From 1fca2d5bb327eb8eebc9ab71e6150917b423376c Mon Sep 17 00:00:00 2001 From: Harminder Virk Date: Wed, 19 Oct 2016 17:45:53 +0530 Subject: [PATCH] feat(migrations): add migrations time in the console output Closes #57 --- src/Commands/Run.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Commands/Run.js b/src/Commands/Run.js index b47f7d94..f970f72f 100644 --- a/src/Commands/Run.js +++ b/src/Commands/Run.js @@ -10,6 +10,7 @@ */ const Command = require('./Command') +const prettyHrTime = require('pretty-hrtime') class Run extends Command { @@ -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 @@ -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) {