Skip to content

Commit

Permalink
feat(orga): migration to create a column campaign participations id i…
Browse files Browse the repository at this point in the history
…n ke snapshots
  • Loading branch information
alicegoarnisson committed Dec 18, 2024
1 parent 8a5435c commit 755299c
Showing 1 changed file with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
const TABLE_NAME = 'knowledge-element-snapshots';
const COLUMN_NAME = 'campaignParticipationId';

const up = async function (knex) {
await knex.schema.alterTable(TABLE_NAME, function (table) {
table.integer(COLUMN_NAME).unsigned().nullable();

table.foreign(COLUMN_NAME).references('id').inTable('campaign-participations');
});
};

const down = async function (knex) {
await knex.schema.alterTable(TABLE_NAME, function (table) {
table.dropForeign(COLUMN_NAME);
table.dropColumn(COLUMN_NAME);
});
};

export { down, up };

0 comments on commit 755299c

Please sign in to comment.