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