-
Notifications
You must be signed in to change notification settings - Fork 231
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
[Enhancement]: Improve pending migration(s) check #2013
Merged
aybruhm
merged 2 commits into
feature/age-540-endpoint-for-app-type
from
enhancement/refactor-migration-handling
Aug 29, 2024
Merged
[Enhancement]: Improve pending migration(s) check #2013
aybruhm
merged 2 commits into
feature/age-540-endpoint-for-app-type
from
enhancement/refactor-migration-handling
Aug 29, 2024
Conversation
This file contains 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
…atest migration head - Refactored the migration check to compare the current database migration head against the latest migration script head. - Enhanced `get_current_migration_head_from_db` to ensure only one migration head is tracked. - Updated logic in `get_pending_migration_head` to reduce unnecessary checks and handle first-time setup more efficiently. - Improved error handling and clarified logging messages for better debugging.
…/refactor-migration-handling
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
aybruhm
changed the base branch from
main
to
feature/age-540-endpoint-for-app-type
August 22, 2024 15:55
dosubot
bot
added
size:M
This PR changes 30-99 lines, ignoring generated files.
Backend
enhancement
New feature or request
labels
Aug 22, 2024
aybruhm
changed the title
Enhancement/refactor migration handling
[Enhancement]: Improve pending migration check
Aug 22, 2024
aybruhm
changed the title
[Enhancement]: Improve pending migration check
[Enhancement]: Improve pending migration(s) check
Aug 22, 2024
jp-agenta
approved these changes
Aug 27, 2024
aybruhm
merged commit Aug 29, 2024
8736de4
into
feature/age-540-endpoint-for-app-type
10 checks passed
All tests run successfully for both new and returning users ✅ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Backend
enhancement
New feature or request
lgtm
This PR has been approved by a maintainer
size:M
This PR changes 30-99 lines, ignoring generated files.
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.
Description
This PR refactors the migration handling process to improve efficiency and accuracy. Key changes include:
Changes Included
get_pending_migration_head
function to compare only the latest migration head with the current state.get_current_migration_head_from_db
function to ensure it returns a single migration head, improving consistency.What to QA
Delete all Docker resources related to Agenta on your PC.
Run
docker compose up --build
to create new images, volumes, and containers.Apply the Alembic migration with this command:
docker exec -w /app/agenta_backend/migrations/postgres agenta-backend-1 alembic -c alembic.oss.ini upgrade head
Run
docker compose up --build
to recreate the containers.Apply the Alembic migration with this command:
docker exec -w /app/agenta_backend/migrations/postgres agenta-backend-1 alembic -c alembic.oss.ini upgrade head
Acceptance Tests
NOTE: Cloud (prod) and OSS (prod) do not require QA as notifying users about pending migrations is a local concern.