new commits

Signed-off-by: Kenneth Obsequio <k80308392@gmail.com>
This commit is contained in:
2026-07-03 16:20:58 +08:00
parent 1372f4e975
commit 1d12f04967
93 changed files with 3849 additions and 1063 deletions
@@ -0,0 +1,28 @@
'use strict';
module.exports = {
async up(queryInterface, Sequelize) {
await queryInterface.addColumn('advertisements', 'placement', {
type: Sequelize.STRING(100),
allowNull: true,
});
await queryInterface.addIndex('advertisements', ['placement']);
// Backfill the only two placements that were actually wired up before this
// migration (Dashboard hero + popup). Any existing banner/sidebar rows are
// left with placement = NULL — dev data, an admin reassigns them via the
// edit form once the new Page/Position picker ships.
await queryInterface.sequelize.query(`
UPDATE advertisements SET placement = 'dashboard.hero' WHERE type = 'hero' AND placement IS NULL
`);
await queryInterface.sequelize.query(`
UPDATE advertisements SET placement = 'dashboard.popup' WHERE type = 'popup' AND placement IS NULL
`);
},
async down(queryInterface) {
await queryInterface.removeIndex('advertisements', ['placement']).catch(() => {});
await queryInterface.removeColumn('advertisements', 'placement');
},
};