PennyDreadfulMTG / Penny-Dreadful-Tools

A suite of tools for the Penny Dreadful MTGO community
https://pennydreadfulmagic.com
MIT License
40 stars 28 forks source link

Because of the two gatherlings one or two tournaments are missing from pdm/gatherling.com #6214

Closed bakert closed 4 years ago

bakert commented 5 years ago
InvalidDataException
Unable to find deck with gatherling id '66803'

Stack Trace:
Python traceback
  File "run.py", line 125, in <module>
    run()
  File "run.py", line 69, in task
    run_all_tasks(module)
  File "run.py", line 112, in run_all_tasks
    s.scrape() # type: ignore
  File "/home/discord/decksite/decksite/scrapers/gatherling.py", line 28, in scrape
    i = tournament(url, name)
  File "/home/discord/decksite/decksite/scrapers/gatherling.py", line 56, in tournament
    n = add_decks(dt, competition_id, final, s)
  File "/home/discord/decksite/decksite/scrapers/gatherling.py", line 99, in add_decks
    add_ids(matches, ds)
  File "/home/discord/decksite/decksite/scrapers/gatherling.py", line 259, in add_ids
    m['right_id'] = lookup(m['right_identifier']).id if m['right_identifier'] else None
  File "/home/discord/decksite/decksite/scrapers/gatherling.py", line 256, in lookup
    raise InvalidDataException("Unable to find deck with gatherling id '{0}'".format(gatherling_id))

Exception_hash: c554a3761e73af36c88f8d7ada113bc450c52f72

Traceback (most recent call last):
  File "/home/discord/decksite/decksite/scrapers/gatherling.py", line 254, in lookup
    return decks_by_identifier[gatherling_id]
KeyError: '66803'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "run.py", line 125, in <module>
    run()
  File "run.py", line 34, in run
    task(sys.argv)
  File "run.py", line 69, in task
    run_all_tasks(module)
  File "run.py", line 112, in run_all_tasks
    s.scrape() # type: ignore
  File "/home/discord/decksite/decksite/scrapers/gatherling.py", line 28, in scrape
    i = tournament(url, name)
  File "/home/discord/decksite/decksite/scrapers/gatherling.py", line 56, in tournament
    n = add_decks(dt, competition_id, final, s)
  File "/home/discord/decksite/decksite/scrapers/gatherling.py", line 99, in add_decks
    add_ids(matches, ds)
  File "/home/discord/decksite/decksite/scrapers/gatherling.py", line 259, in add_ids
    m['right_id'] = lookup(m['right_identifier']).id if m['right_identifier'] else None
  File "/home/discord/decksite/decksite/scrapers/gatherling.py", line 256, in lookup
    raise InvalidDataException("Unable to find deck with gatherling id '{0}'".format(gatherling_id))
shared.pd_exception.InvalidDataException: Unable to find deck with gatherling id '66803'
bakert commented 5 years ago

Somehow this works on local.

bakert commented 5 years ago

This is because prod has a tournament from "new gatherling" but that was not present when the latest tournament happened. So now there are two decks with the same identifier, kinda. Will need some manual surgery. New gatherling is still live at dev.gatherling.one

bakert commented 5 years ago

We need to reconcile these things but there will be duplicate deck ids between the two gatherling dbs. It's kinda ugly. Nicest would be to fix up Gatherling itself to have all tournaments but might be ok just to make sure pdm has everything with a bit of hackery.

bakert commented 5 years ago

The affected events here are:

Penny Dreadful Mondays 11.07 Penny Dreadful Thursdays 11.07

bakert commented 5 years ago

The site HAS a PDM 11.07 but it does not appear in Gatherling's current prod db. The site does NOT have a PDT 11.07.

Both of these events appear in the alternate Gatherling db (once upon a time this was gatherling.one but now both URLs point at current prod).

bakert commented 5 years ago

@silasary Would you be confident in how to move across these two tournaments into current prod Gatherling db with new deck ids?

Alternate plan is to just get PDT 11.07 into the decksite db and not care about adding them to Gatherling. The scraper will continue to die but I think that will go away when all this falls out of the most recent 100 PD events on gatherling (quite soon).

Alternate alternate plan is to let PDT 11.07 be missing forever.

I think those three are in order of desirability but also reverse order of difficulty.

bakert commented 5 years ago

Addendum: Penny Dreadful Sundays 11.08 is also missing but I think that's because it was canceled not because it's in the other Gatherling db. Probably worth checking.

