feat: allow newer migrations in alembic to allow for rollback#10835
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
This PR enables Langflow to handle scenarios where the database has newer migrations than the codebase, allowing for rollback capabilities. This is useful when reverting to an older version of the code after running newer migrations that are backwards-compatible.
Key changes:
- Added detection logic to identify when the database is ahead of the code
- Modified error handling to allow startup when the database has backwards-compatible newer migrations
- Restructured exception handling flow to check for database-ahead scenarios before attempting upgrades
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| src/backend/base/langflow/services/database/service.py | Added helper methods to detect and handle database-ahead scenarios, and integrated them into the migration checking flow |
| src/backend/base/langflow/services/database/utils.py | Restructured exception handling to check for database-ahead scenarios and handle different error types separately |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
d9e2a5e to
dff3580
Compare
|
Intentionally making minimal changes and not fixing existing tests (or bugs). intended to be a small patch on the cloud, then all fixes will be done with upcoming v1.7 release. |
Allow langflow to start up when database is at newer migration
allow newer migrations in alembic to allow for rollback