'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'); }, };