

# Dump of table content
# ------------------------------------------------------------


CREATE TABLE `content` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `content_block_id` int(11) NOT NULL,
  `updated_user_id` int(11) NOT NULL,
  `published_user_id` int(11) DEFAULT NULL,
  `updated` datetime DEFAULT NULL,
  `published` datetime DEFAULT NULL,
  `type` tinyint(1) NOT NULL DEFAULT '0' COMMENT '0 - Mark-up\n1 - Block\n',
  `content` text,
  `status` tinyint(1) NOT NULL DEFAULT '0' COMMENT '0 - Archive\n1 - Pending Approval\n2 - Published\n',
  PRIMARY KEY (`id`),
  KEY `fk_content_content_block1_idx` (`content_block_id`),
  KEY `fk_content_user1_idx` (`updated_user_id`),
  KEY `fk_content_user2_idx` (`published_user_id`),
  CONSTRAINT `fk_content_content_block1` FOREIGN KEY (`content_block_id`) REFERENCES `content_block` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `fk_content_user1` FOREIGN KEY (`updated_user_id`) REFERENCES `user` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `fk_content_user2` FOREIGN KEY (`published_user_id`) REFERENCES `user` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



# Dump of table content_block
# ------------------------------------------------------------


CREATE TABLE `content_block` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `created_user_id` int(11) NOT NULL,
  `markup_key` varchar(45) NOT NULL,
  `created` datetime DEFAULT NULL,
  `name` varchar(45) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_markup_key` (`markup_key`),
  KEY `fk_content_block_user1_idx` (`created_user_id`),
  CONSTRAINT `fk_content_block_user1` FOREIGN KEY (`created_user_id`) REFERENCES `user` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



# Dump of table content_block_page
# ------------------------------------------------------------


CREATE TABLE `content_block_page` (
  `page_id` int(11) NOT NULL,
  `content_block_id` int(11) NOT NULL,
  `position` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`page_id`,`content_block_id`),
  KEY `fk_content_block_page_content_block1_idx` (`content_block_id`),
  KEY `idx_position` (`position`),
  CONSTRAINT `fk_content_block_page_content_block1` FOREIGN KEY (`content_block_id`) REFERENCES `content_block` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `fk_content_block_page_page1` FOREIGN KEY (`page_id`) REFERENCES `page` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



# Dump of table content_block_setting
# ------------------------------------------------------------


CREATE TABLE `content_block_setting` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `site_id` int(11) NOT NULL,
  `name` varchar(45) NOT NULL,
  `settings` text,
  PRIMARY KEY (`id`),
  KEY `fk_block_setting_site1_idx` (`site_id`),
  CONSTRAINT `fk_block_setting_site1` FOREIGN KEY (`site_id`) REFERENCES `site` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


INSERT INTO `content_block_setting` (`id`, `site_id`, `name`, `settings`)
VALUES
	(1,16,'event-calendar','{\"template\":\"event-calendar\"}'),
	(2,16,'slider','{\"templates\":{\"Standard carousel\":{\"filename\":\"slider\"}},\"grouped\":{\"slides\":{\"max_members\":3,\"member\":{\"image\":{\"type\":\"image\",\"width\":1920,\"height\":1080},\"title\":{\"type\":\"text\",\"max_length\":20,\"font\":{\"family\":\"\",\"size\":12}},\"desc\":{\"type\":\"textarea\",\"max_length\":255},\"cta\":{\"type\":\"button\",\"label\":{\"text\":\"\",\"max_length\":20},\"link\":{\"url\":\"\",\"target\":\"_blank\"}}}}},\"fields\":[]}'),
	(3,16,'promo-block','{\n  \"templates\": {\n    \"Left Light template\": {\n      \"filename\": \"template-1\"\n    },\n    \"Right Light template\": {\n      \"filename\": \"template-2\"\n    },\n    \"Left Dark template\": {\n      \"filename\": \"template-1-dark\"\n    },\n    \"Right Dark template\": {\n      \"filename\": \"template-2-dark\"\n    }\n  },\n  \"grouped\": {},\n  \"fields\": {\n    \"header\": {\n      \"type\": \"text\",\n      \"max_length\": 15\n    },\n    \"desc\": {\n      \"type\": \"textarea\",\n      \"max_length\": 255\n    },\n    \"hero\": {\n      \"type\": \"image\",\n      \"width\": 800,\n      \"height\": 1432\n    },\n    \"image1\": {\n      \"type\": \"image\",\n      \"width\": 800,\n      \"height\": 716\n    },\n    \"image2\": {\n      \"type\": \"image\",\n      \"width\": 800,\n      \"height\": 716\n    },\n    \"cta\": {\"type\": \"button\",\"label\": {\"text\": \"\",\"max_length\": 20},\"link\": {\"url\": \"\",\"target\": \"_blank\"},\"labels\": [\"Buy Tickets\",\n           \"Find Out More\",\n        \"Click Here\",\n   \"Download\",\n         \"Enter Competition\",\n    \"Contact Us\"]}\n  }\n}'),
	(4,16,'intro-block','{\"templates\": {\n    \"Light template\": {\n      \"filename\": \"template-1\"\n    },\n    \"Dark template\": {\n      \"filename\": \"template-2\"\n    }\n  },\n  \"grouped\": [],\n  \"fields\": {\n    \"head\": {\n      \"type\": \"text\",\n      \"max_length\": 50\n    },\n    \"desc\": {\n      \"type\": \"textarea\",\n      \"max-lengh\": 255\n    },\n    \"cta\": {\n      \"type\": \"button\",\n      \"label\": {\n        \"text\": \"\",\n        \"max_length\": 20\n      },\n      \"link\": {\n        \"url\": \"\",\n        \"target\": \"_blank\"\n      },\n      \"labels\": [\n        \"Buy Tickets\",\n        \"Find Out More\",\n        \"Click Here\",\n        \"Enter Competition\"\n      ]\n    }\n  }\n}'),
	(5,16,'broadcast-block','{\n  \"templates\": {\n    \"Main template\": {\n      \"name\": \"template-1\",\n      \"preview\": \"main_template.png\"\n    }\n  },\n  \"cms-broadcast-header\": {\n    \"type\": \"text\",\n    \"max_length\": 128\n  }\n}'),
	(6,16,'forms','{\n\"templates\":\n    {\n     \"Contact us template\":{\n         \"filename\":\"contact\"\n      },\n        \"Newsletter sign-up template\":{\n         \"filename\":\"newsletter\"\n       }\n }\n}'),
	(7,16,'paragraph','{\n  \"templates\": {\n    \"Full text\": {\n      \"filename\": \"paragraph\"\n    },\n    \"Image left\": {\n      \"filename\": \"paragraph-img-left\"\n    },\n    \"Image right\": {\n      \"filename\": \"paragraph-img-right\"\n    },\n    \"Image left 50\": {\n      \"filename\": \"paragraph-img-50-left\"\n    },\n    \"Image right 50\": {\n      \"filename\": \"paragraph-img-50-right\"\n    },\n    \"Image left 50 with button\": {\n      \"filename\": \"paragraph-img-50-left-with-button\"\n    },\n    \"Image right 50 with button\": {\n      \"filename\": \"paragraph-img-50-right-with-button\"\n    }\n  },\n  \"grouped\": [],\n  \"fields\": {\n    \"paragraph\": {\n      \"type\": \"html\",\n      \"max-lengh\": null\n    },\n    \"image\": {\n      \"type\": \"image\",\n      \"width\": 1340,\n      \"height\": 1004\n    },\n    \"image50\": {\n      \"type\": \"image\",\n      \"width\": 1340,\n      \"height\": 1004\n    },\n     \"cta\": {\n  \"type\": \"button\",\n \"label\": {\n      \"max_length\": 20\n    },\n    \"link\": {\n       \"url\": \"\",\n        \"target\": \"_blank\"\n    }\n   }\n\n\n  }\n}'),
	(8,16,'page-hero-block','{\n  \"templates\": {\n    \"Main template\": {\n      \"filename\": \"template-main\"\n    }\n  },\n  \"grouped\": {},\n  \"fields\": {\n    \"header\": {\n      \"type\": \"text\",\n      \"max_length\": 25\n    },\n    \"desc\": {\n      \"type\": \"textarea\",\n      \"max_length\": 255\n    },\n    \"hero\": {\n      \"type\": \"image\",\n      \"width\": 2000,\n      \"height\": 600\n    },\n    \"cta\": {\n      \"type\": \"button\",\n      \"label\": {\n        \"text\": \"\",\n        \"max_length\": 20\n      },\n      \"link\": {\n        \"url\": \"\",\n        \"target\": \"_blank\"\n      }\n    }\n  }\n}'),
	(9,16,'event-info','{\n  \"templates\": [],\n  \"grouped\": [],\n  \"fields\": {\n    \"gates_open\": {\n      \"type\": \"time\"\n    },\n    \"first_race\": {\n      \"type\": \"time\"\n    },\n    \"last_race\": {\n      \"type\": \"time\"\n    },\n    \"race_type\": {\n      \"type\": \"list\",\n      \"items\": [\n        {\n          \"label\": \"FLAT\",\n          \"value\": 0\n        },\n        {\n          \"label\": \"JUMP\",\n          \"value\": 1\n        }\n      ]\n    },\n    \"races\": {\n      \"type\": \"text\",\n      \"max_length\": 2\n    },\n    \"sponsor_image\": {\n      \"type\": \"image\",\n      \"width\": 384,\n      \"height\": 183\n    }\n  }\n}'),
	(10,16,'video-block','{\n  \"templates\": {\n    \"Main Template\": {\n      \"filename\": \"template-1\"\n    }\n  },\n  \"grouped\": [],\n  \"fields\": {\n    \"video\": {\n      \"type\": \"video\",\n      \"max_length\": 255\n    }\n\n  }\n}'),
	(11,16,'event-news','{\n  \"templates\": {\n    \"Light background\": {\n      \"filename\": \"light\"\n    },\n    \"Dark background\": {\n      \"filename\": \"dark\"\n    }\n  },\n  \"fields\": {\n    \"title\": {\n      \"type\": \"text\",\n      \"max_length\": 20\n    }\n  },\n  \"grouped\": {\n    \"items\": {\n      \"max_members\": 6,\n      \"member\": {\n        \"image\": {\n          \"type\": \"image\",\n          \"width\": 800,\n          \"height\": 600\n        },\n        \"title\": {\n          \"type\": \"text\",\n          \"max_length\": 20\n        },\n        \"subtitle\": {\n          \"type\": \"text\",\n          \"max_length\": 20\n        },\n        \"cta\": {\n          \"type\": \"button\",\n          \"label\": {\n            \"text\": \"\",\n            \"max_length\": 20\n          },\n          \"link\": {\n            \"url\": \"\",\n            \"target\": \"_blank\"\n          },\n          \"labels\": [\n            \"Buy Tickets\",\n            \"Find Out More\",\n            \"Click Here\",\n       \"Download\",\n            \"Enter Competition\"\n          ]\n        }\n      }\n    }\n  }\n} '),
	(12,16,'trio-image-block','{\n  \"templates\": {\n    \"Main template\": {\n      \"filename\": \"template-1\"\n    }\n  },\n  \"grouped\": {},\n  \"fields\": {\n    \"imageleft\": {\n      \"type\": \"image\",\n      \"width\": 1000,\n      \"height\": 1000\n    },\n    \"imagecenter\": {\n      \"type\": \"image\",\n      \"width\": 1000,\n      \"height\": 1000\n    },\n    \"imageright\": {\n      \"type\": \"image\",\n      \"width\": 1000,\n      \"height\": 1000\n    }\n  }\n}'),
	(13,16,'call-to-action-block','{\n  \"templates\": {\n    \"Light template\": {\n      \"filename\": \"template-1\"\n    },\n    \"Dark template\": {\n      \"filename\": \"template-2\"\n    }\n  },\n  \"grouped\": {\n    \"items\": {\n      \"max_members\": 4,\n      \"member\": {\n        \"desc\": {\n          \"type\": \"html\",\n          \"max-lengh\": 255\n        },\n        \"cta\": {\n          \"type\": \"button\",\n          \"link\": {\n            \"url\": \"\",\n            \"target\": \"_blank\"\n          }\n        }        \n      }\n    }\n  },\n  \"fields\": {\n    \"desc\": {\n      \"type\": \"html\",\n      \"max-lengh\": 255\n    },\n    \"cta\": {\n      \"type\": \"button\",\n      \"link\": {\n        \"url\": \"\",\n        \"target\": \"_blank\"\n      }\n    }\n  }\n}'),
	(14,16,'fast-facts-block','{\n  \"templates\": {\n    \"Light background\": {\n      \"filename\": \"template-light\"\n    },\n    \"Dark background\": {\n      \"filename\": \"template-dark\"\n    }\n  },\n  \"fields\": {},\n  \"grouped\": {\n    \"items\": {\n\n\n      \"max_members\": 8,\n      \"member\": {\n        \n  \"icon\": {\n           \"type\": \"icon\",\n           \"names\": [\n          \"15-racecourses\",\n           \"annual-membership\",\n            \"banquets-and-awards\",\n          \"cars\",\n         \"carvery\",\n          \"cash\",\n         \"christmas\",\n            \"coffee\",\n           \"conferences\",\n          \"email\",\n            \"exhibition\",\n           \"exhibitions\",\n          \"eye\",\n          \"food-and-drink\",\n           \"game\",\n         \"guide-to-betting\",\n         \"join-our-team\",\n            \"location\",\n         \"multiple-access\",\n          \"outdoor-events\",\n           \"owners-and-trainers\",\n          \"package\",\n          \"parking\",\n          \"parties\",\n          \"pdf\",\n          \"people\",\n           \"person\",\n           \"phone\",\n            \"power\",\n            \"private\",\n          \"product-launches\",\n         \"programme\",\n            \"proms\",\n            \"screen\",\n           \"sponsor\",\n          \"ticket\",\n           \"training\",\n         \"venue-accessibility\",\n          \"venue-etiquette\",\n              \"view\",\n         \"voucher\",\n          \"waiter\",\n           \"weddings\"            ]\n     },\n        \"title\": {\n          \"type\": \"text\",\n          \"max_length\": 30\n        },\n        \"subtitle\": {\n          \"type\": \"text\",\n          \"max_length\": 40\n        }\n\n      }\n\n    }\n  }\n} '),
	(15,16,'event-hero','{\n  \"templates\": [],\n  \"grouped\": [],\n  \"fields\": {\n    \"hero_image\": {\n      \"type\": \"image\",\n      \"width\": 2000,\n      \"height\": 600\n    }\n  }\n}'),
	(16,16,'quote-block','{\n  \"templates\": {\n  \"Left template\": {\n    \"filename\": \"template-left\"\n  },\n  \"Right template\": {\n    \"filename\": \"template-right\"\n  }\n},\n  \"grouped\": {\n    \"items\": {\n      \"max_members\": 10,\n      \"member\": {\n        \"quote\": {\n          \"type\": \"text\",\n          \"max_length\": 255\n        },\n        \"author\": {\n          \"type\": \"textarea\",\n          \"max-lengh\": 100\n        }\n      }\n    }\n  },\n  \"fields\": {\n    \"quote\": {\n      \"type\": \"text\",\n      \"max_length\": 255\n    },\n    \"author\": {\n      \"type\": \"textarea\",\n      \"max-lengh\": 100\n    }\n  }\n}'),
	(17,16,'data-grid','{\n  \"templates\": {\n    \"Light background\": {\n      \"filename\": \"light\"\n    },\n    \"Dark background\": {\n      \"filename\": \"dark\"\n    }\n  },\n  \"fields\": {\n    \"title\": {\n      \"type\": \"text\",\n      \"max_length\": 20\n    }\n  },\n  \"grouped\": {\n    \"items\": {\n      \"max_members\": 6,\n      \"member\": {\n        \"col1\": {\n          \"type\": \"text\",\n          \"max_length\": 10\n        },\n        \"col2\": {\n          \"type\": \"text\",\n          \"max_length\": 40\n        },\n        \"col3\": {\n          \"type\": \"text\",\n          \"max_length\": 10\n        }\n\n      }\n    }\n  }\n}');



# Dump of table content_update
# ------------------------------------------------------------


CREATE TABLE `content_update` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



# Dump of table event
# ------------------------------------------------------------


CREATE TABLE `event` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `site_id` int(11) NOT NULL,
  `event_type_id` int(11) NOT NULL,
  `event_id` varchar(20) NOT NULL,
  `title` varchar(100) NOT NULL,
  `page_title` varchar(100) DEFAULT NULL,
  `sub_title` varchar(100) DEFAULT NULL,
  `date` date DEFAULT NULL,
  `description` text,
  `slug` varchar(100) DEFAULT NULL,
  `ticket_url` varchar(500) DEFAULT NULL,
  `event_info_link` varchar(100) DEFAULT NULL,
  `race_day` tinyint(4) NOT NULL DEFAULT '0',
  `featured` tinyint(4) NOT NULL DEFAULT '0',
  `active` tinyint(4) NOT NULL DEFAULT '1',
  `deleted` tinyint(4) NOT NULL DEFAULT '0',
  `modified` int(11) DEFAULT NULL,
  `custom_field_data` text,
  `ems_event` tinyint(4) NOT NULL DEFAULT '1',
  PRIMARY KEY (`id`),
  KEY `fk_event_site1_idx` (`site_id`),
  KEY `idx_slug` (`slug`),
  KEY `fk_event_event_type1_idx` (`event_type_id`),
  KEY `idx_ems_event_id` (`event_id`),
  KEY `idx_modified` (`modified`),
  KEY `idx_featured` (`featured`),
  KEY `idx_active` (`active`),
  KEY `idx_deleted` (`deleted`),
  KEY `idx_ems_event` (`ems_event`),
  CONSTRAINT `fk_event_event_type1` FOREIGN KEY (`event_type_id`) REFERENCES `event_type` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `fk_event_site1` FOREIGN KEY (`site_id`) REFERENCES `site` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



# Dump of table event_image
# ------------------------------------------------------------


CREATE TABLE `event_image` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `image_id` int(11) NOT NULL,
  `event_id` int(11) NOT NULL,
  `type` int(11) NOT NULL DEFAULT '0' COMMENT '0 - Hero\n1 - Thumbnail\n2 - Sponsor',
  PRIMARY KEY (`id`),
  KEY `fk_event_image_image1_idx` (`image_id`),
  KEY `fk_event_image_event1_idx` (`event_id`),
  CONSTRAINT `fk_event_image_event1` FOREIGN KEY (`event_id`) REFERENCES `event` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `fk_event_image_image1` FOREIGN KEY (`image_id`) REFERENCES `image` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



# Dump of table event_type
# ------------------------------------------------------------


CREATE TABLE `event_type` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(50) NOT NULL,
  `custom_field_list` text,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



# Dump of table facility
# ------------------------------------------------------------


CREATE TABLE `facility` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `title` varchar(45) NOT NULL,
  `wifi` tinyint(1) NOT NULL DEFAULT '0',
  `av_system` tinyint(1) NOT NULL DEFAULT '0',
  `telephone_points` tinyint(1) NOT NULL DEFAULT '0',
  `bar` tinyint(1) NOT NULL DEFAULT '0',
  `walk_in` tinyint(1) NOT NULL DEFAULT '0',
  `pre_book` tinyint(1) NOT NULL DEFAULT '0',
  `notes` text,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



# Dump of table facility_capacity
# ------------------------------------------------------------


CREATE TABLE `facility_capacity` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `facility_id` int(11) NOT NULL,
  `facility_layout_id` int(11) NOT NULL,
  `capacity` int(11) NOT NULL DEFAULT '0',
  `projection_type` enum('np','bp','fp') NOT NULL DEFAULT 'np' COMMENT 'np - No Projection\nbp - Back Projection\nfp - Front Projection',
  `notes` text,
  PRIMARY KEY (`id`),
  KEY `fk_facility_capacity_facility1_idx` (`facility_id`),
  KEY `fk_facility_capacity_facility_layout1_idx` (`facility_layout_id`),
  CONSTRAINT `fk_facility_capacity_facility1` FOREIGN KEY (`facility_id`) REFERENCES `facility` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `fk_facility_capacity_facility_layout1` FOREIGN KEY (`facility_layout_id`) REFERENCES `facility_layout` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



# Dump of table facility_category
# ------------------------------------------------------------


CREATE TABLE `facility_category` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(45) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



# Dump of table facility_facility_use
# ------------------------------------------------------------


CREATE TABLE `facility_facility_use` (
  `facility_id` int(11) NOT NULL,
  `facility_use_id` int(11) NOT NULL,
  `facility_category_id` int(11) NOT NULL,
  `notes` text,
  PRIMARY KEY (`facility_id`,`facility_use_id`),
  KEY `fk_facility_facility_use_facility_use1_idx` (`facility_use_id`),
  KEY `fk_facility_facility_use_facility1_idx` (`facility_id`),
  KEY `fk_facility_facility_use_facility_category1_idx` (`facility_category_id`),
  CONSTRAINT `fk_facility_facility_use_facility1` FOREIGN KEY (`facility_id`) REFERENCES `facility` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `fk_facility_facility_use_facility_category1` FOREIGN KEY (`facility_category_id`) REFERENCES `facility_category` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `fk_facility_facility_use_facility_use1` FOREIGN KEY (`facility_use_id`) REFERENCES `facility_use` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



# Dump of table facility_layout
# ------------------------------------------------------------


CREATE TABLE `facility_layout` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(45) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



# Dump of table facility_unique_selling_point
# ------------------------------------------------------------


CREATE TABLE `facility_unique_selling_point` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `facility_id` int(11) NOT NULL,
  `description` text,
  PRIMARY KEY (`id`),
  KEY `fk_unique_selling_point_facility1_idx` (`facility_id`),
  CONSTRAINT `fk_unique_selling_point_facility1` FOREIGN KEY (`facility_id`) REFERENCES `facility` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



# Dump of table facility_use
# ------------------------------------------------------------


CREATE TABLE `facility_use` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(45) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



# Dump of table file
# ------------------------------------------------------------


CREATE TABLE `file` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `site_id` int(11) NOT NULL,
  `user_id` int(11) NOT NULL,
  `title` varchar(200) DEFAULT NULL,
  `uploaded` datetime NOT NULL,
  `original_filename` varchar(200) NOT NULL,
  `extension` varchar(5) NOT NULL,
  `size` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `fk_image_site1_idx` (`site_id`),
  KEY `fk_image_user1_idx` (`user_id`),
  CONSTRAINT `fk_image_site10` FOREIGN KEY (`site_id`) REFERENCES `site` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `fk_image_user10` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



# Dump of table image
# ------------------------------------------------------------


CREATE TABLE `image` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `site_id` int(11) NOT NULL,
  `user_id` int(11) NOT NULL,
  `title` varchar(200) DEFAULT NULL,
  `alt_tag` varchar(125) DEFAULT NULL,
  `uploaded` datetime NOT NULL,
  `original_filename` varchar(200) NOT NULL,
  `thumbnail_filename` varchar(200) NOT NULL,
  `extension` varchar(5) NOT NULL,
  `width` int(11) DEFAULT NULL,
  `height` int(11) DEFAULT NULL,
  `size` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `fk_image_site1_idx` (`site_id`),
  KEY `fk_image_user1_idx` (`user_id`),
  CONSTRAINT `fk_image_site1` FOREIGN KEY (`site_id`) REFERENCES `site` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `fk_image_user1` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



# Dump of table news_article
# ------------------------------------------------------------


CREATE TABLE `news_article` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `site_id` int(11) NOT NULL,
  `site_user_id` int(11) NOT NULL,
  `news_article_category_id` int(11) NOT NULL,
  `image_id` int(11) NOT NULL,
  `created_date` datetime NOT NULL,
  `published_date` datetime DEFAULT NULL,
  `title` varchar(80) NOT NULL,
  `slug` varchar(80) NOT NULL,
  `content` mediumtext NOT NULL,
  `published` tinyint(1) NOT NULL DEFAULT '1',
  PRIMARY KEY (`id`),
  KEY `fk_news_article_news_article_category1_idx` (`news_article_category_id`),
  KEY `fk_news_article_image1_idx` (`image_id`),
  KEY `fk_news_article_site_user1_idx` (`site_user_id`),
  KEY `fk_news_article_site1_idx` (`site_id`),
  CONSTRAINT `fk_news_article_image1` FOREIGN KEY (`image_id`) REFERENCES `image` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `fk_news_article_news_article_category1` FOREIGN KEY (`news_article_category_id`) REFERENCES `news_article_category` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `fk_news_article_site1` FOREIGN KEY (`site_id`) REFERENCES `site` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `fk_news_article_site_user1` FOREIGN KEY (`site_user_id`) REFERENCES `site_user` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



# Dump of table news_article_category
# ------------------------------------------------------------


CREATE TABLE `news_article_category` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `site_id` int(11) NOT NULL,
  `title` varchar(25) NOT NULL,
  `slug` varchar(50) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `fk_news_article_category_site1_idx` (`site_id`),
  KEY `idx_slug` (`slug`),
  CONSTRAINT `fk_news_article_category_site1` FOREIGN KEY (`site_id`) REFERENCES `site` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


INSERT INTO `news_article_category` (`id`, `site_id`, `title`, `slug`)
VALUES
	(1,16,'Charity Events','charity-events'),
	(2,16,'Christmas','christmas'),
	(3,16,'Competitions','competitions'),
	(4,16,'Family Events','family-events'),
	(5,16,'Festivals','festivals'),
	(6,16,'Local Business','local-business'),
	(7,16,'Music Live','music-live'),
	(8,16,'Non-Racing Events','non-racing-events'),
	(9,16,'Partners & Sponsors','partners-and-sponsors'),
	(10,16,'Racing','racing');



# Dump of table notification
# ------------------------------------------------------------


CREATE TABLE `notification` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `site_id` int(11) NOT NULL,
  `user_id` int(11) NOT NULL,
  `message_added` date NOT NULL,
  `message` varchar(200) NOT NULL,
  `expiry_date` date NOT NULL,
  `active` tinyint(4) NOT NULL DEFAULT '1',
  PRIMARY KEY (`id`),
  KEY `fk_table1_site1_idx` (`site_id`),
  KEY `fk_notification_user1_idx` (`user_id`),
  CONSTRAINT `fk_notification_user1` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `fk_table1_site1` FOREIGN KEY (`site_id`) REFERENCES `site` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



# Dump of table package
# ------------------------------------------------------------


CREATE TABLE `package` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `event_id` int(11) NOT NULL,
  `package_type_id` int(11) NOT NULL,
  `package_id` varchar(20) NOT NULL,
  `name` varchar(100) NOT NULL,
  `description` text,
  `price` decimal(13,4) NOT NULL,
  `created` int(11) NOT NULL,
  `modified` int(11) NOT NULL,
  `featured` tinyint(4) NOT NULL DEFAULT '0',
  `active` tinyint(4) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `fk_package_package_type1_idx` (`package_type_id`),
  KEY `fk_package_event1_idx` (`event_id`),
  KEY `idx_package_id` (`package_id`),
  CONSTRAINT `fk_package_event1` FOREIGN KEY (`event_id`) REFERENCES `event` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `fk_package_package_type1` FOREIGN KEY (`package_type_id`) REFERENCES `package_type` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



# Dump of table package_type
# ------------------------------------------------------------


CREATE TABLE `package_type` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(100) NOT NULL,
  `package_type_id` varchar(20) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_package_type_id` (`package_type_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



# Dump of table page
# ------------------------------------------------------------


CREATE TABLE `page` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `site_id` int(11) NOT NULL,
  `image_id` int(11) DEFAULT '0',
  `title` varchar(50) DEFAULT NULL,
  `name` varchar(200) NOT NULL,
  `description` text,
  `cache` text,
  `parent_page_id` int(11) NOT NULL DEFAULT '0',
  `previous_page_id` int(11) NOT NULL DEFAULT '0',
  `next_page_id` int(11) NOT NULL DEFAULT '0',
  `sitemap_priority` float NOT NULL DEFAULT '0',
  `sitemap_frequency` varchar(10) NOT NULL COMMENT '''always'', ''hourly'', ''daily'', ''weekly'', ''monthly'', ''yearly'', ''never''',
  `sitemap_lastmod` datetime DEFAULT NULL,
  `menu_order` int(11) NOT NULL DEFAULT '0',
  `include_on_menu` tinyint(4) NOT NULL DEFAULT '1',
  PRIMARY KEY (`id`),
  KEY `idx_page_name` (`name`),
  KEY `fk_page_site1_idx` (`site_id`),
  KEY `idx_parent_page_id` (`parent_page_id`),
  KEY `idx_previous_page_id` (`previous_page_id`),
  KEY `idx_next_page_id` (`next_page_id`),
  KEY `idx_menu_order` (`menu_order`),
  KEY `fk_page_image1_idx` (`image_id`),
  CONSTRAINT `fk_page_image1` FOREIGN KEY (`image_id`) REFERENCES `image` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `fk_page_site1` FOREIGN KEY (`site_id`) REFERENCES `site` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


INSERT INTO `page` (`id`, `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
	(1,16,NULL,'Sunderland Greyhounds','/','Sunderland Greyhounds','<?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><module key=\"e273565d-803c-4c99-8dde-28df7d3f6fb2\" type=\"meta-data\"><![CDATA[{\"template_name\":\"meta-data\",\"data\":{\"meta_data\":{\"description\":\"The Silk Series returns for it\'s second year, continuing to promote races specifically for female jockeys, held on ladies days across 13 racecourses in the UK.\",\"keywords\":\"\"}},\"block_type\":\"meta-data\"}]]></module><module key=\"ec3e17a7-1185-428a-8f91-acc5a71c1db9\" type=\"hero\"><![CDATA[{\"template_name\":\"template-main\",\"data\":{\"hero\":{\"id\":\"42\",\"filename\":\"silks-hero-2.jpg\",\"alt_tag\":\"false\"}},\"block_type\":\"hero\"}]]></module><module key=\"4fc09f90-b2d8-49dd-8933-966ae971c141\" type=\"intro\"><![CDATA[{\"template_name\":\"template-1\",\"data\":{\"head\":{\"text\":\"The Silk Series\",\"visible\":\"true\"},\"desc\":{\"text\":\"Created by Arena Racing Company, the \\u00a3100,000 Silk Series returns for it\'s second year, promoting races specifically for female jockeys across thirteen racecourses, showcasing talent and proudly supporting Cancer Research UK.\",\"visible\":\"true\"},\"cta\":{\"label\":\"About the Silk Series\",\"target\":\"_self\",\"url\":\"\\/about-the-silk-series\\/\",\"visible\":\"true\"}},\"block_type\":\"intro\"}]]></module><module key=\"b640da24-15a2-4f2e-ac8f-1e54467d4ff8\" type=\"paragraph\"><![CDATA[{\"template_name\":\"paragraph-img-50-left\",\"data\":{\"paragraph\":{\"text\":\"<h4><strong>Raising Money For Cancer Research UK<\\/strong><\\/h4>\\n<br \\/>We very much hope you will come and be part of The Silk Series by attending one of thirteen Ladies Days events, which are full of colour and fun, as well as excellent sporting action. All details about the racedays can be found on each of the participating racecourses websites.\"},\"image50\":{\"id\":\"43\",\"filename\":\"cruk_1.jpg\",\"alt_tag\":\"Cancer Research UK logo.\"},\"cta\":{\"label\":\"CTA Button\",\"target\":\"_self\",\"url\":\"\\/\"}},\"block_type\":\"paragraph\"}]]></module></content>\n',0,5,2,1,'daily',NULL,0,1),
	(2,16,NULL,'Racing | Sunderland Greyhounds','/racing/','Racing','<?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><module key=\"e273565d-803c-4c99-8dde-28df7d3f6fb2\" type=\"meta-data\"><![CDATA[{\"template_name\":\"meta-data\",\"data\":{\"meta_data\":{\"description\":\"The Silk Series returns for it\'s second year, continuing to promote races specifically for female jockeys, held on ladies days across 13 racecourses in the UK.\",\"keywords\":\"\"}},\"block_type\":\"meta-data\"}]]></module><module key=\"ec3e17a7-1185-428a-8f91-acc5a71c1db9\" type=\"hero\"><![CDATA[{\"template_name\":\"template-main\",\"data\":{\"hero\":{\"id\":\"42\",\"filename\":\"silks-hero-2.jpg\",\"alt_tag\":\"false\"}},\"block_type\":\"hero\"}]]></module><module key=\"4fc09f90-b2d8-49dd-8933-966ae971c141\" type=\"intro\"><![CDATA[{\"template_name\":\"template-1\",\"data\":{\"head\":{\"text\":\"The Silk Series\",\"visible\":\"true\"},\"desc\":{\"text\":\"Created by Arena Racing Company, the \\u00a3100,000 Silk Series returns for it\'s second year, promoting races specifically for female jockeys across thirteen racecourses, showcasing talent and proudly supporting Cancer Research UK.\",\"visible\":\"true\"},\"cta\":{\"label\":\"About the Silk Series\",\"target\":\"_self\",\"url\":\"\\/about-the-silk-series\\/\",\"visible\":\"true\"}},\"block_type\":\"intro\"}]]></module><module key=\"b640da24-15a2-4f2e-ac8f-1e54467d4ff8\" type=\"paragraph\"><![CDATA[{\"template_name\":\"paragraph-img-50-left\",\"data\":{\"paragraph\":{\"text\":\"<h4><strong>Raising Money For Cancer Research UK<\\/strong><\\/h4>\\n<br \\/>We very much hope you will come and be part of The Silk Series by attending one of thirteen Ladies Days events, which are full of colour and fun, as well as excellent sporting action. All details about the racedays can be found on each of the participating racecourses websites.\"},\"image50\":{\"id\":\"43\",\"filename\":\"cruk_1.jpg\",\"alt_tag\":\"Cancer Research UK logo.\"},\"cta\":{\"label\":\"CTA Button\",\"target\":\"_self\",\"url\":\"\\/\"}},\"block_type\":\"paragraph\"}]]></module></content>\n',0,1,3,0.9,'weekly',NULL,0,1),
	(3,16,NULL,'Trackside Restaurant | Sunderland Greyhounds','/trackside-restaurant/','Trackside Restaurant','<?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><module key=\"e273565d-803c-4c99-8dde-28df7d3f6fb2\" type=\"meta-data\"><![CDATA[{\"template_name\":\"meta-data\",\"data\":{\"meta_data\":{\"description\":\"The Silk Series returns for it\'s second year, continuing to promote races specifically for female jockeys, held on ladies days across 13 racecourses in the UK.\",\"keywords\":\"\"}},\"block_type\":\"meta-data\"}]]></module><module key=\"ec3e17a7-1185-428a-8f91-acc5a71c1db9\" type=\"hero\"><![CDATA[{\"template_name\":\"template-main\",\"data\":{\"hero\":{\"id\":\"42\",\"filename\":\"silks-hero-2.jpg\",\"alt_tag\":\"false\"}},\"block_type\":\"hero\"}]]></module><module key=\"4fc09f90-b2d8-49dd-8933-966ae971c141\" type=\"intro\"><![CDATA[{\"template_name\":\"template-1\",\"data\":{\"head\":{\"text\":\"The Silk Series\",\"visible\":\"true\"},\"desc\":{\"text\":\"Created by Arena Racing Company, the \\u00a3100,000 Silk Series returns for it\'s second year, promoting races specifically for female jockeys across thirteen racecourses, showcasing talent and proudly supporting Cancer Research UK.\",\"visible\":\"true\"},\"cta\":{\"label\":\"About the Silk Series\",\"target\":\"_self\",\"url\":\"\\/about-the-silk-series\\/\",\"visible\":\"true\"}},\"block_type\":\"intro\"}]]></module><module key=\"b640da24-15a2-4f2e-ac8f-1e54467d4ff8\" type=\"paragraph\"><![CDATA[{\"template_name\":\"paragraph-img-50-left\",\"data\":{\"paragraph\":{\"text\":\"<h4><strong>Raising Money For Cancer Research UK<\\/strong><\\/h4>\\n<br \\/>We very much hope you will come and be part of The Silk Series by attending one of thirteen Ladies Days events, which are full of colour and fun, as well as excellent sporting action. All details about the racedays can be found on each of the participating racecourses websites.\"},\"image50\":{\"id\":\"43\",\"filename\":\"cruk_1.jpg\",\"alt_tag\":\"Cancer Research UK logo.\"},\"cta\":{\"label\":\"CTA Button\",\"target\":\"_self\",\"url\":\"\\/\"}},\"block_type\":\"paragraph\"}]]></module></content>\n',0,2,4,0.8,'monthly',NULL,0,1),
	(4,16,NULL,'Offers & Packages | Sunderland Greyhounds','/offers-and-packages/','Offers & Packages','<?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><module key=\"e273565d-803c-4c99-8dde-28df7d3f6fb2\" type=\"meta-data\"><![CDATA[{\"template_name\":\"meta-data\",\"data\":{\"meta_data\":{\"description\":\"The Silk Series returns for it\'s second year, continuing to promote races specifically for female jockeys, held on ladies days across 13 racecourses in the UK.\",\"keywords\":\"\"}},\"block_type\":\"meta-data\"}]]></module><module key=\"ec3e17a7-1185-428a-8f91-acc5a71c1db9\" type=\"hero\"><![CDATA[{\"template_name\":\"template-main\",\"data\":{\"hero\":{\"id\":\"42\",\"filename\":\"silks-hero-2.jpg\",\"alt_tag\":\"false\"}},\"block_type\":\"hero\"}]]></module><module key=\"4fc09f90-b2d8-49dd-8933-966ae971c141\" type=\"intro\"><![CDATA[{\"template_name\":\"template-1\",\"data\":{\"head\":{\"text\":\"The Silk Series\",\"visible\":\"true\"},\"desc\":{\"text\":\"Created by Arena Racing Company, the \\u00a3100,000 Silk Series returns for it\'s second year, promoting races specifically for female jockeys across thirteen racecourses, showcasing talent and proudly supporting Cancer Research UK.\",\"visible\":\"true\"},\"cta\":{\"label\":\"About the Silk Series\",\"target\":\"_self\",\"url\":\"\\/about-the-silk-series\\/\",\"visible\":\"true\"}},\"block_type\":\"intro\"}]]></module><module key=\"b640da24-15a2-4f2e-ac8f-1e54467d4ff8\" type=\"paragraph\"><![CDATA[{\"template_name\":\"paragraph-img-50-left\",\"data\":{\"paragraph\":{\"text\":\"<h4><strong>Raising Money For Cancer Research UK<\\/strong><\\/h4>\\n<br \\/>We very much hope you will come and be part of The Silk Series by attending one of thirteen Ladies Days events, which are full of colour and fun, as well as excellent sporting action. All details about the racedays can be found on each of the participating racecourses websites.\"},\"image50\":{\"id\":\"43\",\"filename\":\"cruk_1.jpg\",\"alt_tag\":\"Cancer Research UK logo.\"},\"cta\":{\"label\":\"CTA Button\",\"target\":\"_self\",\"url\":\"\\/\"}},\"block_type\":\"paragraph\"}]]></module></content>\n',0,3,5,0.8,'monthly',NULL,0,1),
	(5,16,NULL,'Contact Us | Sunderland Greyhounds','/contact-us/','Contact Us','<?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><module key=\"e273565d-803c-4c99-8dde-28df7d3f6fb2\" type=\"meta-data\"><![CDATA[{\"template_name\":\"meta-data\",\"data\":{\"meta_data\":{\"description\":\"The Silk Series returns for it\'s second year, continuing to promote races specifically for female jockeys, held on ladies days across 13 racecourses in the UK.\",\"keywords\":\"\"}},\"block_type\":\"meta-data\"}]]></module><module key=\"ec3e17a7-1185-428a-8f91-acc5a71c1db9\" type=\"hero\"><![CDATA[{\"template_name\":\"template-main\",\"data\":{\"hero\":{\"id\":\"42\",\"filename\":\"silks-hero-2.jpg\",\"alt_tag\":\"false\"}},\"block_type\":\"hero\"}]]></module><module key=\"4fc09f90-b2d8-49dd-8933-966ae971c141\" type=\"intro\"><![CDATA[{\"template_name\":\"template-1\",\"data\":{\"head\":{\"text\":\"The Silk Series\",\"visible\":\"true\"},\"desc\":{\"text\":\"Created by Arena Racing Company, the \\u00a3100,000 Silk Series returns for it\'s second year, promoting races specifically for female jockeys across thirteen racecourses, showcasing talent and proudly supporting Cancer Research UK.\",\"visible\":\"true\"},\"cta\":{\"label\":\"About the Silk Series\",\"target\":\"_self\",\"url\":\"\\/about-the-silk-series\\/\",\"visible\":\"true\"}},\"block_type\":\"intro\"}]]></module><module key=\"b640da24-15a2-4f2e-ac8f-1e54467d4ff8\" type=\"paragraph\"><![CDATA[{\"template_name\":\"paragraph-img-50-left\",\"data\":{\"paragraph\":{\"text\":\"<h4><strong>Raising Money For Cancer Research UK<\\/strong><\\/h4>\\n<br \\/>We very much hope you will come and be part of The Silk Series by attending one of thirteen Ladies Days events, which are full of colour and fun, as well as excellent sporting action. All details about the racedays can be found on each of the participating racecourses websites.\"},\"image50\":{\"id\":\"43\",\"filename\":\"cruk_1.jpg\",\"alt_tag\":\"Cancer Research UK logo.\"},\"cta\":{\"label\":\"CTA Button\",\"target\":\"_self\",\"url\":\"\\/\"}},\"block_type\":\"paragraph\"}]]></module></content>\n',0,4,1,0.8,'monthly',NULL,0,1),
	(6,16,NULL,'Cookies | Sunderland Greyhounds','/cookies/','Cookies','<?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><module key=\"e273565d-803c-4c99-8dde-28df7d3f6fb2\" type=\"meta-data\"><![CDATA[{\"template_name\":\"meta-data\",\"data\":{\"meta_data\":{\"description\":\"The Silk Series returns for it\'s second year, continuing to promote races specifically for female jockeys, held on ladies days across 13 racecourses in the UK.\",\"keywords\":\"\"}},\"block_type\":\"meta-data\"}]]></module><module key=\"ec3e17a7-1185-428a-8f91-acc5a71c1db9\" type=\"hero\"><![CDATA[{\"template_name\":\"template-main\",\"data\":{\"hero\":{\"id\":\"42\",\"filename\":\"silks-hero-2.jpg\",\"alt_tag\":\"false\"}},\"block_type\":\"hero\"}]]></module><module key=\"4fc09f90-b2d8-49dd-8933-966ae971c141\" type=\"intro\"><![CDATA[{\"template_name\":\"template-1\",\"data\":{\"head\":{\"text\":\"The Silk Series\",\"visible\":\"true\"},\"desc\":{\"text\":\"Created by Arena Racing Company, the \\u00a3100,000 Silk Series returns for it\'s second year, promoting races specifically for female jockeys across thirteen racecourses, showcasing talent and proudly supporting Cancer Research UK.\",\"visible\":\"true\"},\"cta\":{\"label\":\"About the Silk Series\",\"target\":\"_self\",\"url\":\"\\/about-the-silk-series\\/\",\"visible\":\"true\"}},\"block_type\":\"intro\"}]]></module><module key=\"b640da24-15a2-4f2e-ac8f-1e54467d4ff8\" type=\"paragraph\"><![CDATA[{\"template_name\":\"paragraph-img-50-left\",\"data\":{\"paragraph\":{\"text\":\"<h4><strong>Raising Money For Cancer Research UK<\\/strong><\\/h4>\\n<br \\/>We very much hope you will come and be part of The Silk Series by attending one of thirteen Ladies Days events, which are full of colour and fun, as well as excellent sporting action. All details about the racedays can be found on each of the participating racecourses websites.\"},\"image50\":{\"id\":\"43\",\"filename\":\"cruk_1.jpg\",\"alt_tag\":\"Cancer Research UK logo.\"},\"cta\":{\"label\":\"CTA Button\",\"target\":\"_self\",\"url\":\"\\/\"}},\"block_type\":\"paragraph\"}]]></module></content>\n',0,1,7,0.5,'yearly',NULL,0,1),
	(7,16,NULL,'Privacy Policy | Sunderland Greyhounds','/privacy-policy/','Privacy Policy','<?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><module key=\"e273565d-803c-4c99-8dde-28df7d3f6fb2\" type=\"meta-data\"><![CDATA[{\"template_name\":\"meta-data\",\"data\":{\"meta_data\":{\"description\":\"The Silk Series returns for it\'s second year, continuing to promote races specifically for female jockeys, held on ladies days across 13 racecourses in the UK.\",\"keywords\":\"\"}},\"block_type\":\"meta-data\"}]]></module><module key=\"ec3e17a7-1185-428a-8f91-acc5a71c1db9\" type=\"hero\"><![CDATA[{\"template_name\":\"template-main\",\"data\":{\"hero\":{\"id\":\"42\",\"filename\":\"silks-hero-2.jpg\",\"alt_tag\":\"false\"}},\"block_type\":\"hero\"}]]></module><module key=\"4fc09f90-b2d8-49dd-8933-966ae971c141\" type=\"intro\"><![CDATA[{\"template_name\":\"template-1\",\"data\":{\"head\":{\"text\":\"The Silk Series\",\"visible\":\"true\"},\"desc\":{\"text\":\"Created by Arena Racing Company, the \\u00a3100,000 Silk Series returns for it\'s second year, promoting races specifically for female jockeys across thirteen racecourses, showcasing talent and proudly supporting Cancer Research UK.\",\"visible\":\"true\"},\"cta\":{\"label\":\"About the Silk Series\",\"target\":\"_self\",\"url\":\"\\/about-the-silk-series\\/\",\"visible\":\"true\"}},\"block_type\":\"intro\"}]]></module><module key=\"b640da24-15a2-4f2e-ac8f-1e54467d4ff8\" type=\"paragraph\"><![CDATA[{\"template_name\":\"paragraph-img-50-left\",\"data\":{\"paragraph\":{\"text\":\"<h4><strong>Raising Money For Cancer Research UK<\\/strong><\\/h4>\\n<br \\/>We very much hope you will come and be part of The Silk Series by attending one of thirteen Ladies Days events, which are full of colour and fun, as well as excellent sporting action. All details about the racedays can be found on each of the participating racecourses websites.\"},\"image50\":{\"id\":\"43\",\"filename\":\"cruk_1.jpg\",\"alt_tag\":\"Cancer Research UK logo.\"},\"cta\":{\"label\":\"CTA Button\",\"target\":\"_self\",\"url\":\"\\/\"}},\"block_type\":\"paragraph\"}]]></module></content>\n',0,6,8,0.5,'yearly',NULL,0,1),
	(8,16,NULL,'Terms & Conditions | Sunderland Greyhounds','/terms-conditions/','Terms & Conditions','<?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><module key=\"e273565d-803c-4c99-8dde-28df7d3f6fb2\" type=\"meta-data\"><![CDATA[{\"template_name\":\"meta-data\",\"data\":{\"meta_data\":{\"description\":\"The Silk Series returns for it\'s second year, continuing to promote races specifically for female jockeys, held on ladies days across 13 racecourses in the UK.\",\"keywords\":\"\"}},\"block_type\":\"meta-data\"}]]></module><module key=\"ec3e17a7-1185-428a-8f91-acc5a71c1db9\" type=\"hero\"><![CDATA[{\"template_name\":\"template-main\",\"data\":{\"hero\":{\"id\":\"42\",\"filename\":\"silks-hero-2.jpg\",\"alt_tag\":\"false\"}},\"block_type\":\"hero\"}]]></module><module key=\"4fc09f90-b2d8-49dd-8933-966ae971c141\" type=\"intro\"><![CDATA[{\"template_name\":\"template-1\",\"data\":{\"head\":{\"text\":\"The Silk Series\",\"visible\":\"true\"},\"desc\":{\"text\":\"Created by Arena Racing Company, the \\u00a3100,000 Silk Series returns for it\'s second year, promoting races specifically for female jockeys across thirteen racecourses, showcasing talent and proudly supporting Cancer Research UK.\",\"visible\":\"true\"},\"cta\":{\"label\":\"About the Silk Series\",\"target\":\"_self\",\"url\":\"\\/about-the-silk-series\\/\",\"visible\":\"true\"}},\"block_type\":\"intro\"}]]></module><module key=\"b640da24-15a2-4f2e-ac8f-1e54467d4ff8\" type=\"paragraph\"><![CDATA[{\"template_name\":\"paragraph-img-50-left\",\"data\":{\"paragraph\":{\"text\":\"<h4><strong>Raising Money For Cancer Research UK<\\/strong><\\/h4>\\n<br \\/>We very much hope you will come and be part of The Silk Series by attending one of thirteen Ladies Days events, which are full of colour and fun, as well as excellent sporting action. All details about the racedays can be found on each of the participating racecourses websites.\"},\"image50\":{\"id\":\"43\",\"filename\":\"cruk_1.jpg\",\"alt_tag\":\"Cancer Research UK logo.\"},\"cta\":{\"label\":\"CTA Button\",\"target\":\"_self\",\"url\":\"\\/\"}},\"block_type\":\"paragraph\"}]]></module></content>\n',0,8,1,0.5,'yearly',NULL,0,1);



# Dump of table rbac_permissions
# ------------------------------------------------------------


CREATE TABLE `rbac_permissions` (
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `Lft` int(11) NOT NULL,
  `Rght` int(11) NOT NULL,
  `Title` char(64) COLLATE utf8_bin NOT NULL,
  `Description` text COLLATE utf8_bin NOT NULL,
  PRIMARY KEY (`ID`),
  KEY `Title` (`Title`),
  KEY `Lft` (`Lft`),
  KEY `Rght` (`Rght`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;


INSERT INTO `rbac_permissions` (`ID`, `Lft`, `Rght`, `Title`, `Description`)
VALUES
	(1,0,9,X'726F6F74',X'726F6F74'),
	(2,1,2,X'6D616E6167655F7573657273',X'43616E206D616E616765207573657273'),
	(3,3,4,X'656469745F636F6E74656E74',X'43616E206564697420636D7320636F6E74656E74'),
	(4,5,6,X'6D616E6167655F6E657773',X'43616E206D616E616765206E6577732073746F72696573'),
	(5,7,8,X'6D616E6167655F62726F616463617374',X'43616E206D616E6167652062726F616463617374206D65737361676573');



# Dump of table rbac_rolepermissions
# ------------------------------------------------------------


CREATE TABLE `rbac_rolepermissions` (
  `RoleID` int(11) NOT NULL,
  `PermissionID` int(11) NOT NULL,
  `AssignmentDate` int(11) NOT NULL,
  PRIMARY KEY (`RoleID`,`PermissionID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;


INSERT INTO `rbac_rolepermissions` (`RoleID`, `PermissionID`, `AssignmentDate`)
VALUES
	(1,1,1467367657),
	(8,2,1467644172),
	(8,3,1467644172),
	(8,4,1467644172),
	(8,5,1467644172),
	(9,3,1467644172),
	(9,4,1467644172),
	(9,5,1467644172),
	(10,3,1467644172);



# Dump of table rbac_roles
# ------------------------------------------------------------


CREATE TABLE `rbac_roles` (
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `Lft` int(11) NOT NULL,
  `Rght` int(11) NOT NULL,
  `Title` varchar(128) COLLATE utf8_bin NOT NULL,
  `Description` text COLLATE utf8_bin NOT NULL,
  PRIMARY KEY (`ID`),
  KEY `Title` (`Title`),
  KEY `Lft` (`Lft`),
  KEY `Rght` (`Rght`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;


INSERT INTO `rbac_roles` (`ID`, `Lft`, `Rght`, `Title`, `Description`)
VALUES
	(1,0,7,X'726F6F74',X'726F6F74'),
	(8,1,2,X'73797374656D5F61646D696E',X'53797374656D2061646D696E6973747261746F72'),
	(9,3,4,X'736974655F61646D696E',X'536974652061646D696E6973747261746F72'),
	(10,5,6,X'636F6E74656E745F656469746F72',X'436F6E74656E7420656469746F72');



# Dump of table rbac_userroles
# ------------------------------------------------------------


CREATE TABLE `rbac_userroles` (
  `UserID` int(11) NOT NULL,
  `RoleID` int(11) NOT NULL,
  `AssignmentDate` int(11) NOT NULL,
  PRIMARY KEY (`UserID`,`RoleID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;


INSERT INTO `rbac_userroles` (`UserID`, `RoleID`, `AssignmentDate`)
VALUES
	(1,1,1485528819),
	(1,8,1485528819),
	(2,1,1485528819),
	(2,8,1485528819),
	(4,1,1485528819),
	(4,8,1485528819),
	(5,1,1485528819),
	(5,8,1485528819),
	(6,1,1485528819),
	(6,8,1485528819),
	(7,1,1485528819),
	(7,8,1485528819);



# Dump of table schema_version
# ------------------------------------------------------------


CREATE TABLE `schema_version` (
  `installed_rank` int(11) NOT NULL,
  `version` varchar(50) DEFAULT NULL,
  `description` varchar(200) NOT NULL,
  `type` varchar(20) NOT NULL,
  `script` varchar(1000) NOT NULL,
  `checksum` int(11) DEFAULT NULL,
  `installed_by` varchar(100) NOT NULL,
  `installed_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `execution_time` int(11) NOT NULL,
  `success` tinyint(1) NOT NULL,
  PRIMARY KEY (`installed_rank`),
  KEY `schema_version_s_idx` (`success`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;



# Dump of table site
# ------------------------------------------------------------


CREATE TABLE `site` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(45) NOT NULL,
  `template_dir` varchar(255) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


INSERT INTO `site` (`id`, `name`, `template_dir`)
VALUES
	(16,'Sunderland Greyhounds','sunderland-greyhounds');



# Dump of table site_global
# ------------------------------------------------------------


CREATE TABLE `site_global` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `site_id` int(11) NOT NULL,
  `label` varchar(20) NOT NULL,
  `json` tinyint(4) NOT NULL DEFAULT '0',
  `data` text,
  PRIMARY KEY (`id`),
  KEY `fk_site_global_site1_idx` (`site_id`),
  KEY `idx_label` (`label`),
  CONSTRAINT `fk_site_global_site1` FOREIGN KEY (`site_id`) REFERENCES `site` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


INSERT INTO `site_global` (`id`, `site_id`, `label`, `json`, `data`)
VALUES
	(1,16,'dress_code',0,'Dress Code information\n\n<a href=\"/plan-your-visit/venue-etiquette/\">Click here</a> for more information.'),
	(2,16,'site_details',1,'{\n  \"name\": \"Sunderland Greyhounds\",\n  \"address\": {\n    \"street\": \"\",\n    \"locality\": \"\",\n    \"region\": \"\",\n    \"postcode\": \"\"\n  },\n  \"opening_times\": {\n    \"times\": \"9.00am - 5.30day)\",\n    \"note\": \"Times vary on race days and events.\"\n  },\n  \"contact_points_left\": {\n    \"point1\": {\n      \"label\": \"General Enquiries\",\n      \"display\": \"0044 (0)191 5686 200\",\n      \"contact\": \"+441915686200\",\n      \"email\": \"info@sunderland-greyhounds.co.uk\"\n    }\n\n  },\n  \"contact_points_right\": {\n\n  },\n  \"email_addresses\": {\n    \"enquiries\": \"info@sunderland-greyhounds.co.uk\",\n    \"events\": \"info@sunderland-greyhounds.co.uk\",\n    \"weddings\": \"info@sunderland-greyhounds.co.uk\"\n  },\n  \"items\": [\n {\n      \"icon\": \"directions_car\",\n      \"description\": \"Car directions\"\n    },\n {\n      \"icon\": \"bus\",\n      \"description\": \"Bus directions\"\n    },\n {\n      \"icon\": \"train\",\n      \"description\": \"Train Directions\"\n    },\n    {\n      \"icon\": \"helicopter1\",\n      \"description\": \"Helicopter directions\"\n    }\n\n  ],\n  \"map\": {\n    \"api\": \"AIzaSyB-iEVX18FFI_1NkASbWeYGo4XEUHUCpok\",\n    \"latLon\": \"54.9398218,-1.4097461\",\n    \"markerTitle\": \"Sunderland Greyhounds\"\n  },\n  \"header_menu\": {\n    \"template\": \"light\"\n  }\n}'),
	(3,16,'social_icons',1,'{\n  \"icons\": [\n    {\n      \"url\": \"https://www.facebook.com/sunderlandgreyhoundstadium/\",\n      \"filename\": \"facebook\",\n      \"title\": \"Facebook\"\n    },\n    {\n      \"url\": \"https://twitter.com/SunderlandDogs\",\n      \"filename\": \"twitter\",\n      \"title\": \"Twitter\"\n    },\n    {\n      \"url\": \"https://www.instagram.com/sunderlanddogs/\",\n      \"filename\": \"instagram\",\n      \"title\": \"Instagram\"\n    }\n\n\n  ]\n}'),
	(4,16,'sponsors',1,'{\n  \"sponsors\": [\n    {\n      \"url\": \"http://htbelectrical.co.uk/\",\n      \"filename\": \"hb.png\"\n    },\n    {\n      \"url\": \"http://www.azteccolourprint.co.uk/\",\n      \"filename\": \"aztec.png\"\n    },\n    {\n      \"url\": \"http://sports.williamhill.com/bet/en-gb\",\n      \"filename\": \"william-hill.png\"\n    },\n    {\n      \"url\": \"http://www.skysports.com/\",\n      \"filename\": \"sky-sports.png\"\n    },\n    {\n      \"url\": \"https://carlsberguk.co.uk/\",\n      \"filename\": \"carlsberg.png\"\n    },\n    {\n      \"url\": \"http://www.arenaracingcompany.co.uk/\",\n      \"filename\": \"arc.png\"\n    }\n\n  ]\n}'),
	(5,16,'footer_industry_icon',1,'{\n  \"icons\": [\n\n  ]\n}'),
	(6,16,'eventmaster_forms',1,'{\n  \"contact\": {\n    \"assigned_user\": \"3ae7a749-633f-a85f-a920-59b7bdfecb25\",\n    \"assigned_campaign\": \"ed50b437-a8fb-c778-2dca-519b7346380f\"\n  },\n  \"newsletter\": {\n    \"assigned_user\": \"623ad052-fe18-8081-daba-50631e2c178a\",\n    \"assigned_campaign\": \"76d3626b-e9f5-c534-a4cd-51caac80be7b\"\n  }\n}'),
	(7,16,'add_this_id',1,'{\n  \"add_this\": {\n    \"id\": \"5a942d041012db94\",\n    \"class\": \"addthis_inline_share_toolbox\"\n  }\n}\n'),
	(8,16,'main_menu',1,'{\n  \"template\": {\n    \"name\": \"light\",\n    \"whatson\": \"false\"\n  },\n  \"menus\": [\n   {\n      \"title\": \"Racing\",\n      \"menu\": \"racing\",\n      \"url\": \"/racing/\"\n    }, \n   {\n      \"title\": \"Trackside Restaurant\",\n      \"menu\": \"trackside-restaurant\",\n      \"url\": \"/trackside-restaurant/\"\n    },\n    {\n      \"title\": \"Offers & Packages\",\n      \"menu\": \"offers-packages\",\n      \"url\": \"/offers-and-packages/\"\n    },\n    {\n      \"title\": \"Contact Us\",\n      \"menu\": \"contact-us\",\n      \"url\": \"/contact-us/\"\n    }\n  ]\n}'),
	(9,16,'raceday_info',0,'<p>Children under 18 go free when accompanied by an adult (*Some exceptions apply). ID may be required.</p>\n<p>No refund shall be given in respect of any unused part of any badge or other entitlement. <a href=\"/terms-and-conditions/\">Click here</a> for our full terms and conditions.</p>');



# Dump of table site_user
# ------------------------------------------------------------


CREATE TABLE `site_user` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `site_id` int(11) NOT NULL,
  `user_id` int(11) NOT NULL,
  `active` tinyint(1) NOT NULL DEFAULT '0',
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `fk_site_user_site1_idx` (`site_id`),
  KEY `fk_site_user_user1_idx` (`user_id`),
  KEY `idx_active` (`active`),
  KEY `idx_deleted` (`deleted`),
  CONSTRAINT `fk_site_user_site1` FOREIGN KEY (`site_id`) REFERENCES `site` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `fk_site_user_user1` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


INSERT INTO `site_user` (`id`, `site_id`, `user_id`, `active`, `deleted`)
VALUES
	(1,16,1,1,0),
	(2,16,2,1,0),
	(4,16,4,1,0),
	(5,16,5,1,0),
	(6,16,6,1,0),
	(7,16,7,1,0);



# Dump of table url
# ------------------------------------------------------------


CREATE TABLE `url` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `site_id` int(11) NOT NULL,
  `url` varchar(255) NOT NULL,
  `admin` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'Does this URL gain access to the admin tools?',
  `type` enum('local','development','production') DEFAULT NULL COMMENT 'Type of host.',
  PRIMARY KEY (`id`),
  KEY `fk_url_site_idx` (`site_id`),
  KEY `idx_url` (`url`),
  CONSTRAINT `fk_url_site` FOREIGN KEY (`site_id`) REFERENCES `site` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


INSERT INTO `url` (`id`, `site_id`, `url`, `admin`, `type`)
VALUES
	(10,16,'sunderland-greyhounds.local.co.uk',0,NULL),
	(11,16,'sunderland-greyhounds.arenaracingdev.co.uk',0,NULL),
	(12,16,'sunderland-greyhounds.com',0,NULL),
	(13,16,'www.sunderland-greyhounds.com',0,NULL),
	(14,16,'admin.sunderland-greyhounds.arenaracingdev.co.uk',0,NULL),
	(15,16,'admin.sunderland-greyhounds.com',0,NULL),
	(16,16,'admin.sunderland-greyhounds.local.co.uk',0,NULL);



# Dump of table user
# ------------------------------------------------------------


CREATE TABLE `user` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(100) DEFAULT NULL,
  `email_address` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_email_address` (`email_address`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


INSERT INTO `user` (`id`, `name`, `email_address`)
VALUES
	(1,'Steve','sheath@arenaracingcompany.co.uk'),
	(2,'Kamil','kgraj@arenaracingcompany.co.uk'),
	(4,'Richard','rharris@arenaracingcompany.co.uk'),
	(5,'David Gath','dgath@arenaracingcompany.co.uk'),
	(6,'Scott Weston','sweston@arenaracingcompany.co.uk'),
	(7,'Lauren Keeling','lkeeling@arenaracingcompany.co.uk');




