fix compatibility #1292
This commit is contained in:
parent
6a1dd59737
commit
3db4835f1b
|
@ -1093,7 +1093,6 @@ func (db *postgres) GetTables() ([]*core.Table, error) {
|
|||
return tables, nil
|
||||
}
|
||||
|
||||
|
||||
func getIndexColName(indexdef string) []string {
|
||||
var colNames []string
|
||||
|
||||
|
@ -1105,7 +1104,6 @@ func getIndexColName(indexdef string) []string {
|
|||
return colNames
|
||||
}
|
||||
|
||||
|
||||
func (db *postgres) GetIndexes(tableName string) (map[string]*core.Index, error) {
|
||||
args := []interface{}{tableName}
|
||||
s := fmt.Sprintf("SELECT indexname, indexdef FROM pg_indexes WHERE tablename=$1")
|
||||
|
@ -1131,7 +1129,7 @@ func (db *postgres) GetIndexes(tableName string) (map[string]*core.Index, error)
|
|||
return nil, err
|
||||
}
|
||||
indexName = strings.Trim(indexName, `" `)
|
||||
if strings.HasSuffix(indexName, "_pkey") {
|
||||
if strings.HasSuffix(indexName, "_pkey") || strings.HasSuffix(indexName, "primary") {
|
||||
continue
|
||||
}
|
||||
if strings.HasPrefix(indexdef, "CREATE UNIQUE INDEX") {
|
||||
|
|
Loading…
Reference in New Issue