-
Notifications
You must be signed in to change notification settings - Fork 25
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
Migration tests #636
Merged
Merged
Migration tests #636
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jonahkagan
commented
Jul 7, 2020
@@ -55,6 +55,9 @@ def run_migrations_offline(): | |||
context.configure( | |||
url=url, | |||
target_metadata=target_metadata, | |||
compare_type=True, | |||
compare_server_default=True, | |||
include_schemas=True, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these are suggested configs from the pytest-alembic docs
jonahkagan
commented
Jul 7, 2020
config.get_section(config.config_ini_section), | ||
prefix="sqlalchemy.", | ||
poolclass=pool.NullPool, | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change required by pytest-alembic
jonahkagan
force-pushed
the
migration-tests
branch
from
July 7, 2020 22:59
a9a69d4
to
db36946
Compare
benadida
approved these changes
Jul 8, 2020
Adds some basic tests to ensure our migrations run successfully and yield the same resulting db schema as our models. How we do it: - Create an initial migration from the empty database to the database before our current first migration - Leverage pytest-alembic, a plugin that runs these basic tests for you
jonahkagan
force-pushed
the
migration-tests
branch
from
July 8, 2020 16:34
db36946
to
a1807a5
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds some basic tests to ensure our migrations run successfully and yield the same resulting db schema as our models.
How we do it:
This PR also moves the
migrations
directory insideserver
and adds some documentation to it.