-
Notifications
You must be signed in to change notification settings - Fork 13
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
Refactor AttributeAddQuery to support node with an attribute of the same name previously active #4742
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
few small comments
MATCH path1 = (root:Root)<-[r1:IS_PART_OF]-(n) | ||
OPTIONAL MATCH path2 = (n)-[r2:HAS_ATTRIBUTE]-(:Attribute { name: $attr_name }) | ||
WHERE all(r IN relationships(path1) WHERE (%(branch_filter)s)) | ||
AND all(r IN relationships(path2) WHERE (%(branch_filter)s)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WHERE all(r in [r1, r2] WHERE (%(branch_filter)s))
WITH n1 as n, r1 as rb | ||
WHERE rb.status = "active" | ||
WITH n1 as n, r11 as r1, r12 as r2 | ||
WHERE (r1.status = "active" and r2 is null) OR (r1.status = "active" and r2.status = "deleted") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WHERE r1.status = "active" AND (r2 IS NULL OR r2.status = "deleted")
) | ||
assert len(persons) == 1 | ||
john = persons[0] | ||
john.height.value = 200 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe add an assert that the value is None
before updating it to check that John's initial height was deleted
assert query.get_nbr_migrations_executed() == 2 | ||
|
||
# ------------------------------------------ | ||
# Delete the attribute Color |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add the attribute color
005f7d0
to
d42f7eb
Compare
…ame name previously active
d42f7eb
to
50d5806
Compare
Fixes #4727