IFC-2156: Remove proposed change comments created_at and created_by attribute and relationship#8362
Open
IFC-2156: Remove proposed change comments created_at and created_by attribute and relationship#8362
Conversation
…ttribute and relationship
ajtmccarty
approved these changes
Feb 12, 2026
| CALL (comment) { | ||
| MATCH (comment)-[r1:IS_RELATED]-(:Relationship {name: "comment__account"})-[r2:IS_RELATED]-(account:CoreGenericAccount) | ||
| RETURN account | ||
| ORDER BY r1.from DESC, r2.from DESC |
Contributor
There was a problem hiding this comment.
I don't think either of these suggestions is required b/c this is a required cardinality-one relationship that should never be updated, but I haven't reviewed the schema, so not totally sure
- if the relationship is capable of being updated, you'll need to use
r1.from DESC, r1.status ASC, r.from DESC, r2.status ASCfor ordering to account for relationships added and deleted at the same timestamp - if the relationship is optional, you'll need to account for checking if the edges are status="active" b/c there the latest relationship could be deleted
ogenstad
requested changes
Feb 13, 2026
Contributor
ogenstad
left a comment
There was a problem hiding this comment.
As this work also requires frontend changes, let's wait with this one until after the feature freeze or when we cut a release-1.8 branch this can be merged into develop for inclusion in 1.9 instead. So I don't have any objections to the code itself only that we should wait a few days.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
CoreComment and CoreThread explicitly define created_by (relationship) and created_at (attribute) in their schemas, but these are redundant — every node already has created_at and created_by as node metadata. This adds unnecessary schema complexity and graph relationship overhead.
This PR removes these redundant fields so that comments and threads rely on the built-in node metadata
Closes IFC-2156
What changed
Schema definitions: Removed created_at attribute and created_by relationship from CoreComment and CoreThread generic schemas, along with the order_by=["created_at__value"] that depended on the removed attribute
Protocol definitions: Removed created_at and created_by from CoreComment and CoreThread in both protocols.py and tests/protocols.py
Graph migration (m060): Backfills created_by UUID from the old comment__account and thread__account relationships directly onto the node property, preserving existing data
Test fix: Removed created_at input from the CoreChangeThreadCreate mutation test since it's no longer an input field
How to review
Start with the schema removal in propose_change_comment.py, then the protocol updates.
The migration in m060_set_comment_thread_created_by_on_node.py.
The test for the migration validates both comment and thread backfill.
How to test
Impact & rollout
Backward compatibility:
Migration m060 preserves existing created_by data by copying it from relationships to node properties. The created_at and created_by fields are no longer exposed as schema attributes/relationships in the GraphQL API — consumers should use node_metadata instead.
Performance:
Slight improvement — fewer relationship traversals needed for comment/thread author lookups
Deployment notes:
Migration m060 runs automatically on startup. Frontend will need a corresponding update to read created_by from node_metadata instead of from the comment/thread relationship.
Checklist
uv run towncrier create ...)