-- +mixmaker Up
INSERT INTO rulesets (id, name, body)
VALUES
(
    'standard-control-hybrid-control',
    'Control → Hybrid → Control',
    '{
      "ID": "standard-control-hybrid-control",
      "Name": "Control → Hybrid → Control",
      "MapPools": [
        ["Antarctic Peninsula", "Busan", "Ilios", "Lijiang Tower", "Nepal", "Oasis", "Samoa"],
        ["Blizzard World", "Eichenwalde", "Hollywood", "King''s Row", "Midtown", "Numbani", "Paraíso"],
        ["Antarctic Peninsula", "Busan", "Ilios", "Lijiang Tower", "Nepal", "Oasis", "Samoa"]
      ],
      "Heroes": [
        {"name":"D.Va","role":"Tank"},{"name":"Doomfist","role":"Tank"},{"name":"Hazard","role":"Tank"},{"name":"Junker Queen","role":"Tank"},{"name":"Mauga","role":"Tank"},{"name":"Orisa","role":"Tank"},{"name":"Ramattra","role":"Tank"},{"name":"Reinhardt","role":"Tank"},{"name":"Roadhog","role":"Tank"},{"name":"Sigma","role":"Tank"},{"name":"Winston","role":"Tank"},{"name":"Wrecking Ball","role":"Tank"},{"name":"Zarya","role":"Tank"},
        {"name":"Ashe","role":"Damage"},{"name":"Bastion","role":"Damage"},{"name":"Cassidy","role":"Damage"},{"name":"Echo","role":"Damage"},{"name":"Freja","role":"Damage"},{"name":"Genji","role":"Damage"},{"name":"Hanzo","role":"Damage"},{"name":"Junkrat","role":"Damage"},{"name":"Mei","role":"Damage"},{"name":"Pharah","role":"Damage"},{"name":"Reaper","role":"Damage"},{"name":"Sojourn","role":"Damage"},{"name":"Soldier: 76","role":"Damage"},{"name":"Sombra","role":"Damage"},{"name":"Symmetra","role":"Damage"},{"name":"Torbjörn","role":"Damage"},{"name":"Tracer","role":"Damage"},{"name":"Venture","role":"Damage"},{"name":"Widowmaker","role":"Damage"},
        {"name":"Ana","role":"Support"},{"name":"Baptiste","role":"Support"},{"name":"Brigitte","role":"Support"},{"name":"Illari","role":"Support"},{"name":"Juno","role":"Support"},{"name":"Kiriko","role":"Support"},{"name":"Lifeweaver","role":"Support"},{"name":"Lúcio","role":"Support"},{"name":"Mercy","role":"Support"},{"name":"Moira","role":"Support"},{"name":"Zenyatta","role":"Support"}
      ],
      "HeroBansPerTeam": 2,
      "BestOf": 3,
      "InitialMapBanner": 0,
      "InitialHeroBanner": 1
    }'::jsonb
)
ON CONFLICT (id) DO NOTHING;

INSERT INTO rulesets (id, name, body)
VALUES (
    'variety-control-push-escort',
    'Control → Push → Escort',
    jsonb_set(
      jsonb_set(
        (SELECT body FROM rulesets WHERE id = 'standard-control-hybrid-control'),
        '{ID}',
        '"variety-control-push-escort"'
      ),
      '{Name}',
      '"Control → Push → Escort"'
    ) || '{
      "MapPools": [
        ["Antarctic Peninsula", "Busan", "Ilios", "Lijiang Tower", "Nepal", "Oasis", "Samoa"],
        ["Colosseo", "Esperança", "New Queen Street", "Runasapi"],
        ["Circuit Royal", "Dorado", "Havana", "Junkertown", "Rialto", "Route 66", "Shambali Monastery", "Watchpoint: Gibraltar"]
      ]
    }'::jsonb
)
ON CONFLICT (id) DO NOTHING;

-- +mixmaker Down
DELETE FROM rulesets
WHERE id IN ('standard-control-hybrid-control', 'variety-control-push-escort');
