text: module.exports = {
    up: (queryInterface, Sequelize) =>
      queryInterface.createTable('establishments', {
        id: {
          type: Sequelize.INTEGER,
          allowNull: false,
          autoIncrement: true,
          primaryKey: true,
        },
        company_name: {
          type: Sequelize.STRING,
          allowNull: false,
        },
        social_reason: {
          type: Sequelize.STRING,
          allowNull: false,
        },
        email: {
          type: Sequelize.STRING,
          allowNull: false,
          unique: true,
        },
        password_hash: {
          type: Sequelize.STRING,
          allowNull: false,
        },
        phone: {
          type: Sequelize.STRING,
          allowNull: false,
          unique: true,
        },
        cnpj: {
          type: Sequelize.STRING,
          allowNull: false,
          unique: true,
        },
        bio: {
          type: Sequelize.TEXT,
          allowNull: true,
        },
        id_hash: {
          type: Sequelize.STRING,
          allowNull: true,
        },
        active: {
          type: Sequelize.BOOLEAN,
          allowNull: false,
        },
        terms_of_use: {
          type: Sequelize.BOOLEAN,
          allowNull: false,
          defaultValue: false,
        },
        avatar_id: {
          type: Sequelize.INTEGER,
          references: {
            model: 'files',
            key: 'id'
          },
          onUpdate: 'CASCADE',
          onDelete: 'SET NULL',
          allowNull: true,
        },
        address_id: {
          type: Sequelize.INTEGER,
          references: {
            model: 'addresses',
            key: 'id'
          },
          onUpdate: 'CASCADE',
          onDelete: 'SET NULL',
          allowNull: true,
        },
        created_at: {
          type: Sequelize.DATE,
          allowNull: false,
        },
        updated_at: {
          type: Sequelize.DATE,
          allowNull: false,
        },
      }),
  
    down: (queryInterface) => {
      return queryInterface.dropTable('establishments');
    },
  };
  