mirror of
https://github.com/zulip/zulip.git
synced 2025-11-03 13:33:24 +00:00
confirmation: Use BigInteger to match other models' "id" field.
Without this, Django builds queries with which compare tables' "id"
fields to `("confirmation_confirmation"."object_id")::bigint`; the
explicit cast prevents the index added in the previous commit from
being used.
(cherry picked from commit 9e02e562bb)
This commit is contained in:
committed by
Tim Abbott
parent
e3d1ff1cc2
commit
85cc589bdb
15
confirmation/migrations/0015_alter_confirmation_object_id.py
Normal file
15
confirmation/migrations/0015_alter_confirmation_object_id.py
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
dependencies = [
|
||||||
|
("confirmation", "0014_confirmation_confirmatio_content_80155a_idx"),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name="confirmation",
|
||||||
|
name="object_id",
|
||||||
|
field=models.PositiveBigIntegerField(db_index=True),
|
||||||
|
),
|
||||||
|
]
|
||||||
@@ -209,7 +209,7 @@ def confirmation_url(
|
|||||||
|
|
||||||
class Confirmation(models.Model):
|
class Confirmation(models.Model):
|
||||||
content_type = models.ForeignKey(ContentType, on_delete=CASCADE)
|
content_type = models.ForeignKey(ContentType, on_delete=CASCADE)
|
||||||
object_id = models.PositiveIntegerField(db_index=True)
|
object_id = models.PositiveBigIntegerField(db_index=True)
|
||||||
content_object = GenericForeignKey("content_type", "object_id")
|
content_object = GenericForeignKey("content_type", "object_id")
|
||||||
date_sent = models.DateTimeField(db_index=True)
|
date_sent = models.DateTimeField(db_index=True)
|
||||||
confirmation_key = models.CharField(max_length=40, db_index=True)
|
confirmation_key = models.CharField(max_length=40, db_index=True)
|
||||||
|
|||||||
Reference in New Issue
Block a user