combine-alter-table
Combine compatible adjacent ALTER TABLE actions.
Why
Repeating ALTER TABLE for compatible changes to one relation obscures a single schema operation and adds avoidable statements. PostgreSQL supports comma-separated subcommands, including multiple drops.
Fix
Combine the reported adjacent statements into one ALTER TABLE with comma-separated actions, preserving their order, guards, table modifiers, and drop behavior. Keep deployment checkpoints and operations whose ordering, expression evaluation, or lock contracts differ in separate statements.
Examples
ALTER TABLECALLDROP CONSTRAINT IF EXISTS call_scenario_version_fkey;
ALTER TABLECALLDROP COLUMN IF EXISTS scenario_version_id;ALTER TABLECALLDROP CONSTRAINT IF EXISTS call_scenario_version_fkey,DROP COLUMN IF EXISTS scenario_version_id;