File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ const Promise = require('bluebird');
2
2
const State = require ( '../../state' ) ;
3
3
const Chain = require ( '../../chain' ) ;
4
4
const Migrate = require ( './migrate' ) ;
5
+ const log = require ( 'db-migrate-shared' ) . log ;
5
6
6
7
const methods = {
7
8
createTable : async ( driver , [ t ] , internals ) => {
@@ -45,6 +46,17 @@ const methods = {
45
46
} ,
46
47
47
48
addIndex : async ( driver , [ t , i ] , internals ) => {
49
+ if ( ! internals . modSchema . i [ t ] [ i ] ) {
50
+ log . warning (
51
+ `There was an attempt to create the index "${ i } " in the table "${ t } ".`
52
+ ) ;
53
+ log . warning (
54
+ `This index did not exist at the time of deleting it. ` +
55
+ `This can happen if an index was created by hand and then deleted` +
56
+ `by db-migrate. Make sure to recreate it by hand to avoid any problems.`
57
+ ) ;
58
+ return Promise . resolve ( ) ;
59
+ }
48
60
return driver . addIndex (
49
61
t ,
50
62
i ,
You can’t perform that action at this time.
0 commit comments