You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
51 lines
1.3 KiB
51 lines
1.3 KiB
'use strict';
|
|
|
|
module.exports = dc => {
|
|
const DataTypes = dc.ORM;
|
|
const sequelize = dc.orm;
|
|
|
|
const UserBillingProfile = sequelize.define('userBillingProfile', {
|
|
userId: {
|
|
type: DataTypes.BIGINT,
|
|
allowNull: false,
|
|
primaryKey: true,
|
|
field: 'user_id',
|
|
comment: 'User id',
|
|
},
|
|
policyCode: {
|
|
type: DataTypes.STRING(64),
|
|
allowNull: false,
|
|
field: 'policy_code',
|
|
comment: 'Bound billing policy code',
|
|
},
|
|
activatedAt: {
|
|
type: DataTypes.DATE,
|
|
allowNull: false,
|
|
defaultValue: sequelize.literal('CURRENT_TIMESTAMP'),
|
|
field: 'activated_at',
|
|
comment: 'Policy activated at',
|
|
},
|
|
createdAt: {
|
|
type: DataTypes.DATE,
|
|
allowNull: false,
|
|
defaultValue: sequelize.literal('CURRENT_TIMESTAMP'),
|
|
field: 'created_at',
|
|
comment: 'Created at',
|
|
},
|
|
updatedAt: {
|
|
type: DataTypes.DATE,
|
|
allowNull: false,
|
|
defaultValue: sequelize.literal('CURRENT_TIMESTAMP'),
|
|
field: 'updated_at',
|
|
comment: 'Updated at',
|
|
},
|
|
}, {
|
|
tableName: 'user_billing_profile',
|
|
comment: 'User billing profile table',
|
|
timestamps: false,
|
|
indexes: [],
|
|
});
|
|
|
|
dc.models.UserBillingProfile = UserBillingProfile;
|
|
return UserBillingProfile;
|
|
};
|
|
|