@@ -42,7 +42,6 @@ function executeCreateMigration (internals, config, callback) {
42
42
}
43
43
44
44
createMigrationDir ( migrationsDir , function ( err ) {
45
- const index = require ( '../../connect' ) ;
46
45
const Migration = require ( '../template.js' ) ;
47
46
48
47
if ( err ) {
@@ -91,7 +90,7 @@ function executeCreateMigration (internals, config, callback) {
91
90
internals . runTimestamp ,
92
91
templateType
93
92
) ;
94
- index . createMigration ( migration , function ( err , migration ) {
93
+ migration . write ( function ( err ) {
95
94
if ( _assert ( err , callback ) ) {
96
95
log . info ( util . format ( 'Created migration at %s' , migration . file . path ) ) ;
97
96
if ( shouldCreateSqlFiles ( internals , config ) ) {
@@ -128,7 +127,6 @@ function createSqlFiles (internals, config, callback) {
128
127
129
128
const sqlDir = migrationsDir + '/sqls' ;
130
129
createMigrationDir ( sqlDir , function ( err ) {
131
- const index = require ( '../../connect' ) ;
132
130
const Migration = require ( '../template.js' ) ;
133
131
134
132
if ( err ) {
@@ -148,12 +146,12 @@ function createSqlFiles (internals, config, callback) {
148
146
internals . runTimestamp ,
149
147
templateTypeDefaultSQL
150
148
) ;
151
- index . createMigration ( migrationUpSQL , function ( err , migration ) {
149
+ migrationUpSQL . write ( function ( err ) {
152
150
if ( _assert ( err , callback ) ) {
153
151
log . info (
154
152
util . format (
155
153
'Created migration up sql file at %s' ,
156
- migration . file . path
154
+ migrationUpSQL . file . path
157
155
)
158
156
) ;
159
157
@@ -163,12 +161,12 @@ function createSqlFiles (internals, config, callback) {
163
161
internals . runTimestamp ,
164
162
templateTypeDefaultSQL
165
163
) ;
166
- index . createMigration ( migrationDownSQL , function ( err , migration ) {
164
+ migrationDownSQL . write ( function ( err ) {
167
165
if ( _assert ( err , callback ) ) {
168
166
log . info (
169
167
util . format (
170
168
'Created migration down sql file at %s' ,
171
- migration . file . path
169
+ migrationDownSQL . file . path
172
170
)
173
171
) ;
174
172
if ( typeof callback === 'function' ) callback ( ) ;
0 commit comments