'use strict'; module.exports = { up: async (queryInterface, Sequelize) => { await queryInterface.dropTable('Invoices', { cascade: true }); await queryInterface.createTable('Invoices', { id: { type: Sequelize.INTEGER, autoIncrement: true, primaryKey: true, allowNull: false, }, userId: { type: Sequelize.INTEGER, allowNull: false, references: { model: 'Users', key: 'id', }, onDelete: 'CASCADE', }, cartId: { type: Sequelize.INTEGER, allowNull: false, references: { model: 'Carts', key: 'id', }, onDelete: 'CASCADE', }, totalPaymentAmount: { type: Sequelize.FLOAT, allowNull: false, }, createdAt: { type: Sequelize.DATE, allowNull: false, defaultValue: Sequelize.fn('NOW'), }, updatedAt: { type: Sequelize.DATE, allowNull: false, defaultValue: Sequelize.fn('NOW'), }, }); }, down: async (queryInterface, Sequelize) => { await queryInterface.dropTable('Invoices'); }, };