- Added portfolio schema to 01-schemas.sql - Created enums: risk_profile, goal_status, rebalance_action, allocation_status - Created tables: portfolios, portfolio_allocations, portfolio_goals - Created tables: rebalance_history, portfolio_snapshots - Added triggers for updated_at and goal progress calculations - Added indexes for performance Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
42 lines
1.5 KiB
SQL
42 lines
1.5 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';
|
|
|
|
-- 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';
|