0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-03-11 02:12:21 -05:00

Drop tables in correct order

issue #858

- unit tests now run for MySQL
This commit is contained in:
Hannah Wolfe 2013-09-27 11:54:09 +01:00
parent 6605ce1c71
commit 71711c1fd2

View file

@ -131,19 +131,19 @@ up = function () {
down = function () {
return when.all([
knex.Schema.dropTableIfExists('posts'),
knex.Schema.dropTableIfExists('users'),
knex.Schema.dropTableIfExists('roles'),
knex.Schema.dropTableIfExists('settings'),
knex.Schema.dropTableIfExists('permissions'),
knex.Schema.dropTableIfExists('tags')
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 () {
// Drop the relation tables after the model tables
return when.all([
knex.Schema.dropTableIfExists('roles_users'),
knex.Schema.dropTableIfExists('permissions_users'),
knex.Schema.dropTableIfExists('permissions_roles'),
knex.Schema.dropTableIfExists('posts_tags')
knex.Schema.dropTableIfExists('roles'),
knex.Schema.dropTableIfExists('settings'),
knex.Schema.dropTableIfExists('permissions'),
knex.Schema.dropTableIfExists('tags'),
knex.Schema.dropTableIfExists('posts')
]);
});
};