diff --git a/plugins/catalog-backend/migrations/20210302150147_refresh_state.js b/plugins/catalog-backend/migrations/20210302150147_refresh_state.js index 2752ab0176..db66b46305 100644 --- a/plugins/catalog-backend/migrations/20210302150147_refresh_state.js +++ b/plugins/catalog-backend/migrations/20210302150147_refresh_state.js @@ -65,8 +65,6 @@ exports.up = async function up(knex) { .dateTime('last_discovery_at') // TODO: timezone or change to epoch-millis or similar .notNullable() .comment('The last timestamp of which this entity was discovered'); - // TODO: get migrations to work for this field instead. should be removed before merge. - table.text('location_key').nullable().comment('Location key'); table.unique(['entity_ref'], 'refresh_state_entity_ref_uniq'); table.index('entity_id', 'refresh_state_entity_id_idx'); table.index('entity_ref', 'refresh_state_entity_ref_idx'); diff --git a/plugins/catalog-backend/migrations/20210622104022_refresh_state_location_key.js b/plugins/catalog-backend/migrations/20210622104022_refresh_state_location_key.js index b77ff8961c..ca90bf9074 100644 --- a/plugins/catalog-backend/migrations/20210622104022_refresh_state_location_key.js +++ b/plugins/catalog-backend/migrations/20210622104022_refresh_state_location_key.js @@ -21,7 +21,13 @@ */ exports.up = async function up(knex) { await knex.schema.alterTable('refresh_state', table => { - table.text('location_key').nullable().comment('').alter(); + table + .text('location_key') + .nullable() + .comment( + 'An opaque key that uniquely identifies the location of an entity in order to support conflict resolution', + ); + // table.index(['location_key'], 'refresh_state_location_key_idx'); }); }; @@ -31,5 +37,6 @@ exports.up = async function up(knex) { exports.down = async function down(knex) { await knex.schema.alterTable('refresh_state', table => { table.dropColumn('location_key'); + // table.dropIndex([], 'refresh_state_location_key_idx'); }); };