this replaces the old cards.owned_count and cards.owned_foil_count columns. queries that used to use those will now need to join to lists_card_quantities on card_id/list_id this allows the same types of card lists as before to be retrieved but show quantity counts from any lists instead of just the "Owned" list
15 lines
418 B
SQL
15 lines
418 B
SQL
-- cards.owned_count
|
|
|
|
DROP TRIGGER IF EXISTS cards_update_owned_count_trigger ON collection;
|
|
DROP FUNCTION IF EXISTS update_card_owned_count();
|
|
|
|
ALTER TABLE cards DROP COLUMN IF EXISTS owned_count;
|
|
|
|
|
|
-- cards.owned_foil_count
|
|
|
|
DROP TRIGGER IF EXISTS cards_update_owned_foil_count_trigger ON collection;
|
|
DROP FUNCTION IF EXISTS update_card_owned_foil_count();
|
|
|
|
ALTER TABLE cards DROP COLUMN IF EXISTS owned_foil_count;
|