Skip to content

Commit 7473d8a

Browse files
committed
Move migration constants to separate python file
1 parent c0f34bc commit 7473d8a

File tree

2 files changed

+20
-29
lines changed

2 files changed

+20
-29
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Update this file with tags for each new release.
2+
# Note: the key should NOT be a prefix of an existing revision hash in alembic/versions_gxy/.
3+
# For example, if we have a hash 231xxxxxxxxx and use 231 as the key for release 23.1,
4+
# then using 231 as a partial revision identifier like `sh manage_db.sh upgrade 231`
5+
# will map to release 23.1 instead of revision 231xxxxxxxxx.
6+
7+
REVISION_TAGS = {
8+
"22.01": "base",
9+
"22.05": "186d4835587b",
10+
"23.0": "caa7742f7bca",
11+
"23.1": "e93c5d0b47a9",
12+
"23.2": "8a19186a6ee7",
13+
"24.0": "55f02fd8ab6c",
14+
"24.1": "04288b6a5b25",
15+
"24.2": "a4c3ef999ab5",
16+
"25.0": "c716ee82337b",
17+
"25.1": "cd26484899fb",
18+
}

lib/galaxy/model/migrations/dbscript.py

Lines changed: 2 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
BaseDbScript,
1111
BaseParserBuilder,
1212
)
13+
from galaxy.model.migrations.dbrevisions import REVISION_TAGS
1314
from galaxy.model.migrations.scripts import (
1415
get_configuration,
1516
get_configuration_from_file,
@@ -24,34 +25,6 @@
2425
GXY_CONFIG_PREFIX = "GALAXY_CONFIG_"
2526
TSI_CONFIG_PREFIX = "GALAXY_INSTALL_CONFIG_"
2627

27-
# Update this dict with tags for each new release.
28-
# Note: the key should NOT be a prefix of an existing revision hash in alembic/versions_gxy/.
29-
# For example, if we have a hash 231xxxxxxxxx and use 231 as the key for release 23.1,
30-
# then using 231 as a partial revision identifier like `sh manage_db.sh upgrade 231`
31-
# will map to release 23.1 instead of revision 231xxxxxxxxx.
32-
REVISION_TAGS = {
33-
"release_22.01": "base",
34-
"22.01": "base",
35-
"release_22.05": "186d4835587b",
36-
"22.05": "186d4835587b",
37-
"release_23.0": "caa7742f7bca",
38-
"23.0": "caa7742f7bca",
39-
"release_23.1": "e93c5d0b47a9",
40-
"23.1": "e93c5d0b47a9",
41-
"release_23.2": "8a19186a6ee7",
42-
"23.2": "8a19186a6ee7",
43-
"release_24.0": "55f02fd8ab6c",
44-
"24.0": "55f02fd8ab6c",
45-
"release_24.1": "04288b6a5b25",
46-
"24.1": "04288b6a5b25",
47-
"release_24.2": "a4c3ef999ab5",
48-
"24.2": "a4c3ef999ab5",
49-
"release_25.0": "c716ee82337b",
50-
"25.0": "c716ee82337b",
51-
"release_25.1": "cd26484899fb",
52-
"25.1": "cd26484899fb",
53-
}
54-
5528

5629
class ParserBuilder(BaseParserBuilder):
5730
def _get_command_object(self):
@@ -81,7 +54,7 @@ def _add_branch_label(self, revision_id: str) -> str:
8154
return f"gxy@{revision_id}"
8255

8356
def _revision_tags(self):
84-
return REVISION_TAGS
57+
return {f"release_{k}": v for k, v in REVISION_TAGS.items()} | REVISION_TAGS
8558

8659
def _set_dburl(self, config_file: Optional[str] = None) -> None:
8760
gxy_config, tsi_config, _ = get_configuration_from_file(os.getcwd(), config_file)

0 commit comments

Comments
 (0)