text: 'use strict';
  
  module.exports = {
    up: async function (queryInterface, Sequelize) {
      return await queryInterface.createTable('tbl_vnpay_history', {
        id: {
          type: Sequelize.UUID,
          defaultValue: Sequelize.UUIDV1,
          primaryKey: true
        },
        session_id: {
          type: Sequelize.UUID,
          allowNull: false
        },
        amount: {
          type: Sequelize.DOUBLE,
          defaultValue: 0,
          allowNull: false,
          validate: {
            min: 0
          }
        },
        status: {
          type: Sequelize.BOOLEAN,
          defaultValue: true,
          allowNull: false
        },
        created_at: {
          type: 'TIMESTAMP',
          defaultValue: Sequelize.literal('CURRENT_TIMESTAMP'),
          allowNull: false
        },
        updated_at: {
          type: 'TIMESTAMP',
          defaultValue: Sequelize.literal('CURRENT_TIMESTAMP'),
          allowNull: false
        },
        deleted_at: { type: 'TIMESTAMP' }
      })
    },
  
    down: async function (queryInterface, Sequelize) {
      return await queryInterface.dropTable('tbl_vnpay_history');
    }
  };