trading-platform-database-v2/ddl/01-schemas.sql
Adrian Flores Cortes 2a6d8367d8 feat: Update DDL schemas and add new structures
DDL updates:
- Update extensions and schemas configuration
- Add sessions table for auth schema
- Update education schema (videos, install/uninstall scripts)
- Add backtest_runs and llm_signals tables for ML schema

Scripts:
- Update database creation and migration scripts
- Add DDL validation script

New:
- Add migrations directory structure
- Add production seeds for auth, investment, market_data, trading

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 12:24:23 -06:00

46 lines
1.7 KiB
SQL

-- ============================================================================
-- OrbiQuant IA - Trading Platform
-- File: 01-schemas.sql
-- Description: Database schemas creation
-- ============================================================================
-- Authentication and User Management
CREATE SCHEMA IF NOT EXISTS auth;
COMMENT ON SCHEMA auth IS 'Authentication, authorization, and user management';
-- Education and Learning
CREATE SCHEMA IF NOT EXISTS education;
COMMENT ON SCHEMA education IS 'Educational content, courses, and learning progress';
-- Market Data
CREATE SCHEMA IF NOT EXISTS market_data;
COMMENT ON SCHEMA market_data IS 'Market tickers, OHLCV data, and data staging';
-- Trading Operations
CREATE SCHEMA IF NOT EXISTS trading;
COMMENT ON SCHEMA trading IS 'Trading bots, orders, positions, and market data';
-- Investment Management
CREATE SCHEMA IF NOT EXISTS investment;
COMMENT ON SCHEMA investment IS 'Investment products, accounts, and transactions';
-- Portfolio Management
CREATE SCHEMA IF NOT EXISTS portfolio;
COMMENT ON SCHEMA portfolio IS 'User portfolios, allocations, and financial goals';
-- Financial Operations
CREATE SCHEMA IF NOT EXISTS financial;
COMMENT ON SCHEMA financial IS 'Wallets, payments, subscriptions, and financial transactions';
-- Machine Learning
CREATE SCHEMA IF NOT EXISTS ml;
COMMENT ON SCHEMA ml IS 'ML models, predictions, and feature store';
-- Large Language Models
CREATE SCHEMA IF NOT EXISTS llm;
COMMENT ON SCHEMA llm IS 'LLM conversations, messages, and user preferences';
-- Audit and Compliance
CREATE SCHEMA IF NOT EXISTS audit;
COMMENT ON SCHEMA audit IS 'Audit logs, security events, and compliance tracking';