feat:add CustomMigrate
This commit is contained in:
1 parent
4ce39764bc
commit
58999ef1a4
1 file changed
+8
@@ -8,6 +8,7 @@ import (
|
|||||||
|
|
||||||
func AutoMigrate(db *gorm.DB) error {
|
func AutoMigrate(db *gorm.DB) error {
|
||||||
db.SingularTable(true)
|
db.SingularTable(true)
|
||||||
|
|
||||||
return db.AutoMigrate(
|
return db.AutoMigrate(
|
||||||
new(models.CasbinRule),
|
new(models.CasbinRule),
|
||||||
new(tools.SysTables),
|
new(tools.SysTables),
|
||||||
@@ -26,3 +27,10 @@ func AutoMigrate(db *gorm.DB) error {
|
|||||||
new(models.DictType),
|
new(models.DictType),
|
||||||
).Error
|
).Error
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
func CustomMigrate(db *gorm.DB,table interface{}) error {
|
||||||
|
db.SingularTable(true)
|
||||||
|
return db.AutoMigrate(&table).Error
|
||||||
|
}
|
||||||
|
|
||||||
Reference in new issue
Block a user