
# Update Mega Menu.
update `site_global`
set `data` = '
{
  "template": {
    "name": "light"
  },
  "menus": [
    {
      "title": "Plan Your Visit",
      "menu": "plan-your-visit",
      "slug": "/plan-your-visit/",
      "columns": [
        {
          "items": [
            {
              "type": "parent",
              "title": "Plan Your Visit",
              "slug": "/plan-your-visit/"
            },
            {
              "type": "parent",
              "title": "Get Here",
              "slug": "/plan-your-visit/get-here/"
            },
            {
              "type": "parent",
              "title": "Ticket & Package Types",
              "slug": "/plan-your-visit/ticket-and-package-types/"
            },
            {
              "type": "parent",
              "title": "Food & Drink ",
              "slug": "/plan-your-visit/food-and-drink/"
            }
          ]
        },
        {
          "items": [
            {
              "type": "parent",
              "title": "What To Wear",
              "slug": "/plan-your-visit/what-to-wear/"
            },
            {
              "type": "parent",
              "title": "Venue Accessibility ",
              "slug": "/plan-your-visit/venue-accessibility/"
            },
            {
              "type": "parent",
              "title": "Racecourse Map",
              "slug": "/plan-your-visit/racecourse-map/"
            },
            {
              "type": "parent",
              "title": "Guide For New Racegoers",
              "slug": "/plan-your-visit/guide-for-new-racegoers/"
            }
          ]
        },
        {
          "items": [
            {
              "type": "parent",
              "title": "How To Place A Bet",
              "slug": "/plan-your-visit/how-to-place-a-bet/"
            },
            {
              "type": "parent",
              "title": "Where To Stay",
              "slug": "/plan-your-visit/where-to-stay/"
            },
            {
              "type": "parent",
              "title": "Rewards4Racing",
              "slug": "/plan-your-visit/rewards4racing/"
            }
          ]
        }
      ]
    },
    {
      "title": "Restaurants </br>& Hospitality",
      "menu": "hospitality",
      "slug": "/restaurants-and-hospitality/",
      "columns": [
        {
          "items": [
            {
              "type": "parent",
              "title": "Restaurants & Hospitality",
              "slug": "/restaurants-and-hospitality/"
            },
            {
              "type": "parent",
              "title": "Severn Restaurant",
              "slug": "/restaurants-and-hospitality/severn-restaurant/"
            }
          ]
        },
        {
          "items": [
            {
              "type": "parent",
              "title": "Private Boxes",
              "slug": "/restaurants-and-hospitality/private-boxes/"
            },
            {
              "type": "parent",
              "title": "The Parade Ring Marquee",
              "slug": "/restaurants-and-hospitality/the-parade-ring-marquee/"
            }
          ]
        },
        {
          "items": [
            {
              "type": "parent",
              "title": "Platinum Package",
              "slug": "/restaurants-and-hospitality/platinum-package/"
            }

          ]
        }
      ]
    },
    {
      "title": "Hire Our Venue",
      "menu": "hire-our-venue",
      "slug": "/hire-our-venue/",
      "columns": [
        {
          "items": [
            {
              "type": "parent",
              "title": "Hire Our Venue",
              "slug": "/hire-our-venue/"
            },
            {
              "type": "child",
              "title": "Rooms & Capacities",
              "slug": "/hire-our-venue/rooms-and-capacities/"
            },
            {
              "type": "parent",
              "title": "Hire For Business",
              "slug": "/hire-our-venue/hire-for-business/"
            },
            {
              "type": "child",
              "title": "Conferences & Meetings",
              "slug": "/hire-our-venue/hire-for-business/conferences-and-meetings/"
            },
            {
              "type": "child",
              "title": "Exhibitions & Fairs",
              "slug": "/hire-our-venue/hire-for-business/exhibitions-and-fairs/"
            },
            {
              "type": "child",
              "title": "Outdoor Events",
              "slug": "/hire-our-venue/hire-for-business/outdoor-events/"
            }
          ]
        },
        {
          "items": [
            {
              "type": "parent",
              "title": "Hire For Celebration",
              "slug": "/hire-our-venue/hire-for-celebration/"
            },
            {
              "type": "child",
              "title": "Christmas Parties",
              "slug": "/hire-our-venue/hire-for-celebration/christmas-parties/"
            },
            {
              "type": "child",
              "title": "Parties & Dinners",
              "slug": "/hire-our-venue/hire-for-celebration/parties-and-dinners/"
            },
            {
              "type": "child",
              "title": "Funeral Receptions",
              "slug": "/hire-our-venue/hire-for-celebration/funeral-receptions/"
            }
          ]
        },
        {
          "items": [
            {
              "type": "parent",
              "title": "Weddings",
              "slug": "/hire-our-venue/weddings/"
            },
            {
              "type": "child",
              "title": "Wedding Spaces & Suites",
              "slug": "/hire-our-venue/weddings/wedding-spaces-and-suites/"
            },
            {
              "type": "child",
              "title": "Wedding Packages & Menus",
              "slug": "/hire-our-venue/weddings/wedding-packages-and-menus/"
            }
          ]
        }

      ]
    },
    {
      "title": "Our Racecourse",
      "menu": "our-racecourse",
      "slug": "/our-racecourse/",
      "columns": [
        {
          "items": [
            {
              "type": "parent",
              "title": "Our Racecourse",
              "slug": "/our-racecourse/"
            },
            {
              "type": "parent",
              "title": "About Us",
              "slug": "/our-racecourse/about-us/"
            },
             {
              "type": "parent",
              "title": "Annual Membership",
              "slug": "/our-racecourse/annual-membership/"
            }
          ]
        },
        {
          "items": [
            {
              "type": "parent",
              "title": "Gift Vouchers",
              "slug": "/our-racecourse/gift-vouchers/"
            },
            {
              "type": "parent",
              "title": "Sponsorship & Partnerships",
              "slug": "/our-racecourse/sponsorship-and-partnerships/"
            },
            {
              "type": "parent",
              "title": "Join Our Team",
              "slug": "/our-racecourse/join-our-team/"
            }
          ]
        },
        {
          "items": [
            {
              "type": "parent",
              "title": "People Of Pitchcroft",
              "slug": "/our-racecourse/people-of-pitchcroft/"
            },
            {
              "type": "parent",
              "title": "Owners & Trainers",
              "slug": "/our-racecourse/owners-and-trainers/"
            },
            {
              "type": "parent",
              "title": "Equine Welfare",
              "slug": "/our-racecourse/equine-welfare/"
            }
          ]
        }
      ]
    },
    {
      "title": "News",
      "menu": "news",
      "url": "/news/"
    },
    {
      "title": "Contact Us",
      "menu": "contact-us",
      "url": "/contact-us/"
    }
  ]
}'
where `label` = 'main_menu';

