Files
galaxy/scripts/create_toolshed_db.py
T
Sergey Golitsynskiy 92b2e67145 Apply black, isort (squashed)
Squashed:
- pick 8a26c3c7af Fix import order in config
- squash ebe36de5fc Apply black, isort
2022-03-09 18:41:49 -05:00

30 lines
854 B
Python
Executable File

"""
Creates the initial tool shed database schema using the settings defined in config/tool_shed.yml.
Note: pass '-c /location/to/your_config.yml' for non-standard ini file locations.
Note: if no database_connection is set in tool_shed.yml, the default, sqlite database will be constructed.
This script is also wrapped by create_ts_db.sh.
"""
import logging
import os.path
import sys
sys.path.insert(1, os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir, "lib")))
from galaxy.model.orm.scripts import get_config
from tool_shed.webapp.model.migrate.check import create_or_verify_database as create_tool_shed_db
logging.basicConfig(level=logging.DEBUG)
log = logging.getLogger(__name__)
def invoke_create():
config = get_config(sys.argv)
create_tool_shed_db(config["db_url"])
if __name__ == "__main__":
invoke_create()