Signed-off-by: Kenneth Obsequio <k80308392@gmail.com>
This commit is contained in:
2026-07-12 12:39:17 +08:00
parent 82ea9c77c4
commit ea3e82e54c
47 changed files with 1301 additions and 481 deletions
@@ -0,0 +1,32 @@
'use strict';
// Reverts the notification_templates feature (20260703000008 +
// 20260709000004) — admin-editable notification wording has been moved back
// to hardcoded build() functions in data/notifications.data.js.
module.exports = {
async up(queryInterface) {
await queryInterface.dropTable('notification_templates');
await queryInterface.sequelize.query(`DROP TYPE IF EXISTS "enum_notification_templates_scope";`);
await queryInterface.sequelize.query(`DROP TYPE IF EXISTS "enum_notification_templates_status";`);
},
async down(queryInterface, Sequelize) {
await queryInterface.createTable('notification_templates', {
notification_template_id: { type: Sequelize.BIGINT, primaryKey: true, autoIncrement: true },
type: { type: Sequelize.STRING(100), allowNull: false, unique: true },
notify_type: { type: Sequelize.STRING(64), allowNull: false },
scope: { type: Sequelize.ENUM('admin', 'user', 'both'), allowNull: false },
label: { type: Sequelize.STRING(150), allowNull: false },
status: { type: Sequelize.ENUM('draft', 'sent'), allowNull: false, defaultValue: 'draft' },
title: { type: Sequelize.STRING(255), allowNull: true },
message: { type: Sequelize.TEXT, allowNull: true },
draft_title: { type: Sequelize.STRING(255), allowNull: true },
draft_message: { type: Sequelize.TEXT, allowNull: true },
last_sent_at: { type: Sequelize.DATE, allowNull: true },
is_system: { type: Sequelize.BOOLEAN, allowNull: false, defaultValue: false },
createdAt: { type: Sequelize.DATE, allowNull: false },
updatedAt: { type: Sequelize.DATE, allowNull: false },
});
},
};