# Add new page.
INSERT INTO `page` (`site_id`, `image_id`, `title`, `name`, `description`, `cache`, `parent_page_id`, `previous_page_id`, `next_page_id`, `sitemap_priority`, `sitemap_frequency`, `sitemap_lastmod`, `menu_order`, `include_on_menu`)
VALUES
  (11, NULL, 'People Of Pitchcroft | Worcester Racecourse', '/our-racecourse/people-of-pitchcroft/', 'People Of Pitchcroft', '<?xml version=\"1.0\" encoding=\"utf8\"?>\n<!DOCTYPE content [\n        <!ELEMENT content (module)*>\n        <!ELEMENT module (#PCDATA)>\n        <!ATTLIST module key CDATA #REQUIRED>\n        <!ATTLIST module type CDATA #REQUIRED>\n        ]>\n<content>\n    <module key=\"454f05a5-2d16-4699-81c0-539a5747bc67\" type=\"meta-data\">\n        {\"template_name\":\"meta-data\",\"data\":{\"meta_data\":{\"description\":\"Description text.\",\"keywords\":\"keywords, separated, with, commas\"}}}\n    </module>\n\n    <module key=\"c32acc73-3bed-48be-8601-14233f115b0f\" type=\"hero\">\n        {\"template_name\":\"template-main\",\"data\":{\"hero\":{\"id\":\"\",\"filename\":\"\"}}}\n    </module>\n\n    <module key=\"e7be1dd8-7abd-4bf6-bf1e-d0d32b4c85db\" type=\"paragraph\">\n        {\"template_name\":\"paragraph\",\"data\":{\"paragraph\":{\"text\":\"Paragraph Text\"},\"image50\":{\"id\":\"\",\"filename\":\"\"},\"cta\":{\"label\":\"CTA Button\",\"target\":\"_self\",\"url\":\"/\"}}}\n    </module>\n\n    <module key=\"97b398e4-4111-4d63-a925-54cc55e82f50\" type=\"trio-image\">\n        {\"template_name\":\"template-1\",\"data\":{\"imageleft\":{\"id\":\"\",\"filename\":\"\"},\"imagecenter\":{\"id\":\"\",\"filename\":\"\"},\"imageright\":{\"id\":\"\",\"filename\":\"\"}}}\n    </module>\n\n    <module key=\"3b91cea0-0d35-45b9-89c4-2af220523d49\" type=\"trio-image\">\n        {\"template_name\":\"template-1\",\"data\":{\"imageleft\":{\"id\":\"\",\"filename\":\"\"},\"imagecenter\":{\"id\":\"\",\"filename\":\"\"},\"imageright\":{\"id\":\"\",\"filename\":\"\"}}}\n    </module>\n\n    <module key=\"eebc2109-342f-41d3-8e77-15cc4fdd1e0d\" type=\"call-to-action\">\n        {\"template_name\":\"call-to-action\",\"data\":{\"items\":[{\"desc\":{\"text\":\"Call To Action Text\"},\"cta\":{\"label\":\"CTA Button\",\"url\":\"/\",\"target\":\"_self\"}}]}}\n    </module>\n\n    <module key=\"72ddbada-0e17-41ed-a736-0ab75a9f95b9\" type=\"form\">\n        {\"template_name\":\"newsletter\"}\n    </module>\n</content>\n', 0, 43, 43, 0.9, 'monthly', NULL, 0, 1);

# Get the new page ID.
SET @peopleOfPitchcroftPageId = LAST_INSERT_ID();

# Update previous and next.

# Get page id for Owners And Trainers.
select `id` into @ownersAndTrainersId
from `page`
where `name` = '/our-racecourse/owners-and-trainers/';

# Get page id for Join Our Team.
select `id` into @joinOurTeamId
from `page`
where `name` = '/our-racecourse/join-our-team/';

# Update Next for Join Our Team.
update `page`
set `next_page_id` = @peopleOfPitchcroftPageId
where `id` = @joinOurTeamId;

# Update Previous for Owners And Trainers.
update `page`
set `previous_page_id` = @peopleOfPitchcroftPageId
where `id` = @ownersAndTrainersId;

# Update Previous and next for People Of Pitchcroft.
update `page`
set `previous_page_id` = @joinOurTeamId, `next_page_id` = @ownersAndTrainersId
where `id` = @peopleOfPitchcroftPageId;

