Skip to content

Commit

Permalink
[TECH] Modifier le type de la colonne "id" de la table "learningconte…
Browse files Browse the repository at this point in the history
…nt.missions" (PIX-15481)

 #10660
pix-service-auto-merge authored Nov 27, 2024
2 parents 04a614e + 2b25faa commit 44597f4
Showing 2 changed files with 31 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { databaseBuffer } from '../../database-buffer.js';

export function buildMission({
id = 'missionIdA',
id = 1,
status = 'status Mission A',
name_i18n = { fr: 'name FR Mission A', en: 'name EN Mission A' },
content = { some: 'content' },
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
const TABLE_NAME = 'missions';
const SCHEMA_NAME = 'learningcontent';
/**
* @param { import("knex").Knex } knex
* @returns { Promise<void> }
*/
export async function up(knex) {
await knex.schema.withSchema(SCHEMA_NAME).dropTable(TABLE_NAME);
await knex.schema.withSchema(SCHEMA_NAME).createTable('missions', function (table) {
table.integer('id').primary();
table.string('status');
table.jsonb('name_i18n');
table.jsonb('content');
table.jsonb('learningObjectives_i18n');
table.jsonb('validatedObjectives_i18n');
table.string('introductionMediaType');
table.text('introductionMediaUrl');
table.jsonb('introductionMediaAlt_i18n');
table.text('documentationUrl');
table.text('cardImageUrl');
table.string('competenceId');
});
}

/**
* @returns { Promise<void> }
*/
export async function down() {
// non
}

0 comments on commit 44597f4

Please sign in to comment.