mirror of
https://github.com/rgrgogu/new_starr.git
synced 2026-09-27 00:12:54 +08:00
28 lines
918 B
JavaScript
28 lines
918 B
JavaScript
'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');
|
|
}
|
|
},
|
|
};
|