Skip to content

Commit

Permalink
Make removed fields nullable and non-indexed
Browse files Browse the repository at this point in the history
  • Loading branch information
arttuperala committed Feb 23, 2024
1 parent 2d57a52 commit e545eb4
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
15 changes: 13 additions & 2 deletions reversion/migrations/0001_squashed_0004_auto_20160611_1202.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,20 @@
from django.db import migrations
from django.db import migrations, models


class Migration(migrations.Migration):
dependencies = [
("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),
),
]
6 changes: 3 additions & 3 deletions reversion/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
)

Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit e545eb4

Please sign in to comment.