FRN704[medium]History
Down migration doesn't undo the change
Running the down migrations after this pull request's migrations failed, or left the schema different from before.
Why it's risky in PostgreSQL
Fronelta runs the new migrations, then their down migrations in reverse order, and compares the schema with what it was before. A rollback that fails or leaves objects behind won't help when you need it during an incident.
The check runs on the seeded verification database, so a down migration that only fails on real data can still pass here.
What triggers it, and the safer way
-- 0060_tags.up.sql
CREATE TABLE tags (id bigint PRIMARY KEY);
CREATE INDEX tags_id_idx ON tags (id);
-- 0060_tags.down.sql
DROP INDEX tags_id_idx; -- the table is left behind-- 0060_tags.down.sql
DROP TABLE tags;Suppress it when you're sure
Put this comment on the line before the statement. The reason is required and shows in the report.
-- fronelta:allow FRN704 <why this is safe here>Applies to PostgreSQL 14, 15, 16, 17.