bakert commented 4 years ago
MariaDB [gatherling_one]> SELECT * FROM events WHERE name IN ('Penny Dreadful Thursdays 11.07', 'Penny Dreadful Mondays 11.07', 'Penny Dreadful Sundays 11.08');
+---------------------+----------------+------------+--------+---------------------------------+--------------------------------+--------+--------+--------------------------+---------------------------------------------+-----------+-----------+----------+----------------+--------+--------+---------------+-------------------+------------------+------------+-----------------------+---------------+----------------+------------------+
| start               | format         | host       | kvalue | metaurl                         | name                           | number | season | series                   | threadurl                                   | reporturl | finalized | cohost   | prereg_allowed | pkonly | active | current_round | player_reportable | player_editdecks | prereg_cap | player_reported_draws | private_decks | private_finals | late_entry_limit |
+---------------------+----------------+------------+--------+---------------------------------+--------------------------------+--------+--------+--------------------------+---------------------------------------------+-----------+-----------+----------+----------------+--------+--------+---------------+-------------------+------------------+------------+-----------------------+---------------+----------------+------------------+
| 2019-03-11 19:00:00 | Penny Dreadful | Briar_Moss |     16 | https://pennydreadfulmagic.com/ | Penny Dreadful Mondays 11.07   |      7 |     11 | Penny Dreadful Mondays   | https://pennydreadfulmagic.com/tournaments/ |           |         1 | j_meka   |              1 |      0 |      0 |             7 |                 1 |                1 |          0 |                     0 |             1 |              1 |                3 |
| 2011-03-17 13:30:00 | Penny Dreadful | MrSad      |     16 | https://pennydreadfulmagic.com/ | Penny Dreadful Sundays 11.08   |      8 |     11 | Penny Dreadful Sundays   | https://pennydreadfulmagic.com/tournaments/ |           |         1 | bakert99 |              1 |      0 |      0 |             1 |                 1 |                1 |          0 |                     0 |             1 |              1 |                3 |
| 2019-03-14 19:00:00 | Penny Dreadful | silasary   |     16 | https://pennydreadfulmagic.com/ | Penny Dreadful Thursdays 11.07 |      7 |     11 | Penny Dreadful Thursdays | https://pennydreadfulmagic.com/tournaments/ |           |         1 | j_meka   |              1 |      0 |      0 |             3 |                 1 |                1 |          0 |                     0 |             1 |              1 |                3 |
+---------------------+----------------+------------+--------+---------------------------------+--------------------------------+--------+--------+--------------------------+---------------------------------------------+-----------+-----------+----------+----------------+--------+--------+---------------+-------------------+------------------+------------+-----------------------+---------------+----------------+------------------+
3 rows in set (0.00 sec)
bakert commented 4 years ago
MariaDB [gatherling_one]> SELECT * FROM entries WHERE event IN ('Penny Dreadful Thursdays 11.07', 'Penny Dreadful Mondays 11.07', 'Penny Dreadful Sundays 11.08');
+--------------------------------+--------------------+-------+-------+---------+-------+---------------------+------------+
| event                          | player             | medal | deck  | ignored | notes | registered_at       | drop_round |
+--------------------------------+--------------------+-------+-------+---------+-------+---------------------+------------+
| Penny Dreadful Mondays 11.07   | -DiamondDust-      | t4    | 10581 |    NULL | NULL  | 2019-03-12 10:02:54 |       NULL |
| Penny Dreadful Mondays 11.07   | clevernamegoeshere | dot   | 10578 |    NULL | NULL  | 2019-03-12 08:42:24 |          2 |
| Penny Dreadful Mondays 11.07   | DrumDevil          | dot   | 10580 |    NULL | NULL  | 2019-03-12 10:02:43 |          3 |
| Penny Dreadful Mondays 11.07   | Hematite12         | t4    | 10583 |    NULL | NULL  | 2019-03-12 10:03:06 |       NULL |
| Penny Dreadful Mondays 11.07   | Kaitoukid111       | dot   | 10582 |    NULL | NULL  | 2019-03-12 10:02:35 |          0 |
| Penny Dreadful Mondays 11.07   | LeoKing            | dot   | 10587 |    NULL | NULL  | 2019-03-12 10:36:34 |          2 |
| Penny Dreadful Mondays 11.07   | lovetapsmtg        | dot   | 10588 |    NULL | NULL  | 2019-03-12 11:01:04 |       NULL |
| Penny Dreadful Mondays 11.07   | nanaiper           | 1st   | 10579 |    NULL | NULL  | 2019-03-12 09:40:50 |       NULL |
| Penny Dreadful Mondays 11.07   | Peridot_cow        | dot   | 10577 |    NULL | NULL  | 2019-03-12 08:58:29 |       NULL |
| Penny Dreadful Mondays 11.07   | rakura             | dot   | 10576 |    NULL | NULL  | 2019-03-12 08:29:03 |          1 |
| Penny Dreadful Mondays 11.07   | Rfunay             | dot   | 10589 |    NULL | NULL  | 2019-03-11 06:45:47 |          1 |
| Penny Dreadful Mondays 11.07   | syu_tei            | 2nd   | 10584 |    NULL | NULL  | 2019-03-12 10:03:28 |       NULL |
| Penny Dreadful Sundays 11.08   | bakert99           | dot   | 10613 |    NULL | NULL  | 2019-03-14 18:26:32 |       NULL |
| Penny Dreadful Thursdays 11.07 | AVPfanJoe          | dot   | 10619 |    NULL | NULL  | 2019-03-14 19:51:08 |       NULL |
| Penny Dreadful Thursdays 11.07 | bakert99           | dot   | 10612 |    NULL | NULL  | 2019-03-14 18:25:30 |       NULL |
| Penny Dreadful Thursdays 11.07 | clevernamegoeshere | dot   | 10617 |    NULL | NULL  | 2019-03-14 19:14:50 |       NULL |
| Penny Dreadful Thursdays 11.07 | EternalParadox38   | dot   | 10616 |    NULL | NULL  | 2019-03-14 18:52:51 |       NULL |
| Penny Dreadful Thursdays 11.07 | Kaitoukid111       | dot   | 10615 |    NULL | NULL  | 2019-03-14 18:29:20 |          1 |
| Penny Dreadful Thursdays 11.07 | lovetapsmtg        | dot   | 10618 |    NULL | NULL  | 2019-03-14 19:16:21 |       NULL |
| Penny Dreadful Thursdays 11.07 | rakura             | dot   | 10609 |    NULL | NULL  | 2019-03-14 14:49:09 |          1 |
| Penny Dreadful Thursdays 11.07 | Rfunay             | dot   | 10610 |    NULL | NULL  | 2019-03-14 15:27:18 |       NULL |
| Penny Dreadful Thursdays 11.07 | seky               | dot   | 10611 |    NULL | NULL  | 2019-03-14 18:25:00 |       NULL |
+--------------------------------+--------------------+-------+-------+---------+-------+---------------------+------------+
22 rows in set (0.00 sec)
bakert commented 4 years ago
MariaDB [gatherling_one]> SELECT * FROM decks WHERE id IN (SELECT deck FROM entries WHERE event IN ('Penny Dreadful Thursdays 11.07', 'Penny Dreadful Mondays 11.07', 'Penny Dreadful Sundays 11.08'));
+---------------+-------+--------------------+-------+------------------------------------------+------------------------------------------+------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------+-------------+----------------+-------+---------------------+
| archetype     | id    | name               | notes | deck_hash                                | sideboard_hash                           | whole_hash                               | deck_contents_cache                                                                                                                                                                                                                                                                                                                                                                                                                                                  | playername         | deck_colors | format         | tribe | created_date        |
+---------------+-------+--------------------+-------+------------------------------------------+------------------------------------------+------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------+-------------+----------------+-------+---------------------+
| Combo         | 10576 | PD Storm           |       | 1b93985c75f3704c82f1bcf41907516af770a7d4 | 15c751304041e9854732e558fb758b16cb8baa5a | 594f8f1646f166fd47e1b913b3147529931c06c2 | Frantic Search|Crumbling Vestige|Seething Song|Locket of Yesterdays|Hazoret's Undying Fury|Goblin Electromancer|Recoup|Pirate's Pillage|Mirrodin's Core|Desperate Ravings|Nagging Thoughts|Primal Amulet|Rakdos Signet|Island|Mountain|Swamp|Tendrils of Agony|Treasure Cruise|Orbs of Warding|Persecute|Tendrils of Agony|Temporal Fissure|Locket of Yesterdays|Early Frost|Flashfreeze                                                                             | rakura             | bru         | Penny Dreadful | NULL  | 2019-03-12 08:55:08 |
| Aggro         | 10577 | PD Selesnya Tokens |       | eec18ab7bc6b60a2522e735c65ee36daa922555c | 652a99999624d5d5308c9d871c6ccba81c7d7669 | 5a567f7b45f79a87c1214d0b5be8ef66507e09cd | Avacyn's Pilgrim|Barkshell Blessing|Collective Blessing|Cryptolith Rite|Emmara, Soul of the Accord|Flower/Flourish|Forest|Fortified Village|Loam Dryad|Overrun|Plains|Raise the Alarm|Scatter the Seeds|Triplicate Spirits|Wingmate Roc|Loxodon Hierarch|Sentinel Totem|Sundering Growth|Sunlance                                                                                                                                                                    | Peridot_cow        | gw          | Penny Dreadful | NULL  | 2019-03-12 09:03:30 |
| Unclassified  | 10578 | Suicide Black      |       | 447e2089c9bd04b2657b38adc87a69cf9960593b | ce94a83705e5a75253a45c2e0e078009d03cc089 | 0d8eeab5a4881c08d1fcd3ebc36aa265d51dd1a5 | Bloodsoaked Champion|Rakdos Cackler|Gnarled Scarhide|Black Knight|Asylum Visitor|Despoiler of Souls|Cryptborn Horror|Vampire Nighthawk|Ulcerate|Bile Blight|Vampire Lacerator|Swamp|Dark Tutelage|Stupor|Lay Bare the Heart|Golden Demise|Deathmark|Withered Wretch                                                                                                                                                                                                  | clevernamegoeshere | br          | Penny Dreadful | NULL  | 2019-03-12 09:06:48 |
| Control       | 10579 | Grixis Control     |       | a88d74fb4ed441703dcd4270fc67ec3b0f15304b | 13d3e042f6fb061ac5e43f1650a9055e4b96c31e | cd203b2d8a8bad2600ea4d365abf9214fa8df0fb | Swamp|Foreboding Ruins|Careful Consideration|Lavaclaw Reaches|Cruel Ultimatum|Think Twice|Mountain|Mirrodin's Core|Burst Lightning|Island|Vivid Crag|Radiant Flames|Choked Estuary|Thought Erasure|Treasure Cruise|Rune Snag|Bedeck/Bedazzle|Mystic Monastery|Sphinx of the Final Word|Forbid|Consuming Vapors|Ultimate Price|Sailor of Means|Utter End|Void|Smother|Slaughter Games|Negate|Detritivore|Bedeck/Bedazzle|Hand of Cruelty|Nature's Ruin|Radiant Flames | nanaiper           | bruw        | Penny Dreadful | NULL  | 2019-03-12 09:42:12 |
| Unclassified  | 10580 | UB Midrange        |       | 1c12e93946d0c01f336ca07c08e72ff7f87a5eb1 | 0ff12aca98ed8054e72a8922208bd4034a5c0969 | 4436a29f85c9e433a530e9279aa0c7e4da869f12 | Asylum Visitor|Nightveil Specter|Psychatog|Desecration Demon|Glyph Keeper|Tombstalker|Deep Analysis|Obsessive Search|Agony Warp|Bile Blight|Smother|Murder|Thought Erasure|Frantic Search|Ultimate Price|Far/Away|Treasure Cruise|Choked Estuary|Terror|Memorial to Genius|Sunken Hollow|Dead Weight|Island|Swamp|Lay Bare the Heart|Negate|Flaying Tendrils|Nature's Ruin|Underworld Connections|Steal Artifact|Withered Wretch                                     | DrumDevil          | bu          | Penny Dreadful | NULL  | 2019-03-12 10:03:09 |
| Unclassified  | 10581 | PD MBM             |       | 0c053f57f512a258087ba18e63594d60321f581c | 1be7ec1e4d0bb731bbafe99aed6c043901016765 | c1e7c637adaa9e782fb874d07e67ec37c0317f67 | Swamp|Costly Plunder|Fourth Bridge Prowler|Tribute to Hunger|Mimic Vat|Leechridden Swamp|Lashwrithe|Bile Blight|Braids, Cabal Minion|Vampire Nighthawk|Liliana's Specter|Phyrexian Rager|Dusk Legion Zealot|Burglar Rat|Mesmeric Fiend|Withered Wretch|Skinrender|Lay Bare the Heart|Bile Blight|Infinite Obliteration                                                                                                                                               | -DiamondDust-      | b           | Penny Dreadful | NULL  | 2019-03-12 10:03:13 |
| Unclassified  | 10582 | Otter-Glare (1)    |       | 10889e43ce612df3284f1676b6d5d035184f7a92 | 37009ad2c72798a95a8e69838b283303e9742b47 | 62b55f033dc8a5bd1cd2c845c6d7675ff7c15175 | Always Watching|Avacyn's Pilgrim|Benevolent Bodyguard|Bygone Bishop|Evolving Wilds|Forest|Fortified Village|Glare of Subdual|Invigorate|Kavu Predator|Knotvine Paladin|Plains|Precinct Captain|Silverblade Paladin|True Believer|Absolute Law|Glare of Subdual|Holy Mantle|Mentor of the Meek|Seal of Cleansing|True Believer|Vryn Wingmare                                                                                                                          | Kaitoukid111       | gw          | Penny Dreadful | NULL  | 2019-03-12 10:03:47 |
| Aggro         | 10583 | Red Rites          |       | ccc4c8ac5615bc9717a08c63192e1a8c4abda346 | bb95bceab96e5a9294f096bd2105429e052add6b | f3ce6ddb6164cad2e6deadd55e37e39abdb83386 | Chain Lightning|Dragon Fodder|Goblin Wardriver|Hordeling Outburst|Jackal Pup|Mountain|Rakdos Cackler|Rigging Runner|Rites of Initiation|Stromkirk Noble|Village Messenger|Arc Trail|Blood Knight|Goblin Cratermaker|Jinxed Idol|Vexing Shusher                                                                                                                                                                                                                       | Hematite12         | br          | Penny Dreadful | NULL  | 2019-03-12 10:04:09 |
| Aggro         | 10584 | Otter-Stompy       |       | 0d3cd6e83ca9bd15da1b5a365b271b1e621be9d4 | c9116c92f9e05c081940f37a184936a7414b71ab | d4c3c1125ac4c4fdc9649cf47cd19eb2921a7dfe | Kessig Prowler|Honored Hierarch|Sylvan Advocate|Kavu Predator|Lambholt Pacifist|Generous Patron|Leatherback Baloth|Thrash/Threat|Invigorate|Mountain|Forest|Game Trail|Spellshock|Savage Lands|Seedtime|Thrashing Brontodon|Flametongue Kavu|Sentinel Totem|Heartwood Storyteller|Spellshock                                                                                                                                                                         | syu_tei            | gr          | Penny Dreadful | NULL  | 2019-03-12 10:06:28 |
| Unclassified  | 10587 | RDW with P         |       | 9a1cad645330ea7e72ef3b4560722dba69a2148b | ac7048e2999cfefa6aa5dca77d3264b72a351ccf | 63dac33280c61ca82d1ff7b8a3285775cda9d334 | Falkenrath Exterminator|Stromkirk Noble|Rakdos Cackler|Tezzeret's Gambit|Stormblood Berserker|Incinerate|Volt Charge|Burst Lightning|Flame Javelin|Keldon Megaliths|Mountain|Thriving Grubs|Rage Forger|Slith Firewalker|Rampaging Ferocidon|Sentinel Totem|Shattering Blow|Manabarbs|Contagion Clasp|Slagstorm                                                                                                                                                      | LeoKing            | bru         | Penny Dreadful | NULL  | 2019-03-12 10:36:43 |
| Unclassified  | 10588 | White Aeropower    |       | 6543ae0cf8b9e7dc8d39d5fe9c2f7304499845f2 | fb26e5fa3dde97cc21cc41e234753a0e3d4b6e8b | a0837ee8a23aa26c5d7a5646c09b8f3dec3ff8ac | Honor of the Pure|Healer's Hawk|Rustwing Falcon|Soulcatchers' Aerie|Welkin Hawk|Plains|Duskrider Peregrine|Eyes in the Skies|Aven Riftwatcher|Doomed Traveler|Roc Egg|Faith's Shield|Kjeldoran Outpost|Hoofprints of the Stag|Sundering Growth|Sentinel Totem|Absolute Law                                                                                                                                                                                           | lovetapsmtg        | w           | Penny Dreadful | NULL  | 2019-03-12 11:01:49 |
| Unclassified  | 10589 | WW Penny Dreadful  |       | 899b2dbb4ef9f726c143fa1a7c1b1f10657a0ff0 | b5e16755f5f65f027e84a5e926a041318833206d | 79ecc88bc5df245d4727e92cd1f88b01030e75f0 | Kjeldoran Outpost|Plains|Brave the Elements|Doomed Traveler|Hunted Witness|Soldier of the Pantheon|Student of Warfare|Honor of the Pure|Knight of Meadowgrain|Precinct Captain|Banisher Priest|Bygone Bishop|Angel of Jubilation|Purify the Grave|Sunlance|Absolute Law|Mastery of the Unseen|Sundering Growth|Make a Stand|Stasis Snare                                                                                                                             | Rfunay             | w           | Penny Dreadful | NULL  | 2019-03-12 11:39:36 |
| Aggro         | 10609 | PD Rakdos Goblins  |       | 39021a67292d8af8a03dc28ef9a8fbeb3dcde67f | 144f8190c98775aedf118cb921f2533d3dc57568 | 554822667191c0c7643c358b943a712b46bd6b5a | Auntie's Hovel|Auntie's Snitch|Ember Hauler|Evolving Wilds|Goblin Cratermaker|Knucklebone Witch|Lightning Crafter|Mad Auntie|Mountain|Pyrewild Shaman|Quest for the Goblin Lord|Spike Jester|Swamp|Warren Pilferers|Wort, Boggart Auntie|Loxodon Warhammer|Goblin Outlander|Lightning Crafter|Smother|Ultimate Price                                                                                                                                                 | rakura             | br          | Penny Dreadful | NULL  | 2019-03-14 14:50:04 |
| Unclassified  | 10610 | WW Penny Dreadful  |       | 899b2dbb4ef9f726c143fa1a7c1b1f10657a0ff0 | b5e16755f5f65f027e84a5e926a041318833206d | 79ecc88bc5df245d4727e92cd1f88b01030e75f0 | Kjeldoran Outpost|Plains|Brave the Elements|Doomed Traveler|Hunted Witness|Soldier of the Pantheon|Student of Warfare|Honor of the Pure|Knight of Meadowgrain|Precinct Captain|Banisher Priest|Bygone Bishop|Angel of Jubilation|Purify the Grave|Sunlance|Absolute Law|Mastery of the Unseen|Sundering Growth|Make a Stand|Stasis Snare                                                                                                                             | Rfunay             | w           | Penny Dreadful | NULL  | 2019-03-14 15:27:45 |
| Unclassified  | 10611 | burn               |       | 1d1354daa2f39657a70f12416a500f47e3f2def2 | d2de65858d820d9c06d9dd8c04b5ea24433f0afe | c6eefc8a6cf22c5090348c204484eb928228c82f | Mountain|Burst Lightning|Chain Lightning|Vivid Crag|Abbot of Keral Keep|Magma Jet|Chandra's Phoenix|Incinerate|Firedrinker Satyr|Foreboding Ruins|Lavaclaw Reaches|Tyrant's Choice|Keldon Megaliths|Toil/Trouble|Rakdos Cackler|Spellshock|Slagstorm|Sentinel Totem|Spellshock|Rain of Gore|Goblin Cratermaker                                                                                                                                                       | seky               | br          | Penny Dreadful | NULL  | 2019-03-14 18:25:40 |
| Combo-Control | 10612 | Court Hussar Drake |       | beaa2c7233cbdbd1fff2e436e95684c1ff5bb1e0 | e34e6ad611cbbd84b549f728cba0705d493e6b0a | 67f19c3db11f6586fe6edaa90622a4f29cbf3056 | Court Hussar|Archaeomancer|Peregrine Drake|Condemn|Azorius Charm|Memory Lapse|Think Twice|Displace|Frantic Search|Treasure Cruise|Decree of Justice|Island|Mystic Monastery|New Benalia|Plains|Tranquil Cove|Urza's Factory|Scrabbling Claws|Sentinel Totem|Last Breath|Negate|Revoke Existence|Sanctimony|Sundering Growth|Invoke the Divine|End Hostilities                                                                                                        | bakert99           | uw          | Penny Dreadful | NULL  | 2019-03-14 18:26:06 |
| Unclassified  | 10613 |  Unclassified      |       | 383c58dbaba74a32e32a6c6e18e1f098ccdb1200 | da39a3ee5e6b4b0d3255bfef95601890afd80709 | f8b7364f4b8a92f0ba3a943f232857221df08064 | Island                                                                                                                                                                                                                                                                                                                                                                                                                                                               | bakert99           |             | Penny Dreadful | NULL  | 2019-03-14 18:26:39 |
| Unclassified  | 10615 | Thastormlu (1)     |       | a2fc0fb4951f32c27f2dbfb04b0fc262e65c5dc8 | 2523aeb8812e940006dd9e80c8eab6a0299d50a5 | d48427fcb66ad3a57a87957b620c4ac965c95a57 | Deep Analysis|Evolving Wilds|Frantic Search|Goblin Electromancer|Hazoret's Undying Fury|Island|Mountain|Mystic Monastery|Nagging Thoughts|Peer Through Depths|Pirate's Pillage|Primal Amulet|Recoup|Seething Song|Shimmer of Possibility|Tendrils of Agony|Treasure Cruise|Vivid Crag|Blink of an Eye|Docent of Perfection|Nature's Ruin|Negate|Rise from the Tides|Sentinel Totem|Slagstorm|Temporal Fissure|Welcome to the Fold|Witchbane Orb                      | Kaitoukid111       | bru         | Penny Dreadful | NULL  | 2019-03-14 18:31:17 |
| Combo-Control | 10616 | Izzet Ascendancy   |       | 6fbdf5f233b7384caed2d121e5509a719e9560a3 | 7bcf21af563ae4037230477cf02a18d106c4d279 | 05ff8839ee1c57e61b2ef6259b450f7159dbcf87 | Electrostatic Field|Izzet Keyrune|Jeskai Ascendancy|Burst Lightning|Cerulean Wisps|Treasure Cruise|Nagging Thoughts|Obsessive Search|Mystic Monastery|Vivid Crag|Ghitu Encampment|Azorius Charm|Island|Mountain|Chain Lightning|Think Twice|Azorius Keyrune|Radiant Flames|Negate|Purify the Grave|Firemind's Research|Weaver of Lightning|Beacon Bolt|Seal of Cleansing                                                                                             | EternalParadox38   | ruw         | Penny Dreadful | NULL  | 2019-03-14 18:57:06 |
| Combo-Control | 10617 | Mirari Storm       |       | ec75e1033de439d026f80aa2f7feb3f556d5f9fa | 41a95658144feeeb4782f5cb942f8b9ef7bc3081 | 1457277411ca42bcbce85b425bea0dec8a28ad43 | The Mirari Conjecture|Eye of the Storm|Shimmer of Possibility|Incinerate|Mountain|Seething Song|Burst Lightning|Whispers of the Muse|Frantic Search|Memorial to Genius|Obsessive Search|Vivid Crag|Pirate's Pillage|Call to Mind|Izzet Guildgate|Island|Fevered Visions|Negate|Brain Freeze|Blink of an Eye|Slagstorm|Radiant Flames                                                                                                                                 | clevernamegoeshere | ru          | Penny Dreadful | NULL  | 2019-03-14 19:15:15 |
| Unclassified  | 10618 | White Aeropower    |       | f2f46c98c2a7bb2e68f5973ff6813033f0a42a8b | 1afb8bc6cb7b348c10ba759050b29e88fb4cf01f | 421e8820d434e0be49ddcecccd51ace138e9a233 | Honor of the Pure|Healer's Hawk|Rustwing Falcon|Soulcatchers' Aerie|Welkin Hawk|Plains|Duskrider Peregrine|Eyes in the Skies|Doomed Traveler|Roc Egg|Hunted Witness|Kjeldoran Outpost|Hoofprints of the Stag|Sundering Growth|Sentinel Totem|Absolute Law                                                                                                                                                                                                            | lovetapsmtg        | w           | Penny Dreadful | NULL  | 2019-03-14 19:17:05 |
| Aggro         | 10619 | Deck - Treefolk    |       | 7e7b20c870f0b42072c795b4fba21caeb0a04ed9 | 7fda44f813d4a313154db47a411603478ea581e0 | 48fbe8d61eee41c2822994acd238e4039e081063 | Asceticism|Battlewand Oak|Bosk Banneret|Dauntless Dourbark|Fog|Forest|Heartwood Storyteller|Lignify|Nourish|Orchard Warden|Rampant Growth|Rootgrapple|Seedguide Ash|Timber Protector|Treefolk Harbinger|Ulvenwald Observer|Lignify                                                                                                                                                                                                                                   | AVPfanJoe          | g           | Penny Dreadful | NULL  | 2019-03-14 19:51:39 |
+---------------+-------+--------------------+-------+------------------------------------------+------------------------------------------+------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------+-------------+----------------+-------+---------------------+
22 rows in set (0.00 sec)
bakert commented 4 years ago
MariaDB [gatherling_one]> SELECT * FROM deckcontents WHERE deck IN (SELECT deck FROM entries WHERE event IN ('Penny Dreadful Thursdays 11.07', 'Penny Dreadful Mondays 11.07', 'Penny Dreadful Sundays 11.08'));
+-------+-------+-----+-------------+
| card  | deck  | qty | issideboard |
+-------+-------+-----+-------------+
|  5336 | 10576 |   7 |           0 |
|  5337 | 10576 |   2 |           0 |
|  5338 | 10576 |   4 |           0 |
|  5498 | 10576 |   4 |           0 |
|  5871 | 10576 |   4 |           0 |
|  6709 | 10576 |   1 |           0 |
|  7533 | 10576 |   3 |           0 |
|  7891 | 10576 |   4 |           0 |
|  8544 | 10576 |   4 |           0 |
| 10060 | 10576 |   4 |           0 |
| 10603 | 10576 |   2 |           1 |
| 11633 | 10576 |   1 |           1 |
| 11802 | 10576 |   3 |           0 |
| 12601 | 10576 |   2 |           0 |
| 12601 | 10576 |   1 |           1 |
| 13327 | 10576 |   4 |           1 |
| 14838 | 10576 |   4 |           0 |
| 14909 | 10576 |   4 |           0 |
| 15650 | 10576 |   3 |           1 |
| 20589 | 10576 |   2 |           0 |
| 20589 | 10576 |   2 |           1 |
| 25068 | 10576 |   4 |           0 |
| 25494 | 10576 |   1 |           1 |
| 27703 | 10576 |   1 |           1 |
| 28217 | 10576 |   4 |           0 |
|  5335 | 10577 |   7 |           0 |
|  5339 | 10577 |  10 |           0 |
|  5874 | 10577 |   3 |           1 |
|  7351 | 10577 |   4 |           0 |
|  7674 | 10577 |   1 |           0 |
|  7694 | 10577 |   4 |           0 |
|  7758 | 10577 |   4 |           0 |
|  8274 | 10577 |   2 |           0 |
|  9515 | 10577 |   4 |           0 |
| 10536 | 10577 |   4 |           1 |
| 11919 | 10577 |   4 |           1 |
| 12044 | 10577 |   4 |           0 |
| 14445 | 10577 |   4 |           0 |
| 15487 | 10577 |   2 |           0 |
| 17151 | 10577 |   4 |           0 |
| 20957 | 10577 |   2 |           0 |
| 21241 | 10577 |   4 |           1 |
| 30596 | 10577 |   4 |           0 |
| 30659 | 10577 |   4 |           0 |
|  5166 | 10578 |   3 |           1 |
|  5337 | 10578 |  20 |           0 |
|  7562 | 10578 |   4 |           0 |
|  7855 | 10578 |   2 |           1 |
|  8309 | 10578 |   4 |           0 |
|  9282 | 10578 |   4 |           0 |
| 11986 | 10578 |   4 |           0 |
| 13183 | 10578 |   4 |           0 |
| 13751 | 10578 |   4 |           0 |
| 14301 | 10578 |   4 |           0 |
| 15671 | 10578 |   2 |           1 |
| 16394 | 10578 |   4 |           0 |
| 17325 | 10578 |   2 |           0 |
| 20029 | 10578 |   3 |           1 |
| 21019 | 10578 |   2 |           0 |
| 21027 | 10578 |   4 |           0 |
| 23202 | 10578 |   3 |           1 |
| 28295 | 10578 |   2 |           1 |
|  4916 | 10579 |   2 |           1 |
|  5336 | 10579 |   4 |           0 |
|  5337 | 10579 |   3 |           0 |
|  5338 | 10579 |   5 |           0 |
|  5695 | 10579 |   2 |           0 |
|  7256 | 10579 |   3 |           0 |
|  7754 | 10579 |   3 |           0 |
|  7756 | 10579 |   1 |           0 |
|  9852 | 10579 |   2 |           0 |
|  9953 | 10579 |   1 |           0 |
| 10844 | 10579 |   2 |           0 |
| 11384 | 10579 |   3 |           0 |
| 11384 | 10579 |   1 |           1 |
| 11633 | 10579 |   2 |           0 |
| 11758 | 10579 |   2 |           0 |
| 11844 | 10579 |   2 |           0 |
| 11994 | 10579 |   2 |           0 |
| 12948 | 10579 |   1 |           0 |
| 14044 | 10579 |   3 |           1 |
| 15663 | 10579 |   4 |           0 |
| 17411 | 10579 |   3 |           0 |
| 17562 | 10579 |   4 |           0 |
| 18536 | 10579 |   1 |           0 |
| 19470 | 10579 |   3 |           1 |
| 19604 | 10579 |   2 |           0 |
| 20223 | 10579 |   1 |           0 |
| 21004 | 10579 |   4 |           1 |
| 21220 | 10579 |   2 |           0 |
| 26131 | 10579 |   1 |           1 |
| 28217 | 10579 |   2 |           0 |
| 30634 | 10579 |   2 |           0 |
| 30932 | 10579 |   1 |           0 |
| 30932 | 10579 |   1 |           1 |
|  4916 | 10580 |   3 |           1 |
|  5125 | 10580 |   2 |           0 |
|  5166 | 10580 |   3 |           1 |
|  5336 | 10580 |   5 |           0 |
|  5337 | 10580 |   8 |           0 |
|  6785 | 10580 |   1 |           0 |
|  7562 | 10580 |   3 |           0 |
|  7754 | 10580 |   4 |           0 |
|  8544 | 10580 |   4 |           0 |
|  9562 | 10580 |   1 |           0 |
|  9960 | 10580 |   3 |           1 |
| 10391 | 10580 |   4 |           0 |
| 11482 | 10580 |   4 |           0 |
| 11633 | 10580 |   3 |           0 |
| 12055 | 10580 |   1 |           0 |
| 12426 | 10580 |   4 |           0 |
| 12948 | 10580 |   1 |           0 |
| 14044 | 10580 |   1 |           1 |
| 14301 | 10580 |   1 |           0 |
| 14827 | 10580 |   2 |           1 |
| 15253 | 10580 |   2 |           0 |
| 17266 | 10580 |   1 |           0 |
| 17864 | 10580 |   1 |           0 |
| 18536 | 10580 |   1 |           0 |
| 22906 | 10580 |   1 |           0 |
| 23202 | 10580 |   2 |           1 |
| 26632 | 10580 |   1 |           0 |
| 27655 | 10580 |   1 |           1 |
| 30076 | 10580 |   2 |           0 |
| 30495 | 10580 |   1 |           0 |
| 30634 | 10580 |   4 |           0 |
|  4936 | 10581 |   3 |           0 |
|  5166 | 10581 |   2 |           1 |
|  5337 | 10581 |  21 |           0 |
|  5720 | 10581 |   2 |           0 |
|  6908 | 10581 |   2 |           0 |
|  7852 | 10581 |   4 |           0 |
|  9723 | 10581 |   3 |           0 |
| 10154 | 10581 |   2 |           1 |
| 10251 | 10581 |   2 |           0 |
| 12452 | 10581 |   4 |           1 |
| 13193 | 10581 |   3 |           1 |
| 14301 | 10581 |   2 |           0 |
| 14301 | 10581 |   2 |           1 |
| 15525 | 10581 |   4 |           0 |
| 17325 | 10581 |   3 |           0 |
| 20043 | 10581 |   4 |           0 |
| 23202 | 10581 |   2 |           1 |
| 25448 | 10581 |   2 |           0 |
| 26442 | 10581 |   4 |           0 |
| 30492 | 10581 |   4 |           0 |
|  5327 | 10582 |   2 |           0 |
|  5335 | 10582 |   9 |           0 |
|  5339 | 10582 |   6 |           0 |
|  7351 | 10582 |   4 |           0 |
|  7453 | 10582 |   3 |           0 |
|  7462 | 10582 |   4 |           0 |
|  7758 | 10582 |   4 |           0 |
|  8657 | 10582 |   2 |           1 |
|  9645 | 10582 |   4 |           0 |
|  9815 | 10582 |   4 |           0 |
|  9843 | 10582 |   2 |           0 |
|  9843 | 10582 |   2 |           1 |
| 13129 | 10582 |   2 |           1 |
| 14768 | 10582 |   2 |           1 |
| 15048 | 10582 |   2 |           1 |
| 15359 | 10582 |   2 |           1 |
| 18158 | 10582 |   4 |           0 |
| 18423 | 10582 |   2 |           0 |
| 18423 | 10582 |   2 |           1 |
| 20824 | 10582 |   4 |           0 |
| 24183 | 10582 |   4 |           0 |
| 26170 | 10582 |   4 |           0 |
|  5338 | 10583 |  20 |           0 |
|  5781 | 10583 |   4 |           0 |
|  6143 | 10583 |   4 |           0 |
|  6710 | 10583 |   4 |           0 |
|  7343 | 10583 |   4 |           0 |
|  7662 | 10583 |   4 |           0 |
|  8354 | 10583 |   4 |           0 |
| 12733 | 10583 |   4 |           0 |
| 12959 | 10583 |   4 |           0 |
| 17149 | 10583 |   3 |           1 |
| 20147 | 10583 |   3 |           1 |
| 21027 | 10583 |   4 |           0 |
| 23919 | 10583 |   3 |           1 |
| 26153 | 10583 |   4 |           1 |
| 30531 | 10583 |   2 |           1 |
| 31165 | 10583 |   4 |           0 |
|  5338 | 10584 |   2 |           0 |
|  5339 | 10584 |  14 |           0 |
|  5874 | 10584 |   1 |           1 |
|  6445 | 10584 |   4 |           0 |
|  7692 | 10584 |   4 |           0 |
|  7760 | 10584 |   4 |           0 |
|  7930 | 10584 |   3 |           1 |
|  9815 | 10584 |   4 |           0 |
| 10034 | 10584 |   4 |           0 |
| 13274 | 10584 |   4 |           0 |
| 15456 | 10584 |   3 |           1 |
| 17546 | 10584 |   2 |           0 |
| 20292 | 10584 |   3 |           0 |
| 20292 | 10584 |   1 |           1 |
| 21188 | 10584 |   4 |           0 |
| 26170 | 10584 |   4 |           0 |
| 26668 | 10584 |   4 |           1 |
| 29047 | 10584 |   3 |           1 |
| 30948 | 10584 |   3 |           0 |
| 31064 | 10584 |   4 |           0 |
|  4740 | 10587 |   2 |           0 |
|  5338 | 10587 |  17 |           0 |
|  5778 | 10587 |   3 |           1 |
|  5874 | 10587 |   2 |           1 |
|  7343 | 10587 |   4 |           0 |
| 10220 | 10587 |   2 |           1 |
| 11631 | 10587 |   4 |           0 |
| 11994 | 10587 |   3 |           0 |
| 12744 | 10587 |   3 |           1 |
| 13815 | 10587 |   2 |           1 |
| 15256 | 10587 |   3 |           1 |
| 17019 | 10587 |   4 |           0 |
| 18256 | 10587 |   2 |           0 |
| 19294 | 10587 |   3 |           0 |
| 19304 | 10587 |   4 |           0 |
| 20732 | 10587 |   4 |           0 |
| 21027 | 10587 |   4 |           0 |
| 25071 | 10587 |   4 |           0 |
| 25644 | 10587 |   2 |           0 |
| 26711 | 10587 |   3 |           0 |
|  5335 | 10588 |  22 |           0 |
|  5874 | 10588 |   4 |           1 |
|  7156 | 10588 |   1 |           0 |
|  8657 | 10588 |   3 |           1 |
|  9642 | 10588 |   3 |           0 |
| 10330 | 10588 |   4 |           0 |
| 10536 | 10588 |   4 |           1 |
| 11599 | 10588 |   4 |           1 |
| 13682 | 10588 |   4 |           0 |
| 16763 | 10588 |   1 |           0 |
| 19964 | 10588 |   4 |           0 |
| 20213 | 10588 |   4 |           0 |
| 20345 | 10588 |   2 |           0 |
| 28942 | 10588 |   4 |           0 |
| 30149 | 10588 |   3 |           0 |
| 30442 | 10588 |   4 |           0 |
| 31085 | 10588 |   4 |           0 |
|  5335 | 10589 |  19 |           0 |
|  7156 | 10589 |   1 |           0 |
|  7196 | 10589 |   2 |           1 |
|  7462 | 10589 |   4 |           0 |
|  8026 | 10589 |   4 |           0 |
|  8657 | 10589 |   2 |           1 |
| 10536 | 10589 |   3 |           1 |
| 11067 | 10589 |   2 |           1 |
| 11283 | 10589 |   2 |           1 |
| 11919 | 10589 |   2 |           1 |
| 12141 | 10589 |   4 |           0 |
| 13682 | 10589 |   4 |           0 |
| 15346 | 10589 |   4 |           0 |
| 16049 | 10589 |   4 |           0 |
| 18124 | 10589 |   2 |           0 |
| 20824 | 10589 |   4 |           0 |
| 21356 | 10589 |   4 |           0 |
| 30139 | 10589 |   2 |           1 |
| 30443 | 10589 |   3 |           0 |
| 31085 | 10589 |   3 |           0 |
|  5327 | 10609 |   4 |           0 |
|  5337 | 10609 |   6 |           0 |
|  5338 | 10609 |   8 |           0 |
| 12948 | 10609 |   4 |           1 |
| 15527 | 10609 |   4 |           1 |
| 16141 | 10609 |   4 |           0 |
| 16144 | 10609 |   4 |           0 |
| 16167 | 10609 |   1 |           0 |
| 16273 | 10609 |   4 |           0 |
| 16288 | 10609 |   4 |           0 |
| 18536 | 10609 |   2 |           1 |
| 19639 | 10609 |   4 |           0 |
| 20074 | 10609 |   4 |           0 |
| 21167 | 10609 |   4 |           0 |
| 22809 | 10609 |   4 |           0 |
| 22879 | 10609 |   4 |           0 |
| 24928 | 10609 |   4 |           1 |
| 25640 | 10609 |   1 |           0 |
| 25640 | 10609 |   1 |           1 |
| 30531 | 10609 |   4 |           0 |
|  5335 | 10610 |  19 |           0 |
|  7156 | 10610 |   1 |           0 |
|  7196 | 10610 |   2 |           1 |
|  7462 | 10610 |   4 |           0 |
|  8026 | 10610 |   4 |           0 |
|  8657 | 10610 |   2 |           1 |
| 10536 | 10610 |   3 |           1 |
| 11067 | 10610 |   2 |           1 |
| 11283 | 10610 |   2 |           1 |
| 11919 | 10610 |   2 |           1 |
| 12141 | 10610 |   4 |           0 |
| 13682 | 10610 |   4 |           0 |
| 15346 | 10610 |   4 |           0 |
| 16049 | 10610 |   4 |           0 |
| 18124 | 10610 |   2 |           0 |
| 20824 | 10610 |   4 |           0 |
| 21356 | 10610 |   4 |           0 |
| 30139 | 10610 |   2 |           1 |
| 30443 | 10610 |   3 |           0 |
| 31085 | 10610 |   3 |           0 |
|  5338 | 10611 |   8 |           0 |
|  5874 | 10611 |   3 |           1 |
|  7756 | 10611 |   4 |           0 |
|  8116 | 10611 |   4 |           0 |
| 10647 | 10611 |   3 |           0 |
| 11994 | 10611 |   4 |           0 |
| 12744 | 10611 |   4 |           1 |
| 13218 | 10611 |   4 |           0 |
| 17562 | 10611 |   4 |           0 |
| 19274 | 10611 |   4 |           0 |
| 19294 | 10611 |   4 |           0 |
| 20292 | 10611 |   2 |           0 |
| 20292 | 10611 |   2 |           1 |
| 21027 | 10611 |   4 |           0 |
| 21220 | 10611 |   2 |           0 |
| 22276 | 10611 |   4 |           0 |
| 22918 | 10611 |   4 |           0 |
| 26329 | 10611 |   3 |           1 |
| 26711 | 10611 |   1 |           0 |
| 30531 | 10611 |   3 |           1 |
| 31165 | 10611 |   4 |           0 |
|  4916 | 10612 |   3 |           1 |
|  5335 | 10612 |   6 |           0 |
|  5336 | 10612 |  10 |           0 |
|  5874 | 10612 |   2 |           1 |
|  6329 | 10612 |   3 |           0 |
|  6877 | 10612 |   4 |           0 |
|  7256 | 10612 |   3 |           0 |
|  8251 | 10612 |   2 |           1 |
|  8544 | 10612 |   4 |           0 |
|  9362 | 10612 |   1 |           0 |
| 10536 | 10612 |   1 |           1 |
| 10820 | 10612 |   4 |           0 |
| 11633 | 10612 |   2 |           0 |
| 11844 | 10612 |   2 |           0 |
| 14265 | 10612 |   1 |           1 |
| 15349 | 10612 |   4 |           0 |
| 15350 | 10612 |   3 |           0 |
| 17538 | 10612 |   1 |           0 |
| 17560 | 10612 |   1 |           0 |
| 18058 | 10612 |   4 |           0 |
| 23518 | 10612 |   3 |           1 |
| 25201 | 10612 |   1 |           1 |
| 26225 | 10612 |   4 |           0 |
| 27594 | 10612 |   1 |           1 |
| 30129 | 10612 |   1 |           1 |
| 31122 | 10612 |   4 |           0 |
|  5336 | 10613 |  60 |           0 |
|  4916 | 10615 |   2 |           1 |
|  5327 | 10615 |   4 |           0 |
|  5336 | 10615 |   7 |           0 |
|  5338 | 10615 |   3 |           0 |
|  5498 | 10615 |   2 |           0 |
|  5871 | 10615 |   3 |           0 |
|  5874 | 10615 |   2 |           1 |
|  6330 | 10615 |   1 |           1 |
|  6709 | 10615 |   1 |           0 |
|  7424 | 10615 |   2 |           1 |
|  7533 | 10615 |   4 |           0 |
|  7542 | 10615 |   1 |           1 |
|  7558 | 10615 |   1 |           1 |
|  7891 | 10615 |   4 |           0 |
|  8544 | 10615 |   4 |           0 |
| 11633 | 10615 |   2 |           0 |
| 11844 | 10615 |   2 |           0 |
| 12601 | 10615 |   2 |           0 |
| 12744 | 10615 |   1 |           1 |
| 14044 | 10615 |   2 |           1 |
| 14909 | 10615 |   4 |           0 |
| 17266 | 10615 |   4 |           0 |
| 17562 | 10615 |   4 |           0 |
| 22537 | 10615 |   2 |           0 |
| 25068 | 10615 |   4 |           0 |
| 25494 | 10615 |   1 |           1 |
| 29879 | 10615 |   2 |           1 |
| 30762 | 10615 |   4 |           0 |
|  4916 | 10616 |   3 |           1 |
|  5336 | 10616 |   9 |           0 |
|  5338 | 10616 |   2 |           0 |
|  6431 | 10616 |   2 |           1 |
|  7196 | 10616 |   2 |           1 |
|  7256 | 10616 |   3 |           0 |
|  7533 | 10616 |   3 |           0 |
|  8423 | 10616 |   4 |           0 |
|  9362 | 10616 |   2 |           0 |
| 11384 | 10616 |   2 |           1 |
| 11633 | 10616 |   3 |           0 |
| 11844 | 10616 |   4 |           0 |
| 11994 | 10616 |   3 |           0 |
| 12426 | 10616 |   3 |           0 |
| 14768 | 10616 |   2 |           1 |
| 16958 | 10616 |   3 |           0 |
| 17465 | 10616 |   4 |           0 |
| 17562 | 10616 |   4 |           0 |
| 21037 | 10616 |   1 |           0 |
| 21910 | 10616 |   4 |           0 |
| 30525 | 10616 |   4 |           0 |
| 30582 | 10616 |   2 |           1 |
| 30599 | 10616 |   2 |           1 |
| 31165 | 10616 |   4 |           0 |
|  4916 | 10617 |   4 |           1 |
|  5336 | 10617 |   7 |           0 |
|  5338 | 10617 |   6 |           0 |
|  6063 | 10617 |   2 |           0 |
|  7725 | 10617 |   4 |           1 |
|  7891 | 10617 |   4 |           0 |
|  8544 | 10617 |   4 |           0 |
| 11384 | 10617 |   1 |           1 |
| 11994 | 10617 |   4 |           0 |
| 12426 | 10617 |   4 |           0 |
| 12555 | 10617 |   1 |           1 |
| 12744 | 10617 |   4 |           1 |
| 15381 | 10617 |   2 |           0 |
| 17526 | 10617 |   4 |           0 |
| 17562 | 10617 |   3 |           0 |
| 19294 | 10617 |   4 |           0 |
| 21988 | 10617 |   2 |           0 |
| 25068 | 10617 |   4 |           0 |
| 29879 | 10617 |   1 |           1 |
| 29890 | 10617 |   4 |           0 |
| 30076 | 10617 |   2 |           0 |
| 30762 | 10617 |   4 |           0 |
|  5335 | 10618 |  22 |           0 |
|  5874 | 10618 |   3 |           1 |
|  7156 | 10618 |   1 |           0 |
|  8657 | 10618 |   4 |           1 |
| 10330 | 10618 |   4 |           0 |
| 10536 | 10618 |   4 |           1 |
| 11599 | 10618 |   4 |           1 |
| 13682 | 10618 |   4 |           0 |
| 19964 | 10618 |   4 |           0 |
| 20213 | 10618 |   4 |           0 |
| 20345 | 10618 |   2 |           0 |
| 28942 | 10618 |   4 |           0 |
| 30149 | 10618 |   3 |           0 |
| 30442 | 10618 |   4 |           0 |
| 30443 | 10618 |   4 |           0 |
| 31085 | 10618 |   4 |           0 |
|  5339 | 10619 |  21 |           0 |
|  6462 | 10619 |   1 |           0 |
|  9808 | 10619 |   3 |           0 |
| 10186 | 10619 |   1 |           0 |
| 14888 | 10619 |   3 |           0 |
| 16218 | 10619 |   3 |           0 |
| 16224 | 10619 |   3 |           0 |
| 16249 | 10619 |   3 |           0 |
| 16249 | 10619 |   1 |           1 |
| 16255 | 10619 |   2 |           0 |
| 16256 | 10619 |   1 |           0 |
| 16259 | 10619 |   4 |           0 |
| 16260 | 10619 |   4 |           0 |
| 25661 | 10619 |   4 |           0 |
| 25678 | 10619 |   1 |           0 |
| 26668 | 10619 |   3 |           0 |
| 28130 | 10619 |   3 |           0 |
+-------+-------+-----+-------------+
456 rows in set (0.01 sec)
bakert commented 4 years ago
MariaDB [gatherling_one]> SELECT * FROM deckerrors WHERE deck IN (SELECT deck FROM entries WHERE event IN ('Penny Dreadful Thursdays 11.07', 'Penny Dreadful Mondays 11.07', 'Penny Dreadful Sundays 11.08'));
Empty set (0.00 sec)
bakert commented 4 years ago
MariaDB [gatherling_one]> SELECT * FROM subevents WHERE parent IN ('Penny Dreadful Thursdays 11.07', 'Penny Dreadful Mondays 11.07', 'Penny Dreadful Sundays 11.08');
+--------------------------------+--------+--------+--------------------+------+
| parent                         | rounds | timing | type               | id   |
+--------------------------------+--------+--------+--------------------+------+
| Penny Dreadful Mondays 11.07   |      4 |      1 | Swiss (Blossom)    | 1956 |
| Penny Dreadful Mondays 11.07   |      2 |      2 | Single Elimination | 1957 |
| Penny Dreadful Thursdays 11.07 |      3 |      1 | Swiss (Blossom)    | 1958 |
| Penny Dreadful Thursdays 11.07 |      0 |      2 | Single Elimination | 1959 |
| Penny Dreadful Sundays 11.08   |      4 |      1 | Swiss (Blossom)    | 1964 |
| Penny Dreadful Sundays 11.08   |      3 |      2 | Single Elimination | 1965 |
+--------------------------------+--------+--------+--------------------+------+
6 rows in set (0.00 sec)
bakert commented 4 years ago
MariaDB [gatherling_one]> SELECT * FROM matches WHERE subevent IN (SELECT id FROM subevents WHERE parent IN ('Penny Dreadful Thursdays 11.07', 'Penny Dreadful Mondays 11.07', 'Penny Dreadful Sundays 11.08'));
+-------+--------------------+--------------------+-------+----------+--------+--------------+----------------+---------------+--------------+----------------+---------------+--------------+
| id    | playera            | playerb            | round | subevent | result | playera_wins | playera_losses | playera_draws | playerb_wins | playerb_losses | playerb_draws | verification |
+-------+--------------------+--------------------+-------+----------+--------+--------------+----------------+---------------+--------------+----------------+---------------+--------------+
| 37450 | -DiamondDust-      | clevernamegoeshere |     1 |     1956 | A      |            2 |              1 |             0 |            1 |              2 |             0 | verified     |
| 37451 | Rfunay             | Hematite12         |     1 |     1956 | B      |            0 |              2 |             0 |            2 |              0 |             0 | verified     |
| 37452 | nanaiper           | syu_tei            |     1 |     1956 | A      |            2 |              1 |             0 |            1 |              2 |             0 | verified     |
| 37453 | rakura             | Peridot_cow        |     1 |     1956 | B      |            0 |              2 |             0 |            2 |              0 |             0 | verified     |
| 37454 | DrumDevil          | Kaitoukid111       |     1 |     1956 | B      |            1 |              2 |             0 |            2 |              1 |             0 | verified     |
| 37455 | clevernamegoeshere | Kaitoukid111       |     2 |     1956 | B      |            0 |              2 |             0 |            2 |              0 |             0 | verified     |
| 37456 | LeoKing            | syu_tei            |     2 |     1956 | B      |            0 |              2 |             0 |            2 |              0 |             0 | verified     |
| 37457 | Hematite12         | Peridot_cow        |     2 |     1956 | A      |            2 |              0 |             0 |            0 |              2 |             0 | verified     |
| 37458 | -DiamondDust-      | nanaiper           |     2 |     1956 | B      |            0 |              2 |             0 |            2 |              0 |             0 | verified     |
| 37459 | DrumDevil          | DrumDevil          |     2 |     1956 | BYE    |            0 |              0 |             0 |            0 |              0 |             0 | verified     |
| 37460 | DrumDevil          | nanaiper           |     3 |     1956 | B      |            0 |              2 |             0 |            2 |              0 |             0 | verified     |
| 37461 | syu_tei            | Peridot_cow        |     3 |     1956 | A      |            2 |              1 |             0 |            1 |              2 |             0 | verified     |
| 37462 | -DiamondDust-      | lovetapsmtg        |     3 |     1956 | A      |            2 |              0 |             0 |            0 |              2 |             0 | verified     |
| 37463 | Kaitoukid111       | Hematite12         |     3 |     1956 | B      |            0 |              2 |             0 |            2 |              0 |             0 | verified     |
| 37464 | -DiamondDust-      | Peridot_cow        |     4 |     1956 | A      |            2 |              0 |             0 |            0 |              2 |             0 | verified     |
| 37465 | Kaitoukid111       | syu_tei            |     4 |     1956 | B      |            1 |              2 |             0 |            2 |              1 |             0 | verified     |
| 37466 | nanaiper           | Hematite12         |     4 |     1956 | A      |            2 |              1 |             0 |            1 |              2 |             0 | verified     |
| 37467 | lovetapsmtg        | lovetapsmtg        |     4 |     1956 | BYE    |            0 |              0 |             0 |            0 |              0 |             0 | verified     |
| 37468 | nanaiper           | -DiamondDust-      |     1 |     1957 | A      |            2 |              0 |             0 |            0 |              2 |             0 | verified     |
| 37469 | Hematite12         | syu_tei            |     1 |     1957 | B      |            1 |              2 |             0 |            2 |              1 |             0 | verified     |
| 37470 | nanaiper           | syu_tei            |     2 |     1957 | A      |            2 |              1 |             0 |            1 |              2 |             0 | verified     |
| 37485 | Kaitoukid111       | seky               |     1 |     1958 | B      |            0 |              2 |             0 |            2 |              0 |             0 | verified     |
| 37486 | rakura             | EternalParadox38   |     1 |     1958 | B      |            0 |              2 |             0 |            2 |              0 |             0 | verified     |
| 37487 | Rfunay             | bakert99           |     1 |     1958 | B      |            0 |              2 |             0 |            2 |              0 |             0 | verified     |
| 37488 | bakert99           | lovetapsmtg        |     2 |     1958 | A      |            2 |              0 |             0 |            0 |              2 |             0 | verified     |
| 37489 | seky               | EternalParadox38   |     2 |     1958 | B      |            1 |              2 |             0 |            2 |              1 |             0 | verified     |
| 37490 | clevernamegoeshere | Rfunay             |     2 |     1958 | A      |            2 |              0 |             0 |            0 |              2 |             0 | verified     |
| 37491 | Rfunay             | AVPfanJoe          |     3 |     1958 | B      |            1 |              2 |             0 |            2 |              1 |             0 | verified     |
| 37492 | clevernamegoeshere | seky               |     3 |     1958 | A      |            2 |              1 |             0 |            1 |              2 |             0 | verified     |
| 37493 | EternalParadox38   | bakert99           |     3 |     1958 | A      |            2 |              0 |             0 |            0 |              2 |             0 | verified     |
| 37494 | lovetapsmtg        | lovetapsmtg        |     3 |     1958 | BYE    |            0 |              0 |             0 |            0 |              0 |             0 | verified     |
+-------+--------------------+--------------------+-------+----------+--------+--------------+----------------+---------------+--------------+----------------+---------------+--------------+
31 rows in set (0.00 sec)
bakert commented 4 years ago
MariaDB [gatherling_one]> SELECT * FROM season_points WHERE event IN ('Penny Dreadful Thursdays 11.07', 'Penny Dreadful Mondays 11.07', 'Penny Dreadful Sundays 11.08');
Empty set (0.00 sec)
bakert commented 4 years ago

