Fix index name parsing in SQLite dialect (#1737)
Fix index name parsing in SQLite dialect If index is created with statement like CREATE INDEX "IDX_tbl_field" ON "tbl" (field), the dialect will parse index name as "IDX_tbl_field" and recognize it as an irregular index. Co-authored-by: David Dai <stdioa@163.com> Reviewed-on: https://gitea.com/xorm/xorm/pulls/1737
This commit is contained in:
parent
56881e64a9
commit
be7800fc63
|
@ -483,7 +483,7 @@ func (db *sqlite3) GetIndexes(queryer core.Queryer, ctx context.Context, tableNa
|
|||
continue
|
||||
}
|
||||
|
||||
indexName := strings.Trim(sql[nNStart+6:nNEnd], "` []")
|
||||
indexName := strings.Trim(sql[nNStart+6:nNEnd], "` []'\"")
|
||||
var isRegular bool
|
||||
if strings.HasPrefix(indexName, "IDX_"+tableName) || strings.HasPrefix(indexName, "UQE_"+tableName) {
|
||||
index.Name = indexName[5+len(tableName):]
|
||||
|
|
Loading…
Reference in New Issue