Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

fix: delete all SYSTEM_BOT principals in migration, not just [email protected] (#19198)

boojack02ef5e32c73e
diff --git a/backend/migrator/migration/3.15/0006##remove_system_bot.sql b/backend/migrator/migration/3.15/0006##remove_system_bot.sql
index 078e94e654..9ed22a9dee 100644
--- a/backend/migrator/migration/3.15/0006##remove_system_bot.sql
+++ b/backend/migrator/migration/3.15/0006##remove_system_bot.sql
@@ -38,8 +38,8 @@ BEGIN
UPDATE release SET creator = fallback_user WHERE creator = '[email protected]';
END $$;
--- Delete the SystemBot principal row
-DELETE FROM principal WHERE id = 1 AND email = '[email protected]';
+-- Delete all SYSTEM_BOT principal rows ([email protected] and allUsers)
+DELETE FROM principal WHERE type = 'SYSTEM_BOT';
-- Remove SYSTEM_BOT from principal type constraint
ALTER TABLE principal DROP CONSTRAINT principal_type_check;