'use strict';

module.exports = {
  async up(queryInterface, Sequelize) {
    await queryInterface.addColumn('document', 'file_path', {
      type: Sequelize.STRING(500),
      allowNull: true,
      comment: 'Path to the uploaded document file (PDF)'
    });

    await queryInterface.addColumn('document', 'file_name', {
      type: Sequelize.STRING(255),
      allowNull: true,
      comment: 'Original filename of the uploaded document'
    });

    await queryInterface.addColumn('document', 'file_size', {
      type: Sequelize.INTEGER,
      allowNull: true,
      comment: 'Size of the document file in bytes'
    });

    await queryInterface.addColumn('document', 'file_type', {
      type: Sequelize.STRING(50),
      allowNull: true,
      comment: 'MIME type of the document file (e.g., application/pdf)'
    });
  },

  async down(queryInterface, Sequelize) {
    await queryInterface.removeColumn('document', 'file_path');
    await queryInterface.removeColumn('document', 'file_name');
    await queryInterface.removeColumn('document', 'file_size');
    await queryInterface.removeColumn('document', 'file_type');
  }
};
