@@ -648,7 +648,7 @@ function executeCreateMigration(internals, config, callback) {
648
648
templateType = Migration . TemplateType . DEFAULT_COFFEE ;
649
649
}
650
650
var migration = new Migration ( internals . argv . title + (
651
- shouldCreateCoffeeFile ( internals , config ) ? '.coffee' : '.js' ) , path , new Date ( ) ,
651
+ shouldCreateCoffeeFile ( internals , config ) ? '.coffee' : '.js' ) , path , internals . runTimestamp ,
652
652
templateType ) ;
653
653
index . createMigration ( migration , function ( err , migration ) {
654
654
if ( _assert ( err , callback ) ) {
@@ -709,15 +709,15 @@ function createSqlFiles(internals, config, callback) {
709
709
710
710
var templateTypeDefaultSQL = Migration . TemplateType . DEFAULT_SQL ;
711
711
var migrationUpSQL = new Migration ( internals . argv . title + '-up.sql' ,
712
- sqlDir , new Date ( ) , templateTypeDefaultSQL ) ;
712
+ sqlDir , internals . runTimestamp , templateTypeDefaultSQL ) ;
713
713
index . createMigration ( migrationUpSQL , function ( err , migration ) {
714
714
if ( _assert ( err , callback ) ) {
715
715
716
716
log . info ( util . format ( 'Created migration up sql file at %s' ,
717
717
migration . path ) ) ;
718
718
719
719
var migrationDownSQL = new Migration ( internals . argv . title +
720
- '-down.sql' , sqlDir , new Date ( ) , templateTypeDefaultSQL ) ;
720
+ '-down.sql' , sqlDir , internals . runTimestamp , templateTypeDefaultSQL ) ;
721
721
index . createMigration ( migrationDownSQL , function ( err , migration ) {
722
722
if ( _assert ( err , callback ) ) {
723
723
@@ -891,6 +891,8 @@ function run(internals, config) {
891
891
var action = internals . argv . _ . shift ( ) ,
892
892
folder = action . split ( ':' ) ;
893
893
894
+ internals . runTimestamp = new Date ( ) ;
895
+
894
896
action = folder [ 0 ] ;
895
897
896
898
switch ( action ) {
0 commit comments