const Sequelize = require("sequelize"); module.exports = (db) => { const biz_usage_monthly = db.define( "biz_usage_monthly", { id: { type: Sequelize.BIGINT.UNSIGNED, primaryKey: true, autoIncrement: true, }, user_id: { type: Sequelize.BIGINT.UNSIGNED, allowNull: false, }, plan_id: { type: Sequelize.BIGINT.UNSIGNED, allowNull: false, }, stat_month: { type: Sequelize.STRING(7), allowNull: false, comment: "YYYY-MM", }, msg_count: { type: Sequelize.INTEGER, allowNull: false, defaultValue: 0 }, mass_count: { type: Sequelize.INTEGER, allowNull: false, defaultValue: 0 }, friend_count: { type: Sequelize.INTEGER, allowNull: false, defaultValue: 0 }, sns_count: { type: Sequelize.INTEGER, allowNull: false, defaultValue: 0 }, active_user_count: { type: Sequelize.INTEGER, allowNull: false, defaultValue: 0 }, }, { tableName: "biz_usage_monthly", timestamps: true, underscored: true, comment: "月用量", } ); // biz_usage_monthly.sync({ alter: true }); return biz_usage_monthly; };