chore: test if this works on all dbs

Signed-off-by: blam <ben@blam.sh>
This commit is contained in:
blam
2024-10-24 17:23:47 +02:00
parent 76857dae2e
commit af653034ef
2 changed files with 15 additions and 5 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
---
'@backstage/plugin-catalog-backend': patch
'@backstage/plugin-catalog-backend': minor
---
Added `entity_ref` column to `final_entities` in order to move `refresh_state` away from the read path
@@ -30,10 +30,20 @@ exports.up = async function up(knex) {
);
});
// Set the default entity_ref in final_entities from the refresh_state table
await knex.raw(
`UPDATE final_entities SET entity_ref = refresh_state.entity_ref FROM refresh_state WHERE refresh_state.entity_id = final_entities.entity_id`,
);
// // Set the default entity_ref in final_entities from the table
// await knex.raw(
// `UPDATE final_entities SET entity_ref = refresh_state.entity_ref FROM refresh_state WHERE refresh_state.entity_id = final_entities.entity_id`,
// );
// 2
await knex
.update({
entity_ref: knex
.select('r.entity_ref')
.from('refresh_state as r')
.where('r.entity_id', knex.raw('f.entity_id')),
})
.table('final_entities as f');
};
/**