fix: roles model

This commit is contained in:
Lakhan Samani
2021-10-04 13:58:03 +05:30
parent e429a1f860
commit b1b7f47f4c
2 changed files with 2 additions and 5 deletions

View File

@@ -23,8 +23,7 @@ func (r *Role) BeforeCreate(tx *gorm.DB) (err error) {
func (mgr *manager) SaveRoles(roles []Role) error {
res := mgr.db.Clauses(
clause.OnConflict{
OnConstraint: "authorizer_roles_role_key",
DoNothing: true,
DoNothing: true,
}).Create(&roles)
if res.Error != nil {
log.Println(`Error saving roles`)