@@ -29,15 +29,15 @@ const execUnit = {
2929
3030 up : async function ( context , driver , file ) {
3131 const _file = file . get ( ) ;
32- const chain = new Chain ( context . _driver , file , driver , context . internals ) ;
32+ const chain = new Chain ( context . _driver , file , driver , context . internals , context . _pdriver ) ;
3333 if ( ! _file . _meta . noDefaultColumn ) {
3434 chain . addChain ( AddConventions ) ;
3535 }
3636 chain . addChain ( Learn ) ;
3737 chain . addChain ( StateTravel ) ;
3838 chain . addChain ( Migrate ) ;
3939
40- await State . startMigration ( context . _driver , file , context . internals ) ;
40+ await State . startMigration ( context . _pdriver , file , context . internals ) ;
4141 // startMigration - needs secondary instance since we can not afford to
4242 // loose state and the transaction start will include these for roll back
4343 // we will disable them probably at all from DDL when the driver does not
@@ -62,20 +62,20 @@ const execUnit = {
6262 throw err ;
6363 }
6464 await Promise . promisify ( context . writeMigrationRecord . bind ( context ) ) ( file ) ;
65- return State . endMigration ( context . _driver , file , context . internals ) ;
65+ return State . endMigration ( context . _pdriver , file , context . internals ) ;
6666 // end migration, same as start migration
6767 } ,
6868
6969 fix : async function ( context , driver , file ) {
7070 const _file = file . get ( ) ;
71- const chain = new Chain ( context . _driver , file , driver , context . internals ) ;
71+ const chain = new Chain ( context . _driver , file , driver , context . internals , context . _pdriver ) ;
7272 if ( ! _file . _meta . noDefaultColumn ) {
7373 chain . addChain ( AddConventions ) ;
7474 }
7575 chain . addChain ( Learn ) ;
7676 chain . addChain ( StateTravel ) ;
7777
78- await State . startMigration ( context . _driver , file , context . internals ) ;
78+ await State . startMigration ( context . _pdriver , file , context . internals ) ;
7979 // startMigration - needs secondary instance since we can not afford to
8080 // loose state and the transaction start will include these for roll back
8181 // we will disable them probably at all from DDL when the driver does not
@@ -99,16 +99,16 @@ const execUnit = {
9999 await execUnit . down ( context , driver , file ) ;
100100 throw err ;
101101 }
102- await State . endMigration ( context . _driver , file , context . internals ) ;
102+ await State . endMigration ( context . _pdriver , file , context . internals ) ;
103103 log . verbose ( `[fix] current schema` , util . inspect ( context . internals . schema , false , null , true ) ) ;
104104 // end migration, same as start migration
105105 } ,
106106
107107 down : async function ( context , driver , file ) {
108108 // start migration, see up comments
109- await State . startMigration ( context . _driver , file , context . internals ) ;
110- await TranslateState ( context . _driver , file , driver , context . internals ) ;
111- await State . endMigration ( context . _driver , file , context . internals ) ;
109+ await State . startMigration ( context . _pdriver , file , context . internals ) ;
110+ await TranslateState ( context . _driver , file , driver , context . internals , context . _pdriver ) ;
111+ await State . endMigration ( context . _pdriver , file , context . internals ) ;
112112 return Promise . promisify ( context . deleteMigrationRecord . bind ( context ) ) ( file ) ;
113113 // end migration, see up comments
114114 }
0 commit comments