mtgjson / mtgsqlive

MTGJSON build scripts to generate alternative data formats
https://mtgjson.com
MIT License
54 stars 32 forks source link

Add boosterName and unique constraint for relevant tables #97

Closed dan-kez closed 1 year ago

dan-kez commented 1 year ago

This should fix https://github.com/mtgjson/mtgsqlive/issues/96 .

This PR adds boosterName as a column to setBoosterSheets and setBoosterSheetCards. Sheets can have the same name across packs but have different weights and contents as per taw on discord.

A better schema design would likely be to add a foreign key to table of setName, sheetName, boosterName to minimize disk space. However, that would be a large breaking change for existing users.

I also added a unique constraint to these tables to help mitigate a similar problem from occurring in the future.

If there is a different preferred approach please let me know!