From 508c3ad38c6e3bd5a8bafeeaf3a7f7ff1f92a5e8 Mon Sep 17 00:00:00 2001 From: Johan Haals Date: Thu, 20 May 2021 10:06:59 +0200 Subject: [PATCH 1/2] Catalog/next: Drop bootstrap from locations table Signed-off-by: Johan Haals --- .../migrationsv2/20210302150147_refresh_state.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/plugins/catalog-backend/migrationsv2/20210302150147_refresh_state.js b/plugins/catalog-backend/migrationsv2/20210302150147_refresh_state.js index 4c03405910..23bcd7c69f 100644 --- a/plugins/catalog-backend/migrationsv2/20210302150147_refresh_state.js +++ b/plugins/catalog-backend/migrationsv2/20210302150147_refresh_state.js @@ -185,6 +185,11 @@ exports.up = async function up(knex) { table.index(['key'], 'search_key_idx'); table.index(['value'], 'search_value_idx'); }); + + // Delete bootstrap location which is no longer required. + await knex.schema.raw( + `DELETE from locations WHERE type = 'bootstrap' AND target = 'bootstrap'`, + ); }; /** From d349a319095300e8e591ff66ad8019fb250495d8 Mon Sep 17 00:00:00 2001 From: Johan Haals Date: Thu, 20 May 2021 13:25:55 +0200 Subject: [PATCH 2/2] Replace knex.schema with knex Signed-off-by: Johan Haals --- .../migrationsv2/20210302150147_refresh_state.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/catalog-backend/migrationsv2/20210302150147_refresh_state.js b/plugins/catalog-backend/migrationsv2/20210302150147_refresh_state.js index 23bcd7c69f..57ae9a2d8a 100644 --- a/plugins/catalog-backend/migrationsv2/20210302150147_refresh_state.js +++ b/plugins/catalog-backend/migrationsv2/20210302150147_refresh_state.js @@ -187,9 +187,9 @@ exports.up = async function up(knex) { }); // Delete bootstrap location which is no longer required. - await knex.schema.raw( - `DELETE from locations WHERE type = 'bootstrap' AND target = 'bootstrap'`, - ); + await knex('locations') + .where({ type: 'bootstrap', target: 'bootstrap' }) + .delete(); }; /**