bugfix :Oid It's a special index. You can't put it in (#2105)
Co-authored-by: fuge <8342337@qq.com> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Reviewed-on: https://gitea.com/xorm/xorm/pulls/2105 Co-authored-by: fuge <fuge@noreply.gitea.io> Co-committed-by: fuge <fuge@noreply.gitea.io>
This commit is contained in:
parent
7802393d01
commit
3180c418c2
|
@ -1300,6 +1300,19 @@ func (db *postgres) GetIndexes(queryer core.Queryer, ctx context.Context, tableN
|
||||||
indexType = schemas.IndexType
|
indexType = schemas.IndexType
|
||||||
}
|
}
|
||||||
colNames = getIndexColName(indexdef)
|
colNames = getIndexColName(indexdef)
|
||||||
|
|
||||||
|
isSkip := false
|
||||||
|
//Oid It's a special index. You can't put it in
|
||||||
|
for _, element := range colNames {
|
||||||
|
if "oid" == element {
|
||||||
|
isSkip = true
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if isSkip {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
var isRegular bool
|
var isRegular bool
|
||||||
if strings.HasPrefix(indexName, "IDX_"+tableName) || strings.HasPrefix(indexName, "UQE_"+tableName) {
|
if strings.HasPrefix(indexName, "IDX_"+tableName) || strings.HasPrefix(indexName, "UQE_"+tableName) {
|
||||||
newIdxName := indexName[5+len(tableName):]
|
newIdxName := indexName[5+len(tableName):]
|
||||||
|
|
Loading…
Reference in New Issue