Artifact Content
Not logged in

Artifact 770b6e309d5bada137d763205170bc5e2589f420:


const Sequelize = require('sequelize')

module.exports = {
  up: sequelize => {
    return sequelize.queryInterface.createTable('Withdrawals', {
      id: {
        type: Sequelize.UUID,
        primaryKey: true,
        defaultValue: Sequelize.UUIDV4
      },
      amount: Sequelize.FLOAT,
      status: Sequelize.STRING,
      transfer_id: {
        type: Sequelize.UUID
      },
      user_id: {
        type: Sequelize.INTEGER,
        references: {
          model: 'Users',
          key: 'id'
        }
      },
      created_at: {
        type: Sequelize.DATE,
        allowNull: false,
        defaultValue: Sequelize.NOW
      },
      updated_at: {
        type: Sequelize.DATE,
        allowNull: false,
        defaultValue: Sequelize.NOW
      }
    })
  },
  down: sequelize => {
    return sequelize.queryInterface.dropTable('Withdrawals')
  }
}