b33f8450b5
Five migration down functions were broken, causing the SQL report to flag
them as not reversible. All issues were pre-existing bugs that were never
caught because the down migrations had never been exercised under the
reversibility checker.
- 20241003170511: add .notNullable() to both up and down when altering
locations.target, preventing the NOT NULL constraint from being silently
dropped by knex's .alter() when widening varchar(255) to text.
- 20220116144621: implement a real down function that recreates the three
dropped legacy tables (entities, entities_search, entities_relations)
with correct columns and indices.
- 20210302150147: drop dependent tables in the correct order to avoid a
FK constraint violation, and fix a typo (references → refresh_state_references).
- 20201005122705: drop full_name from entities (not entities_search), and
restore entities_unique_name with the correct column order (kind, name, namespace).
- 20200702153613: use table.integer('generation') instead of table.string()
in the down function to restore the correct column type.
Signed-off-by: Fredrik Adelöw <freben@spotify.com>
Made-with: Cursor
1.3 KiB
1.3 KiB
@backstage/plugin-catalog-backend
| @backstage/plugin-catalog-backend |
|---|
| patch |
Fixed several database migration down functions that were not properly reversible, causing the SQL report to show warnings:
20241003170511_alter_target_in_locations.js: bothupanddownnow include.notNullable()when altering thelocations.targetcolumn, preventing theNOT NULLconstraint from being accidentally dropped when widening the column type fromvarchar(255)totext.20220116144621_remove_legacy.js: thedownfunction now properly recreates the three dropped legacy tables (entities,entities_search,entities_relations) with correct columns and indices.20210302150147_refresh_state.js: thedownfunction now drops dependent tables in the correct order (avoiding a FK constraint violation) and fixes a typo where the table was referred to asreferencesinstead ofrefresh_state_references.20201005122705_add_entity_full_name.js: thedownfunction now drops thefull_namecolumn fromentities(notentities_search), and restores theentities_unique_nameindex with the correct column order(kind, name, namespace).20200702153613_entities.js: thedownfunction now usestable.integer('generation')instead oftable.string('generation'), restoring the correct column type.