Skip to main content

Questions tagged [sql]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
1 answer

Relations query with OR: Find entries based on (lightswitch = false AND relatedTo()) OR (lightswitch = true) / nested relatedTo?

I have the following challenge: we have a news channel for multiple company locations. Some news should be visible globally (for all locations), but some news are only visible for location X. But ...
m_andrasch's user avatar
1 vote
1 answer

Batch retrieve the entry count per category item in facet filter

I'm building a facet filter using Craft Commerce products and Craft categories. I have a "Brand" category and each product entry has a brand defined. Same for the other facet filters that ...
Jesse's user avatar
  • 113
1 vote
1 answer

After Migration from v2.9 to 3.5 - some entries added into an entry-relation-field get added twice after saving

We migrated a craft cms site with 3 locales from v2.9 to 3.5 We have a section with a field of type "Entries". When editing the entry, and adding certain entries to this field, those get ...
Chris Angel's user avatar
1 vote
0 answers

Craft CMS hangs when deleting a field then throws 504

We have an instance of Craft CMS running that has a lot of content entries and a lot of fields, using Neo and SuperTable. At some point, something changed and now when we try to delete one of the ...
Richard Gil's user avatar
2 votes
1 answer

Mass enable entries

I'm trying to set statuses to enabled in mysql. Around 150k entries. The tables are elements and elements_sites. Set status to 1. The query runs OK. In the cp is also everything fine but entries don't ...
Mark H.'s user avatar
  • 401
1 vote
1 answer

Least CPU intensive way to get number of matching elements?

Which is the least CPU intensive (SQL-intensive) way to get the sum of products that are relatedTo a category? Like this? {% set productCount = craft.products.relatedTo(category)|length %}
nitech's user avatar
  • 679