Skip to content

Commit

Permalink
[FEATURE] Permettre d'avoir un campaignParticipationId NULL dans …
Browse files Browse the repository at this point in the history
…`user-recommended-trainings` (PIX-15303)

 #10585
  • Loading branch information
pix-service-auto-merge authored Nov 21, 2024
2 parents dbd0855 + 46e3887 commit 69e89f1
Showing 1 changed file with 25 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// Make sure you properly test your migration, especially DDL (Data Definition Language)
// ! If the target table is large, and the migration take more than 20 minutes, the deployment will fail !

// You can design and test your migration to avoid this by following this guide
// https://1024pix.atlassian.net/wiki/spaces/EDTDT/pages/3849323922/Cr+er+une+migration

// If your migrations target `answers` or `knowledge-elements`
// contact @team-captains, because automatic migrations are not active on `pix-datawarehouse-production`
// this may prevent data replication to succeed the day after your migration is deployed on `pix-api-production`
const TABLE_NAME = 'user-recommended-trainings';
const COLUMN_NAME = 'campaignParticipationId';

const up = async (knex) => {
await knex.schema.alterTable(TABLE_NAME, (table) => {
table.integer(COLUMN_NAME).nullable().alter();
});
};

const down = async (knex) => {
await knex.schema.table(TABLE_NAME, (table) => {
table.integer(COLUMN_NAME).notNullable().alter();
});
};

export { down, up };

0 comments on commit 69e89f1

Please sign in to comment.