Files
starr-philproperties/models/notifications/sticky_banner_setting.mdl.js
T
kennethobsequio ea3e82e54c added
Signed-off-by: Kenneth Obsequio <k80308392@gmail.com>
2026-07-12 12:39:17 +08:00

23 lines
960 B
JavaScript

// models/notifications/sticky_banner_setting.mdl.js
//
// Singleton (always id=1) — one shared banner image shown alongside every
// currently-active sticky announcement, not one image per announcement. Set
// from the Announcements list page (see admin/notificationBroadcasts.controller.js's
// getStickyBannerSetting/updateStickyBannerSetting).
const { DataTypes } = require("sequelize");
const sequelize = require("../../config/db.config");
const mdl_Assets = require("../assets/assets.mdl");
const StickyBannerSetting = sequelize.define("StickyBannerSetting", {
id: { type: DataTypes.SMALLINT, primaryKey: true, defaultValue: 1 },
image_asset_id: { type: DataTypes.BIGINT, allowNull: true },
updatedBy: { type: DataTypes.BIGINT, allowNull: true },
}, {
tableName: "sticky_banner_settings",
timestamps: true,
});
StickyBannerSetting.belongsTo(mdl_Assets, { as: "image", foreignKey: "image_asset_id" });
module.exports = StickyBannerSetting;