From 11ca95ba3c957ba1494527e1fd45315fd8ff6a80 Mon Sep 17 00:00:00 2001 From: John Davis Date: Thu, 9 Feb 2023 14:42:30 -0500 Subject: [PATCH 1/2] Add new release tags to db migration scripts Note: we add release_23.1 to the TS script because that's the release that will contain the base revision. --- lib/galaxy/model/migrations/dbscript.py | 2 ++ lib/tool_shed/webapp/model/migrations/dbscript.py | 13 +++++++++++++ 2 files changed, 15 insertions(+) diff --git a/lib/galaxy/model/migrations/dbscript.py b/lib/galaxy/model/migrations/dbscript.py index b49729cb767..527db07235d 100644 --- a/lib/galaxy/model/migrations/dbscript.py +++ b/lib/galaxy/model/migrations/dbscript.py @@ -34,6 +34,8 @@ REVISION_TAGS = { "22.01": "base", "release_22.05": "186d4835587b", "22.05": "186d4835587b", + "release_23.0": "186d4835587b", + "23.0": "186d4835587b", } diff --git a/lib/tool_shed/webapp/model/migrations/dbscript.py b/lib/tool_shed/webapp/model/migrations/dbscript.py index e0820ebefcb..e9a3a5da349 100644 --- a/lib/tool_shed/webapp/model/migrations/dbscript.py +++ b/lib/tool_shed/webapp/model/migrations/dbscript.py @@ -20,6 +20,16 @@ log = logging.getLogger(__name__) CONFIG_FILE_ARG = "--toolshed-config" +# Update this dict with tags for each new release. +# Note: the key should NOT be a prefix of an existing revision hash in alembic/versions/. +# For example, if we have a hash 231xxxxxxxxx and use 231 as the key for release 23.1, +# then using 231 as a partial revision identifier like `sh manage_toolshed_db.sh upgrade 231` +# will map to release 23.1 instead of revision 231xxxxxxxxx. +REVISION_TAGS = { + "release_23.1": "base", + "23.1": "base", +} + class ParserBuilder(BaseParserBuilder): def _get_command_object(self): @@ -43,3 +53,6 @@ class DbScript(BaseDbScript): def _upgrade_to_head(self, is_sql_mode: bool) -> None: self.alembic_config.set_main_option("sqlalchemy.url", self.url) self._upgrade_to_revision("head", is_sql_mode) + + def _revision_tags(self): + return REVISION_TAGS From 3d808426e98b84e8fd720c5b9ac1221d83888f06 Mon Sep 17 00:00:00 2001 From: John Davis Date: Thu, 9 Feb 2023 15:15:36 -0500 Subject: [PATCH 2/2] Do not change manage_db.sh: should go into 23.0 --- lib/galaxy/model/migrations/dbscript.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/galaxy/model/migrations/dbscript.py b/lib/galaxy/model/migrations/dbscript.py index 527db07235d..b49729cb767 100644 --- a/lib/galaxy/model/migrations/dbscript.py +++ b/lib/galaxy/model/migrations/dbscript.py @@ -34,8 +34,6 @@ REVISION_TAGS = { "22.01": "base", "release_22.05": "186d4835587b", "22.05": "186d4835587b", - "release_23.0": "186d4835587b", - "23.0": "186d4835587b", }