
CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__all_media_3`  AS  (select `f`.`fileID` AS `mediaID`,`fs`.`type` AS `mediaType`,`fs`.`socialChannel` AS `socialChannel`,`fs`.`mime` AS `mime`,`f`.`name` AS `mediaName`,`f`.`url` AS `url`,`fp`.`url` AS `previewFileUrl`,`fs`.`size` AS `size`,`fs`.`data_width` AS `width`,`fs`.`data_height` AS `height`,`fs`.`data_ratio` AS `ratio`,`fs`.`systemType` AS `systemType`,`f`.`status` AS `status`,`f`.`userID` AS `userID`,`f`.`createDate` AS `createDate`,`f`.`modifyDate` AS `modifyDate`,'file' AS `mainMediaType` from ((`cms__file` `f` join `cms__file_static` `fs` on(((`fs`.`fileID` = `f`.`fileID`) and (`fs`.`type` <> 'preview') and (`f`.`fileID` in (select `smd__organization_has_media`.`mediaID` from `smd__organization_has_media` where `smd__organization_has_media`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 3))) or (`fs`.`systemType` in ('generic','branded')))))) left join `cms__file` `fp` on((`fp`.`fileID` = `fs`.`previewFileID`)))) union (select `c`.`carouselID` AS `mediaID`,'carousel' AS `mediaType`,`c`.`socialChannel` AS `socialChannel`,'carousel' AS `mime`,`c`.`name` AS `mediaName`,`c`.`url` AS `url`,NULL AS `previewFileUrl`,NULL AS `size`,NULL AS `width`,NULL AS `height`,NULL AS `ratio`,`c`.`systemType` AS `systemType`,`c`.`status` AS `status`,`c`.`userID` AS `userID`,`c`.`createDate` AS `createDate`,`c`.`modifyDate` AS `modifyDate`,'carousel' AS `mainMediaType` from `smd__carousel` `c`) ;

-- --------------------------------------------------------

--
-- Structure for view `view__all_media_4`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__all_media_4`  AS  (select `f`.`fileID` AS `mediaID`,`fs`.`type` AS `mediaType`,`fs`.`socialChannel` AS `socialChannel`,`fs`.`mime` AS `mime`,`f`.`name` AS `mediaName`,`f`.`url` AS `url`,`fp`.`url` AS `previewFileUrl`,`fs`.`size` AS `size`,`fs`.`data_width` AS `width`,`fs`.`data_height` AS `height`,`fs`.`data_ratio` AS `ratio`,`fs`.`systemType` AS `systemType`,`f`.`status` AS `status`,`f`.`userID` AS `userID`,`f`.`createDate` AS `createDate`,`f`.`modifyDate` AS `modifyDate`,'file' AS `mainMediaType` from ((`cms__file` `f` join `cms__file_static` `fs` on(((`fs`.`fileID` = `f`.`fileID`) and (`fs`.`type` <> 'preview') and (`f`.`fileID` in (select `smd__organization_has_media`.`mediaID` from `smd__organization_has_media` where `smd__organization_has_media`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 4))) or (`fs`.`systemType` in ('generic','branded')))))) left join `cms__file` `fp` on((`fp`.`fileID` = `fs`.`previewFileID`)))) union (select `c`.`carouselID` AS `mediaID`,'carousel' AS `mediaType`,`c`.`socialChannel` AS `socialChannel`,'carousel' AS `mime`,`c`.`name` AS `mediaName`,`c`.`url` AS `url`,NULL AS `previewFileUrl`,NULL AS `size`,NULL AS `width`,NULL AS `height`,NULL AS `ratio`,`c`.`systemType` AS `systemType`,`c`.`status` AS `status`,`c`.`userID` AS `userID`,`c`.`createDate` AS `createDate`,`c`.`modifyDate` AS `modifyDate`,'carousel' AS `mainMediaType` from `smd__carousel` `c`) ;

-- --------------------------------------------------------

--
-- Structure for view `view__all_media_5`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__all_media_5`  AS  (select `f`.`fileID` AS `mediaID`,`fs`.`type` AS `mediaType`,`fs`.`socialChannel` AS `socialChannel`,`fs`.`mime` AS `mime`,`f`.`name` AS `mediaName`,`f`.`url` AS `url`,`fp`.`url` AS `previewFileUrl`,`fs`.`size` AS `size`,`fs`.`data_width` AS `width`,`fs`.`data_height` AS `height`,`fs`.`data_ratio` AS `ratio`,`fs`.`systemType` AS `systemType`,`f`.`status` AS `status`,`f`.`userID` AS `userID`,`f`.`createDate` AS `createDate`,`f`.`modifyDate` AS `modifyDate`,'file' AS `mainMediaType` from ((`cms__file` `f` join `cms__file_static` `fs` on(((`fs`.`fileID` = `f`.`fileID`) and (`fs`.`type` <> 'preview') and (`f`.`fileID` in (select `smd__organization_has_media`.`mediaID` from `smd__organization_has_media` where `smd__organization_has_media`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 5))) or (`fs`.`systemType` in ('generic','branded')))))) left join `cms__file` `fp` on((`fp`.`fileID` = `fs`.`previewFileID`)))) union (select `c`.`carouselID` AS `mediaID`,'carousel' AS `mediaType`,`c`.`socialChannel` AS `socialChannel`,'carousel' AS `mime`,`c`.`name` AS `mediaName`,`c`.`url` AS `url`,NULL AS `previewFileUrl`,NULL AS `size`,NULL AS `width`,NULL AS `height`,NULL AS `ratio`,`c`.`systemType` AS `systemType`,`c`.`status` AS `status`,`c`.`userID` AS `userID`,`c`.`createDate` AS `createDate`,`c`.`modifyDate` AS `modifyDate`,'carousel' AS `mainMediaType` from `smd__carousel` `c`) ;

-- --------------------------------------------------------

--
-- Structure for view `view__all_media_6`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__all_media_6`  AS  (select `f`.`fileID` AS `mediaID`,`fs`.`type` AS `mediaType`,`fs`.`socialChannel` AS `socialChannel`,`fs`.`mime` AS `mime`,`f`.`name` AS `mediaName`,`f`.`url` AS `url`,`fp`.`url` AS `previewFileUrl`,`fs`.`size` AS `size`,`fs`.`data_width` AS `width`,`fs`.`data_height` AS `height`,`fs`.`data_ratio` AS `ratio`,`fs`.`systemType` AS `systemType`,`f`.`status` AS `status`,`f`.`userID` AS `userID`,`f`.`createDate` AS `createDate`,`f`.`modifyDate` AS `modifyDate`,'file' AS `mainMediaType` from ((`cms__file` `f` join `cms__file_static` `fs` on(((`fs`.`fileID` = `f`.`fileID`) and (`fs`.`type` <> 'preview') and (`f`.`fileID` in (select `smd__organization_has_media`.`mediaID` from `smd__organization_has_media` where `smd__organization_has_media`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 6))) or (`fs`.`systemType` in ('generic','branded')))))) left join `cms__file` `fp` on((`fp`.`fileID` = `fs`.`previewFileID`)))) union (select `c`.`carouselID` AS `mediaID`,'carousel' AS `mediaType`,`c`.`socialChannel` AS `socialChannel`,'carousel' AS `mime`,`c`.`name` AS `mediaName`,`c`.`url` AS `url`,NULL AS `previewFileUrl`,NULL AS `size`,NULL AS `width`,NULL AS `height`,NULL AS `ratio`,`c`.`systemType` AS `systemType`,`c`.`status` AS `status`,`c`.`userID` AS `userID`,`c`.`createDate` AS `createDate`,`c`.`modifyDate` AS `modifyDate`,'carousel' AS `mainMediaType` from `smd__carousel` `c`) ;

-- --------------------------------------------------------

--
-- Structure for view `view__all_media_7`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__all_media_7`  AS  (select `f`.`fileID` AS `mediaID`,`fs`.`type` AS `mediaType`,`fs`.`socialChannel` AS `socialChannel`,`fs`.`mime` AS `mime`,`f`.`name` AS `mediaName`,`f`.`url` AS `url`,`fp`.`url` AS `previewFileUrl`,`fs`.`size` AS `size`,`fs`.`data_width` AS `width`,`fs`.`data_height` AS `height`,`fs`.`data_ratio` AS `ratio`,`fs`.`systemType` AS `systemType`,`f`.`status` AS `status`,`f`.`userID` AS `userID`,`f`.`createDate` AS `createDate`,`f`.`modifyDate` AS `modifyDate`,'file' AS `mainMediaType` from ((`cms__file` `f` join `cms__file_static` `fs` on(((`fs`.`fileID` = `f`.`fileID`) and (`fs`.`type` <> 'preview') and (`f`.`fileID` in (select `smd__organization_has_media`.`mediaID` from `smd__organization_has_media` where `smd__organization_has_media`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 7))) or (`fs`.`systemType` in ('generic','branded')))))) left join `cms__file` `fp` on((`fp`.`fileID` = `fs`.`previewFileID`)))) union (select `c`.`carouselID` AS `mediaID`,'carousel' AS `mediaType`,`c`.`socialChannel` AS `socialChannel`,'carousel' AS `mime`,`c`.`name` AS `mediaName`,`c`.`url` AS `url`,NULL AS `previewFileUrl`,NULL AS `size`,NULL AS `width`,NULL AS `height`,NULL AS `ratio`,`c`.`systemType` AS `systemType`,`c`.`status` AS `status`,`c`.`userID` AS `userID`,`c`.`createDate` AS `createDate`,`c`.`modifyDate` AS `modifyDate`,'carousel' AS `mainMediaType` from `smd__carousel` `c`) ;

-- --------------------------------------------------------

--
-- Structure for view `view__all_media_8`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__all_media_8`  AS  (select `f`.`fileID` AS `mediaID`,`fs`.`type` AS `mediaType`,`fs`.`socialChannel` AS `socialChannel`,`fs`.`mime` AS `mime`,`f`.`name` AS `mediaName`,`f`.`url` AS `url`,`fp`.`url` AS `previewFileUrl`,`fs`.`size` AS `size`,`fs`.`data_width` AS `width`,`fs`.`data_height` AS `height`,`fs`.`data_ratio` AS `ratio`,`fs`.`systemType` AS `systemType`,`f`.`status` AS `status`,`f`.`userID` AS `userID`,`f`.`createDate` AS `createDate`,`f`.`modifyDate` AS `modifyDate`,'file' AS `mainMediaType` from ((`cms__file` `f` join `cms__file_static` `fs` on(((`fs`.`fileID` = `f`.`fileID`) and (`fs`.`type` <> 'preview') and (`f`.`fileID` in (select `smd__organization_has_media`.`mediaID` from `smd__organization_has_media` where `smd__organization_has_media`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 8))) or (`fs`.`systemType` in ('generic','branded')))))) left join `cms__file` `fp` on((`fp`.`fileID` = `fs`.`previewFileID`)))) union (select `c`.`carouselID` AS `mediaID`,'carousel' AS `mediaType`,`c`.`socialChannel` AS `socialChannel`,'carousel' AS `mime`,`c`.`name` AS `mediaName`,`c`.`url` AS `url`,NULL AS `previewFileUrl`,NULL AS `size`,NULL AS `width`,NULL AS `height`,NULL AS `ratio`,`c`.`systemType` AS `systemType`,`c`.`status` AS `status`,`c`.`userID` AS `userID`,`c`.`createDate` AS `createDate`,`c`.`modifyDate` AS `modifyDate`,'carousel' AS `mainMediaType` from `smd__carousel` `c`) ;

-- --------------------------------------------------------

--
-- Structure for view `view__all_media_9`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__all_media_9`  AS  (select `f`.`fileID` AS `mediaID`,`fs`.`type` AS `mediaType`,`fs`.`socialChannel` AS `socialChannel`,`fs`.`mime` AS `mime`,`f`.`name` AS `mediaName`,`f`.`url` AS `url`,`fp`.`url` AS `previewFileUrl`,`fs`.`size` AS `size`,`fs`.`data_width` AS `width`,`fs`.`data_height` AS `height`,`fs`.`data_ratio` AS `ratio`,`fs`.`systemType` AS `systemType`,`f`.`status` AS `status`,`f`.`userID` AS `userID`,`f`.`createDate` AS `createDate`,`f`.`modifyDate` AS `modifyDate`,'file' AS `mainMediaType` from ((`cms__file` `f` join `cms__file_static` `fs` on(((`fs`.`fileID` = `f`.`fileID`) and (`fs`.`type` <> 'preview') and (`f`.`fileID` in (select `smd__organization_has_media`.`mediaID` from `smd__organization_has_media` where `smd__organization_has_media`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 9))) or (`fs`.`systemType` in ('generic','branded')))))) left join `cms__file` `fp` on((`fp`.`fileID` = `fs`.`previewFileID`)))) union (select `c`.`carouselID` AS `mediaID`,'carousel' AS `mediaType`,`c`.`socialChannel` AS `socialChannel`,'carousel' AS `mime`,`c`.`name` AS `mediaName`,`c`.`url` AS `url`,NULL AS `previewFileUrl`,NULL AS `size`,NULL AS `width`,NULL AS `height`,NULL AS `ratio`,`c`.`systemType` AS `systemType`,`c`.`status` AS `status`,`c`.`userID` AS `userID`,`c`.`createDate` AS `createDate`,`c`.`modifyDate` AS `modifyDate`,'carousel' AS `mainMediaType` from `smd__carousel` `c`) ;

-- --------------------------------------------------------

--
-- Structure for view `view__all_media_10`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__all_media_10`  AS  (select `f`.`fileID` AS `mediaID`,`fs`.`type` AS `mediaType`,`fs`.`socialChannel` AS `socialChannel`,`fs`.`mime` AS `mime`,`f`.`name` AS `mediaName`,`f`.`url` AS `url`,`fp`.`url` AS `previewFileUrl`,`fs`.`size` AS `size`,`fs`.`data_width` AS `width`,`fs`.`data_height` AS `height`,`fs`.`data_ratio` AS `ratio`,`fs`.`systemType` AS `systemType`,`f`.`status` AS `status`,`f`.`userID` AS `userID`,`f`.`createDate` AS `createDate`,`f`.`modifyDate` AS `modifyDate`,'file' AS `mainMediaType` from ((`cms__file` `f` join `cms__file_static` `fs` on(((`fs`.`fileID` = `f`.`fileID`) and (`fs`.`type` <> 'preview') and (`f`.`fileID` in (select `smd__organization_has_media`.`mediaID` from `smd__organization_has_media` where `smd__organization_has_media`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 10))) or (`fs`.`systemType` in ('generic','branded')))))) left join `cms__file` `fp` on((`fp`.`fileID` = `fs`.`previewFileID`)))) union (select `c`.`carouselID` AS `mediaID`,'carousel' AS `mediaType`,`c`.`socialChannel` AS `socialChannel`,'carousel' AS `mime`,`c`.`name` AS `mediaName`,`c`.`url` AS `url`,NULL AS `previewFileUrl`,NULL AS `size`,NULL AS `width`,NULL AS `height`,NULL AS `ratio`,`c`.`systemType` AS `systemType`,`c`.`status` AS `status`,`c`.`userID` AS `userID`,`c`.`createDate` AS `createDate`,`c`.`modifyDate` AS `modifyDate`,'carousel' AS `mainMediaType` from `smd__carousel` `c`) ;

-- --------------------------------------------------------

--
-- Structure for view `view__all_media_11`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__all_media_11`  AS  (select `f`.`fileID` AS `mediaID`,`fs`.`type` AS `mediaType`,`fs`.`socialChannel` AS `socialChannel`,`fs`.`mime` AS `mime`,`f`.`name` AS `mediaName`,`f`.`url` AS `url`,`fp`.`url` AS `previewFileUrl`,`fs`.`size` AS `size`,`fs`.`data_width` AS `width`,`fs`.`data_height` AS `height`,`fs`.`data_ratio` AS `ratio`,`fs`.`systemType` AS `systemType`,`f`.`status` AS `status`,`f`.`userID` AS `userID`,`f`.`createDate` AS `createDate`,`f`.`modifyDate` AS `modifyDate`,'file' AS `mainMediaType` from ((`cms__file` `f` join `cms__file_static` `fs` on(((`fs`.`fileID` = `f`.`fileID`) and (`fs`.`type` <> 'preview') and (`f`.`fileID` in (select `smd__organization_has_media`.`mediaID` from `smd__organization_has_media` where `smd__organization_has_media`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 11))) or (`fs`.`systemType` in ('generic','branded')))))) left join `cms__file` `fp` on((`fp`.`fileID` = `fs`.`previewFileID`)))) union (select `c`.`carouselID` AS `mediaID`,'carousel' AS `mediaType`,`c`.`socialChannel` AS `socialChannel`,'carousel' AS `mime`,`c`.`name` AS `mediaName`,`c`.`url` AS `url`,NULL AS `previewFileUrl`,NULL AS `size`,NULL AS `width`,NULL AS `height`,NULL AS `ratio`,`c`.`systemType` AS `systemType`,`c`.`status` AS `status`,`c`.`userID` AS `userID`,`c`.`createDate` AS `createDate`,`c`.`modifyDate` AS `modifyDate`,'carousel' AS `mainMediaType` from `smd__carousel` `c`) ;

-- --------------------------------------------------------

--
-- Structure for view `view__all_media_12`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__all_media_12`  AS  (select `f`.`fileID` AS `mediaID`,`fs`.`type` AS `mediaType`,`fs`.`socialChannel` AS `socialChannel`,`fs`.`mime` AS `mime`,`f`.`name` AS `mediaName`,`f`.`url` AS `url`,`fp`.`url` AS `previewFileUrl`,`fs`.`size` AS `size`,`fs`.`data_width` AS `width`,`fs`.`data_height` AS `height`,`fs`.`data_ratio` AS `ratio`,`fs`.`systemType` AS `systemType`,`f`.`status` AS `status`,`f`.`userID` AS `userID`,`f`.`createDate` AS `createDate`,`f`.`modifyDate` AS `modifyDate`,'file' AS `mainMediaType` from ((`cms__file` `f` join `cms__file_static` `fs` on(((`fs`.`fileID` = `f`.`fileID`) and (`fs`.`type` <> 'preview') and (`f`.`fileID` in (select `smd__organization_has_media`.`mediaID` from `smd__organization_has_media` where `smd__organization_has_media`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 12))) or (`fs`.`systemType` in ('generic','branded')))))) left join `cms__file` `fp` on((`fp`.`fileID` = `fs`.`previewFileID`)))) union (select `c`.`carouselID` AS `mediaID`,'carousel' AS `mediaType`,`c`.`socialChannel` AS `socialChannel`,'carousel' AS `mime`,`c`.`name` AS `mediaName`,`c`.`url` AS `url`,NULL AS `previewFileUrl`,NULL AS `size`,NULL AS `width`,NULL AS `height`,NULL AS `ratio`,`c`.`systemType` AS `systemType`,`c`.`status` AS `status`,`c`.`userID` AS `userID`,`c`.`createDate` AS `createDate`,`c`.`modifyDate` AS `modifyDate`,'carousel' AS `mainMediaType` from `smd__carousel` `c`) ;

-- --------------------------------------------------------

--
-- Structure for view `view__all_media_13`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__all_media_13`  AS  (select `f`.`fileID` AS `mediaID`,`fs`.`type` AS `mediaType`,`fs`.`socialChannel` AS `socialChannel`,`fs`.`mime` AS `mime`,`f`.`name` AS `mediaName`,`f`.`url` AS `url`,`fp`.`url` AS `previewFileUrl`,`fs`.`size` AS `size`,`fs`.`data_width` AS `width`,`fs`.`data_height` AS `height`,`fs`.`data_ratio` AS `ratio`,`fs`.`systemType` AS `systemType`,`f`.`status` AS `status`,`f`.`userID` AS `userID`,`f`.`createDate` AS `createDate`,`f`.`modifyDate` AS `modifyDate`,'file' AS `mainMediaType` from ((`cms__file` `f` join `cms__file_static` `fs` on(((`fs`.`fileID` = `f`.`fileID`) and (`fs`.`type` <> 'preview') and (`f`.`fileID` in (select `smd__organization_has_media`.`mediaID` from `smd__organization_has_media` where `smd__organization_has_media`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 13))) or (`fs`.`systemType` in ('generic','branded')))))) left join `cms__file` `fp` on((`fp`.`fileID` = `fs`.`previewFileID`)))) union (select `c`.`carouselID` AS `mediaID`,'carousel' AS `mediaType`,`c`.`socialChannel` AS `socialChannel`,'carousel' AS `mime`,`c`.`name` AS `mediaName`,`c`.`url` AS `url`,NULL AS `previewFileUrl`,NULL AS `size`,NULL AS `width`,NULL AS `height`,NULL AS `ratio`,`c`.`systemType` AS `systemType`,`c`.`status` AS `status`,`c`.`userID` AS `userID`,`c`.`createDate` AS `createDate`,`c`.`modifyDate` AS `modifyDate`,'carousel' AS `mainMediaType` from `smd__carousel` `c`) ;

-- --------------------------------------------------------

--
-- Structure for view `view__all_media_14`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__all_media_14`  AS  (select `f`.`fileID` AS `mediaID`,`fs`.`type` AS `mediaType`,`fs`.`socialChannel` AS `socialChannel`,`fs`.`mime` AS `mime`,`f`.`name` AS `mediaName`,`f`.`url` AS `url`,`fp`.`url` AS `previewFileUrl`,`fs`.`size` AS `size`,`fs`.`data_width` AS `width`,`fs`.`data_height` AS `height`,`fs`.`data_ratio` AS `ratio`,`fs`.`systemType` AS `systemType`,`f`.`status` AS `status`,`f`.`userID` AS `userID`,`f`.`createDate` AS `createDate`,`f`.`modifyDate` AS `modifyDate`,'file' AS `mainMediaType` from ((`cms__file` `f` join `cms__file_static` `fs` on(((`fs`.`fileID` = `f`.`fileID`) and (`fs`.`type` <> 'preview') and (`f`.`fileID` in (select `smd__organization_has_media`.`mediaID` from `smd__organization_has_media` where `smd__organization_has_media`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 14))) or (`fs`.`systemType` in ('generic','branded')))))) left join `cms__file` `fp` on((`fp`.`fileID` = `fs`.`previewFileID`)))) union (select `c`.`carouselID` AS `mediaID`,'carousel' AS `mediaType`,`c`.`socialChannel` AS `socialChannel`,'carousel' AS `mime`,`c`.`name` AS `mediaName`,`c`.`url` AS `url`,NULL AS `previewFileUrl`,NULL AS `size`,NULL AS `width`,NULL AS `height`,NULL AS `ratio`,`c`.`systemType` AS `systemType`,`c`.`status` AS `status`,`c`.`userID` AS `userID`,`c`.`createDate` AS `createDate`,`c`.`modifyDate` AS `modifyDate`,'carousel' AS `mainMediaType` from `smd__carousel` `c`) ;

-- --------------------------------------------------------

--
-- Structure for view `view__all_media_15`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__all_media_15`  AS  (select `f`.`fileID` AS `mediaID`,`fs`.`type` AS `mediaType`,`fs`.`socialChannel` AS `socialChannel`,`fs`.`mime` AS `mime`,`f`.`name` AS `mediaName`,`f`.`url` AS `url`,`fp`.`url` AS `previewFileUrl`,`fs`.`size` AS `size`,`fs`.`data_width` AS `width`,`fs`.`data_height` AS `height`,`fs`.`data_ratio` AS `ratio`,`fs`.`systemType` AS `systemType`,`f`.`status` AS `status`,`f`.`userID` AS `userID`,`f`.`createDate` AS `createDate`,`f`.`modifyDate` AS `modifyDate`,'file' AS `mainMediaType` from ((`cms__file` `f` join `cms__file_static` `fs` on(((`fs`.`fileID` = `f`.`fileID`) and (`fs`.`type` <> 'preview') and (`f`.`fileID` in (select `smd__organization_has_media`.`mediaID` from `smd__organization_has_media` where `smd__organization_has_media`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 15))) or (`fs`.`systemType` in ('generic','branded')))))) left join `cms__file` `fp` on((`fp`.`fileID` = `fs`.`previewFileID`)))) union (select `c`.`carouselID` AS `mediaID`,'carousel' AS `mediaType`,`c`.`socialChannel` AS `socialChannel`,'carousel' AS `mime`,`c`.`name` AS `mediaName`,`c`.`url` AS `url`,NULL AS `previewFileUrl`,NULL AS `size`,NULL AS `width`,NULL AS `height`,NULL AS `ratio`,`c`.`systemType` AS `systemType`,`c`.`status` AS `status`,`c`.`userID` AS `userID`,`c`.`createDate` AS `createDate`,`c`.`modifyDate` AS `modifyDate`,'carousel' AS `mainMediaType` from `smd__carousel` `c`) ;

-- --------------------------------------------------------

--
-- Structure for view `view__all_media_16`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__all_media_16`  AS  (select `f`.`fileID` AS `mediaID`,`fs`.`type` AS `mediaType`,`fs`.`socialChannel` AS `socialChannel`,`fs`.`mime` AS `mime`,`f`.`name` AS `mediaName`,`f`.`url` AS `url`,`fp`.`url` AS `previewFileUrl`,`fs`.`size` AS `size`,`fs`.`data_width` AS `width`,`fs`.`data_height` AS `height`,`fs`.`data_ratio` AS `ratio`,`fs`.`systemType` AS `systemType`,`f`.`status` AS `status`,`f`.`userID` AS `userID`,`f`.`createDate` AS `createDate`,`f`.`modifyDate` AS `modifyDate`,'file' AS `mainMediaType` from ((`cms__file` `f` join `cms__file_static` `fs` on(((`fs`.`fileID` = `f`.`fileID`) and (`fs`.`type` <> 'preview') and (`f`.`fileID` in (select `smd__organization_has_media`.`mediaID` from `smd__organization_has_media` where `smd__organization_has_media`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 16))) or (`fs`.`systemType` in ('generic','branded')))))) left join `cms__file` `fp` on((`fp`.`fileID` = `fs`.`previewFileID`)))) union (select `c`.`carouselID` AS `mediaID`,'carousel' AS `mediaType`,`c`.`socialChannel` AS `socialChannel`,'carousel' AS `mime`,`c`.`name` AS `mediaName`,`c`.`url` AS `url`,NULL AS `previewFileUrl`,NULL AS `size`,NULL AS `width`,NULL AS `height`,NULL AS `ratio`,`c`.`systemType` AS `systemType`,`c`.`status` AS `status`,`c`.`userID` AS `userID`,`c`.`createDate` AS `createDate`,`c`.`modifyDate` AS `modifyDate`,'carousel' AS `mainMediaType` from `smd__carousel` `c`) ;

-- --------------------------------------------------------

--
-- Structure for view `view__all_media_17`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__all_media_17`  AS  (select `f`.`fileID` AS `mediaID`,`fs`.`type` AS `mediaType`,`fs`.`socialChannel` AS `socialChannel`,`fs`.`mime` AS `mime`,`f`.`name` AS `mediaName`,`f`.`url` AS `url`,`fp`.`url` AS `previewFileUrl`,`fs`.`size` AS `size`,`fs`.`data_width` AS `width`,`fs`.`data_height` AS `height`,`fs`.`data_ratio` AS `ratio`,`fs`.`systemType` AS `systemType`,`f`.`status` AS `status`,`f`.`userID` AS `userID`,`f`.`createDate` AS `createDate`,`f`.`modifyDate` AS `modifyDate`,'file' AS `mainMediaType` from ((`cms__file` `f` join `cms__file_static` `fs` on(((`fs`.`fileID` = `f`.`fileID`) and (`fs`.`type` <> 'preview') and (`f`.`fileID` in (select `smd__organization_has_media`.`mediaID` from `smd__organization_has_media` where `smd__organization_has_media`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 17))) or (`fs`.`systemType` in ('generic','branded')))))) left join `cms__file` `fp` on((`fp`.`fileID` = `fs`.`previewFileID`)))) union (select `c`.`carouselID` AS `mediaID`,'carousel' AS `mediaType`,`c`.`socialChannel` AS `socialChannel`,'carousel' AS `mime`,`c`.`name` AS `mediaName`,`c`.`url` AS `url`,NULL AS `previewFileUrl`,NULL AS `size`,NULL AS `width`,NULL AS `height`,NULL AS `ratio`,`c`.`systemType` AS `systemType`,`c`.`status` AS `status`,`c`.`userID` AS `userID`,`c`.`createDate` AS `createDate`,`c`.`modifyDate` AS `modifyDate`,'carousel' AS `mainMediaType` from `smd__carousel` `c`) ;

-- --------------------------------------------------------

--
-- Structure for view `view__all_media_18`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__all_media_18`  AS  (select `f`.`fileID` AS `mediaID`,`fs`.`type` AS `mediaType`,`fs`.`socialChannel` AS `socialChannel`,`fs`.`mime` AS `mime`,`f`.`name` AS `mediaName`,`f`.`url` AS `url`,`fp`.`url` AS `previewFileUrl`,`fs`.`size` AS `size`,`fs`.`data_width` AS `width`,`fs`.`data_height` AS `height`,`fs`.`data_ratio` AS `ratio`,`fs`.`systemType` AS `systemType`,`f`.`status` AS `status`,`f`.`userID` AS `userID`,`f`.`createDate` AS `createDate`,`f`.`modifyDate` AS `modifyDate`,'file' AS `mainMediaType` from ((`cms__file` `f` join `cms__file_static` `fs` on(((`fs`.`fileID` = `f`.`fileID`) and (`fs`.`type` <> 'preview') and (`f`.`fileID` in (select `smd__organization_has_media`.`mediaID` from `smd__organization_has_media` where `smd__organization_has_media`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 18))) or (`fs`.`systemType` in ('generic','branded')))))) left join `cms__file` `fp` on((`fp`.`fileID` = `fs`.`previewFileID`)))) union (select `c`.`carouselID` AS `mediaID`,'carousel' AS `mediaType`,`c`.`socialChannel` AS `socialChannel`,'carousel' AS `mime`,`c`.`name` AS `mediaName`,`c`.`url` AS `url`,NULL AS `previewFileUrl`,NULL AS `size`,NULL AS `width`,NULL AS `height`,NULL AS `ratio`,`c`.`systemType` AS `systemType`,`c`.`status` AS `status`,`c`.`userID` AS `userID`,`c`.`createDate` AS `createDate`,`c`.`modifyDate` AS `modifyDate`,'carousel' AS `mainMediaType` from `smd__carousel` `c`) ;

-- --------------------------------------------------------

--
-- Structure for view `view__all_media_19`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__all_media_19`  AS  (select `f`.`fileID` AS `mediaID`,`fs`.`type` AS `mediaType`,`fs`.`socialChannel` AS `socialChannel`,`fs`.`mime` AS `mime`,`f`.`name` AS `mediaName`,`f`.`url` AS `url`,`fp`.`url` AS `previewFileUrl`,`fs`.`size` AS `size`,`fs`.`data_width` AS `width`,`fs`.`data_height` AS `height`,`fs`.`data_ratio` AS `ratio`,`fs`.`systemType` AS `systemType`,`f`.`status` AS `status`,`f`.`userID` AS `userID`,`f`.`createDate` AS `createDate`,`f`.`modifyDate` AS `modifyDate`,'file' AS `mainMediaType` from ((`cms__file` `f` join `cms__file_static` `fs` on(((`fs`.`fileID` = `f`.`fileID`) and (`fs`.`type` <> 'preview') and (`f`.`fileID` in (select `smd__organization_has_media`.`mediaID` from `smd__organization_has_media` where `smd__organization_has_media`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 19))) or (`fs`.`systemType` in ('generic','branded')))))) left join `cms__file` `fp` on((`fp`.`fileID` = `fs`.`previewFileID`)))) union (select `c`.`carouselID` AS `mediaID`,'carousel' AS `mediaType`,`c`.`socialChannel` AS `socialChannel`,'carousel' AS `mime`,`c`.`name` AS `mediaName`,`c`.`url` AS `url`,NULL AS `previewFileUrl`,NULL AS `size`,NULL AS `width`,NULL AS `height`,NULL AS `ratio`,`c`.`systemType` AS `systemType`,`c`.`status` AS `status`,`c`.`userID` AS `userID`,`c`.`createDate` AS `createDate`,`c`.`modifyDate` AS `modifyDate`,'carousel' AS `mainMediaType` from `smd__carousel` `c`) ;

-- --------------------------------------------------------

--
-- Structure for view `view__all_media_20`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__all_media_20`  AS  (select `f`.`fileID` AS `mediaID`,`fs`.`type` AS `mediaType`,`fs`.`socialChannel` AS `socialChannel`,`fs`.`mime` AS `mime`,`f`.`name` AS `mediaName`,`f`.`url` AS `url`,`fp`.`url` AS `previewFileUrl`,`fs`.`size` AS `size`,`fs`.`data_width` AS `width`,`fs`.`data_height` AS `height`,`fs`.`data_ratio` AS `ratio`,`fs`.`systemType` AS `systemType`,`f`.`status` AS `status`,`f`.`userID` AS `userID`,`f`.`createDate` AS `createDate`,`f`.`modifyDate` AS `modifyDate`,'file' AS `mainMediaType` from ((`cms__file` `f` join `cms__file_static` `fs` on(((`fs`.`fileID` = `f`.`fileID`) and (`fs`.`type` <> 'preview') and (`f`.`fileID` in (select `smd__organization_has_media`.`mediaID` from `smd__organization_has_media` where `smd__organization_has_media`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 20))) or (`fs`.`systemType` in ('generic','branded')))))) left join `cms__file` `fp` on((`fp`.`fileID` = `fs`.`previewFileID`)))) union (select `c`.`carouselID` AS `mediaID`,'carousel' AS `mediaType`,`c`.`socialChannel` AS `socialChannel`,'carousel' AS `mime`,`c`.`name` AS `mediaName`,`c`.`url` AS `url`,NULL AS `previewFileUrl`,NULL AS `size`,NULL AS `width`,NULL AS `height`,NULL AS `ratio`,`c`.`systemType` AS `systemType`,`c`.`status` AS `status`,`c`.`userID` AS `userID`,`c`.`createDate` AS `createDate`,`c`.`modifyDate` AS `modifyDate`,'carousel' AS `mainMediaType` from `smd__carousel` `c`) ;

-- --------------------------------------------------------

--
-- Structure for view `view__all_media_21`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__all_media_21`  AS  (select `f`.`fileID` AS `mediaID`,`fs`.`type` AS `mediaType`,`fs`.`socialChannel` AS `socialChannel`,`fs`.`mime` AS `mime`,`f`.`name` AS `mediaName`,`f`.`url` AS `url`,`fp`.`url` AS `previewFileUrl`,`fs`.`size` AS `size`,`fs`.`data_width` AS `width`,`fs`.`data_height` AS `height`,`fs`.`data_ratio` AS `ratio`,`fs`.`systemType` AS `systemType`,`f`.`status` AS `status`,`f`.`userID` AS `userID`,`f`.`createDate` AS `createDate`,`f`.`modifyDate` AS `modifyDate`,'file' AS `mainMediaType` from ((`cms__file` `f` join `cms__file_static` `fs` on(((`fs`.`fileID` = `f`.`fileID`) and (`fs`.`type` <> 'preview') and (`f`.`fileID` in (select `smd__organization_has_media`.`mediaID` from `smd__organization_has_media` where `smd__organization_has_media`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 21))) or (`fs`.`systemType` in ('generic','branded')))))) left join `cms__file` `fp` on((`fp`.`fileID` = `fs`.`previewFileID`)))) union (select `c`.`carouselID` AS `mediaID`,'carousel' AS `mediaType`,`c`.`socialChannel` AS `socialChannel`,'carousel' AS `mime`,`c`.`name` AS `mediaName`,`c`.`url` AS `url`,NULL AS `previewFileUrl`,NULL AS `size`,NULL AS `width`,NULL AS `height`,NULL AS `ratio`,`c`.`systemType` AS `systemType`,`c`.`status` AS `status`,`c`.`userID` AS `userID`,`c`.`createDate` AS `createDate`,`c`.`modifyDate` AS `modifyDate`,'carousel' AS `mainMediaType` from `smd__carousel` `c`) ;

-- --------------------------------------------------------

--
-- Structure for view `view__all_media_22`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__all_media_22`  AS  (select `f`.`fileID` AS `mediaID`,`fs`.`type` AS `mediaType`,`fs`.`socialChannel` AS `socialChannel`,`fs`.`mime` AS `mime`,`f`.`name` AS `mediaName`,`f`.`url` AS `url`,`fp`.`url` AS `previewFileUrl`,`fs`.`size` AS `size`,`fs`.`data_width` AS `width`,`fs`.`data_height` AS `height`,`fs`.`data_ratio` AS `ratio`,`fs`.`systemType` AS `systemType`,`f`.`status` AS `status`,`f`.`userID` AS `userID`,`f`.`createDate` AS `createDate`,`f`.`modifyDate` AS `modifyDate`,'file' AS `mainMediaType` from ((`cms__file` `f` join `cms__file_static` `fs` on(((`fs`.`fileID` = `f`.`fileID`) and (`fs`.`type` <> 'preview') and (`f`.`fileID` in (select `smd__organization_has_media`.`mediaID` from `smd__organization_has_media` where `smd__organization_has_media`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 22))) or (`fs`.`systemType` in ('generic','branded')))))) left join `cms__file` `fp` on((`fp`.`fileID` = `fs`.`previewFileID`)))) union (select `c`.`carouselID` AS `mediaID`,'carousel' AS `mediaType`,`c`.`socialChannel` AS `socialChannel`,'carousel' AS `mime`,`c`.`name` AS `mediaName`,`c`.`url` AS `url`,NULL AS `previewFileUrl`,NULL AS `size`,NULL AS `width`,NULL AS `height`,NULL AS `ratio`,`c`.`systemType` AS `systemType`,`c`.`status` AS `status`,`c`.`userID` AS `userID`,`c`.`createDate` AS `createDate`,`c`.`modifyDate` AS `modifyDate`,'carousel' AS `mainMediaType` from `smd__carousel` `c`) ;

-- --------------------------------------------------------

--
-- Structure for view `view__all_media_23`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__all_media_23`  AS  (select `f`.`fileID` AS `mediaID`,`fs`.`type` AS `mediaType`,`fs`.`socialChannel` AS `socialChannel`,`fs`.`mime` AS `mime`,`f`.`name` AS `mediaName`,`f`.`url` AS `url`,`fp`.`url` AS `previewFileUrl`,`fs`.`size` AS `size`,`fs`.`data_width` AS `width`,`fs`.`data_height` AS `height`,`fs`.`data_ratio` AS `ratio`,`fs`.`systemType` AS `systemType`,`f`.`status` AS `status`,`f`.`userID` AS `userID`,`f`.`createDate` AS `createDate`,`f`.`modifyDate` AS `modifyDate`,'file' AS `mainMediaType` from ((`cms__file` `f` join `cms__file_static` `fs` on(((`fs`.`fileID` = `f`.`fileID`) and (`fs`.`type` <> 'preview') and (`f`.`fileID` in (select `smd__organization_has_media`.`mediaID` from `smd__organization_has_media` where `smd__organization_has_media`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 23))) or (`fs`.`systemType` in ('generic','branded')))))) left join `cms__file` `fp` on((`fp`.`fileID` = `fs`.`previewFileID`)))) union (select `c`.`carouselID` AS `mediaID`,'carousel' AS `mediaType`,`c`.`socialChannel` AS `socialChannel`,'carousel' AS `mime`,`c`.`name` AS `mediaName`,`c`.`url` AS `url`,NULL AS `previewFileUrl`,NULL AS `size`,NULL AS `width`,NULL AS `height`,NULL AS `ratio`,`c`.`systemType` AS `systemType`,`c`.`status` AS `status`,`c`.`userID` AS `userID`,`c`.`createDate` AS `createDate`,`c`.`modifyDate` AS `modifyDate`,'carousel' AS `mainMediaType` from `smd__carousel` `c`) ;

-- --------------------------------------------------------

--
-- Structure for view `view__all_media_24`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__all_media_24`  AS  (select `f`.`fileID` AS `mediaID`,`fs`.`type` AS `mediaType`,`fs`.`socialChannel` AS `socialChannel`,`fs`.`mime` AS `mime`,`f`.`name` AS `mediaName`,`f`.`url` AS `url`,`fp`.`url` AS `previewFileUrl`,`fs`.`size` AS `size`,`fs`.`data_width` AS `width`,`fs`.`data_height` AS `height`,`fs`.`data_ratio` AS `ratio`,`fs`.`systemType` AS `systemType`,`f`.`status` AS `status`,`f`.`userID` AS `userID`,`f`.`createDate` AS `createDate`,`f`.`modifyDate` AS `modifyDate`,'file' AS `mainMediaType` from ((`cms__file` `f` join `cms__file_static` `fs` on(((`fs`.`fileID` = `f`.`fileID`) and (`fs`.`type` <> 'preview') and (`f`.`fileID` in (select `smd__organization_has_media`.`mediaID` from `smd__organization_has_media` where `smd__organization_has_media`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 24))) or (`fs`.`systemType` in ('generic','branded')))))) left join `cms__file` `fp` on((`fp`.`fileID` = `fs`.`previewFileID`)))) union (select `c`.`carouselID` AS `mediaID`,'carousel' AS `mediaType`,`c`.`socialChannel` AS `socialChannel`,'carousel' AS `mime`,`c`.`name` AS `mediaName`,`c`.`url` AS `url`,NULL AS `previewFileUrl`,NULL AS `size`,NULL AS `width`,NULL AS `height`,NULL AS `ratio`,`c`.`systemType` AS `systemType`,`c`.`status` AS `status`,`c`.`userID` AS `userID`,`c`.`createDate` AS `createDate`,`c`.`modifyDate` AS `modifyDate`,'carousel' AS `mainMediaType` from `smd__carousel` `c`) ;

-- --------------------------------------------------------

--
-- Structure for view `view__all_media_25`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__all_media_25`  AS  (select `f`.`fileID` AS `mediaID`,`fs`.`type` AS `mediaType`,`fs`.`socialChannel` AS `socialChannel`,`fs`.`mime` AS `mime`,`f`.`name` AS `mediaName`,`f`.`url` AS `url`,`fp`.`url` AS `previewFileUrl`,`fs`.`size` AS `size`,`fs`.`data_width` AS `width`,`fs`.`data_height` AS `height`,`fs`.`data_ratio` AS `ratio`,`fs`.`systemType` AS `systemType`,`f`.`status` AS `status`,`f`.`userID` AS `userID`,`f`.`createDate` AS `createDate`,`f`.`modifyDate` AS `modifyDate`,'file' AS `mainMediaType` from ((`cms__file` `f` join `cms__file_static` `fs` on(((`fs`.`fileID` = `f`.`fileID`) and (`fs`.`type` <> 'preview') and (`f`.`fileID` in (select `smd__organization_has_media`.`mediaID` from `smd__organization_has_media` where `smd__organization_has_media`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 25))) or (`fs`.`systemType` in ('generic','branded')))))) left join `cms__file` `fp` on((`fp`.`fileID` = `fs`.`previewFileID`)))) union (select `c`.`carouselID` AS `mediaID`,'carousel' AS `mediaType`,`c`.`socialChannel` AS `socialChannel`,'carousel' AS `mime`,`c`.`name` AS `mediaName`,`c`.`url` AS `url`,NULL AS `previewFileUrl`,NULL AS `size`,NULL AS `width`,NULL AS `height`,NULL AS `ratio`,`c`.`systemType` AS `systemType`,`c`.`status` AS `status`,`c`.`userID` AS `userID`,`c`.`createDate` AS `createDate`,`c`.`modifyDate` AS `modifyDate`,'carousel' AS `mainMediaType` from `smd__carousel` `c`) ;

-- --------------------------------------------------------

--
-- Structure for view `view__all_media_26`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__all_media_26`  AS  (select `f`.`fileID` AS `mediaID`,`fs`.`type` AS `mediaType`,`fs`.`socialChannel` AS `socialChannel`,`fs`.`mime` AS `mime`,`f`.`name` AS `mediaName`,`f`.`url` AS `url`,`fp`.`url` AS `previewFileUrl`,`fs`.`size` AS `size`,`fs`.`data_width` AS `width`,`fs`.`data_height` AS `height`,`fs`.`data_ratio` AS `ratio`,`fs`.`systemType` AS `systemType`,`f`.`status` AS `status`,`f`.`userID` AS `userID`,`f`.`createDate` AS `createDate`,`f`.`modifyDate` AS `modifyDate`,'file' AS `mainMediaType` from ((`cms__file` `f` join `cms__file_static` `fs` on(((`fs`.`fileID` = `f`.`fileID`) and (`fs`.`type` <> 'preview') and (`f`.`fileID` in (select `smd__organization_has_media`.`mediaID` from `smd__organization_has_media` where `smd__organization_has_media`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 26))) or (`fs`.`systemType` in ('generic','branded')))))) left join `cms__file` `fp` on((`fp`.`fileID` = `fs`.`previewFileID`)))) union (select `c`.`carouselID` AS `mediaID`,'carousel' AS `mediaType`,`c`.`socialChannel` AS `socialChannel`,'carousel' AS `mime`,`c`.`name` AS `mediaName`,`c`.`url` AS `url`,NULL AS `previewFileUrl`,NULL AS `size`,NULL AS `width`,NULL AS `height`,NULL AS `ratio`,`c`.`systemType` AS `systemType`,`c`.`status` AS `status`,`c`.`userID` AS `userID`,`c`.`createDate` AS `createDate`,`c`.`modifyDate` AS `modifyDate`,'carousel' AS `mainMediaType` from `smd__carousel` `c`) ;

-- --------------------------------------------------------

--
-- Structure for view `view__all_media_27`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__all_media_27`  AS  (select `f`.`fileID` AS `mediaID`,`fs`.`type` AS `mediaType`,`fs`.`socialChannel` AS `socialChannel`,`fs`.`mime` AS `mime`,`f`.`name` AS `mediaName`,`f`.`url` AS `url`,`fp`.`url` AS `previewFileUrl`,`fs`.`size` AS `size`,`fs`.`data_width` AS `width`,`fs`.`data_height` AS `height`,`fs`.`data_ratio` AS `ratio`,`fs`.`systemType` AS `systemType`,`f`.`status` AS `status`,`f`.`userID` AS `userID`,`f`.`createDate` AS `createDate`,`f`.`modifyDate` AS `modifyDate`,'file' AS `mainMediaType` from ((`cms__file` `f` join `cms__file_static` `fs` on(((`fs`.`fileID` = `f`.`fileID`) and (`fs`.`type` <> 'preview') and (`f`.`fileID` in (select `smd__organization_has_media`.`mediaID` from `smd__organization_has_media` where `smd__organization_has_media`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 27))) or (`fs`.`systemType` in ('generic','branded')))))) left join `cms__file` `fp` on((`fp`.`fileID` = `fs`.`previewFileID`)))) union (select `c`.`carouselID` AS `mediaID`,'carousel' AS `mediaType`,`c`.`socialChannel` AS `socialChannel`,'carousel' AS `mime`,`c`.`name` AS `mediaName`,`c`.`url` AS `url`,NULL AS `previewFileUrl`,NULL AS `size`,NULL AS `width`,NULL AS `height`,NULL AS `ratio`,`c`.`systemType` AS `systemType`,`c`.`status` AS `status`,`c`.`userID` AS `userID`,`c`.`createDate` AS `createDate`,`c`.`modifyDate` AS `modifyDate`,'carousel' AS `mainMediaType` from `smd__carousel` `c`) ;

-- --------------------------------------------------------

--
-- Structure for view `view__all_media_28`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__all_media_28`  AS  (select `f`.`fileID` AS `mediaID`,`fs`.`type` AS `mediaType`,`fs`.`socialChannel` AS `socialChannel`,`fs`.`mime` AS `mime`,`f`.`name` AS `mediaName`,`f`.`url` AS `url`,`fp`.`url` AS `previewFileUrl`,`fs`.`size` AS `size`,`fs`.`data_width` AS `width`,`fs`.`data_height` AS `height`,`fs`.`data_ratio` AS `ratio`,`fs`.`systemType` AS `systemType`,`f`.`status` AS `status`,`f`.`userID` AS `userID`,`f`.`createDate` AS `createDate`,`f`.`modifyDate` AS `modifyDate`,'file' AS `mainMediaType` from ((`cms__file` `f` join `cms__file_static` `fs` on(((`fs`.`fileID` = `f`.`fileID`) and (`fs`.`type` <> 'preview') and (`f`.`fileID` in (select `smd__organization_has_media`.`mediaID` from `smd__organization_has_media` where `smd__organization_has_media`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 28))) or (`fs`.`systemType` in ('generic','branded')))))) left join `cms__file` `fp` on((`fp`.`fileID` = `fs`.`previewFileID`)))) union (select `c`.`carouselID` AS `mediaID`,'carousel' AS `mediaType`,`c`.`socialChannel` AS `socialChannel`,'carousel' AS `mime`,`c`.`name` AS `mediaName`,`c`.`url` AS `url`,NULL AS `previewFileUrl`,NULL AS `size`,NULL AS `width`,NULL AS `height`,NULL AS `ratio`,`c`.`systemType` AS `systemType`,`c`.`status` AS `status`,`c`.`userID` AS `userID`,`c`.`createDate` AS `createDate`,`c`.`modifyDate` AS `modifyDate`,'carousel' AS `mainMediaType` from `smd__carousel` `c`) ;

-- --------------------------------------------------------

--
-- Structure for view `view__all_media_29`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__all_media_29`  AS  (select `f`.`fileID` AS `mediaID`,`fs`.`type` AS `mediaType`,`fs`.`socialChannel` AS `socialChannel`,`fs`.`mime` AS `mime`,`f`.`name` AS `mediaName`,`f`.`url` AS `url`,`fp`.`url` AS `previewFileUrl`,`fs`.`size` AS `size`,`fs`.`data_width` AS `width`,`fs`.`data_height` AS `height`,`fs`.`data_ratio` AS `ratio`,`fs`.`systemType` AS `systemType`,`f`.`status` AS `status`,`f`.`userID` AS `userID`,`f`.`createDate` AS `createDate`,`f`.`modifyDate` AS `modifyDate`,'file' AS `mainMediaType` from ((`cms__file` `f` join `cms__file_static` `fs` on(((`fs`.`fileID` = `f`.`fileID`) and (`fs`.`type` <> 'preview') and (`f`.`fileID` in (select `smd__organization_has_media`.`mediaID` from `smd__organization_has_media` where `smd__organization_has_media`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 29))) or (`fs`.`systemType` in ('generic','branded')))))) left join `cms__file` `fp` on((`fp`.`fileID` = `fs`.`previewFileID`)))) union (select `c`.`carouselID` AS `mediaID`,'carousel' AS `mediaType`,`c`.`socialChannel` AS `socialChannel`,'carousel' AS `mime`,`c`.`name` AS `mediaName`,`c`.`url` AS `url`,NULL AS `previewFileUrl`,NULL AS `size`,NULL AS `width`,NULL AS `height`,NULL AS `ratio`,`c`.`systemType` AS `systemType`,`c`.`status` AS `status`,`c`.`userID` AS `userID`,`c`.`createDate` AS `createDate`,`c`.`modifyDate` AS `modifyDate`,'carousel' AS `mainMediaType` from `smd__carousel` `c`) ;

-- --------------------------------------------------------

--
-- Structure for view `view__all_media_30`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__all_media_30`  AS  (select `f`.`fileID` AS `mediaID`,`fs`.`type` AS `mediaType`,`fs`.`socialChannel` AS `socialChannel`,`fs`.`mime` AS `mime`,`f`.`name` AS `mediaName`,`f`.`url` AS `url`,`fp`.`url` AS `previewFileUrl`,`fs`.`size` AS `size`,`fs`.`data_width` AS `width`,`fs`.`data_height` AS `height`,`fs`.`data_ratio` AS `ratio`,`fs`.`systemType` AS `systemType`,`f`.`status` AS `status`,`f`.`userID` AS `userID`,`f`.`createDate` AS `createDate`,`f`.`modifyDate` AS `modifyDate`,'file' AS `mainMediaType` from ((`cms__file` `f` join `cms__file_static` `fs` on(((`fs`.`fileID` = `f`.`fileID`) and (`fs`.`type` <> 'preview') and (`f`.`fileID` in (select `smd__organization_has_media`.`mediaID` from `smd__organization_has_media` where `smd__organization_has_media`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 30))) or (`fs`.`systemType` in ('generic','branded')))))) left join `cms__file` `fp` on((`fp`.`fileID` = `fs`.`previewFileID`)))) union (select `c`.`carouselID` AS `mediaID`,'carousel' AS `mediaType`,`c`.`socialChannel` AS `socialChannel`,'carousel' AS `mime`,`c`.`name` AS `mediaName`,`c`.`url` AS `url`,NULL AS `previewFileUrl`,NULL AS `size`,NULL AS `width`,NULL AS `height`,NULL AS `ratio`,`c`.`systemType` AS `systemType`,`c`.`status` AS `status`,`c`.`userID` AS `userID`,`c`.`createDate` AS `createDate`,`c`.`modifyDate` AS `modifyDate`,'carousel' AS `mainMediaType` from `smd__carousel` `c`) ;

-- --------------------------------------------------------

--
-- Structure for view `view__all_media_31`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__all_media_31`  AS  (select `f`.`fileID` AS `mediaID`,`fs`.`type` AS `mediaType`,`fs`.`socialChannel` AS `socialChannel`,`fs`.`mime` AS `mime`,`f`.`name` AS `mediaName`,`f`.`url` AS `url`,`fp`.`url` AS `previewFileUrl`,`fs`.`size` AS `size`,`fs`.`data_width` AS `width`,`fs`.`data_height` AS `height`,`fs`.`data_ratio` AS `ratio`,`fs`.`systemType` AS `systemType`,`f`.`status` AS `status`,`f`.`userID` AS `userID`,`f`.`createDate` AS `createDate`,`f`.`modifyDate` AS `modifyDate`,'file' AS `mainMediaType` from ((`cms__file` `f` join `cms__file_static` `fs` on(((`fs`.`fileID` = `f`.`fileID`) and (`fs`.`type` <> 'preview') and (`f`.`fileID` in (select `smd__organization_has_media`.`mediaID` from `smd__organization_has_media` where `smd__organization_has_media`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 31))) or (`fs`.`systemType` in ('generic','branded')))))) left join `cms__file` `fp` on((`fp`.`fileID` = `fs`.`previewFileID`)))) union (select `c`.`carouselID` AS `mediaID`,'carousel' AS `mediaType`,`c`.`socialChannel` AS `socialChannel`,'carousel' AS `mime`,`c`.`name` AS `mediaName`,`c`.`url` AS `url`,NULL AS `previewFileUrl`,NULL AS `size`,NULL AS `width`,NULL AS `height`,NULL AS `ratio`,`c`.`systemType` AS `systemType`,`c`.`status` AS `status`,`c`.`userID` AS `userID`,`c`.`createDate` AS `createDate`,`c`.`modifyDate` AS `modifyDate`,'carousel' AS `mainMediaType` from `smd__carousel` `c`) ;

-- --------------------------------------------------------

--
-- Structure for view `view__all_media_32`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__all_media_32`  AS  (select `f`.`fileID` AS `mediaID`,`fs`.`type` AS `mediaType`,`fs`.`socialChannel` AS `socialChannel`,`fs`.`mime` AS `mime`,`f`.`name` AS `mediaName`,`f`.`url` AS `url`,`fp`.`url` AS `previewFileUrl`,`fs`.`size` AS `size`,`fs`.`data_width` AS `width`,`fs`.`data_height` AS `height`,`fs`.`data_ratio` AS `ratio`,`fs`.`systemType` AS `systemType`,`f`.`status` AS `status`,`f`.`userID` AS `userID`,`f`.`createDate` AS `createDate`,`f`.`modifyDate` AS `modifyDate`,'file' AS `mainMediaType` from ((`cms__file` `f` join `cms__file_static` `fs` on(((`fs`.`fileID` = `f`.`fileID`) and (`fs`.`type` <> 'preview') and (`f`.`fileID` in (select `smd__organization_has_media`.`mediaID` from `smd__organization_has_media` where `smd__organization_has_media`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 32))) or (`fs`.`systemType` in ('generic','branded')))))) left join `cms__file` `fp` on((`fp`.`fileID` = `fs`.`previewFileID`)))) union (select `c`.`carouselID` AS `mediaID`,'carousel' AS `mediaType`,`c`.`socialChannel` AS `socialChannel`,'carousel' AS `mime`,`c`.`name` AS `mediaName`,`c`.`url` AS `url`,NULL AS `previewFileUrl`,NULL AS `size`,NULL AS `width`,NULL AS `height`,NULL AS `ratio`,`c`.`systemType` AS `systemType`,`c`.`status` AS `status`,`c`.`userID` AS `userID`,`c`.`createDate` AS `createDate`,`c`.`modifyDate` AS `modifyDate`,'carousel' AS `mainMediaType` from `smd__carousel` `c`) ;

-- --------------------------------------------------------

--
-- Structure for view `view__all_media_33`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__all_media_33`  AS  (select `f`.`fileID` AS `mediaID`,`fs`.`type` AS `mediaType`,`fs`.`socialChannel` AS `socialChannel`,`fs`.`mime` AS `mime`,`f`.`name` AS `mediaName`,`f`.`url` AS `url`,`fp`.`url` AS `previewFileUrl`,`fs`.`size` AS `size`,`fs`.`data_width` AS `width`,`fs`.`data_height` AS `height`,`fs`.`data_ratio` AS `ratio`,`fs`.`systemType` AS `systemType`,`f`.`status` AS `status`,`f`.`userID` AS `userID`,`f`.`createDate` AS `createDate`,`f`.`modifyDate` AS `modifyDate`,'file' AS `mainMediaType` from ((`cms__file` `f` join `cms__file_static` `fs` on(((`fs`.`fileID` = `f`.`fileID`) and (`fs`.`type` <> 'preview') and (`f`.`fileID` in (select `smd__organization_has_media`.`mediaID` from `smd__organization_has_media` where `smd__organization_has_media`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 33))) or (`fs`.`systemType` in ('generic','branded')))))) left join `cms__file` `fp` on((`fp`.`fileID` = `fs`.`previewFileID`)))) union (select `c`.`carouselID` AS `mediaID`,'carousel' AS `mediaType`,`c`.`socialChannel` AS `socialChannel`,'carousel' AS `mime`,`c`.`name` AS `mediaName`,`c`.`url` AS `url`,NULL AS `previewFileUrl`,NULL AS `size`,NULL AS `width`,NULL AS `height`,NULL AS `ratio`,`c`.`systemType` AS `systemType`,`c`.`status` AS `status`,`c`.`userID` AS `userID`,`c`.`createDate` AS `createDate`,`c`.`modifyDate` AS `modifyDate`,'carousel' AS `mainMediaType` from `smd__carousel` `c`) ;

-- --------------------------------------------------------

--
-- Structure for view `view__all_media_34`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__all_media_34`  AS  (select `f`.`fileID` AS `mediaID`,`fs`.`type` AS `mediaType`,`fs`.`socialChannel` AS `socialChannel`,`fs`.`mime` AS `mime`,`f`.`name` AS `mediaName`,`f`.`url` AS `url`,`fp`.`url` AS `previewFileUrl`,`fs`.`size` AS `size`,`fs`.`data_width` AS `width`,`fs`.`data_height` AS `height`,`fs`.`data_ratio` AS `ratio`,`fs`.`systemType` AS `systemType`,`f`.`status` AS `status`,`f`.`userID` AS `userID`,`f`.`createDate` AS `createDate`,`f`.`modifyDate` AS `modifyDate`,'file' AS `mainMediaType` from ((`cms__file` `f` join `cms__file_static` `fs` on(((`fs`.`fileID` = `f`.`fileID`) and (`fs`.`type` <> 'preview') and (`f`.`fileID` in (select `smd__organization_has_media`.`mediaID` from `smd__organization_has_media` where `smd__organization_has_media`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 34))) or (`fs`.`systemType` in ('generic','branded')))))) left join `cms__file` `fp` on((`fp`.`fileID` = `fs`.`previewFileID`)))) union (select `c`.`carouselID` AS `mediaID`,'carousel' AS `mediaType`,`c`.`socialChannel` AS `socialChannel`,'carousel' AS `mime`,`c`.`name` AS `mediaName`,`c`.`url` AS `url`,NULL AS `previewFileUrl`,NULL AS `size`,NULL AS `width`,NULL AS `height`,NULL AS `ratio`,`c`.`systemType` AS `systemType`,`c`.`status` AS `status`,`c`.`userID` AS `userID`,`c`.`createDate` AS `createDate`,`c`.`modifyDate` AS `modifyDate`,'carousel' AS `mainMediaType` from `smd__carousel` `c`) ;

-- --------------------------------------------------------

--
-- Structure for view `view__all_media_35`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__all_media_35`  AS  (select `f`.`fileID` AS `mediaID`,`fs`.`type` AS `mediaType`,`fs`.`socialChannel` AS `socialChannel`,`fs`.`mime` AS `mime`,`f`.`name` AS `mediaName`,`f`.`url` AS `url`,`fp`.`url` AS `previewFileUrl`,`fs`.`size` AS `size`,`fs`.`data_width` AS `width`,`fs`.`data_height` AS `height`,`fs`.`data_ratio` AS `ratio`,`fs`.`systemType` AS `systemType`,`f`.`status` AS `status`,`f`.`userID` AS `userID`,`f`.`createDate` AS `createDate`,`f`.`modifyDate` AS `modifyDate`,'file' AS `mainMediaType` from ((`cms__file` `f` join `cms__file_static` `fs` on(((`fs`.`fileID` = `f`.`fileID`) and (`fs`.`type` <> 'preview') and (`f`.`fileID` in (select `smd__organization_has_media`.`mediaID` from `smd__organization_has_media` where `smd__organization_has_media`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 35))) or (`fs`.`systemType` in ('generic','branded')))))) left join `cms__file` `fp` on((`fp`.`fileID` = `fs`.`previewFileID`)))) union (select `c`.`carouselID` AS `mediaID`,'carousel' AS `mediaType`,`c`.`socialChannel` AS `socialChannel`,'carousel' AS `mime`,`c`.`name` AS `mediaName`,`c`.`url` AS `url`,NULL AS `previewFileUrl`,NULL AS `size`,NULL AS `width`,NULL AS `height`,NULL AS `ratio`,`c`.`systemType` AS `systemType`,`c`.`status` AS `status`,`c`.`userID` AS `userID`,`c`.`createDate` AS `createDate`,`c`.`modifyDate` AS `modifyDate`,'carousel' AS `mainMediaType` from `smd__carousel` `c`) ;

-- --------------------------------------------------------

--
-- Structure for view `view__all_media_36`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__all_media_36`  AS  (select `f`.`fileID` AS `mediaID`,`fs`.`type` AS `mediaType`,`fs`.`socialChannel` AS `socialChannel`,`fs`.`mime` AS `mime`,`f`.`name` AS `mediaName`,`f`.`url` AS `url`,`fp`.`url` AS `previewFileUrl`,`fs`.`size` AS `size`,`fs`.`data_width` AS `width`,`fs`.`data_height` AS `height`,`fs`.`data_ratio` AS `ratio`,`fs`.`systemType` AS `systemType`,`f`.`status` AS `status`,`f`.`userID` AS `userID`,`f`.`createDate` AS `createDate`,`f`.`modifyDate` AS `modifyDate`,'file' AS `mainMediaType` from ((`cms__file` `f` join `cms__file_static` `fs` on(((`fs`.`fileID` = `f`.`fileID`) and (`fs`.`type` <> 'preview') and (`f`.`fileID` in (select `smd__organization_has_media`.`mediaID` from `smd__organization_has_media` where `smd__organization_has_media`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 36))) or (`fs`.`systemType` in ('generic','branded')))))) left join `cms__file` `fp` on((`fp`.`fileID` = `fs`.`previewFileID`)))) union (select `c`.`carouselID` AS `mediaID`,'carousel' AS `mediaType`,`c`.`socialChannel` AS `socialChannel`,'carousel' AS `mime`,`c`.`name` AS `mediaName`,`c`.`url` AS `url`,NULL AS `previewFileUrl`,NULL AS `size`,NULL AS `width`,NULL AS `height`,NULL AS `ratio`,`c`.`systemType` AS `systemType`,`c`.`status` AS `status`,`c`.`userID` AS `userID`,`c`.`createDate` AS `createDate`,`c`.`modifyDate` AS `modifyDate`,'carousel' AS `mainMediaType` from `smd__carousel` `c`) ;

-- --------------------------------------------------------

--
-- Structure for view `view__all_media_37`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__all_media_37`  AS  (select `f`.`fileID` AS `mediaID`,`fs`.`type` AS `mediaType`,`fs`.`socialChannel` AS `socialChannel`,`fs`.`mime` AS `mime`,`f`.`name` AS `mediaName`,`f`.`url` AS `url`,`fp`.`url` AS `previewFileUrl`,`fs`.`size` AS `size`,`fs`.`data_width` AS `width`,`fs`.`data_height` AS `height`,`fs`.`data_ratio` AS `ratio`,`fs`.`systemType` AS `systemType`,`f`.`status` AS `status`,`f`.`userID` AS `userID`,`f`.`createDate` AS `createDate`,`f`.`modifyDate` AS `modifyDate`,'file' AS `mainMediaType` from ((`cms__file` `f` join `cms__file_static` `fs` on(((`fs`.`fileID` = `f`.`fileID`) and (`fs`.`type` <> 'preview') and (`f`.`fileID` in (select `smd__organization_has_media`.`mediaID` from `smd__organization_has_media` where `smd__organization_has_media`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 37))) or (`fs`.`systemType` in ('generic','branded')))))) left join `cms__file` `fp` on((`fp`.`fileID` = `fs`.`previewFileID`)))) union (select `c`.`carouselID` AS `mediaID`,'carousel' AS `mediaType`,`c`.`socialChannel` AS `socialChannel`,'carousel' AS `mime`,`c`.`name` AS `mediaName`,`c`.`url` AS `url`,NULL AS `previewFileUrl`,NULL AS `size`,NULL AS `width`,NULL AS `height`,NULL AS `ratio`,`c`.`systemType` AS `systemType`,`c`.`status` AS `status`,`c`.`userID` AS `userID`,`c`.`createDate` AS `createDate`,`c`.`modifyDate` AS `modifyDate`,'carousel' AS `mainMediaType` from `smd__carousel` `c`) ;

-- --------------------------------------------------------

--
-- Structure for view `view__all_media_38`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__all_media_38`  AS  (select `f`.`fileID` AS `mediaID`,`fs`.`type` AS `mediaType`,`fs`.`socialChannel` AS `socialChannel`,`fs`.`mime` AS `mime`,`f`.`name` AS `mediaName`,`f`.`url` AS `url`,`fp`.`url` AS `previewFileUrl`,`fs`.`size` AS `size`,`fs`.`data_width` AS `width`,`fs`.`data_height` AS `height`,`fs`.`data_ratio` AS `ratio`,`fs`.`systemType` AS `systemType`,`f`.`status` AS `status`,`f`.`userID` AS `userID`,`f`.`createDate` AS `createDate`,`f`.`modifyDate` AS `modifyDate`,'file' AS `mainMediaType` from ((`cms__file` `f` join `cms__file_static` `fs` on(((`fs`.`fileID` = `f`.`fileID`) and (`fs`.`type` <> 'preview') and (`f`.`fileID` in (select `smd__organization_has_media`.`mediaID` from `smd__organization_has_media` where `smd__organization_has_media`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 38))) or (`fs`.`systemType` in ('generic','branded')))))) left join `cms__file` `fp` on((`fp`.`fileID` = `fs`.`previewFileID`)))) union (select `c`.`carouselID` AS `mediaID`,'carousel' AS `mediaType`,`c`.`socialChannel` AS `socialChannel`,'carousel' AS `mime`,`c`.`name` AS `mediaName`,`c`.`url` AS `url`,NULL AS `previewFileUrl`,NULL AS `size`,NULL AS `width`,NULL AS `height`,NULL AS `ratio`,`c`.`systemType` AS `systemType`,`c`.`status` AS `status`,`c`.`userID` AS `userID`,`c`.`createDate` AS `createDate`,`c`.`modifyDate` AS `modifyDate`,'carousel' AS `mainMediaType` from `smd__carousel` `c`) ;

-- --------------------------------------------------------

--
-- Structure for view `view__all_media_39`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__all_media_39`  AS  (select `f`.`fileID` AS `mediaID`,`fs`.`type` AS `mediaType`,`fs`.`socialChannel` AS `socialChannel`,`fs`.`mime` AS `mime`,`f`.`name` AS `mediaName`,`f`.`url` AS `url`,`fp`.`url` AS `previewFileUrl`,`fs`.`size` AS `size`,`fs`.`data_width` AS `width`,`fs`.`data_height` AS `height`,`fs`.`data_ratio` AS `ratio`,`fs`.`systemType` AS `systemType`,`f`.`status` AS `status`,`f`.`userID` AS `userID`,`f`.`createDate` AS `createDate`,`f`.`modifyDate` AS `modifyDate`,'file' AS `mainMediaType` from ((`cms__file` `f` join `cms__file_static` `fs` on(((`fs`.`fileID` = `f`.`fileID`) and (`fs`.`type` <> 'preview') and (`f`.`fileID` in (select `smd__organization_has_media`.`mediaID` from `smd__organization_has_media` where `smd__organization_has_media`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 39))) or (`fs`.`systemType` in ('generic','branded')))))) left join `cms__file` `fp` on((`fp`.`fileID` = `fs`.`previewFileID`)))) union (select `c`.`carouselID` AS `mediaID`,'carousel' AS `mediaType`,`c`.`socialChannel` AS `socialChannel`,'carousel' AS `mime`,`c`.`name` AS `mediaName`,`c`.`url` AS `url`,NULL AS `previewFileUrl`,NULL AS `size`,NULL AS `width`,NULL AS `height`,NULL AS `ratio`,`c`.`systemType` AS `systemType`,`c`.`status` AS `status`,`c`.`userID` AS `userID`,`c`.`createDate` AS `createDate`,`c`.`modifyDate` AS `modifyDate`,'carousel' AS `mainMediaType` from `smd__carousel` `c`) ;

-- --------------------------------------------------------

--
-- Structure for view `view__all_media_40`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__all_media_40`  AS  (select `f`.`fileID` AS `mediaID`,`fs`.`type` AS `mediaType`,`fs`.`socialChannel` AS `socialChannel`,`fs`.`mime` AS `mime`,`f`.`name` AS `mediaName`,`f`.`url` AS `url`,`fp`.`url` AS `previewFileUrl`,`fs`.`size` AS `size`,`fs`.`data_width` AS `width`,`fs`.`data_height` AS `height`,`fs`.`data_ratio` AS `ratio`,`fs`.`systemType` AS `systemType`,`f`.`status` AS `status`,`f`.`userID` AS `userID`,`f`.`createDate` AS `createDate`,`f`.`modifyDate` AS `modifyDate`,'file' AS `mainMediaType` from ((`cms__file` `f` join `cms__file_static` `fs` on(((`fs`.`fileID` = `f`.`fileID`) and (`fs`.`type` <> 'preview') and (`f`.`fileID` in (select `smd__organization_has_media`.`mediaID` from `smd__organization_has_media` where `smd__organization_has_media`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 40))) or (`fs`.`systemType` in ('generic','branded')))))) left join `cms__file` `fp` on((`fp`.`fileID` = `fs`.`previewFileID`)))) union (select `c`.`carouselID` AS `mediaID`,'carousel' AS `mediaType`,`c`.`socialChannel` AS `socialChannel`,'carousel' AS `mime`,`c`.`name` AS `mediaName`,`c`.`url` AS `url`,NULL AS `previewFileUrl`,NULL AS `size`,NULL AS `width`,NULL AS `height`,NULL AS `ratio`,`c`.`systemType` AS `systemType`,`c`.`status` AS `status`,`c`.`userID` AS `userID`,`c`.`createDate` AS `createDate`,`c`.`modifyDate` AS `modifyDate`,'carousel' AS `mainMediaType` from `smd__carousel` `c`) ;

-- --------------------------------------------------------

--
-- Structure for view `view__all_media_41`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__all_media_41`  AS  (select `f`.`fileID` AS `mediaID`,`fs`.`type` AS `mediaType`,`fs`.`socialChannel` AS `socialChannel`,`fs`.`mime` AS `mime`,`f`.`name` AS `mediaName`,`f`.`url` AS `url`,`fp`.`url` AS `previewFileUrl`,`fs`.`size` AS `size`,`fs`.`data_width` AS `width`,`fs`.`data_height` AS `height`,`fs`.`data_ratio` AS `ratio`,`fs`.`systemType` AS `systemType`,`f`.`status` AS `status`,`f`.`userID` AS `userID`,`f`.`createDate` AS `createDate`,`f`.`modifyDate` AS `modifyDate`,'file' AS `mainMediaType` from ((`cms__file` `f` join `cms__file_static` `fs` on(((`fs`.`fileID` = `f`.`fileID`) and (`fs`.`type` <> 'preview') and (`f`.`fileID` in (select `smd__organization_has_media`.`mediaID` from `smd__organization_has_media` where `smd__organization_has_media`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 41))) or (`fs`.`systemType` in ('generic','branded')))))) left join `cms__file` `fp` on((`fp`.`fileID` = `fs`.`previewFileID`)))) union (select `c`.`carouselID` AS `mediaID`,'carousel' AS `mediaType`,`c`.`socialChannel` AS `socialChannel`,'carousel' AS `mime`,`c`.`name` AS `mediaName`,`c`.`url` AS `url`,NULL AS `previewFileUrl`,NULL AS `size`,NULL AS `width`,NULL AS `height`,NULL AS `ratio`,`c`.`systemType` AS `systemType`,`c`.`status` AS `status`,`c`.`userID` AS `userID`,`c`.`createDate` AS `createDate`,`c`.`modifyDate` AS `modifyDate`,'carousel' AS `mainMediaType` from `smd__carousel` `c`) ;

-- --------------------------------------------------------

--
-- Structure for view `view__all_media_42`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__all_media_42`  AS  (select `f`.`fileID` AS `mediaID`,`fs`.`type` AS `mediaType`,`fs`.`socialChannel` AS `socialChannel`,`fs`.`mime` AS `mime`,`f`.`name` AS `mediaName`,`f`.`url` AS `url`,`fp`.`url` AS `previewFileUrl`,`fs`.`size` AS `size`,`fs`.`data_width` AS `width`,`fs`.`data_height` AS `height`,`fs`.`data_ratio` AS `ratio`,`fs`.`systemType` AS `systemType`,`f`.`status` AS `status`,`f`.`userID` AS `userID`,`f`.`createDate` AS `createDate`,`f`.`modifyDate` AS `modifyDate`,'file' AS `mainMediaType` from ((`cms__file` `f` join `cms__file_static` `fs` on(((`fs`.`fileID` = `f`.`fileID`) and (`fs`.`type` <> 'preview') and (`f`.`fileID` in (select `smd__organization_has_media`.`mediaID` from `smd__organization_has_media` where `smd__organization_has_media`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 42))) or (`fs`.`systemType` in ('generic','branded')))))) left join `cms__file` `fp` on((`fp`.`fileID` = `fs`.`previewFileID`)))) union (select `c`.`carouselID` AS `mediaID`,'carousel' AS `mediaType`,`c`.`socialChannel` AS `socialChannel`,'carousel' AS `mime`,`c`.`name` AS `mediaName`,`c`.`url` AS `url`,NULL AS `previewFileUrl`,NULL AS `size`,NULL AS `width`,NULL AS `height`,NULL AS `ratio`,`c`.`systemType` AS `systemType`,`c`.`status` AS `status`,`c`.`userID` AS `userID`,`c`.`createDate` AS `createDate`,`c`.`modifyDate` AS `modifyDate`,'carousel' AS `mainMediaType` from `smd__carousel` `c`) ;

-- --------------------------------------------------------

--
-- Structure for view `view__all_media_43`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__all_media_43`  AS  (select `f`.`fileID` AS `mediaID`,`fs`.`type` AS `mediaType`,`fs`.`socialChannel` AS `socialChannel`,`fs`.`mime` AS `mime`,`f`.`name` AS `mediaName`,`f`.`url` AS `url`,`fp`.`url` AS `previewFileUrl`,`fs`.`size` AS `size`,`fs`.`data_width` AS `width`,`fs`.`data_height` AS `height`,`fs`.`data_ratio` AS `ratio`,`fs`.`systemType` AS `systemType`,`f`.`status` AS `status`,`f`.`userID` AS `userID`,`f`.`createDate` AS `createDate`,`f`.`modifyDate` AS `modifyDate`,'file' AS `mainMediaType` from ((`cms__file` `f` join `cms__file_static` `fs` on(((`fs`.`fileID` = `f`.`fileID`) and (`fs`.`type` <> 'preview') and (`f`.`fileID` in (select `smd__organization_has_media`.`mediaID` from `smd__organization_has_media` where `smd__organization_has_media`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 43))) or (`fs`.`systemType` in ('generic','branded')))))) left join `cms__file` `fp` on((`fp`.`fileID` = `fs`.`previewFileID`)))) union (select `c`.`carouselID` AS `mediaID`,'carousel' AS `mediaType`,`c`.`socialChannel` AS `socialChannel`,'carousel' AS `mime`,`c`.`name` AS `mediaName`,`c`.`url` AS `url`,NULL AS `previewFileUrl`,NULL AS `size`,NULL AS `width`,NULL AS `height`,NULL AS `ratio`,`c`.`systemType` AS `systemType`,`c`.`status` AS `status`,`c`.`userID` AS `userID`,`c`.`createDate` AS `createDate`,`c`.`modifyDate` AS `modifyDate`,'carousel' AS `mainMediaType` from `smd__carousel` `c`) ;

-- --------------------------------------------------------

--
-- Structure for view `view__all_media_44`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__all_media_44`  AS  (select `f`.`fileID` AS `mediaID`,`fs`.`type` AS `mediaType`,`fs`.`socialChannel` AS `socialChannel`,`fs`.`mime` AS `mime`,`f`.`name` AS `mediaName`,`f`.`url` AS `url`,`fp`.`url` AS `previewFileUrl`,`fs`.`size` AS `size`,`fs`.`data_width` AS `width`,`fs`.`data_height` AS `height`,`fs`.`data_ratio` AS `ratio`,`fs`.`systemType` AS `systemType`,`f`.`status` AS `status`,`f`.`userID` AS `userID`,`f`.`createDate` AS `createDate`,`f`.`modifyDate` AS `modifyDate`,'file' AS `mainMediaType` from ((`cms__file` `f` join `cms__file_static` `fs` on(((`fs`.`fileID` = `f`.`fileID`) and (`fs`.`type` <> 'preview') and (`f`.`fileID` in (select `smd__organization_has_media`.`mediaID` from `smd__organization_has_media` where `smd__organization_has_media`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 44))) or (`fs`.`systemType` in ('generic','branded')))))) left join `cms__file` `fp` on((`fp`.`fileID` = `fs`.`previewFileID`)))) union (select `c`.`carouselID` AS `mediaID`,'carousel' AS `mediaType`,`c`.`socialChannel` AS `socialChannel`,'carousel' AS `mime`,`c`.`name` AS `mediaName`,`c`.`url` AS `url`,NULL AS `previewFileUrl`,NULL AS `size`,NULL AS `width`,NULL AS `height`,NULL AS `ratio`,`c`.`systemType` AS `systemType`,`c`.`status` AS `status`,`c`.`userID` AS `userID`,`c`.`createDate` AS `createDate`,`c`.`modifyDate` AS `modifyDate`,'carousel' AS `mainMediaType` from `smd__carousel` `c`) ;

-- --------------------------------------------------------

--
-- Structure for view `view__all_media_45`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__all_media_45`  AS  (select `f`.`fileID` AS `mediaID`,`fs`.`type` AS `mediaType`,`fs`.`socialChannel` AS `socialChannel`,`fs`.`mime` AS `mime`,`f`.`name` AS `mediaName`,`f`.`url` AS `url`,`fp`.`url` AS `previewFileUrl`,`fs`.`size` AS `size`,`fs`.`data_width` AS `width`,`fs`.`data_height` AS `height`,`fs`.`data_ratio` AS `ratio`,`fs`.`systemType` AS `systemType`,`f`.`status` AS `status`,`f`.`userID` AS `userID`,`f`.`createDate` AS `createDate`,`f`.`modifyDate` AS `modifyDate`,'file' AS `mainMediaType` from ((`cms__file` `f` join `cms__file_static` `fs` on(((`fs`.`fileID` = `f`.`fileID`) and (`fs`.`type` <> 'preview') and (`f`.`fileID` in (select `smd__organization_has_media`.`mediaID` from `smd__organization_has_media` where `smd__organization_has_media`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 45))) or (`fs`.`systemType` in ('generic','branded')))))) left join `cms__file` `fp` on((`fp`.`fileID` = `fs`.`previewFileID`)))) union (select `c`.`carouselID` AS `mediaID`,'carousel' AS `mediaType`,`c`.`socialChannel` AS `socialChannel`,'carousel' AS `mime`,`c`.`name` AS `mediaName`,`c`.`url` AS `url`,NULL AS `previewFileUrl`,NULL AS `size`,NULL AS `width`,NULL AS `height`,NULL AS `ratio`,`c`.`systemType` AS `systemType`,`c`.`status` AS `status`,`c`.`userID` AS `userID`,`c`.`createDate` AS `createDate`,`c`.`modifyDate` AS `modifyDate`,'carousel' AS `mainMediaType` from `smd__carousel` `c`) ;

-- --------------------------------------------------------

--
-- Structure for view `view__all_media_46`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__all_media_46`  AS  (select `f`.`fileID` AS `mediaID`,`fs`.`type` AS `mediaType`,`fs`.`socialChannel` AS `socialChannel`,`fs`.`mime` AS `mime`,`f`.`name` AS `mediaName`,`f`.`url` AS `url`,`fp`.`url` AS `previewFileUrl`,`fs`.`size` AS `size`,`fs`.`data_width` AS `width`,`fs`.`data_height` AS `height`,`fs`.`data_ratio` AS `ratio`,`fs`.`systemType` AS `systemType`,`f`.`status` AS `status`,`f`.`userID` AS `userID`,`f`.`createDate` AS `createDate`,`f`.`modifyDate` AS `modifyDate`,'file' AS `mainMediaType` from ((`cms__file` `f` join `cms__file_static` `fs` on(((`fs`.`fileID` = `f`.`fileID`) and (`fs`.`type` <> 'preview') and (`f`.`fileID` in (select `smd__organization_has_media`.`mediaID` from `smd__organization_has_media` where `smd__organization_has_media`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 46))) or (`fs`.`systemType` in ('generic','branded')))))) left join `cms__file` `fp` on((`fp`.`fileID` = `fs`.`previewFileID`)))) union (select `c`.`carouselID` AS `mediaID`,'carousel' AS `mediaType`,`c`.`socialChannel` AS `socialChannel`,'carousel' AS `mime`,`c`.`name` AS `mediaName`,`c`.`url` AS `url`,NULL AS `previewFileUrl`,NULL AS `size`,NULL AS `width`,NULL AS `height`,NULL AS `ratio`,`c`.`systemType` AS `systemType`,`c`.`status` AS `status`,`c`.`userID` AS `userID`,`c`.`createDate` AS `createDate`,`c`.`modifyDate` AS `modifyDate`,'carousel' AS `mainMediaType` from `smd__carousel` `c`) ;

-- --------------------------------------------------------

--
-- Structure for view `view__all_media_47`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__all_media_47`  AS  (select `f`.`fileID` AS `mediaID`,`fs`.`type` AS `mediaType`,`fs`.`socialChannel` AS `socialChannel`,`fs`.`mime` AS `mime`,`f`.`name` AS `mediaName`,`f`.`url` AS `url`,`fp`.`url` AS `previewFileUrl`,`fs`.`size` AS `size`,`fs`.`data_width` AS `width`,`fs`.`data_height` AS `height`,`fs`.`data_ratio` AS `ratio`,`fs`.`systemType` AS `systemType`,`f`.`status` AS `status`,`f`.`userID` AS `userID`,`f`.`createDate` AS `createDate`,`f`.`modifyDate` AS `modifyDate`,'file' AS `mainMediaType` from ((`cms__file` `f` join `cms__file_static` `fs` on(((`fs`.`fileID` = `f`.`fileID`) and (`fs`.`type` <> 'preview') and (`f`.`fileID` in (select `smd__organization_has_media`.`mediaID` from `smd__organization_has_media` where `smd__organization_has_media`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 47))) or (`fs`.`systemType` in ('generic','branded')))))) left join `cms__file` `fp` on((`fp`.`fileID` = `fs`.`previewFileID`)))) union (select `c`.`carouselID` AS `mediaID`,'carousel' AS `mediaType`,`c`.`socialChannel` AS `socialChannel`,'carousel' AS `mime`,`c`.`name` AS `mediaName`,`c`.`url` AS `url`,NULL AS `previewFileUrl`,NULL AS `size`,NULL AS `width`,NULL AS `height`,NULL AS `ratio`,`c`.`systemType` AS `systemType`,`c`.`status` AS `status`,`c`.`userID` AS `userID`,`c`.`createDate` AS `createDate`,`c`.`modifyDate` AS `modifyDate`,'carousel' AS `mainMediaType` from `smd__carousel` `c`) ;

-- --------------------------------------------------------

--
-- Structure for view `view__all_media_48`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__all_media_48`  AS  (select `f`.`fileID` AS `mediaID`,`fs`.`type` AS `mediaType`,`fs`.`socialChannel` AS `socialChannel`,`fs`.`mime` AS `mime`,`f`.`name` AS `mediaName`,`f`.`url` AS `url`,`fp`.`url` AS `previewFileUrl`,`fs`.`size` AS `size`,`fs`.`data_width` AS `width`,`fs`.`data_height` AS `height`,`fs`.`data_ratio` AS `ratio`,`fs`.`systemType` AS `systemType`,`f`.`status` AS `status`,`f`.`userID` AS `userID`,`f`.`createDate` AS `createDate`,`f`.`modifyDate` AS `modifyDate`,'file' AS `mainMediaType` from ((`cms__file` `f` join `cms__file_static` `fs` on(((`fs`.`fileID` = `f`.`fileID`) and (`fs`.`type` <> 'preview') and (`f`.`fileID` in (select `smd__organization_has_media`.`mediaID` from `smd__organization_has_media` where `smd__organization_has_media`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 48))) or (`fs`.`systemType` in ('generic','branded')))))) left join `cms__file` `fp` on((`fp`.`fileID` = `fs`.`previewFileID`)))) union (select `c`.`carouselID` AS `mediaID`,'carousel' AS `mediaType`,`c`.`socialChannel` AS `socialChannel`,'carousel' AS `mime`,`c`.`name` AS `mediaName`,`c`.`url` AS `url`,NULL AS `previewFileUrl`,NULL AS `size`,NULL AS `width`,NULL AS `height`,NULL AS `ratio`,`c`.`systemType` AS `systemType`,`c`.`status` AS `status`,`c`.`userID` AS `userID`,`c`.`createDate` AS `createDate`,`c`.`modifyDate` AS `modifyDate`,'carousel' AS `mainMediaType` from `smd__carousel` `c`) ;

-- --------------------------------------------------------

--
-- Structure for view `view__all_media_49`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__all_media_49`  AS  (select `f`.`fileID` AS `mediaID`,`fs`.`type` AS `mediaType`,`fs`.`socialChannel` AS `socialChannel`,`fs`.`mime` AS `mime`,`f`.`name` AS `mediaName`,`f`.`url` AS `url`,`fp`.`url` AS `previewFileUrl`,`fs`.`size` AS `size`,`fs`.`data_width` AS `width`,`fs`.`data_height` AS `height`,`fs`.`data_ratio` AS `ratio`,`fs`.`systemType` AS `systemType`,`f`.`status` AS `status`,`f`.`userID` AS `userID`,`f`.`createDate` AS `createDate`,`f`.`modifyDate` AS `modifyDate`,'file' AS `mainMediaType` from ((`cms__file` `f` join `cms__file_static` `fs` on(((`fs`.`fileID` = `f`.`fileID`) and (`fs`.`type` <> 'preview') and (`f`.`fileID` in (select `smd__organization_has_media`.`mediaID` from `smd__organization_has_media` where `smd__organization_has_media`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 49))) or (`fs`.`systemType` in ('generic','branded')))))) left join `cms__file` `fp` on((`fp`.`fileID` = `fs`.`previewFileID`)))) union (select `c`.`carouselID` AS `mediaID`,'carousel' AS `mediaType`,`c`.`socialChannel` AS `socialChannel`,'carousel' AS `mime`,`c`.`name` AS `mediaName`,`c`.`url` AS `url`,NULL AS `previewFileUrl`,NULL AS `size`,NULL AS `width`,NULL AS `height`,NULL AS `ratio`,`c`.`systemType` AS `systemType`,`c`.`status` AS `status`,`c`.`userID` AS `userID`,`c`.`createDate` AS `createDate`,`c`.`modifyDate` AS `modifyDate`,'carousel' AS `mainMediaType` from `smd__carousel` `c`) ;

-- --------------------------------------------------------

--
-- Structure for view `view__all_media_50`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__all_media_50`  AS  (select `f`.`fileID` AS `mediaID`,`fs`.`type` AS `mediaType`,`fs`.`socialChannel` AS `socialChannel`,`fs`.`mime` AS `mime`,`f`.`name` AS `mediaName`,`f`.`url` AS `url`,`fp`.`url` AS `previewFileUrl`,`fs`.`size` AS `size`,`fs`.`data_width` AS `width`,`fs`.`data_height` AS `height`,`fs`.`data_ratio` AS `ratio`,`fs`.`systemType` AS `systemType`,`f`.`status` AS `status`,`f`.`userID` AS `userID`,`f`.`createDate` AS `createDate`,`f`.`modifyDate` AS `modifyDate`,'file' AS `mainMediaType` from ((`cms__file` `f` join `cms__file_static` `fs` on(((`fs`.`fileID` = `f`.`fileID`) and (`fs`.`type` <> 'preview') and (`f`.`fileID` in (select `smd__organization_has_media`.`mediaID` from `smd__organization_has_media` where `smd__organization_has_media`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 50))) or (`fs`.`systemType` in ('generic','branded')))))) left join `cms__file` `fp` on((`fp`.`fileID` = `fs`.`previewFileID`)))) union (select `c`.`carouselID` AS `mediaID`,'carousel' AS `mediaType`,`c`.`socialChannel` AS `socialChannel`,'carousel' AS `mime`,`c`.`name` AS `mediaName`,`c`.`url` AS `url`,NULL AS `previewFileUrl`,NULL AS `size`,NULL AS `width`,NULL AS `height`,NULL AS `ratio`,`c`.`systemType` AS `systemType`,`c`.`status` AS `status`,`c`.`userID` AS `userID`,`c`.`createDate` AS `createDate`,`c`.`modifyDate` AS `modifyDate`,'carousel' AS `mainMediaType` from `smd__carousel` `c`) ;

-- --------------------------------------------------------

--
-- Structure for view `view__all_media_51`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__all_media_51`  AS  (select `f`.`fileID` AS `mediaID`,`fs`.`type` AS `mediaType`,`fs`.`socialChannel` AS `socialChannel`,`fs`.`mime` AS `mime`,`f`.`name` AS `mediaName`,`f`.`url` AS `url`,`fp`.`url` AS `previewFileUrl`,`fs`.`size` AS `size`,`fs`.`data_width` AS `width`,`fs`.`data_height` AS `height`,`fs`.`data_ratio` AS `ratio`,`fs`.`systemType` AS `systemType`,`f`.`status` AS `status`,`f`.`userID` AS `userID`,`f`.`createDate` AS `createDate`,`f`.`modifyDate` AS `modifyDate`,'file' AS `mainMediaType` from ((`cms__file` `f` join `cms__file_static` `fs` on(((`fs`.`fileID` = `f`.`fileID`) and (`fs`.`type` <> 'preview') and (`f`.`fileID` in (select `smd__organization_has_media`.`mediaID` from `smd__organization_has_media` where `smd__organization_has_media`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 51))) or (`fs`.`systemType` in ('generic','branded')))))) left join `cms__file` `fp` on((`fp`.`fileID` = `fs`.`previewFileID`)))) union (select `c`.`carouselID` AS `mediaID`,'carousel' AS `mediaType`,`c`.`socialChannel` AS `socialChannel`,'carousel' AS `mime`,`c`.`name` AS `mediaName`,`c`.`url` AS `url`,NULL AS `previewFileUrl`,NULL AS `size`,NULL AS `width`,NULL AS `height`,NULL AS `ratio`,`c`.`systemType` AS `systemType`,`c`.`status` AS `status`,`c`.`userID` AS `userID`,`c`.`createDate` AS `createDate`,`c`.`modifyDate` AS `modifyDate`,'carousel' AS `mainMediaType` from `smd__carousel` `c`) ;

-- --------------------------------------------------------

--
-- Structure for view `view__all_media_52`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__all_media_52`  AS  (select `f`.`fileID` AS `mediaID`,`fs`.`type` AS `mediaType`,`fs`.`socialChannel` AS `socialChannel`,`fs`.`mime` AS `mime`,`f`.`name` AS `mediaName`,`f`.`url` AS `url`,`fp`.`url` AS `previewFileUrl`,`fs`.`size` AS `size`,`fs`.`data_width` AS `width`,`fs`.`data_height` AS `height`,`fs`.`data_ratio` AS `ratio`,`fs`.`systemType` AS `systemType`,`f`.`status` AS `status`,`f`.`userID` AS `userID`,`f`.`createDate` AS `createDate`,`f`.`modifyDate` AS `modifyDate`,'file' AS `mainMediaType` from ((`cms__file` `f` join `cms__file_static` `fs` on(((`fs`.`fileID` = `f`.`fileID`) and (`fs`.`type` <> 'preview') and (`f`.`fileID` in (select `smd__organization_has_media`.`mediaID` from `smd__organization_has_media` where `smd__organization_has_media`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 52))) or (`fs`.`systemType` in ('generic','branded')))))) left join `cms__file` `fp` on((`fp`.`fileID` = `fs`.`previewFileID`)))) union (select `c`.`carouselID` AS `mediaID`,'carousel' AS `mediaType`,`c`.`socialChannel` AS `socialChannel`,'carousel' AS `mime`,`c`.`name` AS `mediaName`,`c`.`url` AS `url`,NULL AS `previewFileUrl`,NULL AS `size`,NULL AS `width`,NULL AS `height`,NULL AS `ratio`,`c`.`systemType` AS `systemType`,`c`.`status` AS `status`,`c`.`userID` AS `userID`,`c`.`createDate` AS `createDate`,`c`.`modifyDate` AS `modifyDate`,'carousel' AS `mainMediaType` from `smd__carousel` `c`) ;

-- --------------------------------------------------------

--
-- Structure for view `view__all_media_53`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__all_media_53`  AS  (select `f`.`fileID` AS `mediaID`,`fs`.`type` AS `mediaType`,`fs`.`socialChannel` AS `socialChannel`,`fs`.`mime` AS `mime`,`f`.`name` AS `mediaName`,`f`.`url` AS `url`,`fp`.`url` AS `previewFileUrl`,`fs`.`size` AS `size`,`fs`.`data_width` AS `width`,`fs`.`data_height` AS `height`,`fs`.`data_ratio` AS `ratio`,`fs`.`systemType` AS `systemType`,`f`.`status` AS `status`,`f`.`userID` AS `userID`,`f`.`createDate` AS `createDate`,`f`.`modifyDate` AS `modifyDate`,'file' AS `mainMediaType` from ((`cms__file` `f` join `cms__file_static` `fs` on(((`fs`.`fileID` = `f`.`fileID`) and (`fs`.`type` <> 'preview') and (`f`.`fileID` in (select `smd__organization_has_media`.`mediaID` from `smd__organization_has_media` where `smd__organization_has_media`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 53))) or (`fs`.`systemType` in ('generic','branded')))))) left join `cms__file` `fp` on((`fp`.`fileID` = `fs`.`previewFileID`)))) union (select `c`.`carouselID` AS `mediaID`,'carousel' AS `mediaType`,`c`.`socialChannel` AS `socialChannel`,'carousel' AS `mime`,`c`.`name` AS `mediaName`,`c`.`url` AS `url`,NULL AS `previewFileUrl`,NULL AS `size`,NULL AS `width`,NULL AS `height`,NULL AS `ratio`,`c`.`systemType` AS `systemType`,`c`.`status` AS `status`,`c`.`userID` AS `userID`,`c`.`createDate` AS `createDate`,`c`.`modifyDate` AS `modifyDate`,'carousel' AS `mainMediaType` from `smd__carousel` `c`) ;

-- --------------------------------------------------------

--
-- Structure for view `view__all_media_54`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__all_media_54`  AS  (select `f`.`fileID` AS `mediaID`,`fs`.`type` AS `mediaType`,`fs`.`socialChannel` AS `socialChannel`,`fs`.`mime` AS `mime`,`f`.`name` AS `mediaName`,`f`.`url` AS `url`,`fp`.`url` AS `previewFileUrl`,`fs`.`size` AS `size`,`fs`.`data_width` AS `width`,`fs`.`data_height` AS `height`,`fs`.`data_ratio` AS `ratio`,`fs`.`systemType` AS `systemType`,`f`.`status` AS `status`,`f`.`userID` AS `userID`,`f`.`createDate` AS `createDate`,`f`.`modifyDate` AS `modifyDate`,'file' AS `mainMediaType` from ((`cms__file` `f` join `cms__file_static` `fs` on(((`fs`.`fileID` = `f`.`fileID`) and (`fs`.`type` <> 'preview') and (`f`.`fileID` in (select `smd__organization_has_media`.`mediaID` from `smd__organization_has_media` where `smd__organization_has_media`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 54))) or (`fs`.`systemType` in ('generic','branded')))))) left join `cms__file` `fp` on((`fp`.`fileID` = `fs`.`previewFileID`)))) union (select `c`.`carouselID` AS `mediaID`,'carousel' AS `mediaType`,`c`.`socialChannel` AS `socialChannel`,'carousel' AS `mime`,`c`.`name` AS `mediaName`,`c`.`url` AS `url`,NULL AS `previewFileUrl`,NULL AS `size`,NULL AS `width`,NULL AS `height`,NULL AS `ratio`,`c`.`systemType` AS `systemType`,`c`.`status` AS `status`,`c`.`userID` AS `userID`,`c`.`createDate` AS `createDate`,`c`.`modifyDate` AS `modifyDate`,'carousel' AS `mainMediaType` from `smd__carousel` `c`) ;

-- --------------------------------------------------------

--
-- Structure for view `view__all_media_55`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__all_media_55`  AS  (select `f`.`fileID` AS `mediaID`,`fs`.`type` AS `mediaType`,`fs`.`socialChannel` AS `socialChannel`,`fs`.`mime` AS `mime`,`f`.`name` AS `mediaName`,`f`.`url` AS `url`,`fp`.`url` AS `previewFileUrl`,`fs`.`size` AS `size`,`fs`.`data_width` AS `width`,`fs`.`data_height` AS `height`,`fs`.`data_ratio` AS `ratio`,`fs`.`systemType` AS `systemType`,`f`.`status` AS `status`,`f`.`userID` AS `userID`,`f`.`createDate` AS `createDate`,`f`.`modifyDate` AS `modifyDate`,'file' AS `mainMediaType` from ((`cms__file` `f` join `cms__file_static` `fs` on(((`fs`.`fileID` = `f`.`fileID`) and (`fs`.`type` <> 'preview') and (`f`.`fileID` in (select `smd__organization_has_media`.`mediaID` from `smd__organization_has_media` where `smd__organization_has_media`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 55))) or (`fs`.`systemType` in ('generic','branded')))))) left join `cms__file` `fp` on((`fp`.`fileID` = `fs`.`previewFileID`)))) union (select `c`.`carouselID` AS `mediaID`,'carousel' AS `mediaType`,`c`.`socialChannel` AS `socialChannel`,'carousel' AS `mime`,`c`.`name` AS `mediaName`,`c`.`url` AS `url`,NULL AS `previewFileUrl`,NULL AS `size`,NULL AS `width`,NULL AS `height`,NULL AS `ratio`,`c`.`systemType` AS `systemType`,`c`.`status` AS `status`,`c`.`userID` AS `userID`,`c`.`createDate` AS `createDate`,`c`.`modifyDate` AS `modifyDate`,'carousel' AS `mainMediaType` from `smd__carousel` `c`) ;

-- --------------------------------------------------------

--
-- Structure for view `view__all_media_56`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__all_media_56`  AS  (select `f`.`fileID` AS `mediaID`,`fs`.`type` AS `mediaType`,`fs`.`socialChannel` AS `socialChannel`,`fs`.`mime` AS `mime`,`f`.`name` AS `mediaName`,`f`.`url` AS `url`,`fp`.`url` AS `previewFileUrl`,`fs`.`size` AS `size`,`fs`.`data_width` AS `width`,`fs`.`data_height` AS `height`,`fs`.`data_ratio` AS `ratio`,`fs`.`systemType` AS `systemType`,`f`.`status` AS `status`,`f`.`userID` AS `userID`,`f`.`createDate` AS `createDate`,`f`.`modifyDate` AS `modifyDate`,'file' AS `mainMediaType` from ((`cms__file` `f` join `cms__file_static` `fs` on(((`fs`.`fileID` = `f`.`fileID`) and (`fs`.`type` <> 'preview') and (`f`.`fileID` in (select `smd__organization_has_media`.`mediaID` from `smd__organization_has_media` where `smd__organization_has_media`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 56))) or (`fs`.`systemType` in ('generic','branded')))))) left join `cms__file` `fp` on((`fp`.`fileID` = `fs`.`previewFileID`)))) union (select `c`.`carouselID` AS `mediaID`,'carousel' AS `mediaType`,`c`.`socialChannel` AS `socialChannel`,'carousel' AS `mime`,`c`.`name` AS `mediaName`,`c`.`url` AS `url`,NULL AS `previewFileUrl`,NULL AS `size`,NULL AS `width`,NULL AS `height`,NULL AS `ratio`,`c`.`systemType` AS `systemType`,`c`.`status` AS `status`,`c`.`userID` AS `userID`,`c`.`createDate` AS `createDate`,`c`.`modifyDate` AS `modifyDate`,'carousel' AS `mainMediaType` from `smd__carousel` `c`) ;

-- --------------------------------------------------------

--
-- Structure for view `view__all_media_57`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__all_media_57`  AS  (select `f`.`fileID` AS `mediaID`,`fs`.`type` AS `mediaType`,`fs`.`socialChannel` AS `socialChannel`,`fs`.`mime` AS `mime`,`f`.`name` AS `mediaName`,`f`.`url` AS `url`,`fp`.`url` AS `previewFileUrl`,`fs`.`size` AS `size`,`fs`.`data_width` AS `width`,`fs`.`data_height` AS `height`,`fs`.`data_ratio` AS `ratio`,`fs`.`systemType` AS `systemType`,`f`.`status` AS `status`,`f`.`userID` AS `userID`,`f`.`createDate` AS `createDate`,`f`.`modifyDate` AS `modifyDate`,'file' AS `mainMediaType` from ((`cms__file` `f` join `cms__file_static` `fs` on(((`fs`.`fileID` = `f`.`fileID`) and (`fs`.`type` <> 'preview') and (`f`.`fileID` in (select `smd__organization_has_media`.`mediaID` from `smd__organization_has_media` where `smd__organization_has_media`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 57))) or (`fs`.`systemType` in ('generic','branded')))))) left join `cms__file` `fp` on((`fp`.`fileID` = `fs`.`previewFileID`)))) union (select `c`.`carouselID` AS `mediaID`,'carousel' AS `mediaType`,`c`.`socialChannel` AS `socialChannel`,'carousel' AS `mime`,`c`.`name` AS `mediaName`,`c`.`url` AS `url`,NULL AS `previewFileUrl`,NULL AS `size`,NULL AS `width`,NULL AS `height`,NULL AS `ratio`,`c`.`systemType` AS `systemType`,`c`.`status` AS `status`,`c`.`userID` AS `userID`,`c`.`createDate` AS `createDate`,`c`.`modifyDate` AS `modifyDate`,'carousel' AS `mainMediaType` from `smd__carousel` `c`) ;

-- --------------------------------------------------------

--
-- Structure for view `view__all_media_58`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__all_media_58`  AS  (select `f`.`fileID` AS `mediaID`,`fs`.`type` AS `mediaType`,`fs`.`socialChannel` AS `socialChannel`,`fs`.`mime` AS `mime`,`f`.`name` AS `mediaName`,`f`.`url` AS `url`,`fp`.`url` AS `previewFileUrl`,`fs`.`size` AS `size`,`fs`.`data_width` AS `width`,`fs`.`data_height` AS `height`,`fs`.`data_ratio` AS `ratio`,`fs`.`systemType` AS `systemType`,`f`.`status` AS `status`,`f`.`userID` AS `userID`,`f`.`createDate` AS `createDate`,`f`.`modifyDate` AS `modifyDate`,'file' AS `mainMediaType` from ((`cms__file` `f` join `cms__file_static` `fs` on(((`fs`.`fileID` = `f`.`fileID`) and (`fs`.`type` <> 'preview') and (`f`.`fileID` in (select `smd__organization_has_media`.`mediaID` from `smd__organization_has_media` where `smd__organization_has_media`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 58))) or (`fs`.`systemType` in ('generic','branded')))))) left join `cms__file` `fp` on((`fp`.`fileID` = `fs`.`previewFileID`)))) union (select `c`.`carouselID` AS `mediaID`,'carousel' AS `mediaType`,`c`.`socialChannel` AS `socialChannel`,'carousel' AS `mime`,`c`.`name` AS `mediaName`,`c`.`url` AS `url`,NULL AS `previewFileUrl`,NULL AS `size`,NULL AS `width`,NULL AS `height`,NULL AS `ratio`,`c`.`systemType` AS `systemType`,`c`.`status` AS `status`,`c`.`userID` AS `userID`,`c`.`createDate` AS `createDate`,`c`.`modifyDate` AS `modifyDate`,'carousel' AS `mainMediaType` from `smd__carousel` `c`) ;

-- --------------------------------------------------------

--
-- Structure for view `view__all_media_59`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__all_media_59`  AS  (select `f`.`fileID` AS `mediaID`,`fs`.`type` AS `mediaType`,`fs`.`socialChannel` AS `socialChannel`,`fs`.`mime` AS `mime`,`f`.`name` AS `mediaName`,`f`.`url` AS `url`,`fp`.`url` AS `previewFileUrl`,`fs`.`size` AS `size`,`fs`.`data_width` AS `width`,`fs`.`data_height` AS `height`,`fs`.`data_ratio` AS `ratio`,`fs`.`systemType` AS `systemType`,`f`.`status` AS `status`,`f`.`userID` AS `userID`,`f`.`createDate` AS `createDate`,`f`.`modifyDate` AS `modifyDate`,'file' AS `mainMediaType` from ((`cms__file` `f` join `cms__file_static` `fs` on(((`fs`.`fileID` = `f`.`fileID`) and (`fs`.`type` <> 'preview') and (`f`.`fileID` in (select `smd__organization_has_media`.`mediaID` from `smd__organization_has_media` where `smd__organization_has_media`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 59))) or (`fs`.`systemType` in ('generic','branded')))))) left join `cms__file` `fp` on((`fp`.`fileID` = `fs`.`previewFileID`)))) union (select `c`.`carouselID` AS `mediaID`,'carousel' AS `mediaType`,`c`.`socialChannel` AS `socialChannel`,'carousel' AS `mime`,`c`.`name` AS `mediaName`,`c`.`url` AS `url`,NULL AS `previewFileUrl`,NULL AS `size`,NULL AS `width`,NULL AS `height`,NULL AS `ratio`,`c`.`systemType` AS `systemType`,`c`.`status` AS `status`,`c`.`userID` AS `userID`,`c`.`createDate` AS `createDate`,`c`.`modifyDate` AS `modifyDate`,'carousel' AS `mainMediaType` from `smd__carousel` `c`) ;

-- --------------------------------------------------------

--
-- Structure for view `view__all_media_60`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__all_media_60`  AS  (select `f`.`fileID` AS `mediaID`,`fs`.`type` AS `mediaType`,`fs`.`socialChannel` AS `socialChannel`,`fs`.`mime` AS `mime`,`f`.`name` AS `mediaName`,`f`.`url` AS `url`,`fp`.`url` AS `previewFileUrl`,`fs`.`size` AS `size`,`fs`.`data_width` AS `width`,`fs`.`data_height` AS `height`,`fs`.`data_ratio` AS `ratio`,`fs`.`systemType` AS `systemType`,`f`.`status` AS `status`,`f`.`userID` AS `userID`,`f`.`createDate` AS `createDate`,`f`.`modifyDate` AS `modifyDate`,'file' AS `mainMediaType` from ((`cms__file` `f` join `cms__file_static` `fs` on(((`fs`.`fileID` = `f`.`fileID`) and (`fs`.`type` <> 'preview') and (`f`.`fileID` in (select `smd__organization_has_media`.`mediaID` from `smd__organization_has_media` where `smd__organization_has_media`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 60))) or (`fs`.`systemType` in ('generic','branded')))))) left join `cms__file` `fp` on((`fp`.`fileID` = `fs`.`previewFileID`)))) union (select `c`.`carouselID` AS `mediaID`,'carousel' AS `mediaType`,`c`.`socialChannel` AS `socialChannel`,'carousel' AS `mime`,`c`.`name` AS `mediaName`,`c`.`url` AS `url`,NULL AS `previewFileUrl`,NULL AS `size`,NULL AS `width`,NULL AS `height`,NULL AS `ratio`,`c`.`systemType` AS `systemType`,`c`.`status` AS `status`,`c`.`userID` AS `userID`,`c`.`createDate` AS `createDate`,`c`.`modifyDate` AS `modifyDate`,'carousel' AS `mainMediaType` from `smd__carousel` `c`) ;

-- --------------------------------------------------------

--
-- Structure for view `view__all_media_61`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__all_media_61`  AS  (select `f`.`fileID` AS `mediaID`,`fs`.`type` AS `mediaType`,`fs`.`socialChannel` AS `socialChannel`,`fs`.`mime` AS `mime`,`f`.`name` AS `mediaName`,`f`.`url` AS `url`,`fp`.`url` AS `previewFileUrl`,`fs`.`size` AS `size`,`fs`.`data_width` AS `width`,`fs`.`data_height` AS `height`,`fs`.`data_ratio` AS `ratio`,`fs`.`systemType` AS `systemType`,`f`.`status` AS `status`,`f`.`userID` AS `userID`,`f`.`createDate` AS `createDate`,`f`.`modifyDate` AS `modifyDate`,'file' AS `mainMediaType` from ((`cms__file` `f` join `cms__file_static` `fs` on(((`fs`.`fileID` = `f`.`fileID`) and (`fs`.`type` <> 'preview') and (`f`.`fileID` in (select `smd__organization_has_media`.`mediaID` from `smd__organization_has_media` where `smd__organization_has_media`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 61))) or (`fs`.`systemType` in ('generic','branded')))))) left join `cms__file` `fp` on((`fp`.`fileID` = `fs`.`previewFileID`)))) union (select `c`.`carouselID` AS `mediaID`,'carousel' AS `mediaType`,`c`.`socialChannel` AS `socialChannel`,'carousel' AS `mime`,`c`.`name` AS `mediaName`,`c`.`url` AS `url`,NULL AS `previewFileUrl`,NULL AS `size`,NULL AS `width`,NULL AS `height`,NULL AS `ratio`,`c`.`systemType` AS `systemType`,`c`.`status` AS `status`,`c`.`userID` AS `userID`,`c`.`createDate` AS `createDate`,`c`.`modifyDate` AS `modifyDate`,'carousel' AS `mainMediaType` from `smd__carousel` `c`) ;

-- --------------------------------------------------------

--
-- Structure for view `view__all_media_62`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__all_media_62`  AS  (select `f`.`fileID` AS `mediaID`,`fs`.`type` AS `mediaType`,`fs`.`socialChannel` AS `socialChannel`,`fs`.`mime` AS `mime`,`f`.`name` AS `mediaName`,`f`.`url` AS `url`,`fp`.`url` AS `previewFileUrl`,`fs`.`size` AS `size`,`fs`.`data_width` AS `width`,`fs`.`data_height` AS `height`,`fs`.`data_ratio` AS `ratio`,`fs`.`systemType` AS `systemType`,`f`.`status` AS `status`,`f`.`userID` AS `userID`,`f`.`createDate` AS `createDate`,`f`.`modifyDate` AS `modifyDate`,'file' AS `mainMediaType` from ((`cms__file` `f` join `cms__file_static` `fs` on(((`fs`.`fileID` = `f`.`fileID`) and (`fs`.`type` <> 'preview') and (`f`.`fileID` in (select `smd__organization_has_media`.`mediaID` from `smd__organization_has_media` where `smd__organization_has_media`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 62))) or (`fs`.`systemType` in ('generic','branded')))))) left join `cms__file` `fp` on((`fp`.`fileID` = `fs`.`previewFileID`)))) union (select `c`.`carouselID` AS `mediaID`,'carousel' AS `mediaType`,`c`.`socialChannel` AS `socialChannel`,'carousel' AS `mime`,`c`.`name` AS `mediaName`,`c`.`url` AS `url`,NULL AS `previewFileUrl`,NULL AS `size`,NULL AS `width`,NULL AS `height`,NULL AS `ratio`,`c`.`systemType` AS `systemType`,`c`.`status` AS `status`,`c`.`userID` AS `userID`,`c`.`createDate` AS `createDate`,`c`.`modifyDate` AS `modifyDate`,'carousel' AS `mainMediaType` from `smd__carousel` `c`) ;

-- --------------------------------------------------------

--
-- Structure for view `view__all_media_63`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__all_media_63`  AS  (select `f`.`fileID` AS `mediaID`,`fs`.`type` AS `mediaType`,`fs`.`socialChannel` AS `socialChannel`,`fs`.`mime` AS `mime`,`f`.`name` AS `mediaName`,`f`.`url` AS `url`,`fp`.`url` AS `previewFileUrl`,`fs`.`size` AS `size`,`fs`.`data_width` AS `width`,`fs`.`data_height` AS `height`,`fs`.`data_ratio` AS `ratio`,`fs`.`systemType` AS `systemType`,`f`.`status` AS `status`,`f`.`userID` AS `userID`,`f`.`createDate` AS `createDate`,`f`.`modifyDate` AS `modifyDate`,'file' AS `mainMediaType` from ((`cms__file` `f` join `cms__file_static` `fs` on(((`fs`.`fileID` = `f`.`fileID`) and (`fs`.`type` <> 'preview') and (`f`.`fileID` in (select `smd__organization_has_media`.`mediaID` from `smd__organization_has_media` where `smd__organization_has_media`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 63))) or (`fs`.`systemType` in ('generic','branded')))))) left join `cms__file` `fp` on((`fp`.`fileID` = `fs`.`previewFileID`)))) union (select `c`.`carouselID` AS `mediaID`,'carousel' AS `mediaType`,`c`.`socialChannel` AS `socialChannel`,'carousel' AS `mime`,`c`.`name` AS `mediaName`,`c`.`url` AS `url`,NULL AS `previewFileUrl`,NULL AS `size`,NULL AS `width`,NULL AS `height`,NULL AS `ratio`,`c`.`systemType` AS `systemType`,`c`.`status` AS `status`,`c`.`userID` AS `userID`,`c`.`createDate` AS `createDate`,`c`.`modifyDate` AS `modifyDate`,'carousel' AS `mainMediaType` from `smd__carousel` `c`) ;

-- --------------------------------------------------------

--
-- Structure for view `view__all_media_64`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__all_media_64`  AS  (select `f`.`fileID` AS `mediaID`,`fs`.`type` AS `mediaType`,`fs`.`socialChannel` AS `socialChannel`,`fs`.`mime` AS `mime`,`f`.`name` AS `mediaName`,`f`.`url` AS `url`,`fp`.`url` AS `previewFileUrl`,`fs`.`size` AS `size`,`fs`.`data_width` AS `width`,`fs`.`data_height` AS `height`,`fs`.`data_ratio` AS `ratio`,`fs`.`systemType` AS `systemType`,`f`.`status` AS `status`,`f`.`userID` AS `userID`,`f`.`createDate` AS `createDate`,`f`.`modifyDate` AS `modifyDate`,'file' AS `mainMediaType` from ((`cms__file` `f` join `cms__file_static` `fs` on(((`fs`.`fileID` = `f`.`fileID`) and (`fs`.`type` <> 'preview') and (`f`.`fileID` in (select `smd__organization_has_media`.`mediaID` from `smd__organization_has_media` where `smd__organization_has_media`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 64))) or (`fs`.`systemType` in ('generic','branded')))))) left join `cms__file` `fp` on((`fp`.`fileID` = `fs`.`previewFileID`)))) union (select `c`.`carouselID` AS `mediaID`,'carousel' AS `mediaType`,`c`.`socialChannel` AS `socialChannel`,'carousel' AS `mime`,`c`.`name` AS `mediaName`,`c`.`url` AS `url`,NULL AS `previewFileUrl`,NULL AS `size`,NULL AS `width`,NULL AS `height`,NULL AS `ratio`,`c`.`systemType` AS `systemType`,`c`.`status` AS `status`,`c`.`userID` AS `userID`,`c`.`createDate` AS `createDate`,`c`.`modifyDate` AS `modifyDate`,'carousel' AS `mainMediaType` from `smd__carousel` `c`) ;

-- --------------------------------------------------------

--
-- Structure for view `view__all_media_65`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__all_media_65`  AS  (select `f`.`fileID` AS `mediaID`,`fs`.`type` AS `mediaType`,`fs`.`socialChannel` AS `socialChannel`,`fs`.`mime` AS `mime`,`f`.`name` AS `mediaName`,`f`.`url` AS `url`,`fp`.`url` AS `previewFileUrl`,`fs`.`size` AS `size`,`fs`.`data_width` AS `width`,`fs`.`data_height` AS `height`,`fs`.`data_ratio` AS `ratio`,`fs`.`systemType` AS `systemType`,`f`.`status` AS `status`,`f`.`userID` AS `userID`,`f`.`createDate` AS `createDate`,`f`.`modifyDate` AS `modifyDate`,'file' AS `mainMediaType` from ((`cms__file` `f` join `cms__file_static` `fs` on(((`fs`.`fileID` = `f`.`fileID`) and (`fs`.`type` <> 'preview') and (`f`.`fileID` in (select `smd__organization_has_media`.`mediaID` from `smd__organization_has_media` where `smd__organization_has_media`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 65))) or (`fs`.`systemType` in ('generic','branded')))))) left join `cms__file` `fp` on((`fp`.`fileID` = `fs`.`previewFileID`)))) union (select `c`.`carouselID` AS `mediaID`,'carousel' AS `mediaType`,`c`.`socialChannel` AS `socialChannel`,'carousel' AS `mime`,`c`.`name` AS `mediaName`,`c`.`url` AS `url`,NULL AS `previewFileUrl`,NULL AS `size`,NULL AS `width`,NULL AS `height`,NULL AS `ratio`,`c`.`systemType` AS `systemType`,`c`.`status` AS `status`,`c`.`userID` AS `userID`,`c`.`createDate` AS `createDate`,`c`.`modifyDate` AS `modifyDate`,'carousel' AS `mainMediaType` from `smd__carousel` `c`) ;

-- --------------------------------------------------------

--
-- Structure for view `view__all_media_66`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__all_media_66`  AS  (select `f`.`fileID` AS `mediaID`,`fs`.`type` AS `mediaType`,`fs`.`socialChannel` AS `socialChannel`,`fs`.`mime` AS `mime`,`f`.`name` AS `mediaName`,`f`.`url` AS `url`,`fp`.`url` AS `previewFileUrl`,`fs`.`size` AS `size`,`fs`.`data_width` AS `width`,`fs`.`data_height` AS `height`,`fs`.`data_ratio` AS `ratio`,`fs`.`systemType` AS `systemType`,`f`.`status` AS `status`,`f`.`userID` AS `userID`,`f`.`createDate` AS `createDate`,`f`.`modifyDate` AS `modifyDate`,'file' AS `mainMediaType` from ((`cms__file` `f` join `cms__file_static` `fs` on(((`fs`.`fileID` = `f`.`fileID`) and (`fs`.`type` <> 'preview') and (`f`.`fileID` in (select `smd__organization_has_media`.`mediaID` from `smd__organization_has_media` where `smd__organization_has_media`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 66))) or (`fs`.`systemType` in ('generic','branded')))))) left join `cms__file` `fp` on((`fp`.`fileID` = `fs`.`previewFileID`)))) union (select `c`.`carouselID` AS `mediaID`,'carousel' AS `mediaType`,`c`.`socialChannel` AS `socialChannel`,'carousel' AS `mime`,`c`.`name` AS `mediaName`,`c`.`url` AS `url`,NULL AS `previewFileUrl`,NULL AS `size`,NULL AS `width`,NULL AS `height`,NULL AS `ratio`,`c`.`systemType` AS `systemType`,`c`.`status` AS `status`,`c`.`userID` AS `userID`,`c`.`createDate` AS `createDate`,`c`.`modifyDate` AS `modifyDate`,'carousel' AS `mainMediaType` from `smd__carousel` `c`) ;

-- --------------------------------------------------------

--
-- Structure for view `view__all_media_67`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__all_media_67`  AS  (select `f`.`fileID` AS `mediaID`,`fs`.`type` AS `mediaType`,`fs`.`socialChannel` AS `socialChannel`,`fs`.`mime` AS `mime`,`f`.`name` AS `mediaName`,`f`.`url` AS `url`,`fp`.`url` AS `previewFileUrl`,`fs`.`size` AS `size`,`fs`.`data_width` AS `width`,`fs`.`data_height` AS `height`,`fs`.`data_ratio` AS `ratio`,`fs`.`systemType` AS `systemType`,`f`.`status` AS `status`,`f`.`userID` AS `userID`,`f`.`createDate` AS `createDate`,`f`.`modifyDate` AS `modifyDate`,'file' AS `mainMediaType` from ((`cms__file` `f` join `cms__file_static` `fs` on(((`fs`.`fileID` = `f`.`fileID`) and (`fs`.`type` <> 'preview') and (`f`.`fileID` in (select `smd__organization_has_media`.`mediaID` from `smd__organization_has_media` where `smd__organization_has_media`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 67))) or (`fs`.`systemType` in ('generic','branded')))))) left join `cms__file` `fp` on((`fp`.`fileID` = `fs`.`previewFileID`)))) union (select `c`.`carouselID` AS `mediaID`,'carousel' AS `mediaType`,`c`.`socialChannel` AS `socialChannel`,'carousel' AS `mime`,`c`.`name` AS `mediaName`,`c`.`url` AS `url`,NULL AS `previewFileUrl`,NULL AS `size`,NULL AS `width`,NULL AS `height`,NULL AS `ratio`,`c`.`systemType` AS `systemType`,`c`.`status` AS `status`,`c`.`userID` AS `userID`,`c`.`createDate` AS `createDate`,`c`.`modifyDate` AS `modifyDate`,'carousel' AS `mainMediaType` from `smd__carousel` `c`) ;

-- --------------------------------------------------------

--
-- Structure for view `view__all_media_68`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__all_media_68`  AS  (select `f`.`fileID` AS `mediaID`,`fs`.`type` AS `mediaType`,`fs`.`socialChannel` AS `socialChannel`,`fs`.`mime` AS `mime`,`f`.`name` AS `mediaName`,`f`.`url` AS `url`,`fp`.`url` AS `previewFileUrl`,`fs`.`size` AS `size`,`fs`.`data_width` AS `width`,`fs`.`data_height` AS `height`,`fs`.`data_ratio` AS `ratio`,`fs`.`systemType` AS `systemType`,`f`.`status` AS `status`,`f`.`userID` AS `userID`,`f`.`createDate` AS `createDate`,`f`.`modifyDate` AS `modifyDate`,'file' AS `mainMediaType` from ((`cms__file` `f` join `cms__file_static` `fs` on(((`fs`.`fileID` = `f`.`fileID`) and (`fs`.`type` <> 'preview') and (`f`.`fileID` in (select `smd__organization_has_media`.`mediaID` from `smd__organization_has_media` where `smd__organization_has_media`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 68))) or (`fs`.`systemType` in ('generic','branded')))))) left join `cms__file` `fp` on((`fp`.`fileID` = `fs`.`previewFileID`)))) union (select `c`.`carouselID` AS `mediaID`,'carousel' AS `mediaType`,`c`.`socialChannel` AS `socialChannel`,'carousel' AS `mime`,`c`.`name` AS `mediaName`,`c`.`url` AS `url`,NULL AS `previewFileUrl`,NULL AS `size`,NULL AS `width`,NULL AS `height`,NULL AS `ratio`,`c`.`systemType` AS `systemType`,`c`.`status` AS `status`,`c`.`userID` AS `userID`,`c`.`createDate` AS `createDate`,`c`.`modifyDate` AS `modifyDate`,'carousel' AS `mainMediaType` from `smd__carousel` `c`) ;

-- --------------------------------------------------------

--
-- Structure for view `view__all_media_69`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__all_media_69`  AS  (select `f`.`fileID` AS `mediaID`,`fs`.`type` AS `mediaType`,`fs`.`socialChannel` AS `socialChannel`,`fs`.`mime` AS `mime`,`f`.`name` AS `mediaName`,`f`.`url` AS `url`,`fp`.`url` AS `previewFileUrl`,`fs`.`size` AS `size`,`fs`.`data_width` AS `width`,`fs`.`data_height` AS `height`,`fs`.`data_ratio` AS `ratio`,`fs`.`systemType` AS `systemType`,`f`.`status` AS `status`,`f`.`userID` AS `userID`,`f`.`createDate` AS `createDate`,`f`.`modifyDate` AS `modifyDate`,'file' AS `mainMediaType` from ((`cms__file` `f` join `cms__file_static` `fs` on(((`fs`.`fileID` = `f`.`fileID`) and (`fs`.`type` <> 'preview') and (`f`.`fileID` in (select `smd__organization_has_media`.`mediaID` from `smd__organization_has_media` where `smd__organization_has_media`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 69))) or (`fs`.`systemType` in ('generic','branded')))))) left join `cms__file` `fp` on((`fp`.`fileID` = `fs`.`previewFileID`)))) union (select `c`.`carouselID` AS `mediaID`,'carousel' AS `mediaType`,`c`.`socialChannel` AS `socialChannel`,'carousel' AS `mime`,`c`.`name` AS `mediaName`,`c`.`url` AS `url`,NULL AS `previewFileUrl`,NULL AS `size`,NULL AS `width`,NULL AS `height`,NULL AS `ratio`,`c`.`systemType` AS `systemType`,`c`.`status` AS `status`,`c`.`userID` AS `userID`,`c`.`createDate` AS `createDate`,`c`.`modifyDate` AS `modifyDate`,'carousel' AS `mainMediaType` from `smd__carousel` `c`) ;

-- --------------------------------------------------------

--
-- Structure for view `view__all_media_70`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__all_media_70`  AS  (select `f`.`fileID` AS `mediaID`,`fs`.`type` AS `mediaType`,`fs`.`socialChannel` AS `socialChannel`,`fs`.`mime` AS `mime`,`f`.`name` AS `mediaName`,`f`.`url` AS `url`,`fp`.`url` AS `previewFileUrl`,`fs`.`size` AS `size`,`fs`.`data_width` AS `width`,`fs`.`data_height` AS `height`,`fs`.`data_ratio` AS `ratio`,`fs`.`systemType` AS `systemType`,`f`.`status` AS `status`,`f`.`userID` AS `userID`,`f`.`createDate` AS `createDate`,`f`.`modifyDate` AS `modifyDate`,'file' AS `mainMediaType` from ((`cms__file` `f` join `cms__file_static` `fs` on(((`fs`.`fileID` = `f`.`fileID`) and (`fs`.`type` <> 'preview') and (`f`.`fileID` in (select `smd__organization_has_media`.`mediaID` from `smd__organization_has_media` where `smd__organization_has_media`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 70))) or (`fs`.`systemType` in ('generic','branded')))))) left join `cms__file` `fp` on((`fp`.`fileID` = `fs`.`previewFileID`)))) union (select `c`.`carouselID` AS `mediaID`,'carousel' AS `mediaType`,`c`.`socialChannel` AS `socialChannel`,'carousel' AS `mime`,`c`.`name` AS `mediaName`,`c`.`url` AS `url`,NULL AS `previewFileUrl`,NULL AS `size`,NULL AS `width`,NULL AS `height`,NULL AS `ratio`,`c`.`systemType` AS `systemType`,`c`.`status` AS `status`,`c`.`userID` AS `userID`,`c`.`createDate` AS `createDate`,`c`.`modifyDate` AS `modifyDate`,'carousel' AS `mainMediaType` from `smd__carousel` `c`) ;

-- --------------------------------------------------------

--
-- Structure for view `view__all_media_71`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__all_media_71`  AS  (select `f`.`fileID` AS `mediaID`,`fs`.`type` AS `mediaType`,`fs`.`socialChannel` AS `socialChannel`,`fs`.`mime` AS `mime`,`f`.`name` AS `mediaName`,`f`.`url` AS `url`,`fp`.`url` AS `previewFileUrl`,`fs`.`size` AS `size`,`fs`.`data_width` AS `width`,`fs`.`data_height` AS `height`,`fs`.`data_ratio` AS `ratio`,`fs`.`systemType` AS `systemType`,`f`.`status` AS `status`,`f`.`userID` AS `userID`,`f`.`createDate` AS `createDate`,`f`.`modifyDate` AS `modifyDate`,'file' AS `mainMediaType` from ((`cms__file` `f` join `cms__file_static` `fs` on(((`fs`.`fileID` = `f`.`fileID`) and (`fs`.`type` <> 'preview') and (`f`.`fileID` in (select `smd__organization_has_media`.`mediaID` from `smd__organization_has_media` where `smd__organization_has_media`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 71))) or (`fs`.`systemType` in ('generic','branded')))))) left join `cms__file` `fp` on((`fp`.`fileID` = `fs`.`previewFileID`)))) union (select `c`.`carouselID` AS `mediaID`,'carousel' AS `mediaType`,`c`.`socialChannel` AS `socialChannel`,'carousel' AS `mime`,`c`.`name` AS `mediaName`,`c`.`url` AS `url`,NULL AS `previewFileUrl`,NULL AS `size`,NULL AS `width`,NULL AS `height`,NULL AS `ratio`,`c`.`systemType` AS `systemType`,`c`.`status` AS `status`,`c`.`userID` AS `userID`,`c`.`createDate` AS `createDate`,`c`.`modifyDate` AS `modifyDate`,'carousel' AS `mainMediaType` from `smd__carousel` `c`) ;

-- --------------------------------------------------------

--
-- Structure for view `view__all_media_72`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__all_media_72`  AS  (select `f`.`fileID` AS `mediaID`,`fs`.`type` AS `mediaType`,`fs`.`socialChannel` AS `socialChannel`,`fs`.`mime` AS `mime`,`f`.`name` AS `mediaName`,`f`.`url` AS `url`,`fp`.`url` AS `previewFileUrl`,`fs`.`size` AS `size`,`fs`.`data_width` AS `width`,`fs`.`data_height` AS `height`,`fs`.`data_ratio` AS `ratio`,`fs`.`systemType` AS `systemType`,`f`.`status` AS `status`,`f`.`userID` AS `userID`,`f`.`createDate` AS `createDate`,`f`.`modifyDate` AS `modifyDate`,'file' AS `mainMediaType` from ((`cms__file` `f` join `cms__file_static` `fs` on(((`fs`.`fileID` = `f`.`fileID`) and (`fs`.`type` <> 'preview') and (`f`.`fileID` in (select `smd__organization_has_media`.`mediaID` from `smd__organization_has_media` where `smd__organization_has_media`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 72))) or (`fs`.`systemType` in ('generic','branded')))))) left join `cms__file` `fp` on((`fp`.`fileID` = `fs`.`previewFileID`)))) union (select `c`.`carouselID` AS `mediaID`,'carousel' AS `mediaType`,`c`.`socialChannel` AS `socialChannel`,'carousel' AS `mime`,`c`.`name` AS `mediaName`,`c`.`url` AS `url`,NULL AS `previewFileUrl`,NULL AS `size`,NULL AS `width`,NULL AS `height`,NULL AS `ratio`,`c`.`systemType` AS `systemType`,`c`.`status` AS `status`,`c`.`userID` AS `userID`,`c`.`createDate` AS `createDate`,`c`.`modifyDate` AS `modifyDate`,'carousel' AS `mainMediaType` from `smd__carousel` `c`) ;

-- --------------------------------------------------------

--
-- Structure for view `view__all_media_73`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__all_media_73`  AS  (select `f`.`fileID` AS `mediaID`,`fs`.`type` AS `mediaType`,`fs`.`socialChannel` AS `socialChannel`,`fs`.`mime` AS `mime`,`f`.`name` AS `mediaName`,`f`.`url` AS `url`,`fp`.`url` AS `previewFileUrl`,`fs`.`size` AS `size`,`fs`.`data_width` AS `width`,`fs`.`data_height` AS `height`,`fs`.`data_ratio` AS `ratio`,`fs`.`systemType` AS `systemType`,`f`.`status` AS `status`,`f`.`userID` AS `userID`,`f`.`createDate` AS `createDate`,`f`.`modifyDate` AS `modifyDate`,'file' AS `mainMediaType` from ((`cms__file` `f` join `cms__file_static` `fs` on(((`fs`.`fileID` = `f`.`fileID`) and (`fs`.`type` <> 'preview') and (`f`.`fileID` in (select `smd__organization_has_media`.`mediaID` from `smd__organization_has_media` where `smd__organization_has_media`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 73))) or (`fs`.`systemType` in ('generic','branded')))))) left join `cms__file` `fp` on((`fp`.`fileID` = `fs`.`previewFileID`)))) union (select `c`.`carouselID` AS `mediaID`,'carousel' AS `mediaType`,`c`.`socialChannel` AS `socialChannel`,'carousel' AS `mime`,`c`.`name` AS `mediaName`,`c`.`url` AS `url`,NULL AS `previewFileUrl`,NULL AS `size`,NULL AS `width`,NULL AS `height`,NULL AS `ratio`,`c`.`systemType` AS `systemType`,`c`.`status` AS `status`,`c`.`userID` AS `userID`,`c`.`createDate` AS `createDate`,`c`.`modifyDate` AS `modifyDate`,'carousel' AS `mainMediaType` from `smd__carousel` `c`) ;

-- --------------------------------------------------------

--
-- Structure for view `view__all_media_74`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__all_media_74`  AS  (select `f`.`fileID` AS `mediaID`,`fs`.`type` AS `mediaType`,`fs`.`socialChannel` AS `socialChannel`,`fs`.`mime` AS `mime`,`f`.`name` AS `mediaName`,`f`.`url` AS `url`,`fp`.`url` AS `previewFileUrl`,`fs`.`size` AS `size`,`fs`.`data_width` AS `width`,`fs`.`data_height` AS `height`,`fs`.`data_ratio` AS `ratio`,`fs`.`systemType` AS `systemType`,`f`.`status` AS `status`,`f`.`userID` AS `userID`,`f`.`createDate` AS `createDate`,`f`.`modifyDate` AS `modifyDate`,'file' AS `mainMediaType` from ((`cms__file` `f` join `cms__file_static` `fs` on(((`fs`.`fileID` = `f`.`fileID`) and (`fs`.`type` <> 'preview') and (`f`.`fileID` in (select `smd__organization_has_media`.`mediaID` from `smd__organization_has_media` where `smd__organization_has_media`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 74))) or (`fs`.`systemType` in ('generic','branded')))))) left join `cms__file` `fp` on((`fp`.`fileID` = `fs`.`previewFileID`)))) union (select `c`.`carouselID` AS `mediaID`,'carousel' AS `mediaType`,`c`.`socialChannel` AS `socialChannel`,'carousel' AS `mime`,`c`.`name` AS `mediaName`,`c`.`url` AS `url`,NULL AS `previewFileUrl`,NULL AS `size`,NULL AS `width`,NULL AS `height`,NULL AS `ratio`,`c`.`systemType` AS `systemType`,`c`.`status` AS `status`,`c`.`userID` AS `userID`,`c`.`createDate` AS `createDate`,`c`.`modifyDate` AS `modifyDate`,'carousel' AS `mainMediaType` from `smd__carousel` `c`) ;

-- --------------------------------------------------------

--
-- Structure for view `view__all_media_75`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__all_media_75`  AS  (select `f`.`fileID` AS `mediaID`,`fs`.`type` AS `mediaType`,`fs`.`socialChannel` AS `socialChannel`,`fs`.`mime` AS `mime`,`f`.`name` AS `mediaName`,`f`.`url` AS `url`,`fp`.`url` AS `previewFileUrl`,`fs`.`size` AS `size`,`fs`.`data_width` AS `width`,`fs`.`data_height` AS `height`,`fs`.`data_ratio` AS `ratio`,`fs`.`systemType` AS `systemType`,`f`.`status` AS `status`,`f`.`userID` AS `userID`,`f`.`createDate` AS `createDate`,`f`.`modifyDate` AS `modifyDate`,'file' AS `mainMediaType` from ((`cms__file` `f` join `cms__file_static` `fs` on(((`fs`.`fileID` = `f`.`fileID`) and (`fs`.`type` <> 'preview') and (`f`.`fileID` in (select `smd__organization_has_media`.`mediaID` from `smd__organization_has_media` where `smd__organization_has_media`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 75))) or (`fs`.`systemType` in ('generic','branded')))))) left join `cms__file` `fp` on((`fp`.`fileID` = `fs`.`previewFileID`)))) union (select `c`.`carouselID` AS `mediaID`,'carousel' AS `mediaType`,`c`.`socialChannel` AS `socialChannel`,'carousel' AS `mime`,`c`.`name` AS `mediaName`,`c`.`url` AS `url`,NULL AS `previewFileUrl`,NULL AS `size`,NULL AS `width`,NULL AS `height`,NULL AS `ratio`,`c`.`systemType` AS `systemType`,`c`.`status` AS `status`,`c`.`userID` AS `userID`,`c`.`createDate` AS `createDate`,`c`.`modifyDate` AS `modifyDate`,'carousel' AS `mainMediaType` from `smd__carousel` `c`) ;

-- --------------------------------------------------------

--
-- Structure for view `view__all_media_76`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__all_media_76`  AS  (select `f`.`fileID` AS `mediaID`,`fs`.`type` AS `mediaType`,`fs`.`socialChannel` AS `socialChannel`,`fs`.`mime` AS `mime`,`f`.`name` AS `mediaName`,`f`.`url` AS `url`,`fp`.`url` AS `previewFileUrl`,`fs`.`size` AS `size`,`fs`.`data_width` AS `width`,`fs`.`data_height` AS `height`,`fs`.`data_ratio` AS `ratio`,`fs`.`systemType` AS `systemType`,`f`.`status` AS `status`,`f`.`userID` AS `userID`,`f`.`createDate` AS `createDate`,`f`.`modifyDate` AS `modifyDate`,'file' AS `mainMediaType` from ((`cms__file` `f` join `cms__file_static` `fs` on(((`fs`.`fileID` = `f`.`fileID`) and (`fs`.`type` <> 'preview') and (`f`.`fileID` in (select `smd__organization_has_media`.`mediaID` from `smd__organization_has_media` where `smd__organization_has_media`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 76))) or (`fs`.`systemType` in ('generic','branded')))))) left join `cms__file` `fp` on((`fp`.`fileID` = `fs`.`previewFileID`)))) union (select `c`.`carouselID` AS `mediaID`,'carousel' AS `mediaType`,`c`.`socialChannel` AS `socialChannel`,'carousel' AS `mime`,`c`.`name` AS `mediaName`,`c`.`url` AS `url`,NULL AS `previewFileUrl`,NULL AS `size`,NULL AS `width`,NULL AS `height`,NULL AS `ratio`,`c`.`systemType` AS `systemType`,`c`.`status` AS `status`,`c`.`userID` AS `userID`,`c`.`createDate` AS `createDate`,`c`.`modifyDate` AS `modifyDate`,'carousel' AS `mainMediaType` from `smd__carousel` `c`) ;

-- --------------------------------------------------------

--
-- Structure for view `view__all_media_77`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__all_media_77`  AS  (select `f`.`fileID` AS `mediaID`,`fs`.`type` AS `mediaType`,`fs`.`socialChannel` AS `socialChannel`,`fs`.`mime` AS `mime`,`f`.`name` AS `mediaName`,`f`.`url` AS `url`,`fp`.`url` AS `previewFileUrl`,`fs`.`size` AS `size`,`fs`.`data_width` AS `width`,`fs`.`data_height` AS `height`,`fs`.`data_ratio` AS `ratio`,`fs`.`systemType` AS `systemType`,`f`.`status` AS `status`,`f`.`userID` AS `userID`,`f`.`createDate` AS `createDate`,`f`.`modifyDate` AS `modifyDate`,'file' AS `mainMediaType` from ((`cms__file` `f` join `cms__file_static` `fs` on(((`fs`.`fileID` = `f`.`fileID`) and (`fs`.`type` <> 'preview') and (`f`.`fileID` in (select `smd__organization_has_media`.`mediaID` from `smd__organization_has_media` where `smd__organization_has_media`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 77))) or (`fs`.`systemType` in ('generic','branded')))))) left join `cms__file` `fp` on((`fp`.`fileID` = `fs`.`previewFileID`)))) union (select `c`.`carouselID` AS `mediaID`,'carousel' AS `mediaType`,`c`.`socialChannel` AS `socialChannel`,'carousel' AS `mime`,`c`.`name` AS `mediaName`,`c`.`url` AS `url`,NULL AS `previewFileUrl`,NULL AS `size`,NULL AS `width`,NULL AS `height`,NULL AS `ratio`,`c`.`systemType` AS `systemType`,`c`.`status` AS `status`,`c`.`userID` AS `userID`,`c`.`createDate` AS `createDate`,`c`.`modifyDate` AS `modifyDate`,'carousel' AS `mainMediaType` from `smd__carousel` `c`) ;

-- --------------------------------------------------------

--
-- Structure for view `view__all_media_78`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__all_media_78`  AS  (select `f`.`fileID` AS `mediaID`,`fs`.`type` AS `mediaType`,`fs`.`socialChannel` AS `socialChannel`,`fs`.`mime` AS `mime`,`f`.`name` AS `mediaName`,`f`.`url` AS `url`,`fp`.`url` AS `previewFileUrl`,`fs`.`size` AS `size`,`fs`.`data_width` AS `width`,`fs`.`data_height` AS `height`,`fs`.`data_ratio` AS `ratio`,`fs`.`systemType` AS `systemType`,`f`.`status` AS `status`,`f`.`userID` AS `userID`,`f`.`createDate` AS `createDate`,`f`.`modifyDate` AS `modifyDate`,'file' AS `mainMediaType` from ((`cms__file` `f` join `cms__file_static` `fs` on(((`fs`.`fileID` = `f`.`fileID`) and (`fs`.`type` <> 'preview') and (`f`.`fileID` in (select `smd__organization_has_media`.`mediaID` from `smd__organization_has_media` where `smd__organization_has_media`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 78))) or (`fs`.`systemType` in ('generic','branded')))))) left join `cms__file` `fp` on((`fp`.`fileID` = `fs`.`previewFileID`)))) union (select `c`.`carouselID` AS `mediaID`,'carousel' AS `mediaType`,`c`.`socialChannel` AS `socialChannel`,'carousel' AS `mime`,`c`.`name` AS `mediaName`,`c`.`url` AS `url`,NULL AS `previewFileUrl`,NULL AS `size`,NULL AS `width`,NULL AS `height`,NULL AS `ratio`,`c`.`systemType` AS `systemType`,`c`.`status` AS `status`,`c`.`userID` AS `userID`,`c`.`createDate` AS `createDate`,`c`.`modifyDate` AS `modifyDate`,'carousel' AS `mainMediaType` from `smd__carousel` `c`) ;

-- --------------------------------------------------------

--
-- Structure for view `view__all_media_79`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__all_media_79`  AS  (select `f`.`fileID` AS `mediaID`,`fs`.`type` AS `mediaType`,`fs`.`socialChannel` AS `socialChannel`,`fs`.`mime` AS `mime`,`f`.`name` AS `mediaName`,`f`.`url` AS `url`,`fp`.`url` AS `previewFileUrl`,`fs`.`size` AS `size`,`fs`.`data_width` AS `width`,`fs`.`data_height` AS `height`,`fs`.`data_ratio` AS `ratio`,`fs`.`systemType` AS `systemType`,`f`.`status` AS `status`,`f`.`userID` AS `userID`,`f`.`createDate` AS `createDate`,`f`.`modifyDate` AS `modifyDate`,'file' AS `mainMediaType` from ((`cms__file` `f` join `cms__file_static` `fs` on(((`fs`.`fileID` = `f`.`fileID`) and (`fs`.`type` <> 'preview') and (`f`.`fileID` in (select `smd__organization_has_media`.`mediaID` from `smd__organization_has_media` where `smd__organization_has_media`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 79))) or (`fs`.`systemType` in ('generic','branded')))))) left join `cms__file` `fp` on((`fp`.`fileID` = `fs`.`previewFileID`)))) union (select `c`.`carouselID` AS `mediaID`,'carousel' AS `mediaType`,`c`.`socialChannel` AS `socialChannel`,'carousel' AS `mime`,`c`.`name` AS `mediaName`,`c`.`url` AS `url`,NULL AS `previewFileUrl`,NULL AS `size`,NULL AS `width`,NULL AS `height`,NULL AS `ratio`,`c`.`systemType` AS `systemType`,`c`.`status` AS `status`,`c`.`userID` AS `userID`,`c`.`createDate` AS `createDate`,`c`.`modifyDate` AS `modifyDate`,'carousel' AS `mainMediaType` from `smd__carousel` `c`) ;

-- --------------------------------------------------------

--
-- Structure for view `view__all_media_80`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__all_media_80`  AS  (select `f`.`fileID` AS `mediaID`,`fs`.`type` AS `mediaType`,`fs`.`socialChannel` AS `socialChannel`,`fs`.`mime` AS `mime`,`f`.`name` AS `mediaName`,`f`.`url` AS `url`,`fp`.`url` AS `previewFileUrl`,`fs`.`size` AS `size`,`fs`.`data_width` AS `width`,`fs`.`data_height` AS `height`,`fs`.`data_ratio` AS `ratio`,`fs`.`systemType` AS `systemType`,`f`.`status` AS `status`,`f`.`userID` AS `userID`,`f`.`createDate` AS `createDate`,`f`.`modifyDate` AS `modifyDate`,'file' AS `mainMediaType` from ((`cms__file` `f` join `cms__file_static` `fs` on(((`fs`.`fileID` = `f`.`fileID`) and (`fs`.`type` <> 'preview') and (`f`.`fileID` in (select `smd__organization_has_media`.`mediaID` from `smd__organization_has_media` where `smd__organization_has_media`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 80))) or (`fs`.`systemType` in ('generic','branded')))))) left join `cms__file` `fp` on((`fp`.`fileID` = `fs`.`previewFileID`)))) union (select `c`.`carouselID` AS `mediaID`,'carousel' AS `mediaType`,`c`.`socialChannel` AS `socialChannel`,'carousel' AS `mime`,`c`.`name` AS `mediaName`,`c`.`url` AS `url`,NULL AS `previewFileUrl`,NULL AS `size`,NULL AS `width`,NULL AS `height`,NULL AS `ratio`,`c`.`systemType` AS `systemType`,`c`.`status` AS `status`,`c`.`userID` AS `userID`,`c`.`createDate` AS `createDate`,`c`.`modifyDate` AS `modifyDate`,'carousel' AS `mainMediaType` from `smd__carousel` `c`) ;

-- --------------------------------------------------------

--
-- Structure for view `view__all_media_81`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__all_media_81`  AS  (select `f`.`fileID` AS `mediaID`,`fs`.`type` AS `mediaType`,`fs`.`socialChannel` AS `socialChannel`,`fs`.`mime` AS `mime`,`f`.`name` AS `mediaName`,`f`.`url` AS `url`,`fp`.`url` AS `previewFileUrl`,`fs`.`size` AS `size`,`fs`.`data_width` AS `width`,`fs`.`data_height` AS `height`,`fs`.`data_ratio` AS `ratio`,`fs`.`systemType` AS `systemType`,`f`.`status` AS `status`,`f`.`userID` AS `userID`,`f`.`createDate` AS `createDate`,`f`.`modifyDate` AS `modifyDate`,'file' AS `mainMediaType` from ((`cms__file` `f` join `cms__file_static` `fs` on(((`fs`.`fileID` = `f`.`fileID`) and (`fs`.`type` <> 'preview') and (`f`.`fileID` in (select `smd__organization_has_media`.`mediaID` from `smd__organization_has_media` where `smd__organization_has_media`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 81))) or (`fs`.`systemType` in ('generic','branded')))))) left join `cms__file` `fp` on((`fp`.`fileID` = `fs`.`previewFileID`)))) union (select `c`.`carouselID` AS `mediaID`,'carousel' AS `mediaType`,`c`.`socialChannel` AS `socialChannel`,'carousel' AS `mime`,`c`.`name` AS `mediaName`,`c`.`url` AS `url`,NULL AS `previewFileUrl`,NULL AS `size`,NULL AS `width`,NULL AS `height`,NULL AS `ratio`,`c`.`systemType` AS `systemType`,`c`.`status` AS `status`,`c`.`userID` AS `userID`,`c`.`createDate` AS `createDate`,`c`.`modifyDate` AS `modifyDate`,'carousel' AS `mainMediaType` from `smd__carousel` `c`) ;

-- --------------------------------------------------------

--
-- Structure for view `view__all_media_82`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__all_media_82`  AS  (select `f`.`fileID` AS `mediaID`,`fs`.`type` AS `mediaType`,`fs`.`socialChannel` AS `socialChannel`,`fs`.`mime` AS `mime`,`f`.`name` AS `mediaName`,`f`.`url` AS `url`,`fp`.`url` AS `previewFileUrl`,`fs`.`size` AS `size`,`fs`.`data_width` AS `width`,`fs`.`data_height` AS `height`,`fs`.`data_ratio` AS `ratio`,`fs`.`systemType` AS `systemType`,`f`.`status` AS `status`,`f`.`userID` AS `userID`,`f`.`createDate` AS `createDate`,`f`.`modifyDate` AS `modifyDate`,'file' AS `mainMediaType` from ((`cms__file` `f` join `cms__file_static` `fs` on(((`fs`.`fileID` = `f`.`fileID`) and (`fs`.`type` <> 'preview') and (`f`.`fileID` in (select `smd__organization_has_media`.`mediaID` from `smd__organization_has_media` where `smd__organization_has_media`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 82))) or (`fs`.`systemType` in ('generic','branded')))))) left join `cms__file` `fp` on((`fp`.`fileID` = `fs`.`previewFileID`)))) union (select `c`.`carouselID` AS `mediaID`,'carousel' AS `mediaType`,`c`.`socialChannel` AS `socialChannel`,'carousel' AS `mime`,`c`.`name` AS `mediaName`,`c`.`url` AS `url`,NULL AS `previewFileUrl`,NULL AS `size`,NULL AS `width`,NULL AS `height`,NULL AS `ratio`,`c`.`systemType` AS `systemType`,`c`.`status` AS `status`,`c`.`userID` AS `userID`,`c`.`createDate` AS `createDate`,`c`.`modifyDate` AS `modifyDate`,'carousel' AS `mainMediaType` from `smd__carousel` `c`) ;

-- --------------------------------------------------------

--
-- Structure for view `view__all_media_83`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__all_media_83`  AS  (select `f`.`fileID` AS `mediaID`,`fs`.`type` AS `mediaType`,`fs`.`socialChannel` AS `socialChannel`,`fs`.`mime` AS `mime`,`f`.`name` AS `mediaName`,`f`.`url` AS `url`,`fp`.`url` AS `previewFileUrl`,`fs`.`size` AS `size`,`fs`.`data_width` AS `width`,`fs`.`data_height` AS `height`,`fs`.`data_ratio` AS `ratio`,`fs`.`systemType` AS `systemType`,`f`.`status` AS `status`,`f`.`userID` AS `userID`,`f`.`createDate` AS `createDate`,`f`.`modifyDate` AS `modifyDate`,'file' AS `mainMediaType` from ((`cms__file` `f` join `cms__file_static` `fs` on(((`fs`.`fileID` = `f`.`fileID`) and (`fs`.`type` <> 'preview') and (`f`.`fileID` in (select `smd__organization_has_media`.`mediaID` from `smd__organization_has_media` where `smd__organization_has_media`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 83))) or (`fs`.`systemType` in ('generic','branded')))))) left join `cms__file` `fp` on((`fp`.`fileID` = `fs`.`previewFileID`)))) union (select `c`.`carouselID` AS `mediaID`,'carousel' AS `mediaType`,`c`.`socialChannel` AS `socialChannel`,'carousel' AS `mime`,`c`.`name` AS `mediaName`,`c`.`url` AS `url`,NULL AS `previewFileUrl`,NULL AS `size`,NULL AS `width`,NULL AS `height`,NULL AS `ratio`,`c`.`systemType` AS `systemType`,`c`.`status` AS `status`,`c`.`userID` AS `userID`,`c`.`createDate` AS `createDate`,`c`.`modifyDate` AS `modifyDate`,'carousel' AS `mainMediaType` from `smd__carousel` `c`) ;

-- --------------------------------------------------------

--
-- Structure for view `view__all_media_84`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__all_media_84`  AS  (select `f`.`fileID` AS `mediaID`,`fs`.`type` AS `mediaType`,`fs`.`socialChannel` AS `socialChannel`,`fs`.`mime` AS `mime`,`f`.`name` AS `mediaName`,`f`.`url` AS `url`,`fp`.`url` AS `previewFileUrl`,`fs`.`size` AS `size`,`fs`.`data_width` AS `width`,`fs`.`data_height` AS `height`,`fs`.`data_ratio` AS `ratio`,`fs`.`systemType` AS `systemType`,`f`.`status` AS `status`,`f`.`userID` AS `userID`,`f`.`createDate` AS `createDate`,`f`.`modifyDate` AS `modifyDate`,'file' AS `mainMediaType` from ((`cms__file` `f` join `cms__file_static` `fs` on(((`fs`.`fileID` = `f`.`fileID`) and (`fs`.`type` <> 'preview') and (`f`.`fileID` in (select `smd__organization_has_media`.`mediaID` from `smd__organization_has_media` where `smd__organization_has_media`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 84))) or (`fs`.`systemType` in ('generic','branded')))))) left join `cms__file` `fp` on((`fp`.`fileID` = `fs`.`previewFileID`)))) union (select `c`.`carouselID` AS `mediaID`,'carousel' AS `mediaType`,`c`.`socialChannel` AS `socialChannel`,'carousel' AS `mime`,`c`.`name` AS `mediaName`,`c`.`url` AS `url`,NULL AS `previewFileUrl`,NULL AS `size`,NULL AS `width`,NULL AS `height`,NULL AS `ratio`,`c`.`systemType` AS `systemType`,`c`.`status` AS `status`,`c`.`userID` AS `userID`,`c`.`createDate` AS `createDate`,`c`.`modifyDate` AS `modifyDate`,'carousel' AS `mainMediaType` from `smd__carousel` `c`) ;

-- --------------------------------------------------------

--
-- Structure for view `view__all_media_85`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__all_media_85`  AS  (select `f`.`fileID` AS `mediaID`,`fs`.`type` AS `mediaType`,`fs`.`socialChannel` AS `socialChannel`,`fs`.`mime` AS `mime`,`f`.`name` AS `mediaName`,`f`.`url` AS `url`,`fp`.`url` AS `previewFileUrl`,`fs`.`size` AS `size`,`fs`.`data_width` AS `width`,`fs`.`data_height` AS `height`,`fs`.`data_ratio` AS `ratio`,`fs`.`systemType` AS `systemType`,`f`.`status` AS `status`,`f`.`userID` AS `userID`,`f`.`createDate` AS `createDate`,`f`.`modifyDate` AS `modifyDate`,'file' AS `mainMediaType` from ((`cms__file` `f` join `cms__file_static` `fs` on(((`fs`.`fileID` = `f`.`fileID`) and (`fs`.`type` <> 'preview') and (`f`.`fileID` in (select `smd__organization_has_media`.`mediaID` from `smd__organization_has_media` where `smd__organization_has_media`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 85))) or (`fs`.`systemType` in ('generic','branded')))))) left join `cms__file` `fp` on((`fp`.`fileID` = `fs`.`previewFileID`)))) union (select `c`.`carouselID` AS `mediaID`,'carousel' AS `mediaType`,`c`.`socialChannel` AS `socialChannel`,'carousel' AS `mime`,`c`.`name` AS `mediaName`,`c`.`url` AS `url`,NULL AS `previewFileUrl`,NULL AS `size`,NULL AS `width`,NULL AS `height`,NULL AS `ratio`,`c`.`systemType` AS `systemType`,`c`.`status` AS `status`,`c`.`userID` AS `userID`,`c`.`createDate` AS `createDate`,`c`.`modifyDate` AS `modifyDate`,'carousel' AS `mainMediaType` from `smd__carousel` `c`) ;

-- --------------------------------------------------------

--
-- Structure for view `view__all_media_86`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__all_media_86`  AS  (select `f`.`fileID` AS `mediaID`,`fs`.`type` AS `mediaType`,`fs`.`socialChannel` AS `socialChannel`,`fs`.`mime` AS `mime`,`f`.`name` AS `mediaName`,`f`.`url` AS `url`,`fp`.`url` AS `previewFileUrl`,`fs`.`size` AS `size`,`fs`.`data_width` AS `width`,`fs`.`data_height` AS `height`,`fs`.`data_ratio` AS `ratio`,`fs`.`systemType` AS `systemType`,`f`.`status` AS `status`,`f`.`userID` AS `userID`,`f`.`createDate` AS `createDate`,`f`.`modifyDate` AS `modifyDate`,'file' AS `mainMediaType` from ((`cms__file` `f` join `cms__file_static` `fs` on(((`fs`.`fileID` = `f`.`fileID`) and (`fs`.`type` <> 'preview') and (`f`.`fileID` in (select `smd__organization_has_media`.`mediaID` from `smd__organization_has_media` where `smd__organization_has_media`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 86))) or (`fs`.`systemType` in ('generic','branded')))))) left join `cms__file` `fp` on((`fp`.`fileID` = `fs`.`previewFileID`)))) union (select `c`.`carouselID` AS `mediaID`,'carousel' AS `mediaType`,`c`.`socialChannel` AS `socialChannel`,'carousel' AS `mime`,`c`.`name` AS `mediaName`,`c`.`url` AS `url`,NULL AS `previewFileUrl`,NULL AS `size`,NULL AS `width`,NULL AS `height`,NULL AS `ratio`,`c`.`systemType` AS `systemType`,`c`.`status` AS `status`,`c`.`userID` AS `userID`,`c`.`createDate` AS `createDate`,`c`.`modifyDate` AS `modifyDate`,'carousel' AS `mainMediaType` from `smd__carousel` `c`) ;

-- --------------------------------------------------------

--
-- Structure for view `view__all_media_87`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__all_media_87`  AS  (select `f`.`fileID` AS `mediaID`,`fs`.`type` AS `mediaType`,`fs`.`socialChannel` AS `socialChannel`,`fs`.`mime` AS `mime`,`f`.`name` AS `mediaName`,`f`.`url` AS `url`,`fp`.`url` AS `previewFileUrl`,`fs`.`size` AS `size`,`fs`.`data_width` AS `width`,`fs`.`data_height` AS `height`,`fs`.`data_ratio` AS `ratio`,`fs`.`systemType` AS `systemType`,`f`.`status` AS `status`,`f`.`userID` AS `userID`,`f`.`createDate` AS `createDate`,`f`.`modifyDate` AS `modifyDate`,'file' AS `mainMediaType` from ((`cms__file` `f` join `cms__file_static` `fs` on(((`fs`.`fileID` = `f`.`fileID`) and (`fs`.`type` <> 'preview') and (`f`.`fileID` in (select `smd__organization_has_media`.`mediaID` from `smd__organization_has_media` where `smd__organization_has_media`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 87))) or (`fs`.`systemType` in ('generic','branded')))))) left join `cms__file` `fp` on((`fp`.`fileID` = `fs`.`previewFileID`)))) union (select `c`.`carouselID` AS `mediaID`,'carousel' AS `mediaType`,`c`.`socialChannel` AS `socialChannel`,'carousel' AS `mime`,`c`.`name` AS `mediaName`,`c`.`url` AS `url`,NULL AS `previewFileUrl`,NULL AS `size`,NULL AS `width`,NULL AS `height`,NULL AS `ratio`,`c`.`systemType` AS `systemType`,`c`.`status` AS `status`,`c`.`userID` AS `userID`,`c`.`createDate` AS `createDate`,`c`.`modifyDate` AS `modifyDate`,'carousel' AS `mainMediaType` from `smd__carousel` `c`) ;

-- --------------------------------------------------------

--
-- Structure for view `view__all_media_88`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__all_media_88`  AS  (select `f`.`fileID` AS `mediaID`,`fs`.`type` AS `mediaType`,`fs`.`socialChannel` AS `socialChannel`,`fs`.`mime` AS `mime`,`f`.`name` AS `mediaName`,`f`.`url` AS `url`,`fp`.`url` AS `previewFileUrl`,`fs`.`size` AS `size`,`fs`.`data_width` AS `width`,`fs`.`data_height` AS `height`,`fs`.`data_ratio` AS `ratio`,`fs`.`systemType` AS `systemType`,`f`.`status` AS `status`,`f`.`userID` AS `userID`,`f`.`createDate` AS `createDate`,`f`.`modifyDate` AS `modifyDate`,'file' AS `mainMediaType` from ((`cms__file` `f` join `cms__file_static` `fs` on(((`fs`.`fileID` = `f`.`fileID`) and (`fs`.`type` <> 'preview') and (`f`.`fileID` in (select `smd__organization_has_media`.`mediaID` from `smd__organization_has_media` where `smd__organization_has_media`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 88))) or (`fs`.`systemType` in ('generic','branded')))))) left join `cms__file` `fp` on((`fp`.`fileID` = `fs`.`previewFileID`)))) union (select `c`.`carouselID` AS `mediaID`,'carousel' AS `mediaType`,`c`.`socialChannel` AS `socialChannel`,'carousel' AS `mime`,`c`.`name` AS `mediaName`,`c`.`url` AS `url`,NULL AS `previewFileUrl`,NULL AS `size`,NULL AS `width`,NULL AS `height`,NULL AS `ratio`,`c`.`systemType` AS `systemType`,`c`.`status` AS `status`,`c`.`userID` AS `userID`,`c`.`createDate` AS `createDate`,`c`.`modifyDate` AS `modifyDate`,'carousel' AS `mainMediaType` from `smd__carousel` `c`) ;

-- --------------------------------------------------------

--
-- Structure for view `view__all_media_89`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__all_media_89`  AS  (select `f`.`fileID` AS `mediaID`,`fs`.`type` AS `mediaType`,`fs`.`socialChannel` AS `socialChannel`,`fs`.`mime` AS `mime`,`f`.`name` AS `mediaName`,`f`.`url` AS `url`,`fp`.`url` AS `previewFileUrl`,`fs`.`size` AS `size`,`fs`.`data_width` AS `width`,`fs`.`data_height` AS `height`,`fs`.`data_ratio` AS `ratio`,`fs`.`systemType` AS `systemType`,`f`.`status` AS `status`,`f`.`userID` AS `userID`,`f`.`createDate` AS `createDate`,`f`.`modifyDate` AS `modifyDate`,'file' AS `mainMediaType` from ((`cms__file` `f` join `cms__file_static` `fs` on(((`fs`.`fileID` = `f`.`fileID`) and (`fs`.`type` <> 'preview') and (`f`.`fileID` in (select `smd__organization_has_media`.`mediaID` from `smd__organization_has_media` where `smd__organization_has_media`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 89))) or (`fs`.`systemType` in ('generic','branded')))))) left join `cms__file` `fp` on((`fp`.`fileID` = `fs`.`previewFileID`)))) union (select `c`.`carouselID` AS `mediaID`,'carousel' AS `mediaType`,`c`.`socialChannel` AS `socialChannel`,'carousel' AS `mime`,`c`.`name` AS `mediaName`,`c`.`url` AS `url`,NULL AS `previewFileUrl`,NULL AS `size`,NULL AS `width`,NULL AS `height`,NULL AS `ratio`,`c`.`systemType` AS `systemType`,`c`.`status` AS `status`,`c`.`userID` AS `userID`,`c`.`createDate` AS `createDate`,`c`.`modifyDate` AS `modifyDate`,'carousel' AS `mainMediaType` from `smd__carousel` `c`) ;

-- --------------------------------------------------------

--
-- Structure for view `view__all_media_90`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__all_media_90`  AS  (select `f`.`fileID` AS `mediaID`,`fs`.`type` AS `mediaType`,`fs`.`socialChannel` AS `socialChannel`,`fs`.`mime` AS `mime`,`f`.`name` AS `mediaName`,`f`.`url` AS `url`,`fp`.`url` AS `previewFileUrl`,`fs`.`size` AS `size`,`fs`.`data_width` AS `width`,`fs`.`data_height` AS `height`,`fs`.`data_ratio` AS `ratio`,`fs`.`systemType` AS `systemType`,`f`.`status` AS `status`,`f`.`userID` AS `userID`,`f`.`createDate` AS `createDate`,`f`.`modifyDate` AS `modifyDate`,'file' AS `mainMediaType` from ((`cms__file` `f` join `cms__file_static` `fs` on(((`fs`.`fileID` = `f`.`fileID`) and (`fs`.`type` <> 'preview') and (`f`.`fileID` in (select `smd__organization_has_media`.`mediaID` from `smd__organization_has_media` where `smd__organization_has_media`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 90))) or (`fs`.`systemType` in ('generic','branded')))))) left join `cms__file` `fp` on((`fp`.`fileID` = `fs`.`previewFileID`)))) union (select `c`.`carouselID` AS `mediaID`,'carousel' AS `mediaType`,`c`.`socialChannel` AS `socialChannel`,'carousel' AS `mime`,`c`.`name` AS `mediaName`,`c`.`url` AS `url`,NULL AS `previewFileUrl`,NULL AS `size`,NULL AS `width`,NULL AS `height`,NULL AS `ratio`,`c`.`systemType` AS `systemType`,`c`.`status` AS `status`,`c`.`userID` AS `userID`,`c`.`createDate` AS `createDate`,`c`.`modifyDate` AS `modifyDate`,'carousel' AS `mainMediaType` from `smd__carousel` `c`) ;

-- --------------------------------------------------------

--
-- Structure for view `view__all_media_91`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__all_media_91`  AS  (select `f`.`fileID` AS `mediaID`,`fs`.`type` AS `mediaType`,`fs`.`socialChannel` AS `socialChannel`,`fs`.`mime` AS `mime`,`f`.`name` AS `mediaName`,`f`.`url` AS `url`,`fp`.`url` AS `previewFileUrl`,`fs`.`size` AS `size`,`fs`.`data_width` AS `width`,`fs`.`data_height` AS `height`,`fs`.`data_ratio` AS `ratio`,`fs`.`systemType` AS `systemType`,`f`.`status` AS `status`,`f`.`userID` AS `userID`,`f`.`createDate` AS `createDate`,`f`.`modifyDate` AS `modifyDate`,'file' AS `mainMediaType` from ((`cms__file` `f` join `cms__file_static` `fs` on(((`fs`.`fileID` = `f`.`fileID`) and (`fs`.`type` <> 'preview') and (`f`.`fileID` in (select `smd__organization_has_media`.`mediaID` from `smd__organization_has_media` where `smd__organization_has_media`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 91))) or (`fs`.`systemType` in ('generic','branded')))))) left join `cms__file` `fp` on((`fp`.`fileID` = `fs`.`previewFileID`)))) union (select `c`.`carouselID` AS `mediaID`,'carousel' AS `mediaType`,`c`.`socialChannel` AS `socialChannel`,'carousel' AS `mime`,`c`.`name` AS `mediaName`,`c`.`url` AS `url`,NULL AS `previewFileUrl`,NULL AS `size`,NULL AS `width`,NULL AS `height`,NULL AS `ratio`,`c`.`systemType` AS `systemType`,`c`.`status` AS `status`,`c`.`userID` AS `userID`,`c`.`createDate` AS `createDate`,`c`.`modifyDate` AS `modifyDate`,'carousel' AS `mainMediaType` from `smd__carousel` `c`) ;

-- --------------------------------------------------------

--
-- Structure for view `view__all_media_92`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__all_media_92`  AS  (select `f`.`fileID` AS `mediaID`,`fs`.`type` AS `mediaType`,`fs`.`socialChannel` AS `socialChannel`,`fs`.`mime` AS `mime`,`f`.`name` AS `mediaName`,`f`.`url` AS `url`,`fp`.`url` AS `previewFileUrl`,`fs`.`size` AS `size`,`fs`.`data_width` AS `width`,`fs`.`data_height` AS `height`,`fs`.`data_ratio` AS `ratio`,`fs`.`systemType` AS `systemType`,`f`.`status` AS `status`,`f`.`userID` AS `userID`,`f`.`createDate` AS `createDate`,`f`.`modifyDate` AS `modifyDate`,'file' AS `mainMediaType` from ((`cms__file` `f` join `cms__file_static` `fs` on(((`fs`.`fileID` = `f`.`fileID`) and (`fs`.`type` <> 'preview') and (`f`.`fileID` in (select `smd__organization_has_media`.`mediaID` from `smd__organization_has_media` where `smd__organization_has_media`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 92))) or (`fs`.`systemType` in ('generic','branded')))))) left join `cms__file` `fp` on((`fp`.`fileID` = `fs`.`previewFileID`)))) union (select `c`.`carouselID` AS `mediaID`,'carousel' AS `mediaType`,`c`.`socialChannel` AS `socialChannel`,'carousel' AS `mime`,`c`.`name` AS `mediaName`,`c`.`url` AS `url`,NULL AS `previewFileUrl`,NULL AS `size`,NULL AS `width`,NULL AS `height`,NULL AS `ratio`,`c`.`systemType` AS `systemType`,`c`.`status` AS `status`,`c`.`userID` AS `userID`,`c`.`createDate` AS `createDate`,`c`.`modifyDate` AS `modifyDate`,'carousel' AS `mainMediaType` from `smd__carousel` `c`) ;

-- --------------------------------------------------------

--
-- Structure for view `view__all_media_93`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__all_media_93`  AS  (select `f`.`fileID` AS `mediaID`,`fs`.`type` AS `mediaType`,`fs`.`socialChannel` AS `socialChannel`,`fs`.`mime` AS `mime`,`f`.`name` AS `mediaName`,`f`.`url` AS `url`,`fp`.`url` AS `previewFileUrl`,`fs`.`size` AS `size`,`fs`.`data_width` AS `width`,`fs`.`data_height` AS `height`,`fs`.`data_ratio` AS `ratio`,`fs`.`systemType` AS `systemType`,`f`.`status` AS `status`,`f`.`userID` AS `userID`,`f`.`createDate` AS `createDate`,`f`.`modifyDate` AS `modifyDate`,'file' AS `mainMediaType` from ((`cms__file` `f` join `cms__file_static` `fs` on(((`fs`.`fileID` = `f`.`fileID`) and (`fs`.`type` <> 'preview') and (`f`.`fileID` in (select `smd__organization_has_media`.`mediaID` from `smd__organization_has_media` where `smd__organization_has_media`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 93))) or (`fs`.`systemType` in ('generic','branded')))))) left join `cms__file` `fp` on((`fp`.`fileID` = `fs`.`previewFileID`)))) union (select `c`.`carouselID` AS `mediaID`,'carousel' AS `mediaType`,`c`.`socialChannel` AS `socialChannel`,'carousel' AS `mime`,`c`.`name` AS `mediaName`,`c`.`url` AS `url`,NULL AS `previewFileUrl`,NULL AS `size`,NULL AS `width`,NULL AS `height`,NULL AS `ratio`,`c`.`systemType` AS `systemType`,`c`.`status` AS `status`,`c`.`userID` AS `userID`,`c`.`createDate` AS `createDate`,`c`.`modifyDate` AS `modifyDate`,'carousel' AS `mainMediaType` from `smd__carousel` `c`) ;

-- --------------------------------------------------------

--
-- Structure for view `view__all_media_94`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__all_media_94`  AS  (select `f`.`fileID` AS `mediaID`,`fs`.`type` AS `mediaType`,`fs`.`socialChannel` AS `socialChannel`,`fs`.`mime` AS `mime`,`f`.`name` AS `mediaName`,`f`.`url` AS `url`,`fp`.`url` AS `previewFileUrl`,`fs`.`size` AS `size`,`fs`.`data_width` AS `width`,`fs`.`data_height` AS `height`,`fs`.`data_ratio` AS `ratio`,`fs`.`systemType` AS `systemType`,`f`.`status` AS `status`,`f`.`userID` AS `userID`,`f`.`createDate` AS `createDate`,`f`.`modifyDate` AS `modifyDate`,'file' AS `mainMediaType` from ((`cms__file` `f` join `cms__file_static` `fs` on(((`fs`.`fileID` = `f`.`fileID`) and (`fs`.`type` <> 'preview') and (`f`.`fileID` in (select `smd__organization_has_media`.`mediaID` from `smd__organization_has_media` where `smd__organization_has_media`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 94))) or (`fs`.`systemType` in ('generic','branded')))))) left join `cms__file` `fp` on((`fp`.`fileID` = `fs`.`previewFileID`)))) union (select `c`.`carouselID` AS `mediaID`,'carousel' AS `mediaType`,`c`.`socialChannel` AS `socialChannel`,'carousel' AS `mime`,`c`.`name` AS `mediaName`,`c`.`url` AS `url`,NULL AS `previewFileUrl`,NULL AS `size`,NULL AS `width`,NULL AS `height`,NULL AS `ratio`,`c`.`systemType` AS `systemType`,`c`.`status` AS `status`,`c`.`userID` AS `userID`,`c`.`createDate` AS `createDate`,`c`.`modifyDate` AS `modifyDate`,'carousel' AS `mainMediaType` from `smd__carousel` `c`) ;

-- --------------------------------------------------------

--
-- Structure for view `view__all_media_95`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__all_media_95`  AS  (select `f`.`fileID` AS `mediaID`,`fs`.`type` AS `mediaType`,`fs`.`socialChannel` AS `socialChannel`,`fs`.`mime` AS `mime`,`f`.`name` AS `mediaName`,`f`.`url` AS `url`,`fp`.`url` AS `previewFileUrl`,`fs`.`size` AS `size`,`fs`.`data_width` AS `width`,`fs`.`data_height` AS `height`,`fs`.`data_ratio` AS `ratio`,`fs`.`systemType` AS `systemType`,`f`.`status` AS `status`,`f`.`userID` AS `userID`,`f`.`createDate` AS `createDate`,`f`.`modifyDate` AS `modifyDate`,'file' AS `mainMediaType` from ((`cms__file` `f` join `cms__file_static` `fs` on(((`fs`.`fileID` = `f`.`fileID`) and (`fs`.`type` <> 'preview') and (`f`.`fileID` in (select `smd__organization_has_media`.`mediaID` from `smd__organization_has_media` where `smd__organization_has_media`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 95))) or (`fs`.`systemType` in ('generic','branded')))))) left join `cms__file` `fp` on((`fp`.`fileID` = `fs`.`previewFileID`)))) union (select `c`.`carouselID` AS `mediaID`,'carousel' AS `mediaType`,`c`.`socialChannel` AS `socialChannel`,'carousel' AS `mime`,`c`.`name` AS `mediaName`,`c`.`url` AS `url`,NULL AS `previewFileUrl`,NULL AS `size`,NULL AS `width`,NULL AS `height`,NULL AS `ratio`,`c`.`systemType` AS `systemType`,`c`.`status` AS `status`,`c`.`userID` AS `userID`,`c`.`createDate` AS `createDate`,`c`.`modifyDate` AS `modifyDate`,'carousel' AS `mainMediaType` from `smd__carousel` `c`) ;

-- --------------------------------------------------------

--
-- Structure for view `view__all_media_96`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__all_media_96`  AS  (select `f`.`fileID` AS `mediaID`,`fs`.`type` AS `mediaType`,`fs`.`socialChannel` AS `socialChannel`,`fs`.`mime` AS `mime`,`f`.`name` AS `mediaName`,`f`.`url` AS `url`,`fp`.`url` AS `previewFileUrl`,`fs`.`size` AS `size`,`fs`.`data_width` AS `width`,`fs`.`data_height` AS `height`,`fs`.`data_ratio` AS `ratio`,`fs`.`systemType` AS `systemType`,`f`.`status` AS `status`,`f`.`userID` AS `userID`,`f`.`createDate` AS `createDate`,`f`.`modifyDate` AS `modifyDate`,'file' AS `mainMediaType` from ((`cms__file` `f` join `cms__file_static` `fs` on(((`fs`.`fileID` = `f`.`fileID`) and (`fs`.`type` <> 'preview') and (`f`.`fileID` in (select `smd__organization_has_media`.`mediaID` from `smd__organization_has_media` where `smd__organization_has_media`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 96))) or (`fs`.`systemType` in ('generic','branded')))))) left join `cms__file` `fp` on((`fp`.`fileID` = `fs`.`previewFileID`)))) union (select `c`.`carouselID` AS `mediaID`,'carousel' AS `mediaType`,`c`.`socialChannel` AS `socialChannel`,'carousel' AS `mime`,`c`.`name` AS `mediaName`,`c`.`url` AS `url`,NULL AS `previewFileUrl`,NULL AS `size`,NULL AS `width`,NULL AS `height`,NULL AS `ratio`,`c`.`systemType` AS `systemType`,`c`.`status` AS `status`,`c`.`userID` AS `userID`,`c`.`createDate` AS `createDate`,`c`.`modifyDate` AS `modifyDate`,'carousel' AS `mainMediaType` from `smd__carousel` `c`) ;

-- --------------------------------------------------------

--
-- Structure for view `view__all_media_97`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__all_media_97`  AS  (select `f`.`fileID` AS `mediaID`,`fs`.`type` AS `mediaType`,`fs`.`socialChannel` AS `socialChannel`,`fs`.`mime` AS `mime`,`f`.`name` AS `mediaName`,`f`.`url` AS `url`,`fp`.`url` AS `previewFileUrl`,`fs`.`size` AS `size`,`fs`.`data_width` AS `width`,`fs`.`data_height` AS `height`,`fs`.`data_ratio` AS `ratio`,`fs`.`systemType` AS `systemType`,`f`.`status` AS `status`,`f`.`userID` AS `userID`,`f`.`createDate` AS `createDate`,`f`.`modifyDate` AS `modifyDate`,'file' AS `mainMediaType` from ((`cms__file` `f` join `cms__file_static` `fs` on(((`fs`.`fileID` = `f`.`fileID`) and (`fs`.`type` <> 'preview') and (`f`.`fileID` in (select `smd__organization_has_media`.`mediaID` from `smd__organization_has_media` where `smd__organization_has_media`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 97))) or (`fs`.`systemType` in ('generic','branded')))))) left join `cms__file` `fp` on((`fp`.`fileID` = `fs`.`previewFileID`)))) union (select `c`.`carouselID` AS `mediaID`,'carousel' AS `mediaType`,`c`.`socialChannel` AS `socialChannel`,'carousel' AS `mime`,`c`.`name` AS `mediaName`,`c`.`url` AS `url`,NULL AS `previewFileUrl`,NULL AS `size`,NULL AS `width`,NULL AS `height`,NULL AS `ratio`,`c`.`systemType` AS `systemType`,`c`.`status` AS `status`,`c`.`userID` AS `userID`,`c`.`createDate` AS `createDate`,`c`.`modifyDate` AS `modifyDate`,'carousel' AS `mainMediaType` from `smd__carousel` `c`) ;

-- --------------------------------------------------------

--
-- Structure for view `view__all_media_98`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__all_media_98`  AS  (select `f`.`fileID` AS `mediaID`,`fs`.`type` AS `mediaType`,`fs`.`socialChannel` AS `socialChannel`,`fs`.`mime` AS `mime`,`f`.`name` AS `mediaName`,`f`.`url` AS `url`,`fp`.`url` AS `previewFileUrl`,`fs`.`size` AS `size`,`fs`.`data_width` AS `width`,`fs`.`data_height` AS `height`,`fs`.`data_ratio` AS `ratio`,`fs`.`systemType` AS `systemType`,`f`.`status` AS `status`,`f`.`userID` AS `userID`,`f`.`createDate` AS `createDate`,`f`.`modifyDate` AS `modifyDate`,'file' AS `mainMediaType` from ((`cms__file` `f` join `cms__file_static` `fs` on(((`fs`.`fileID` = `f`.`fileID`) and (`fs`.`type` <> 'preview') and (`f`.`fileID` in (select `smd__organization_has_media`.`mediaID` from `smd__organization_has_media` where `smd__organization_has_media`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 98))) or (`fs`.`systemType` in ('generic','branded')))))) left join `cms__file` `fp` on((`fp`.`fileID` = `fs`.`previewFileID`)))) union (select `c`.`carouselID` AS `mediaID`,'carousel' AS `mediaType`,`c`.`socialChannel` AS `socialChannel`,'carousel' AS `mime`,`c`.`name` AS `mediaName`,`c`.`url` AS `url`,NULL AS `previewFileUrl`,NULL AS `size`,NULL AS `width`,NULL AS `height`,NULL AS `ratio`,`c`.`systemType` AS `systemType`,`c`.`status` AS `status`,`c`.`userID` AS `userID`,`c`.`createDate` AS `createDate`,`c`.`modifyDate` AS `modifyDate`,'carousel' AS `mainMediaType` from `smd__carousel` `c`) ;

-- --------------------------------------------------------

--
-- Structure for view `view__all_media_99`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__all_media_99`  AS  (select `f`.`fileID` AS `mediaID`,`fs`.`type` AS `mediaType`,`fs`.`socialChannel` AS `socialChannel`,`fs`.`mime` AS `mime`,`f`.`name` AS `mediaName`,`f`.`url` AS `url`,`fp`.`url` AS `previewFileUrl`,`fs`.`size` AS `size`,`fs`.`data_width` AS `width`,`fs`.`data_height` AS `height`,`fs`.`data_ratio` AS `ratio`,`fs`.`systemType` AS `systemType`,`f`.`status` AS `status`,`f`.`userID` AS `userID`,`f`.`createDate` AS `createDate`,`f`.`modifyDate` AS `modifyDate`,'file' AS `mainMediaType` from ((`cms__file` `f` join `cms__file_static` `fs` on(((`fs`.`fileID` = `f`.`fileID`) and (`fs`.`type` <> 'preview') and (`f`.`fileID` in (select `smd__organization_has_media`.`mediaID` from `smd__organization_has_media` where `smd__organization_has_media`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 99))) or (`fs`.`systemType` in ('generic','branded')))))) left join `cms__file` `fp` on((`fp`.`fileID` = `fs`.`previewFileID`)))) union (select `c`.`carouselID` AS `mediaID`,'carousel' AS `mediaType`,`c`.`socialChannel` AS `socialChannel`,'carousel' AS `mime`,`c`.`name` AS `mediaName`,`c`.`url` AS `url`,NULL AS `previewFileUrl`,NULL AS `size`,NULL AS `width`,NULL AS `height`,NULL AS `ratio`,`c`.`systemType` AS `systemType`,`c`.`status` AS `status`,`c`.`userID` AS `userID`,`c`.`createDate` AS `createDate`,`c`.`modifyDate` AS `modifyDate`,'carousel' AS `mainMediaType` from `smd__carousel` `c`) ;

-- --------------------------------------------------------

--
-- Structure for view `view__all_media_100`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__all_media_100`  AS  (select `f`.`fileID` AS `mediaID`,`fs`.`type` AS `mediaType`,`fs`.`socialChannel` AS `socialChannel`,`fs`.`mime` AS `mime`,`f`.`name` AS `mediaName`,`f`.`url` AS `url`,`fp`.`url` AS `previewFileUrl`,`fs`.`size` AS `size`,`fs`.`data_width` AS `width`,`fs`.`data_height` AS `height`,`fs`.`data_ratio` AS `ratio`,`fs`.`systemType` AS `systemType`,`f`.`status` AS `status`,`f`.`userID` AS `userID`,`f`.`createDate` AS `createDate`,`f`.`modifyDate` AS `modifyDate`,'file' AS `mainMediaType` from ((`cms__file` `f` join `cms__file_static` `fs` on(((`fs`.`fileID` = `f`.`fileID`) and (`fs`.`type` <> 'preview') and (`f`.`fileID` in (select `smd__organization_has_media`.`mediaID` from `smd__organization_has_media` where `smd__organization_has_media`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 100))) or (`fs`.`systemType` in ('generic','branded')))))) left join `cms__file` `fp` on((`fp`.`fileID` = `fs`.`previewFileID`)))) union (select `c`.`carouselID` AS `mediaID`,'carousel' AS `mediaType`,`c`.`socialChannel` AS `socialChannel`,'carousel' AS `mime`,`c`.`name` AS `mediaName`,`c`.`url` AS `url`,NULL AS `previewFileUrl`,NULL AS `size`,NULL AS `width`,NULL AS `height`,NULL AS `ratio`,`c`.`systemType` AS `systemType`,`c`.`status` AS `status`,`c`.`userID` AS `userID`,`c`.`createDate` AS `createDate`,`c`.`modifyDate` AS `modifyDate`,'carousel' AS `mainMediaType` from `smd__carousel` `c`) ;

-- --------------------------------------------------------

--
-- Structure for view `view__all_media_101`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__all_media_101`  AS  (select `f`.`fileID` AS `mediaID`,`fs`.`type` AS `mediaType`,`fs`.`socialChannel` AS `socialChannel`,`fs`.`mime` AS `mime`,`f`.`name` AS `mediaName`,`f`.`url` AS `url`,`fp`.`url` AS `previewFileUrl`,`fs`.`size` AS `size`,`fs`.`data_width` AS `width`,`fs`.`data_height` AS `height`,`fs`.`data_ratio` AS `ratio`,`fs`.`systemType` AS `systemType`,`f`.`status` AS `status`,`f`.`userID` AS `userID`,`f`.`createDate` AS `createDate`,`f`.`modifyDate` AS `modifyDate`,'file' AS `mainMediaType` from ((`cms__file` `f` join `cms__file_static` `fs` on(((`fs`.`fileID` = `f`.`fileID`) and (`fs`.`type` <> 'preview') and (`f`.`fileID` in (select `smd__organization_has_media`.`mediaID` from `smd__organization_has_media` where `smd__organization_has_media`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 101))) or (`fs`.`systemType` in ('generic','branded')))))) left join `cms__file` `fp` on((`fp`.`fileID` = `fs`.`previewFileID`)))) union (select `c`.`carouselID` AS `mediaID`,'carousel' AS `mediaType`,`c`.`socialChannel` AS `socialChannel`,'carousel' AS `mime`,`c`.`name` AS `mediaName`,`c`.`url` AS `url`,NULL AS `previewFileUrl`,NULL AS `size`,NULL AS `width`,NULL AS `height`,NULL AS `ratio`,`c`.`systemType` AS `systemType`,`c`.`status` AS `status`,`c`.`userID` AS `userID`,`c`.`createDate` AS `createDate`,`c`.`modifyDate` AS `modifyDate`,'carousel' AS `mainMediaType` from `smd__carousel` `c`) ;

-- --------------------------------------------------------

--
-- Structure for view `view__all_media_102`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__all_media_102`  AS  (select `f`.`fileID` AS `mediaID`,`fs`.`type` AS `mediaType`,`fs`.`socialChannel` AS `socialChannel`,`fs`.`mime` AS `mime`,`f`.`name` AS `mediaName`,`f`.`url` AS `url`,`fp`.`url` AS `previewFileUrl`,`fs`.`size` AS `size`,`fs`.`data_width` AS `width`,`fs`.`data_height` AS `height`,`fs`.`data_ratio` AS `ratio`,`fs`.`systemType` AS `systemType`,`f`.`status` AS `status`,`f`.`userID` AS `userID`,`f`.`createDate` AS `createDate`,`f`.`modifyDate` AS `modifyDate`,'file' AS `mainMediaType` from ((`cms__file` `f` join `cms__file_static` `fs` on(((`fs`.`fileID` = `f`.`fileID`) and (`fs`.`type` <> 'preview') and (`f`.`fileID` in (select `smd__organization_has_media`.`mediaID` from `smd__organization_has_media` where `smd__organization_has_media`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 102))) or (`fs`.`systemType` in ('generic','branded')))))) left join `cms__file` `fp` on((`fp`.`fileID` = `fs`.`previewFileID`)))) union (select `c`.`carouselID` AS `mediaID`,'carousel' AS `mediaType`,`c`.`socialChannel` AS `socialChannel`,'carousel' AS `mime`,`c`.`name` AS `mediaName`,`c`.`url` AS `url`,NULL AS `previewFileUrl`,NULL AS `size`,NULL AS `width`,NULL AS `height`,NULL AS `ratio`,`c`.`systemType` AS `systemType`,`c`.`status` AS `status`,`c`.`userID` AS `userID`,`c`.`createDate` AS `createDate`,`c`.`modifyDate` AS `modifyDate`,'carousel' AS `mainMediaType` from `smd__carousel` `c`) ;

-- --------------------------------------------------------

--
-- Structure for view `view__all_media_103`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__all_media_103`  AS  (select `f`.`fileID` AS `mediaID`,`fs`.`type` AS `mediaType`,`fs`.`socialChannel` AS `socialChannel`,`fs`.`mime` AS `mime`,`f`.`name` AS `mediaName`,`f`.`url` AS `url`,`fp`.`url` AS `previewFileUrl`,`fs`.`size` AS `size`,`fs`.`data_width` AS `width`,`fs`.`data_height` AS `height`,`fs`.`data_ratio` AS `ratio`,`fs`.`systemType` AS `systemType`,`f`.`status` AS `status`,`f`.`userID` AS `userID`,`f`.`createDate` AS `createDate`,`f`.`modifyDate` AS `modifyDate`,'file' AS `mainMediaType` from ((`cms__file` `f` join `cms__file_static` `fs` on(((`fs`.`fileID` = `f`.`fileID`) and (`fs`.`type` <> 'preview') and (`f`.`fileID` in (select `smd__organization_has_media`.`mediaID` from `smd__organization_has_media` where `smd__organization_has_media`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 103))) or (`fs`.`systemType` in ('generic','branded')))))) left join `cms__file` `fp` on((`fp`.`fileID` = `fs`.`previewFileID`)))) union (select `c`.`carouselID` AS `mediaID`,'carousel' AS `mediaType`,`c`.`socialChannel` AS `socialChannel`,'carousel' AS `mime`,`c`.`name` AS `mediaName`,`c`.`url` AS `url`,NULL AS `previewFileUrl`,NULL AS `size`,NULL AS `width`,NULL AS `height`,NULL AS `ratio`,`c`.`systemType` AS `systemType`,`c`.`status` AS `status`,`c`.`userID` AS `userID`,`c`.`createDate` AS `createDate`,`c`.`modifyDate` AS `modifyDate`,'carousel' AS `mainMediaType` from `smd__carousel` `c`) ;

-- --------------------------------------------------------

--
-- Structure for view `view__all_media_104`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__all_media_104`  AS  (select `f`.`fileID` AS `mediaID`,`fs`.`type` AS `mediaType`,`fs`.`socialChannel` AS `socialChannel`,`fs`.`mime` AS `mime`,`f`.`name` AS `mediaName`,`f`.`url` AS `url`,`fp`.`url` AS `previewFileUrl`,`fs`.`size` AS `size`,`fs`.`data_width` AS `width`,`fs`.`data_height` AS `height`,`fs`.`data_ratio` AS `ratio`,`fs`.`systemType` AS `systemType`,`f`.`status` AS `status`,`f`.`userID` AS `userID`,`f`.`createDate` AS `createDate`,`f`.`modifyDate` AS `modifyDate`,'file' AS `mainMediaType` from ((`cms__file` `f` join `cms__file_static` `fs` on(((`fs`.`fileID` = `f`.`fileID`) and (`fs`.`type` <> 'preview') and (`f`.`fileID` in (select `smd__organization_has_media`.`mediaID` from `smd__organization_has_media` where `smd__organization_has_media`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 104))) or (`fs`.`systemType` in ('generic','branded')))))) left join `cms__file` `fp` on((`fp`.`fileID` = `fs`.`previewFileID`)))) union (select `c`.`carouselID` AS `mediaID`,'carousel' AS `mediaType`,`c`.`socialChannel` AS `socialChannel`,'carousel' AS `mime`,`c`.`name` AS `mediaName`,`c`.`url` AS `url`,NULL AS `previewFileUrl`,NULL AS `size`,NULL AS `width`,NULL AS `height`,NULL AS `ratio`,`c`.`systemType` AS `systemType`,`c`.`status` AS `status`,`c`.`userID` AS `userID`,`c`.`createDate` AS `createDate`,`c`.`modifyDate` AS `modifyDate`,'carousel' AS `mainMediaType` from `smd__carousel` `c`) ;

-- --------------------------------------------------------

--
-- Structure for view `view__all_media_105`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__all_media_105`  AS  (select `f`.`fileID` AS `mediaID`,`fs`.`type` AS `mediaType`,`fs`.`socialChannel` AS `socialChannel`,`fs`.`mime` AS `mime`,`f`.`name` AS `mediaName`,`f`.`url` AS `url`,`fp`.`url` AS `previewFileUrl`,`fs`.`size` AS `size`,`fs`.`data_width` AS `width`,`fs`.`data_height` AS `height`,`fs`.`data_ratio` AS `ratio`,`fs`.`systemType` AS `systemType`,`f`.`status` AS `status`,`f`.`userID` AS `userID`,`f`.`createDate` AS `createDate`,`f`.`modifyDate` AS `modifyDate`,'file' AS `mainMediaType` from ((`cms__file` `f` join `cms__file_static` `fs` on(((`fs`.`fileID` = `f`.`fileID`) and (`fs`.`type` <> 'preview') and (`f`.`fileID` in (select `smd__organization_has_media`.`mediaID` from `smd__organization_has_media` where `smd__organization_has_media`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 105))) or (`fs`.`systemType` in ('generic','branded')))))) left join `cms__file` `fp` on((`fp`.`fileID` = `fs`.`previewFileID`)))) union (select `c`.`carouselID` AS `mediaID`,'carousel' AS `mediaType`,`c`.`socialChannel` AS `socialChannel`,'carousel' AS `mime`,`c`.`name` AS `mediaName`,`c`.`url` AS `url`,NULL AS `previewFileUrl`,NULL AS `size`,NULL AS `width`,NULL AS `height`,NULL AS `ratio`,`c`.`systemType` AS `systemType`,`c`.`status` AS `status`,`c`.`userID` AS `userID`,`c`.`createDate` AS `createDate`,`c`.`modifyDate` AS `modifyDate`,'carousel' AS `mainMediaType` from `smd__carousel` `c`) ;

-- --------------------------------------------------------

--
-- Structure for view `view__all_media_106`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__all_media_106`  AS  (select `f`.`fileID` AS `mediaID`,`fs`.`type` AS `mediaType`,`fs`.`socialChannel` AS `socialChannel`,`fs`.`mime` AS `mime`,`f`.`name` AS `mediaName`,`f`.`url` AS `url`,`fp`.`url` AS `previewFileUrl`,`fs`.`size` AS `size`,`fs`.`data_width` AS `width`,`fs`.`data_height` AS `height`,`fs`.`data_ratio` AS `ratio`,`fs`.`systemType` AS `systemType`,`f`.`status` AS `status`,`f`.`userID` AS `userID`,`f`.`createDate` AS `createDate`,`f`.`modifyDate` AS `modifyDate`,'file' AS `mainMediaType` from ((`cms__file` `f` join `cms__file_static` `fs` on(((`fs`.`fileID` = `f`.`fileID`) and (`fs`.`type` <> 'preview') and (`f`.`fileID` in (select `smd__organization_has_media`.`mediaID` from `smd__organization_has_media` where `smd__organization_has_media`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 106))) or (`fs`.`systemType` in ('generic','branded')))))) left join `cms__file` `fp` on((`fp`.`fileID` = `fs`.`previewFileID`)))) union (select `c`.`carouselID` AS `mediaID`,'carousel' AS `mediaType`,`c`.`socialChannel` AS `socialChannel`,'carousel' AS `mime`,`c`.`name` AS `mediaName`,`c`.`url` AS `url`,NULL AS `previewFileUrl`,NULL AS `size`,NULL AS `width`,NULL AS `height`,NULL AS `ratio`,`c`.`systemType` AS `systemType`,`c`.`status` AS `status`,`c`.`userID` AS `userID`,`c`.`createDate` AS `createDate`,`c`.`modifyDate` AS `modifyDate`,'carousel' AS `mainMediaType` from `smd__carousel` `c`) ;

-- --------------------------------------------------------

--
-- Structure for view `view__all_media_107`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__all_media_107`  AS  (select `f`.`fileID` AS `mediaID`,`fs`.`type` AS `mediaType`,`fs`.`socialChannel` AS `socialChannel`,`fs`.`mime` AS `mime`,`f`.`name` AS `mediaName`,`f`.`url` AS `url`,`fp`.`url` AS `previewFileUrl`,`fs`.`size` AS `size`,`fs`.`data_width` AS `width`,`fs`.`data_height` AS `height`,`fs`.`data_ratio` AS `ratio`,`fs`.`systemType` AS `systemType`,`f`.`status` AS `status`,`f`.`userID` AS `userID`,`f`.`createDate` AS `createDate`,`f`.`modifyDate` AS `modifyDate`,'file' AS `mainMediaType` from ((`cms__file` `f` join `cms__file_static` `fs` on(((`fs`.`fileID` = `f`.`fileID`) and (`fs`.`type` <> 'preview') and (`f`.`fileID` in (select `smd__organization_has_media`.`mediaID` from `smd__organization_has_media` where `smd__organization_has_media`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 107))) or (`fs`.`systemType` in ('generic','branded')))))) left join `cms__file` `fp` on((`fp`.`fileID` = `fs`.`previewFileID`)))) union (select `c`.`carouselID` AS `mediaID`,'carousel' AS `mediaType`,`c`.`socialChannel` AS `socialChannel`,'carousel' AS `mime`,`c`.`name` AS `mediaName`,`c`.`url` AS `url`,NULL AS `previewFileUrl`,NULL AS `size`,NULL AS `width`,NULL AS `height`,NULL AS `ratio`,`c`.`systemType` AS `systemType`,`c`.`status` AS `status`,`c`.`userID` AS `userID`,`c`.`createDate` AS `createDate`,`c`.`modifyDate` AS `modifyDate`,'carousel' AS `mainMediaType` from `smd__carousel` `c`) ;

-- --------------------------------------------------------

--
-- Structure for view `view__all_media_108`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__all_media_108`  AS  (select `f`.`fileID` AS `mediaID`,`fs`.`type` AS `mediaType`,`fs`.`socialChannel` AS `socialChannel`,`fs`.`mime` AS `mime`,`f`.`name` AS `mediaName`,`f`.`url` AS `url`,`fp`.`url` AS `previewFileUrl`,`fs`.`size` AS `size`,`fs`.`data_width` AS `width`,`fs`.`data_height` AS `height`,`fs`.`data_ratio` AS `ratio`,`fs`.`systemType` AS `systemType`,`f`.`status` AS `status`,`f`.`userID` AS `userID`,`f`.`createDate` AS `createDate`,`f`.`modifyDate` AS `modifyDate`,'file' AS `mainMediaType` from ((`cms__file` `f` join `cms__file_static` `fs` on(((`fs`.`fileID` = `f`.`fileID`) and (`fs`.`type` <> 'preview') and (`f`.`fileID` in (select `smd__organization_has_media`.`mediaID` from `smd__organization_has_media` where `smd__organization_has_media`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 108))) or (`fs`.`systemType` in ('generic','branded')))))) left join `cms__file` `fp` on((`fp`.`fileID` = `fs`.`previewFileID`)))) union (select `c`.`carouselID` AS `mediaID`,'carousel' AS `mediaType`,`c`.`socialChannel` AS `socialChannel`,'carousel' AS `mime`,`c`.`name` AS `mediaName`,`c`.`url` AS `url`,NULL AS `previewFileUrl`,NULL AS `size`,NULL AS `width`,NULL AS `height`,NULL AS `ratio`,`c`.`systemType` AS `systemType`,`c`.`status` AS `status`,`c`.`userID` AS `userID`,`c`.`createDate` AS `createDate`,`c`.`modifyDate` AS `modifyDate`,'carousel' AS `mainMediaType` from `smd__carousel` `c`) ;

-- --------------------------------------------------------

--
-- Structure for view `view__all_media_109`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__all_media_109`  AS  (select `f`.`fileID` AS `mediaID`,`fs`.`type` AS `mediaType`,`fs`.`socialChannel` AS `socialChannel`,`fs`.`mime` AS `mime`,`f`.`name` AS `mediaName`,`f`.`url` AS `url`,`fp`.`url` AS `previewFileUrl`,`fs`.`size` AS `size`,`fs`.`data_width` AS `width`,`fs`.`data_height` AS `height`,`fs`.`data_ratio` AS `ratio`,`fs`.`systemType` AS `systemType`,`f`.`status` AS `status`,`f`.`userID` AS `userID`,`f`.`createDate` AS `createDate`,`f`.`modifyDate` AS `modifyDate`,'file' AS `mainMediaType` from ((`cms__file` `f` join `cms__file_static` `fs` on(((`fs`.`fileID` = `f`.`fileID`) and (`fs`.`type` <> 'preview') and (`f`.`fileID` in (select `smd__organization_has_media`.`mediaID` from `smd__organization_has_media` where `smd__organization_has_media`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 109))) or (`fs`.`systemType` in ('generic','branded')))))) left join `cms__file` `fp` on((`fp`.`fileID` = `fs`.`previewFileID`)))) union (select `c`.`carouselID` AS `mediaID`,'carousel' AS `mediaType`,`c`.`socialChannel` AS `socialChannel`,'carousel' AS `mime`,`c`.`name` AS `mediaName`,`c`.`url` AS `url`,NULL AS `previewFileUrl`,NULL AS `size`,NULL AS `width`,NULL AS `height`,NULL AS `ratio`,`c`.`systemType` AS `systemType`,`c`.`status` AS `status`,`c`.`userID` AS `userID`,`c`.`createDate` AS `createDate`,`c`.`modifyDate` AS `modifyDate`,'carousel' AS `mainMediaType` from `smd__carousel` `c`) ;

-- --------------------------------------------------------

--
-- Structure for view `view__all_media_110`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__all_media_110`  AS  (select `f`.`fileID` AS `mediaID`,`fs`.`type` AS `mediaType`,`fs`.`socialChannel` AS `socialChannel`,`fs`.`mime` AS `mime`,`f`.`name` AS `mediaName`,`f`.`url` AS `url`,`fp`.`url` AS `previewFileUrl`,`fs`.`size` AS `size`,`fs`.`data_width` AS `width`,`fs`.`data_height` AS `height`,`fs`.`data_ratio` AS `ratio`,`fs`.`systemType` AS `systemType`,`f`.`status` AS `status`,`f`.`userID` AS `userID`,`f`.`createDate` AS `createDate`,`f`.`modifyDate` AS `modifyDate`,'file' AS `mainMediaType` from ((`cms__file` `f` join `cms__file_static` `fs` on(((`fs`.`fileID` = `f`.`fileID`) and (`fs`.`type` <> 'preview') and (`f`.`fileID` in (select `smd__organization_has_media`.`mediaID` from `smd__organization_has_media` where `smd__organization_has_media`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 110))) or (`fs`.`systemType` in ('generic','branded')))))) left join `cms__file` `fp` on((`fp`.`fileID` = `fs`.`previewFileID`)))) union (select `c`.`carouselID` AS `mediaID`,'carousel' AS `mediaType`,`c`.`socialChannel` AS `socialChannel`,'carousel' AS `mime`,`c`.`name` AS `mediaName`,`c`.`url` AS `url`,NULL AS `previewFileUrl`,NULL AS `size`,NULL AS `width`,NULL AS `height`,NULL AS `ratio`,`c`.`systemType` AS `systemType`,`c`.`status` AS `status`,`c`.`userID` AS `userID`,`c`.`createDate` AS `createDate`,`c`.`modifyDate` AS `modifyDate`,'carousel' AS `mainMediaType` from `smd__carousel` `c`) ;

-- --------------------------------------------------------

--
-- Structure for view `view__all_media_111`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__all_media_111`  AS  (select `f`.`fileID` AS `mediaID`,`fs`.`type` AS `mediaType`,`fs`.`socialChannel` AS `socialChannel`,`fs`.`mime` AS `mime`,`f`.`name` AS `mediaName`,`f`.`url` AS `url`,`fp`.`url` AS `previewFileUrl`,`fs`.`size` AS `size`,`fs`.`data_width` AS `width`,`fs`.`data_height` AS `height`,`fs`.`data_ratio` AS `ratio`,`fs`.`systemType` AS `systemType`,`f`.`status` AS `status`,`f`.`userID` AS `userID`,`f`.`createDate` AS `createDate`,`f`.`modifyDate` AS `modifyDate`,'file' AS `mainMediaType` from ((`cms__file` `f` join `cms__file_static` `fs` on(((`fs`.`fileID` = `f`.`fileID`) and (`fs`.`type` <> 'preview') and (`f`.`fileID` in (select `smd__organization_has_media`.`mediaID` from `smd__organization_has_media` where `smd__organization_has_media`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 111))) or (`fs`.`systemType` in ('generic','branded')))))) left join `cms__file` `fp` on((`fp`.`fileID` = `fs`.`previewFileID`)))) union (select `c`.`carouselID` AS `mediaID`,'carousel' AS `mediaType`,`c`.`socialChannel` AS `socialChannel`,'carousel' AS `mime`,`c`.`name` AS `mediaName`,`c`.`url` AS `url`,NULL AS `previewFileUrl`,NULL AS `size`,NULL AS `width`,NULL AS `height`,NULL AS `ratio`,`c`.`systemType` AS `systemType`,`c`.`status` AS `status`,`c`.`userID` AS `userID`,`c`.`createDate` AS `createDate`,`c`.`modifyDate` AS `modifyDate`,'carousel' AS `mainMediaType` from `smd__carousel` `c`) ;

-- --------------------------------------------------------

--
-- Structure for view `view__all_media_114`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__all_media_114`  AS  (select `f`.`fileID` AS `mediaID`,`fs`.`type` AS `mediaType`,`fs`.`socialChannel` AS `socialChannel`,`fs`.`mime` AS `mime`,`f`.`name` AS `mediaName`,`f`.`url` AS `url`,`fp`.`url` AS `previewFileUrl`,`fs`.`size` AS `size`,`fs`.`data_width` AS `width`,`fs`.`data_height` AS `height`,`fs`.`data_ratio` AS `ratio`,`fs`.`systemType` AS `systemType`,`f`.`status` AS `status`,`f`.`userID` AS `userID`,`f`.`createDate` AS `createDate`,`f`.`modifyDate` AS `modifyDate`,'file' AS `mainMediaType` from ((`cms__file` `f` join `cms__file_static` `fs` on(((`fs`.`fileID` = `f`.`fileID`) and (`fs`.`type` <> 'preview') and (`f`.`fileID` in (select `smd__organization_has_media`.`mediaID` from `smd__organization_has_media` where `smd__organization_has_media`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 114))) or (`fs`.`systemType` in ('generic','branded')))))) left join `cms__file` `fp` on((`fp`.`fileID` = `fs`.`previewFileID`)))) union (select `c`.`carouselID` AS `mediaID`,'carousel' AS `mediaType`,`c`.`socialChannel` AS `socialChannel`,'carousel' AS `mime`,`c`.`name` AS `mediaName`,`c`.`url` AS `url`,NULL AS `previewFileUrl`,NULL AS `size`,NULL AS `width`,NULL AS `height`,NULL AS `ratio`,`c`.`systemType` AS `systemType`,`c`.`status` AS `status`,`c`.`userID` AS `userID`,`c`.`createDate` AS `createDate`,`c`.`modifyDate` AS `modifyDate`,'carousel' AS `mainMediaType` from `smd__carousel` `c`) ;

-- --------------------------------------------------------

--
-- Structure for view `view__all_media_130`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__all_media_130`  AS  (select `f`.`fileID` AS `mediaID`,`fs`.`type` AS `mediaType`,`fs`.`socialChannel` AS `socialChannel`,`fs`.`mime` AS `mime`,`f`.`name` AS `mediaName`,`f`.`url` AS `url`,`fp`.`url` AS `previewFileUrl`,`fs`.`size` AS `size`,`fs`.`data_width` AS `width`,`fs`.`data_height` AS `height`,`fs`.`data_ratio` AS `ratio`,`fs`.`systemType` AS `systemType`,`f`.`status` AS `status`,`f`.`userID` AS `userID`,`f`.`createDate` AS `createDate`,`f`.`modifyDate` AS `modifyDate`,'file' AS `mainMediaType` from ((`cms__file` `f` join `cms__file_static` `fs` on(((`fs`.`fileID` = `f`.`fileID`) and (`fs`.`type` <> 'preview') and (`f`.`fileID` in (select `smd__organization_has_media`.`mediaID` from `smd__organization_has_media` where `smd__organization_has_media`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 130))) or (`fs`.`systemType` in ('generic','branded')))))) left join `cms__file` `fp` on((`fp`.`fileID` = `fs`.`previewFileID`)))) union (select `c`.`carouselID` AS `mediaID`,'carousel' AS `mediaType`,`c`.`socialChannel` AS `socialChannel`,'carousel' AS `mime`,`c`.`name` AS `mediaName`,`c`.`url` AS `url`,NULL AS `previewFileUrl`,NULL AS `size`,NULL AS `width`,NULL AS `height`,NULL AS `ratio`,`c`.`systemType` AS `systemType`,`c`.`status` AS `status`,`c`.`userID` AS `userID`,`c`.`createDate` AS `createDate`,`c`.`modifyDate` AS `modifyDate`,'carousel' AS `mainMediaType` from `smd__carousel` `c`) ;

-- --------------------------------------------------------

--
-- Structure for view `view__all_media_138`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__all_media_138`  AS  (select `f`.`fileID` AS `mediaID`,`fs`.`type` AS `mediaType`,`fs`.`socialChannel` AS `socialChannel`,`fs`.`mime` AS `mime`,`f`.`name` AS `mediaName`,`f`.`url` AS `url`,`fp`.`url` AS `previewFileUrl`,`fs`.`size` AS `size`,`fs`.`data_width` AS `width`,`fs`.`data_height` AS `height`,`fs`.`data_ratio` AS `ratio`,`fs`.`systemType` AS `systemType`,`f`.`status` AS `status`,`f`.`userID` AS `userID`,`f`.`createDate` AS `createDate`,`f`.`modifyDate` AS `modifyDate`,'file' AS `mainMediaType` from ((`cms__file` `f` join `cms__file_static` `fs` on(((`fs`.`fileID` = `f`.`fileID`) and (`fs`.`type` <> 'preview') and (`f`.`fileID` in (select `smd__organization_has_media`.`mediaID` from `smd__organization_has_media` where `smd__organization_has_media`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 138))) or (`fs`.`systemType` in ('generic','branded')))))) left join `cms__file` `fp` on((`fp`.`fileID` = `fs`.`previewFileID`)))) union (select `c`.`carouselID` AS `mediaID`,'carousel' AS `mediaType`,`c`.`socialChannel` AS `socialChannel`,'carousel' AS `mime`,`c`.`name` AS `mediaName`,`c`.`url` AS `url`,NULL AS `previewFileUrl`,NULL AS `size`,NULL AS `width`,NULL AS `height`,NULL AS `ratio`,`c`.`systemType` AS `systemType`,`c`.`status` AS `status`,`c`.`userID` AS `userID`,`c`.`createDate` AS `createDate`,`c`.`modifyDate` AS `modifyDate`,'carousel' AS `mainMediaType` from `smd__carousel` `c`) ;

-- --------------------------------------------------------

--
-- Structure for view `view__all_media_139`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__all_media_139`  AS  (select `f`.`fileID` AS `mediaID`,`fs`.`type` AS `mediaType`,`fs`.`socialChannel` AS `socialChannel`,`fs`.`mime` AS `mime`,`f`.`name` AS `mediaName`,`f`.`url` AS `url`,`fp`.`url` AS `previewFileUrl`,`fs`.`size` AS `size`,`fs`.`data_width` AS `width`,`fs`.`data_height` AS `height`,`fs`.`data_ratio` AS `ratio`,`fs`.`systemType` AS `systemType`,`f`.`status` AS `status`,`f`.`userID` AS `userID`,`f`.`createDate` AS `createDate`,`f`.`modifyDate` AS `modifyDate`,'file' AS `mainMediaType` from ((`cms__file` `f` join `cms__file_static` `fs` on(((`fs`.`fileID` = `f`.`fileID`) and (`fs`.`type` <> 'preview') and (`f`.`fileID` in (select `smd__organization_has_media`.`mediaID` from `smd__organization_has_media` where `smd__organization_has_media`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 139))) or (`fs`.`systemType` in ('generic','branded')))))) left join `cms__file` `fp` on((`fp`.`fileID` = `fs`.`previewFileID`)))) union (select `c`.`carouselID` AS `mediaID`,'carousel' AS `mediaType`,`c`.`socialChannel` AS `socialChannel`,'carousel' AS `mime`,`c`.`name` AS `mediaName`,`c`.`url` AS `url`,NULL AS `previewFileUrl`,NULL AS `size`,NULL AS `width`,NULL AS `height`,NULL AS `ratio`,`c`.`systemType` AS `systemType`,`c`.`status` AS `status`,`c`.`userID` AS `userID`,`c`.`createDate` AS `createDate`,`c`.`modifyDate` AS `modifyDate`,'carousel' AS `mainMediaType` from `smd__carousel` `c`) ;

-- --------------------------------------------------------

--
-- Structure for view `view__all_media_141`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__all_media_141`  AS  (select `f`.`fileID` AS `mediaID`,`fs`.`type` AS `mediaType`,`fs`.`socialChannel` AS `socialChannel`,`fs`.`mime` AS `mime`,`f`.`name` AS `mediaName`,`f`.`url` AS `url`,`fp`.`url` AS `previewFileUrl`,`fs`.`size` AS `size`,`fs`.`data_width` AS `width`,`fs`.`data_height` AS `height`,`fs`.`data_ratio` AS `ratio`,`fs`.`systemType` AS `systemType`,`f`.`status` AS `status`,`f`.`userID` AS `userID`,`f`.`createDate` AS `createDate`,`f`.`modifyDate` AS `modifyDate`,'file' AS `mainMediaType` from ((`cms__file` `f` join `cms__file_static` `fs` on(((`fs`.`fileID` = `f`.`fileID`) and (`fs`.`type` <> 'preview') and (`f`.`fileID` in (select `smd__organization_has_media`.`mediaID` from `smd__organization_has_media` where `smd__organization_has_media`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 141))) or (`fs`.`systemType` in ('generic','branded')))))) left join `cms__file` `fp` on((`fp`.`fileID` = `fs`.`previewFileID`)))) union (select `c`.`carouselID` AS `mediaID`,'carousel' AS `mediaType`,`c`.`socialChannel` AS `socialChannel`,'carousel' AS `mime`,`c`.`name` AS `mediaName`,`c`.`url` AS `url`,NULL AS `previewFileUrl`,NULL AS `size`,NULL AS `width`,NULL AS `height`,NULL AS `ratio`,`c`.`systemType` AS `systemType`,`c`.`status` AS `status`,`c`.`userID` AS `userID`,`c`.`createDate` AS `createDate`,`c`.`modifyDate` AS `modifyDate`,'carousel' AS `mainMediaType` from `smd__carousel` `c`) ;

-- --------------------------------------------------------

--
-- Structure for view `view__all_media_181`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__all_media_181`  AS  (select `f`.`fileID` AS `mediaID`,`fs`.`type` AS `mediaType`,`fs`.`socialChannel` AS `socialChannel`,`fs`.`mime` AS `mime`,`f`.`name` AS `mediaName`,`f`.`url` AS `url`,`fp`.`url` AS `previewFileUrl`,`fs`.`size` AS `size`,`fs`.`data_width` AS `width`,`fs`.`data_height` AS `height`,`fs`.`data_ratio` AS `ratio`,`fs`.`systemType` AS `systemType`,`f`.`status` AS `status`,`f`.`userID` AS `userID`,`f`.`createDate` AS `createDate`,`f`.`modifyDate` AS `modifyDate`,'file' AS `mainMediaType` from ((`cms__file` `f` join `cms__file_static` `fs` on(((`fs`.`fileID` = `f`.`fileID`) and (`fs`.`type` <> 'preview') and (`f`.`fileID` in (select `smd__organization_has_media`.`mediaID` from `smd__organization_has_media` where `smd__organization_has_media`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 181))) or (`fs`.`systemType` in ('generic','branded')))))) left join `cms__file` `fp` on((`fp`.`fileID` = `fs`.`previewFileID`)))) union (select `c`.`carouselID` AS `mediaID`,'carousel' AS `mediaType`,`c`.`socialChannel` AS `socialChannel`,'carousel' AS `mime`,`c`.`name` AS `mediaName`,`c`.`url` AS `url`,NULL AS `previewFileUrl`,NULL AS `size`,NULL AS `width`,NULL AS `height`,NULL AS `ratio`,`c`.`systemType` AS `systemType`,`c`.`status` AS `status`,`c`.`userID` AS `userID`,`c`.`createDate` AS `createDate`,`c`.`modifyDate` AS `modifyDate`,'carousel' AS `mainMediaType` from `smd__carousel` `c`) ;

-- --------------------------------------------------------

--
-- Structure for view `view__all_media_183`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__all_media_183`  AS  (select `f`.`fileID` AS `mediaID`,`fs`.`type` AS `mediaType`,`fs`.`socialChannel` AS `socialChannel`,`fs`.`mime` AS `mime`,`f`.`name` AS `mediaName`,`f`.`url` AS `url`,`fp`.`url` AS `previewFileUrl`,`fs`.`size` AS `size`,`fs`.`data_width` AS `width`,`fs`.`data_height` AS `height`,`fs`.`data_ratio` AS `ratio`,`fs`.`systemType` AS `systemType`,`f`.`status` AS `status`,`f`.`userID` AS `userID`,`f`.`createDate` AS `createDate`,`f`.`modifyDate` AS `modifyDate`,'file' AS `mainMediaType` from ((`cms__file` `f` join `cms__file_static` `fs` on(((`fs`.`fileID` = `f`.`fileID`) and (`fs`.`type` <> 'preview') and (`f`.`fileID` in (select `smd__organization_has_media`.`mediaID` from `smd__organization_has_media` where `smd__organization_has_media`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 183))) or (`fs`.`systemType` in ('generic','branded')))))) left join `cms__file` `fp` on((`fp`.`fileID` = `fs`.`previewFileID`)))) union (select `c`.`carouselID` AS `mediaID`,'carousel' AS `mediaType`,`c`.`socialChannel` AS `socialChannel`,'carousel' AS `mime`,`c`.`name` AS `mediaName`,`c`.`url` AS `url`,NULL AS `previewFileUrl`,NULL AS `size`,NULL AS `width`,NULL AS `height`,NULL AS `ratio`,`c`.`systemType` AS `systemType`,`c`.`status` AS `status`,`c`.`userID` AS `userID`,`c`.`createDate` AS `createDate`,`c`.`modifyDate` AS `modifyDate`,'carousel' AS `mainMediaType` from `smd__carousel` `c`) ;

-- --------------------------------------------------------

--
-- Structure for view `view__autofeed_posts`
--

-- --------------------------------------------------------

--
-- Structure for view `view__cron`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__cron`  AS  select `cron__jobs`.`taskName` AS `taskName`,`cron__jobs`.`timing` AS `timing`,`cron__jobs`.`status` AS `status`,`cron__jobs`.`lastRun` AS `lastRun`,`cron__jobs`.`started` AS `started`,`cron__jobs`.`timeout` AS `timeout`,if((`cron__jobs`.`taskName` = 'Monitor'),1,NULL) AS `isMonitor`,if(((((unix_timestamp() - unix_timestamp(`cron__jobs`.`started`)) / 60) > `cron__jobs`.`timeout`) and (`cron__jobs`.`status` = 'started')),1,NULL) AS `isGarbage`,(case when (`cron__jobs`.`status` = 'started') then NULL when (isnull(`cron__jobs`.`lastRun`) or isnull(`cron__jobs`.`status`) or isnull(`cron__jobs`.`started`)) then 1 when (((unix_timestamp() - unix_timestamp(`cron__jobs`.`started`)) / 60) >= `cron__jobs`.`timing`) then 1 else NULL end) AS `isNeedToRun` from `cron__jobs` where (`cron__jobs`.`active` = 'yes') ;

-- --------------------------------------------------------

--
-- Structure for view `view__panel`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__panel`  AS  select `p`.`moduleID` AS `moduleID`,`p`.`panelID` AS `panelID`,`pv`.`panelVariantID` AS `panelVariantID`,`php`.`fileID` AS `fileID`,`php`.`columnID` AS `columnID`,`php`.`phpID` AS `phpID`,`pv`.`type` AS `type`,`p`.`name` AS `name`,`pv`.`name` AS `variantName`,`p`.`exclusive` AS `exclusive`,`p`.`status` AS `status`,if((`pv`.`parameters` is not null),`pv`.`parameters`,`p`.`parameters`) AS `parameters`,`php`.`position` AS `position` from ((`cms__panel` `p` left join `cms__panel_variant` `pv` on((`p`.`panelID` = `pv`.`panelID`))) left join `cms__file_page_has_panels` `php` on((`pv`.`panelVariantID` = `php`.`panelVariantID`))) ;

-- --------------------------------------------------------

--
-- Structure for view `view__posts`
--

-- --------------------------------------------------------

--
-- Structure for view `view__roles`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__roles`  AS  select `uhor`.`roleID` AS `roleID`,`or`.`name` AS `roleName`,`uhor`.`userID` AS `userID`,`uhor`.`main` AS `main`,`or`.`organizationID` AS `organizationID`,`or`.`admin` AS `admin`,`o`.`partnerID` AS `partnerID` from ((`smd__user_has_organization_role` `uhor` join `smd__organization_role` `or` on((`or`.`roleID` = `uhor`.`roleID`))) join `smd__organization` `o` on((`or`.`organizationID` = `o`.`organizationID`))) ;

-- --------------------------------------------------------

--
-- Structure for view `view__template_1`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__template_1`  AS  (select `smd__post_template`.`templateID` AS `templateID`,`smd__post_template`.`headline` AS `headline`,`smd__post_template`.`subHeadline` AS `subHeadline`,`smd__post_template`.`mainCopy` AS `mainCopy`,`smd__post_template`.`userID` AS `userID`,`smd__post_template`.`organizationID` AS `organizationID`,`smd__post_template`.`socialType` AS `socialType`,`smd__post_template`.`createDate` AS `createDate`,`smd__post_template`.`modifyDate` AS `modifyDate`,`smd__post_template`.`status` AS `status`,`smd__post_template`.`signature` AS `signature`,`smd__post_template`.`feedTargetingOptions` AS `feedTargetingOptions`,`smd__post_template`.`archive` AS `archive`,`smd__post_template`.`systemType` AS `systemType`,group_concat(`sptho`.`organizationID` separator ',') AS `organizationIDs` from (`smd__post_template` join `smd__post_template_has_organizations` `sptho` on(((`sptho`.`templateID` = `smd__post_template`.`templateID`) and `sptho`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 1))))) where (`smd__post_template`.`systemType` = 'custom') group by `smd__post_template`.`templateID`) union all (select `smd__post_template`.`templateID` AS `templateID`,`smd__post_template`.`headline` AS `headline`,`smd__post_template`.`subHeadline` AS `subHeadline`,`smd__post_template`.`mainCopy` AS `mainCopy`,`smd__post_template`.`userID` AS `userID`,`smd__post_template`.`organizationID` AS `organizationID`,`smd__post_template`.`socialType` AS `socialType`,`smd__post_template`.`createDate` AS `createDate`,`smd__post_template`.`modifyDate` AS `modifyDate`,`smd__post_template`.`status` AS `status`,`smd__post_template`.`signature` AS `signature`,`smd__post_template`.`feedTargetingOptions` AS `feedTargetingOptions`,`smd__post_template`.`archive` AS `archive`,`smd__post_template`.`systemType` AS `systemType`,NULL AS `organizationIDs` from `smd__post_template` where (((`smd__post_template`.`systemType` = 'branded') and exists(select `subPhpt`.`templateID` from `smd__partner_has_post_templates` `subPhpt` where ((`subPhpt`.`partnerID` = 1) and (`subPhpt`.`allowed` = 'yes') and (`subPhpt`.`templateID` = `smd__post_template`.`templateID`)))) or ((`smd__post_template`.`systemType` = 'generic') and (not(exists(select `subPhpt`.`templateID` from `smd__partner_has_post_templates` `subPhpt` where ((`subPhpt`.`partnerID` = 1) and (`subPhpt`.`templateID` = `smd__post_template`.`templateID`)))))))) ;

-- --------------------------------------------------------

--
-- Structure for view `view__template_11`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__template_11`  AS  (select `smd__post_template`.`templateID` AS `templateID`,`smd__post_template`.`headline` AS `headline`,`smd__post_template`.`subHeadline` AS `subHeadline`,`smd__post_template`.`mainCopy` AS `mainCopy`,`smd__post_template`.`userID` AS `userID`,`smd__post_template`.`organizationID` AS `organizationID`,`smd__post_template`.`socialType` AS `socialType`,`smd__post_template`.`createDate` AS `createDate`,`smd__post_template`.`modifyDate` AS `modifyDate`,`smd__post_template`.`status` AS `status`,`smd__post_template`.`signature` AS `signature`,`smd__post_template`.`feedTargetingOptions` AS `feedTargetingOptions`,`smd__post_template`.`archive` AS `archive`,`smd__post_template`.`systemType` AS `systemType`,group_concat(`sptho`.`organizationID` separator ',') AS `organizationIDs` from (`smd__post_template` join `smd__post_template_has_organizations` `sptho` on(((`sptho`.`templateID` = `smd__post_template`.`templateID`) and `sptho`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 11))))) where (`smd__post_template`.`systemType` = 'custom') group by `smd__post_template`.`templateID`) union all (select `smd__post_template`.`templateID` AS `templateID`,`smd__post_template`.`headline` AS `headline`,`smd__post_template`.`subHeadline` AS `subHeadline`,`smd__post_template`.`mainCopy` AS `mainCopy`,`smd__post_template`.`userID` AS `userID`,`smd__post_template`.`organizationID` AS `organizationID`,`smd__post_template`.`socialType` AS `socialType`,`smd__post_template`.`createDate` AS `createDate`,`smd__post_template`.`modifyDate` AS `modifyDate`,`smd__post_template`.`status` AS `status`,`smd__post_template`.`signature` AS `signature`,`smd__post_template`.`feedTargetingOptions` AS `feedTargetingOptions`,`smd__post_template`.`archive` AS `archive`,`smd__post_template`.`systemType` AS `systemType`,NULL AS `organizationIDs` from `smd__post_template` where (((`smd__post_template`.`systemType` = 'branded') and exists(select `subPhpt`.`templateID` from `smd__partner_has_post_templates` `subPhpt` where ((`subPhpt`.`partnerID` = 11) and (`subPhpt`.`allowed` = 'yes') and (`subPhpt`.`templateID` = `smd__post_template`.`templateID`)))) or ((`smd__post_template`.`systemType` = 'generic') and (not(exists(select `subPhpt`.`templateID` from `smd__partner_has_post_templates` `subPhpt` where ((`subPhpt`.`partnerID` = 11) and (`subPhpt`.`templateID` = `smd__post_template`.`templateID`)))))))) ;

-- --------------------------------------------------------

--
-- Structure for view `view__template_13`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__template_13`  AS  (select `smd__post_template`.`templateID` AS `templateID`,`smd__post_template`.`headline` AS `headline`,`smd__post_template`.`subHeadline` AS `subHeadline`,`smd__post_template`.`mainCopy` AS `mainCopy`,`smd__post_template`.`userID` AS `userID`,`smd__post_template`.`organizationID` AS `organizationID`,`smd__post_template`.`socialType` AS `socialType`,`smd__post_template`.`createDate` AS `createDate`,`smd__post_template`.`modifyDate` AS `modifyDate`,`smd__post_template`.`status` AS `status`,`smd__post_template`.`signature` AS `signature`,`smd__post_template`.`feedTargetingOptions` AS `feedTargetingOptions`,`smd__post_template`.`archive` AS `archive`,`smd__post_template`.`systemType` AS `systemType`,group_concat(`sptho`.`organizationID` separator ',') AS `organizationIDs` from (`smd__post_template` join `smd__post_template_has_organizations` `sptho` on(((`sptho`.`templateID` = `smd__post_template`.`templateID`) and `sptho`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 13))))) where (`smd__post_template`.`systemType` = 'custom') group by `smd__post_template`.`templateID`) union all (select `smd__post_template`.`templateID` AS `templateID`,`smd__post_template`.`headline` AS `headline`,`smd__post_template`.`subHeadline` AS `subHeadline`,`smd__post_template`.`mainCopy` AS `mainCopy`,`smd__post_template`.`userID` AS `userID`,`smd__post_template`.`organizationID` AS `organizationID`,`smd__post_template`.`socialType` AS `socialType`,`smd__post_template`.`createDate` AS `createDate`,`smd__post_template`.`modifyDate` AS `modifyDate`,`smd__post_template`.`status` AS `status`,`smd__post_template`.`signature` AS `signature`,`smd__post_template`.`feedTargetingOptions` AS `feedTargetingOptions`,`smd__post_template`.`archive` AS `archive`,`smd__post_template`.`systemType` AS `systemType`,NULL AS `organizationIDs` from `smd__post_template` where (((`smd__post_template`.`systemType` = 'branded') and exists(select `subPhpt`.`templateID` from `smd__partner_has_post_templates` `subPhpt` where ((`subPhpt`.`partnerID` = 13) and (`subPhpt`.`allowed` = 'yes') and (`subPhpt`.`templateID` = `smd__post_template`.`templateID`)))) or ((`smd__post_template`.`systemType` = 'generic') and (not(exists(select `subPhpt`.`templateID` from `smd__partner_has_post_templates` `subPhpt` where ((`subPhpt`.`partnerID` = 13) and (`subPhpt`.`templateID` = `smd__post_template`.`templateID`)))))))) ;

-- --------------------------------------------------------

--
-- Structure for view `view__template_23`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__template_23`  AS  (select `smd__post_template`.`templateID` AS `templateID`,`smd__post_template`.`headline` AS `headline`,`smd__post_template`.`subHeadline` AS `subHeadline`,`smd__post_template`.`mainCopy` AS `mainCopy`,`smd__post_template`.`userID` AS `userID`,`smd__post_template`.`organizationID` AS `organizationID`,`smd__post_template`.`socialType` AS `socialType`,`smd__post_template`.`createDate` AS `createDate`,`smd__post_template`.`modifyDate` AS `modifyDate`,`smd__post_template`.`status` AS `status`,`smd__post_template`.`signature` AS `signature`,`smd__post_template`.`feedTargetingOptions` AS `feedTargetingOptions`,`smd__post_template`.`archive` AS `archive`,`smd__post_template`.`systemType` AS `systemType`,group_concat(`sptho`.`organizationID` separator ',') AS `organizationIDs` from (`smd__post_template` join `smd__post_template_has_organizations` `sptho` on(((`sptho`.`templateID` = `smd__post_template`.`templateID`) and `sptho`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 23))))) where (`smd__post_template`.`systemType` = 'custom') group by `smd__post_template`.`templateID`) union all (select `smd__post_template`.`templateID` AS `templateID`,`smd__post_template`.`headline` AS `headline`,`smd__post_template`.`subHeadline` AS `subHeadline`,`smd__post_template`.`mainCopy` AS `mainCopy`,`smd__post_template`.`userID` AS `userID`,`smd__post_template`.`organizationID` AS `organizationID`,`smd__post_template`.`socialType` AS `socialType`,`smd__post_template`.`createDate` AS `createDate`,`smd__post_template`.`modifyDate` AS `modifyDate`,`smd__post_template`.`status` AS `status`,`smd__post_template`.`signature` AS `signature`,`smd__post_template`.`feedTargetingOptions` AS `feedTargetingOptions`,`smd__post_template`.`archive` AS `archive`,`smd__post_template`.`systemType` AS `systemType`,NULL AS `organizationIDs` from `smd__post_template` where (((`smd__post_template`.`systemType` = 'branded') and exists(select `subPhpt`.`templateID` from `smd__partner_has_post_templates` `subPhpt` where ((`subPhpt`.`partnerID` = 23) and (`subPhpt`.`allowed` = 'yes') and (`subPhpt`.`templateID` = `smd__post_template`.`templateID`)))) or ((`smd__post_template`.`systemType` = 'generic') and (not(exists(select `subPhpt`.`templateID` from `smd__partner_has_post_templates` `subPhpt` where ((`subPhpt`.`partnerID` = 23) and (`subPhpt`.`templateID` = `smd__post_template`.`templateID`)))))))) ;

-- --------------------------------------------------------

--
-- Structure for view `view__template_24`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__template_24`  AS  (select `smd__post_template`.`templateID` AS `templateID`,`smd__post_template`.`headline` AS `headline`,`smd__post_template`.`subHeadline` AS `subHeadline`,`smd__post_template`.`mainCopy` AS `mainCopy`,`smd__post_template`.`userID` AS `userID`,`smd__post_template`.`organizationID` AS `organizationID`,`smd__post_template`.`socialType` AS `socialType`,`smd__post_template`.`createDate` AS `createDate`,`smd__post_template`.`modifyDate` AS `modifyDate`,`smd__post_template`.`status` AS `status`,`smd__post_template`.`signature` AS `signature`,`smd__post_template`.`feedTargetingOptions` AS `feedTargetingOptions`,`smd__post_template`.`archive` AS `archive`,`smd__post_template`.`systemType` AS `systemType`,group_concat(`sptho`.`organizationID` separator ',') AS `organizationIDs` from (`smd__post_template` join `smd__post_template_has_organizations` `sptho` on(((`sptho`.`templateID` = `smd__post_template`.`templateID`) and `sptho`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 24))))) where (`smd__post_template`.`systemType` = 'custom') group by `smd__post_template`.`templateID`) union all (select `smd__post_template`.`templateID` AS `templateID`,`smd__post_template`.`headline` AS `headline`,`smd__post_template`.`subHeadline` AS `subHeadline`,`smd__post_template`.`mainCopy` AS `mainCopy`,`smd__post_template`.`userID` AS `userID`,`smd__post_template`.`organizationID` AS `organizationID`,`smd__post_template`.`socialType` AS `socialType`,`smd__post_template`.`createDate` AS `createDate`,`smd__post_template`.`modifyDate` AS `modifyDate`,`smd__post_template`.`status` AS `status`,`smd__post_template`.`signature` AS `signature`,`smd__post_template`.`feedTargetingOptions` AS `feedTargetingOptions`,`smd__post_template`.`archive` AS `archive`,`smd__post_template`.`systemType` AS `systemType`,NULL AS `organizationIDs` from `smd__post_template` where (((`smd__post_template`.`systemType` = 'branded') and exists(select `subPhpt`.`templateID` from `smd__partner_has_post_templates` `subPhpt` where ((`subPhpt`.`partnerID` = 24) and (`subPhpt`.`allowed` = 'yes') and (`subPhpt`.`templateID` = `smd__post_template`.`templateID`)))) or ((`smd__post_template`.`systemType` = 'generic') and (not(exists(select `subPhpt`.`templateID` from `smd__partner_has_post_templates` `subPhpt` where ((`subPhpt`.`partnerID` = 24) and (`subPhpt`.`templateID` = `smd__post_template`.`templateID`)))))))) ;

-- --------------------------------------------------------

--
-- Structure for view `view__template_25`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__template_25`  AS  (select `smd__post_template`.`templateID` AS `templateID`,`smd__post_template`.`headline` AS `headline`,`smd__post_template`.`subHeadline` AS `subHeadline`,`smd__post_template`.`mainCopy` AS `mainCopy`,`smd__post_template`.`userID` AS `userID`,`smd__post_template`.`organizationID` AS `organizationID`,`smd__post_template`.`socialType` AS `socialType`,`smd__post_template`.`createDate` AS `createDate`,`smd__post_template`.`modifyDate` AS `modifyDate`,`smd__post_template`.`status` AS `status`,`smd__post_template`.`signature` AS `signature`,`smd__post_template`.`feedTargetingOptions` AS `feedTargetingOptions`,`smd__post_template`.`archive` AS `archive`,`smd__post_template`.`systemType` AS `systemType`,group_concat(`sptho`.`organizationID` separator ',') AS `organizationIDs` from (`smd__post_template` join `smd__post_template_has_organizations` `sptho` on(((`sptho`.`templateID` = `smd__post_template`.`templateID`) and `sptho`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 25))))) where (`smd__post_template`.`systemType` = 'custom') group by `smd__post_template`.`templateID`) union all (select `smd__post_template`.`templateID` AS `templateID`,`smd__post_template`.`headline` AS `headline`,`smd__post_template`.`subHeadline` AS `subHeadline`,`smd__post_template`.`mainCopy` AS `mainCopy`,`smd__post_template`.`userID` AS `userID`,`smd__post_template`.`organizationID` AS `organizationID`,`smd__post_template`.`socialType` AS `socialType`,`smd__post_template`.`createDate` AS `createDate`,`smd__post_template`.`modifyDate` AS `modifyDate`,`smd__post_template`.`status` AS `status`,`smd__post_template`.`signature` AS `signature`,`smd__post_template`.`feedTargetingOptions` AS `feedTargetingOptions`,`smd__post_template`.`archive` AS `archive`,`smd__post_template`.`systemType` AS `systemType`,NULL AS `organizationIDs` from `smd__post_template` where (((`smd__post_template`.`systemType` = 'branded') and exists(select `subPhpt`.`templateID` from `smd__partner_has_post_templates` `subPhpt` where ((`subPhpt`.`partnerID` = 25) and (`subPhpt`.`allowed` = 'yes') and (`subPhpt`.`templateID` = `smd__post_template`.`templateID`)))) or ((`smd__post_template`.`systemType` = 'generic') and (not(exists(select `subPhpt`.`templateID` from `smd__partner_has_post_templates` `subPhpt` where ((`subPhpt`.`partnerID` = 25) and (`subPhpt`.`templateID` = `smd__post_template`.`templateID`)))))))) ;

-- --------------------------------------------------------

--
-- Structure for view `view__template_60`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__template_60`  AS  (select `smd__post_template`.`templateID` AS `templateID`,`smd__post_template`.`headline` AS `headline`,`smd__post_template`.`subHeadline` AS `subHeadline`,`smd__post_template`.`mainCopy` AS `mainCopy`,`smd__post_template`.`userID` AS `userID`,`smd__post_template`.`organizationID` AS `organizationID`,`smd__post_template`.`socialType` AS `socialType`,`smd__post_template`.`createDate` AS `createDate`,`smd__post_template`.`modifyDate` AS `modifyDate`,`smd__post_template`.`status` AS `status`,`smd__post_template`.`signature` AS `signature`,`smd__post_template`.`feedTargetingOptions` AS `feedTargetingOptions`,`smd__post_template`.`archive` AS `archive`,`smd__post_template`.`systemType` AS `systemType`,group_concat(`sptho`.`organizationID` separator ',') AS `organizationIDs` from (`smd__post_template` join `smd__post_template_has_organizations` `sptho` on(((`sptho`.`templateID` = `smd__post_template`.`templateID`) and `sptho`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 60))))) where (`smd__post_template`.`systemType` = 'custom') group by `smd__post_template`.`templateID`) union all (select `smd__post_template`.`templateID` AS `templateID`,`smd__post_template`.`headline` AS `headline`,`smd__post_template`.`subHeadline` AS `subHeadline`,`smd__post_template`.`mainCopy` AS `mainCopy`,`smd__post_template`.`userID` AS `userID`,`smd__post_template`.`organizationID` AS `organizationID`,`smd__post_template`.`socialType` AS `socialType`,`smd__post_template`.`createDate` AS `createDate`,`smd__post_template`.`modifyDate` AS `modifyDate`,`smd__post_template`.`status` AS `status`,`smd__post_template`.`signature` AS `signature`,`smd__post_template`.`feedTargetingOptions` AS `feedTargetingOptions`,`smd__post_template`.`archive` AS `archive`,`smd__post_template`.`systemType` AS `systemType`,NULL AS `organizationIDs` from `smd__post_template` where (((`smd__post_template`.`systemType` = 'branded') and exists(select `subPhpt`.`templateID` from `smd__partner_has_post_templates` `subPhpt` where ((`subPhpt`.`partnerID` = 60) and (`subPhpt`.`allowed` = 'yes') and (`subPhpt`.`templateID` = `smd__post_template`.`templateID`)))) or ((`smd__post_template`.`systemType` = 'generic') and (not(exists(select `subPhpt`.`templateID` from `smd__partner_has_post_templates` `subPhpt` where ((`subPhpt`.`partnerID` = 60) and (`subPhpt`.`templateID` = `smd__post_template`.`templateID`)))))))) ;

-- --------------------------------------------------------

--
-- Structure for view `view__template_61`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__template_61`  AS  (select `smd__post_template`.`templateID` AS `templateID`,`smd__post_template`.`headline` AS `headline`,`smd__post_template`.`subHeadline` AS `subHeadline`,`smd__post_template`.`mainCopy` AS `mainCopy`,`smd__post_template`.`userID` AS `userID`,`smd__post_template`.`organizationID` AS `organizationID`,`smd__post_template`.`socialType` AS `socialType`,`smd__post_template`.`createDate` AS `createDate`,`smd__post_template`.`modifyDate` AS `modifyDate`,`smd__post_template`.`status` AS `status`,`smd__post_template`.`signature` AS `signature`,`smd__post_template`.`feedTargetingOptions` AS `feedTargetingOptions`,`smd__post_template`.`archive` AS `archive`,`smd__post_template`.`systemType` AS `systemType`,group_concat(`sptho`.`organizationID` separator ',') AS `organizationIDs` from (`smd__post_template` join `smd__post_template_has_organizations` `sptho` on(((`sptho`.`templateID` = `smd__post_template`.`templateID`) and `sptho`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 61))))) where (`smd__post_template`.`systemType` = 'custom') group by `smd__post_template`.`templateID`) union all (select `smd__post_template`.`templateID` AS `templateID`,`smd__post_template`.`headline` AS `headline`,`smd__post_template`.`subHeadline` AS `subHeadline`,`smd__post_template`.`mainCopy` AS `mainCopy`,`smd__post_template`.`userID` AS `userID`,`smd__post_template`.`organizationID` AS `organizationID`,`smd__post_template`.`socialType` AS `socialType`,`smd__post_template`.`createDate` AS `createDate`,`smd__post_template`.`modifyDate` AS `modifyDate`,`smd__post_template`.`status` AS `status`,`smd__post_template`.`signature` AS `signature`,`smd__post_template`.`feedTargetingOptions` AS `feedTargetingOptions`,`smd__post_template`.`archive` AS `archive`,`smd__post_template`.`systemType` AS `systemType`,NULL AS `organizationIDs` from `smd__post_template` where (((`smd__post_template`.`systemType` = 'branded') and exists(select `subPhpt`.`templateID` from `smd__partner_has_post_templates` `subPhpt` where ((`subPhpt`.`partnerID` = 61) and (`subPhpt`.`allowed` = 'yes') and (`subPhpt`.`templateID` = `smd__post_template`.`templateID`)))) or ((`smd__post_template`.`systemType` = 'generic') and (not(exists(select `subPhpt`.`templateID` from `smd__partner_has_post_templates` `subPhpt` where ((`subPhpt`.`partnerID` = 61) and (`subPhpt`.`templateID` = `smd__post_template`.`templateID`)))))))) ;

-- --------------------------------------------------------

--
-- Structure for view `view__template_62`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__template_62`  AS  (select `smd__post_template`.`templateID` AS `templateID`,`smd__post_template`.`headline` AS `headline`,`smd__post_template`.`subHeadline` AS `subHeadline`,`smd__post_template`.`mainCopy` AS `mainCopy`,`smd__post_template`.`userID` AS `userID`,`smd__post_template`.`organizationID` AS `organizationID`,`smd__post_template`.`socialType` AS `socialType`,`smd__post_template`.`createDate` AS `createDate`,`smd__post_template`.`modifyDate` AS `modifyDate`,`smd__post_template`.`status` AS `status`,`smd__post_template`.`signature` AS `signature`,`smd__post_template`.`feedTargetingOptions` AS `feedTargetingOptions`,`smd__post_template`.`archive` AS `archive`,`smd__post_template`.`systemType` AS `systemType`,group_concat(`sptho`.`organizationID` separator ',') AS `organizationIDs` from (`smd__post_template` join `smd__post_template_has_organizations` `sptho` on(((`sptho`.`templateID` = `smd__post_template`.`templateID`) and `sptho`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 62))))) where (`smd__post_template`.`systemType` = 'custom') group by `smd__post_template`.`templateID`) union all (select `smd__post_template`.`templateID` AS `templateID`,`smd__post_template`.`headline` AS `headline`,`smd__post_template`.`subHeadline` AS `subHeadline`,`smd__post_template`.`mainCopy` AS `mainCopy`,`smd__post_template`.`userID` AS `userID`,`smd__post_template`.`organizationID` AS `organizationID`,`smd__post_template`.`socialType` AS `socialType`,`smd__post_template`.`createDate` AS `createDate`,`smd__post_template`.`modifyDate` AS `modifyDate`,`smd__post_template`.`status` AS `status`,`smd__post_template`.`signature` AS `signature`,`smd__post_template`.`feedTargetingOptions` AS `feedTargetingOptions`,`smd__post_template`.`archive` AS `archive`,`smd__post_template`.`systemType` AS `systemType`,NULL AS `organizationIDs` from `smd__post_template` where (((`smd__post_template`.`systemType` = 'branded') and exists(select `subPhpt`.`templateID` from `smd__partner_has_post_templates` `subPhpt` where ((`subPhpt`.`partnerID` = 62) and (`subPhpt`.`allowed` = 'yes') and (`subPhpt`.`templateID` = `smd__post_template`.`templateID`)))) or ((`smd__post_template`.`systemType` = 'generic') and (not(exists(select `subPhpt`.`templateID` from `smd__partner_has_post_templates` `subPhpt` where ((`subPhpt`.`partnerID` = 62) and (`subPhpt`.`templateID` = `smd__post_template`.`templateID`)))))))) ;

-- --------------------------------------------------------

--
-- Structure for view `view__template_91`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__template_91`  AS  (select `smd__post_template`.`templateID` AS `templateID`,`smd__post_template`.`headline` AS `headline`,`smd__post_template`.`subHeadline` AS `subHeadline`,`smd__post_template`.`mainCopy` AS `mainCopy`,`smd__post_template`.`userID` AS `userID`,`smd__post_template`.`organizationID` AS `organizationID`,`smd__post_template`.`socialType` AS `socialType`,`smd__post_template`.`createDate` AS `createDate`,`smd__post_template`.`modifyDate` AS `modifyDate`,`smd__post_template`.`status` AS `status`,`smd__post_template`.`signature` AS `signature`,`smd__post_template`.`feedTargetingOptions` AS `feedTargetingOptions`,`smd__post_template`.`archive` AS `archive`,`smd__post_template`.`systemType` AS `systemType`,group_concat(`sptho`.`organizationID` separator ',') AS `organizationIDs` from (`smd__post_template` join `smd__post_template_has_organizations` `sptho` on(((`sptho`.`templateID` = `smd__post_template`.`templateID`) and `sptho`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 91))))) where (`smd__post_template`.`systemType` = 'custom') group by `smd__post_template`.`templateID`) union all (select `smd__post_template`.`templateID` AS `templateID`,`smd__post_template`.`headline` AS `headline`,`smd__post_template`.`subHeadline` AS `subHeadline`,`smd__post_template`.`mainCopy` AS `mainCopy`,`smd__post_template`.`userID` AS `userID`,`smd__post_template`.`organizationID` AS `organizationID`,`smd__post_template`.`socialType` AS `socialType`,`smd__post_template`.`createDate` AS `createDate`,`smd__post_template`.`modifyDate` AS `modifyDate`,`smd__post_template`.`status` AS `status`,`smd__post_template`.`signature` AS `signature`,`smd__post_template`.`feedTargetingOptions` AS `feedTargetingOptions`,`smd__post_template`.`archive` AS `archive`,`smd__post_template`.`systemType` AS `systemType`,NULL AS `organizationIDs` from `smd__post_template` where (((`smd__post_template`.`systemType` = 'branded') and exists(select `subPhpt`.`templateID` from `smd__partner_has_post_templates` `subPhpt` where ((`subPhpt`.`partnerID` = 91) and (`subPhpt`.`allowed` = 'yes') and (`subPhpt`.`templateID` = `smd__post_template`.`templateID`)))) or ((`smd__post_template`.`systemType` = 'generic') and (not(exists(select `subPhpt`.`templateID` from `smd__partner_has_post_templates` `subPhpt` where ((`subPhpt`.`partnerID` = 91) and (`subPhpt`.`templateID` = `smd__post_template`.`templateID`)))))))) ;

-- --------------------------------------------------------

--
-- Structure for view `view__template_102`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__template_102`  AS  (select `smd__post_template`.`templateID` AS `templateID`,`smd__post_template`.`headline` AS `headline`,`smd__post_template`.`subHeadline` AS `subHeadline`,`smd__post_template`.`mainCopy` AS `mainCopy`,`smd__post_template`.`userID` AS `userID`,`smd__post_template`.`organizationID` AS `organizationID`,`smd__post_template`.`socialType` AS `socialType`,`smd__post_template`.`createDate` AS `createDate`,`smd__post_template`.`modifyDate` AS `modifyDate`,`smd__post_template`.`status` AS `status`,`smd__post_template`.`signature` AS `signature`,`smd__post_template`.`feedTargetingOptions` AS `feedTargetingOptions`,`smd__post_template`.`archive` AS `archive`,`smd__post_template`.`systemType` AS `systemType`,group_concat(`sptho`.`organizationID` separator ',') AS `organizationIDs` from (`smd__post_template` join `smd__post_template_has_organizations` `sptho` on(((`sptho`.`templateID` = `smd__post_template`.`templateID`) and `sptho`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 102))))) where (`smd__post_template`.`systemType` = 'custom') group by `smd__post_template`.`templateID`) union all (select `smd__post_template`.`templateID` AS `templateID`,`smd__post_template`.`headline` AS `headline`,`smd__post_template`.`subHeadline` AS `subHeadline`,`smd__post_template`.`mainCopy` AS `mainCopy`,`smd__post_template`.`userID` AS `userID`,`smd__post_template`.`organizationID` AS `organizationID`,`smd__post_template`.`socialType` AS `socialType`,`smd__post_template`.`createDate` AS `createDate`,`smd__post_template`.`modifyDate` AS `modifyDate`,`smd__post_template`.`status` AS `status`,`smd__post_template`.`signature` AS `signature`,`smd__post_template`.`feedTargetingOptions` AS `feedTargetingOptions`,`smd__post_template`.`archive` AS `archive`,`smd__post_template`.`systemType` AS `systemType`,NULL AS `organizationIDs` from `smd__post_template` where (((`smd__post_template`.`systemType` = 'branded') and exists(select `subPhpt`.`templateID` from `smd__partner_has_post_templates` `subPhpt` where ((`subPhpt`.`partnerID` = 102) and (`subPhpt`.`allowed` = 'yes') and (`subPhpt`.`templateID` = `smd__post_template`.`templateID`)))) or ((`smd__post_template`.`systemType` = 'generic') and (not(exists(select `subPhpt`.`templateID` from `smd__partner_has_post_templates` `subPhpt` where ((`subPhpt`.`partnerID` = 102) and (`subPhpt`.`templateID` = `smd__post_template`.`templateID`)))))))) ;

-- --------------------------------------------------------

--
-- Structure for view `view__template_105`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__template_105`  AS  (select `smd__post_template`.`templateID` AS `templateID`,`smd__post_template`.`headline` AS `headline`,`smd__post_template`.`subHeadline` AS `subHeadline`,`smd__post_template`.`mainCopy` AS `mainCopy`,`smd__post_template`.`userID` AS `userID`,`smd__post_template`.`organizationID` AS `organizationID`,`smd__post_template`.`socialType` AS `socialType`,`smd__post_template`.`createDate` AS `createDate`,`smd__post_template`.`modifyDate` AS `modifyDate`,`smd__post_template`.`status` AS `status`,`smd__post_template`.`signature` AS `signature`,`smd__post_template`.`feedTargetingOptions` AS `feedTargetingOptions`,`smd__post_template`.`archive` AS `archive`,`smd__post_template`.`systemType` AS `systemType`,group_concat(`sptho`.`organizationID` separator ',') AS `organizationIDs` from (`smd__post_template` join `smd__post_template_has_organizations` `sptho` on(((`sptho`.`templateID` = `smd__post_template`.`templateID`) and `sptho`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 105))))) where (`smd__post_template`.`systemType` = 'custom') group by `smd__post_template`.`templateID`) union all (select `smd__post_template`.`templateID` AS `templateID`,`smd__post_template`.`headline` AS `headline`,`smd__post_template`.`subHeadline` AS `subHeadline`,`smd__post_template`.`mainCopy` AS `mainCopy`,`smd__post_template`.`userID` AS `userID`,`smd__post_template`.`organizationID` AS `organizationID`,`smd__post_template`.`socialType` AS `socialType`,`smd__post_template`.`createDate` AS `createDate`,`smd__post_template`.`modifyDate` AS `modifyDate`,`smd__post_template`.`status` AS `status`,`smd__post_template`.`signature` AS `signature`,`smd__post_template`.`feedTargetingOptions` AS `feedTargetingOptions`,`smd__post_template`.`archive` AS `archive`,`smd__post_template`.`systemType` AS `systemType`,NULL AS `organizationIDs` from `smd__post_template` where (((`smd__post_template`.`systemType` = 'branded') and exists(select `subPhpt`.`templateID` from `smd__partner_has_post_templates` `subPhpt` where ((`subPhpt`.`partnerID` = 105) and (`subPhpt`.`allowed` = 'yes') and (`subPhpt`.`templateID` = `smd__post_template`.`templateID`)))) or ((`smd__post_template`.`systemType` = 'generic') and (not(exists(select `subPhpt`.`templateID` from `smd__partner_has_post_templates` `subPhpt` where ((`subPhpt`.`partnerID` = 105) and (`subPhpt`.`templateID` = `smd__post_template`.`templateID`)))))))) ;

-- --------------------------------------------------------

--
-- Structure for view `view__template_114`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__template_114`  AS  (select `smd__post_template`.`templateID` AS `templateID`,`smd__post_template`.`headline` AS `headline`,`smd__post_template`.`subHeadline` AS `subHeadline`,`smd__post_template`.`mainCopy` AS `mainCopy`,`smd__post_template`.`userID` AS `userID`,`smd__post_template`.`organizationID` AS `organizationID`,`smd__post_template`.`socialType` AS `socialType`,`smd__post_template`.`createDate` AS `createDate`,`smd__post_template`.`modifyDate` AS `modifyDate`,`smd__post_template`.`status` AS `status`,`smd__post_template`.`signature` AS `signature`,`smd__post_template`.`feedTargetingOptions` AS `feedTargetingOptions`,`smd__post_template`.`archive` AS `archive`,`smd__post_template`.`systemType` AS `systemType`,group_concat(`sptho`.`organizationID` separator ',') AS `organizationIDs` from (`smd__post_template` join `smd__post_template_has_organizations` `sptho` on(((`sptho`.`templateID` = `smd__post_template`.`templateID`) and `sptho`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 114))))) where (`smd__post_template`.`systemType` = 'custom') group by `smd__post_template`.`templateID`) union all (select `smd__post_template`.`templateID` AS `templateID`,`smd__post_template`.`headline` AS `headline`,`smd__post_template`.`subHeadline` AS `subHeadline`,`smd__post_template`.`mainCopy` AS `mainCopy`,`smd__post_template`.`userID` AS `userID`,`smd__post_template`.`organizationID` AS `organizationID`,`smd__post_template`.`socialType` AS `socialType`,`smd__post_template`.`createDate` AS `createDate`,`smd__post_template`.`modifyDate` AS `modifyDate`,`smd__post_template`.`status` AS `status`,`smd__post_template`.`signature` AS `signature`,`smd__post_template`.`feedTargetingOptions` AS `feedTargetingOptions`,`smd__post_template`.`archive` AS `archive`,`smd__post_template`.`systemType` AS `systemType`,NULL AS `organizationIDs` from `smd__post_template` where (((`smd__post_template`.`systemType` = 'branded') and exists(select `subPhpt`.`templateID` from `smd__partner_has_post_templates` `subPhpt` where ((`subPhpt`.`partnerID` = 114) and (`subPhpt`.`allowed` = 'yes') and (`subPhpt`.`templateID` = `smd__post_template`.`templateID`)))) or ((`smd__post_template`.`systemType` = 'generic') and (not(exists(select `subPhpt`.`templateID` from `smd__partner_has_post_templates` `subPhpt` where ((`subPhpt`.`partnerID` = 114) and (`subPhpt`.`templateID` = `smd__post_template`.`templateID`)))))))) ;

-- --------------------------------------------------------

--
-- Structure for view `view__template_138`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__template_138`  AS  (select `smd__post_template`.`templateID` AS `templateID`,`smd__post_template`.`headline` AS `headline`,`smd__post_template`.`subHeadline` AS `subHeadline`,`smd__post_template`.`mainCopy` AS `mainCopy`,`smd__post_template`.`userID` AS `userID`,`smd__post_template`.`organizationID` AS `organizationID`,`smd__post_template`.`socialType` AS `socialType`,`smd__post_template`.`createDate` AS `createDate`,`smd__post_template`.`modifyDate` AS `modifyDate`,`smd__post_template`.`status` AS `status`,`smd__post_template`.`signature` AS `signature`,`smd__post_template`.`feedTargetingOptions` AS `feedTargetingOptions`,`smd__post_template`.`archive` AS `archive`,`smd__post_template`.`systemType` AS `systemType`,group_concat(`sptho`.`organizationID` separator ',') AS `organizationIDs` from (`smd__post_template` join `smd__post_template_has_organizations` `sptho` on(((`sptho`.`templateID` = `smd__post_template`.`templateID`) and `sptho`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 138))))) where (`smd__post_template`.`systemType` = 'custom') group by `smd__post_template`.`templateID`) union all (select `smd__post_template`.`templateID` AS `templateID`,`smd__post_template`.`headline` AS `headline`,`smd__post_template`.`subHeadline` AS `subHeadline`,`smd__post_template`.`mainCopy` AS `mainCopy`,`smd__post_template`.`userID` AS `userID`,`smd__post_template`.`organizationID` AS `organizationID`,`smd__post_template`.`socialType` AS `socialType`,`smd__post_template`.`createDate` AS `createDate`,`smd__post_template`.`modifyDate` AS `modifyDate`,`smd__post_template`.`status` AS `status`,`smd__post_template`.`signature` AS `signature`,`smd__post_template`.`feedTargetingOptions` AS `feedTargetingOptions`,`smd__post_template`.`archive` AS `archive`,`smd__post_template`.`systemType` AS `systemType`,NULL AS `organizationIDs` from `smd__post_template` where (((`smd__post_template`.`systemType` = 'branded') and exists(select `subPhpt`.`templateID` from `smd__partner_has_post_templates` `subPhpt` where ((`subPhpt`.`partnerID` = 138) and (`subPhpt`.`allowed` = 'yes') and (`subPhpt`.`templateID` = `smd__post_template`.`templateID`)))) or ((`smd__post_template`.`systemType` = 'generic') and (not(exists(select `subPhpt`.`templateID` from `smd__partner_has_post_templates` `subPhpt` where ((`subPhpt`.`partnerID` = 138) and (`subPhpt`.`templateID` = `smd__post_template`.`templateID`)))))))) ;

-- --------------------------------------------------------

--
-- Structure for view `view__template_181`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__template_181`  AS  (select `smd__post_template`.`templateID` AS `templateID`,`smd__post_template`.`headline` AS `headline`,`smd__post_template`.`subHeadline` AS `subHeadline`,`smd__post_template`.`mainCopy` AS `mainCopy`,`smd__post_template`.`userID` AS `userID`,`smd__post_template`.`organizationID` AS `organizationID`,`smd__post_template`.`socialType` AS `socialType`,`smd__post_template`.`createDate` AS `createDate`,`smd__post_template`.`modifyDate` AS `modifyDate`,`smd__post_template`.`status` AS `status`,`smd__post_template`.`signature` AS `signature`,`smd__post_template`.`feedTargetingOptions` AS `feedTargetingOptions`,`smd__post_template`.`archive` AS `archive`,`smd__post_template`.`systemType` AS `systemType`,group_concat(`sptho`.`organizationID` separator ',') AS `organizationIDs` from (`smd__post_template` join `smd__post_template_has_organizations` `sptho` on(((`sptho`.`templateID` = `smd__post_template`.`templateID`) and `sptho`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 181))))) where (`smd__post_template`.`systemType` = 'custom') group by `smd__post_template`.`templateID`) union all (select `smd__post_template`.`templateID` AS `templateID`,`smd__post_template`.`headline` AS `headline`,`smd__post_template`.`subHeadline` AS `subHeadline`,`smd__post_template`.`mainCopy` AS `mainCopy`,`smd__post_template`.`userID` AS `userID`,`smd__post_template`.`organizationID` AS `organizationID`,`smd__post_template`.`socialType` AS `socialType`,`smd__post_template`.`createDate` AS `createDate`,`smd__post_template`.`modifyDate` AS `modifyDate`,`smd__post_template`.`status` AS `status`,`smd__post_template`.`signature` AS `signature`,`smd__post_template`.`feedTargetingOptions` AS `feedTargetingOptions`,`smd__post_template`.`archive` AS `archive`,`smd__post_template`.`systemType` AS `systemType`,NULL AS `organizationIDs` from `smd__post_template` where (((`smd__post_template`.`systemType` = 'branded') and exists(select `subPhpt`.`templateID` from `smd__partner_has_post_templates` `subPhpt` where ((`subPhpt`.`partnerID` = 181) and (`subPhpt`.`allowed` = 'yes') and (`subPhpt`.`templateID` = `smd__post_template`.`templateID`)))) or ((`smd__post_template`.`systemType` = 'generic') and (not(exists(select `subPhpt`.`templateID` from `smd__partner_has_post_templates` `subPhpt` where ((`subPhpt`.`partnerID` = 181) and (`subPhpt`.`templateID` = `smd__post_template`.`templateID`)))))))) ;

-- --------------------------------------------------------

--
-- Structure for view `view__template_183`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__template_183`  AS  (select `smd__post_template`.`templateID` AS `templateID`,`smd__post_template`.`headline` AS `headline`,`smd__post_template`.`subHeadline` AS `subHeadline`,`smd__post_template`.`mainCopy` AS `mainCopy`,`smd__post_template`.`userID` AS `userID`,`smd__post_template`.`organizationID` AS `organizationID`,`smd__post_template`.`socialType` AS `socialType`,`smd__post_template`.`createDate` AS `createDate`,`smd__post_template`.`modifyDate` AS `modifyDate`,`smd__post_template`.`status` AS `status`,`smd__post_template`.`signature` AS `signature`,`smd__post_template`.`feedTargetingOptions` AS `feedTargetingOptions`,`smd__post_template`.`archive` AS `archive`,`smd__post_template`.`systemType` AS `systemType`,group_concat(`sptho`.`organizationID` separator ',') AS `organizationIDs` from (`smd__post_template` join `smd__post_template_has_organizations` `sptho` on(((`sptho`.`templateID` = `smd__post_template`.`templateID`) and `sptho`.`organizationID` in (select `smd__organization`.`organizationID` from `smd__organization` where (`smd__organization`.`partnerID` = 183))))) where (`smd__post_template`.`systemType` = 'custom') group by `smd__post_template`.`templateID`) union all (select `smd__post_template`.`templateID` AS `templateID`,`smd__post_template`.`headline` AS `headline`,`smd__post_template`.`subHeadline` AS `subHeadline`,`smd__post_template`.`mainCopy` AS `mainCopy`,`smd__post_template`.`userID` AS `userID`,`smd__post_template`.`organizationID` AS `organizationID`,`smd__post_template`.`socialType` AS `socialType`,`smd__post_template`.`createDate` AS `createDate`,`smd__post_template`.`modifyDate` AS `modifyDate`,`smd__post_template`.`status` AS `status`,`smd__post_template`.`signature` AS `signature`,`smd__post_template`.`feedTargetingOptions` AS `feedTargetingOptions`,`smd__post_template`.`archive` AS `archive`,`smd__post_template`.`systemType` AS `systemType`,NULL AS `organizationIDs` from `smd__post_template` where (((`smd__post_template`.`systemType` = 'branded') and exists(select `subPhpt`.`templateID` from `smd__partner_has_post_templates` `subPhpt` where ((`subPhpt`.`partnerID` = 183) and (`subPhpt`.`allowed` = 'yes') and (`subPhpt`.`templateID` = `smd__post_template`.`templateID`)))) or ((`smd__post_template`.`systemType` = 'generic') and (not(exists(select `subPhpt`.`templateID` from `smd__partner_has_post_templates` `subPhpt` where ((`subPhpt`.`partnerID` = 183) and (`subPhpt`.`templateID` = `smd__post_template`.`templateID`)))))))) ;

-- --------------------------------------------------------

--
-- Structure for view `view__template_administration`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view__template_administration`  AS  (select `smd__post_template`.`templateID` AS `templateID`,`smd__post_template`.`headline` AS `headline`,`smd__post_template`.`subHeadline` AS `subHeadline`,`smd__post_template`.`mainCopy` AS `mainCopy`,`smd__post_template`.`userID` AS `userID`,`smd__post_template`.`organizationID` AS `organizationID`,`smd__post_template`.`socialType` AS `socialType`,`smd__post_template`.`createDate` AS `createDate`,`smd__post_template`.`modifyDate` AS `modifyDate`,`smd__post_template`.`status` AS `status`,`smd__post_template`.`signature` AS `signature`,`smd__post_template`.`feedTargetingOptions` AS `feedTargetingOptions`,`smd__post_template`.`archive` AS `archive`,`smd__post_template`.`systemType` AS `systemType`,NULL AS `partnerIDs`,group_concat(`sphpt`.`partnerID` separator ',') AS `disallowedPartnerIDs` from (`smd__post_template` left join `smd__partner_has_post_templates` `sphpt` on(((`sphpt`.`templateID` = `smd__post_template`.`templateID`) and (`sphpt`.`allowed` = 'no')))) where (`smd__post_template`.`systemType` = 'generic') group by `smd__post_template`.`templateID`) union all (select `smd__post_template`.`templateID` AS `templateID`,`smd__post_template`.`headline` AS `headline`,`smd__post_template`.`subHeadline` AS `subHeadline`,`smd__post_template`.`mainCopy` AS `mainCopy`,`smd__post_template`.`userID` AS `userID`,`smd__post_template`.`organizationID` AS `organizationID`,`smd__post_template`.`socialType` AS `socialType`,`smd__post_template`.`createDate` AS `createDate`,`smd__post_template`.`modifyDate` AS `modifyDate`,`smd__post_template`.`status` AS `status`,`smd__post_template`.`signature` AS `signature`,`smd__post_template`.`feedTargetingOptions` AS `feedTargetingOptions`,`smd__post_template`.`archive` AS `archive`,`smd__post_template`.`systemType` AS `systemType`,group_concat(`sphpt`.`partnerID` separator ',') AS `partnerIDs`,NULL AS `disallowedPartnerIDs` from (`smd__post_template` left join `smd__partner_has_post_templates` `sphpt` on(((`sphpt`.`templateID` = `smd__post_template`.`templateID`) and (`sphpt`.`allowed` = 'yes')))) where (`smd__post_template`.`systemType` = 'branded') group by `smd__post_template`.`templateID`) ;

--
-- Indexes for table `cms__column`
--
ALTER TABLE `cms__column`
  ADD PRIMARY KEY (`columnID`),
  ADD UNIQUE KEY `unique_name` (`name`),
  ADD KEY `index_layoutID` (`layoutID`) USING BTREE;

--
-- Indexes for table `cms__column_has_panels`
--
ALTER TABLE `cms__column_has_panels`
  ADD PRIMARY KEY (`columnID`,`panelID`),
  ADD KEY `index_columnID1` (`columnID`) USING BTREE,
  ADD KEY `index_maxPerColumn` (`maxPerColumn`) USING BTREE,
  ADD KEY `index_panelID1` (`panelID`) USING BTREE;

--
-- Indexes for table `cms__domain`
--
ALTER TABLE `cms__domain`
  ADD PRIMARY KEY (`domainID`),
  ADD UNIQUE KEY `unique_name` (`name`),
  ADD KEY `index_defaultSiteID` (`defaultSiteID`) USING BTREE;

--
-- Indexes for table `cms__file`
--
ALTER TABLE `cms__file`
  ADD PRIMARY KEY (`fileID`),
  ADD UNIQUE KEY `unique_url` (`url`),
  ADD UNIQUE KEY `unique_alias` (`alias`),
  ADD KEY `index_createDate1` (`createDate`) USING BTREE,
  ADD KEY `index_folderID` (`folderID`) USING BTREE,
  ADD KEY `index_modifyDate1` (`modifyDate`) USING BTREE,
  ADD KEY `index_name` (`name`) USING BTREE,
  ADD KEY `index_position` (`position`) USING BTREE,
  ADD KEY `index_status3` (`status`) USING BTREE,
  ADD KEY `index_type` (`type`) USING BTREE,
  ADD KEY `index_userID2` (`userID`);

--
-- Indexes for table `cms__file_has_files`
--
ALTER TABLE `cms__file_has_files`
  ADD PRIMARY KEY (`fileID`,`otherFileID`,`type`),
  ADD KEY `index_fileID` (`fileID`) USING BTREE,
  ADD KEY `index_otherFileID` (`otherFileID`) USING BTREE,
  ADD KEY `index_type1` (`type`) USING BTREE;

--
-- Indexes for table `cms__file_link`
--
ALTER TABLE `cms__file_link`
  ADD PRIMARY KEY (`fileID`),
  ADD KEY `index_linkFileID` (`linkFileID`) USING BTREE,
  ADD KEY `index_linkFolderID` (`linkFolderID`) USING BTREE,
  ADD KEY `index_linkUrl` (`linkUrl`) USING BTREE,
  ADD KEY `index_target` (`target`) USING BTREE;

--
-- Indexes for table `cms__file_page`
--
ALTER TABLE `cms__file_page`
  ADD PRIMARY KEY (`fileID`),
  ADD KEY `index_editMode` (`editMode`) USING BTREE,
  ADD KEY `index_layoutID1` (`layoutID`) USING BTREE;

--
-- Indexes for table `cms__file_page_has_panels`
--
ALTER TABLE `cms__file_page_has_panels`
  ADD PRIMARY KEY (`phpID`),
  ADD KEY `index_columnID` (`columnID`) USING BTREE,
  ADD KEY `index_fileID2` (`fileID`) USING BTREE,
  ADD KEY `index_panelVariantID` (`panelVariantID`) USING BTREE,
  ADD KEY `index_position2` (`position`) USING BTREE;

--
-- Indexes for table `cms__file_static`
--
ALTER TABLE `cms__file_static`
  ADD PRIMARY KEY (`fileID`),
  ADD UNIQUE KEY `unique_realPath` (`realPath`),
  ADD KEY `index_mime` (`mime`) USING BTREE,
  ADD KEY `index_type5` (`type`),
  ADD KEY `index_organizationID1` (`organizationID`),
  ADD KEY `index_previewFileID` (`previewFileID`),
  ADD KEY `index_systemType1` (`systemType`),
  ADD KEY `index_data_width` (`data_width`),
  ADD KEY `index_data_height` (`data_height`);

--
-- Indexes for table `cms__folder`
--
ALTER TABLE `cms__folder`
  ADD PRIMARY KEY (`folderID`),
  ADD UNIQUE KEY `unique_url` (`url`),
  ADD UNIQUE KEY `unique_alias` (`alias`),
  ADD KEY `index_createDate2` (`createDate`) USING BTREE,
  ADD KEY `index_defaultFileID` (`defaultFileID`) USING BTREE,
  ADD KEY `index_modifyDate2` (`modifyDate`) USING BTREE,
  ADD KEY `index_name1` (`name`) USING BTREE,
  ADD KEY `index_parentID` (`parentID`) USING BTREE,
  ADD KEY `index_position1` (`position`) USING BTREE;

--
-- Indexes for table `cms__group`
--
ALTER TABLE `cms__group`
  ADD PRIMARY KEY (`groupID`),
  ADD KEY `index_guest` (`guest`) USING BTREE,
  ADD KEY `index_status1` (`status`) USING BTREE;

--
-- Indexes for table `cms__group_has_files`
--
ALTER TABLE `cms__group_has_files`
  ADD PRIMARY KEY (`groupID`,`fileID`),
  ADD KEY `index_fileID1` (`fileID`) USING BTREE,
  ADD KEY `index_groupID4` (`groupID`) USING BTREE;

--
-- Indexes for table `cms__group_has_folders`
--
ALTER TABLE `cms__group_has_folders`
  ADD PRIMARY KEY (`groupID`,`folderID`),
  ADD KEY `index_folderID1` (`folderID`) USING BTREE,
  ADD KEY `index_groupID3` (`groupID`) USING BTREE;

--
-- Indexes for table `cms__group_has_groups`
--
ALTER TABLE `cms__group_has_groups`
  ADD PRIMARY KEY (`groupID`,`otherGroupID`),
  ADD KEY `index_groupID1` (`groupID`) USING BTREE,
  ADD KEY `index_otherGroupID` (`otherGroupID`) USING BTREE;

--
-- Indexes for table `cms__group_has_roles`
--
ALTER TABLE `cms__group_has_roles`
  ADD PRIMARY KEY (`groupID`,`roleID`),
  ADD KEY `index_groupID2` (`groupID`) USING BTREE,
  ADD KEY `index_roleID1` (`roleID`) USING BTREE;

--
-- Indexes for table `cms__language`
--
ALTER TABLE `cms__language`
  ADD PRIMARY KEY (`languageID`),
  ADD UNIQUE KEY `unique_dir` (`dir`),
  ADD UNIQUE KEY `unique_name` (`name`),
  ADD KEY `index_locale` (`locale`) USING BTREE,
  ADD KEY `index_status2` (`status`) USING BTREE,
  ADD KEY `index_type4` (`type`) USING BTREE;

--
-- Indexes for table `cms__layout`
--
ALTER TABLE `cms__layout`
  ADD PRIMARY KEY (`layoutID`),
  ADD UNIQUE KEY `unique_fileName` (`fileName`),
  ADD UNIQUE KEY `unique_name` (`name`);

--
-- Indexes for table `cms__module`
--
ALTER TABLE `cms__module`
  ADD PRIMARY KEY (`moduleID`),
  ADD UNIQUE KEY `unique_name` (`name`);

--
-- Indexes for table `cms__panel`
--
ALTER TABLE `cms__panel`
  ADD PRIMARY KEY (`panelID`),
  ADD UNIQUE KEY `unique_name` (`name`),
  ADD KEY `index_exclusive` (`exclusive`) USING BTREE,
  ADD KEY `index_moduleID2` (`moduleID`) USING BTREE,
  ADD KEY `index_status4` (`status`) USING BTREE;

--
-- Indexes for table `cms__panel_variant`
--
ALTER TABLE `cms__panel_variant`
  ADD PRIMARY KEY (`panelVariantID`),
  ADD KEY `index_panelID` (`panelID`) USING BTREE,
  ADD KEY `index_status5` (`status`) USING BTREE,
  ADD KEY `index_type2` (`type`) USING BTREE;

--
-- Indexes for table `cms__resource`
--
ALTER TABLE `cms__resource`
  ADD PRIMARY KEY (`resourceID`),
  ADD KEY `index_moduleID` (`moduleID`) USING BTREE;

--
-- Indexes for table `cms__role`
--
ALTER TABLE `cms__role`
  ADD PRIMARY KEY (`roleID`),
  ADD UNIQUE KEY `unique_name` (`name`),
  ADD KEY `index_moduleID1` (`moduleID`) USING BTREE;

--
-- Indexes for table `cms__role_has_resources`
--
ALTER TABLE `cms__role_has_resources`
  ADD PRIMARY KEY (`roleID`,`resourceID`),
  ADD KEY `index_resourceID` (`resourceID`) USING BTREE,
  ADD KEY `index_roleID` (`roleID`) USING BTREE;

--
-- Indexes for table `cms__site`
--
ALTER TABLE `cms__site`
  ADD PRIMARY KEY (`siteID`),
  ADD KEY `index_errorFileID` (`errorFileID`) USING BTREE,
  ADD KEY `index_languageID` (`languageID`) USING BTREE,
  ADD KEY `index_loginFileID` (`loginFileID`) USING BTREE,
  ADD KEY `index_registerFileID` (`registerFileID`) USING BTREE,
  ADD KEY `index_registerGroupID` (`registerGroupID`) USING BTREE,
  ADD KEY `index_rootFolderID` (`rootFolderID`) USING BTREE;

--
-- Indexes for table `cms__site_has_domains`
--
ALTER TABLE `cms__site_has_domains`
  ADD PRIMARY KEY (`siteID`,`domainID`),
  ADD KEY `index_domainID` (`domainID`) USING BTREE,
  ADD KEY `index_siteID` (`siteID`) USING BTREE;

--
-- Indexes for table `cms__tag`
--
ALTER TABLE `cms__tag`
  ADD PRIMARY KEY (`tagID`),
  ADD UNIQUE KEY `unique_name_type` (`name`,`type`,`partnerID`),
  ADD KEY `index_name2` (`name`) USING BTREE,
  ADD KEY `index_type3` (`type`) USING BTREE,
  ADD KEY `index_tagID` (`tagID`) USING BTREE,
  ADD KEY `index_organizationID2` (`partnerID`);

--
-- Indexes for table `cron__jobs`
--
ALTER TABLE `cron__jobs`
  ADD PRIMARY KEY (`taskName`);

--
-- Indexes for table `smd__activity`
--
ALTER TABLE `smd__activity`
  ADD PRIMARY KEY (`activityID`),
  ADD KEY `activityDate` (`activityDate`) USING BTREE,
  ADD KEY `fk_smd__activity_cms__user1` (`userID`) USING BTREE,
  ADD KEY `objectType` (`objectType`) USING BTREE;

--
-- Indexes for table `smd__addon`
--
ALTER TABLE `smd__addon`
  ADD PRIMARY KEY (`addonID`),
  ADD UNIQUE KEY `unique_addonID` (`addonID`),
  ADD UNIQUE KEY `unique_zohoAddonID` (`zohoAddonID`);

--
-- Indexes for table `smd__autofeed_post_time`
--
ALTER TABLE `smd__autofeed_post_time`
  ADD PRIMARY KEY (`postTimeID`),
  ADD KEY `index_day` (`days`),
  ADD KEY `index_time` (`time`),
  ADD KEY `index_organizationID1` (`settingID`),
  ADD KEY `index_categoryID` (`categoryID`),
  ADD KEY `index_multiple` (`multiple`);

--
-- Indexes for table `smd__autofeed_post_time_has_posts`
--
ALTER TABLE `smd__autofeed_post_time_has_posts`
  ADD PRIMARY KEY (`postID`),
  ADD KEY `index_postTimeID` (`postTimeID`),
  ADD KEY `index_postID3` (`postID`),
  ADD KEY `index_date` (`date`);

--
-- Indexes for table `smd__autofeed_preset`
--
ALTER TABLE `smd__autofeed_preset`
  ADD PRIMARY KEY (`presetID`),
  ADD KEY `index_presetID` (`presetID`),
  ADD KEY `index_createDate13` (`createDate`),
  ADD KEY `index_name4` (`name`);

--
-- Indexes for table `smd__autofeed_settings`
--
ALTER TABLE `smd__autofeed_settings`
  ADD PRIMARY KEY (`settingID`),
  ADD KEY `index_organizationID` (`organizationID`),
  ADD KEY `index_status` (`status`);

--
-- Indexes for table `smd__carousel`
--
ALTER TABLE `smd__carousel`
  ADD PRIMARY KEY (`carouselID`),
  ADD KEY `index_status8` (`status`),
  ADD KEY `index_createDate4` (`createDate`),
  ADD KEY `index_modifyDate4` (`modifyDate`),
  ADD KEY `index_userID3` (`userID`),
  ADD KEY `index_systemType` (`systemType`);

--
-- Indexes for table `smd__carousel_item`
--
ALTER TABLE `smd__carousel_item`
  ADD PRIMARY KEY (`itemID`),
  ADD KEY `index_carouselID1` (`carouselID`),
  ADD KEY `index_imageFileID` (`imageFileID`),
  ADD KEY `index_position3` (`position`),
  ADD KEY `index_status9` (`status`);

--
-- Indexes for table `smd__category`
--
ALTER TABLE `smd__category`
  ADD PRIMARY KEY (`categoryID`),
  ADD UNIQUE KEY `unique_categoryID` (`categoryID`),
  ADD KEY `index_name1` (`name`),
  ADD KEY `index_partnerID3` (`partnerID`);

--
-- Indexes for table `smd__comment`
--
ALTER TABLE `smd__comment`
  ADD PRIMARY KEY (`commentID`),
  ADD UNIQUE KEY `unique_commentID` (`commentID`),
  ADD KEY `index_objectID` (`objectID`),
  ADD KEY `index_objectType` (`objectType`),
  ADD KEY `index_userID` (`userID`),
  ADD KEY `index_createDate5` (`createDate`);

--
-- Indexes for table `smd__dashboard`
--
ALTER TABLE `smd__dashboard`
  ADD PRIMARY KEY (`dashboardID`),
  ADD UNIQUE KEY `unique_dashboardID` (`dashboardID`);

--
-- Indexes for table `smd__dashboard_has_users`
--
ALTER TABLE `smd__dashboard_has_users`
  ADD PRIMARY KEY (`dashboardID`,`userID`),
  ADD KEY `index_userID1` (`userID`),
  ADD KEY `index_dashboardID` (`dashboardID`);

--
-- Indexes for table `smd__default_role`
--
ALTER TABLE `smd__default_role`
  ADD PRIMARY KEY (`defaultRoleID`),
  ADD KEY `index_name3` (`name`),
  ADD KEY `index_status10` (`status`),
  ADD KEY `index_admin` (`admin`);

--
-- Indexes for table `smd__default_role_has_resources`
--
ALTER TABLE `smd__default_role_has_resources`
  ADD PRIMARY KEY (`defaultRoleID`,`resourceID`),
  ADD KEY `index_resourceID2` (`resourceID`),
  ADD KEY `index_defaultRoleID` (`defaultRoleID`);

--
-- Indexes for table `smd__email_queue`
--
ALTER TABLE `smd__email_queue`
  ADD PRIMARY KEY (`emailQueueID`),
  ADD UNIQUE KEY `unique_emailQueueID` (`emailQueueID`),
  ADD KEY `index_timestamp` (`createDate`),
  ADD KEY `index_sent` (`sent`),
  ADD KEY `index_attempt` (`attempt`),
  ADD KEY `index_maxAttempts` (`maxAttempts`),
  ADD KEY `index_lastAttempt` (`lastAttempt`);

--
-- Indexes for table `smd__events`
--
ALTER TABLE `smd__events`
  ADD PRIMARY KEY (`eventID`),
  ADD UNIQUE KEY `unique_eventID` (`eventID`),
  ADD KEY `index_eventTime` (`eventTime`),
  ADD KEY `index_status1` (`status`),
  ADD KEY `index_type8` (`type`);

--
-- Indexes for table `smd__hashtag_collection`
--
ALTER TABLE `smd__hashtag_collection`
  ADD PRIMARY KEY (`collectionID`),
  ADD UNIQUE KEY `unique_collectionID` (`collectionID`),
  ADD KEY `index_name` (`name`) USING BTREE,
  ADD KEY `index_createDate8` (`createDate`);

--
-- Indexes for table `smd__hashtag_tag`
--
ALTER TABLE `smd__hashtag_tag`
  ADD PRIMARY KEY (`tagID`),
  ADD UNIQUE KEY `unique_tagID` (`tagID`),
  ADD KEY `index_tag` (`tag`) USING BTREE,
  ADD KEY `index_createDate9` (`createDate`);

--
-- Indexes for table `smd__limit`
--
ALTER TABLE `smd__limit`
  ADD PRIMARY KEY (`date`,`partnerID`),
  ADD KEY `index_partnerID4` (`partnerID`),
  ADD KEY `index_date1` (`date`),
  ADD KEY `index_rssLimit` (`postFromRssNumber`),
  ADD KEY `index_postLimit` (`postFromTemplateNumber`),
  ADD KEY `index_rssUrlNumber` (`rssUrlNumber`),
  ADD KEY `index_postFromMediaNumber` (`postFromMediaNumber`);

--
-- Indexes for table `smd__media_has_categories`
--
ALTER TABLE `smd__media_has_categories`
  ADD PRIMARY KEY (`mediaID`,`categoryID`,`mediaType`),
  ADD KEY `index_categoryID2` (`categoryID`),
  ADD KEY `index_mediaID2` (`mediaID`),
  ADD KEY `index_mediaType3` (`mediaType`);

--
-- Indexes for table `smd__media_has_tags`
--
ALTER TABLE `smd__media_has_tags`
  ADD PRIMARY KEY (`mediaID`,`tagID`,`mediaType`),
  ADD KEY `index_tagID1` (`tagID`),
  ADD KEY `index_mediaID` (`mediaID`),
  ADD KEY `index_mediaType` (`mediaType`);

--
-- Indexes for table `smd__messaging_feed`
--
ALTER TABLE `smd__messaging_feed`
  ADD PRIMARY KEY (`feedID`),
  ADD UNIQUE KEY `unique_feedID` (`feedID`),
  ADD KEY `index_pageID2` (`pageID`),
  ADD KEY `index_entityID` (`entityID`),
  ADD KEY `index_status12` (`status`),
  ADD KEY `index_createdTime` (`createdTime`),
  ADD KEY `index_lastInteractionTime` (`lastInteractionTime`),
  ADD KEY `index_fromID` (`fromID`),
  ADD KEY `index_type9` (`type`),
  ADD KEY `index_socialType2` (`socialType`);

--
-- Indexes for table `smd__messaging_webhook_events`
--
ALTER TABLE `smd__messaging_webhook_events`
  ADD PRIMARY KEY (`eventID`),
  ADD UNIQUE KEY `unique_eventID` (`eventID`),
  ADD KEY `index_object` (`object`),
  ADD KEY `index_entryID` (`entryID`),
  ADD KEY `index_entryTime` (`entryTime`),
  ADD KEY `index_processed` (`processed`),
  ADD KEY `index_socialType1` (`socialType`);

--
-- Indexes for table `smd__organization`
--
ALTER TABLE `smd__organization`
  ADD PRIMARY KEY (`organizationID`),
  ADD KEY `index_parentID` (`parentID`),
  ADD KEY `index_partnerID` (`partnerID`);

--
-- Indexes for table `smd__organization_has_autofeed_preset`
--
ALTER TABLE `smd__organization_has_autofeed_preset`
  ADD PRIMARY KEY (`organizationID`,`presetID`),
  ADD UNIQUE KEY `unique` (`organizationID`,`presetID`),
  ADD KEY `index_presetID1` (`presetID`),
  ADD KEY `index_organizationID10` (`organizationID`);

--
-- Indexes for table `smd__organization_has_hashtag_collection`
--
ALTER TABLE `smd__organization_has_hashtag_collection`
  ADD PRIMARY KEY (`collectionID`,`organizationID`),
  ADD KEY `index_organizationID` (`organizationID`),
  ADD KEY `index_collectionID` (`collectionID`);

--
-- Indexes for table `smd__organization_has_hashtag_tag`
--
ALTER TABLE `smd__organization_has_hashtag_tag`
  ADD PRIMARY KEY (`organizationID`,`tagID`),
  ADD KEY `index_tagID2` (`tagID`) USING BTREE,
  ADD KEY `index_organizationID7` (`organizationID`) USING BTREE;

--
-- Indexes for table `smd__organization_has_media`
--
ALTER TABLE `smd__organization_has_media`
  ADD PRIMARY KEY (`mediaID`,`mediaType`,`organizationID`),
  ADD KEY `index_organizationID3` (`organizationID`),
  ADD KEY `index_mediaType2` (`mediaType`),
  ADD KEY `index_mediaID1` (`mediaID`);

--
-- Indexes for table `smd__organization_has_rss_feeds`
--
ALTER TABLE `smd__organization_has_rss_feeds`
  ADD PRIMARY KEY (`organizationID`,`feedID`),
  ADD KEY `index_feedID2` (`feedID`),
  ADD KEY `index_organizationID9` (`organizationID`);

--
-- Indexes for table `smd__organization_has_rss_groups`
--
ALTER TABLE `smd__organization_has_rss_groups`
  ADD PRIMARY KEY (`organizationID`,`groupID`),
  ADD KEY `index_groupID5` (`groupID`),
  ADD KEY `index_organizationID8` (`organizationID`);

--
-- Indexes for table `smd__organization_has_social_site`
--
ALTER TABLE `smd__organization_has_social_site`
  ADD PRIMARY KEY (`organizationID`,`siteID`),
  ADD KEY `index_siteID1` (`siteID`),
  ADD KEY `index_organizationID4` (`organizationID`);

--
-- Indexes for table `smd__organization_role`
--
ALTER TABLE `smd__organization_role`
  ADD PRIMARY KEY (`roleID`),
  ADD KEY `index_organizationID` (`organizationID`);

--
-- Indexes for table `smd__organization_role_has_resources`
--
ALTER TABLE `smd__organization_role_has_resources`
  ADD PRIMARY KEY (`roleID`,`resourceID`),
  ADD KEY `index_resourceID1` (`resourceID`),
  ADD KEY `index_roleID2` (`roleID`);

--
-- Indexes for table `smd__partner`
--
ALTER TABLE `smd__partner`
  ADD PRIMARY KEY (`partnerID`),
  ADD KEY `index_deleteRequested` (`deleteRequested`),
  ADD KEY `index_imageFileID` (`imageFileID`),
  ADD KEY `index_zohoCustomerID` (`zohoCustomerID`);

--
-- Indexes for table `smd__partner_config`
--
ALTER TABLE `smd__partner_config`
  ADD PRIMARY KEY (`partnerConfigID`),
  ADD UNIQUE KEY `partnerID_subscriptionID_u` (`partnerID`,`subscriptionID`),
  ADD KEY `index_status1` (`status`) USING BTREE,
  ADD KEY `index_subscriptionID2` (`subscriptionID`) USING BTREE;

--
-- Indexes for table `smd__partner_has_media`
--
ALTER TABLE `smd__partner_has_media`
  ADD UNIQUE KEY `unique_partnerID_mediaID_mediaType` (`partnerID`,`mediaID`,`mediaType`),
  ADD KEY `index_partnerID5` (`partnerID`),
  ADD KEY `index_mediaID3` (`mediaID`),
  ADD KEY `index_mediaType4` (`mediaType`),
  ADD KEY `index_allowed` (`allowed`);

--
-- Indexes for table `smd__partner_has_post_templates`
--
ALTER TABLE `smd__partner_has_post_templates`
  ADD PRIMARY KEY (`templateID`,`partnerID`),
  ADD KEY `index_partnerID4` (`partnerID`),
  ADD KEY `index_templateID2` (`templateID`);

--
-- Indexes for table `smd__plan`
--
ALTER TABLE `smd__plan`
  ADD PRIMARY KEY (`planID`),
  ADD UNIQUE KEY `unique_zohoPlanID` (`zohoPlanID`);

--
-- Indexes for table `smd__post`
--
ALTER TABLE `smd__post`
  ADD PRIMARY KEY (`postID`),
  ADD UNIQUE KEY `unique_postID` (`postID`),
  ADD KEY `index_userID` (`userID`),
  ADD KEY `index_activeTo` (`activeFrom`),
  ADD KEY `index_activeTo1` (`activeTo`),
  ADD KEY `index_status7` (`status`),
  ADD KEY `smd__post_template_smd__post_templateID_templateID` (`templateID`),
  ADD KEY `index_organizationID5` (`organizationID`),
  ADD KEY `index_type6` (`type`),
  ADD KEY `index_parentID1` (`parentID`),
  ADD KEY `index_postExpiryDate` (`expiryDate`),
  ADD KEY `index_postExpiryPeriod` (`expiryPeriod`);

--
-- Indexes for table `smd__post_has_categories`
--
ALTER TABLE `smd__post_has_categories`
  ADD PRIMARY KEY (`postID`,`categoryID`),
  ADD KEY `index_categoryID1` (`categoryID`),
  ADD KEY `index_postID4` (`postID`);

--
-- Indexes for table `smd__post_has_media`
--
ALTER TABLE `smd__post_has_media`
  ADD PRIMARY KEY (`mediaID`,`mediaType`,`postID`),
  ADD KEY `index_postID2` (`postID`),
  ADD KEY `index_mediaType1` (`mediaType`);

--
-- Indexes for table `smd__post_has_social_sites`
--
ALTER TABLE `smd__post_has_social_sites`
  ADD PRIMARY KEY (`postID`,`socialSiteID`,`serverTime`),
  ADD KEY `index_socialSiteID` (`socialSiteID`),
  ADD KEY `index_serverTime1` (`serverTime`),
  ADD KEY `index_postID5` (`postID`);

--
-- Indexes for table `smd__post_search`
--
ALTER TABLE `smd__post_search`
  ADD PRIMARY KEY (`postID`);
ALTER TABLE `smd__post_search` ADD FULLTEXT KEY `idx` (`content`);

--
-- Indexes for table `smd__post_template`
--
ALTER TABLE `smd__post_template`
  ADD PRIMARY KEY (`templateID`),
  ADD UNIQUE KEY `unique_templateID` (`templateID`),
  ADD KEY `index_userID1` (`userID`),
  ADD KEY `index_partnerID2` (`organizationID`),
  ADD KEY `index_socialType` (`socialType`),
  ADD KEY `index_createDate3` (`createDate`),
  ADD KEY `index_modifyDate3` (`modifyDate`),
  ADD KEY `index_status6` (`status`),
  ADD KEY `index_type7` (`systemType`);

--
-- Indexes for table `smd__post_template_has_categories`
--
ALTER TABLE `smd__post_template_has_categories`
  ADD PRIMARY KEY (`templateID`,`categoryID`),
  ADD KEY `index_categoryID` (`categoryID`),
  ADD KEY `index_postID1` (`templateID`);

--
-- Indexes for table `smd__post_template_has_media`
--
ALTER TABLE `smd__post_template_has_media`
  ADD PRIMARY KEY (`mediaID`,`mediaType`,`templateID`),
  ADD KEY `index_templateID` (`templateID`),
  ADD KEY `index_mediaType` (`mediaType`),
  ADD KEY `index_mediaID` (`mediaID`);

--
-- Indexes for table `smd__post_template_has_organizations`
--
ALTER TABLE `smd__post_template_has_organizations`
  ADD PRIMARY KEY (`templateID`,`organizationID`),
  ADD KEY `index_organizationID6` (`organizationID`),
  ADD KEY `index_templateID1` (`templateID`);

--
-- Indexes for table `smd__post_template_has_tags`
--
ALTER TABLE `smd__post_template_has_tags`
  ADD PRIMARY KEY (`templateID`,`tagID`),
  ADD KEY `index_tagID1` (`tagID`),
  ADD KEY `index_postID` (`templateID`);

--
-- Indexes for table `smd__rss_feed`
--
ALTER TABLE `smd__rss_feed`
  ADD PRIMARY KEY (`feedID`),
  ADD UNIQUE KEY `unique_feedID` (`feedID`),
  ADD KEY `index_feedUrl` (`feedUrl`),
  ADD KEY `index_createDate11` (`createDate`);

--
-- Indexes for table `smd__rss_group`
--
ALTER TABLE `smd__rss_group`
  ADD PRIMARY KEY (`groupID`),
  ADD UNIQUE KEY `unique_groupID` (`groupID`),
  ADD KEY `index_name` (`name`),
  ADD KEY `index_createDate10` (`createDate`);

--
-- Indexes for table `smd__rss_group_has_feed`
--
ALTER TABLE `smd__rss_group_has_feed`
  ADD PRIMARY KEY (`groupID`,`feedID`),
  ADD KEY `index_feedID` (`feedID`),
  ADD KEY `index_groupID` (`groupID`);

--
-- Indexes for table `smd__rss_saved_post`
--
ALTER TABLE `smd__rss_saved_post`
  ADD PRIMARY KEY (`postID`),
  ADD UNIQUE KEY `unique_postID` (`postID`),
  ADD KEY `index_feedID1` (`feedID`),
  ADD KEY `index_userID4` (`userID`),
  ADD KEY `index_createDate12` (`createDate`);

--
-- Indexes for table `smd__subscription`
--
ALTER TABLE `smd__subscription`
  ADD PRIMARY KEY (`subscriptionID`),
  ADD UNIQUE KEY `unique_zohoSubscriptionID` (`zohoSubscriptionID`),
  ADD KEY `index_createDate` (`createDate`),
  ADD KEY `index_modifyDate` (`modifyDate`),
  ADD KEY `index_productID` (`planID`),
  ADD KEY `index_status` (`status`),
  ADD KEY `index_subscriptionID` (`subscriptionID`),
  ADD KEY `index_expiryDate` (`expiryDate`);

--
-- Indexes for table `smd__subscription_has_addons`
--
ALTER TABLE `smd__subscription_has_addons`
  ADD PRIMARY KEY (`subscriptionID`,`addonID`),
  ADD KEY `index_addonID` (`addonID`),
  ADD KEY `index_productID1` (`subscriptionID`);

--
-- Indexes for table `smd__subscription_has_transaction_logs`
--
ALTER TABLE `smd__subscription_has_transaction_logs`
  ADD PRIMARY KEY (`subscriptionID`,`transactionID`),
  ADD KEY `index_transactionID` (`transactionID`),
  ADD KEY `index_subscriptionID1` (`subscriptionID`);

--
-- Indexes for table `smd__transaction_log`
--
ALTER TABLE `smd__transaction_log`
  ADD PRIMARY KEY (`transactionID`),
  ADD UNIQUE KEY `unique_transactionID` (`transactionID`),
  ADD UNIQUE KEY `unique_zohoEventID` (`zohoEventID`),
  ADD KEY `index_createDate6` (`createDate`);

--
-- Indexes for table `smd__transaction_queue`
--
ALTER TABLE `smd__transaction_queue`
  ADD PRIMARY KEY (`transactionQueueID`),
  ADD KEY `index_createDate7` (`createDate`),
  ADD KEY `index_notifyEmailSent` (`notifyEmailSent`),
  ADD KEY `index_transactionQueueID` (`transactionQueueID`);

--
-- Indexes for table `smd__user_has_events`
--
ALTER TABLE `smd__user_has_events`
  ADD PRIMARY KEY (`userID`,`eventID`),
  ADD KEY `index_eventID` (`eventID`),
  ADD KEY `index_userID` (`userID`),
  ADD KEY `index_processTime` (`processedOn`),
  ADD KEY `index_status11` (`status`),
  ADD KEY `index_emailQueueID` (`emailQueueID`),
  ADD KEY `index_affectedOrganizationID` (`affectedOrganizationID`);

--
-- Indexes for table `smd__user_has_organization_role`
--
ALTER TABLE `smd__user_has_organization_role`
  ADD PRIMARY KEY (`userID`,`roleID`),
  ADD KEY `index_userID` (`userID`),
  ADD KEY `lnk_smd__organization_role_smd__user_has_organization_role` (`roleID`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `cms__column`
--
ALTER TABLE `cms__column`
  MODIFY `columnID` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Oszlop azonosító', AUTO_INCREMENT=9;

--
-- AUTO_INCREMENT for table `cms__domain`
--
ALTER TABLE `cms__domain`
  MODIFY `domainID` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Domain azonosító', AUTO_INCREMENT=7;

--
-- AUTO_INCREMENT for table `cms__file`
--
ALTER TABLE `cms__file`
  MODIFY `fileID` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Fájl azonosító', AUTO_INCREMENT=29278;

--
-- AUTO_INCREMENT for table `cms__file_page_has_panels`
--
ALTER TABLE `cms__file_page_has_panels`
  MODIFY `phpID` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'PHP azonosító', AUTO_INCREMENT=22;

--
-- AUTO_INCREMENT for table `cms__folder`
--
ALTER TABLE `cms__folder`
  MODIFY `folderID` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Mappa azonosító', AUTO_INCREMENT=5;

--
-- AUTO_INCREMENT for table `cms__group`
--
ALTER TABLE `cms__group`
  MODIFY `groupID` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Csoport azonosító', AUTO_INCREMENT=4;

--
-- AUTO_INCREMENT for table `cms__language`
--
ALTER TABLE `cms__language`
  MODIFY `languageID` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Nyelvi azonosító', AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT for table `cms__layout`
--
ALTER TABLE `cms__layout`
  MODIFY `layoutID` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Layout azonosító', AUTO_INCREMENT=6;

--
-- AUTO_INCREMENT for table `cms__module`
--
ALTER TABLE `cms__module`
  MODIFY `moduleID` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Modul azonosító', AUTO_INCREMENT=17;

--
-- AUTO_INCREMENT for table `cms__panel`
--
ALTER TABLE `cms__panel`
  MODIFY `panelID` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Panel azonosító', AUTO_INCREMENT=16;

--
-- AUTO_INCREMENT for table `cms__panel_variant`
--
ALTER TABLE `cms__panel_variant`
  MODIFY `panelVariantID` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Panel változat azonosító', AUTO_INCREMENT=11;

--
-- AUTO_INCREMENT for table `cms__site`
--
ALTER TABLE `cms__site`
  MODIFY `siteID` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Website azonosító', AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT for table `cms__tag`
--
ALTER TABLE `cms__tag`
  MODIFY `tagID` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Tag azonosító', AUTO_INCREMENT=22921;

--
-- AUTO_INCREMENT for table `smd__activity`
--
ALTER TABLE `smd__activity`
  MODIFY `activityID` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=94390;

--
-- AUTO_INCREMENT for table `smd__addon`
--
ALTER TABLE `smd__addon`
  MODIFY `addonID` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=37;

--
-- AUTO_INCREMENT for table `smd__autofeed_post_time`
--
ALTER TABLE `smd__autofeed_post_time`
  MODIFY `postTimeID` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1886;

--
-- AUTO_INCREMENT for table `smd__autofeed_preset`
--
ALTER TABLE `smd__autofeed_preset`
  MODIFY `presetID` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=65;

--
-- AUTO_INCREMENT for table `smd__autofeed_settings`
--
ALTER TABLE `smd__autofeed_settings`
  MODIFY `settingID` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=244;

--
-- AUTO_INCREMENT for table `smd__carousel`
--
ALTER TABLE `smd__carousel`
  MODIFY `carouselID` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Carousel azonosító', AUTO_INCREMENT=276;

--
-- AUTO_INCREMENT for table `smd__carousel_item`
--
ALTER TABLE `smd__carousel_item`
  MODIFY `itemID` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Carousel elem azonosító', AUTO_INCREMENT=666;

--
-- AUTO_INCREMENT for table `smd__category`
--
ALTER TABLE `smd__category`
  MODIFY `categoryID` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4066;

--
-- AUTO_INCREMENT for table `smd__comment`
--
ALTER TABLE `smd__comment`
  MODIFY `commentID` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=609;

--
-- AUTO_INCREMENT for table `smd__dashboard`
--
ALTER TABLE `smd__dashboard`
  MODIFY `dashboardID` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=136;

--
-- AUTO_INCREMENT for table `smd__email_queue`
--
ALTER TABLE `smd__email_queue`
  MODIFY `emailQueueID` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=333;

--
-- AUTO_INCREMENT for table `smd__events`
--
ALTER TABLE `smd__events`
  MODIFY `eventID` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1988;

--
-- AUTO_INCREMENT for table `smd__hashtag_collection`
--
ALTER TABLE `smd__hashtag_collection`
  MODIFY `collectionID` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=47;

--
-- AUTO_INCREMENT for table `smd__hashtag_tag`
--
ALTER TABLE `smd__hashtag_tag`
  MODIFY `tagID` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=239;

--
-- AUTO_INCREMENT for table `smd__messaging_feed`
--
ALTER TABLE `smd__messaging_feed`
  MODIFY `feedID` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=274;

--
-- AUTO_INCREMENT for table `smd__messaging_webhook_events`
--
ALTER TABLE `smd__messaging_webhook_events`
  MODIFY `eventID` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1155;

--
-- AUTO_INCREMENT for table `smd__organization`
--
ALTER TABLE `smd__organization`
  MODIFY `organizationID` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=447;

--
-- AUTO_INCREMENT for table `smd__partner`
--
ALTER TABLE `smd__partner`
  MODIFY `partnerID` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=184;

--
-- AUTO_INCREMENT for table `smd__partner_config`
--
ALTER TABLE `smd__partner_config`
  MODIFY `partnerConfigID` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=184;

--
-- AUTO_INCREMENT for table `smd__plan`
--
ALTER TABLE `smd__plan`
  MODIFY `planID` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=14;

--
-- AUTO_INCREMENT for table `smd__post`
--
ALTER TABLE `smd__post`
  MODIFY `postID` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=28103;

--
-- AUTO_INCREMENT for table `smd__post_search`
--
ALTER TABLE `smd__post_search`
  MODIFY `postID` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=586;

--
-- AUTO_INCREMENT for table `smd__post_template`
--
ALTER TABLE `smd__post_template`
  MODIFY `templateID` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=31703;

--
-- AUTO_INCREMENT for table `smd__rss_feed`
--
ALTER TABLE `smd__rss_feed`
  MODIFY `feedID` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=111;

--
-- AUTO_INCREMENT for table `smd__rss_group`
--
ALTER TABLE `smd__rss_group`
  MODIFY `groupID` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=36;

--
-- AUTO_INCREMENT for table `smd__rss_saved_post`
--
ALTER TABLE `smd__rss_saved_post`
  MODIFY `postID` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=55;

--
-- AUTO_INCREMENT for table `smd__subscription`
--
ALTER TABLE `smd__subscription`
  MODIFY `subscriptionID` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=88;

--
-- AUTO_INCREMENT for table `smd__transaction_log`
--
ALTER TABLE `smd__transaction_log`
  MODIFY `transactionID` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=892;

--
-- AUTO_INCREMENT for table `smd__transaction_queue`
--
ALTER TABLE `smd__transaction_queue`
  MODIFY `transactionQueueID` int(11) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- Constraints for table `cms__column`
--
ALTER TABLE `cms__column`
  ADD CONSTRAINT `cms__layout_cms__column_layoutID` FOREIGN KEY (`layoutID`) REFERENCES `cms__layout` (`layoutID`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `cms__column_has_panels`
--
ALTER TABLE `cms__column_has_panels`
  ADD CONSTRAINT `cms__column_cms__column_has_panels_columnID` FOREIGN KEY (`columnID`) REFERENCES `cms__column` (`columnID`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `cms__panel_cms__column_has_panels_panelID` FOREIGN KEY (`panelID`) REFERENCES `cms__panel` (`panelID`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `cms__domain`
--
ALTER TABLE `cms__domain`
  ADD CONSTRAINT `cms__site_cms__domain_defaultSiteID_siteID` FOREIGN KEY (`defaultSiteID`) REFERENCES `cms__site` (`siteID`) ON DELETE NO ACTION ON UPDATE CASCADE;

--
-- Constraints for table `cms__file`
--
ALTER TABLE `cms__file`
  ADD CONSTRAINT `cms__file_cms__folder_folderID` FOREIGN KEY (`folderID`) REFERENCES `cms__folder` (`folderID`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `cms__user_cms__file_userID_userID` FOREIGN KEY (`userID`) REFERENCES `cms__user` (`userID`) ON DELETE SET NULL ON UPDATE CASCADE;

--
-- Constraints for table `cms__file_has_files`
--
ALTER TABLE `cms__file_has_files`
  ADD CONSTRAINT `cms__file_cms__file_has_files_fileID` FOREIGN KEY (`fileID`) REFERENCES `cms__file` (`fileID`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `cms__file_cms__file_has_files_otherFileID_fileID` FOREIGN KEY (`otherFileID`) REFERENCES `cms__file` (`fileID`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `cms__file_link`
--
ALTER TABLE `cms__file_link`
  ADD CONSTRAINT `cms__file_cms__file_link_fileID` FOREIGN KEY (`fileID`) REFERENCES `cms__file` (`fileID`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `cms__file_cms__file_link_linkFileID_fileID` FOREIGN KEY (`linkFileID`) REFERENCES `cms__file` (`fileID`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `cms__file_page`
--
ALTER TABLE `cms__file_page`
  ADD CONSTRAINT `cms__file_cms__file_page_fileID` FOREIGN KEY (`fileID`) REFERENCES `cms__file` (`fileID`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `cms__layout_cms__file_page_layoutID` FOREIGN KEY (`layoutID`) REFERENCES `cms__layout` (`layoutID`) ON DELETE NO ACTION ON UPDATE CASCADE;

--
-- Constraints for table `cms__file_page_has_panels`
--
ALTER TABLE `cms__file_page_has_panels`
  ADD CONSTRAINT `cms__column_cms__file_page_has_panels_columnID` FOREIGN KEY (`columnID`) REFERENCES `cms__column` (`columnID`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `cms__file_page_cms__file_page_has_panels_fileID` FOREIGN KEY (`fileID`) REFERENCES `cms__file_page` (`fileID`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `cms__panel_variant_cms__file_page_has_panels_panelVariantID` FOREIGN KEY (`panelVariantID`) REFERENCES `cms__panel_variant` (`panelVariantID`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `cms__file_static`
--
ALTER TABLE `cms__file_static`
  ADD CONSTRAINT `cms__file_cms__file_static_fileID` FOREIGN KEY (`fileID`) REFERENCES `cms__file` (`fileID`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `cms__file_cms__file_static_fileID_previewFileID` FOREIGN KEY (`previewFileID`) REFERENCES `cms__file` (`fileID`) ON DELETE SET NULL ON UPDATE CASCADE;

--
-- Constraints for table `cms__folder`
--
ALTER TABLE `cms__folder`
  ADD CONSTRAINT `cms__file_cms__folder_defaultFileID_fileID` FOREIGN KEY (`defaultFileID`) REFERENCES `cms__file` (`fileID`) ON DELETE NO ACTION ON UPDATE CASCADE,
  ADD CONSTRAINT `cms__folder_cms__folder_parentID_folderID` FOREIGN KEY (`parentID`) REFERENCES `cms__folder` (`folderID`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `cms__group_has_files`
--
ALTER TABLE `cms__group_has_files`
  ADD CONSTRAINT `cms__file_cms__group_has_files_fileID` FOREIGN KEY (`fileID`) REFERENCES `cms__file` (`fileID`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `cms__group_cms__group_has_files_groupID` FOREIGN KEY (`groupID`) REFERENCES `cms__group` (`groupID`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `cms__group_has_folders`
--
ALTER TABLE `cms__group_has_folders`
  ADD CONSTRAINT `cms__folder_cms__group_has_folders_folderID` FOREIGN KEY (`folderID`) REFERENCES `cms__folder` (`folderID`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `cms__group_cms__group_has_folders_groupID` FOREIGN KEY (`groupID`) REFERENCES `cms__group` (`groupID`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `cms__group_has_groups`
--
ALTER TABLE `cms__group_has_groups`
  ADD CONSTRAINT `cms__group_cms__group_has_groups_groupID` FOREIGN KEY (`groupID`) REFERENCES `cms__group` (`groupID`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `cms__group_cms__group_has_groups_otherGroupID_groupID` FOREIGN KEY (`otherGroupID`) REFERENCES `cms__group` (`groupID`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `cms__group_has_roles`
--
ALTER TABLE `cms__group_has_roles`
  ADD CONSTRAINT `cms__group_cms__group_has_roles_groupID` FOREIGN KEY (`groupID`) REFERENCES `cms__group` (`groupID`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `cms__role_cms__group_has_roles_roleID` FOREIGN KEY (`roleID`) REFERENCES `cms__role` (`roleID`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `cms__panel`
--
ALTER TABLE `cms__panel`
  ADD CONSTRAINT `cms__module_cms__panel_moduleID` FOREIGN KEY (`moduleID`) REFERENCES `cms__module` (`moduleID`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `cms__panel_variant`
--
ALTER TABLE `cms__panel_variant`
  ADD CONSTRAINT `cms__panel_cms__panel_variant_panelID` FOREIGN KEY (`panelID`) REFERENCES `cms__panel` (`panelID`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `cms__resource`
--
ALTER TABLE `cms__resource`
  ADD CONSTRAINT `cms__module_cms__resource_moduleID` FOREIGN KEY (`moduleID`) REFERENCES `cms__module` (`moduleID`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `cms__role`
--
ALTER TABLE `cms__role`
  ADD CONSTRAINT `cms__module_cms__role_moduleID` FOREIGN KEY (`moduleID`) REFERENCES `cms__module` (`moduleID`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `cms__role_has_resources`
--
ALTER TABLE `cms__role_has_resources`
  ADD CONSTRAINT `cms__resource_cms__role_has_resources_resourceID` FOREIGN KEY (`resourceID`) REFERENCES `cms__resource` (`resourceID`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `cms__role_cms__role_has_resources_roleID` FOREIGN KEY (`roleID`) REFERENCES `cms__role` (`roleID`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `cms__site`
--
ALTER TABLE `cms__site`
  ADD CONSTRAINT `cms__file_cms__site_errorFileID_fileID` FOREIGN KEY (`errorFileID`) REFERENCES `cms__file` (`fileID`) ON DELETE NO ACTION ON UPDATE CASCADE,
  ADD CONSTRAINT `cms__file_cms__site_loginFileID_fileID` FOREIGN KEY (`loginFileID`) REFERENCES `cms__file` (`fileID`) ON DELETE NO ACTION ON UPDATE CASCADE,
  ADD CONSTRAINT `cms__file_cms__site_registerFileID_fileID` FOREIGN KEY (`registerFileID`) REFERENCES `cms__file` (`fileID`) ON DELETE NO ACTION ON UPDATE CASCADE,
  ADD CONSTRAINT `cms__folder_cms__site_rootFolderID_folderID` FOREIGN KEY (`rootFolderID`) REFERENCES `cms__folder` (`folderID`) ON DELETE NO ACTION ON UPDATE CASCADE,
  ADD CONSTRAINT `cms__group_cms__site_registerGroupID_groupID` FOREIGN KEY (`registerGroupID`) REFERENCES `cms__group` (`groupID`) ON DELETE NO ACTION ON UPDATE CASCADE,
  ADD CONSTRAINT `cms__language_cms__site_languageID` FOREIGN KEY (`languageID`) REFERENCES `cms__language` (`languageID`) ON DELETE NO ACTION ON UPDATE CASCADE;

--
-- Constraints for table `cms__site_has_domains`
--
ALTER TABLE `cms__site_has_domains`
  ADD CONSTRAINT `cms__domain_cms__site_has_domains_domainID` FOREIGN KEY (`domainID`) REFERENCES `cms__domain` (`domainID`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `cms__site_cms__site_has_domains_siteID` FOREIGN KEY (`siteID`) REFERENCES `cms__site` (`siteID`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `cms__tag`
--
ALTER TABLE `cms__tag`
  ADD CONSTRAINT `smd__partner_cms__tag_partnerID_partnerID` FOREIGN KEY (`partnerID`) REFERENCES `smd__partner` (`partnerID`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `smd__activity`
--
ALTER TABLE `smd__activity`
  ADD CONSTRAINT `pn__activity_ibfk_2` FOREIGN KEY (`userID`) REFERENCES `cms__user` (`userID`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `smd__autofeed_post_time`
--
ALTER TABLE `smd__autofeed_post_time`
  ADD CONSTRAINT `smd__autofeed_settings_smd__autofeed_post_times_settingID` FOREIGN KEY (`settingID`) REFERENCES `smd__autofeed_settings` (`settingID`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `smd__category_smd__autofeed_post_times_categoryID_categoryID` FOREIGN KEY (`categoryID`) REFERENCES `smd__category` (`categoryID`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `smd__autofeed_post_time_has_posts`
--
ALTER TABLE `smd__autofeed_post_time_has_posts`
  ADD CONSTRAINT `lnk_smd__post_smd__autofeed_post_time_has_posts` FOREIGN KEY (`postID`) REFERENCES `smd__post` (`postID`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `smd__autofeed_post_times_smd__autofeed_post_time_has_post` FOREIGN KEY (`postTimeID`) REFERENCES `smd__autofeed_post_time` (`postTimeID`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `smd__autofeed_settings`
--
ALTER TABLE `smd__autofeed_settings`
  ADD CONSTRAINT `smd__organization_smd__autofeed_settings_organizationID` FOREIGN KEY (`organizationID`) REFERENCES `smd__organization` (`organizationID`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `smd__carousel`
--
ALTER TABLE `smd__carousel`
  ADD CONSTRAINT `cms__user_smd__carousel_userID_userID` FOREIGN KEY (`userID`) REFERENCES `cms__user` (`userID`) ON DELETE SET NULL ON UPDATE CASCADE;

--
-- Constraints for table `smd__carousel_item`
--
ALTER TABLE `smd__carousel_item`
  ADD CONSTRAINT `cms__file_smd__carousel_item_fileID_imageFileID` FOREIGN KEY (`imageFileID`) REFERENCES `cms__file` (`fileID`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `smd__carousel_smd__carousel_item_carouselID_carouselID` FOREIGN KEY (`carouselID`) REFERENCES `smd__carousel` (`carouselID`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `smd__category`
--
ALTER TABLE `smd__category`
  ADD CONSTRAINT `smd__partner_smd__category_partnerID_partnerID` FOREIGN KEY (`partnerID`) REFERENCES `smd__partner` (`partnerID`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `smd__comment`
--
ALTER TABLE `smd__comment`
  ADD CONSTRAINT `cms__user_smd__comment_userID_userID` FOREIGN KEY (`userID`) REFERENCES `cms__user` (`userID`) ON DELETE SET NULL ON UPDATE CASCADE;

--
-- Constraints for table `smd__dashboard_has_users`
--
ALTER TABLE `smd__dashboard_has_users`
  ADD CONSTRAINT `cms__user_smd__dashboard_has_users_userID_userID` FOREIGN KEY (`userID`) REFERENCES `cms__user` (`userID`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `smd__dashboard_smd__dashboard_has_users_dashboardID_dashboardID` FOREIGN KEY (`dashboardID`) REFERENCES `smd__dashboard` (`dashboardID`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `smd__default_role_has_resources`
--
ALTER TABLE `smd__default_role_has_resources`
  ADD CONSTRAINT `cms__resource_smd__default_role_has_resources_resourceID` FOREIGN KEY (`resourceID`) REFERENCES `cms__resource` (`resourceID`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `smd__default_role_smd__default_role_has_resources_defaultRoleID` FOREIGN KEY (`defaultRoleID`) REFERENCES `smd__default_role` (`defaultRoleID`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `smd__limit`
--
ALTER TABLE `smd__limit`
  ADD CONSTRAINT `smd__partner_smd__limit_partnerID` FOREIGN KEY (`partnerID`) REFERENCES `smd__partner` (`partnerID`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `smd__media_has_categories`
--
ALTER TABLE `smd__media_has_categories`
  ADD CONSTRAINT `smd__category_smd__category_categoryID_categoryID` FOREIGN KEY (`categoryID`) REFERENCES `smd__category` (`categoryID`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `smd__media_has_tags`
--
ALTER TABLE `smd__media_has_tags`
  ADD CONSTRAINT `cms__tag_smd__media_has_tags_tagID_tagID` FOREIGN KEY (`tagID`) REFERENCES `cms__tag` (`tagID`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `smd__organization`
--
ALTER TABLE `smd__organization`
  ADD CONSTRAINT `lnk_smd__group_smd__group` FOREIGN KEY (`parentID`) REFERENCES `smd__organization` (`organizationID`) ON UPDATE CASCADE,
  ADD CONSTRAINT `lnk_smd__partner_smd__group` FOREIGN KEY (`partnerID`) REFERENCES `smd__partner` (`partnerID`) ON UPDATE CASCADE;

--
-- Constraints for table `smd__organization_has_autofeed_preset`
--
ALTER TABLE `smd__organization_has_autofeed_preset`
  ADD CONSTRAINT `smd__autofeed_preset_smd__organization_has_autofeed_preset` FOREIGN KEY (`presetID`) REFERENCES `smd__autofeed_preset` (`presetID`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `smd__organization_smd__organization_has_autofeed_preset` FOREIGN KEY (`organizationID`) REFERENCES `smd__organization` (`organizationID`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `smd__organization_has_hashtag_collection`
--
ALTER TABLE `smd__organization_has_hashtag_collection`
  ADD CONSTRAINT `smd__hashtag_collection_smd__organization_has_hashtag_collection` FOREIGN KEY (`collectionID`) REFERENCES `smd__hashtag_collection` (`collectionID`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `smd__organization_smd__organization_has_hashtag_collection` FOREIGN KEY (`organizationID`) REFERENCES `smd__organization` (`organizationID`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `smd__organization_has_hashtag_tag`
--
ALTER TABLE `smd__organization_has_hashtag_tag`
  ADD CONSTRAINT `smd__hashtag_tag_smd__organization_has_hashtag_tag` FOREIGN KEY (`tagID`) REFERENCES `smd__hashtag_tag` (`tagID`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `smd__organization_smd__organization_has_hashtag_tag` FOREIGN KEY (`organizationID`) REFERENCES `smd__organization` (`organizationID`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `smd__organization_has_media`
--
ALTER TABLE `smd__organization_has_media`
  ADD CONSTRAINT `smd__organization_smd__organization_has_media_organizationID` FOREIGN KEY (`organizationID`) REFERENCES `smd__organization` (`organizationID`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `smd__organization_has_rss_feeds`
--
ALTER TABLE `smd__organization_has_rss_feeds`
  ADD CONSTRAINT `smd__organization_smd__organization_has_rss_feeds_organizationID` FOREIGN KEY (`organizationID`) REFERENCES `smd__organization` (`organizationID`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `smd__rss_feed_smd__organization_has_rss_feeds_feedID_feedID` FOREIGN KEY (`feedID`) REFERENCES `smd__rss_feed` (`feedID`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `smd__organization_has_rss_groups`
--
ALTER TABLE `smd__organization_has_rss_groups`
  ADD CONSTRAINT `smd__organization_smd__organization_has_rss_groups` FOREIGN KEY (`organizationID`) REFERENCES `smd__organization` (`organizationID`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `smd__rss_group_smd__organization_has_rss_groups_groupID_groupID` FOREIGN KEY (`groupID`) REFERENCES `smd__rss_group` (`groupID`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `smd__organization_has_social_site`
--
ALTER TABLE `smd__organization_has_social_site`
  ADD CONSTRAINT `smd__organization_smd__organization_has_social_site` FOREIGN KEY (`organizationID`) REFERENCES `smd__organization` (`organizationID`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `smd__social_site_smd__organization_has_social_site_siteID_siteID` FOREIGN KEY (`siteID`) REFERENCES `smd__social_site` (`siteID`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `smd__organization_role`
--
ALTER TABLE `smd__organization_role`
  ADD CONSTRAINT `lnk_smd__organization_smd__organization_role` FOREIGN KEY (`organizationID`) REFERENCES `smd__organization` (`organizationID`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `smd__organization_role_has_resources`
--
ALTER TABLE `smd__organization_role_has_resources`
  ADD CONSTRAINT `lnk_cms__resource_smd__oraginaziton_role_has_resources` FOREIGN KEY (`resourceID`) REFERENCES `cms__resource` (`resourceID`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `lnk_smd__organization_role_smd__oraginaziton_role_has_resources` FOREIGN KEY (`roleID`) REFERENCES `smd__organization_role` (`roleID`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `smd__partner`
--
ALTER TABLE `smd__partner`
  ADD CONSTRAINT `cms__file_smd__partner_fileID_imageFileID` FOREIGN KEY (`imageFileID`) REFERENCES `cms__file` (`fileID`) ON DELETE SET NULL ON UPDATE CASCADE;

--
-- Constraints for table `smd__partner_config`
--
ALTER TABLE `smd__partner_config`
  ADD CONSTRAINT `smd__partner_smd__partner_config_partnerID_partnerID` FOREIGN KEY (`partnerID`) REFERENCES `smd__partner` (`partnerID`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `smd__subscription_smd__partner_config_subscriptionID` FOREIGN KEY (`subscriptionID`) REFERENCES `smd__subscription` (`subscriptionID`) ON DELETE SET NULL ON UPDATE CASCADE;

--
-- Constraints for table `smd__partner_has_media`
--
ALTER TABLE `smd__partner_has_media`
  ADD CONSTRAINT `smd__partner_smd__partner_has_media_partnerID` FOREIGN KEY (`partnerID`) REFERENCES `smd__partner` (`partnerID`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `smd__partner_has_post_templates`
--
ALTER TABLE `smd__partner_has_post_templates`
  ADD CONSTRAINT `smd__partner_smd__partner_has_post_templates_partnerID_partnerID` FOREIGN KEY (`partnerID`) REFERENCES `smd__partner` (`partnerID`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `smd__post_template_smd__partner_has_post_templates_templateID` FOREIGN KEY (`templateID`) REFERENCES `smd__post_template` (`templateID`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `smd__post`
--
ALTER TABLE `smd__post`
  ADD CONSTRAINT `cms__user_smd__post_userID_userID` FOREIGN KEY (`userID`) REFERENCES `cms__user` (`userID`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `smd__post_smd__post_postID_parentID` FOREIGN KEY (`parentID`) REFERENCES `smd__post` (`postID`) ON DELETE SET NULL ON UPDATE CASCADE,
  ADD CONSTRAINT `smd__post_template_smd__post_templateID_templateID` FOREIGN KEY (`templateID`) REFERENCES `smd__post_template` (`templateID`) ON DELETE SET NULL ON UPDATE CASCADE;

--
-- Constraints for table `smd__post_has_categories`
--
ALTER TABLE `smd__post_has_categories`
  ADD CONSTRAINT `lnk_smd__post_smd__post_has_categories` FOREIGN KEY (`postID`) REFERENCES `smd__post` (`postID`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `smd__category_smd__post_has_categories_categoryID_categoryI` FOREIGN KEY (`categoryID`) REFERENCES `smd__category` (`categoryID`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `smd__post_has_media`
--
ALTER TABLE `smd__post_has_media`
  ADD CONSTRAINT `lnk_smd__post_smd__post_has_media` FOREIGN KEY (`postID`) REFERENCES `smd__post` (`postID`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `smd__post_has_social_sites`
--
ALTER TABLE `smd__post_has_social_sites`
  ADD CONSTRAINT `smd__post_smd__post_has_social_sites_postID_postID` FOREIGN KEY (`postID`) REFERENCES `smd__post` (`postID`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `smd__social_site_smd__post_has_social_sites_siteID_socialSiteID` FOREIGN KEY (`socialSiteID`) REFERENCES `smd__social_site` (`siteID`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `smd__post_template`
--
ALTER TABLE `smd__post_template`
  ADD CONSTRAINT `cms__user_smd__post_template_userID_userID` FOREIGN KEY (`userID`) REFERENCES `cms__user` (`userID`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `smd__post_template_has_categories`
--
ALTER TABLE `smd__post_template_has_categories`
  ADD CONSTRAINT `smd__category_smd__post_has_categories_categoryID_categoryID` FOREIGN KEY (`categoryID`) REFERENCES `smd__category` (`categoryID`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `smd__post_template_smd__post_template_has_categories_templateID` FOREIGN KEY (`templateID`) REFERENCES `smd__post_template` (`templateID`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `smd__post_template_has_media`
--
ALTER TABLE `smd__post_template_has_media`
  ADD CONSTRAINT `smd__post_template_smd__post_template_has_media_templateID` FOREIGN KEY (`templateID`) REFERENCES `smd__post_template` (`templateID`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `smd__post_template_has_organizations`
--
ALTER TABLE `smd__post_template_has_organizations`
  ADD CONSTRAINT `smd__organization_smd__post_template_has_organizations` FOREIGN KEY (`organizationID`) REFERENCES `smd__organization` (`organizationID`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `smd__post_template_smd__post_template_has_organizations` FOREIGN KEY (`templateID`) REFERENCES `smd__post_template` (`templateID`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `smd__post_template_has_tags`
--
ALTER TABLE `smd__post_template_has_tags`
  ADD CONSTRAINT `cms__tag_smd__post_has_tags_tagID_tagID` FOREIGN KEY (`tagID`) REFERENCES `cms__tag` (`tagID`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `smd__post_template_smd__post_template_has_tags_templateID` FOREIGN KEY (`templateID`) REFERENCES `smd__post_template` (`templateID`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `smd__rss_group_has_feed`
--
ALTER TABLE `smd__rss_group_has_feed`
  ADD CONSTRAINT `smd__rss_feed_smd__rss_group_has_feed_feedID_feedID` FOREIGN KEY (`feedID`) REFERENCES `smd__rss_feed` (`feedID`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `smd__rss_group_smd__rss_group_has_feed_groupID_groupID` FOREIGN KEY (`groupID`) REFERENCES `smd__rss_group` (`groupID`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `smd__rss_saved_post`
--
ALTER TABLE `smd__rss_saved_post`
  ADD CONSTRAINT `cms__user_smd__rss_saved_post_userID_userID` FOREIGN KEY (`userID`) REFERENCES `cms__user` (`userID`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `smd__rss_feed_smd__rss_saved_post_feedID_feedID` FOREIGN KEY (`feedID`) REFERENCES `smd__rss_feed` (`feedID`) ON DELETE SET NULL ON UPDATE CASCADE;

--
-- Constraints for table `smd__subscription`
--
ALTER TABLE `smd__subscription`
  ADD CONSTRAINT `smd__subscription_smd_plan_planID_planID` FOREIGN KEY (`planID`) REFERENCES `smd__plan` (`planID`) ON DELETE SET NULL ON UPDATE CASCADE;

--
-- Constraints for table `smd__subscription_has_addons`
--
ALTER TABLE `smd__subscription_has_addons`
  ADD CONSTRAINT `smd__subscription_smd__subscription_has_addons_subscriptionID` FOREIGN KEY (`subscriptionID`) REFERENCES `smd__subscription` (`subscriptionID`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `smd_addon_smd__product_has_addons_addonID_addonID` FOREIGN KEY (`addonID`) REFERENCES `smd__addon` (`addonID`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `smd__subscription_has_transaction_logs`
--
ALTER TABLE `smd__subscription_has_transaction_logs`
  ADD CONSTRAINT `smd__subscription_smd__subscription_has_transaction_logs` FOREIGN KEY (`subscriptionID`) REFERENCES `smd__subscription` (`subscriptionID`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `smd__transaction_log_smd__subscription_has_transaction_logs` FOREIGN KEY (`transactionID`) REFERENCES `smd__transaction_log` (`transactionID`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `smd__user_has_events`
--
ALTER TABLE `smd__user_has_events`
  ADD CONSTRAINT `lnk_cms__user_smd__user_has_events` FOREIGN KEY (`userID`) REFERENCES `cms__user` (`userID`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `lnk_smd__organization_smd__user_has_events` FOREIGN KEY (`affectedOrganizationID`) REFERENCES `smd__organization` (`organizationID`) ON DELETE SET NULL ON UPDATE CASCADE,
  ADD CONSTRAINT `smd__email_queue_smd__user_has_events_queueID_emailQueueID` FOREIGN KEY (`emailQueueID`) REFERENCES `smd__email_queue` (`emailQueueID`) ON DELETE SET NULL ON UPDATE CASCADE,
  ADD CONSTRAINT `smd__events_smd__user_has_events_eventID_eventID` FOREIGN KEY (`eventID`) REFERENCES `smd__events` (`eventID`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `smd__user_has_organization_role`
--
ALTER TABLE `smd__user_has_organization_role`
  ADD CONSTRAINT `lnk_cms__user_smd__user_has_organization_role` FOREIGN KEY (`userID`) REFERENCES `cms__user` (`userID`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `lnk_smd__organization_role_smd__user_has_organization_role` FOREIGN KEY (`roleID`) REFERENCES `smd__organization_role` (`roleID`) ON DELETE CASCADE ON UPDATE CASCADE;

