migrate ✅ 优化migrate
This commit is contained in:
1 parent
e40047a88e
commit
1a111f0666
49 files changed
+677
-202
No files matched your search
@@ -1,13 +1,12 @@
|
||||
package version
|
||||
|
||||
import (
|
||||
"go-admin/app/admin/models/system"
|
||||
|
||||
//"go-admin/app/admin/models"
|
||||
"gorm.io/gorm"
|
||||
"runtime"
|
||||
|
||||
"gorm.io/gorm"
|
||||
|
||||
"go-admin/cmd/migrate/migration"
|
||||
"go-admin/cmd/migrate/migration/models"
|
||||
common "go-admin/common/models"
|
||||
)
|
||||
|
||||
@@ -20,20 +19,20 @@ func _1613697961697Test(db *gorm.DB, version string) error {
|
||||
return db.Transaction(func(tx *gorm.DB) error {
|
||||
|
||||
//修改字段类型
|
||||
err := tx.Migrator().AlterColumn(&system.SysMenu{}, "create_by")
|
||||
err := tx.Migrator().AlterColumn(&models.SysMenu{}, "create_by")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
err = tx.Migrator().AlterColumn(&system.SysMenu{}, "update_by")
|
||||
err = tx.Migrator().AlterColumn(&models.SysMenu{}, "update_by")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
err = tx.Migrator().AlterColumn(&system.SysRole{}, "create_by")
|
||||
err = tx.Migrator().AlterColumn(&models.SysRole{}, "create_by")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
err = tx.Migrator().AlterColumn(&system.SysRole{}, "update_by")
|
||||
err = tx.Migrator().AlterColumn(&models.SysRole{}, "update_by")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user