mirror of
https://github.com/pawelmalak/flame.git
synced 2025-07-25 13:59:36 +02:00
25 lines
532 B
JavaScript
25 lines
532 B
JavaScript
const { DataTypes } = require('sequelize');
|
|
const { INTEGER } = DataTypes;
|
|
|
|
const up = async (query) => {
|
|
await query.addColumn('categories', 'type', {
|
|
type: DataTypes.STRING,
|
|
allowNull: false,
|
|
defaultValue: 'bookmarks'
|
|
});
|
|
await query.addColumn('apps', 'categoryId', {
|
|
type: INTEGER,
|
|
allowNull: true,
|
|
defaultValue: -1,
|
|
});
|
|
};
|
|
|
|
const down = async (query) => {
|
|
await query.removeColumn('apps', 'categoryId');
|
|
await query.removeColumn('categories', 'type');
|
|
};
|
|
|
|
module.exports = {
|
|
up,
|
|
down,
|
|
};
|