add price tracking to collections and implement total value calculation

This commit is contained in:
Matthieu
2025-11-27 11:56:31 +01:00
parent 359cc61115
commit 24023570c7
2 changed files with 44 additions and 4 deletions

View File

@@ -0,0 +1,9 @@
-- Add price_usd column to collections table
ALTER TABLE collections
ADD COLUMN IF NOT EXISTS price_usd DECIMAL(10, 2) DEFAULT 0;
-- Create index for faster price calculations
CREATE INDEX IF NOT EXISTS idx_collections_price ON collections(price_usd);
-- Add comment
COMMENT ON COLUMN collections.price_usd IS 'USD price of the card at time of addition/update';