venues.js 1.3 KB
module.exports = function (sequelize, DataTypes) {
    return sequelize.define('venues', {
        id: {
            autoIncrement: true,
            type: DataTypes.INTEGER,
            allowNull: false,
            primaryKey: true,
            comment: "场馆ID"
        },
        capacity: {
            type: DataTypes.INTEGER,
            allowNull: true,
            comment: "球场容量"
        },
        country_id: {
            type: DataTypes.INTEGER,
            allowNull: true,
            comment: "国家ID"
        },
        name_en: {
            type: DataTypes.STRING(255),
            allowNull: true,
            comment: "英文名称"
        },
        name_zh: {
            type: DataTypes.STRING(255),
            allowNull: true,
            comment: "中文名称"
        },
        name_zht: {
            type: DataTypes.STRING(255),
            allowNull: true,
            comment: "粤语名称"
        },
        updated_at: {
            type: DataTypes.BIGINT,
            allowNull: true,
            get() {
                return moment(this.getDataValue('updated_at')).format('YYYY-MM-DD HH:mm:ss');
            }
        },
        created_at: {
            type: DataTypes.DATE,
            allowNull: true
        }
    });
};
//# sourceMappingURL=venues.js.map