-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(orga): updated migration after review
- Loading branch information
1 parent
39be451
commit e0d8849
Showing
1 changed file
with
22 additions
and
0 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
api/db/migrations/20241218140743_create-campaignparticipationid-column-in-ke-snaphots.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
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() | ||
.references('campaign-participations.id') | ||
.index() | ||
.comment('Added this column as part of the anonymization process'); | ||
}); | ||
}; | ||
|
||
const down = async function (knex) { | ||
await knex.schema.alterTable(TABLE_NAME, function (table) { | ||
table.dropColumn(COLUMN_NAME); | ||
}); | ||
}; | ||
|
||
export { down, up }; |