added and fix some of things

Signed-off-by: Kenneth Obsequio <k80308392@gmail.com>
This commit is contained in:
2026-08-03 12:03:02 +08:00
parent 6765c1faba
commit d246c09cdd
31 changed files with 724 additions and 510 deletions
@@ -0,0 +1,15 @@
'use strict';
module.exports = {
async up(queryInterface, Sequelize) {
await queryInterface.addColumn('categories', 'createdBy', { type: Sequelize.BIGINT, allowNull: true });
await queryInterface.addColumn('categories', 'updatedBy', { type: Sequelize.BIGINT, allowNull: true });
await queryInterface.addColumn('categories', 'deletedBy', { type: Sequelize.BIGINT, allowNull: true });
},
async down(queryInterface) {
await queryInterface.removeColumn('categories', 'createdBy');
await queryInterface.removeColumn('categories', 'updatedBy');
await queryInterface.removeColumn('categories', 'deletedBy');
},
};
@@ -0,0 +1,27 @@
'use strict';
// Per-alert layout image, replacing the old shared sticky_banner_settings
// singleton (see 20270101000066-create-sticky-banner-settings.js) — each
// notification_broadcasts row now carries its own optional image, copied
// onto admin_notifications/user_notifications at send time the same way
// color/show_in_sticky already are.
const TABLES = ['notification_broadcasts', 'admin_notifications', 'user_notifications'];
module.exports = {
async up(queryInterface, Sequelize) {
for (const table of TABLES) {
await queryInterface.addColumn(table, 'image_asset_id', {
type: Sequelize.BIGINT,
allowNull: true,
references: { model: 'assets', key: 'asset_id' },
onDelete: 'SET NULL',
});
}
},
async down(queryInterface) {
for (const table of TABLES) {
await queryInterface.removeColumn(table, 'image_asset_id');
}
},
};