fix prefix

This commit is contained in:
xxj
2021-01-15 17:05:20 +08:00
parent 968898a767
commit 04a1abaed7
2 changed files with 5 additions and 19 deletions

View File

@@ -158,8 +158,8 @@ func (m *mysqlModel) getTableElement(orm *mysqldb.MySqlDB, tab string) (el []mod
if v.NonUnique == 0 { // primary or unique
if strings.EqualFold(v.KeyName, "PRIMARY") { // PRI Set primary key.设置主键
tmp.Index = append(tmp.Index, model.KList{
Key: model.ColumnsKeyPrimary,
Multi: (keyNameCount[v.KeyName] > 1),
Key: model.ColumnsKeyPrimary,
Multi: (keyNameCount[v.KeyName] > 1),
KeyType: v.IndexType,
})
} else { // unique
@@ -218,11 +218,6 @@ func (m *mysqlModel) getTables(orm *mysqldb.MySqlDB) map[string]string {
for rows.Next() {
var table string
rows.Scan(&table)
tablePrefix := config.GetTablePrefix()
if tablePrefix != "" && !strings.Contains(table, tablePrefix) {
// 不包含前缀则跳过
continue
}
tables = append(tables, table)
tbDesc[table] = ""
}