-
Notifications
You must be signed in to change notification settings - Fork 999
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
Replace SQLAlchemy Migrate with Alembic #13513
Commits on Mar 9, 2022
-
Configuration menu - View commit details
-
Copy full SHA for e248cbe - Browse repository at this point
Copy the full SHA e248cbeView commit details -
Configuration menu - View commit details
-
Copy full SHA for 2cbc7f5 - Browse repository at this point
Copy the full SHA 2cbc7f5View commit details -
Configuration menu - View commit details
-
Copy full SHA for 94d9a68 - Browse repository at this point
Copy the full SHA 94d9a68View commit details -
Add alembic dir to ignore list in run_tests
Otherwise alembic/env.py gets executed out of context at test collection stage (via tox -e unit >> run_tests.sh), which raises an AttributeError (alembic.context is not set in this case)
Configuration menu - View commit details
-
Copy full SHA for e8c12ae - Browse repository at this point
Copy the full SHA e8c12aeView commit details -
Add alembic dir to ignore list in package tests
Otherwise alembic/env.py gets executed out of context at test collection stage (via tox -e unit >> run_tests.sh), which raises an AttributeError (alembic.context is not set in this case)
Configuration menu - View commit details
-
Copy full SHA for 3be1f6f - Browse repository at this point
Copy the full SHA 3be1f6fView commit details -
Move engine_options default arg initialization to engine_factory
To eliminate the repetitive `engine_options = engine_options or {}` in multiple places.
Configuration menu - View commit details
-
Copy full SHA for 6f6c778 - Browse repository at this point
Copy the full SHA 6f6c778View commit details -
Remove migrations test from first starup workflow
This tests sqlalchemy migrate which is being replaced.
Configuration menu - View commit details
-
Copy full SHA for ee654c1 - Browse repository at this point
Copy the full SHA ee654c1View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9b91040 - Browse repository at this point
Copy the full SHA 9b91040View commit details -
Configuration menu - View commit details
-
Copy full SHA for 8dacdac - Browse repository at this point
Copy the full SHA 8dacdacView commit details -
Move triggers out of migrate directory
(does not include an import in mapping.py: to be added in a separate commit, grouped with other edits in mapping.py)
Configuration menu - View commit details
-
Copy full SHA for be53ebe - Browse repository at this point
Copy the full SHA be53ebeView commit details -
Configuration menu - View commit details
-
Copy full SHA for e7de070 - Browse repository at this point
Copy the full SHA e7de070View commit details -
Avoid extra trip to db via lazy load of alembic version heads (squashed)
Squashed: - pick 01a42712d2 Avoid extra trip to db via lazy load of alembic version heads - squash 8d729974d6 Fix mypy error
Configuration menu - View commit details
-
Copy full SHA for a9049f8 - Browse repository at this point
Copy the full SHA a9049f8View commit details -
Configuration menu - View commit details
-
Copy full SHA for 38f9b42 - Browse repository at this point
Copy the full SHA 38f9b42View commit details -
Configuration menu - View commit details
-
Copy full SHA for 58ab658 - Browse repository at this point
Copy the full SHA 58ab658View commit details -
Configuration menu - View commit details
-
Copy full SHA for 619228e - Browse repository at this point
Copy the full SHA 619228eView commit details -
Configuration menu - View commit details
-
Copy full SHA for bd5bb85 - Browse repository at this point
Copy the full SHA bd5bb85View commit details -
Configuration menu - View commit details
-
Copy full SHA for c4fc9f6 - Browse repository at this point
Copy the full SHA c4fc9f6View commit details -
Integrate migrations into config, model (squashed)
- pick 058f09a Integrate migrations design into config and model code - squash 89ca1a537b Drop config.database_create_tables (not used) Next squash: - pick cbf29e138c Integrate migrations into config, model (squashed) - squash dd51fd578e Address existing mypy error (see note) Address existing mypy error (see note) This is a (possible) bug that has existed on dev. To expose it, simply change this call to init_models_from_config (https://github.com/galaxyproject/galaxy/blob/release_21.09/lib/galaxy/config/__init__.py#L1302) to a call directly to mapping.init(). The result will be 6 mypy errors. The reason is that the mapping.init() function (https://github.com/galaxyproject/galaxy/blob/release_21.09/lib/galaxy/model/mapping.py#L79) specifies its return type as GalaxyModelMapping - which results in several errors of this type: lib/galaxy/app.py:178: error: Definition of "model" in base class "MinimalApp" is incompatible with definition in base class "ConfiguresGalaxyMixin" When we call an intermediary function (that does not have a return type specified), mypy is happy. This should be addressed in a separate issue/PR. Removing the return type is the simplest (temporary) solution. Next squash: - squash c842973 Add type hints to migrations modules - squash a54be22 Remove circular dependency between migrations and config Setup infrastructure for running db scripts (squashed) Squashed: - pick 146ff8019a Setup infrastructure for running db scripts - squash e0a26dcf3a Move is-one-db check into model.database_utils Squashed: - pick a82c44a Setup infrastructure for running db scripts (squashed) - squash 31a1a702fe Fix mypy error Squashed: - pick 14a4eb08e2 Setup infrastructure for running db scripts (squashed) - squash b1c6acb0f1 When overriding, override. Add type hints to migrations modules Remove circular dependency between migrations and config
Configuration menu - View commit details
-
Copy full SHA for a961939 - Browse repository at this point
Copy the full SHA a961939View commit details -
Configuration menu - View commit details
-
Copy full SHA for ad2f223 - Browse repository at this point
Copy the full SHA ad2f223View commit details -
Add create/migrate scripts for Alembic dbs (squashed)
Also add exec permissions to create/migrate python scripts. (not sure this is required, adding for consistency with previous version) + A few fixes for TS scripts, tests Squashed: - pick b624432 Add create/migrate scripts for Alembic dbs - squash 06f0a92 Fix integration test (test only relevant for TS)
Configuration menu - View commit details
-
Copy full SHA for 3c992a6 - Browse repository at this point
Copy the full SHA 3c992a6View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9db6079 - Browse repository at this point
Copy the full SHA 9db6079View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5e64233 - Browse repository at this point
Copy the full SHA 5e64233View commit details -
Configuration menu - View commit details
-
Copy full SHA for 32da859 - Browse repository at this point
Copy the full SHA 32da859View commit details -
Update data package (requirements, packages, includes)
Note: manage_db entry point needs to be edited in model.orm.scripts.
Configuration menu - View commit details
-
Copy full SHA for 736c6c0 - Browse repository at this point
Copy the full SHA 736c6c0View commit details -
Configuration menu - View commit details
-
Copy full SHA for 609c6b9 - Browse repository at this point
Copy the full SHA 609c6b9View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1bed2da - Browse repository at this point
Copy the full SHA 1bed2daView commit details -
Configuration menu - View commit details
-
Copy full SHA for f9bb6dd - Browse repository at this point
Copy the full SHA f9bb6ddView commit details -
Update db index testing: test both models, gxy and tsi
Also, remove unused env var
Configuration menu - View commit details
-
Copy full SHA for ee5a345 - Browse repository at this point
Copy the full SHA ee5a345View commit details -
Configuration menu - View commit details
-
Copy full SHA for bb4e0fb - Browse repository at this point
Copy the full SHA bb4e0fbView commit details -
Configuration menu - View commit details
-
Copy full SHA for deb683b - Browse repository at this point
Copy the full SHA deb683bView commit details -
Configuration menu - View commit details
-
Copy full SHA for e265f80 - Browse repository at this point
Copy the full SHA e265f80View commit details -
Add prev. version 180 as new revision.
Reason: 180 was added in dev, so it was not in 21.09.
Configuration menu - View commit details
-
Copy full SHA for f87cb9d - Browse repository at this point
Copy the full SHA f87cb9dView commit details -
Preserve manage_db.sh, but do not hide alembic
- Preserves usage of legacy script while not hiding the Alembic script. (see manage_db.sh and run_alembic.sh) - Adds documentation (see top of script files) - Includes misc. relevant refactorings - Includes unit tests for testing legacy script handling
Configuration menu - View commit details
-
Copy full SHA for 537cf5d - Browse repository at this point
Copy the full SHA 537cf5dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 337992e - Browse repository at this point
Copy the full SHA 337992eView commit details -
Modify behavior of legacy wrapper, add tests, refactor
If the database is combined, running `./manage_db.sh upgrade` should upgrade BOTH models: gxy and tsi. However, if tsi uses a separate database, only the galaxy model should be updated. Also, see this for context: galaxyproject#13108 (comment) See inline comments for more details. The new tests are examples of new behavior. All refactoring is directly related to the changes in this commit.
Configuration menu - View commit details
-
Copy full SHA for f32b220 - Browse repository at this point
Copy the full SHA f32b220View commit details -
Check for table existence for vault (see note)
This was the last revision to the database that was handled with SQLAlchemy Migrate prior to the move to Alembic (db version 180). However, it was added to the dev branch after 21.09 was released, but before 22.01. Therefore, this table should be created when upgrading from 21.09, but not from dev.
Configuration menu - View commit details
-
Copy full SHA for d2f766b - Browse repository at this point
Copy the full SHA d2f766bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 6ef54eb - Browse repository at this point
Copy the full SHA 6ef54ebView commit details -
Update manage_db.sh ($@ > "$@")
Co-authored-by: Dannon <dannon.baker@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for c2b367c - Browse repository at this point
Copy the full SHA c2b367cView commit details -
Update manage_db.sh ($@ > "$@")
Co-authored-by: Dannon <dannon.baker@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 7ee1c47 - Browse repository at this point
Copy the full SHA 7ee1c47View commit details -
Update manage_db.sh (use single
=
in[ ]
)Co-authored-by: Dannon <dannon.baker@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 3f577e9 - Browse repository at this point
Copy the full SHA 3f577e9View commit details -
Configuration menu - View commit details
-
Copy full SHA for 92b2e67 - Browse repository at this point
Copy the full SHA 92b2e67View commit details -
Configuration menu - View commit details
-
Copy full SHA for c8ce9c4 - Browse repository at this point
Copy the full SHA c8ce9c4View commit details -
Configuration menu - View commit details
-
Copy full SHA for 3f8a223 - Browse repository at this point
Copy the full SHA 3f8a223View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1a1ae8d - Browse repository at this point
Copy the full SHA 1a1ae8dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 02437fb - Browse repository at this point
Copy the full SHA 02437fbView commit details -
Configuration menu - View commit details
-
Copy full SHA for 70a7942 - Browse repository at this point
Copy the full SHA 70a7942View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6fd1a6e - Browse repository at this point
Copy the full SHA 6fd1a6eView commit details -
Configuration menu - View commit details
-
Copy full SHA for db07621 - Browse repository at this point
Copy the full SHA db07621View commit details -
Configuration menu - View commit details
-
Copy full SHA for 90d8140 - Browse repository at this point
Copy the full SHA 90d8140View commit details -
Configuration menu - View commit details
-
Copy full SHA for 67a4fa8 - Browse repository at this point
Copy the full SHA 67a4fa8View commit details
Commits on Mar 10, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 7535159 - Browse repository at this point
Copy the full SHA 7535159View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1421e7a - Browse repository at this point
Copy the full SHA 1421e7aView commit details -
Drop new migration script (see note)
This will be added as an alembic revision as a separate commit
Configuration menu - View commit details
-
Copy full SHA for 84d5787 - Browse repository at this point
Copy the full SHA 84d5787View commit details
Commits on Mar 11, 2022
-
Improve error message when SA Migrate version is incorrect
See inline comment ("version too old" is misleading if the incorrect version is more recent than what the system expects).
Configuration menu - View commit details
-
Copy full SHA for 44d245f - Browse repository at this point
Copy the full SHA 44d245fView commit details