MP064CRITICALFree
ban-disable-trigger
What It Detects
DISABLE TRIGGER breaks replication, audit logs, and FK enforcement.
Why It's Dangerous
ALTER TABLE DISABLE TRIGGER ALL/USER turns off all triggers on the table. This breaks logical replication (which uses triggers internally), disables audit logging triggers, and bypasses foreign key enforcement. If the session crashes before re-enabling triggers, they remain disabled permanently.
Bad Example
ALTER TABLE users DISABLE TRIGGER ALL;
Good Example
-- Disable only a specific trigger temporarily ALTER TABLE users DISABLE TRIGGER my_audit_trigger; -- ... perform operation ... ALTER TABLE users ENABLE TRIGGER my_audit_trigger;
Configuration
Disable this rule:
# .migrationpilotrc.yml rules: MP064: false
Or change its severity:
# .migrationpilotrc.yml
rules:
MP064:
severity: warning