This one is going to be tricky.

MariaDB [gatherling_one]> SELECT * FROM ratings WHERE event IN ('Penny Dreadful Thursdays 11.07', 'Penny Dreadful Mondays 11.07', 'Penny Dreadful Sundays 11.08');
+------------------------------+--------------------+--------+----------------+---------------------+------+--------+
| event                        | player             | rating | format         | updated             | wins | losses |
+------------------------------+--------------------+--------+----------------+---------------------+------+--------+
| Penny Dreadful Mondays 11.07 | -diamonddust-      |   1593 | Composite      | 2019-03-11 19:00:00 |    4 |      5 |
| Penny Dreadful Mondays 11.07 | clevernamegoeshere |   1583 | Composite      | 2019-03-11 19:00:00 |    0 |      2 |
| Penny Dreadful Mondays 11.07 | drumdevil          |   1584 | Composite      | 2019-03-11 19:00:00 |    0 |      2 |
| Penny Dreadful Mondays 11.07 | hematite12         |   1608 | Composite      | 2019-03-11 19:00:00 |    3 |      2 |
| Penny Dreadful Mondays 11.07 | kaitoukid111       |   1600 | Composite      | 2019-03-11 19:00:00 |    2 |      2 |
| Penny Dreadful Mondays 11.07 | leoking            |   1591 | Composite      | 2019-03-11 19:00:00 |    0 |      1 |
| Penny Dreadful Mondays 11.07 | lovetapsmtg        |   1591 | Composite      | 2019-03-11 19:00:00 |    0 |      1 |
| Penny Dreadful Mondays 11.07 | nanaiper           |   1648 | Composite      | 2019-03-11 19:00:00 |    6 |      0 |
| Penny Dreadful Mondays 11.07 | peridot_cow        |   1584 | Composite      | 2019-03-11 19:00:00 |    1 |      3 |
| Penny Dreadful Mondays 11.07 | rakura             |   1592 | Composite      | 2019-03-11 19:00:00 |    0 |      1 |
| Penny Dreadful Mondays 11.07 | rfunay             |   1592 | Composite      | 2019-03-11 19:00:00 |    0 |      1 |
| Penny Dreadful Mondays 11.07 | syu_tei            |   1617 | Composite      | 2019-03-11 19:00:00 |    4 |      2 |
| Penny Dreadful Mondays 11.07 | -diamonddust-      |   1608 | Penny Dreadful | 2019-03-11 19:00:00 |    3 |      2 |
| Penny Dreadful Mondays 11.07 | clevernamegoeshere |   1584 | Penny Dreadful | 2019-03-11 19:00:00 |    0 |      2 |
| Penny Dreadful Mondays 11.07 | drumdevil          |   1584 | Penny Dreadful | 2019-03-11 19:00:00 |    0 |      2 |
| Penny Dreadful Mondays 11.07 | hematite12         |   1608 | Penny Dreadful | 2019-03-11 19:00:00 |    3 |      2 |
| Penny Dreadful Mondays 11.07 | kaitoukid111       |   1600 | Penny Dreadful | 2019-03-11 19:00:00 |    2 |      2 |
| Penny Dreadful Mondays 11.07 | leoking            |   1591 | Penny Dreadful | 2019-03-11 19:00:00 |    0 |      1 |
| Penny Dreadful Mondays 11.07 | lovetapsmtg        |   1592 | Penny Dreadful | 2019-03-11 19:00:00 |    0 |      1 |
| Penny Dreadful Mondays 11.07 | nanaiper           |   1648 | Penny Dreadful | 2019-03-11 19:00:00 |    6 |      0 |
| Penny Dreadful Mondays 11.07 | peridot_cow        |   1584 | Penny Dreadful | 2019-03-11 19:00:00 |    1 |      3 |
| Penny Dreadful Mondays 11.07 | rakura             |   1592 | Penny Dreadful | 2019-03-11 19:00:00 |    0 |      1 |
| Penny Dreadful Mondays 11.07 | rfunay             |   1592 | Penny Dreadful | 2019-03-11 19:00:00 |    0 |      1 |
| Penny Dreadful Mondays 11.07 | syu_tei            |   1617 | Penny Dreadful | 2019-03-11 19:00:00 |    4 |      2 |
+------------------------------+--------------------+--------+----------------+---------------------+------+--------+
24 rows in set (0.00 sec)
bakert commented 4 years ago
MariaDB [gatherling_one]> SELECT * FROM standings WHERE event IN  ('Penny Dreadful Thursdays 11.07', 'Penny Dreadful Mondays 11.07', 'Penny Dreadful Sundays 11.08');
+--------------------+--------------------------------+--------+----------------+-----------+--------------+------+----------+---------+---------+-------+-----+------+---------+-------------+-------+
| player             | event                          | active | matches_played | games_won | games_played | byes | OP_Match | PL_Game | OP_Game | score | id  | seed | matched | matches_won | draws |
+--------------------+--------------------------------+--------+----------------+-----------+--------------+------+----------+---------+---------+-------+-----+------+---------+-------------+-------+
| Rfunay             | Penny Dreadful Mondays 11.07   |      0 |              1 |         0 |            2 |    0 |    0.750 |   0.000 |   0.778 |     0 | 278 |  127 |       0 |           0 |     0 |
| -DiamondDust-      | Penny Dreadful Mondays 11.07   |      0 |              5 |         6 |           11 |    0 |    0.498 |   0.667 |   0.333 |     9 | 279 |    4 |       1 |           3 |     0 |
| clevernamegoeshere | Penny Dreadful Mondays 11.07   |      0 |              2 |         1 |            5 |    0 |    0.625 |   0.200 |   0.583 |     0 | 280 |  127 |       0 |           0 |     0 |
| DrumDevil          | Penny Dreadful Mondays 11.07   |      0 |              2 |         1 |            5 |    1 |    0.750 |   0.200 |   0.650 |     3 | 281 |  127 |       0 |           1 |     0 |
| Hematite12         | Penny Dreadful Mondays 11.07   |      0 |              5 |         8 |           12 |    0 |    0.540 |   0.778 |   0.408 |     9 | 282 |    3 |       1 |           3 |     0 |
| Kaitoukid111       | Penny Dreadful Mondays 11.07   |      1 |              4 |         5 |           10 |    0 |    0.540 |   0.500 |   0.454 |     6 | 283 |  127 |       1 |           2 |     0 |
| nanaiper           | Penny Dreadful Mondays 11.07   |      1 |              6 |        12 |           15 |    0 |    0.645 |   0.800 |   0.570 |    12 | 284 |    1 |       1 |           4 |     0 |
| Peridot_cow        | Penny Dreadful Mondays 11.07   |      1 |              4 |         3 |            9 |    0 |    0.645 |   0.333 |   0.520 |     3 | 285 |  127 |       1 |           1 |     0 |
| rakura             | Penny Dreadful Mondays 11.07   |      0 |              1 |         0 |            2 |    0 |    0.330 |   0.000 |   0.333 |     0 | 286 |  127 |       0 |           0 |     0 |
| syu_tei            | Penny Dreadful Mondays 11.07   |      0 |              6 |        10 |           17 |    0 |    0.540 |   0.636 |   0.408 |     9 | 287 |    2 |       1 |           3 |     0 |
| LeoKing            | Penny Dreadful Mondays 11.07   |      0 |              1 |         0 |            2 |    0 |    0.750 |   0.000 |   0.636 |     0 | 289 |  127 |       0 |           0 |     0 |
| lovetapsmtg        | Penny Dreadful Mondays 11.07   |      1 |              1 |         0 |            2 |    1 |    0.750 |   0.000 |   0.667 |     3 | 290 |  127 |       1 |           1 |     0 |
| bakert99           | Penny Dreadful Sundays 11.08   |      1 |              0 |         0 |            0 |    1 |    0.000 |   0.000 |   0.000 |     3 | 300 |  127 |       1 |           1 |     0 |
| bakert99           | Penny Dreadful Thursdays 11.07 |      1 |              3 |         4 |            6 |    0 |    0.553 |   0.667 |   0.333 |     6 | 301 |  127 |       1 |           2 |     0 |
| EternalParadox38   | Penny Dreadful Thursdays 11.07 |      1 |              3 |         6 |            7 |    0 |    0.443 |   0.857 |   0.389 |     9 | 302 |  127 |       1 |           3 |     0 |
| Kaitoukid111       | Penny Dreadful Thursdays 11.07 |      0 |              1 |         0 |            2 |    0 |    0.333 |   0.000 |   0.500 |     0 | 303 |  127 |       0 |           0 |     0 |
| rakura             | Penny Dreadful Thursdays 11.07 |      0 |              1 |         0 |            2 |    0 |    1.000 |   0.000 |   0.857 |     0 | 304 |  127 |       0 |           0 |     0 |
| Rfunay             | Penny Dreadful Thursdays 11.07 |      1 |              3 |         1 |            7 |    0 |    0.889 |   0.143 |   0.711 |     0 | 305 |  127 |       1 |           0 |     0 |
| seky               | Penny Dreadful Thursdays 11.07 |      1 |              3 |         4 |            8 |    0 |    0.777 |   0.500 |   0.552 |     3 | 306 |  127 |       1 |           1 |     0 |
| clevernamegoeshere | Penny Dreadful Thursdays 11.07 |      1 |              2 |         4 |            5 |    0 |    0.332 |   0.800 |   0.321 |     6 | 307 |  127 |       1 |           2 |     0 |
| lovetapsmtg        | Penny Dreadful Thursdays 11.07 |      1 |              1 |         0 |            2 |    1 |    0.667 |   0.000 |   0.667 |     3 | 308 |  127 |       1 |           1 |     0 |
| AVPfanJoe          | Penny Dreadful Thursdays 11.07 |      1 |              1 |         2 |            3 |    0 |    0.330 |   0.667 |   0.143 |     3 | 309 |  127 |       1 |           1 |     0 |
+--------------------+--------------------------------+--------+----------------+-----------+--------------+------+----------+---------+---------+-------+-----+------+---------+-------------+-------+
22 rows in set (0.00 sec)
bakert commented 4 years ago
MariaDB [gatherling_one]>  SELECT * FROM trophies WHERE event IN  ('Penny Dreadful Thursdays 11.07', 'Penny Dreadful Mondays 11.07', 'Penny Dreadful Sundays 11.08');
Empty set (0.00 sec)
bakert commented 4 years ago

