From 112bfee1c46a183beb4942f3a459aacf33d77d09 Mon Sep 17 00:00:00 2001
From: chenshijun <csj_sky@126.com>
Date: 星期五, 06 九月 2019 17:46:54 +0800
Subject: [PATCH] 服务器只能到服务器去拉取数据
---
dbself.go | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/dbself.go b/dbself.go
index 9755dfa..f05cc24 100644
--- a/dbself.go
+++ b/dbself.go
@@ -13,6 +13,8 @@
const (
PersonSqliteDBPath = "~/workspace/gitblit/dbserver/config/testdb.db"
+ DbT_TableName = "dbtables"
+ DBP_TableName = "dbtablepersons"
)
var syncMut sync.Mutex
@@ -164,12 +166,12 @@
for _,col :=range tDescArr {
columnNames = append(columnNames, fmt.Sprintf(`'||quote("%s")||'`, col.Name))
}
- if table == "dbTables" {
+ if table == DbT_TableName {
tSql = fmt.Sprintf(`SELECT 'INSERT INTO "%s" VALUES(%s)' as sql FROM "%s" where (analyServerId='' or analyServerId is NULL);`,
table,
strings.Join(columnNames, ","),
table)
- } else if table == "dbtablepersons" {
+ } else if table == DBP_TableName {
tSql = fmt.Sprintf(`SELECT 'INSERT INTO "%s" VALUES(%s)' as sql FROM "%s" where tableId in (select id from dbTables where (analyServerId='' or analyServerId is NULL));`,
table,
strings.Join(columnNames, ","),
--
Gitblit v1.8.0