-
Notifications
You must be signed in to change notification settings - Fork 10
Remove ProjectUser model and related project user management #393
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
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
38eefd4
Refactor project user management: remove ProjectUser model and relate…
avirajsingh7 4bfdd32
Refactor project user management: drop ProjectUser table and update d…
avirajsingh7 2d0d44b
pre commit
avirajsingh7 3201d9c
fix migration
avirajsingh7 6b1f88e
Merge branch 'main' into remove_project_user
avirajsingh7 ca4b54f
Merge remote-tracking branch 'origin/main' into remove_project_user
avirajsingh7 0582e4b
Remove unused projects relationship from User model
avirajsingh7 b19c5f6
Remove unused collections relationship from User model
avirajsingh7 88c0096
Merge remote-tracking branch 'origin/main' into remove_project_user
avirajsingh7 a8138e3
Refactor Project user: create new migration to drop and recreate proj…
avirajsingh7 31ba2f1
Refactor migration: standardize formatting and improve readability of…
avirajsingh7 4d78b9a
Merge branch 'main' into remove_project_user
avirajsingh7 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
62 changes: 62 additions & 0 deletions
62
backend/app/alembic/versions/93d484f5798e_refactor_project_user.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,62 @@ | ||
| """Refactor Project user | ||
|
|
||
| Revision ID: 93d484f5798e | ||
| Revises: b30727137e65 | ||
| Create Date: 2025-10-10 17:55:46.327616 | ||
|
|
||
| """ | ||
| from alembic import op | ||
| import sqlalchemy as sa | ||
| import sqlmodel.sql.sqltypes | ||
| from sqlalchemy.dialects import postgresql | ||
|
|
||
| # revision identifiers, used by Alembic. | ||
| revision = "93d484f5798e" | ||
| down_revision = "b30727137e65" | ||
| branch_labels = None | ||
| depends_on = None | ||
|
|
||
|
|
||
| def upgrade(): | ||
| # ### commands auto generated by Alembic - please adjust! ### | ||
| op.drop_table("projectuser") | ||
| # ### end Alembic commands ### | ||
|
|
||
|
|
||
| def downgrade(): | ||
| # ### commands auto generated by Alembic - please adjust! ### | ||
| op.create_table( | ||
| "projectuser", | ||
| sa.Column("id", sa.INTEGER(), autoincrement=True, nullable=False), | ||
| sa.Column("project_id", sa.INTEGER(), autoincrement=False, nullable=False), | ||
| sa.Column("is_admin", sa.BOOLEAN(), autoincrement=False, nullable=False), | ||
| sa.Column("is_deleted", sa.BOOLEAN(), autoincrement=False, nullable=False), | ||
| sa.Column( | ||
| "inserted_at", | ||
| postgresql.TIMESTAMP(), | ||
| server_default=sa.text("now()"), | ||
| autoincrement=False, | ||
| nullable=False, | ||
| ), | ||
| sa.Column( | ||
| "updated_at", postgresql.TIMESTAMP(), autoincrement=False, nullable=False | ||
| ), | ||
| sa.Column( | ||
| "deleted_at", postgresql.TIMESTAMP(), autoincrement=False, nullable=True | ||
| ), | ||
| sa.Column("user_id", sa.INTEGER(), autoincrement=False, nullable=False), | ||
| sa.ForeignKeyConstraint( | ||
| ["project_id"], | ||
| ["project.id"], | ||
| name="projectuser_project_id_fkey", | ||
| ondelete="CASCADE", | ||
| ), | ||
| sa.ForeignKeyConstraint( | ||
| ["user_id"], | ||
| ["user.id"], | ||
| name="projectuser_user_id_fkey", | ||
| ondelete="CASCADE", | ||
| ), | ||
| sa.PrimaryKeyConstraint("id", name="projectuser_pkey"), | ||
| ) | ||
| # ### end Alembic commands ### | ||
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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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.
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.
🛠️ Refactor suggestion | 🟠 Major
Add return type hint.
As per coding guidelines, type hints should be used in Python code for this Python 3.11+ project. Add
-> Nonereturn type hint to the function.Apply this diff:
Based on coding guidelines.
📝 Committable suggestion
🤖 Prompt for AI Agents