Proposal:

Reservations:

bakert commented 4 years ago
INSERT INTO gatherling2.events SELECT * FROM gatherling_one.events WHERE name IN ('Penny Dreadful Thursdays 11.07', 'Penny Dreadful Mondays 11.07', 'Penny Dreadful Sundays 11.08');
INSERT INTO gatherling2.entries SELECT * FROM gatherling_one.entries WHERE event IN ('Penny Dreadful Thursdays 11.07', 'Penny Dreadful Mondays 11.07', 'Penny Dreadful Sundays 11.08');
INSERT INTO gatherling2.decks SELECT * FROM gatherling_one.decks WHERE id IN (SELECT deck FROM entries WHERE event IN ('Penny Dreadful Thursdays 11.07', 'Penny Dreadful Mondays 11.07', 'Penny Dreadful Sundays 11.08'));
INSERT INTO gatherling2.deckcontents SELECT * FROM gatherling_one.deckcontents WHERE deck IN (SELECT deck FROM entries WHERE event IN ('Penny Dreadful Thursdays 11.07', 'Penny Dreadful Mondays 11.07', 'Penny Dreadful Sundays 11.08'));
INSERT INTO gatherling2.deckerrors SELECT * FROM gatherling_one.deckerrors WHERE deck IN (SELECT deck FROM entries WHERE event IN ('Penny Dreadful Thursdays 11.07', 'Penny Dreadful Mondays 11.07', 'Penny Dreadful Sundays 11.08'));
INSERT INTO gatherling2.subevents SELECT * FROM gatherling_one.subevents WHERE parent IN ('Penny Dreadful Thursdays 11.07', 'Penny Dreadful Mondays 11.07', 'Penny Dreadful Sundays 11.08');
INSERT INTO gatherling2.matches SELECT * FROM gatherling_one.matches WHERE subevent IN (SELECT id FROM subevents WHERE parent IN ('Penny Dreadful Thursdays 11.07', 'Penny Dreadful Mondays 11.07', 'Penny Dreadful Sundays 11.08'));
INSERT INTO gatherling2.season_points SELECT * FROM gatherling_one.season_points WHERE event IN ('Penny Dreadful Thursdays 11.07', 'Penny Dreadful Mondays 11.07', 'Penny Dreadful Sundays 11.08');
INSERT INTO gatherling2.ratings SELECT * FROM gatherling_one.ratings WHERE event IN ('Penny Dreadful Thursdays 11.07', 'Penny Dreadful Mondays 11.07', 'Penny Dreadful Sundays 11.08');
INSERT INTO gatherling2.standings SELECT * FROM gatherling_one.standings WHERE event IN  ('Penny Dreadful Thursdays 11.07', 'Penny Dreadful Mondays 11.07', 'Penny Dreadful Sundays 11.08');
INSERT INTO  gatherling2.trophies SELECT * FROM gatherling_one.trophies WHERE event IN  ('Penny Dreadful Thursdays 11.07', 'Penny Dreadful Mondays 11.07', 'Penny Dreadful Sundays 11.08');
bakert commented 4 years ago
-- The events are not missing (just the details) so this fails but would work if they were not there.

INSERT INTO 
    gatherling2.events
    (start, format, host, kvalue, metaurl, name, number, season, series, threadurl, reporturl, finalized, cohost, prereg_allowed, pkonly, active, current_round, player_reportable, player_editdecks, prereg_cap, player_reported_draws, private_decks, private_finals, late_entry_limit)
SELECT 
    start, format, host, kvalue, metaurl, name, number, season, series, threadurl, reporturl, finalized, cohost, prereg_allowed, pkonly, active, current_round, player_reportable, player_editdecks, prereg_cap, player_reported_draws, private_decks, private_finals, late_entry_limit
FROM 
    gatherling_one.events 
WHERE 
    name IN ('Penny Dreadful Thursdays 11.07', 'Penny Dreadful Mondays 11.07', 'Penny Dreadful Sundays 11.08');
bakert commented 4 years ago

-- Insert the missing decks. The naïve version fails because the table has an auto_increment primary key. Instead add the max current id with a little buffer. This means we have to add the same number to every use of id in these statements.

INSERT INTO
    gatherling2.decks
    (archetype, id, name, notes, deck_hash, sideboard_hash, whole_hash, deck_contents_cache, playername, deck_colors, format, tribe, created_date)
SELECT
    archetype, id + 72000, name, notes, deck_hash, sideboard_hash, whole_hash, deck_contents_cache, playername, deck_colors, format, tribe, created_date
FROM
    gatherling_one.decks
WHERE id IN
    (SELECT deck FROM entries WHERE event IN ('Penny Dreadful Thursdays 11.07', 'Penny Dreadful Mondays 11.07', 'Penny Dreadful Sundays 11.08'));
bakert commented 4 years ago

-- Insert missing entries, updating the now-not-NULLable drop_round column.

INSERT INTO
    gatherling2.entries
    (event, player, medal, deck, ignored, drop_round, notes, registered_at)
SELECT
    event, player, medal, deck + 72000, ignored, IFNULL(drop_round, 0), notes, registered_at
FROM
    gatherling_one.entries
WHERE
    event IN ('Penny Dreadful Thursdays 11.07', 'Penny Dreadful Mondays 11.07', 'Penny Dreadful Sundays 11.08');
bakert commented 4 years ago

card ids have changed since these events ran. need to translate them.

There is an entry per printing in cards rather than just per card which makes me wonder if it can possibly be the reference table but a FOREIGN KEY tells me it is.

I wonder how we choose which to reference and if it matters.

-- gatherling_one card_ids
 SELECT id, name FROM gatherling_one.cards WHERE id IN (SELECT card FROM deckcontents WHERE deck IN (SELECT deck FROM entries WHERE event IN ('Penny Dreadful Thursdays 11.07', 'Penny Dreadful Mondays 11.07', 'Penny Dreadful Sundays 11.08')));
