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.

54 lines
1.1 KiB

'use strict';
module.exports = {
up: async (queryInterface, Sequelize) => {
await queryInterface.createTable('Invoices', {
id: {
type: Sequelize.INTEGER,
allowNull: false,
autoIncrement: true,
primaryKey: true,
},
userId: {
type: Sequelize.INTEGER,
allowNull: false,
references: {
model: 'Users',
key: 'id',
},
onDelete: 'CASCADE',
},
totalAmount: {
type: Sequelize.INTEGER,
allowNull: false,
},
products: {
type: Sequelize.JSON,
allowNull: false,
},
paymentStatus: {
type: Sequelize.STRING,
allowNull: false,
},
refId: {
type: Sequelize.STRING,
allowNull: false,
},
createdAt: {
type: Sequelize.DATE,
allowNull: false,
defaultValue: Sequelize.NOW,
},
updatedAt: {
type: Sequelize.DATE,
allowNull: false,
defaultValue: Sequelize.NOW,
},
});
},
down: async (queryInterface, Sequelize) => {
await queryInterface.dropTable('Invoices');
},
};