This PR might be a bit too specific to to our needs but we thought we'd contribute it if people are interested or if you think it could be useful to others.
We ran into a production bug where we accidentally deleted too much data because of a missing where clause on a DELETE statement. So we decided we wanted better logging of migrations in two ways:
See how many rows were affected by each statement similar to running the migration file through psql -f migration.sql
Be able to annotate the migrations with how many rows we expected to be changed.
This PR might be a bit too specific to to our needs but we thought we'd contribute it if people are interested or if you think it could be useful to others.
We ran into a production bug where we accidentally deleted too much data because of a missing where clause on a
DELETE
statement. So we decided we wanted better logging of migrations in two ways:psql -f migration.sql
An example