campaign version refinment, user locks, db repair
This commit is contained in:
@@ -2,7 +2,8 @@ from __future__ import annotations
|
||||
|
||||
import argparse
|
||||
|
||||
from app.db.bootstrap import bootstrap_dev_data, create_all_tables
|
||||
from app.db.bootstrap import bootstrap_dev_data
|
||||
from app.db.migrations import migrate_database
|
||||
from app.db.session import SessionLocal
|
||||
from app.settings import settings
|
||||
|
||||
@@ -13,8 +14,13 @@ def main() -> None:
|
||||
parser.add_argument("--dev-api-key", default=settings.dev_bootstrap_api_key, help="Development API key secret to create")
|
||||
args = parser.parse_args()
|
||||
|
||||
create_all_tables()
|
||||
print("Database tables ensured.")
|
||||
migration = migrate_database()
|
||||
if migration.reconciled_revision:
|
||||
print(
|
||||
"Reconciled legacy database marker "
|
||||
f"to {migration.reconciled_revision}."
|
||||
)
|
||||
print(f"Database schema upgraded to {migration.current_revision}.")
|
||||
|
||||
if args.with_dev_data:
|
||||
with SessionLocal() as session:
|
||||
|
||||
Reference in New Issue
Block a user