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

Fix error that happens if legacy migration fail in the schema script #1956

Merged
merged 1 commit into from Aug 16, 2022

Conversation

ABrain7710
Copy link
Contributor

Issue: Whenever there was an error in the legacy SQL files, alembic would register that the alembic revision 0 was not completed since it errored out in the middle. While the SQL files were getting COMMITED periodically. Therefore alembic thought that nothing had been done to the database and started at the beginning, when in fact all the SQL files up to the error had already been COMMITED to the database. Therefore whenever someone tried to run the database install after it failed once on the legacy files, it would error saying that the schema already exists.

Fix: I removed all the COMMIT statements in the SQL files, and added one file called commit.sql that gets executed at the end of the legacy SQL files. Therefore if all the legacy SQL files succeed then the database reflects that, but if any of them fail, then no changes are made to the database

Signed-off-by: Andrew Brain <61482022+ABrain7710@users.noreply.github.com>
@ABrain7710 ABrain7710 merged commit 27e70d7 into augur-new Aug 16, 2022
@ABrain7710 ABrain7710 deleted the augur-new-db-creation-fix branch August 27, 2022 00:51
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.

None yet

1 participant