Changed all tables names to lowercase
diff --git a/apidAnalytics_suite_test.go b/apidAnalytics_suite_test.go
index 8c979cb..d2d97e6 100644
--- a/apidAnalytics_suite_test.go
+++ b/apidAnalytics_suite_test.go
@@ -217,7 +217,7 @@
txn, err := db.Begin()
Expect(err).ShouldNot(HaveOccurred())
- txn.Exec("INSERT INTO kms_APP_CREDENTIAL_APIPRODUCT_MAPPER (tenant_id,"+
+ txn.Exec("INSERT INTO kms_app_credential_apiproduct_mapper (tenant_id,"+
" appcred_id, app_id, apiprdt_id, status, _change_selector) "+
"VALUES"+
"($1,$2,$3,$4,$5,$6)",
@@ -229,7 +229,7 @@
"12345",
)
- txn.Exec("INSERT INTO kms_APP (id, tenant_id, name, developer_id) "+
+ txn.Exec("INSERT INTO kms_app (id, tenant_id, name, developer_id) "+
"VALUES"+
"($1,$2,$3,$4)",
"testappid",
@@ -238,7 +238,7 @@
"testdeveloperid",
)
- txn.Exec("INSERT INTO kms_API_PRODUCT (id, tenant_id, name) "+
+ txn.Exec("INSERT INTO kms_api_product (id, tenant_id, name) "+
"VALUES"+
"($1,$2,$3)",
"testproductid",
@@ -246,7 +246,7 @@
"testproduct",
)
- txn.Exec("INSERT INTO kms_DEVELOPER (id, tenant_id, username, email) "+
+ txn.Exec("INSERT INTO kms_developer (id, tenant_id, username, email) "+
"VALUES"+
"($1,$2,$3,$4)",
"testdeveloperid",
@@ -255,7 +255,7 @@
"testdeveloper@test.com",
)
- txn.Exec("INSERT INTO edgex_DATA_SCOPE (id, _change_selector, "+
+ txn.Exec("INSERT INTO edgex_data_scope (id, _change_selector, "+
"apid_cluster_id, scope, org, env) "+
"VALUES"+
"($1,$2,$3,$4,$5,$6)",
diff --git a/common_helper.go b/common_helper.go
index 803c649..b8a2696 100644
--- a/common_helper.go
+++ b/common_helper.go
@@ -135,7 +135,7 @@
var org, env, tenantId string
db := getDB()
- error := db.QueryRow("SELECT env, org, scope FROM edgex_DATA_SCOPE"+
+ error := db.QueryRow("SELECT env, org, scope FROM edgex_data_scope"+
" where id = ?", scopeuuid).Scan(&env, &org, &tenantId)
switch {
@@ -165,10 +165,10 @@
db := getDB()
sSql := "SELECT ap.name, a.name, d.username, d.email " +
- "FROM kms_APP_CREDENTIAL_APIPRODUCT_MAPPER as mp " +
- "INNER JOIN kms_API_PRODUCT as ap ON ap.id = mp.apiprdt_id " +
- "INNER JOIN kms_APP AS a ON a.id = mp.app_id " +
- "INNER JOIN kms_DEVELOPER as d ON d.id = a.developer_id " +
+ "FROM kms_app_credential_apiproduct_mapper as mp " +
+ "INNER JOIN kms_api_product as ap ON ap.id = mp.apiprdt_id " +
+ "INNER JOIN kms_app AS a ON a.id = mp.app_id " +
+ "INNER JOIN kms_developer as d ON d.id = a.developer_id " +
"where mp.tenant_id = ? and mp.appcred_id = ?;"
error := db.QueryRow(sSql, tenantId, apiKey).
Scan(&apiProduct, &developerApp,
diff --git a/listener_test.go b/listener_test.go
index d9918e6..b14fd9f 100644
--- a/listener_test.go
+++ b/listener_test.go
@@ -86,7 +86,7 @@
It("insert/delete event should add/remove to/from cache if usecaching is true", func() {
txn, err := getDB().Begin()
Expect(err).ShouldNot(HaveOccurred())
- txn.Exec("INSERT INTO edgex_DATA_SCOPE (id, _change_selector, apid_cluster_id, scope, org, env) "+
+ txn.Exec("INSERT INTO edgex_data_scope (id, _change_selector, apid_cluster_id, scope, org, env) "+
"VALUES"+
"($1,$2,$3,$4,$5,$6)",
"i2",
@@ -128,7 +128,7 @@
txn, err = getDB().Begin()
Expect(err).ShouldNot(HaveOccurred())
- txn.Exec("DELETE FROM edgex_DATA_SCOPE where id = 'i2'")
+ txn.Exec("DELETE FROM edgex_data_scope where id = 'i2'")
txn.Commit()
delete := common.ChangeList{