mtgcoll/resources/migrations/00020_remove_card_table_owned_count_columns.up.sql
Gered 4b2bc86866 sql migrations to add lists_card_quantities table
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
2016-07-24 12:51:20 -04:00

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;