Files
toho-miku/migrations/20230112132055-create-trade-histories.js
Jan Groß 692904d462 Trade: Add tradehistories table
and create rows at the end of each trade.
Both users traded cards are logged.
2023-01-12 14:43:06 +01:00

36 lines
778 B
JavaScript

'use strict';
module.exports = {
async up(queryInterface, Sequelize) {
await queryInterface.createTable('TradeHistories', {
id: {
allowNull: false,
autoIncrement: true,
primaryKey: true,
type: Sequelize.INTEGER
},
userAId: {
type: Sequelize.INTEGER
},
userBId: {
type: Sequelize.INTEGER
},
userATraded: {
type: Sequelize.JSON
},
userBTraded: {
type: Sequelize.JSON
},
createdAt: {
allowNull: false,
type: Sequelize.DATE
},
updatedAt: {
allowNull: false,
type: Sequelize.DATE
}
});
},
async down(queryInterface, Sequelize) {
await queryInterface.dropTable('TradeHistories');
}
};