Skip to content

Instantly share code, notes, and snippets.

@rosskarchner
Created December 4, 2017 19:13
Show Gist options
  • Save rosskarchner/8cf3ec19ed537335bf00ede5116e406b to your computer and use it in GitHub Desktop.
Save rosskarchner/8cf3ec19ed537335bf00ede5116e406b to your computer and use it in GitHub Desktop.
SELECT DISTINCT `wagtailcore_page`.`id`,
`wagtailcore_page`.`path`,
`wagtailcore_page`.`depth`,
`wagtailcore_page`.`numchild`,
`wagtailcore_page`.`title`,
`wagtailcore_page`.`slug`,
`wagtailcore_page`.`content_type_id`,
`wagtailcore_page`.`live`,
`wagtailcore_page`.`has_unpublished_changes`,
`wagtailcore_page`.`url_path`,
`wagtailcore_page`.`owner_id`,
`wagtailcore_page`.`seo_title`,
`wagtailcore_page`.`show_in_menus`,
`wagtailcore_page`.`search_description`,
`wagtailcore_page`.`go_live_at`,
`wagtailcore_page`.`expire_at`,
`wagtailcore_page`.`expired`,
`wagtailcore_page`.`locked`,
`wagtailcore_page`.`first_published_at`,
`wagtailcore_page`.`latest_revision_created_at`,
`v1_cfgovpage`.`page_ptr_id`,
`v1_cfgovpage`.`shared`,
`v1_cfgovpage`.`has_unshared_changes`,
`v1_cfgovpage`.`language`,
`v1_cfgovpage`.`social_sharing_image_id`,
`v1_cfgovpage`.`sidefoot`,
`v1_abstractfilterpage`.`cfgovpage_ptr_id`,
`v1_abstractfilterpage`.`header`,
`v1_abstractfilterpage`.`preview_title`,
`v1_abstractfilterpage`.`preview_subheading`,
`v1_abstractfilterpage`.`preview_description`,
`v1_abstractfilterpage`.`secondary_link_url`,
`v1_abstractfilterpage`.`secondary_link_text`,
`v1_abstractfilterpage`.`preview_image_id`,
`v1_abstractfilterpage`.`date_published`,
`v1_abstractfilterpage`.`date_filed`,
`v1_abstractfilterpage`.`comments_close_by`
FROM `v1_abstractfilterpage`
INNER JOIN `v1_cfgovpage`
ON (
`v1_abstractfilterpage`.`cfgovpage_ptr_id` = `v1_cfgovpage`.`page_ptr_id` )
INNER JOIN `wagtailcore_page`
ON (
`v1_cfgovpage`.`page_ptr_id` = `wagtailcore_page`.`id` )
INNER JOIN `v1_cfgovtaggedpages`
ON (
`v1_cfgovpage`.`page_ptr_id` = `v1_cfgovtaggedpages`.`content_object_id` )
INNER JOIN `v1_cfgovpagecategory`
ON (
`v1_cfgovpage`.`page_ptr_id` = `v1_cfgovpagecategory`.`page_id` )
INNER JOIN `v1_cfgovtaggedpages` t7
ON (
`v1_cfgovpage`.`page_ptr_id` = t7.`content_object_id` )
INNER JOIN `v1_cfgovtaggedpages` t9
ON (
`v1_cfgovpage`.`page_ptr_id` = t9.`content_object_id` )
INNER JOIN `v1_cfgovtaggedpages` t11
ON (
`v1_cfgovpage`.`page_ptr_id` = t11.`content_object_id` )
INNER JOIN `v1_cfgovtaggedpages` t13
ON (
`v1_cfgovpage`.`page_ptr_id` = t13.`content_object_id` )
INNER JOIN `v1_cfgovtaggedpages` t15
ON (
`v1_cfgovpage`.`page_ptr_id` = t15.`content_object_id` )
INNER JOIN `v1_cfgovtaggedpages` t17
ON (
`v1_cfgovpage`.`page_ptr_id` = t17.`content_object_id` )
INNER JOIN `v1_cfgovtaggedpages` t19
ON (
`v1_cfgovpage`.`page_ptr_id` = t19.`content_object_id` )
INNER JOIN `v1_cfgovtaggedpages` t21
ON (
`v1_cfgovpage`.`page_ptr_id` = t21.`content_object_id` )
INNER JOIN `v1_cfgovtaggedpages` t23
ON (
`v1_cfgovpage`.`page_ptr_id` = t23.`content_object_id` )
WHERE (
`wagtailcore_page`.`live` = true
AND NOT (
`v1_abstractfilterpage`.`cfgovpage_ptr_id` = 10848)
AND `wagtailcore_page`.`path` LIKE binary 000100020006000g%
AND `wagtailcore_page`.`depth` >= 4
AND NOT (
`v1_abstractfilterpage`.`cfgovpage_ptr_id` = 1491)
AND `wagtailcore_page`.`depth` = 5
AND `v1_cfgovtaggedpages`.`tag_id` IN (97,
168,
459,
780,
45,
150,
25,
126,
63)
AND `v1_cfgovpagecategory`.`NAME` IN (data-research-reports)
AND t7.`tag_id` = 97
AND t9.`tag_id` = 168
AND t11.`tag_id` = 459
AND t13.`tag_id` = 780
AND t15.`tag_id` = 45
AND t17.`tag_id` = 150
AND t19.`tag_id` = 25
AND t21.`tag_id` = 126
AND t23.`tag_id` = 63)
ORDER BY `v1_abstractfilterpage`.`date_published` DESC
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment