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
Knex has a powerful schema builder. But, as you mentioned in knex 2015 roadmap, it’s still limited. I’d suggest to add a raw sql migrations.
Each migration will have two files: datetime_name_up.sql and datetime_name_down.sql
For now I use following code in migration js file for raw migrations
var migrationUtils = require('../../src/helpers/migrations/migrations');
exports.up = migrationUtils.getUpFunction(__filename);
exports.down = migrationUtils.getDownFunction(__filename);
each of functions reads corresponding (_up or _down) sql file and executes knex.raw with its content. But it causes repeating of each migration js code and gives 3 files per migration.
I can also put raw sql in js, but it’ll break sql syntax highlight and reduce readability.
The text was updated successfully, but these errors were encountered:
Knex has a powerful schema builder. But, as you mentioned in knex 2015 roadmap, it’s still limited. I’d suggest to add a raw sql migrations.
Each migration will have two files:
datetime_name_up.sql
anddatetime_name_down.sql
For now I use following code in migration js file for raw migrations
each of functions reads corresponding (_up or _down) sql file and executes knex.raw with its content. But it causes repeating of each migration js code and gives 3 files per migration.
I can also put raw sql in js, but it’ll break sql syntax highlight and reduce readability.
The text was updated successfully, but these errors were encountered: