diff --git a/migrations/20231113151937_giveCountersIds.js b/migrations/20231113151937_giveCountersIds.js index a1424e2..6161b0e 100644 --- a/migrations/20231113151937_giveCountersIds.js +++ b/migrations/20231113151937_giveCountersIds.js @@ -19,12 +19,12 @@ exports.up = async function(knex) { // awfulllllllllllllll const rows = await knex('counters').select('*'); - await knex('counters_').insert(rows); + if (rows.length > 0) await knex('counters_').insert(rows); await knex.schema .dropTable('counters') .renameTable('counters_', 'counters'); - + await knex.schema .alterTable('counterUserLink', table => { table.integer('id').references('id').inTable('counters');