You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
entering the desired SQL and then trying to execute it with node_modules/db-migrate/bin/db-migrate up I get an error such as:
> node_modules/db-migrate/bin/db-migrate up
[ERROR] Error: ENOENT: no such file or directory, open '/opt/app/migrations/sqls/20170426175647-[redacted].sql'
at Error (native)
From previous event:
at Class.exports.up (/opt/app/migrations/20170426175647-[redacted].js:23:10)
at Class.<anonymous> (/opt/app/node_modules/db-migrate/lib/skeleton.js:81:41)
From previous event:
at Class._up (/opt/app/node_modules/db-migrate/lib/skeleton.js:65:12)
at Class.up (/opt/app/node_modules/db-migrate/lib/skeleton.js:149:17)
at Object.up (/opt/app/node_modules/db-migrate/lib/migrator.js:112:14)
at /opt/app/node_modules/db-migrate/lib/migrator.js:178:25
From previous event:
at /opt/app/node_modules/db-migrate/lib/migrator.js:171:12
at runCallback (timers.js:651:20)
at tryOnImmediate (timers.js:624:5)
at processImmediate [as _immediateCallback] (timers.js:596:5)
From previous event:
at /opt/app/node_modules/db-migrate/lib/migrator.js:166:39
at Query._callback (/opt/app/node_modules/db-migrate/lib/migration.js:373:7)
at Query.Sequence.end (/opt/app/node_modules/mysql/lib/protocol/sequences/Sequence.js:86:24)
at Query._handleFinalResultPacket (/opt/app/node_modules/mysql/lib/protocol/sequences/Query.js:137:8)
at Query.EofPacket (/opt/app/node_modules/mysql/lib/protocol/sequences/Query.js:121:8)
at Protocol._parsePacket (/opt/app/node_modules/mysql/lib/protocol/Protocol.js:280:23)
at Parser.write (/opt/app/node_modules/mysql/lib/protocol/Parser.js:75:12)
at Protocol.write (/opt/app/node_modules/mysql/lib/protocol/Protocol.js:39:16)
at Socket.<anonymous> (/opt/app/node_modules/mysql/lib/Connection.js:103:28)
at emitOne (events.js:96:13)
at Socket.emit (events.js:188:7)
at readableAddChunk (_stream_readable.js:176:18)
at Socket.Readable.push (_stream_readable.js:134:10)
at TCP.onread (net.js:548:20)
So, the .js file cannot find the SQL file. Ironically, the SQL file is actually there but it is named 20170426175648-[redacted].sql (please note how the last digit differs).
Basically, it's obvious that the timestamp for JS and the SQL are created in two different parts of the code and if enough time lapses for the two timestamps to be different - things break. #sadcatemoji
MANUAL FIX: when this happens I usually just edit the name of -up and -down .sql files to make them the same as the name of the .js file, but obviously a proper fix would be preferrable/desired to prevent such occurrences in the first place.
The text was updated successfully, but these errors were encountered:
Uh oh!
There was an error while loading. Please reload this page.
Using:
Every once in a while, after creating a migration with something like:
entering the desired SQL and then trying to execute it with
node_modules/db-migrate/bin/db-migrate up
I get an error such as:So, the .js file cannot find the SQL file. Ironically, the SQL file is actually there but it is named 20170426175648-[redacted].sql (please note how the last digit differs).
Basically, it's obvious that the timestamp for JS and the SQL are created in two different parts of the code and if enough time lapses for the two timestamps to be different - things break. #sadcatemoji
MANUAL FIX: when this happens I usually just edit the name of -up and -down .sql files to make them the same as the name of the .js file, but obviously a proper fix would be preferrable/desired to prevent such occurrences in the first place.
The text was updated successfully, but these errors were encountered: