Files
Enterprise-Knowledge-Base/migrations/versioned/000053_system_admin_and_settings.down.sql
wizardchen 311a033523 refactor(migrations): remove deprecated user system admin migration files and introduce new system settings migration
- Deleted the old migration files for user system admin (000052) as they are no longer needed.
- Added new migration files (000053) to implement system-level administrator flag and a new system settings table, consolidating related changes for improved management of platform-wide settings.
- Ensured that the new migrations include proper rollback procedures for both the system admin flag and the system settings table.
2026-05-26 21:13:56 +08:00

14 lines
482 B
SQL

-- Rollback: drop system_settings table and users.is_system_admin column
DO $$ BEGIN RAISE NOTICE '[Migration 000053 DOWN] Dropping table: system_settings'; END $$;
DROP TABLE IF EXISTS system_settings CASCADE;
DO $$ BEGIN RAISE NOTICE '[Migration 000053 DOWN] Dropping users.is_system_admin...'; END $$;
DROP INDEX IF EXISTS idx_users_is_system_admin;
ALTER TABLE users DROP COLUMN IF EXISTS is_system_admin;
DO $$ BEGIN RAISE NOTICE '[Migration 000053 DOWN] Done.'; END $$;