'use strict'; module.exports = { up: async (queryInterface, Sequelize) => { await queryInterface.dropTable("Payments", { cascade: true }); await queryInterface.createTable('Payments', { id: { type: Sequelize.INTEGER, autoIncrement: true, primaryKey: true, allowNull: false, }, userId: { type: Sequelize.INTEGER, allowNull: false, references: { model: 'Users', key: 'id', }, onDelete: 'CASCADE', }, walletId: { type: Sequelize.INTEGER, allowNull: false, references: { model: 'Wallets', key: 'id', }, onDelete: 'CASCADE', }, paymentAmount: { type: Sequelize.INTEGER, allowNull: false, }, status: { type: Sequelize.ENUM('completed', 'failed'), allowNull: false, defaultValue: 'failed', }, paymentDate: { 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('Payments'); }, };