fix: correct table name from 'services' to 'hermes_services' in all SQL and definitions
This commit is contained in:
parent
9396aaed21
commit
ff5f42b4fa
@ -16,14 +16,14 @@ from datetime import datetime
|
|||||||
# - logined_userorgid param in CRUD definition enables framework-level org filtering
|
# - logined_userorgid param in CRUD definition enables framework-level org filtering
|
||||||
SERVICES_CRUD = {
|
SERVICES_CRUD = {
|
||||||
"module": "hermes-web-cli",
|
"module": "hermes-web-cli",
|
||||||
"table": "services",
|
"table": "hermes_services",
|
||||||
"operations": {
|
"operations": {
|
||||||
"create": {
|
"create": {
|
||||||
"name": "create_service_record",
|
"name": "create_service_record",
|
||||||
"description": "Create a new service record for the current organization",
|
"description": "Create a new service record for the current organization",
|
||||||
"parameters": ["orgid", "name", "service_url", "description", "apikey"],
|
"parameters": ["orgid", "name", "service_url", "description", "apikey"],
|
||||||
"sql_template": """
|
"sql_template": """
|
||||||
INSERT INTO services (id, orgid, name, service_url, description, apikey, status, created_at, updated_at)
|
INSERT INTO hermes_services (id, orgid, name, service_url, description, apikey, status, created_at, updated_at)
|
||||||
VALUES (${id}$, ${orgid}$, ${name}$, ${service_url}$, ${description}$, ${apikey}$, ${status}$, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP)
|
VALUES (${id}$, ${orgid}$, ${name}$, ${service_url}$, ${description}$, ${apikey}$, ${status}$, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP)
|
||||||
""",
|
""",
|
||||||
"return_fields": ["id"]
|
"return_fields": ["id"]
|
||||||
@ -35,7 +35,7 @@ SERVICES_CRUD = {
|
|||||||
"sql_template": """
|
"sql_template": """
|
||||||
SELECT id, orgid, name, service_url, description, apikey, status,
|
SELECT id, orgid, name, service_url, description, apikey, status,
|
||||||
created_at, updated_at
|
created_at, updated_at
|
||||||
FROM services
|
FROM hermes_services
|
||||||
WHERE orgid = ${orgid}$
|
WHERE orgid = ${orgid}$
|
||||||
ORDER BY created_at DESC
|
ORDER BY created_at DESC
|
||||||
""",
|
""",
|
||||||
@ -48,7 +48,7 @@ SERVICES_CRUD = {
|
|||||||
"sql_template": """
|
"sql_template": """
|
||||||
SELECT id, orgid, name, service_url, description, apikey, status,
|
SELECT id, orgid, name, service_url, description, apikey, status,
|
||||||
created_at, updated_at
|
created_at, updated_at
|
||||||
FROM services
|
FROM hermes_services
|
||||||
WHERE id = ${service_id}$ AND orgid = ${orgid}$
|
WHERE id = ${service_id}$ AND orgid = ${orgid}$
|
||||||
""",
|
""",
|
||||||
"return_fields": ["id", "orgid", "name", "service_url", "description", "apikey", "status", "created_at", "updated_at"]
|
"return_fields": ["id", "orgid", "name", "service_url", "description", "apikey", "status", "created_at", "updated_at"]
|
||||||
@ -58,7 +58,7 @@ SERVICES_CRUD = {
|
|||||||
"description": "Update an existing service record",
|
"description": "Update an existing service record",
|
||||||
"parameters": ["service_id", "orgid", "name", "service_url", "description", "apikey", "status"],
|
"parameters": ["service_id", "orgid", "name", "service_url", "description", "apikey", "status"],
|
||||||
"sql_template": """
|
"sql_template": """
|
||||||
UPDATE services
|
UPDATE hermes_services
|
||||||
SET name = ${name}$,
|
SET name = ${name}$,
|
||||||
service_url = ${service_url}$,
|
service_url = ${service_url}$,
|
||||||
description = ${description}$,
|
description = ${description}$,
|
||||||
@ -74,7 +74,7 @@ SERVICES_CRUD = {
|
|||||||
"description": "Delete a service record for the current organization",
|
"description": "Delete a service record for the current organization",
|
||||||
"parameters": ["service_id", "orgid"],
|
"parameters": ["service_id", "orgid"],
|
||||||
"sql_template": """
|
"sql_template": """
|
||||||
DELETE FROM services
|
DELETE FROM hermes_services
|
||||||
WHERE id = ${service_id}$ AND orgid = ${orgid}$
|
WHERE id = ${service_id}$ AND orgid = ${orgid}$
|
||||||
""",
|
""",
|
||||||
"return_fields": []
|
"return_fields": []
|
||||||
|
|||||||
@ -6,7 +6,7 @@ Follows database-table-definition-spec: summary/fields/indexes/codes four-sectio
|
|||||||
# Services table definition
|
# Services table definition
|
||||||
SERVICES_TABLE = {
|
SERVICES_TABLE = {
|
||||||
"summary": {
|
"summary": {
|
||||||
"name": "services",
|
"name": "hermes_services",
|
||||||
"description": "Stores Hermes service configurations for each organization",
|
"description": "Stores Hermes service configurations for each organization",
|
||||||
"module": "hermes-web-cli"
|
"module": "hermes-web-cli"
|
||||||
},
|
},
|
||||||
|
|||||||
@ -240,7 +240,7 @@ async def test_service_connection(service_id: str, orgid: str = "") -> Tuple[boo
|
|||||||
recs = await sor.sqlExe("""
|
recs = await sor.sqlExe("""
|
||||||
SELECT id, orgid, name, service_url, description, apikey, status,
|
SELECT id, orgid, name, service_url, description, apikey, status,
|
||||||
created_at, updated_at
|
created_at, updated_at
|
||||||
FROM services
|
FROM hermes_services
|
||||||
WHERE id = ${service_id}$
|
WHERE id = ${service_id}$
|
||||||
""", {
|
""", {
|
||||||
'service_id': service_id
|
'service_id': service_id
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user