'use strict';
/** @type {import('sequelize-cli').Migration} */
module.exports = {
  async up(queryInterface, Sequelize) {
    await queryInterface.createTable('Products', {
      id: {
        allowNull: false,
        autoIncrement: true,
        primaryKey: true,
        type: Sequelize.INTEGER
      },
      sku: {
        type: Sequelize.STRING
      },
      name: {
        type: Sequelize.STRING
      },
      description: {
        type: Sequelize.TEXT
      },
      categoryId: {
        type: Sequelize.INTEGER
      },
      brandId: {
        type: Sequelize.INTEGER
      },
      unitPrice: {
        type: Sequelize.DECIMAL
      },
      costPrice: {
        type: Sequelize.DECIMAL
      },
      barcode: {
        type: Sequelize.STRING
      },
      imageUrl: {
        type: Sequelize.STRING
      },
      unitOfMeasure: {
        type: Sequelize.STRING
      },
      stock: {
        type: Sequelize.STRING
      },
      taxRate: {
        type: Sequelize.DECIMAL
      },
      taxType: {
        type: Sequelize.DECIMAL
      },
      isTrackInventory: {
        type: Sequelize.BOOLEAN
      },
      minStock: {
        type: Sequelize.INTEGER
      },

      maxStock: {
        type: Sequelize.INTEGER
      },
      reorderLevel: {
        type: Sequelize.INTEGER
      },
      reorderQuantity: {
        type: Sequelize.INTEGER
      },
      isActive: {
        type: Sequelize.BOOLEAN
      },
      createdAt: {
        allowNull: false,
        type: Sequelize.DATE
      },
      updatedAt: {
        allowNull: false,
        type: Sequelize.DATE
      }
    });
  },
  async down(queryInterface, Sequelize) {
    await queryInterface.dropTable('Products');
  }
};