diff --git a/src/Commands/Seed.js b/src/Commands/Seed.js index 51fd459d..b50ca730 100644 --- a/src/Commands/Seed.js +++ b/src/Commands/Seed.js @@ -56,6 +56,9 @@ class Seed extends Command { this.success(`${this.icon('success')} seeded database successfully`) } catch (e) { this.error(e) + } finally { + const MigrationsRunner = this.migrations + new MigrationsRunner().database.close() } } } diff --git a/src/Commands/Status.js b/src/Commands/Status.js index dde940cb..2cf2773c 100644 --- a/src/Commands/Status.js +++ b/src/Commands/Status.js @@ -52,8 +52,6 @@ class Status extends Command { this.table(['Migration', 'Status'], response) } catch (e) { this.error(e) - } finally { - migrationsRunner.database.close() } } } diff --git a/src/Migrations/index.js b/src/Migrations/index.js index 32e328c5..f4b9bcc1 100644 --- a/src/Migrations/index.js +++ b/src/Migrations/index.js @@ -158,6 +158,7 @@ class Migrations { */ * status (files) { const migrate = yield this._diff(files, 'up') + this.database.close() return _.transform(files, function (result, file, name) { if (migrate.indexOf(name) > -1) { result[name] = 'N'