From bb9c3fda147bfea15ca6c380413efeb7910b6dcb Mon Sep 17 00:00:00 2001 From: Nick Sweeting Date: Mon, 14 Oct 2024 17:40:06 -0700 Subject: [PATCH] fix makemigrations being blocked by check_migrations func --- archivebox/misc/checks.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/archivebox/misc/checks.py b/archivebox/misc/checks.py index 4d12b7df..0c4f9d66 100644 --- a/archivebox/misc/checks.py +++ b/archivebox/misc/checks.py @@ -35,8 +35,9 @@ def check_migrations(): from ..index.sql import list_migrations pending_migrations = [name for status, name in list_migrations() if not status] + is_migrating = any(arg in sys.argv for arg in ['makemigrations', 'migrate', 'init']) - if pending_migrations: + if pending_migrations and not is_migrating: print('[red][X] This collection was created with an older version of ArchiveBox and must be upgraded first.[/red]') print(f' {DATA_DIR}', file=sys.stderr) print(file=sys.stderr)