From d08bdc5a59ccd57d2bfb8f4208b22cec9d98f169 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=A2=81=E5=B8=86?= Date: Tue, 7 May 2019 14:10:52 +0800 Subject: [PATCH 1/2] fix compatibility #1292 --- dialect_postgres.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dialect_postgres.go b/dialect_postgres.go index d6f403684..5487be0c4 100644 --- a/dialect_postgres.go +++ b/dialect_postgres.go @@ -1131,7 +1131,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("primary") { continue } if strings.HasPrefix(indexdef, "CREATE UNIQUE INDEX") { From 65e9ff78fbd23528a9fd52da9d9fe1d13f105fac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=A2=81=E5=B8=86?= Date: Tue, 7 May 2019 14:44:59 +0800 Subject: [PATCH 2/2] fix compatibility #1292 --- dialect_postgres.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dialect_postgres.go b/dialect_postgres.go index 5487be0c4..97aa295b0 100644 --- a/dialect_postgres.go +++ b/dialect_postgres.go @@ -1131,7 +1131,7 @@ func (db *postgres) GetIndexes(tableName string) (map[string]*core.Index, error) return nil, err } indexName = strings.Trim(indexName, `" `) - if strings.HasSuffix(indexName, "_pkey") || strings.HasSuffix("primary") { + if strings.HasSuffix(indexName, "_pkey") || strings.HasSuffix(indexName, "primary") { continue } if strings.HasPrefix(indexdef, "CREATE UNIQUE INDEX") {