3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-03-16 06:11:49 +00:00
zeppelin/migrations/20180712020400_rename_mod_actions_to_cases.js
2018-07-12 02:53:26 +03:00

21 lines
745 B
JavaScript

exports.up = async function(knex) {
await knex.schema.renameTable('mod_actions', 'cases');
await knex.schema.renameTable('mod_action_notes', 'case_notes');
await knex.schema.table('cases', table => {
table.renameColumn('action_type', 'type');
});
await knex.schema.table('case_notes', table => {
table.renameColumn('mod_action_id', 'case_id');
});
};
exports.down = async function(knex) {
await knex.schema.table('cases', table => {
table.renameColumn('type', 'action_type');
});
await knex.schema.table('case_notes', table => {
table.renameColumn('case_id', 'mod_action_id');
});
await knex.schema.renameTable('cases', 'mod_actions');
await knex.schema.renameTable('case_notes', 'mod_action_notes');
};