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:
parent
dbfddf545d
commit
873d21d975
1 changed files with 2 additions and 2 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue