-- ============================================================================
-- OrbiQuant IA - Trading Platform
-- File: 00-extensions.sql
-- Description: PostgreSQL extensions required globally
-- ============================================================================

-- UUID generation extension
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";

-- Cryptographic functions for password hashing and token generation
CREATE EXTENSION IF NOT EXISTS "pgcrypto";

-- Network address types and functions
CREATE EXTENSION IF NOT EXISTS "citext";

-- Full text search
CREATE EXTENSION IF NOT EXISTS "unaccent";

-- Trigram similarity for fuzzy text matching
CREATE EXTENSION IF NOT EXISTS "pg_trgm";

COMMENT ON EXTENSION "uuid-ossp" IS 'UUID generation functions';
COMMENT ON EXTENSION "pgcrypto" IS 'Cryptographic functions for secure password and token handling';
COMMENT ON EXTENSION "citext" IS 'Case-insensitive text type for email addresses';
COMMENT ON EXTENSION "unaccent" IS 'Text search dictionary that removes accents';
COMMENT ON EXTENSION "pg_trgm" IS 'Trigram matching for similarity searches';
