From 3cbb651942ca46d76825bf64911207b67f5c21e8 Mon Sep 17 00:00:00 2001 From: Mateusz Mandera Date: Fri, 20 Oct 2023 02:08:45 +0200 Subject: [PATCH] zilencer: Remove index on RemoteInstallationCount.remote_id. As in 902498ec4ff572ff289b875f62bb304df8cbf21e, we shouldn't need an index on remote_id alone - only (server_id, remote_id) together. --- ...0_alter_remoteinstallationcount_remote_id.py | 17 +++++++++++++++++ zilencer/models.py | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 zilencer/migrations/0030_alter_remoteinstallationcount_remote_id.py diff --git a/zilencer/migrations/0030_alter_remoteinstallationcount_remote_id.py b/zilencer/migrations/0030_alter_remoteinstallationcount_remote_id.py new file mode 100644 index 0000000000..dbc3c7e1ef --- /dev/null +++ b/zilencer/migrations/0030_alter_remoteinstallationcount_remote_id.py @@ -0,0 +1,17 @@ +# Generated by Django 4.2.6 on 2023-10-20 00:10 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + dependencies = [ + ("zilencer", "0029_update_remoterealm_indexes"), + ] + + operations = [ + migrations.AlterField( + model_name="remoteinstallationcount", + name="remote_id", + field=models.IntegerField(), + ), + ] diff --git a/zilencer/models.py b/zilencer/models.py index e7cb3a94ce..f2571039f3 100644 --- a/zilencer/models.py +++ b/zilencer/models.py @@ -133,7 +133,7 @@ class RemoteRealmAuditLog(AbstractRealmAuditLog): class RemoteInstallationCount(BaseCount): server = models.ForeignKey(RemoteZulipServer, on_delete=models.CASCADE) # The remote_id field lets us deduplicate data from the remote server - remote_id = models.IntegerField(db_index=True) + remote_id = models.IntegerField() class Meta: unique_together = ("server", "property", "subgroup", "end_time")