+-------+----------------------------+
| id    | name                       |
+-------+----------------------------+
|  5336 | Island                     |
|  5337 | Swamp                      |
|  5338 | Mountain                   |
|  5498 | Hazoret's Undying Fury     |
|  5871 | Primal Amulet              |
|  6709 | Recoup                     |
|  7533 | Nagging Thoughts           |
|  7891 | Pirate's Pillage           |
|  8544 | Frantic Search             |
| 10060 | Crumbling Vestige          |
| 10603 | Early Frost                |
| 11633 | Treasure Cruise            |
| 11802 | Rakdos Signet              |
| 12601 | Tendrils of Agony          |
| 13327 | Orbs of Warding            |
| 14838 | Desperate Ravings          |
| 14909 | Goblin Electromancer       |
| 15650 | Flashfreeze                |
| 20589 | Locket of Yesterdays       |
| 25068 | Seething Song              |
| 25494 | Temporal Fissure           |
| 27703 | Persecute                  |
| 28217 | Mirrodin's Core            |
|  5335 | Plains                     |
|  5339 | Forest                     |
|  5874 | Sentinel Totem             |
|  7351 | Avacyn's Pilgrim           |
|  7674 | Cryptolith Rite            |
|  7694 | Loam Dryad                 |
|  7758 | Fortified Village          |
|  8274 | Wingmate Roc               |
|  9515 | Raise the Alarm            |
| 10536 | Sundering Growth           |
| 11919 | Sunlance                   |
| 12044 | Scatter the Seeds          |
| 14445 | Triplicate Spirits         |
| 15487 | Overrun                    |
| 17151 | Barkshell Blessing         |
| 20957 | Collective Blessing        |
| 21241 | Loxodon Hierarch           |
| 30596 | Emmara, Soul of the Accord |
| 30659 | Flower/Flourish            |
|  5166 | Lay Bare the Heart         |
|  7562 | Asylum Visitor             |
|  7855 | Golden Demise              |
|  8309 | Bloodsoaked Champion       |
|  9282 | Ulcerate                   |
| 11986 | Vampire Lacerator          |
| 13183 | Despoiler of Souls         |
| 13751 | Black Knight               |
| 14301 | Bile Blight                |
| 15671 | Deathmark                  |
| 16394 | Gnarled Scarhide           |
| 17325 | Vampire Nighthawk          |
| 20029 | Dark Tutelage              |
| 21019 | Cryptborn Horror           |
| 21027 | Rakdos Cackler             |
| 23202 | Withered Wretch            |
| 28295 | Stupor                     |
|  4916 | Negate                     |
|  5695 | Sailor of Means            |
|  7256 | Think Twice                |
|  7754 | Choked Estuary             |
|  7756 | Foreboding Ruins           |
|  9852 | Void                       |
|  9953 | Sphinx of the Final Word   |
| 10844 | Consuming Vapors           |
| 11384 | Radiant Flames             |
| 11758 | Utter End                  |
| 11844 | Mystic Monastery           |
| 11994 | Burst Lightning            |
| 12948 | Ultimate Price             |
| 14044 | Nature's Ruin              |
| 15663 | Rune Snag                  |
| 17411 | Cruel Ultimatum            |
| 17562 | Vivid Crag                 |
| 18536 | Smother                    |
| 19470 | Hand of Cruelty            |
| 19604 | Careful Consideration      |
| 20223 | Forbid                     |
| 21004 | Slaughter Games            |
| 21220 | Lavaclaw Reaches           |
| 26131 | Detritivore                |
| 30634 | Thought Erasure            |
| 30932 | Bedeck/Bedazzle            |
|  5125 | Glyph Keeper               |
|  6785 | Psychatog                  |
|  9562 | Murder                     |
|  9960 | Flaying Tendrils           |
| 10391 | Desecration Demon          |
| 11482 | Sunken Hollow              |
| 12055 | Agony Warp                 |
| 12426 | Obsessive Search           |
| 14827 | Underworld Connections     |
| 15253 | Nightveil Specter          |
| 17266 | Deep Analysis              |
| 17864 | Terror                     |
| 22906 | Far/Away                   |
| 26632 | Tombstalker                |
| 27655 | Steal Artifact             |
| 30076 | Memorial to Genius         |
| 30495 | Dead Weight                |
|  4936 | Fourth Bridge Prowler      |
|  5720 | Costly Plunder             |
|  6908 | Tribute to Hunger          |
|  7852 | Dusk Legion Zealot         |
|  9723 | Braids, Cabal Minion       |
| 10154 | Skinrender                 |
| 10251 | Mimic Vat                  |
| 12452 | Mesmeric Fiend             |
| 13193 | Infinite Obliteration      |
| 15525 | Lashwrithe                 |
| 20043 | Liliana's Specter          |
| 25448 | Leechridden Swamp          |
| 26442 | Phyrexian Rager            |
| 30492 | Burglar Rat                |
|  5327 | Evolving Wilds             |
|  7453 | Always Watching            |
|  7462 | Bygone Bishop              |
|  8657 | Absolute Law               |
|  9645 | Benevolent Bodyguard       |
|  9815 | Invigorate                 |
|  9843 | Glare of Subdual           |
| 13129 | Vryn Wingmare              |
| 14768 | Seal of Cleansing          |
| 15048 | Holy Mantle                |
| 15359 | Mentor of the Meek         |
| 18158 | Silverblade Paladin        |
| 18423 | True Believer              |
| 20824 | Precinct Captain           |
| 24183 | Knotvine Paladin           |
| 26170 | Kavu Predator              |
|  5781 | Rigging Runner             |
|  6143 | Jackal Pup                 |
|  6710 | Rites of Initiation        |
|  7343 | Stromkirk Noble            |
|  7662 | Village Messenger          |
|  8354 | Hordeling Outburst         |
| 12733 | Goblin Wardriver           |
| 12959 | Dragon Fodder              |
| 17149 | Vexing Shusher             |
| 20147 | Jinxed Idol                |
| 23919 | Arc Trail                  |
| 26153 | Blood Knight               |
| 30531 | Goblin Cratermaker         |
| 31165 | Chain Lightning            |
|  6445 | Kessig Prowler             |
|  7692 | Lambholt Pacifist          |
|  7760 | Game Trail                 |
|  7930 | Thrashing Brontodon        |
| 10034 | Sylvan Advocate            |
| 13274 | Honored Hierarch           |
| 15456 | Flametongue Kavu           |
| 17546 | Savage Lands               |
| 20292 | Spellshock                 |
| 21188 | Leatherback Baloth         |
| 26668 | Heartwood Storyteller      |
| 29047 | Seedtime                   |
| 30948 | Thrash/Threat              |
| 31064 | Generous Patron            |
|  4740 | Thriving Grubs             |
|  5778 | Rampaging Ferocidon        |
| 10220 | Contagion Clasp            |
| 11631 | Tezzeret's Gambit          |
| 12744 | Slagstorm                  |
| 13815 | Manabarbs                  |
| 15256 | Shattering Blow            |
| 17019 | Flame Javelin              |
| 18256 | Falkenrath Exterminator    |
| 19294 | Incinerate                 |
| 19304 | Stormblood Berserker       |
| 20732 | Volt Charge                |
| 25071 | Slith Firewalker           |
| 25644 | Rage Forger                |
| 26711 | Keldon Megaliths           |
|  7156 | Kjeldoran Outpost          |
|  9642 | Aven Riftwatcher           |
| 10330 | Eyes in the Skies          |
| 11599 | Hoofprints of the Stag     |
| 13682 | Honor of the Pure          |
| 16763 | Faith's Shield             |
| 19964 | Roc Egg                    |
| 20213 | Welkin Hawk                |
| 20345 | Duskrider Peregrine        |
| 28942 | Soulcatchers' Aerie        |
| 30149 | Rustwing Falcon            |
| 30442 | Healer's Hawk              |
| 31085 | Doomed Traveler            |
|  7196 | Purify the Grave           |
|  8026 | Soldier of the Pantheon    |
| 11067 | Mastery of the Unseen      |
| 11283 | Stasis Snare               |
| 12141 | Banisher Priest            |
| 15346 | Brave the Elements         |
| 16049 | Knight of Meadowgrain      |
| 18124 | Angel of Jubilation        |
| 21356 | Student of Warfare         |
| 30139 | Make a Stand               |
| 30443 | Hunted Witness             |
| 15527 | Loxodon Warhammer          |
| 16141 | Knucklebone Witch          |
| 16144 | Mad Auntie                 |
| 16167 | Warren Pilferers           |
| 16273 | Wort, Boggart Auntie       |
| 16288 | Auntie's Hovel             |
| 19639 | Auntie's Snitch            |
| 20074 | Ember Hauler               |
| 21167 | Quest for the Goblin Lord  |
| 22809 | Pyrewild Shaman            |
| 22879 | Spike Jester               |
| 24928 | Goblin Outlander           |
| 25640 | Lightning Crafter          |
|  8116 | Firedrinker Satyr          |
| 10647 | Magma Jet                  |
| 13218 | Abbot of Keral Keep        |
| 19274 | Chandra's Phoenix          |
| 22276 | Tyrant's Choice            |
| 22918 | Toil/Trouble               |
| 26329 | Rain of Gore               |
|  6329 | Displace                   |
|  6877 | Tranquil Cove              |
|  8251 | End Hostilities            |
|  9362 | Azorius Charm              |
| 10820 | Archaeomancer              |
| 14265 | Revoke Existence           |
| 15349 | Condemn                    |
| 15350 | Decree of Justice          |
| 17538 | New Benalia                |
| 17560 | Urza's Factory             |
| 18058 | Memory Lapse               |
| 23518 | Last Breath                |
| 25201 | Scrabbling Claws           |
| 26225 | Court Hussar               |
| 27594 | Sanctimony                 |
| 30129 | Invoke the Divine          |
| 31122 | Peregrine Drake            |
|  6330 | Docent of Perfection       |
|  7424 | Witchbane Orb              |
|  7542 | Rise from the Tides        |
|  7558 | Welcome to the Fold        |
| 22537 | Peer Through Depths        |
| 29879 | Blink of an Eye            |
| 30762 | Shimmer of Possibility     |
|  6431 | Weaver of Lightning        |
|  8423 | Jeskai Ascendancy          |
| 16958 | Cerulean Wisps             |
| 17465 | Azorius Keyrune            |
| 21037 | Izzet Keyrune              |
| 21910 | Ghitu Encampment           |
| 30525 | Electrostatic Field        |
| 30582 | Beacon Bolt                |
| 30599 | Firemind's Research        |
|  6063 | Whispers of the Muse       |
|  7725 | Fevered Visions            |
| 12555 | Brain Freeze               |
| 15381 | Call to Mind               |
| 17526 | Izzet Guildgate            |
| 21988 | Eye of the Storm           |
| 29890 | The Mirari Conjecture      |
|  6462 | Ulvenwald Observer         |
|  9808 | Fog                        |
| 10186 | Asceticism                 |
| 14888 | Rampant Growth             |
| 16218 | Battlewand Oak             |
| 16224 | Dauntless Dourbark         |
| 16249 | Lignify                    |
| 16255 | Rootgrapple                |
| 16256 | Seedguide Ash              |
| 16259 | Timber Protector           |
| 16260 | Treefolk Harbinger         |
| 25661 | Bosk Banneret              |
| 25678 | Orchard Warden             |
| 28130 | Nourish                    |
+-------+----------------------------+
273 rows in set (0.00 sec)
SELECT name, id FROM gatherling2.cards WHERE name IN (SELECT name FROM gatherling_one.cards WHERE id IN (SELECT card FROM gatherling_one.deckcontents WHERE deck IN (SELECT deck FROM gatherling_one.entries WHERE event IN ('Penny Dreadful Thursdays 11.07', 'Penny Dreadful Mondays 11.07', 'Penny Dreadful Sundays 11.08'))));
+----------------------------+-------+
| name                       | id    |
+----------------------------+-------+
| Island                     | 26900 |
| Island                     | 16521 |
| Island                     | 30508 |
| Island                     | 31476 |
| Island                     | 11207 |
| Island                     |  2304 |
| Island                     | 16287 |
| Island                     | 21001 |
| Island                     | 22324 |
| Island                     | 24843 |
| Island                     | 26429 |
| Island                     | 28672 |
| Island                     | 39491 |
| Island                     | 40770 |
| Island                     | 31112 |
| Island                     | 40464 |
| Island                     | 29126 |
| Island                     | 22940 |
| Island                     | 18988 |
| Island                     | 18837 |
| Island                     | 19097 |
| Island                     | 18550 |
| Island                     | 18762 |
| Island                     | 19028 |
| Island                     |  2981 |
| Island                     | 22686 |
| Island                     |  1746 |
| Island                     |  1336 |
| Island                     | 31182 |
| Island                     | 33935 |
| Island                     | 27381 |
| Island                     |  5378 |
| Island                     | 15811 |
| Island                     |  8749 |
| Island                     | 27678 |
| Island                     | 25856 |
| Island                     | 22184 |
| Island                     |   126 |
| Island                     |   417 |
| Island                     | 13231 |
| Island                     |  3928 |
| Island                     |  4162 |
| Island                     |  4396 |
| Island                     | 17665 |
| Island                     | 20425 |
| Island                     | 21915 |
| Island                     | 37978 |
| Island                     | 23482 |
| Island                     | 16706 |
| Island                     | 17142 |
| Island                     |  8123 |
| Island                     |  6029 |
| Island                     | 10576 |
| Island                     | 15367 |
| Island                     | 15537 |
| Island                     |  3326 |
| Island                     |  9375 |
| Island                     |  9997 |
| Island                     | 18321 |
| Island                     | 18457 |
| Island                     | 36747 |
| Island                     | 11834 |
| Island                     | 18173 |
| Island                     |  1001 |
| Island                     | 14983 |
| Island                     | 28362 |
| Island                     | 15217 |
| Island                     |  2636 |
| Island                     | 13667 |
| Island                     | 24321 |
| Island                     | 14081 |
| Island                     |  6691 |
| Island                     | 25113 |
| Island                     |  3694 |
| Island                     | 20659 |
| Island                     | 41073 |
| Island                     | 12475 |
| Island                     |   709 |
| Island                     |  7502 |
| Island                     | 39633 |
| Island                     | 14605 |
| Swamp                      | 26901 |
| Swamp                      | 16522 |
| Swamp                      | 30518 |
| Swamp                      | 31477 |
| Swamp                      | 11208 |
| Swamp                      |  2305 |
| Swamp                      | 16288 |
| Swamp                      | 21002 |
| Swamp                      | 22455 |
| Swamp                      | 24847 |
| Swamp                      | 26432 |
| Swamp                      | 28675 |
| Swamp                      | 39494 |
| Swamp                      | 40893 |
| Swamp                      | 31116 |
| Swamp                      | 40581 |
| Swamp                      | 29130 |
| Swamp                      | 22941 |
| Swamp                      | 18987 |
| Swamp                      | 18635 |
| Swamp                      | 18694 |
| Swamp                      | 19138 |
| Swamp                      | 18729 |
| Swamp                      | 19736 |
| Swamp                      |  2982 |
| Swamp                      | 22687 |
| Swamp                      |  1910 |
| Swamp                      |  1471 |
| Swamp                      | 33936 |
| Swamp                      | 27382 |
| Swamp                      |  5535 |
| Swamp                      | 15812 |
| Swamp                      |  8750 |
| Swamp                      | 27682 |
| Swamp                      | 25859 |
| Swamp                      | 22185 |
| Swamp                      |   239 |
| Swamp                      |   530 |
| Swamp                      | 13232 |
| Swamp                      |  3929 |
| Swamp                      |  4163 |
| Swamp                      |  4397 |
| Swamp                      | 17666 |
| Swamp                      | 20426 |
| Swamp                      | 21916 |
| Swamp                      | 37976 |
| Swamp                      | 23486 |
| Swamp                      | 16707 |
| Swamp                      | 17146 |
| Swamp                      |  8124 |
| Swamp                      |  6161 |
| Swamp                      | 10577 |
| Swamp                      | 15368 |
| Swamp                      | 15538 |
| Swamp                      |  3327 |
| Swamp                      |  9376 |
| Swamp                      |  9998 |
| Swamp                      | 18322 |
| Swamp                      | 18458 |
| Swamp                      | 36748 |
| Swamp                      | 11835 |
| Swamp                      | 18174 |
| Swamp                      |  1121 |
| Swamp                      | 14984 |
| Swamp                      | 28363 |
| Swamp                      | 15218 |
| Swamp                      |  2641 |
| Swamp                      | 13668 |
| Swamp                      | 24324 |
| Swamp                      | 14082 |
| Swamp                      |  6846 |
| Swamp                      | 25117 |
| Swamp                      |  3695 |
| Swamp                      | 20660 |
| Swamp                      | 41211 |
| Swamp                      | 12476 |
| Swamp                      |   822 |
| Swamp                      |  7503 |
| Swamp                      | 39762 |
| Swamp                      | 14606 |
| Mountain                   | 26902 |
| Mountain                   |  4455 |
| Mountain                   | 16523 |
| Mountain                   | 24001 |
| Mountain                   | 31478 |
| Mountain                   | 11209 |
| Mountain                   |  2306 |
| Mountain                   | 16289 |
| Mountain                   | 21003 |
| Mountain                   | 22361 |
| Mountain                   | 24851 |
| Mountain                   | 26435 |
| Mountain                   | 28678 |
| Mountain                   | 39497 |
| Mountain                   | 40802 |
| Mountain                   | 31120 |
| Mountain                   | 40503 |
| Mountain                   | 29134 |
| Mountain                   | 22942 |
| Mountain                   | 18989 |
| Mountain                   | 18519 |
| Mountain                   | 19098 |
| Mountain                   | 18576 |
| Mountain                   | 18909 |
| Mountain                   | 18763 |
| Mountain                   | 19735 |
| Mountain                   | 19059 |
| Mountain                   |  2983 |
| Mountain                   | 22688 |
| Mountain                   |  1805 |
| Mountain                   |  1387 |
| Mountain                   | 31200 |
| Mountain                   | 33937 |
| Mountain                   | 27383 |
| Mountain                   |  5437 |
| Mountain                   | 15813 |
| Mountain                   |  8751 |
| Mountain                   | 27686 |
| Mountain                   | 25862 |
| Mountain                   | 22186 |
| Mountain                   |   164 |
| Mountain                   |   455 |
| Mountain                   | 13233 |
| Mountain                   |  3930 |
| Mountain                   |  4164 |
| Mountain                   |  4398 |
| Mountain                   | 17667 |
| Mountain                   | 20427 |
| Mountain                   | 21917 |
| Mountain                   | 37979 |
| Mountain                   | 23490 |
| Mountain                   | 16708 |
| Mountain                   | 17150 |
| Mountain                   |  8125 |
| Mountain                   |  6068 |
| Mountain                   | 10578 |
| Mountain                   | 15369 |
| Mountain                   | 15539 |
| Mountain                   |  3328 |
| Mountain                   |  9377 |
| Mountain                   |  9999 |
| Mountain                   | 18323 |
| Mountain                   | 18459 |
| Mountain                   | 36749 |
| Mountain                   | 11836 |
| Mountain                   | 18175 |
| Mountain                   |  1046 |
| Mountain                   | 14985 |
| Mountain                   | 28364 |
| Mountain                   | 15219 |
| Mountain                   |  2638 |
| Mountain                   | 13669 |
| Mountain                   | 24327 |
| Mountain                   | 14083 |
| Mountain                   |  6734 |
| Mountain                   | 25121 |
| Mountain                   |  3696 |
| Mountain                   | 20661 |
| Mountain                   | 41112 |
| Mountain                   | 12477 |
| Mountain                   |   747 |
| Mountain                   |  7504 |
| Mountain                   | 39680 |
| Mountain                   | 14607 |
| Hazoret's Undying Fury     | 27281 |
| Primal Amulet              | 27654 |
| Recoup                     | 19723 |
| Recoup                     |  9259 |
| Nagging Thoughts           | 24083 |
| Pirate's Pillage           | 28271 |
| Frantic Search             | 40149 |
| Frantic Search             |  7537 |
| Frantic Search             | 21409 |
| Crumbling Vestige          | 39007 |
| Crumbling Vestige          | 24502 |
| Early Frost                | 10773 |
| Treasure Cruise            | 26188 |
| Treasure Cruise            | 21992 |
| Treasure Cruise            | 40299 |
| Rakdos Signet              | 16244 |
| Rakdos Signet              | 26357 |
| Rakdos Signet              | 28595 |
| Rakdos Signet              | 12177 |
| Rakdos Signet              | 38672 |
| Rakdos Signet              | 27161 |
| Tendrils of Agony          | 38052 |
| Tendrils of Agony          | 10220 |
| Tendrils of Agony          | 21481 |
| Orbs of Warding            | 23459 |
| Desperate Ravings          | 24665 |
| Desperate Ravings          | 40690 |
| Desperate Ravings          | 25479 |
| Desperate Ravings          | 15686 |
| Goblin Electromancer       | 24736 |
| Goblin Electromancer       | 19062 |
| Goblin Electromancer       | 33838 |
| Goblin Electromancer       | 27102 |
| Goblin Electromancer       | 18085 |
| Flashfreeze                |  5758 |
| Flashfreeze                |  3750 |
| Flashfreeze                |  3984 |
| Flashfreeze                |  4217 |
| Flashfreeze                | 23542 |
| Flashfreeze                |  3413 |
| Locket of Yesterdays       | 12450 |
| Seething Song              | 18901 |
| Seething Song              | 10392 |
| Seething Song              |  3210 |
| Temporal Fissure           | 10198 |
| Temporal Fissure           | 21435 |
| Persecute                  |  2800 |
| Persecute                  |  3145 |
| Persecute                  |  2461 |
| Persecute                  |  7316 |
| Mirrodin's Core            | 27911 |
| Mirrodin's Core            | 10744 |
| Plains                     | 26899 |
| Plains                     | 16520 |
| Plains                     | 23998 |
| Plains                     | 31475 |
| Plains                     | 11206 |
| Plains                     |  2303 |
| Plains                     | 16286 |
| Plains                     | 21000 |
| Plains                     | 22390 |
| Plains                     | 24839 |
| Plains                     | 26426 |
| Plains                     | 28669 |
| Plains                     | 39488 |
| Plains                     | 40823 |
| Plains                     | 31108 |
| Plains                     | 40525 |
| Plains                     | 29122 |
| Plains                     | 22939 |
| Plains                     | 18948 |
| Plains                     | 18605 |
| Plains                     | 18799 |
| Plains                     | 18876 |
| Plains                     | 18761 |
| Plains                     | 19700 |
| Plains                     | 19027 |
| Plains                     |  2980 |
| Plains                     | 22685 |
| Plains                     |  1838 |
| Plains                     |  1413 |
| Plains                     | 31181 |
| Plains                     | 33934 |
| Plains                     | 27380 |
| Plains                     |  5466 |
| Plains                     | 15810 |
| Plains                     |  8748 |
| Plains                     | 27674 |
| Plains                     | 25853 |
| Plains                     | 22183 |
| Plains                     |   188 |
| Plains                     |   479 |
| Plains                     | 13230 |
| Plains                     |  3927 |
| Plains                     |  4161 |
| Plains                     |  4395 |
| Plains                     | 17664 |
| Plains                     | 20424 |
| Plains                     | 21914 |
| Plains                     | 37974 |
| Plains                     | 23478 |
| Plains                     | 16705 |
| Plains                     | 17138 |
| Plains                     |  8122 |
| Plains                     |  6088 |
| Plains                     | 10575 |
| Plains                     | 15366 |
| Plains                     | 15536 |
| Plains                     |  3325 |
| Plains                     |  9374 |
| Plains                     |  9996 |
| Plains                     | 18320 |
| Plains                     | 18456 |
| Plains                     | 36746 |
| Plains                     | 11833 |
| Plains                     | 18172 |
| Plains                     |  1066 |
| Plains                     | 14982 |
| Plains                     | 28361 |
| Plains                     | 15216 |
| Plains                     |  2639 |
| Plains                     | 13666 |
| Plains                     | 24318 |
| Plains                     | 14080 |
| Plains                     |  6759 |
| Plains                     | 25109 |
| Plains                     |  3693 |
| Plains                     | 20658 |
| Plains                     | 41141 |
| Plains                     | 12474 |
| Plains                     |   771 |
| Plains                     |  7501 |
| Plains                     | 39708 |
| Plains                     | 14604 |
| Forest                     | 26903 |
| Forest                     | 16524 |
| Forest                     | 24002 |
| Forest                     | 31479 |
| Forest                     | 11210 |
| Forest                     |  2307 |
| Forest                     | 16290 |
| Forest                     | 21004 |
| Forest                     | 22290 |
| Forest                     | 24855 |
| Forest                     | 26438 |
| Forest                     | 28681 |
| Forest                     | 39500 |
| Forest                     | 40721 |
| Forest                     | 31124 |
| Forest                     | 40424 |
| Forest                     | 29138 |
| Forest                     | 22943 |
| Forest                     | 18947 |
| Forest                     | 18491 |
| Forest                     | 18665 |
| Forest                     | 19139 |
| Forest                     | 18877 |
| Forest                     | 18764 |
| Forest                     |  2984 |
| Forest                     | 22689 |
| Forest                     |  1687 |
| Forest                     |  1296 |
| Forest                     | 31201 |
| Forest                     | 33938 |
| Forest                     | 27384 |
| Forest                     |  5313 |
| Forest                     | 15814 |
| Forest                     |  8752 |
| Forest                     | 27690 |
| Forest                     | 25865 |
| Forest                     | 22187 |
| Forest                     |    91 |
| Forest                     |   382 |
| Forest                     | 13234 |
| Forest                     |  3931 |
| Forest                     |  4165 |
| Forest                     |  4399 |
| Forest                     | 17668 |
| Forest                     | 20428 |
| Forest                     | 21918 |
| Forest                     | 37977 |
| Forest                     | 23494 |
| Forest                     | 16709 |
| Forest                     | 17154 |
| Forest                     |  8126 |
| Forest                     |  5997 |
| Forest                     | 10579 |
| Forest                     | 15370 |
| Forest                     | 15540 |
| Forest                     |  3329 |
| Forest                     |  9378 |
| Forest                     | 10000 |
| Forest                     | 18324 |
| Forest                     | 18460 |
| Forest                     | 36750 |
| Forest                     | 11837 |
| Forest                     | 18176 |
| Forest                     |   971 |
| Forest                     | 14986 |
| Forest                     | 28365 |
| Forest                     | 15220 |
| Forest                     |  2635 |
| Forest                     | 13670 |
| Forest                     | 24330 |
| Forest                     | 14084 |
| Forest                     |  6659 |
| Forest                     | 25125 |
| Forest                     |  3697 |
| Forest                     | 20662 |
| Forest                     | 41031 |
| Forest                     | 12478 |
| Forest                     |   674 |
| Forest                     |  7505 |
| Forest                     | 39595 |
| Forest                     | 14608 |
| Sentinel Totem             | 27657 |
| Avacyn's Pilgrim           | 15723 |
| Avacyn's Pilgrim           | 38652 |
| Avacyn's Pilgrim           | 27055 |
| Cryptolith Rite            | 24224 |
| Loam Dryad                 | 24244 |
| Fortified Village          | 24308 |
| Wingmate Roc               | 40932 |
| Wingmate Roc               | 21964 |
| Raise the Alarm            | 25961 |
| Raise the Alarm            | 40536 |
| Raise the Alarm            | 18789 |
| Raise the Alarm            | 25378 |
| Raise the Alarm            | 21690 |
| Raise the Alarm            | 10304 |
| Raise the Alarm            | 23528 |
| Sundering Growth           | 40890 |
| Sundering Growth           | 27147 |
| Sundering Growth           | 18145 |
| Sunlance                   | 18785 |
| Sunlance                   | 23531 |
| Sunlance                   | 12631 |
| Scatter the Seeds          | 23656 |
| Scatter the Seeds          | 11727 |
| Triplicate Spirits         | 21704 |
| Overrun                    | 22378 |
| Overrun                    | 24711 |
| Overrun                    | 26054 |
| Overrun                    | 18661 |
| Overrun                    |  3895 |
| Overrun                    |  4351 |
| Overrun                    |  9303 |
| Overrun                    | 18396 |
| Overrun                    |  6746 |
| Overrun                    | 25044 |
| Overrun                    |  3613 |
| Barkshell Blessing         | 13608 |
| Collective Blessing        | 18072 |
| Loxodon Hierarch           | 18924 |
| Loxodon Hierarch           | 11760 |
| Emmara, Soul of the Accord | 33832 |
| Emmara, Soul of the Accord | 39172 |
| Flower/Flourish            | 33895 |
| Lay Bare the Heart         | 26745 |
| Asylum Visitor             | 40643 |
| Asylum Visitor             | 24112 |
| Golden Demise              | 28235 |
| Bloodsoaked Champion       | 21999 |
| Ulcerate                   | 28025 |
| Ulcerate                   | 21783 |
| Vampire Lacerator          | 19668 |
| Vampire Lacerator          | 33280 |
| Vampire Lacerator          | 23598 |
| Vampire Lacerator          | 14489 |
| Despoiler of Souls         | 23315 |
| Black Knight               |  1575 |
| Black Knight               |  1198 |
| Black Knight               |    17 |
| Black Knight               |   307 |
| Black Knight               |  3782 |
| Black Knight               |  4014 |
| Black Knight               | 38241 |
| Black Knight               | 16584 |
| Black Knight               | 17234 |
| Black Knight               |   893 |
| Black Knight               |   599 |
| Bile Blight                | 21065 |
| Bile Blight                | 38806 |
| Deathmark                  |  5779 |
| Deathmark                  |  3787 |
| Deathmark                  |  4022 |
| Deathmark                  |  4255 |
| Deathmark                  | 23574 |
| Deathmark                  |  3463 |
| Gnarled Scarhide           | 21246 |
| Vampire Nighthawk          | 16092 |
| Vampire Nighthawk          | 20759 |
| Vampire Nighthawk          | 28503 |
| Vampire Nighthawk          | 19677 |
| Vampire Nighthawk          | 28706 |
| Vampire Nighthawk          | 17546 |
| Vampire Nighthawk          | 38387 |
| Vampire Nighthawk          | 27023 |
| Vampire Nighthawk          | 14490 |
| Dark Tutelage              |  4021 |
| Cryptborn Horror           | 38665 |
| Cryptborn Horror           | 18134 |
| Rakdos Cackler             | 38739 |
| Rakdos Cackler             | 18142 |
| Withered Wretch            | 10086 |
| Withered Wretch            | 38411 |
| Withered Wretch            | 18221 |
| Withered Wretch            | 12532 |
| Stupor                     |  2130 |
| Stupor                     | 38281 |
| Stupor                     |  6156 |
| Stupor                     | 12526 |
| Negate                     | 26495 |
| Negate                     | 31348 |
| Negate                     | 25982 |
| Negate                     | 40512 |
| Negate                     | 22754 |
| Negate                     |  3762 |
| Negate                     |  3999 |
| Negate                     |  4234 |
| Negate                     | 17496 |
| Negate                     | 20258 |
| Negate                     | 21735 |
| Negate                     | 38217 |
| Negate                     | 23287 |
| Negate                     | 13277 |
| Negate                     | 24391 |
| Negate                     | 28206 |
| Sailor of Means            | 27478 |
| Sailor of Means            | 28211 |
| Think Twice                | 40909 |
| Think Twice                | 15628 |
| Think Twice                | 12278 |
| Think Twice                | 40296 |
| Choked Estuary             | 24304 |
| Foreboding Ruins           | 24306 |
| Void                       | 25565 |
| Void                       |  8699 |
| Void                       | 12583 |
| Sphinx of the Final Word   | 24395 |
| Consuming Vapors           | 28479 |
| Consuming Vapors           | 14854 |
| Radiant Flames             | 23899 |
| Radiant Flames             | 38946 |
| Utter End                  | 26313 |
| Utter End                  | 39388 |
| Utter End                  | 22143 |
| Utter End                  | 38833 |
| Mystic Monastery           | 26399 |
| Mystic Monastery           | 28637 |
| Mystic Monastery           | 40807 |
| Mystic Monastery           | 22169 |
| Burst Lightning            | 38470 |
| Burst Lightning            | 23606 |
| Burst Lightning            | 14493 |
| Ultimate Price             | 22813 |
| Ultimate Price             | 38942 |
| Ultimate Price             | 18004 |
| Nature's Ruin              | 21468 |
| Rune Snag                  |  5771 |
| Rune Snag                  | 40249 |
| Cruel Ultimatum            | 20845 |
| Cruel Ultimatum            | 18976 |
| Cruel Ultimatum            | 27094 |
| Cruel Ultimatum            | 14014 |
| Vivid Crag                 | 16280 |
| Vivid Crag                 | 20996 |
| Vivid Crag                 | 24832 |
| Vivid Crag                 | 28663 |
| Vivid Crag                 | 13223 |
| Vivid Crag                 | 20183 |
| Smother                    | 38071 |
| Smother                    |  9835 |
| Smother                    | 14676 |
| Hand of Cruelty            | 11449 |
| Careful Consideration      | 19991 |
| Careful Consideration      | 12244 |
| Forbid                     |  7062 |
| Forbid                     | 38319 |
| Forbid                     | 24909 |
| Slaughter Games            | 18119 |
| Lavaclaw Reaches           | 40189 |
| Lavaclaw Reaches           | 14747 |
| Detritivore                | 12696 |
| Thought Erasure            | 33870 |
| Bedeck/Bedazzle            | 36697 |
| Glyph Keeper               | 26704 |
| Psychatog                  | 38067 |
| Psychatog                  |  9335 |
| Psychatog                  | 21597 |
| Murder                     | 26008 |
| Murder                     | 30956 |
| Murder                     | 40509 |
| Murder                     | 25234 |
| Murder                     | 17535 |
| Murder                     | 39161 |
| Murder                     | 33264 |
| Flaying Tendrils           | 39005 |
| Flaying Tendrils           | 24402 |
| Desecration Demon          | 27002 |
| Desecration Demon          | 17985 |
| Sunken Hollow              | 23997 |
| Sunken Hollow              | 40892 |
| Agony Warp                 | 23667 |
| Agony Warp                 | 27086 |
| Agony Warp                 | 14003 |
| Obsessive Search           |  9421 |
| Obsessive Search           | 21422 |
| Underworld Connections     | 24654 |
| Underworld Connections     | 28502 |
| Underworld Connections     | 18005 |
| Nightveil Specter          | 19467 |
| Nightveil Specter          | 38715 |
| Nightveil Specter          | 28791 |
| Deep Analysis              | 20700 |
| Deep Analysis              | 40687 |
| Deep Analysis              | 18972 |
| Deep Analysis              | 25399 |
| Deep Analysis              | 38223 |
| Deep Analysis              |  9414 |
| Deep Analysis              | 21404 |
| Terror                     |  2132 |
| Terror                     |  1914 |
| Terror                     |  1477 |
| Terror                     |   242 |
| Terror                     |   533 |
| Terror                     | 38075 |
| Terror                     | 17274 |
| Terror                     | 10367 |
| Terror                     |  1124 |
| Terror                     |  3511 |
| Terror                     |   825 |
| Far/Away                   | 19627 |
| Tombstalker                | 12859 |
| Tombstalker                | 20171 |
| Steal Artifact             |  2752 |
| Steal Artifact             |  1902 |
| Steal Artifact             |  1464 |
| Steal Artifact             |   234 |
| Steal Artifact             |   525 |
| Steal Artifact             |  1116 |
| Steal Artifact             |  2406 |
| Steal Artifact             |   817 |
| Memorial to Genius         | 29115 |
| Dead Weight                | 33731 |
| Dead Weight                | 15642 |
| Dead Weight                | 24119 |
| Fourth Bridge Prowler      | 26515 |
| Costly Plunder             | 27503 |
| Tribute to Hunger          | 15666 |
| Dusk Legion Zealot         | 33255 |
| Dusk Legion Zealot         | 28232 |
| Braids, Cabal Minion       | 25436 |
| Braids, Cabal Minion       |  9160 |
| Skinrender                 | 15064 |
| Mimic Vat                  | 39404 |
| Mimic Vat                  | 40798 |
| Mimic Vat                  | 15161 |
| Mesmeric Fiend             | 19672 |
| Mesmeric Fiend             | 33263 |
| Mesmeric Fiend             |  9447 |
| Mesmeric Fiend             | 21467 |
| Infinite Obliteration      | 23325 |
| Lashwrithe                 | 22335 |
| Lashwrithe                 | 15513 |
| Liliana's Specter          | 27819 |
| Liliana's Specter          |  4035 |
| Liliana's Specter          | 38466 |
| Liliana's Specter          | 18358 |
| Leechridden Swamp          | 18313 |
| Leechridden Swamp          | 13657 |
| Phyrexian Rager            |  8944 |
| Phyrexian Rager            | 24648 |
| Phyrexian Rager            | 18673 |
| Phyrexian Rager            | 25456 |
| Phyrexian Rager            | 28015 |
| Phyrexian Rager            | 28744 |
| Phyrexian Rager            | 15271 |
| Phyrexian Rager            |  3496 |
| Burglar Rat                | 33728 |
| Evolving Wilds             | 26891 |
| Evolving Wilds             | 23984 |
| Evolving Wilds             | 16259 |
| Evolving Wilds             | 20950 |
| Evolving Wilds             | 22275 |
| Evolving Wilds             | 24799 |
| Evolving Wilds             | 26383 |
| Evolving Wilds             | 28622 |
| Evolving Wilds             | 39440 |
| Evolving Wilds             | 40707 |
| Evolving Wilds             | 26083 |
| Evolving Wilds             | 40413 |
| Evolving Wilds             | 15982 |
| Evolving Wilds             | 22937 |
| Evolving Wilds             | 18941 |
| Evolving Wilds             | 19698 |
| Evolving Wilds             | 28148 |
| Evolving Wilds             | 17658 |
| Evolving Wilds             | 21907 |
| Evolving Wilds             | 38656 |
| Evolving Wilds             | 23471 |
| Evolving Wilds             | 28851 |
| Evolving Wilds             | 23738 |
| Evolving Wilds             | 14981 |
| Evolving Wilds             | 28355 |
| Always Watching            | 24003 |
| Bygone Bishop              | 24012 |
| Absolute Law               |  7172 |
| Benevolent Bodyguard       | 25358 |
| Benevolent Bodyguard       |  9527 |
| Benevolent Bodyguard       | 21356 |
| Invigorate                 | 16148 |
| Invigorate                 | 18656 |
| Invigorate                 | 25528 |
| Invigorate                 | 33339 |
| Invigorate                 |  8045 |
| Glare of Subdual           | 25556 |
| Glare of Subdual           | 11753 |
| Vryn Wingmare              | 23261 |
| Seal of Cleansing          | 24595 |
| Seal of Cleansing          | 25380 |
| Seal of Cleansing          | 38214 |
| Seal of Cleansing          |  8144 |
| Seal of Cleansing          | 21382 |
| Holy Mantle                | 19262 |
| Mentor of the Meek         | 22354 |
| Mentor of the Meek         | 26156 |
| Mentor of the Meek         | 30873 |
| Mentor of the Meek         | 15562 |
| Silverblade Paladin        | 16326 |
| Silverblade Paladin        | 22427 |
| Silverblade Paladin        | 38636 |
| Silverblade Paladin        | 28774 |
| True Believer              |  9722 |
| True Believer              |  3382 |
| Precinct Captain           | 17939 |
| Knotvine Paladin           | 14300 |
| Knotvine Paladin           | 18847 |
| Kavu Predator              | 33342 |
| Kavu Predator              | 12735 |
| Rigging Runner             | 27564 |
| Jackal Pup                 | 38308 |
| Jackal Pup                 | 33305 |
| Jackal Pup                 |  6692 |
| Rites of Initiation        |  9260 |
| Rites of Initiation        | 21521 |
| Stromkirk Noble            | 15715 |
| Village Messenger          | 24212 |
| Hordeling Outburst         | 22044 |
| Hordeling Outburst         | 38879 |
| Hordeling Outburst         | 33300 |
| Goblin Wardriver           | 15284 |
| Dragon Fodder              | 22824 |
| Dragon Fodder              | 18896 |
| Dragon Fodder              | 38903 |
| Dragon Fodder              | 23364 |
| Dragon Fodder              | 28849 |
| Dragon Fodder              | 27029 |
| Dragon Fodder              | 13947 |
| Vexing Shusher             | 38135 |
| Vexing Shusher             | 13606 |
| Jinxed Idol                |  4139 |
| Jinxed Idol                |  6694 |
| Jinxed Idol                | 25083 |
| Arc Trail                  | 18363 |
| Arc Trail                  | 15067 |
| Blood Knight               | 38272 |
| Blood Knight               | 12718 |
| Goblin Cratermaker         | 33767 |
| Chain Lightning            | 31396 |
| Chain Lightning            | 25477 |
| Chain Lightning            |  4605 |
| Chain Lightning            | 17044 |
| Chain Lightning            | 21492 |
| Kessig Prowler             | 25305 |
| Lambholt Pacifist          | 24242 |
| Game Trail                 | 24310 |
| Thrashing Brontodon        | 40597 |
| Thrashing Brontodon        | 28310 |
| Sylvan Advocate            | 24476 |
| Honored Hierarch           | 38921 |
| Honored Hierarch           | 23406 |
| Flametongue Kavu           | 16109 |
| Flametongue Kavu           | 22285 |
| Flametongue Kavu           | 18559 |
| Flametongue Kavu           | 38065 |
| Flametongue Kavu           | 18230 |
| Flametongue Kavu           |  8812 |
| Flametongue Kavu           | 21499 |
| Savage Lands               | 20980 |
| Savage Lands               | 26410 |
| Savage Lands               | 28649 |
| Savage Lands               | 39470 |
| Savage Lands               | 38560 |
| Savage Lands               | 27179 |
| Savage Lands               | 14078 |
| Spellshock                 |  7131 |
| Spellshock                 | 25019 |
| Leatherback Baloth         | 38598 |
| Leatherback Baloth         | 14715 |
| Heartwood Storyteller      | 12895 |
| Seedtime                   |  9652 |
| Thrash/Threat              | 36713 |
| Generous Patron            | 31295 |
| Thriving Grubs             | 25741 |
| Rampaging Ferocidon        | 27561 |
| Contagion Clasp            | 18824 |
| Contagion Clasp            | 38551 |
| Contagion Clasp            | 15130 |
| Tezzeret's Gambit          | 26186 |
| Tezzeret's Gambit          | 40903 |
| Tezzeret's Gambit          | 23560 |
| Tezzeret's Gambit          | 15417 |
| Slagstorm                  | 15295 |
| Manabarbs                  |  2166 |
| Manabarbs                  |  1791 |
| Manabarbs                  |  1374 |
| Manabarbs                  |   158 |
| Manabarbs                  |   449 |
| Manabarbs                  |  3846 |
| Manabarbs                  |  4315 |
| Manabarbs                  |  1037 |
| Manabarbs                  |  3547 |
| Manabarbs                  |   741 |
| Shattering Blow            | 19470 |
| Flame Javelin              | 18570 |
| Flame Javelin              | 19730 |
| Flame Javelin              | 38209 |
| Flame Javelin              | 13476 |
| Falkenrath Exterminator    | 16424 |
| Incinerate                 | 18568 |
| Incinerate                 |  1737 |
| Incinerate                 |  5373 |
| Incinerate                 |  4311 |
| Incinerate                 | 38045 |
| Incinerate                 | 16840 |
| Incinerate                 |  6026 |
| Incinerate                 |  3542 |
| Stormblood Berserker       |  4321 |
| Stormblood Berserker       | 23627 |
| Volt Charge                | 15470 |
| Slith Firewalker           | 18556 |
| Slith Firewalker           | 38227 |
| Slith Firewalker           | 10395 |
| Rage Forger                | 13331 |
| Keldon Megaliths           | 18575 |
| Keldon Megaliths           | 12938 |
| Kjeldoran Outpost          |  5640 |
| Kjeldoran Outpost          | 38016 |
| Kjeldoran Outpost          | 16942 |
| Kjeldoran Outpost          | 21640 |
| Aven Riftwatcher           | 25355 |
| Aven Riftwatcher           | 12601 |
| Eyes in the Skies          | 26941 |
| Eyes in the Skies          | 17932 |
| Hoofprints of the Stag     | 26154 |
| Hoofprints of the Stag     | 12969 |
| Honor of the Pure          |  3713 |
| Honor of the Pure          |  3948 |
| Honor of the Pure          |  4188 |
| Honor of the Pure          | 38587 |
| Honor of the Pure          | 28750 |
| Faith's Shield             | 15821 |
| Roc Egg                    | 40847 |
| Roc Egg                    |  3956 |
| Roc Egg                    |  4197 |
| Welkin Hawk                |  7052 |
| Duskrider Peregrine        | 12206 |
| Soulcatchers' Aerie        |  9547 |
| Rustwing Falcon            | 30882 |
| Healer's Hawk              | 33678 |
| Doomed Traveler            | 31316 |
| Doomed Traveler            | 27772 |
| Doomed Traveler            | 25948 |
| Doomed Traveler            | 19667 |
| Doomed Traveler            | 27929 |
| Doomed Traveler            | 15552 |
| Purify the Grave           | 40831 |
| Purify the Grave           | 15568 |
| Soldier of the Pantheon    | 20460 |
| Mastery of the Unseen      | 22528 |
| Mastery of the Unseen      | 38840 |
| Stasis Snare               | 23798 |
| Stasis Snare               | 38945 |
| Banisher Priest            | 20201 |
| Banisher Priest            | 38761 |
| Brave the Elements         | 22216 |
| Brave the Elements         | 20204 |
| Brave the Elements         | 38478 |
| Brave the Elements         | 14378 |
| Knight of Meadowgrain      | 18842 |
| Knight of Meadowgrain      | 12976 |
| Angel of Jubilation        | 16292 |
| Student of Warfare         | 14800 |
| Make a Stand               | 30872 |
| Make a Stand               | 24358 |
| Hunted Witness             | 33679 |
| Loxodon Warhammer          | 22343 |
| Loxodon Warhammer          | 24774 |
| Loxodon Warhammer          | 26350 |
| Loxodon Warhammer          | 28590 |
| Loxodon Warhammer          | 18868 |
| Loxodon Warhammer          | 10489 |
| Loxodon Warhammer          |  3297 |
| Loxodon Warhammer          | 18296 |
| Loxodon Warhammer          |  3661 |
| Knucklebone Witch          | 13068 |
| Mad Auntie                 | 13071 |
| Mad Auntie                 | 38181 |
| Mad Auntie                 | 20081 |
| Warren Pilferers           | 13094 |
| Warren Pilferers           | 20189 |
| Wort, Boggart Auntie       | 13200 |
| Auntie's Hovel             | 13215 |
| Auntie's Snitch            | 19979 |
| Auntie's Snitch            | 13291 |
| Ember Hauler               | 40406 |
| Ember Hauler               |  4066 |
| Quest for the Goblin Lord  | 14694 |
| Pyrewild Shaman            | 19530 |
| Pyrewild Shaman            | 27042 |
| Spike Jester               | 19600 |
| Spike Jester               | 27124 |
| Goblin Outlander           | 14193 |
| Lightning Crafter          | 13327 |
| Firedrinker Satyr          | 20550 |
| Magma Jet                  | 18569 |
| Magma Jet                  | 10817 |
| Magma Jet                  | 38361 |
| Magma Jet                  | 27036 |
| Magma Jet                  | 20556 |
| Abbot of Keral Keep        | 39077 |
| Abbot of Keral Keep        | 23350 |
| Chandra's Phoenix          |  4291 |
| Chandra's Phoenix          | 20328 |
| Chandra's Phoenix          | 38546 |
| Chandra's Phoenix          | 28767 |
| Tyrant's Choice            | 27733 |
| Tyrant's Choice            | 21482 |
| Toil/Trouble               | 19639 |
| Rain of Gore               | 12128 |
| Displace                   | 25188 |
| Tranquil Cove              | 39483 |
| Tranquil Cove              | 40916 |
| Tranquil Cove              | 40600 |
| Tranquil Cove              | 25601 |
| Tranquil Cove              | 22683 |
| Tranquil Cove              | 22179 |
| End Hostilities            | 21941 |
| Azorius Charm              | 28105 |
| Azorius Charm              | 18067 |
| Archaeomancer              | 28455 |
| Archaeomancer              | 17475 |
| Archaeomancer              | 20237 |
| Archaeomancer              | 40082 |
| Revoke Existence           | 21029 |
| Revoke Existence           | 19015 |
| Revoke Existence           | 15004 |
| Condemn                    | 22235 |
| Condemn                    | 28432 |
| Condemn                    | 12010 |
| Condemn                    |  3942 |
| Condemn                    | 38028 |
| Condemn                    |  3342 |
| Decree of Justice          | 22246 |
| Decree of Justice          | 38035 |
| Decree of Justice          | 33177 |
| Decree of Justice          | 10153 |
| Decree of Justice          | 21361 |
| New Benalia                | 20972 |
| New Benalia                | 24811 |
| New Benalia                | 39465 |
| New Benalia                | 19024 |
| New Benalia                | 12940 |
| Urza's Factory             | 20994 |
| Urza's Factory             | 38080 |
| Urza's Factory             | 12472 |
| Memory Lapse               |  2053 |
| Memory Lapse               | 25414 |
| Memory Lapse               |  1794 |
| Memory Lapse               |  5169 |
| Memory Lapse               | 38273 |
| Memory Lapse               |  6058 |
| Memory Lapse               |  2395 |
| Last Breath                |  7818 |
| Last Breath                | 13395 |
| Last Breath                | 20450 |
| Scrabbling Claws           | 39413 |
| Scrabbling Claws           | 10525 |
| Scrabbling Claws           | 36724 |
| Court Hussar               | 16028 |
| Court Hussar               | 12024 |
| Court Hussar               | 33217 |
| Sanctimony                 |  2691 |
| Sanctimony                 |  2346 |
| Sanctimony                 |  7664 |
| Invoke the Divine          | 30862 |
| Invoke the Divine          | 28894 |
| Peregrine Drake            | 31353 |
| Peregrine Drake            | 25418 |
| Peregrine Drake            | 18346 |
| Peregrine Drake            |  7258 |
| Docent of Perfection       | 25189 |
| Witchbane Orb              | 15796 |
| Rise from the Tides        | 39010 |
| Rise from the Tides        | 24092 |
| Rise from the Tides        | 40245 |
| Welcome to the Fold        | 24108 |
| Peer Through Depths        | 10990 |
| Peer Through Depths        | 20106 |
| Blink of an Eye            | 28918 |
| Shimmer of Possibility     | 36527 |
| Weaver of Lightning        | 25291 |
| Jeskai Ascendancy          | 22113 |
| Cerulean Wisps             | 13415 |
| Azorius Keyrune            | 20899 |
| Azorius Keyrune            | 18147 |
| Izzet Keyrune              | 18152 |
| Ghitu Encampment           |  3682 |
| Ghitu Encampment           |  7646 |
| Electrostatic Field        | 33761 |
| Beacon Bolt                | 33818 |
| Firemind's Research        | 33835 |
| Firemind's Research        | 39171 |
| Whispers of the Muse       | 23748 |
| Whispers of the Muse       |  6876 |
| Whispers of the Muse       | 24938 |
| Whispers of the Muse       | 12513 |
| Fevered Visions            | 24275 |
| Brain Freeze               | 10174 |
| Brain Freeze               | 21396 |
| Call to Mind               | 22224 |
| Call to Mind               |  3978 |
| Izzet Guildgate            | 20960 |
| Izzet Guildgate            | 24807 |
| Izzet Guildgate            | 39452 |
| Izzet Guildgate            | 40775 |
| Izzet Guildgate            | 19660 |
| Izzet Guildgate            | 27173 |
| Izzet Guildgate            | 18164 |
| Eye of the Storm           | 11594 |
| The Mirari Conjecture      | 28929 |
| Ulvenwald Observer         | 25322 |
| Ulvenwald Observer         | 39001 |
| Fog                        |  2202 |
| Fog                        | 25521 |
| Fog                        |  1684 |
| Fog                        |  1294 |
| Fog                        |    88 |
| Fog                        |   379 |
| Fog                        |  3879 |
| Fog                        |  4104 |
| Fog                        |  4338 |
| Fog                        | 17606 |
| Fog                        | 20365 |
| Fog                        | 17327 |
| Fog                        |  5994 |
| Fog                        |   969 |
| Fog                        |  2552 |
| Fog                        |   671 |
| Asceticism                 | 15096 |
| Rampant Growth             |  2218 |
| Rampant Growth             | 24715 |
| Rampant Growth             | 26248 |
| Rampant Growth             |  2923 |
| Rampant Growth             |  3898 |
| Rampant Growth             |  4355 |
| Rampant Growth             | 38212 |
| Rampant Growth             |  6103 |
| Rampant Growth             | 23654 |
| Rampant Growth             |  3257 |
| Rampant Growth             | 18252 |
| Rampant Growth             |  2569 |
| Rampant Growth             |  6766 |
| Rampant Growth             | 25046 |
| Rampant Growth             |  3617 |
| Battlewand Oak             | 13145 |
| Dauntless Dourbark         | 13151 |
| Dauntless Dourbark         | 38329 |
| Lignify                    | 18653 |
| Lignify                    | 13176 |
| Rootgrapple                | 13182 |
| Seedguide Ash              | 13183 |
| Timber Protector           | 13186 |
| Treefolk Harbinger         | 13187 |
| Bosk Banneret              | 13348 |
| Orchard Warden             | 13365 |
| Nourish                    | 10657 |
+----------------------------+-------+
1133 rows in set (0.00 sec)
bakert commented 4 years ago

There are discrepancies between the two cardsets tables that are problematic for 40 of the relevant entries in deckcontents.

mysql> SELECT * FROM gatherling_one.cardsets WHERE name NOT IN (SELECT name FROM gatherling2.cardsets);
+------------+-----------------------------------+-------+------+----------------+--------------+
| released   | name                              | type  | code | standard_legal | modern_legal |
+------------+-----------------------------------+-------+------+----------------+--------------+
| 2016-02-26 | Duel Decks: Blessed vs. Cursed    | Extra | DDQ  |              0 |            0 |
| 2014-03-14 | Duel Decks: Jace vs. Vraska       | Extra | DDM  |              0 |            0 |
| 2017-03-31 | Duel Decks: Mind vs. Might        | Extra | DDS  |              0 |            0 |
| 2013-07-19 | Magic 2014 Core Set               | Core  | M14  |              0 |            1 |
| 2014-07-18 | Magic 2015 Core Set               | Core  | M15  |              0 |            1 |
| 2011-06-17 | Magic: The Gathering-Commander    | Extra | CMD  |              0 |            0 |
| 2014-06-06 | Magic: The Gathering—Conspiracy   | Extra | CNS  |              0 |            0 |
| 2015-05-22 | Modern Masters 2015 Edition       | Extra | MM2  |              0 |            0 |
| 2006-10-06 | Time Spiral Timeshifted           | Block | TSB  |              0 |            1 |
| 1999-06-07 | Urza's Destiny                    | Block | UDS  |              0 |            0 |
| 1999-02-15 | Urza's Legacy                     | Block | ULG  |              0 |            0 |
| 1998-10-12 | Urza's Saga                       | Block | USG  |              0 |            0 |
| 2016-04-08 | Welcome Deck 2016                 | Core  | W16  |              0 |            1 |
+------------+-----------------------------------+-------+------+----------------+--------------+
13 rows in set (0.00 sec)

mysql> SELECT * FROM gatherling2.cardsets WHERE name NOT IN (SELECT name FROM gatherling_one.cardsets);
+------------+------------------------------------------+-------+------+----------------+--------------+--------------+
| released   | name                                     | type  | code | standard_legal | modern_legal | last_updated |
+------------+------------------------------------------+-------+------+----------------+--------------+--------------+
| 1996-06-10 | Alliances                                | Block | NULL |              0 |            0 |         NULL |
| 1994-03-07 | Antiquities                              | Block | NULL |              0 |            0 |         NULL |
| 1993-12-06 | Arabian Nights                           | Block | NULL |              0 |            0 |         NULL |
| 1999-04-28 | Classic Sixth Edition                    | Core  | NULL |              0 |            0 |         NULL |
| 2011-06-17 | Commander                                | Extra | NULL |              0 |            0 |         NULL |
| 2018-08-09 | Commander 2018                           | Extra | C18  |              0 |            0 |         NULL |
| 2019-08-23 | Commander 2019                           | Extra | C19  |              0 |            0 |         NULL |
| 0000-00-00 | Conspiracy                               | Extra | NULL |              0 |            0 |         NULL |
| 2019-07-12 | Core Set 2020                            | Core  | M20  |              1 |            1 |         NULL |
| 2009-04-10 | Duel Decks: Divine vs. Demonic           | Extra | NULL |              0 |            0 |         NULL |
| 2010-09-03 | Duel Decks: Elspeth vs. Tezzeret         | Extra | NULL |              0 |            0 |         NULL |
| 2007-11-16 | Duel Decks: Elves vs. Goblins            | Extra | NULL |              0 |            0 |         NULL |
| 2009-10-30 | Duel Decks: Garruk vs. Liliana           | Extra | NULL |              0 |            0 |         NULL |
| 2012-09-07 | Duel Decks: Izzet vs. Golgari            | Extra | NULL |              0 |            0 |         NULL |
| 2008-11-07 | Duel Decks: Jace vs. Chandra             | Extra | NULL |              0 |            0 |         NULL |
| 2011-04-01 | Duel Decks: Knights vs. Dragons          | Extra | NULL |              0 |            0 |         NULL |
| 2013-05-15 | Duel Decks: Sorin vs. Tibalt             | Extra | NULL |              0 |            0 |         NULL |
| 2017-11-24 | Explorers of Ixalan                      | Extra | E02  |              0 |            0 |         NULL |
| 1994-11-04 | Fallen Empires                           | Block | NULL |              0 |            0 |         NULL |
| 1997-03-24 | Fifth Edition                            | Core  | NULL |              0 |            0 |         NULL |
| 1995-04-07 | Fourth Edition                           | Core  | NULL |              0 |            0 |         NULL |
| 0000-00-00 | From the Vault: Annihilation             | Extra | NULL |              0 |            0 |         NULL |
| 2018-06-22 | Global Series: Jiang Yanggu and Mu Yanli | Extra | GS1  |              0 |            0 |         NULL |
| 1995-10-06 | Homelands                                | Block | NULL |              0 |            0 |         NULL |
| 1995-06-02 | Ice Age                                  | Block | NULL |              0 |            0 |         NULL |
| 1994-06-06 | Legends                                  | Block | NULL |              0 |            0 |         NULL |
| 1993-08-05 | Limited Edition Alpha                    | Core  | NULL |              0 |            0 |         NULL |
| 1993-10-01 | Limited Edition Beta                     | Core  | NULL |              0 |            0 |         NULL |
| 2018-11-16 | M19 Gift Pack                            | Extra | G18  |              0 |            0 |         NULL |
| 2013-07-19 | Magic 2014                               | Core  | NULL |              0 |            1 |         NULL |
| 2014-07-25 | Magic 2015                               | Core  | NULL |              0 |            1 |         NULL |
| 2002-06-24 | Magic Online Promos                      | Extra | PRM  |              0 |            0 |         NULL |
| 2018-03-16 | Masters 25                               | Extra | A25  |              0 |            0 |         NULL |
| 1995-01-01 | Media Inserts                            | Extra | pMEI |              0 |            0 |         NULL |
| 2019-06-14 | Modern Horizons                          | Extra | MH1  |              0 |            0 |         NULL |
| 0000-00-00 | Modern Masters 2015                      | Extra | NULL |              0 |            0 |         NULL |
| 2018-12-25 | Planechase Anthology Planes              | Extra | OPCA |              0 |            0 |         NULL |
| 1994-04-01 | Revised Edition                          | Core  | NULL |              0 |            0 |         NULL |
| 1994-08-08 | The Dark                                 | Block | NULL |              0 |            0 |         NULL |
| 2019-10-04 | Throne of Eldraine                       | Block | ELD  |              1 |            1 |         NULL |
| 2006-10-06 | Time Spiral Timeshifted Special          | Block | NULL |              0 |            1 |         NULL |
| 2018-12-07 | Ultimate Masters                         | Extra | UMA  |              0 |            0 |         NULL |
| 1993-12-03 | Unlimited Edition                        | Core  | NULL |              0 |            0 |         NULL |
| 1999-06-07 | Urzas Destiny                            | Block | NULL |              0 |            0 |         NULL |
| 1999-02-15 | Urzas Legacy                             | Block | NULL |              0 |            0 |         NULL |
| 1998-10-12 | Urzas Saga                               | Block | NULL |              0 |            0 |         NULL |
| 2003-10-27 | Vanguard                                 | Extra | NULL |              0 |            0 |         NULL |
| 2019-05-03 | War of the Spark                         | Block | WAR  |              1 |            1 |         NULL |
+------------+------------------------------------------+-------+------+----------------+--------------+--------------+
48 rows in set (0.00 sec)
bakert commented 4 years ago

