What are the Slack Archives?
Itβs a history of our time together in the Slack Community! Thereβs a ton of knowledge in here, so feel free to search through the archives for a possible answer to your question.
Because this space is not active, you wonβt be able to create a new post or comment here. If you have a question or want to start a discussion about something, head over to our categories and pick one to post in! You can always refer back to a post from Slack Archives if needed; just copy the link to use it as a reference..
Is there a quick way to mark all categories with 0 products as inactive?
Is there a quick way to mark all categories with 0 products as inactive?
Comments
-
(other than querying and setting so from SQL)
0 -
Not to my knowledge. The SQL way you've mentioned does seem to be the simplest, quickest solution to me too.
0 -
it gets kinda tricky to get only leaf nodes but doable, lets see
0 -
update spy_category set is_active = 0 where spy_category.id_category not in ( with recursive tree (id_category, category_key, fk_parent_category_node, is_active) as ( select id_category, category_key, fk_parent_category_node, is_active from spy_category sp left join spy_product_category spc on sp.id_category = spc.fk_category left join spy_category_node ndc on sp.id_category = ndc.fk_category where spc.fk_category is not NULL and ndc.fk_parent_category_node is not null UNION ALL select p.id_category, p.category_key, ndc.fk_parent_category_node, p.is_active from spy_category p left join spy_product_category spc on p.id_category = spc.fk_category left join spy_category_node ndc on p.id_category = ndc.fk_category inner join tree on p.id_category = tree.fk_parent_category_node ) select distinct (id_category) from tree order by category_key);
0 -
Maybe.
0 -
Looks good π
0 -
docker/sdk console publish:trigger-events -r category_node
0 -
is this the command to update search? Seems to take forever
0 -
Based on the description, looks like that to me.
(Although previously, we usedconsole event:trigger -r [resource name]
for such updates, and that was pretty fast (if it only had small amounts of data to work with.)0 -
(You should also be able to use
-i [comma separated id list]
to specify ids you'd like to update and then it can be even faster as then it won't need to bother with the rest, just with the ones you specified).0
Categories
- All Categories
- 42 Getting Started & Guidelines
- 7 Getting Started in the Community
- 8 Additional Resources
- 7 Community Ideas and Feedback
- 76 Spryker News
- 929 Developer Corner
- 787 Spryker Development
- 89 Spryker Dev Environment
- 362 Spryker Releases
- 3 Oryx frontend framework
- 35 Propel ORM
- 68 Community Projects
- 3 Community Ideation Board
- 30 Hackathon
- 3 PHP Bridge
- 6 Gacela Project
- 26 Job Opportunities
- 3.2K π Slack Archives
- 116 Academy
- 5 Business Users
- 370 Docker
- 551 Slack General
- 2K Help
- 75 Knowledge Sharing
- 6 Random Stuff
- 4 Code Testing
- 32 Product & Business Questions
- 70 Spryker Safari Questions
- 50 Random