-
Notifications
You must be signed in to change notification settings - Fork 276
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Much simpler way to implement required UUIDs. #478
Conversation
…/properties/constants every time it's called again. Thanks @subvertallchris !
Simpler AND it can be merged automatically! 👏 Though I still think merge (or at least a release with this) should be accompanied be a rake task to add IDs. I can give that a shot tomorrow, if you want. |
Boom! Automating the process of adding IDs to existing nodes was trickier than I imagined. I wrote a bit about it at http://stackoverflow.com/questions/25952884/neo4j-assign-unique-values-to-all-nodes-matching-query/25954136#25954136. |
@subvertallchris really cool |
…n nodes for a particular label, adding a constraint takes 141 seconds and it seems to be asynchronous for some reason...
Just so I'm getting it right, it's dropping the constraint at load if one On Sunday, September 21, 2014, Coveralls notifications@github.com wrote:
|
I'm pretty sure it's dropping the constraint just for the class/label concerned. Inheriting and calling id_property again should just act like more calls to id_property (which at each point drop the old constraint and undefined the old property) |
If these tests pass (which I believe they will) I'm going to merge it! |
But when does it drop it? It looks like every time the model is loaded if there was already an id property defined, right? Does that force a wipe and rebuild of all indexes, too, since indexes follow labels? EDIT: Wait, that's a little drunk logic talking. I think it might have to reindex the ID properties of all nodes with that label, though. |
Yeah, that's a good point ;) I'll look at that now. I would think part of the problem is that there's no way to query for constraints (except, maybe, a separate endpoint), but maybe it's possible to make a single query which doesn't change anything if the constraint is already there. |
If you look in at data/graph.db/messages.log, it shows when it's dropping and rebuilding indexes. If dropping the old indexes is just to try keeping the database a little cleaner, maybe that should be left alone for now and the user can maintain that on their own? |
Ok, just made a change so that it shouldn't remove the constraint if it already exists. Merging! |
Much simpler way to implement required UUIDs.
That is brilliant! I didn't think you could get constraint info from On Sunday, September 21, 2014, Coveralls notifications@github.com wrote:
|
Just remove the methods/properties/constants every time it's called again. Thanks @subvertallchris !