Fix keyboard shortcuts migration
This commit is contained in:
parent
5b806a50e4
commit
36a1751544
1 changed files with 14 additions and 6 deletions
|
|
@ -1,19 +1,27 @@
|
|||
'use strict';
|
||||
|
||||
const {
|
||||
safeAddColumns,
|
||||
safeRemoveColumn,
|
||||
} = require('../utils/migration-utils');
|
||||
|
||||
/**
|
||||
* Migration to add keyboard_shortcuts JSON column to users table.
|
||||
* This stores user-configurable keyboard shortcuts for quick actions.
|
||||
*/
|
||||
module.exports = {
|
||||
async up(queryInterface, Sequelize) {
|
||||
await queryInterface.safeAddColumn('users', 'keyboard_shortcuts', {
|
||||
type: Sequelize.JSON,
|
||||
allowNull: true,
|
||||
defaultValue: null,
|
||||
});
|
||||
await safeAddColumns(queryInterface, 'users', [
|
||||
{
|
||||
name: 'keyboard_shortcuts',
|
||||
type: Sequelize.JSON,
|
||||
allowNull: true,
|
||||
defaultValue: null,
|
||||
},
|
||||
]);
|
||||
},
|
||||
|
||||
async down(queryInterface) {
|
||||
await queryInterface.safeRemoveColumn('users', 'keyboard_shortcuts');
|
||||
await safeRemoveColumn(queryInterface, 'users', 'keyboard_shortcuts');
|
||||
},
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue