dukcapil/migrations/000032_add_system_user_and_department.down.sql
2025-09-08 12:24:37 +07:00

20 lines
591 B
PL/PgSQL

BEGIN;
-- Remove system user from department (cascade should handle this, but being explicit)
DELETE FROM user_department
WHERE user_id = '11111111-2222-3333-4444-555555555555'::uuid
AND department_id = '11111111-2222-3333-4444-555555555555'::uuid;
-- Remove system user profile
DELETE FROM user_profiles
WHERE user_id = '11111111-2222-3333-4444-555555555555'::uuid;
-- Remove system user
DELETE FROM users
WHERE id = '11111111-2222-3333-4444-555555555555'::uuid;
-- Remove system department
DELETE FROM departments
WHERE id = '11111111-2222-3333-4444-555555555555'::uuid;
COMMIT;