2025-12-24 16:44:27 +08:00
|
|
|
const { DataTypes } = require('sequelize');
|
|
|
|
|
const { sequelize } = require('../db');
|
|
|
|
|
|
2026-03-27 19:12:16 +08:00
|
|
|
const ConsumableCategory = sequelize.define(
|
|
|
|
|
'ConsumableCategory',
|
|
|
|
|
{
|
|
|
|
|
id: {
|
|
|
|
|
type: DataTypes.INTEGER,
|
|
|
|
|
primaryKey: true,
|
|
|
|
|
autoIncrement: true,
|
|
|
|
|
},
|
|
|
|
|
name: {
|
|
|
|
|
type: DataTypes.STRING,
|
|
|
|
|
allowNull: false,
|
|
|
|
|
unique: true,
|
|
|
|
|
comment: '分类名称',
|
|
|
|
|
},
|
|
|
|
|
description: {
|
|
|
|
|
type: DataTypes.STRING,
|
|
|
|
|
comment: '分类描述',
|
|
|
|
|
},
|
|
|
|
|
sortOrder: {
|
|
|
|
|
type: DataTypes.INTEGER,
|
|
|
|
|
defaultValue: 0,
|
|
|
|
|
comment: '排序顺序',
|
|
|
|
|
},
|
|
|
|
|
status: {
|
|
|
|
|
type: DataTypes.STRING,
|
|
|
|
|
defaultValue: 'active',
|
|
|
|
|
comment: '状态: active-启用, inactive-停用',
|
|
|
|
|
},
|
2025-12-24 16:44:27 +08:00
|
|
|
},
|
2026-03-27 19:12:16 +08:00
|
|
|
{
|
|
|
|
|
tableName: 'consumable_categories',
|
|
|
|
|
timestamps: true,
|
2025-12-24 16:44:27 +08:00
|
|
|
}
|
2026-03-27 19:12:16 +08:00
|
|
|
);
|
2025-12-24 16:44:27 +08:00
|
|
|
|
|
|
|
|
module.exports = ConsumableCategory;
|