Affected cards:

> SELECT
    ->     name
    -> FROM 
    ->     gatherling_one.cards
    -> WHERE
    ->     id IN (6877,  6908,  8544,  8544,  8544,  8544,  8544,  8657,  8657,  8657,  8657,  8657, 11919, 11919, 11919, 11986, 11994, 11994, 11994, 11994, 11994, 12044, 12055, 12141, 12141, 14445, 18058, 22276, 25494, 25494);
+--------------------+
| name               |
+--------------------+
| Tranquil Cove      |
| Tribute to Hunger  |
| Frantic Search     |
| Absolute Law       |
| Sunlance           |
| Vampire Lacerator  |
| Burst Lightning    |
| Scatter the Seeds  |
| Agony Warp         |
| Banisher Priest    |
| Triplicate Spirits |
| Memory Lapse       |
| Tyrant's Choice    |
| Temporal Fissure   |
+--------------------+
14 rows in set (0.00 sec)
bakert commented 4 years ago

Here are the ids we should (?) be using for these cards. Btw the gatherling db is insane.

SELECT
    c2.name, MAX(c2.id)
FROM
    gatherling2.cards AS c2
WHERE 
    c2.name IN ('Tranquil Cove', 'Tribute to Hunger', 'Frantic Search', 'Absolute Law', 'Sunlance', 'Vampire Lacerator', 'Burst Lightning', 'Scatter the Seeds', 'Agony Warp', 'Banisher Priest', 'Triplicate Spirits', 'Memory Lapse', 'Tyrant''s Choice', 'Temporal Fissure')
AND
    c2.id IN (SELECT card FROM gatherling2.deckcontents)
GROUP BY
    c2.name
+--------------------+------------+
| name               | MAX(c2.id) |
+--------------------+------------+
| Absolute Law       |       7172 |
| Agony Warp         |      23667 |
| Banisher Priest    |      20201 |
| Burst Lightning    |      38470 |
| Frantic Search     |      40149 |
| Memory Lapse       |      25414 |
| Scatter the Seeds  |      23656 |
| Sunlance           |      23531 |
| Temporal Fissure   |      10198 |
| Tranquil Cove      |      40600 |
| Tribute to Hunger  |      15666 |
| Triplicate Spirits |      21704 |
| Tyrant's Choice    |      27733 |
| Vampire Lacerator  |      23598 |
+--------------------+------------+
bakert commented 4 years ago

This gets us where we need for deckcontents by looking up an arbitrary id for the cases were we don't have a name+cardset match in the target db.

-- Insert deckcontents

INSERT INTO
    deckcontents
    (card, deck, qty, issideboard)
SELECT
    IFNULL(c2.id, c3.id), dc.deck + 72000, dc.qty, dc.issideboard
FROM
    gatherling_one.deckcontents AS dc
INNER JOIN
    gatherling_one.cards AS c1 ON c1.id = dc.card
LEFT JOIN
    gatherling2.cards AS c2 ON c1.name = c2.name AND c1.cardset = c2.cardset
LEFT JOIN -- Find an id of each card we couldn't find in target db
    (SELECT
            c2.name, MAX(c2.id) AS id
        FROM
            gatherling2.cards AS c2
        WHERE 
            c2.name IN ('Tranquil Cove', 'Tribute to Hunger', 'Frantic Search', 'Absolute Law', 'Sunlance', 'Vampire Lacerator', 'Burst Lightning', 'Scatter the Seeds', 'Agony Warp', 'Banisher Priest', 'Triplicate Spirits', 'Memory Lapse', 'Tyrant''s Choice', 'Temporal Fissure')
        AND
            c2.id IN (SELECT card FROM gatherling2.deckcontents)
        GROUP BY
            c2.name) 
    AS c3 ON c1.name = c3.name
WHERE
    dc.deck IN (SELECT deck FROM gatherling_one.entries WHERE event IN ('Penny Dreadful Thursdays 11.07', 'Penny Dreadful Mondays 11.07', 'Penny Dreadful Sundays 11.08'))
ORDER BY
    deck, card, issideboard
bakert commented 4 years ago
-- Insert deckerrors

INSERT INTO 
    gatherling2.deckerrors 
    (deck, error, id)
SELECT 
    deck, error, id
FROM 
    gatherling_one.deckerrors 
WHERE 
    deck IN (SELECT deck FROM entries WHERE event IN ('Penny Dreadful Thursdays 11.07', 'Penny Dreadful Mondays 11.07', 'Penny Dreadful Sundays 11.08'));
bakert commented 4 years ago

We need to bump the id of subevents everywhere like we did for deck.

-- Insert subevents

INSERT INTO 
    gatherling2.subevents 
    (parent, rounds, timing, type, id)
SELECT 
    parent, rounds, timing, type, id + 10000
FROM 
    gatherling_one.subevents 
WHERE 
    parent IN ('Penny Dreadful Thursdays 11.07', 'Penny Dreadful Mondays 11.07', 'Penny Dreadful Sundays 11.08');
bakert commented 4 years ago

More id bumping on matches.

-- Insert matches

INSERT INTO 
    gatherling2.matches 
    (id, playera, playerb, round, subevent, result, playera_wins, playera_losses, playera_draws, playerb_wins, playerb_losses, playerb_draws, verification)
SELECT 
    id + 130000, playera, playerb, round, subevent + 10000, result, playera_wins, playera_losses, playera_draws, playerb_wins, playerb_losses, playerb_draws, verification
FROM 
    gatherling_one.matches 
WHERE 
    subevent IN (SELECT id FROM gatherling_one.subevents WHERE parent IN ('Penny Dreadful Thursdays 11.07', 'Penny Dreadful Mondays 11.07', 'Penny Dreadful Sundays 11.08'));
bakert commented 4 years ago

Season points stuff here is definitely broken. As is the gatherling db :)


-- Insert season_points

INSERT INTO 
    gatherling2.season_points 
    (series, season, event, player, adjustment, reason)
SELECT 
    series, season, event, player, adjustment, reason
FROM 
    gatherling_one.season_points 
WHERE 
    event IN ('Penny Dreadful Thursdays 11.07', 'Penny Dreadful Mondays 11.07', 'Penny Dreadful Sundays 11.08');
bakert commented 4 years ago
-- Insert ratings

INSERT INTO 
    gatherling2.ratings 
    (event, player, rating, format, updated, wins, losses)
SELECT 
    event, player, rating, format, updated, wins, losses
FROM 
    gatherling_one.ratings 
WHERE 
    event IN ('Penny Dreadful Thursdays 11.07', 'Penny Dreadful Mondays 11.07', 'Penny Dreadful Sundays 11.08');
bakert commented 4 years ago

I'm not sure why we don't get an id conflict here but we don't.

-- Insert standings

INSERT INTO 
    gatherling2.standings 
    (player, event, active, matches_played, games_won, games_played, byes, OP_Match, PL_Game, OP_Game, score, id, seed, matched, matches_won, draws)
SELECT 
    player, event, active, matches_played, games_won, games_played, byes, OP_Match, PL_Game, OP_Game, score, id, seed, matched, matches_won, draws
FROM 
    gatherling_one.standings 
WHERE 
    event IN  ('Penny Dreadful Thursdays 11.07', 'Penny Dreadful Mondays 11.07', 'Penny Dreadful Sundays 11.08');
bakert commented 4 years ago
-- Insert trophies

INSERT INTO 
    gatherling2.trophies 
    (event, image, type, size)
SELECT 
    event, image, type, size
FROM 
    gatherling_one.trophies 
WHERE 
    event IN  ('Penny Dreadful Thursdays 11.07', 'Penny Dreadful Mondays 11.07', 'Penny Dreadful Sundays 11.08');
bakert commented 4 years ago

ok so this is a set of SQL statements that work and insert the right number of values into the right tables.

do they break gatherling? i don't know. do they mess with "season points"/ratings? for sure. does that matter? I don't know.

it's probably low risk to do this on prod, click a few things on gatherling, and quickly revert if anything goes amiss. i'm not sure the accounts the app uses have enough permissions to do this though.

bakert commented 4 years ago

Final set of SQL statements with the prod db names.

-- The events are not missing (just the details) so this fails but would work if they were not there.

INSERT INTO
    gatherli_gatherling.events
    (start, format, host, kvalue, metaurl, name, number, season, series, threadurl, reporturl, finalized, cohost, prereg_allowed, pkonly, active, current_round, player_reportable, player_editdecks, prereg_cap, player_reported_draws, private_decks, private_finals, late_entry_limit)
SELECT
    start, format, host, kvalue, metaurl, name, number, season, series, threadurl, reporturl, finalized, cohost, prereg_allowed, pkonly, active, current_round, player_reportable, player_editdecks, prereg_cap, player_reported_draws, private_decks, private_finals, late_entry_limit
FROM
    gatherling_one.events
WHERE
    name IN ('Penny Dreadful Thursdays 11.07', 'Penny Dreadful Mondays 11.07', 'Penny Dreadful Sundays 11.08');

-- Insert the missing decks. The naïve version fails because the table has an auto_increment primary key. Instead add the max current id with a little buffer. This means we have to add the same number to every use of id in these statements.

INSERT INTO
    gatherli_gatherling.decks
    (archetype, id, name, notes, deck_hash, sideboard_hash, whole_hash, deck_contents_cache, playername, deck_colors, format, tribe, created_date)
SELECT
    archetype, id + 72000, name, notes, deck_hash, sideboard_hash, whole_hash, deck_contents_cache, playername, deck_colors, format, tribe, created_date
FROM
    gatherling_one.decks
WHERE id IN
    (SELECT deck FROM gatherling_one.entries WHERE event IN ('Penny Dreadful Thursdays 11.07', 'Penny Dreadful Mondays 11.07', 'Penny Dreadful Sundays 11.08'));

-- Insert missing entries, updating the now-not-NULLable drop_round column.

INSERT INTO
    gatherli_gatherling.entries
    (event, player, medal, deck, ignored, drop_round, notes, registered_at)
SELECT
    event, player, medal, deck + 72000, ignored, IFNULL(drop_round, 0), notes, registered_at
FROM
    gatherling_one.entries
WHERE
    event IN ('Penny Dreadful Thursdays 11.07', 'Penny Dreadful Mondays 11.07', 'Penny Dreadful Sundays 11.08');

-- Insert deckcontents

INSERT INTO
    deckcontents
    (card, deck, qty, issideboard)
SELECT
    IFNULL(c2.id, c3.id), dc.deck + 72000, dc.qty, dc.issideboard
FROM
    gatherling_one.deckcontents AS dc
INNER JOIN
    gatherling_one.cards AS c1 ON c1.id = dc.card
LEFT JOIN
    gatherli_gatherling.cards AS c2 ON c1.name = c2.name AND c1.cardset = c2.cardset
LEFT JOIN -- Find an id of each card we couldn't find in target db
    (SELECT
            c2.name, MAX(c2.id) AS id
        FROM
            gatherli_gatherling.cards AS c2
        WHERE
            c2.name IN ('Tranquil Cove', 'Tribute to Hunger', 'Frantic Search', 'Absolute Law', 'Sunlance', 'Vampire Lacerator', 'Burst Lightning', 'Scatter the Seeds', 'Agony Warp', 'Banisher Priest', 'Triplicate Spirits', 'Memory Lapse', 'Tyrant''s Choice', 'Temporal Fissure')
        AND
            c2.id IN (SELECT card FROM gatherli_gatherling.deckcontents)
        GROUP BY
            c2.name)
    AS c3 ON c1.name = c3.name
WHERE
    dc.deck IN (SELECT deck FROM gatherling_one.entries WHERE event IN ('Penny Dreadful Thursdays 11.07', 'Penny Dreadful Mondays 11.07', 'Penny Dreadful Sundays 11.08'))
ORDER BY
    deck, card, issideboard

-- Insert deckerrors

INSERT INTO 
    gatherli_gatherling.deckerrors 
    (deck, error, id)
SELECT 
    deck, error, id
FROM 
    gatherling_one.deckerrors 
WHERE 
    deck IN (SELECT deck FROM gatherling_one.entries WHERE event IN ('Penny Dreadful Thursdays 11.07', 'Penny Dreadful Mondays 11.07', 'Penny Dreadful Sundays 11.08'));

-- Insert subevents

INSERT INTO 
    gatherli_gatherling.subevents 
    (parent, rounds, timing, type, id)
SELECT 
    parent, rounds, timing, type, id + 10000
FROM 
    gatherling_one.subevents 
WHERE 
    parent IN ('Penny Dreadful Thursdays 11.07', 'Penny Dreadful Mondays 11.07', 'Penny Dreadful Sundays 11.08');

-- Insert matches

INSERT INTO 
    gatherli_gatherling.matches 
    (id, playera, playerb, round, subevent, result, playera_wins, playera_losses, playera_draws, playerb_wins, playerb_losses, playerb_draws, verification)
SELECT 
    id + 130000, playera, playerb, round, subevent + 10000, result, playera_wins, playera_losses, playera_draws, playerb_wins, playerb_losses, playerb_draws, verification
FROM 
    gatherling_one.matches 
WHERE 
    subevent IN (SELECT id FROM gatherling_one.subevents WHERE parent IN ('Penny Dreadful Thursdays 11.07', 'Penny Dreadful Mondays 11.07', 'Penny Dreadful Sundays 11.08'));

-- Insert season_points

INSERT INTO 
    gatherli_gatherling.season_points 
    (series, season, event, player, adjustment, reason)
SELECT 
    series, season, event, player, adjustment, reason
FROM 
    gatherling_one.season_points 
WHERE 
    event IN ('Penny Dreadful Thursdays 11.07', 'Penny Dreadful Mondays 11.07', 'Penny Dreadful Sundays 11.08');

-- Insert ratings

INSERT INTO 
    gatherli_gatherling.ratings 
    (event, player, rating, format, updated, wins, losses)
SELECT 
    event, player, rating, format, updated, wins, losses
FROM 
    gatherling_one.ratings 
WHERE 
    event IN ('Penny Dreadful Thursdays 11.07', 'Penny Dreadful Mondays 11.07', 'Penny Dreadful Sundays 11.08');

-- Insert standings

INSERT INTO 
    gatherli_gatherling.standings 
    (player, event, active, matches_played, games_won, games_played, byes, OP_Match, PL_Game, OP_Game, score, id, seed, matched, matches_won, draws)
SELECT 
    player, event, active, matches_played, games_won, games_played, byes, OP_Match, PL_Game, OP_Game, score, id, seed, matched, matches_won, draws
FROM 
    gatherling_one.standings 
WHERE 
    event IN  ('Penny Dreadful Thursdays 11.07', 'Penny Dreadful Mondays 11.07', 'Penny Dreadful Sundays 11.08');

-- Insert trophies

INSERT INTO 
    gatherli_gatherling.trophies 
    (event, image, type, size)
SELECT 
    event, image, type, size
FROM 
    gatherling_one.trophies 
WHERE 
    event IN  ('Penny Dreadful Thursdays 11.07', 'Penny Dreadful Mondays 11.07', 'Penny Dreadful Sundays 11.08');
bakert commented 4 years ago

I started to run this. The insert into deckcontents failed with ERROR 1452 (23000): Cannot add or update a child row: a foreign key constraint fails (gatherling_one.deckcontents, CONSTRAINT deckcontents_ibfk_2 FOREIGN KEY (deck) REFERENCES decks (id))

I am attempting to restore the db from my backup of a few minutes ago but it's taking an ominously long time. :/

bakert commented 4 years ago

Restore completed. Nothing is broken. Going to run everything on a copy on local and check it all still works.

bakert commented 4 years ago

Dang, it works seamlessly on local as I assumed it would. I could copy up my local db and restore it.

bakert commented 4 years ago

I had an ambiguous table name so it only worked when logged into the correct db. After fixing that they all ran.

https://gatherling.com/event.php?event=Penny%20Dreadful%20Thursdays%2011.07 https://gatherling.com/event.php?event=Penny%20Dreadful%20Mondays%2011.07 https://gatherling.com/event.php?event=Penny%20Dreadful%20Sundays%2011.08

Woo woo!

bakert commented 4 years ago

I really hope the ids being "out of order" doesn't break anything.

bakert commented 4 years ago

The events appear to start in 2011 :/

bakert commented 4 years ago

Fixed dates. Scraped tournaments on prod. Done. Phew. Only took 7 months. Let's never speak of this again.

https://pennydreadfulmagic.com/competitions/1538/ https://pennydreadfulmagic.com/competitions/3056/