0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-20 22:42:53 -05:00

Updated addTable util to take optional tableSpec

no-issue

Migrations should contain all the necessary information rather than
relying on external data
This commit is contained in:
Fabien O'Carroll 2021-02-03 12:15:05 +00:00 committed by Fabien 'egg' O'Carroll
parent dbfddf545d
commit 873d21d975

View file

@ -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);