-- Aggie-server counterpart of add_financial_entity_extraction_guidance.sql (structure only).
-- Idempotent — safe to re-run.
-- Deploy: mysql -u <user> -p 'stacie_Aggie_v1.0' < db/aggie_add_financial_entity_extraction_guidance.sql

USE `stacie_Aggie_v1.0`;

SET @col_exists = (SELECT COUNT(*) FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'dim_financial_entities' AND COLUMN_NAME = 'extraction_guidance_text');
SET @sql = IF(@col_exists = 0, 'ALTER TABLE dim_financial_entities ADD COLUMN extraction_guidance_text TEXT NULL', 'SELECT 1');
PREPARE stmt FROM @sql; EXECUTE stmt; DEALLOCATE PREPARE stmt;
