const { DataTypes } = require('sequelize'); const sequelize = require('../config/db'); const Apartment = sequelize.define('Apartment', { id: { type: DataTypes.INTEGER, primaryKey: true, autoIncrement: true, comment: '公寓ID' }, name: { type: DataTypes.STRING(50), allowNull: false, comment: '公寓名称' }, address: { type: DataTypes.STRING(255), allowNull: true, comment: '公寓地址' }, createBy: { type: DataTypes.INTEGER, allowNull: true, comment: '创建人ID' }, createTime: { type: DataTypes.DATE, defaultValue: DataTypes.NOW, comment: '创建时间' }, updateBy: { type: DataTypes.INTEGER, allowNull: true, comment: '修改人ID' }, updateTime: { type: DataTypes.DATE, defaultValue: DataTypes.NOW, onUpdate: DataTypes.NOW, comment: '更新时间' }, isDeleted: { type: DataTypes.INTEGER, allowNull: false, defaultValue: 0, comment: '删除状态(0:未删除,1:已删除)' } }, { tableName: 'apartments', timestamps: false }); module.exports = Apartment;