fix(migrator/migrator.go):remove var sql

This commit is contained in:
dino.ma 2021-11-11 23:29:37 +08:00
parent 441dc26e43
commit 10525fd0e2

View File

@ -156,8 +156,7 @@ func (m Migrator) AutoMigrate(values ...interface{}) error {
}
func (m Migrator) GetTables() (tableList []string, err error) {
sql := "SELECT TABLE_NAME FROM information_schema.tables where TABLE_SCHEMA=?"
return tableList, m.DB.Raw(sql, m.CurrentDatabase()).Scan(&tableList).Error
return tableList, m.DB.Raw("SELECT TABLE_NAME FROM information_schema.tables where TABLE_SCHEMA=?", m.CurrentDatabase()).Scan(&tableList).Error
}
func (m Migrator) CreateTable(values ...interface{}) error {