I am trying to use migrations using knex and bookshelf, and so far this is my code, this is an example from the bookshelf documentation:
exports.up = function(knex, Promise) {
return knex.schema.createTable('books', function(table) {
table.increments('id').primary();
table.string('name');
}).createTable('summaries', function(table) {
table.increments('id').primary();
table.string('details');
table.integer('book_id').unique().references('books.id');
});
};
I tried running:
knex migrate:make my_migration_name
knex migrate:latest
knex migrate:rollback
But no changes have occurred in my database. Any ideas how I can make it work?
source
share