Files
starr-philproperties/models/tiers/tier_categories.mdl.js
T
2026-08-01 23:02:31 +08:00

24 lines
1.5 KiB
JavaScript

const { DataTypes } = require('sequelize');
const sequelize = require('../../config/db.config');
const mdl_TierCategories = sequelize.define('TierCategory', {
tier_category_id: { type: DataTypes.BIGINT, primaryKey: true, autoIncrement: true },
slug: { type: DataTypes.STRING(50), allowNull: false, unique: true, label: 'Slug' },
name: { type: DataTypes.STRING(100), allowNull: false, label: 'Name' },
description: { type: DataTypes.TEXT, allowNull: true, label: 'Description' },
rank: { type: DataTypes.INTEGER, allowNull: false, defaultValue: 0, label: 'Rank' },
badge_asset_id: { type: DataTypes.BIGINT, allowNull: true, label: 'Badge Asset' },
badge_icon: { type: DataTypes.STRING(50), allowNull: true, label: 'Badge Icon' },
badge_label: { type: DataTypes.STRING(100), allowNull: true, label: 'Badge Label' },
color: { type: DataTypes.STRING(30), allowNull: false, defaultValue: 'purple', label: 'Color' },
is_default: { type: DataTypes.BOOLEAN, allowNull: false, defaultValue: false, label: 'Default' },
is_active: { type: DataTypes.BOOLEAN, allowNull: false, defaultValue: true, label: 'Active' },
is_special: { type: DataTypes.BOOLEAN, allowNull: false, defaultValue: false, label: 'Special' },
}, {
tableName: 'tier_categories',
timestamps: true,
paranoid: false,
});
module.exports = mdl_TierCategories;