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