-- Dados cadastrais da empresa (tenant) para o painel RH — CNPJ e endereço.
-- Execute após 01_core_schema.sql.

SET NAMES utf8mb4;

ALTER TABLE `tenants`
  ADD COLUMN `cnpj` CHAR(14) NULL DEFAULT NULL COMMENT 'Somente dígitos' AFTER `slug`,
  ADD COLUMN `legal_name` VARCHAR(200) NULL DEFAULT NULL COMMENT 'Razão social' AFTER `cnpj`,
  ADD COLUMN `trade_name` VARCHAR(200) NULL DEFAULT NULL COMMENT 'Nome fantasia' AFTER `legal_name`,
  ADD COLUMN `company_phone` VARCHAR(30) NULL DEFAULT NULL AFTER `trade_name`,
  ADD COLUMN `company_cep` VARCHAR(10) NULL DEFAULT NULL AFTER `company_phone`,
  ADD COLUMN `company_street` VARCHAR(200) NULL DEFAULT NULL AFTER `company_cep`,
  ADD COLUMN `company_number` VARCHAR(20) NULL DEFAULT NULL AFTER `company_street`,
  ADD COLUMN `company_complement` VARCHAR(120) NULL DEFAULT NULL AFTER `company_number`,
  ADD COLUMN `company_neighborhood` VARCHAR(120) NULL DEFAULT NULL AFTER `company_complement`,
  ADD COLUMN `company_city` VARCHAR(120) NULL DEFAULT NULL AFTER `company_neighborhood`,
  ADD COLUMN `company_state` CHAR(2) NULL DEFAULT NULL AFTER `company_city`,
  ADD UNIQUE KEY `uk_tenants_cnpj` (`cnpj`);
