diff --git a/backend/cli.py b/backend/cli.py index 6d358f10..3eeb5cb4 100644 --- a/backend/cli.py +++ b/backend/cli.py @@ -70,6 +70,11 @@ def command_user_create(args): ) +def command_migrate(args): + print("Start migration.") + management.call_command("migrate") + + def command_run_webserver(args): print(f"Starting server with port {args.port}.") if is_windows(): @@ -102,9 +107,12 @@ def main(): # Create a parser for db initialization. parser_init = subparsers.add_parser("init", help="see `init -h`") - parser_init.set_defaults(handler=command_db_init) + # Create a parser for migration. + parser_migration = subparsers.add_parser("migrate", help="Updates database schema.") + parser_migration.set_defaults(handler=command_migrate) + # Create a parser for user creation. parser_create_user = subparsers.add_parser("createuser", help="see `createuser -h`") parser_create_user.add_argument("--username", type=str, default="admin", help="admin username")