@@ -402,6 +402,58 @@ describe(Support.getTestDialectTeaser('db:migrate'), () => {
402
402
} ) ;
403
403
} ) ;
404
404
405
+ describeOnlyForSQLite ( Support . getTestDialectTeaser ( 'db:migrate' ) , ( ) => {
406
+ describe ( 'with url option containing relative path to a local storage file' , ( ) => {
407
+ const prepare = function ( callback ) {
408
+ const config = { url : 'sqlite:../test.sqlite' } ;
409
+ const configContent = 'module.exports = ' + JSON . stringify ( config ) ;
410
+ let result = '' ;
411
+
412
+ return gulp
413
+ . src ( Support . resolveSupportPath ( 'tmp' ) )
414
+ . pipe ( helpers . clearDirectory ( ) )
415
+ . pipe ( helpers . runCli ( 'init' ) )
416
+ . pipe ( helpers . removeFile ( 'config/config.json' ) )
417
+ . pipe ( helpers . copyMigration ( 'createPerson.js' ) )
418
+ . pipe ( helpers . overwriteFile ( configContent , 'config/config.js' ) )
419
+ . pipe ( helpers . runCli ( 'db:migrate' ) )
420
+ . on ( 'error' , ( e ) => {
421
+ callback ( e ) ;
422
+ } )
423
+ . on ( 'data' , ( data ) => {
424
+ result += data . toString ( ) ;
425
+ } )
426
+ . on ( 'end' , ( ) => {
427
+ callback ( null , result ) ;
428
+ } ) ;
429
+ } ;
430
+
431
+ it ( 'creates a SequelizeMeta table' , function ( done ) {
432
+ const self = this ;
433
+
434
+ prepare ( ( ) => {
435
+ helpers . readTables ( self . sequelize , ( tables ) => {
436
+ expect ( tables ) . to . have . length ( 2 ) ;
437
+ expect ( tables ) . to . contain ( 'SequelizeMeta' ) ;
438
+ done ( ) ;
439
+ } ) ;
440
+ } ) ;
441
+ } ) ;
442
+
443
+ it ( 'creates the respective table' , function ( done ) {
444
+ const self = this ;
445
+
446
+ prepare ( ( ) => {
447
+ helpers . readTables ( self . sequelize , ( tables ) => {
448
+ expect ( tables ) . to . have . length ( 2 ) ;
449
+ expect ( tables ) . to . contain ( 'Person' ) ;
450
+ done ( ) ;
451
+ } ) ;
452
+ } ) ;
453
+ } ) ;
454
+ } ) ;
455
+ } ) ;
456
+
405
457
describe ( Support . getTestDialectTeaser ( 'db:migrate' ) , ( ) => {
406
458
describe ( 'optional migration parameters' , ( ) => {
407
459
const prepare = function ( runArgs = '' , callback ) {
@@ -626,3 +678,11 @@ function describeOnlyForESM(title, fn) {
626
678
describe . skip ( title , fn ) ;
627
679
}
628
680
}
681
+
682
+ function describeOnlyForSQLite ( title , fn ) {
683
+ if ( Support . getTestDialect ( ) === 'sqlite' ) {
684
+ describe ( title , fn ) ;
685
+ } else {
686
+ describe . skip ( title , fn ) ;
687
+ }
688
+ }
0 commit comments