对gorm生成的外键表多s问题作出兼容代码
This commit is contained in:
parent
3dea48b54e
commit
d930a9e95a
|
@ -411,10 +411,16 @@ func InitSysDataAuthorityId() (err error) {
|
|||
{"9528", "8881"},
|
||||
{"9528", "9528"},
|
||||
}
|
||||
if global.GVA_DB.Migrator().HasTable("sys_data_authority_ids") {
|
||||
if tx.Table("sys_data_authority_ids").Create(&insert).Error != nil { // 遇到错误时回滚事务
|
||||
tx.Rollback()
|
||||
}
|
||||
return tx.Commit().Error
|
||||
}
|
||||
if tx.Table("sys_data_authority_id").Create(&insert).Error != nil { // 遇到错误时回滚事务
|
||||
tx.Rollback()
|
||||
}
|
||||
return tx.Commit().Error
|
||||
}
|
||||
|
||||
func InitSysDictionaryDetail() (err error) {
|
||||
|
|
Loading…
Reference in New Issue