20220222061821-init-transfer.js 789 Bytes
'use strict';

module.exports = {
  async up(queryInterface, Sequelize) {
    const { UUID, DATE, STRING, TEXT, BOOLEAN, UUIDV1 } = Sequelize;
    await queryInterface.createTable('transfers', {
      id: {
        allowNull: false,
        primaryKey: true,
        type: UUID,
        defaultValue: UUIDV1,
      },
      address: { type: STRING },
      to_address: { type: STRING },
      amount: { type: STRING },
      transaction: { type: TEXT },
      finish: { type: BOOLEAN },
      created_at: { type: DATE },
      updated_at: { type: DATE },
    });
  },

  async down(queryInterface, Sequelize) {
    /**
     * Add reverting commands here.
     *
     * Example:
     * await queryInterface.dropTable('users');
     */
    await queryInterface.dropTable('transfer');
  }
};