I'm playing around with Ghost blogging platform https://github.com/TryGhost/Ghost/issues/769. It uses knex module for nodejs to interact with an sqlite3 database. The migrations to rollback look like this. I'm wondering if there's a way to run this from sqlite3 console, or how would I do it if I want to rollback migrations?
down = function () {
return when.all([
knex.schema.dropTableIfExists('posts_tags'),
knex.schema.dropTableIfExists('roles_users'),
knex.schema.dropTableIfExists('permissions_users'),
knex.schema.dropTableIfExists('permissions_roles'),
knex.schema.dropTableIfExists('users')
]).then(function () {
return when.all([
knex.schema.dropTableIfExists('roles'),
knex.schema.dropTableIfExists('settings'),
knex.schema.dropTableIfExists('permissions'),
knex.schema.dropTableIfExists('tags'),
knex.schema.dropTableIfExists('posts')
]);
});
};
exports.up = up;
exports.down = down;
exports.constraints = constraints;