message: fix(catalog-backend): update migration to delete dependent view first
diff: */
  exports.up = function up(knex) {
  return knex.schema
  + .raw('DROP VIEW location_update_log_latest;')
  .dropTable('location_update_log')
  .createTable('location_update_log', table => {
  table.bigIncrements('id').primary(); // instead of uuid, so we can MAX it
  @@ -35,8 +36,6 @@ exports.up = function up(knex) {
  .onDelete('CASCADE');
  table.string('entity_name').nullable();
  }).raw(`
  - DROP VIEW location_update_log_latest;
  - `).raw(`
  CREATE VIEW location_update_log_latest AS
  SELECT t1.* FROM location_update_log t1
  JOIN
  @@ -56,9 +55,22 @@ exports.up = function up(knex) {
  * @param {import('knex')} knex
  */
  exports.down = function down(knex) {
  - return knex.schema.raw(`
  - DROP VIEW location_update_log_latest;
  - `).raw(`
  + return knex.schema
  + .raw('DROP VIEW location_update_log_latest;')
  + .dropTable('location_update_log')
  + .createTable('location_update_log', table => {
  + table.uuid('id').primary();
  + table.enum('status', ['success', 'fail']).notNullable();
  + table.dateTime('created_at').defaultTo(knex.fn.now()).notNullable();
  + table.string('message');
  + table
  + .uuid('location_id')
  + .references('id')
  + .inTable('locations')
  + .onUpdate('CASCADE')
  + .onDelete('CASCADE');
  + table.string('entity_name').nullable();
  + }).raw(`
  CREATE VIEW location_update_log_latest AS
  SELECT t1.* FROM location_update_log t1
  JOIN
  