Skip to content
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

[Refactor]: Manually Name Database Table Constraints to Resolve sqlalchemy.exc.CompileError #2054

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

aybruhm
Copy link
Member

@aybruhm aybruhm commented Sep 3, 2024

Description

This PR addresses an issue where a downgrade migration in cloud.staging failed due to an unnamed UniqueConstraint, resulting in a sqlalchemy.exc.CompileError. The error was caused by the inability to drop the unnamed constraint during the migration process.

Related Issue

Closes AGE-761

Changes

  • Updated the migration scripts by manually naming the individual database table constraints to ensure they are correctly identified, preventing the CompileError from occurring during downgrades.

What to QA

  • Ensure that the downgrade migration now runs successfully without errors.
  • Verify that the named constraints are correctly applied in both the upgrade and downgrade paths.

Acceptance Tests

  • Run the downgrade migration in the staging environment and confirm that it completes without triggering a CompileError.

Copy link

vercel bot commented Sep 3, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
agenta ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 9, 2024 7:00pm
agenta-documentation ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 9, 2024 7:00pm

@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Sep 3, 2024
@dosubot dosubot bot added Backend bug Something isn't working refactoring labels Sep 3, 2024
@aybruhm aybruhm changed the title refactor (migration): manually name unnamed database table constraint… [Refactor]: Manually Name Database Table Constraints to Resolve sqlalchemy.exc.CompileError Sep 3, 2024
@aybruhm aybruhm requested a review from aakrem September 3, 2024 20:58
@aybruhm
Copy link
Member Author

aybruhm commented Sep 11, 2024

@aakrem, this is the downgrade workflow to approve this PR and merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Backend bug Something isn't working refactoring size:L This PR changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant