Files
TradarrV2/backend/internal/database/migrations/000014_user_asset_figi.up.sql
Blomios 8f42c30ec6 feat(assets): track selected indices by FIGI
Add the nullable FIGI migration, owner-scoped asset identity operations, and the explicit index search and selection flow.

Refs #4

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-11-20 22:31:52 +01:00

5 lines
328 B
SQL

ALTER TABLE user_assets ADD COLUMN figi TEXT NULL;
ALTER TABLE user_assets DROP CONSTRAINT user_assets_user_id_symbol_key;
CREATE UNIQUE INDEX user_assets_figi_unique ON user_assets (user_id, figi) WHERE figi IS NOT NULL;
CREATE UNIQUE INDEX user_assets_legacy_symbol_unique ON user_assets (user_id, symbol) WHERE figi IS NULL;