MTG Copilot Docs
Data model

Precon decks

Preconstructed decks as shipped by Wizards, with their commanders and metadata.

11 columns. Every value below is generated from the provenance registry.

FieldTypeSourceUpdatedWritten by
idstringcalculatedneverdatabase
Internal UUID primary key.
file_namestringmtgjsonon set releasescripts/ingest-mtgjson.ts (precons)
MTGJSON DeckList fileName — the unique product identity.
namestringmtgjsonon set releasescripts/ingest-mtgjson.ts (precons)
Product display name.
set_codestring | nullmtgjsonon set releasescripts/ingest-mtgjson.ts (precons)
Owning set (FK to sets); NULL when MTGJSON's deck code isn't a known set.
release_datestring | nullmtgjsonon set releasescripts/ingest-mtgjson.ts (precons)
Product release date.
deck_typestring | nullmtgjsonon set releasescripts/ingest-mtgjson.ts (precons)
Product type (Commander Deck, Jumpstart, Secret Lair Drop, …).
source_urlstring | nullmtgjsonon set releasescripts/ingest-mtgjson.ts (precons)
MTGJSON-provided source/reference URL.
card_countnumbercalculatedon set releaserefresh_precon_summaries(), called by scripts/mtgjson/precons.ts, scripts/mtgjson/relink.ts and the card chain
Commander and main-deck cards, counting copies.
commander_namestring | nullcalculatedon set releaserefresh_precon_summaries(), called by scripts/mtgjson/precons.ts, scripts/mtgjson/relink.ts and the card chain
The commanders' names in name order, joined with " // "; null without a commander.
commander_imagestring | nullcalculatedon set releaserefresh_precon_summaries(), called by scripts/mtgjson/precons.ts, scripts/mtgjson/relink.ts and the card chain
The first commander's card image, by name; null without one.
color_identitystring[]calculatedon set releaserefresh_precon_summaries(), called by scripts/mtgjson/precons.ts, scripts/mtgjson/relink.ts and the card chain
The union of the commanders' colour identities; empty without a commander.

TypeScript model

interface precon_decks {
  id:              string
  file_name:       string
  name:            string
  set_code:        string | null
  release_date:    string | null
  deck_type:       string | null
  source_url:      string | null
  card_count:      number
  commander_name:  string | null
  commander_image: string | null
  color_identity:  string[]
}

On this page