@@ -580,6 +580,42 @@ describe(Support.getTestDialectTeaser('db:migrate'), () => {
580
580
} ) ;
581
581
} ) ;
582
582
} ) ;
583
+
584
+ it ( '--name' , function ( done ) {
585
+ const migrationsPath = Support . resolveSupportPath ( 'assets' , 'migrations' ) ;
586
+ const migrations = fs . readdirSync ( migrationsPath ) ;
587
+ const createPersonMigration = migrations . find ( ( migration ) =>
588
+ migration . includes ( 'createPerson' )
589
+ ) ;
590
+
591
+ prepare ( `--name ${ createPersonMigration } ` , ( ) => {
592
+ helpers . readTables ( this . sequelize , ( tables ) => {
593
+ expect ( tables ) . to . eql ( [ 'Person' , 'SequelizeMeta' ] ) ;
594
+ done ( ) ;
595
+ } ) ;
596
+ } ) ;
597
+ } ) ;
598
+
599
+ it ( '--name array' , function ( done ) {
600
+ const migrationsPath = Support . resolveSupportPath ( 'assets' , 'migrations' ) ;
601
+ const migrations = fs . readdirSync ( migrationsPath ) ;
602
+ const createPersonMigration = migrations . find ( ( migration ) =>
603
+ migration . includes ( 'createPerson' )
604
+ ) ;
605
+ const createPostMigration = migrations . find ( ( migration ) =>
606
+ migration . includes ( 'createPost' )
607
+ ) ;
608
+
609
+ prepare (
610
+ `--name ${ createPersonMigration } --name ${ createPostMigration } ` ,
611
+ ( ) => {
612
+ helpers . readTables ( this . sequelize , ( tables ) => {
613
+ expect ( tables ) . to . eql ( [ 'Person' , 'Post' , 'SequelizeMeta' ] ) ;
614
+ done ( ) ;
615
+ } ) ;
616
+ }
617
+ ) ;
618
+ } ) ;
583
619
} ) ;
584
620
} ) ;
585
621
0 commit comments