From 10525fd0e21ec71402e23e7eb176a07be0b1bde5 Mon Sep 17 00:00:00 2001 From: "dino.ma" Date: Thu, 11 Nov 2021 23:29:37 +0800 Subject: [PATCH] fix(migrator/migrator.go):remove var sql --- migrator/migrator.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/migrator/migrator.go b/migrator/migrator.go index 7b743414..95a708de 100644 --- a/migrator/migrator.go +++ b/migrator/migrator.go @@ -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 {