From 0169f47752b652d2d71d31f60158cd0f3b7b6e4c Mon Sep 17 00:00:00 2001 From: Fabian Becker Date: Tue, 26 Nov 2013 09:35:33 +0000 Subject: [PATCH] Fix failing migration.reset for Postgres. refs #1333 --- core/server/data/migration/index.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/core/server/data/migration/index.js b/core/server/data/migration/index.js index c26d2165e0..2065878392 100644 --- a/core/server/data/migration/index.js +++ b/core/server/data/migration/index.js @@ -142,10 +142,12 @@ function getTablesFromSqlite3() { }); } -// Basic suppport for PgSQL -// Attention: not officially tested/supported function getTablesFromPgSQL() { - return knex.raw("SELECT table_name FROM information_schema.tables WHERE table_schema = 'public'"); + return knex.raw("SELECT table_name FROM information_schema.tables WHERE table_schema = 'public'").then(function (response) { + return _.flatten(_.map(response[0], function (entry) { + return _.values(entry); + })); + }); } function getTablesFromMySQL() {