From 873d21d9751345fe7c983719a4a52aed1ba11cab Mon Sep 17 00:00:00 2001 From: Fabien O'Carroll Date: Wed, 3 Feb 2021 12:15:05 +0000 Subject: [PATCH] Updated addTable util to take optional tableSpec no-issue Migrations should contain all the necessary information rather than relying on external data --- core/server/data/migrations/utils.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/server/data/migrations/utils.js b/core/server/data/migrations/utils.js index 1a89b79cc5..ee7105fdad 100644 --- a/core/server/data/migrations/utils.js +++ b/core/server/data/migrations/utils.js @@ -8,7 +8,7 @@ const MIGRATION_USER = 1; /** * Creates a migrations which will add a new table from schema.js to the database */ -function addTable(name) { +function addTable(name, tableSpec) { return createNonTransactionalMigration( async function up(connection) { const tableExists = await connection.schema.hasTable(name); @@ -18,7 +18,7 @@ function addTable(name) { } logging.info(`Adding table: ${name}`); - return commands.createTable(name, connection); + return commands.createTable(name, connection, tableSpec); }, async function down(connection) { const tableExists = await connection.schema.hasTable(name);