Files
wechatWeb/api/model/biz_subscription.js
张成 433077f08a 1
2026-04-01 10:42:33 +08:00

46 lines
1.1 KiB
JavaScript

const Sequelize = require("sequelize");
module.exports = (db) => {
const biz_subscription = db.define(
"biz_subscription",
{
user_id: {
type: Sequelize.BIGINT.UNSIGNED,
allowNull: false,
},
plan_id: {
type: Sequelize.BIGINT.UNSIGNED,
allowNull: false,
},
status: {
type: Sequelize.ENUM("pending", "active", "expired", "cancelled"),
allowNull: false,
defaultValue: "pending",
},
start_time: { type: Sequelize.DATE, allowNull: false },
end_time: { type: Sequelize.DATE, allowNull: false },
renew_mode: {
type: Sequelize.ENUM("manual", "auto"),
allowNull: false,
defaultValue: "manual",
},
payment_channel: {
type: Sequelize.ENUM("offline", "pay_link"),
allowNull: true,
},
payment_ref: {
type: Sequelize.STRING(200),
allowNull: true,
},
},
{
tableName: "biz_subscriptions",
timestamps: false,
underscored: true,
}
);
// biz_subscription.sync({ alter: true });
return biz_subscription;
};