-- ============================================================================
-- Agregar campos de empresa a la tabla contracts
-- Permite que cada contrato tenga sus propios datos de empresa
-- ============================================================================

USE contratos_db;

ALTER TABLE contracts
ADD COLUMN company_name VARCHAR(255) NULL AFTER logo_path,
ADD COLUMN company_nit VARCHAR(100) NULL AFTER company_name,
ADD COLUMN company_address VARCHAR(500) NULL AFTER company_nit,
ADD COLUMN company_phone VARCHAR(50) NULL AFTER company_address,
ADD COLUMN company_email VARCHAR(255) NULL AFTER company_phone,
ADD COLUMN company_website VARCHAR(255) NULL AFTER company_email,
ADD COLUMN company_city VARCHAR(255) NULL AFTER company_website;

-- Índice para búsquedas por nombre de empresa
ALTER TABLE contracts ADD INDEX idx_company_name (company_name);

SELECT 'Campos de empresa agregados exitosamente a contracts' as mensaje;
