From 5766330f9ab7b1f48459a11b6613e842dd981578 Mon Sep 17 00:00:00 2001 From: zhangming Date: Sat, 29 Jul 2023 21:31:52 +0800 Subject: [PATCH] fixbug-postsql --- store/postgresql/scripts/polaris_server.sql | 12 ++++++++++++ store/postgresql/service.go | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/store/postgresql/scripts/polaris_server.sql b/store/postgresql/scripts/polaris_server.sql index 690ff98..d6d6af2 100644 --- a/store/postgresql/scripts/polaris_server.sql +++ b/store/postgresql/scripts/polaris_server.sql @@ -919,23 +919,35 @@ BEGIN; INSERT INTO "public"."service" ("id", "name", "namespace", + "ports", "comment", "business", + "department", + "cmdb_mod1", + "cmdb_mod2", + "cmdb_mod3", "token", "revision", "owner", "flag", + "reference", "ctime", "mtime") VALUES ('fbca9bfa04ae4ead86e1ecf5811e32a9', 'polaris.checker', 'Polaris', + '0', 'polaris checker service', 'polaris', + 'polaris department', + 'polaris cmdb_mod1', + 'polaris cmdb_mod2', + 'polaris cmdb_mod3', '7d19c46de327408d8709ee7392b7700b', '301b1e9f0bbd47a6b697e26e99dfe012', 'polaris', 0, + 'polaris reference', '2021-09-06 07:55:07', '2021-09-06 07:55:09'); COMMIT; diff --git a/store/postgresql/service.go b/store/postgresql/service.go index f09e31f..438cdf4 100644 --- a/store/postgresql/service.go +++ b/store/postgresql/service.go @@ -703,7 +703,7 @@ func (ss *serviceStore) getServiceMain(name string, namespace string) (*model.Se // getServiceByID 根据服务ID获取服务详情的内部函数 func (ss *serviceStore) getServiceByID(serviceID string) (*model.Service, error) { - str := genServiceSelectSQL() + " from service where service.id = $1" + str := genServiceSelectSQL() + " from \"service\" where service.id = $1" rows, err := ss.master.Query(str, serviceID) if err != nil { log.Errorf("[Store][database] get service by id query err: %s", err.Error())