API/api.medcify.app/migrations/20220121065909-create-subscription.js

78 lines
1.6 KiB
JavaScript
Raw Normal View History

2022-09-26 06:11:44 +00:00
'use strict';
module.exports = {
async up(queryInterface, Sequelize) {
await queryInterface.createTable('subscriptions', {
id: {
allowNull: false,
autoIncrement: true,
primaryKey: true,
type: Sequelize.INTEGER
},
userId:{
type: Sequelize.INTEGER
},
storeId: {
type: Sequelize.INTEGER
},
billNumber: {
type: Sequelize.STRING
},
planId: {
type: Sequelize.INTEGER
},
amount: {
type: Sequelize.STRING
},
validity: {
type: Sequelize.STRING
},
paymentType: {
type: Sequelize.INTEGER
},
startDate: {
type: Sequelize.DATE
},
endDate: {
type: Sequelize.DATE
},
webhookResponse: {
type: Sequelize.TEXT
},
razorpayOrderId: {
type: Sequelize.TEXT
},
razorpayPaymentId: {
type: Sequelize.TEXT
},
razorpaySignature: {
type: Sequelize.TEXT
},
paymentStatus: {
type: Sequelize.TEXT
},
activeStatus: {
type: Sequelize.STRING
},
status: {
type: Sequelize.INTEGER
},
createdBy: {
type: Sequelize.INTEGER
},
updatedBy: {
type: Sequelize.INTEGER
},
createdAt: {
allowNull: false,
type: Sequelize.DATE
},
updatedAt: {
allowNull: false,
type: Sequelize.DATE
}
});
},
async down(queryInterface, Sequelize) {
await queryInterface.dropTable('subscriptions');
}
};