mirror of
https://github.com/rgrgogu/new_starr.git
synced 2026-09-27 00:12:54 +08:00
22 lines
705 B
JavaScript
22 lines
705 B
JavaScript
'use strict';
|
|
|
|
module.exports = {
|
|
async up(queryInterface, Sequelize) {
|
|
await queryInterface.addColumn('email_templates', 'category', {
|
|
type: Sequelize.ENUM('announcement', 'advertisement', 'system', 'other'),
|
|
allowNull: false,
|
|
defaultValue: 'other',
|
|
});
|
|
|
|
// The 8 built-in (is_system) templates are all account/auth notifications.
|
|
await queryInterface.sequelize.query(`
|
|
UPDATE email_templates SET category = 'system' WHERE is_system = true;
|
|
`);
|
|
},
|
|
|
|
async down(queryInterface) {
|
|
await queryInterface.removeColumn('email_templates', 'category');
|
|
await queryInterface.sequelize.query(`DROP TYPE IF EXISTS "enum_email_templates_category";`);
|
|
},
|
|
};
|