Skip to content

Fix/alembic migration idempotent#992

Open
cosmoqain459 wants to merge 4 commits into
SdSarthak:mainfrom
cosmoqain459:fix/alembic-migration-idempotent
Open

Fix/alembic migration idempotent#992
cosmoqain459 wants to merge 4 commits into
SdSarthak:mainfrom
cosmoqain459:fix/alembic-migration-idempotent

Conversation

@cosmoqain459

Copy link
Copy Markdown

Summary

Closes #977

Fixes TableAlreadyExists crash when running alembic upgrade head on existing databases. Added if_not_exists=True to op.create_table() and op.create_index(), and if_exists=True to downgrade drop calls in 2 migration files.

Note: c0e71c86214f_add_rag_queries_table.py listed in the issue does not exist in the repo and was skipped.

Type of Change

  • Bug fix

Checklist

  • I have read CONTRIBUTING.md
  • My code follows the project style (PEP 8 for Python, ESLint for TS)
  • I have not committed .env or any secrets

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix Alembic migration crash on existing databases (add idempotency guards)

1 participant