From fc73f6aae5f6dddb876a6edf5a88b7e561e7287d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Thu, 26 Jan 2023 12:32:52 +0100 Subject: [PATCH] switch the order of the reprocessing statements in migrations MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- .changeset/modern-cats-worry.md | 5 +++++ .../migrations/20220222164811_reprocess_for_relation_refs.js | 2 +- .../20221109192547_search_add_original_value_column.js | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 .changeset/modern-cats-worry.md diff --git a/.changeset/modern-cats-worry.md b/.changeset/modern-cats-worry.md new file mode 100644 index 0000000000..b6698cb805 --- /dev/null +++ b/.changeset/modern-cats-worry.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-catalog-backend': patch +--- + +Switched the order of reprocessing statements retroactively in migrations. This only improves the experience for those who at a later time perform a large upgrade of an old Backstage installation. diff --git a/plugins/catalog-backend/migrations/20220222164811_reprocess_for_relation_refs.js b/plugins/catalog-backend/migrations/20220222164811_reprocess_for_relation_refs.js index f4be2172a0..0679d5cbdb 100644 --- a/plugins/catalog-backend/migrations/20220222164811_reprocess_for_relation_refs.js +++ b/plugins/catalog-backend/migrations/20220222164811_reprocess_for_relation_refs.js @@ -21,11 +21,11 @@ */ exports.up = async function up(knex) { // Make sure to reprocess everything, to make sure that relations have a targetRef produced + await knex('final_entities').update({ hash: '' }); await knex('refresh_state').update({ result_hash: '', next_update_at: knex.fn.now(), }); - await knex('final_entities').update({ hash: '' }); }; exports.down = async function down() {}; diff --git a/plugins/catalog-backend/migrations/20221109192547_search_add_original_value_column.js b/plugins/catalog-backend/migrations/20221109192547_search_add_original_value_column.js index fff7955530..597006e6f5 100644 --- a/plugins/catalog-backend/migrations/20221109192547_search_add_original_value_column.js +++ b/plugins/catalog-backend/migrations/20221109192547_search_add_original_value_column.js @@ -34,11 +34,11 @@ exports.up = async function up(knex) { // not enough to just reset the final_entities hash, since stitching is driven // only by processing resulting in data that isn't matching the refresh_state // hash. + await knex('final_entities').update({ hash: '' }); await knex('refresh_state').update({ result_hash: '', next_update_at: knex.fn.now(), }); - await knex('final_entities').update({ hash: '' }); }; /**