From 2e1b49b0095751ac645510c64a40c11922bbdd33 Mon Sep 17 00:00:00 2001 From: Matt Jibson Date: Fri, 13 Nov 2015 15:41:39 -0500 Subject: [PATCH] Allow None for max_id during migrations This allows empty databases with no max_id to run. fixes #869 --- util/migrate/allocator.py | 1 + 1 file changed, 1 insertion(+) diff --git a/util/migrate/allocator.py b/util/migrate/allocator.py index 6e531d251..e154c9e23 100644 --- a/util/migrate/allocator.py +++ b/util/migrate/allocator.py @@ -126,6 +126,7 @@ def yield_random_entries(batch_query, primary_key_field, batch_size, max_id): an "id" field which can be inspected. """ + max_id = max(max_id, 1) allocator = CompletedKeys(max_id + 1) try: