Skip to content

Commit

Permalink
Fix warning when updating to v3.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Dragory committed Mar 31, 2021
1 parent adf772f commit 944c23c
Showing 1 changed file with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -13,7 +13,9 @@ exports.up = async function(knex) {
const rows = await knex.table("old_moderator_role_overrides")
.select();

await knex.table("moderator_role_overrides").insert(rows);
if (rows.length) {
await knex.table("moderator_role_overrides").insert(rows);
}

await knex.schema.dropTable("old_moderator_role_overrides");
};
@@ -32,10 +34,12 @@ exports.down = async function(knex) {
const rows = await knex.table("new_moderator_role_overrides")
.select();

await knex.table("moderator_role_overrides").insert(rows.map(r => {
delete r.id;
return r;
}));
if (rows.length) {
await knex.table("moderator_role_overrides").insert(rows.map(r => {
delete r.id;
return r;
}));
}

await knex.schema.dropTable("new_moderator_role_overrides");
};

0 comments on commit 944c23c

Please sign in to comment.