trading-platform-database-v2/ddl/schemas/portfolio/00-enums.sql
Adrian Flores Cortes 3fbb1c21e6 [OQI-008] feat: Add portfolio DDL schema with tables for portfolios, allocations, goals
- 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>
2026-01-25 08:20:48 -06:00

37 lines
786 B
SQL

-- =====================================================
-- PORTFOLIO SCHEMA - ENUMS
-- =====================================================
-- Description: Enumerations for portfolio management
-- Schema: portfolio
-- Author: Database Agent
-- Date: 2026-01-25
-- =====================================================
-- Risk profile (shared with investment schema)
CREATE TYPE portfolio.risk_profile AS ENUM (
'conservative',
'moderate',
'aggressive'
);
-- Goal status
CREATE TYPE portfolio.goal_status AS ENUM (
'active',
'completed',
'abandoned'
);
-- Rebalance action
CREATE TYPE portfolio.rebalance_action AS ENUM (
'buy',
'sell',
'hold'
);
-- Allocation status
CREATE TYPE portfolio.allocation_status AS ENUM (
'active',
'inactive',
'rebalancing'
);