-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
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.
Metadata
Metadata
Assignees
Labels
No labels