Files

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

40 lines
1.3 KiB
Python
Raw Permalink Normal View History

2022-09-15 00:20:50 -04:00
"""
This script is intended to be invoked by the scripts/db_dev.sh script.
"""
import os
import sys
2022-09-15 15:21:27 -04:00
from argparse import ArgumentParser
2022-09-15 00:20:50 -04:00
sys.path.insert(1, os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir, "lib")))
2022-09-15 15:21:27 -04:00
from galaxy.model.migrations.dbscript import ParserBuilder
2022-09-15 00:20:50 -04:00
def main() -> None:
parser = ArgumentParser(
2022-09-15 15:21:27 -04:00
prog="db_dev.sh",
description="Extended database schema migration operations",
2022-09-15 00:20:50 -04:00
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")
2022-09-15 15:21:27 -04:00
parser_builder = ParserBuilder(parser)
2022-09-15 00:20:50 -04:00
parser_builder.add_upgrade_command(dev_options=True)
parser_builder.add_downgrade_command(dev_options=True)
2022-09-15 15:21:27 -04:00
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()
2022-09-15 00:20:50 -04:00
args = parser.parse_args()
args.func(args)
if __name__ == "__main__":
main()