Skip to content

Commit

Permalink
fixbug-postsql
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangming committed Jul 29, 2023
1 parent 6b40d42 commit 5766330
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 12 additions & 0 deletions store/postgresql/scripts/polaris_server.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion store/postgresql/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down

0 comments on commit 5766330

Please # to comment.