mirror of
https://github.com/grafana/grafana.git
synced 2025-08-02 03:12:13 +08:00
fix only create/drop database indices if not exists/exists
This commit is contained in:
@ -101,9 +101,9 @@ func (db *Postgres) SqlType(c *Column) string {
|
||||
return res
|
||||
}
|
||||
|
||||
func (db *Postgres) TableCheckSql(tableName string) (string, []interface{}) {
|
||||
args := []interface{}{"grafana", tableName}
|
||||
sql := "SELECT table_name FROM information_schema.tables WHERE table_schema=? and table_name=?"
|
||||
func (db *Postgres) IndexCheckSql(tableName, indexName string) (string, []interface{}) {
|
||||
args := []interface{}{tableName, indexName}
|
||||
sql := "SELECT 1 FROM " + db.Quote("pg_indexes") + " WHERE" + db.Quote("tablename") + "=? AND " + db.Quote("indexname") + "=?"
|
||||
return sql, args
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user