Files
TradarrV2/backend/internal/database/migrations/000014_user_asset_figi.down.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

7 lines
373 B
SQL

-- Refuse rollback if multiple FIGIs share a symbol; never delete rows to fit
-- the old constraint. Back up and resolve that incompatibility explicitly.
ALTER TABLE user_assets ADD CONSTRAINT user_assets_user_id_symbol_key UNIQUE (user_id, symbol);
DROP INDEX user_assets_legacy_symbol_unique;
DROP INDEX user_assets_figi_unique;
ALTER TABLE user_assets DROP COLUMN figi;