refactor(migration): remove is_system field update and clean up imports in permission sync

This commit is contained in:
mlogclub
2026-04-23 14:43:59 +08:00
parent 155e9173a7
commit eb353cbbc8
2 changed files with 2 additions and 11 deletions
@@ -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)
})
})
}