Skip to content

Commit

Permalink
Add support for models with auto-generated integer PKs on Firestore
Browse files Browse the repository at this point in the history
  • Loading branch information
adamalton committed Jan 8, 2024
1 parent 3f08bd9 commit 2f5d764
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions massmigration/backends/djangae.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from djangae.processing import (
datastore_key_ranges,
firestore_name_key_ranges,
firestore_scattered_int_key_ranges,
sequential_int_key_ranges,
uuid_key_ranges,
)
Expand Down Expand Up @@ -80,6 +81,8 @@ def _key_ranges_getter(self, queryset):
elif engine == "gcloudc.db.backends.firestore":
if isinstance(pk_field, AutoCharField):
return firestore_name_key_ranges
elif isinstance(pk_field, (models.AutoField, models.BigAutoField, models.SmallAutoField)):
return firestore_scattered_int_key_ranges
else: # SQL
if isinstance(pk_field, models.IntegerField):
return sequential_int_key_ranges
Expand Down

0 comments on commit 2f5d764

Please sign in to comment.