mirror of
https://github.com/rgrgogu/new_starr.git
synced 2026-09-27 00:12:54 +08:00
43 lines
1.3 KiB
JavaScript
43 lines
1.3 KiB
JavaScript
'use strict';
|
|
|
|
module.exports = {
|
|
async up(queryInterface, Sequelize) {
|
|
// Single shared banner image for the rotating sticky announcement bar —
|
|
// one image for all (up to 3) concurrently-active announcements, not one
|
|
// per announcement. Enforced as a singleton in application code (always
|
|
// read/written as id=1), same pragmatic approach as the "no need for a
|
|
// dedicated Banner entity" ask — just a one-row setting.
|
|
await queryInterface.createTable('sticky_banner_settings', {
|
|
id: {
|
|
type: Sequelize.SMALLINT,
|
|
primaryKey: true,
|
|
defaultValue: 1,
|
|
},
|
|
image_asset_id: {
|
|
type: Sequelize.BIGINT,
|
|
allowNull: true,
|
|
references: { model: 'assets', key: 'asset_id' },
|
|
onDelete: 'SET NULL',
|
|
},
|
|
updatedBy: {
|
|
type: Sequelize.BIGINT,
|
|
allowNull: true,
|
|
},
|
|
createdAt: {
|
|
type: Sequelize.DATE,
|
|
allowNull: false,
|
|
defaultValue: Sequelize.literal('CURRENT_TIMESTAMP'),
|
|
},
|
|
updatedAt: {
|
|
type: Sequelize.DATE,
|
|
allowNull: false,
|
|
defaultValue: Sequelize.literal('CURRENT_TIMESTAMP'),
|
|
},
|
|
});
|
|
},
|
|
|
|
async down(queryInterface) {
|
|
await queryInterface.dropTable('sticky_banner_settings');
|
|
},
|
|
};
|