Skip to content

Commit

Permalink
feat(migrations): add migrations time in the console output
Browse files Browse the repository at this point in the history
Closes #57
  • Loading branch information
thetutlage committed Jul 16, 2017
1 parent 5aa9897 commit d19c571
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Commands/Run.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
*/

const Command = require('./Command')
const prettyHrTime = require('pretty-hrtime')

class Run extends Command {

Expand Down Expand Up @@ -45,6 +46,7 @@ class Run extends Command {
*/
* handle (options, flags) {
try {
const startTime = process.hrtime()
this.checkEnv(flags.force)

const selectedFiles = flags.files ? flags.files.split(',') : null
Expand All @@ -57,7 +59,8 @@ class Run extends Command {
return
}

const successMessage = 'Database migrated successfully.'
const endTime = process.hrtime(startTime)
const successMessage = `Database migrated successfully in ${prettyHrTime(endTime)}`
const infoMessage = 'Nothing to migrate.'
this._log(response.status, successMessage, infoMessage)
} catch (e) {
Expand Down

0 comments on commit d19c571

Please sign in to comment.