Conversation
We keep responses untouched, the only change happens on DB / model side to avoid excessive joins.
Collaborator
Author
|
Note: based on order of merges #610 we need to update alembic migration hash to keep history linear |
Coverage Report for CI Build 24439511301Coverage decreased (-0.002%) to 93.246%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsNo coverage regressions found. Coverage Stats
💛 - Coveralls |
MarcelGeo
approved these changes
Apr 14, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR merges the former user_profile one-to-one table into the main user table to reduce query joins while keeping API responses structurally compatible via a User.profile compatibility shim.
Changes:
- Add a migration to copy
receive_notifications,first_name,last_nameontouserand dropuser_profile. - Remove the
UserProfileSQLAlchemy model and update queries/schemas/controllers to read profile fields fromUser. - Update tests and CLI commands to stop creating
UserProfilerows.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| server/migrations/community/e3f1a9b2c4d6_merge_user_profile_into_user.py | Adds migration to move profile columns to user, migrate data, and drop user_profile. |
| server/mergin/tests/utils.py | Updates test helper to stop creating UserProfile. |
| server/mergin/tests/test_project_controller.py | Removes UserProfile usage in project controller tests. |
| server/mergin/tests/test_auth.py | Removes UserProfile usage in auth tests where it was explicitly instantiated. |
| server/mergin/sync/project_handler.py | Removes join to UserProfile and filters directly on User.receive_notifications. |
| server/mergin/commands.py | Updates DB init command to stop creating UserProfile. |
| server/mergin/auth/schemas.py | Updates profile-related schemas to use User fields directly while keeping schema names/shape compatible. |
| server/mergin/auth/models.py | Adds columns to User, removes UserProfile model, and adds profile compatibility property + name() helper. |
| server/mergin/auth/controller.py | Updates profile update and user listing/search logic to use User fields directly. |
| server/mergin/auth/commands.py | Updates auth CLI create command to stop creating UserProfile. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
We keep responses untouched, the only change happens on DB / model side to avoid excessive joins.