-
Notifications
You must be signed in to change notification settings - Fork 16.4k
[AIRFLOW-1390] Update Alembic to 0.9 #3935
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -45,20 +45,19 @@ def test_database_schema_and_sqlalchemy_model_are_in_sync(self): | |
| lambda t: (t[0] == 'remove_column' and | ||
| t[2] == 'users' and | ||
| t[3].name == 'password'), | ||
| # ignore tables created by other tests | ||
| lambda t: (t[0] == 'remove_table' and | ||
| t[1].name == 't'), | ||
|
||
| lambda t: (t[0] == 'remove_table' and | ||
| t[1].name == 'test_airflow'), | ||
| lambda t: (t[0] == 'remove_table' and | ||
| t[1].name == 'test_postgres_to_postgres'), | ||
| lambda t: (t[0] == 'remove_table' and | ||
| t[1].name == 'test_mysql_to_mysql'), | ||
|
|
||
| # ignore tables created by celery | ||
| lambda t: (t[0] == 'remove_table' and | ||
| t[1].name == 'celery_taskmeta'), | ||
| lambda t: (t[0] == 'remove_table' and | ||
| t[1].name == 'celery_tasksetmeta'), | ||
|
|
||
| # ignore indices created by celery | ||
| lambda t: (t[0] == 'remove_index' and | ||
| t[1].name == 'task_id'), | ||
| lambda t: (t[0] == 'remove_index' and | ||
| t[1].name == 'taskset_id'), | ||
|
|
||
| # Ignore all the fab tables | ||
| lambda t: (t[0] == 'remove_table' and | ||
| t[1].name == 'ab_permission'), | ||
|
|
@@ -76,11 +75,31 @@ def test_database_schema_and_sqlalchemy_model_are_in_sync(self): | |
| t[1].name == 'ab_user'), | ||
| lambda t: (t[0] == 'remove_table' and | ||
| t[1].name == 'ab_view_menu'), | ||
|
|
||
| # Ignore all the fab indices | ||
| lambda t: (t[0] == 'remove_index' and | ||
| t[1].name == 'permission_id'), | ||
| lambda t: (t[0] == 'remove_index' and | ||
| t[1].name == 'name'), | ||
| lambda t: (t[0] == 'remove_index' and | ||
| t[1].name == 'user_id'), | ||
| lambda t: (t[0] == 'remove_index' and | ||
| t[1].name == 'username'), | ||
| lambda t: (t[0] == 'remove_index' and | ||
| t[1].name == 'field_string'), | ||
| lambda t: (t[0] == 'remove_index' and | ||
| t[1].name == 'email'), | ||
| lambda t: (t[0] == 'remove_index' and | ||
| t[1].name == 'permission_view_id'), | ||
|
|
||
| # from test_security unit test | ||
| lambda t: (t[0] == 'remove_table' and | ||
| t[1].name == 'some_model'), | ||
| ] | ||
| for ignore in ignores: | ||
| diff = [d for d in diff if not ignore(d)] | ||
|
|
||
| self.assertFalse(diff, 'Database schema and SQLAlchemy model are not in sync') | ||
| self.assertFalse( | ||
| diff, | ||
| 'Database schema and SQLAlchemy model are not in sync: ' + str(diff) | ||
| ) | ||
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.
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.
What's this test for?
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.
Previously the tables created by the tests would still exists after the test since there was no cleaning up. This interferes with the test that compares the Alembic models with the actual database.
For Travis we run all the tests exactly once, but we still want to clean up the state (tables in the database) afterwards to exit in a consistent state. Therefore I've added the some cleaning in the
tearDownstep of the tests.