-
-
Notifications
You must be signed in to change notification settings - Fork 190
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
305 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
'use strict' | ||
|
||
/* | ||
* adonis-lucid | ||
* | ||
* (c) Harminder Virk <virk@adonisjs.com> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
const BaseMigration = require('./BaseMigration') | ||
|
||
class MigrationStatus extends BaseMigration { | ||
/** | ||
* Command signature required by ace | ||
* | ||
* @method signature | ||
* | ||
* @return {String} | ||
*/ | ||
static get signature () { | ||
return 'migration:status' | ||
} | ||
|
||
/** | ||
* Command description | ||
* | ||
* @method description | ||
* | ||
* @return {String} | ||
*/ | ||
static get description () { | ||
return 'Check migrations current status' | ||
} | ||
|
||
/** | ||
* Method called when command is executed. This method | ||
* will print a table with the migrations status. | ||
* | ||
* @method handle | ||
* | ||
* @return {void|Array} | ||
*/ | ||
async handle () { | ||
try { | ||
const migrations = await this.migration.status(this._getSchemaFiles()) | ||
const head = ['File name', 'Migrated', 'Batch'] | ||
const body = migrations.map((migration) => { | ||
return [migration.name, migration.migrated ? 'Yes' : 'No', migration.batch] | ||
}) | ||
this.table(head, body) | ||
} catch (error) { | ||
console.log(error) | ||
} | ||
} | ||
} | ||
|
||
module.exports = MigrationStatus |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.