From e545eb40a099f0284aec5ce36cd9bc185599de49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arttu=20Per=C3=A4l=C3=A4?= Date: Fri, 23 Feb 2024 09:54:10 +0200 Subject: [PATCH] Make removed fields nullable and non-indexed --- .../0001_squashed_0004_auto_20160611_1202.py | 15 +++++++++++++-- reversion/models.py | 6 +++--- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/reversion/migrations/0001_squashed_0004_auto_20160611_1202.py b/reversion/migrations/0001_squashed_0004_auto_20160611_1202.py index 04231b71..80b61854 100644 --- a/reversion/migrations/0001_squashed_0004_auto_20160611_1202.py +++ b/reversion/migrations/0001_squashed_0004_auto_20160611_1202.py @@ -1,4 +1,4 @@ -from django.db import migrations +from django.db import migrations, models class Migration(migrations.Migration): @@ -6,4 +6,15 @@ class Migration(migrations.Migration): ("reversion", "0002_add_index_on_version_for_content_type_and_db"), ] - operations = [] + operations = [ + migrations.AlterField( + model_name="revision", + name="manager_slug", + field=models.CharField(default="default", max_length=191, null=True), + ), + migrations.AlterField( + model_name="version", + name="object_id_int", + field=models.IntegerField(blank=True, null=True), + ), + ] diff --git a/reversion/models.py b/reversion/models.py index c6c90eb1..3f3e234d 100644 --- a/reversion/models.py +++ b/reversion/models.py @@ -49,7 +49,8 @@ class Revision(models.Model): manager_slug = models.CharField( max_length=191, - db_index=True, + db_index=False, + null=True, default="default", ) @@ -232,8 +233,7 @@ class Version(models.Model): object_id_int = models.IntegerField( blank=True, null=True, - db_index=True, - help_text="An indexed, integer version of the stored model's primary key, used for faster lookups.", + db_index=False, ) content_type = models.ForeignKey(