Fix warning when updating to v3.3.1
parent
adf772f2ff
commit
944c23cd9c
|
@ -13,7 +13,9 @@ exports.up = async function(knex) {
|
||||||
const rows = await knex.table("old_moderator_role_overrides")
|
const rows = await knex.table("old_moderator_role_overrides")
|
||||||
.select();
|
.select();
|
||||||
|
|
||||||
|
if (rows.length) {
|
||||||
await knex.table("moderator_role_overrides").insert(rows);
|
await knex.table("moderator_role_overrides").insert(rows);
|
||||||
|
}
|
||||||
|
|
||||||
await knex.schema.dropTable("old_moderator_role_overrides");
|
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")
|
const rows = await knex.table("new_moderator_role_overrides")
|
||||||
.select();
|
.select();
|
||||||
|
|
||||||
|
if (rows.length) {
|
||||||
await knex.table("moderator_role_overrides").insert(rows.map(r => {
|
await knex.table("moderator_role_overrides").insert(rows.map(r => {
|
||||||
delete r.id;
|
delete r.id;
|
||||||
return r;
|
return r;
|
||||||
}));
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
await knex.schema.dropTable("new_moderator_role_overrides");
|
await knex.schema.dropTable("new_moderator_role_overrides");
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue