'use strict';
/** @type {import('sequelize-cli').Migration} */
module.exports = {
  async up(queryInterface, Sequelize) {
    await queryInterface.createTable('Registers', {
      id: {
        allowNull: false,
        autoIncrement: true,
        primaryKey: true,
        type: Sequelize.INTEGER
      },
      storeId: {
        type: Sequelize.INTEGER
      },
      name: {
        type: Sequelize.STRING
      },
      code: {
        type: Sequelize.STRING
      },
      openingCash: {
        type: Sequelize.DECIMAL
      },
      currentCash: {
        type: Sequelize.DECIMAL
      },
      isOpen: {
        type: Sequelize.BOOLEAN
      },
      openedBy: {
        type: Sequelize.INTEGER
      },
      openedAt: {
        type: Sequelize.DATE
      },
      closedBy: {
        type: Sequelize.INTEGER
      },
      closedAt: {
        type: Sequelize.DATE
      },
      isActive: {
        type: Sequelize.BOOLEAN
      },
       status: {
        type: Sequelize.STRING
      },
      createdAt: {
        allowNull: false,
        type: Sequelize.DATE
      },
      updatedAt: {
        allowNull: false,
        type: Sequelize.DATE
      }
    });
  },
  async down(queryInterface, Sequelize) {
    await queryInterface.dropTable('Registers');
  }
};