Created
September 13, 2022 08:30
-
-
Save Sebobo/199897f35d00eee12e5b2c937bf06fa5 to your computer and use it in GitHub Desktop.
Remove duplicate nodes in a Neos setup with nodes without and with dimensions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UPDATE neos_contentrepository_domain_model_nodedata SET dimensionvalues = '{ | |
"language": { | |
"0": "de" | |
} | |
}' WHERE dimensionvalues = '{}' and path <> '/' and path <> '/sites'; | |
delete t1 FROM neos_contentrepository_domain_model_nodedata t1 | |
INNER JOIN neos_contentrepository_domain_model_nodedata t2 | |
WHERE | |
t1.lastmodificationdatetime <= t2.lastmodificationdatetime AND | |
t1.persistence_object_identifier <> t2.persistence_object_identifier AND | |
t1.identifier = t2.identifier AND | |
t1.dimensionvalues = t2.dimensionvalues; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Adjust the default
dimensionvalue
in the first query as needed.Afterwards run
./flow node:repair
to clean the project up.