'use strict';
/** @type {import('sequelize-cli').Migration} */
module.exports = {
  async up(queryInterface, Sequelize) {
    await queryInterface.createTable('invoicedetails', {
      inv_id: {
        primaryKey: true,
        type: Sequelize.STRING,
        onUpdate: 'CASCADE',
        onDelete: 'CASCADE',
        references: {
          model: 'invoices',
          key: 'inv_id'
        }
      },
      inv_date: {
        type: Sequelize.STRING
      },
      inv_duedate: {
        type: Sequelize.STRING
      },
      client_name: {
        type: Sequelize.STRING
      },
      client_address: {
        type: Sequelize.STRING
      },
      sub_total: {
        type: Sequelize.STRING
      },
      ppn: {
        type: Sequelize.STRING
      },
      credit: {
        type: Sequelize.STRING
      },
      total: {
        type: Sequelize.STRING
      },
      createdAt: {
        allowNull: false,
        type: Sequelize.DATE
      },
      updatedAt: {
        allowNull: false,
        type: Sequelize.DATE
      }
    });
  },
  async down(queryInterface, Sequelize) {
    await queryInterface.dropTable('invoicedetails');
  }
};