@@ -29,15 +29,15 @@ const execUnit = {
29
29
30
30
up : async function ( context , driver , file ) {
31
31
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 ) ;
33
33
if ( ! _file . _meta . noDefaultColumn ) {
34
34
chain . addChain ( AddConventions ) ;
35
35
}
36
36
chain . addChain ( Learn ) ;
37
37
chain . addChain ( StateTravel ) ;
38
38
chain . addChain ( Migrate ) ;
39
39
40
- await State . startMigration ( context . _driver , file , context . internals ) ;
40
+ await State . startMigration ( context . _pdriver , file , context . internals ) ;
41
41
// startMigration - needs secondary instance since we can not afford to
42
42
// loose state and the transaction start will include these for roll back
43
43
// we will disable them probably at all from DDL when the driver does not
@@ -62,20 +62,20 @@ const execUnit = {
62
62
throw err ;
63
63
}
64
64
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 ) ;
66
66
// end migration, same as start migration
67
67
} ,
68
68
69
69
fix : async function ( context , driver , file ) {
70
70
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 ) ;
72
72
if ( ! _file . _meta . noDefaultColumn ) {
73
73
chain . addChain ( AddConventions ) ;
74
74
}
75
75
chain . addChain ( Learn ) ;
76
76
chain . addChain ( StateTravel ) ;
77
77
78
- await State . startMigration ( context . _driver , file , context . internals ) ;
78
+ await State . startMigration ( context . _pdriver , file , context . internals ) ;
79
79
// startMigration - needs secondary instance since we can not afford to
80
80
// loose state and the transaction start will include these for roll back
81
81
// we will disable them probably at all from DDL when the driver does not
@@ -99,16 +99,16 @@ const execUnit = {
99
99
await execUnit . down ( context , driver , file ) ;
100
100
throw err ;
101
101
}
102
- await State . endMigration ( context . _driver , file , context . internals ) ;
102
+ await State . endMigration ( context . _pdriver , file , context . internals ) ;
103
103
log . verbose ( `[fix] current schema` , util . inspect ( context . internals . schema , false , null , true ) ) ;
104
104
// end migration, same as start migration
105
105
} ,
106
106
107
107
down : async function ( context , driver , file ) {
108
108
// 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 ) ;
112
112
return Promise . promisify ( context . deleteMigrationRecord . bind ( context ) ) ( file ) ;
113
113
// end migration, see up comments
114
114
}
0 commit comments