Skip to content

Commit

Permalink
fix: update the migration script
Browse files Browse the repository at this point in the history
  • Loading branch information
boazpoolman committed Dec 20, 2023
1 parent 5962387 commit 084d8e3
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions migrations/2023.06.12T00.00.00.url-alias-to-webtools.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,17 @@
module.exports = {
async up(knex) {
// Rename the url_paths table.
await knex.schema.renameTable('url_paths', 'wt_url_alias');
knex.schema.hasTable('url_paths').then((exists) => {
if (!exists) {
knex.schema.renameTable('url_paths', 'wt_url_alias');
}
});

// Rename the url_patterns table.
await knex.schema.renameTable('url_patterns', 'wt_url_patterns');
knex.schema.hasTable('url_patterns').then((exists) => {
if (!exists) {
knex.schema.renameTable('url_patterns', 'wt_url_patterns');
}
});
},
};

0 comments on commit 084d8e3

Please sign in to comment.