refactor(migration): remove is_system field update and clean up imports in permission sync
This commit is contained in:
@@ -224,7 +224,6 @@ func ensureBootstrapAdmin(tx *gorm.DB, superAdminRole *models.Role) error {
|
||||
if err := repositories.UserRepository.Updates(tx, user.ID, map[string]any{
|
||||
"nickname": nickname,
|
||||
"status": enums.StatusOk,
|
||||
"is_system": true,
|
||||
"update_user_id": constants.SystemAuditUserID,
|
||||
"update_user_name": constants.SystemAuditUserName,
|
||||
"updated_at": now,
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
package migration
|
||||
|
||||
import (
|
||||
"cs-agent/internal/pkg/constants"
|
||||
|
||||
"github.com/mlogclub/simple/sqls"
|
||||
)
|
||||
import "github.com/mlogclub/simple/sqls"
|
||||
|
||||
func init() {
|
||||
register(4, "sync ai agent permissions", func() error {
|
||||
@@ -19,11 +15,7 @@ func init() {
|
||||
return err
|
||||
}
|
||||
|
||||
if err = ensureRolePermissions(ctx.Tx, roles, permissions); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return ensureBootstrapAdmin(ctx.Tx, roles[constants.RoleCodeSuperAdmin])
|
||||
return ensureRolePermissions(ctx.Tx, roles, permissions)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user