Skip to content

feat: allow newer migrations in alembic to allow for rollback#10835

Merged
jordanrfrazier merged 1 commit into
1.6.4-patch-s3-implfrom
allow-newer-migrations-alembic
Dec 3, 2025
Merged

feat: allow newer migrations in alembic to allow for rollback#10835
jordanrfrazier merged 1 commit into
1.6.4-patch-s3-implfrom
allow-newer-migrations-alembic

Conversation

@jordanrfrazier
Copy link
Copy Markdown
Collaborator

allow newer migrations in alembic to allow for rollback

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Dec 1, 2025

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Note

Other AI code review bot(s) detected

CodeRabbit 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)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch allow-newer-migrations-alembic

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added the enhancement New feature or request label Dec 1, 2025
@github-actions github-actions Bot added the lgtm This PR has been approved by a maintainer label Dec 2, 2025
@ricofurtado ricofurtado requested a review from Copilot December 2, 2025 18:22
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread src/backend/base/langflow/services/database/service.py
Comment thread src/backend/base/langflow/services/database/service.py
Comment thread src/backend/base/langflow/services/database/service.py
Comment thread src/backend/base/langflow/services/database/service.py
@github-actions github-actions Bot added enhancement New feature or request and removed enhancement New feature or request labels Dec 2, 2025
@github-actions github-actions Bot added enhancement New feature or request and removed enhancement New feature or request labels Dec 2, 2025
@jordanrfrazier jordanrfrazier force-pushed the allow-newer-migrations-alembic branch from d9e2a5e to dff3580 Compare December 3, 2025 17:33
@jordanrfrazier
Copy link
Copy Markdown
Collaborator Author

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.

@jordanrfrazier jordanrfrazier merged commit 89f4483 into 1.6.4-patch-s3-impl Dec 3, 2025
13 of 17 checks passed
@github-actions github-actions Bot removed the enhancement New feature or request label Dec 3, 2025
@jordanrfrazier jordanrfrazier deleted the allow-newer-migrations-alembic branch December 3, 2025 17:34
@github-actions github-actions Bot added the enhancement New feature or request label Dec 3, 2025
jordanrfrazier added a commit that referenced this pull request Dec 4, 2025
Allow langflow to start up when database is at newer migration
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request lgtm This PR has been approved by a maintainer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants