campaign version refinment, user locks, db repair
This commit is contained in:
27
server/app/db/migrate.py
Normal file
27
server/app/db/migrate.py
Normal file
@@ -0,0 +1,27 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import argparse
|
||||
|
||||
from app.db.migrations import migrate_database
|
||||
|
||||
|
||||
def main() -> None:
|
||||
parser = argparse.ArgumentParser(description="Upgrade the Multi Seal Mail database schema")
|
||||
parser.add_argument(
|
||||
"--no-reconcile-legacy-schema",
|
||||
action="store_true",
|
||||
help="Disable repair of the known create_all/Alembic development schema drift",
|
||||
)
|
||||
args = parser.parse_args()
|
||||
|
||||
result = migrate_database(reconcile_legacy_schema=not args.no_reconcile_legacy_schema)
|
||||
if result.reconciled_revision:
|
||||
print(
|
||||
"Reconciled legacy database marker "
|
||||
f"from {result.previous_revision or 'unversioned'} to {result.reconciled_revision}."
|
||||
)
|
||||
print(f"Database schema is at revision {result.current_revision or 'unknown'}.")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user