@@ -8,6 +8,8 @@ var driver = require('../');
8
8
9
9
var config = require ( './db.config.json' ) . sqlite3 ;
10
10
11
+ var foreignKeyBatch = require ( './foreign_key_batch' )
12
+
11
13
var internals = { } ;
12
14
internals . mod = {
13
15
log : log ,
@@ -22,7 +24,9 @@ internals.migrationTable = 'migrations';
22
24
vows . describe ( 'sqlite3' ) . addBatch ( {
23
25
'createTable' : {
24
26
topic : function ( ) {
27
+ console . log ( "cc" )
25
28
driver . connect ( config , internals , function ( err , db ) {
29
+ console . log ( "cc_cc" )
26
30
db . createTable ( 'event' , {
27
31
id : { type : dataType . INTEGER , primaryKey : true , autoIncrement : true , notNull : true } ,
28
32
str : { type : dataType . STRING , unique : true } ,
@@ -36,9 +40,10 @@ vows.describe('sqlite3').addBatch({
36
40
} ,
37
41
38
42
teardown : function ( db ) {
43
+ console . log ( 'tt' )
39
44
db . close ( function ( err ) {
40
45
fs . unlink ( config . filename , this . callback ) ;
41
- } ) ;
46
+ } . bind ( this ) ) ;
42
47
} ,
43
48
44
49
'has resulting table metadata' : {
@@ -138,7 +143,7 @@ vows.describe('sqlite3').addBatch({
138
143
teardown : function ( db ) {
139
144
db . close ( function ( err ) {
140
145
fs . unlink ( config . filename , this . callback ) ;
141
- } ) ;
146
+ } . bind ( this ) ) ;
142
147
} ,
143
148
144
149
'has table metadata' : {
@@ -172,7 +177,7 @@ vows.describe('sqlite3').addBatch({
172
177
teardown : function ( db ) {
173
178
db . close ( function ( err ) {
174
179
fs . unlink ( config . filename , this . callback ) ;
175
- } ) ;
180
+ } . bind ( this ) ) ;
176
181
} ,
177
182
178
183
'has table metadata' : {
@@ -208,7 +213,7 @@ vows.describe('sqlite3').addBatch({
208
213
teardown : function ( db ) {
209
214
db . close ( function ( err ) {
210
215
fs . unlink ( config . filename , this . callback ) ;
211
- } ) ;
216
+ } . bind ( this ) ) ;
212
217
} ,
213
218
214
219
'has column metadata' : {
@@ -249,7 +254,7 @@ vows.describe('sqlite3').addBatch({
249
254
teardown : function ( db ) {
250
255
db . close ( function ( err ) {
251
256
fs . unlink ( config . filename , this . callback ) ;
252
- } ) ;
257
+ } . bind ( this ) ) ;
253
258
} ,
254
259
255
260
'has resulting index metadata' : {
@@ -287,7 +292,7 @@ vows.describe('sqlite3').addBatch({
287
292
teardown : function ( db ) {
288
293
db . close ( function ( err ) {
289
294
fs . unlink ( config . filename , this . callback ) ;
290
- } ) ;
295
+ } . bind ( this ) ) ;
291
296
} ,
292
297
293
298
'with additional row' : function ( db ) {
@@ -312,7 +317,7 @@ vows.describe('sqlite3').addBatch({
312
317
teardown : function ( db ) {
313
318
db . close ( function ( err ) {
314
319
fs . unlink ( config . filename , this . callback ) ;
315
- } ) ;
320
+ } . bind ( this ) ) ;
316
321
} ,
317
322
318
323
'with additional row' : function ( db ) {
@@ -339,7 +344,7 @@ vows.describe('sqlite3').addBatch({
339
344
teardown : function ( db ) {
340
345
db . close ( function ( err ) {
341
346
fs . unlink ( config . filename , this . callback ) ;
342
- } ) ;
347
+ } . bind ( this ) ) ;
343
348
} ,
344
349
345
350
'has resulting index metadata' : {
@@ -376,7 +381,7 @@ vows.describe('sqlite3').addBatch({
376
381
teardown : function ( db ) {
377
382
db . close ( function ( err ) {
378
383
fs . unlink ( config . filename , this . callback ) ;
379
- } ) ;
384
+ } . bind ( this ) ) ;
380
385
} ,
381
386
382
387
'has resulting index metadata' : {
@@ -406,7 +411,7 @@ vows.describe('sqlite3').addBatch({
406
411
teardown : function ( db ) {
407
412
db . close ( function ( err ) {
408
413
fs . unlink ( config . filename , this . callback ) ;
409
- } ) ;
414
+ } . bind ( this ) ) ;
410
415
} ,
411
416
412
417
'has migrations table' : {
@@ -452,7 +457,8 @@ vows.describe('sqlite3').addBatch({
452
457
}
453
458
}
454
459
}
455
- } ) . export ( module ) ;
460
+ } ) . addBatch ( foreignKeyBatch ( driver , config , internals ) )
461
+ . export ( module ) ;
456
462
457
463
function findByName ( columns , name ) {
458
464
for ( var i = 0 ; i < columns . length ; i ++ ) {
0 commit comments