feat(portfolio): add asset name field across API, DB, and CLI

This commit is contained in:
2026-04-03 14:51:36 +00:00
parent aeb4f10fd0
commit 0654b24d66
13 changed files with 115 additions and 19 deletions
+5 -2
View File
@@ -5,7 +5,7 @@
This document defines the database schema in an AI-agent-friendly format.
- Source of truth: Alembic revisions in `migrations/versions`
- Current baseline revision: `20260403_0007`
- Current baseline revision: `20260403_0008`
- Baseline files:
- `migrations/versions/20260403_0001_initial_portfolio_schema.py`
- `migrations/versions/20260403_0002_strategy_set_columns.py`
@@ -14,6 +14,7 @@ This document defines the database schema in an AI-agent-friendly format.
- `migrations/versions/20260403_0005_auth_user_fields_and_tokens.py`
- `migrations/versions/20260403_0006_bot_principals_and_bot_tokens.py`
- `migrations/versions/20260403_0007_bot_principal_permission_only.py`
- `migrations/versions/20260403_0008_portfolio_name_column.py`
## 2. Scope
@@ -145,7 +146,7 @@ Purpose:
Current baseline note:
- The columns below describe the currently migrated schema through revision `20260403_0005`.
- The columns below describe the currently migrated schema through revision `20260403_0008`.
Columns:
@@ -154,6 +155,7 @@ Columns:
| portfolio_id | Text | NO | - | Primary Key |
| broker | Text | NO | "kis" | Broker code |
| status | Text | NO | "enabled" | Portfolio status |
| name | Text | NO | - | Asset name |
| symbol | Text | NO | - | Trading symbol |
| cash_balance | Float | NO | - | Current cash balance |
| asset_quantity | Float | NO | - | Current asset quantity |
@@ -294,3 +296,4 @@ When schema changes:
| 20260403_0005 | migrations/versions/20260403_0005_auth_user_fields_and_tokens.py | Add password/permission/login fields to `users` and create `auth_tokens` table |
| 20260403_0006 | migrations/versions/20260403_0006_bot_principals_and_bot_tokens.py | Add `bot_principals` table and `auth_tokens.bot_principal_id` for bot API key management |
| 20260403_0007 | migrations/versions/20260403_0007_bot_principal_permission_only.py | Remove `bot_principals.owner_user_id` and enforce bot-local `permission` model |
| 20260403_0008 | migrations/versions/20260403_0008_portfolio_name_column.py | Add non-null `portfolios.name` (asset display name), backfilled from `symbol` |