forked from galaxyproject/galaxy
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdb_dev.py
40 lines (30 loc) · 1.3 KB
/
db_dev.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
"""
This script is intended to be invoked by the scripts/db_dev.sh script.
"""
import os
import sys
from argparse import ArgumentParser
sys.path.insert(1, os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir, "lib")))
from galaxy.model.migrations.dbscript import ParserBuilder
def main() -> None:
parser = ArgumentParser(
prog="db_dev.sh",
description="Extended database schema migration operations",
epilog="Note: these operations are applied to the Galaxy model only (stored in the `gxy` branch)."
" For migrating the `tsi` branch, use the `run_alembic.sh` script.",
)
parser.add_argument("-c", "--galaxy-config", help="Alternate Galaxy configuration file", dest="config")
parser.add_argument("--raiseerr", help="Raise a full stack trace on error", action="store_true")
parser_builder = ParserBuilder(parser)
parser_builder.add_upgrade_command(dev_options=True)
parser_builder.add_downgrade_command(dev_options=True)
parser_builder.add_version_command()
parser_builder.add_dbversion_command()
parser_builder.add_init_command()
parser_builder.add_revision_command()
parser_builder.add_history_command()
parser_builder.add_show_command()
args = parser.parse_args()
args.func(args)
if __name__ == "__main__":
main()