Add create-db command
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
from worblehat.models import Base
|
||||
import logging
|
||||
from pprint import pformat
|
||||
|
||||
@@ -67,6 +68,11 @@ def main():
|
||||
WorblehatCli.run_with_safe_exit_wrapper(sql_session)
|
||||
exit(0)
|
||||
|
||||
if args.command == "create-db":
|
||||
database_url = Config.db_string()
|
||||
engine = create_engine(database_url)
|
||||
Base.metadata.create_all(engine)
|
||||
|
||||
if args.command == "devscripts":
|
||||
sql_session = _connect_to_database(echo=Config["logging.debug_sql"])
|
||||
if args.script == "seed-content-for-deadline-daemon":
|
||||
|
||||
@@ -19,6 +19,10 @@ subparsers.add_parser(
|
||||
"deadline-daemon",
|
||||
help="Initialize a single pass of the daemon which sends deadline emails",
|
||||
)
|
||||
subparsers.add_parser(
|
||||
"create-db",
|
||||
help="Create the database schema in the database specified in the configuration",
|
||||
)
|
||||
subparsers.add_parser(
|
||||
"cli",
|
||||
help="Start the command line interface",
|
||||
|
||||
Reference in New Issue
Block a user