Closed mamazu closed 11 months ago
the strict phpcr way would be to export one repository and import it into the other. but i would not be sure if that process is 100% robust.
either way, the command is an interesting idea. i think this would belong into https://github.com/jackalope/jackalope-doctrine-dbal as that functionality is about the dbal implementation of storage.
i have no capacity to work on that, but if you want to give it a go i would be happy to review a merge request.
Yeah duh, we should have used the import and export feature. And dealt with the duplicated entries in the two repositories manually. If you want I can have a look at how to implement it, but I think it's not going to be very efficient. I've already implemented a very limited version for our use case.
if it tempts you to look into it, happy to review. but i don't see it as a high priority, we can also leave it be imo :-)
I have a possibly bad implementation that I could PR. It's taped onto it, because there isn't really a good way to extract the reference updating from the client without creating a BC break.
maybe post it as a gist or blogpost then? if we integrate it into jackalope, it should be a good implementation that we won't regret... which sounds like its not worth the effort. with a gist or blogpost, its at least possible to still find it, but its fine to say its not a clean implementation (and we won't have to maintain it)
That sounds like a good idea. I will do that.
great. please comment on this issue, would love to read it - and if others ask about it i can then find it again.
Usecase
If you manage to get the database into a state where the references are not in sync with the reference data, then there is currently no way to easily fix that.
In our case we have merged two phpcr instances and to avoid conflicting Ids we incremented the second system's ids all by 10'000. This however means that all the references into the second structures are broken and need to be recalculated.
Proposed solution
It would be cool if there was a command that would scan the whole database for references and re-compute them.