Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

confirmation: Migrate Confirmation to bigint.

Alex Vandiver53b30ed65dbe
diff --git a/confirmation/migrations/0012_alter_confirmation_id.py b/confirmation/migrations/0012_alter_confirmation_id.py
new file mode 100644
index 00000000000..b6aef6aaae2
--- /dev/null
+++ b/confirmation/migrations/0012_alter_confirmation_id.py
@@ -0,0 +1,17 @@
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+ dependencies = [
+ ("confirmation", "0011_alter_confirmation_expiry_date"),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name="confirmation",
+ name="id",
+ field=models.BigAutoField(
+ auto_created=True, primary_key=True, serialize=False, verbose_name="ID"
+ ),
+ ),
+ ]
diff --git a/confirmation/models.py b/confirmation/models.py
index 6740b30cb50..0270832c9d7 100644
--- a/confirmation/models.py
+++ b/confirmation/models.py
@@ -207,6 +207,9 @@ def confirmation_url(
class Confirmation(models.Model):
+ id = models.BigAutoField(
+ auto_created=True, primary_key=True, serialize=False, verbose_name="ID"
+ )
content_type = models.ForeignKey(ContentType, on_delete=CASCADE)
object_id = models.PositiveIntegerField(db_index=True)
content_object = GenericForeignKey("content_type", "object_id")