From ac39664f3a309ef4b79f0b4cb9451d47b93465e3 Mon Sep 17 00:00:00 2001 From: Christopher Ogden <13042897+ChrisOgden@users.noreply.github.com> Date: Tue, 1 Jun 2021 13:35:57 -0400 Subject: [PATCH] Fix SequelizeMeta timestamp add Handle when showAllTables returns an array of objects instead of just an array of strings of tableName --- src/core/migrator.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/core/migrator.js b/src/core/migrator.js index 4e89afd82..ab7985e40 100644 --- a/src/core/migrator.js +++ b/src/core/migrator.js @@ -86,7 +86,14 @@ export function ensureCurrentMetaSchema(migrator) { } function ensureMetaTable(queryInterface, tableName) { - return queryInterface.showAllTables().then((tableNames) => { + return queryInterface.showAllTables() + .then((tableNames) => { + if (typeof tableNames[0] === 'string') { + return tableNames; + } + return tableNames.map(table => { return table.tableName }) + }) + .then((tableNames) => { if (tableNames.indexOf(tableName) === -1) { throw new Error('No MetaTable table found.'); }