-
Notifications
You must be signed in to change notification settings - Fork 91
ENG-3298: Add parent_id column to Comment model for threading #7864
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
Open
JadeCara
wants to merge
18
commits into
main
Choose a base branch
from
ENG-3298/comment-threading-migration
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 8 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
dc2c4a3
ENG-3298: Add parent_id column to Comment model for threading
JadeCara df6e880
add changelog for PR #7864
JadeCara c9e8682
Merge branch 'main' into ENG-3298/comment-threading-migration
JadeCara 0191797
fix mypy: use back_populates instead of overlaps for self-referential…
JadeCara 58af4d0
fixed db_dataset.yml
JadeCara 210edbb
Address PR review: fix passive_deletes mismatch, add reply cleanup an…
JadeCara eef7ede
Merge branch 'main' into ENG-3298/comment-threading-migration
JadeCara f8eba44
Merge branch 'main' into ENG-3298/comment-threading-migration
JadeCara 8ac733b
Address PR review: document SET NULL + manual cascade design choice
JadeCara 2709ee4
Merge branch 'main' into ENG-3298/comment-threading-migration
JadeCara 8958e1c
Address PR review feedback: iterative delete, test coverage
JadeCara 4a3fe91
Merge branch 'main' into ENG-3298/comment-threading-migration
JadeCara 8c982f1
fix fixture
JadeCara 7b810a3
fixed test
JadeCara 88b083e
Merge branch 'main' into ENG-3298/comment-threading-migration
JadeCara 2bd5a67
fix down revision
JadeCara b8609a8
Merge branch 'main' into ENG-3298/comment-threading-migration
JadeCara 28b023c
Merge branch 'main' into ENG-3298/comment-threading-migration
JadeCara File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| type: Added | ||
| description: Added parent_id column to Comment model for threading support | ||
| pr: 7864 | ||
| labels: ["db-migration"] |
36 changes: 36 additions & 0 deletions
36
.../api/alembic/migrations/versions/xx_2026_04_08_1901_1724da7ee981_add_comment_parent_id.py
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| """add_comment_parent_id | ||
|
|
||
| Revision ID: 1724da7ee981 | ||
| Revises: 6a42f48c23dd | ||
| Create Date: 2026-04-08 19:01:40.083985 | ||
|
|
||
| """ | ||
| import sqlalchemy as sa | ||
| from alembic import op | ||
|
|
||
| # revision identifiers, used by Alembic. | ||
| revision = "1724da7ee981" | ||
| down_revision = "6a42f48c23dd" | ||
| branch_labels = None | ||
| depends_on = None | ||
|
|
||
|
|
||
| def upgrade(): | ||
| op.add_column( | ||
| "comment", sa.Column("parent_id", sa.String(length=255), nullable=True) | ||
| ) | ||
| op.create_index("ix_comment_parent_id", "comment", ["parent_id"], unique=False) | ||
| op.create_foreign_key( | ||
| "comment_parent_id_fkey", | ||
| "comment", | ||
| "comment", | ||
| ["parent_id"], | ||
| ["id"], | ||
| ondelete="SET NULL", | ||
| ) | ||
|
|
||
|
|
||
| def downgrade(): | ||
| op.drop_constraint("comment_parent_id_fkey", "comment", type_="foreignkey") | ||
| op.drop_index("ix_comment_parent_id", table_name="comment") | ||
| op.drop_column("comment", "parent_id") | ||
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
JadeCara marked this conversation as resolved.
Show resolved
Hide resolved
|
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.