Files
starr-philproperties/database/migrations/20260711000007-add-broadcast-id-to-notifications.js
T
kennethobsequio ea3e82e54c added
Signed-off-by: Kenneth Obsequio <k80308392@gmail.com>
2026-07-12 12:39:17 +08:00

25 lines
758 B
JavaScript

'use strict';
module.exports = {
async up(queryInterface, Sequelize) {
await queryInterface.addColumn('admin_notifications', 'broadcast_id', {
type: Sequelize.BIGINT,
allowNull: true,
references: { model: 'notification_broadcasts', key: 'broadcast_id' },
onDelete: 'SET NULL',
});
await queryInterface.addColumn('user_notifications', 'broadcast_id', {
type: Sequelize.BIGINT,
allowNull: true,
references: { model: 'notification_broadcasts', key: 'broadcast_id' },
onDelete: 'SET NULL',
});
},
async down(queryInterface) {
await queryInterface.removeColumn('user_notifications', 'broadcast_id');
await queryInterface.removeColumn('admin_notifications', 'broadcast_id');
},
};