- 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>
37 lines
786 B
SQL
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'
|
|
);
|