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.

analytics: Migrate models' id columns to bigint.

Alex Vandiver4f4725f81061
diff --git a/analytics/migrations/0020_alter_installationcount_id_alter_realmcount_id_and_more.py b/analytics/migrations/0020_alter_installationcount_id_alter_realmcount_id_and_more.py
new file mode 100644
index 00000000000..91b94810dad
--- /dev/null
+++ b/analytics/migrations/0020_alter_installationcount_id_alter_realmcount_id_and_more.py
@@ -0,0 +1,40 @@
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+ atomic = False
+
+ dependencies = [
+ ("analytics", "0019_remove_unused_counts"),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name="installationcount",
+ name="id",
+ field=models.BigAutoField(
+ auto_created=True, primary_key=True, serialize=False, verbose_name="ID"
+ ),
+ ),
+ migrations.AlterField(
+ model_name="realmcount",
+ name="id",
+ field=models.BigAutoField(
+ auto_created=True, primary_key=True, serialize=False, verbose_name="ID"
+ ),
+ ),
+ migrations.AlterField(
+ model_name="streamcount",
+ name="id",
+ field=models.BigAutoField(
+ auto_created=True, primary_key=True, serialize=False, verbose_name="ID"
+ ),
+ ),
+ migrations.AlterField(
+ model_name="usercount",
+ name="id",
+ field=models.BigAutoField(
+ auto_created=True, primary_key=True, serialize=False, verbose_name="ID"
+ ),
+ ),
+ ]
diff --git a/analytics/models.py b/analytics/models.py
index 2ebe57338ad..f7b85906a75 100644
--- a/analytics/models.py
+++ b/analytics/models.py
@@ -38,6 +38,9 @@ class BaseCount(models.Model):
# Note: When inheriting from BaseCount, you may want to rearrange
# the order of the columns in the migration to make sure they
# match how you'd like the table to be arranged.
+ id = models.BigAutoField(
+ auto_created=True, primary_key=True, serialize=False, verbose_name="ID"
+ )
property = models.CharField(max_length=32)
subgroup = models.CharField(max_length=16, null=True)
end_time = models.DateTimeField()
diff --git a/zilencer/migrations/0062_alter_remoteinstallationcount_id_and_more.py b/zilencer/migrations/0062_alter_remoteinstallationcount_id_and_more.py
new file mode 100644
index 00000000000..0b36d6def7c
--- /dev/null
+++ b/zilencer/migrations/0062_alter_remoteinstallationcount_id_and_more.py
@@ -0,0 +1,26 @@
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+ atomic = False
+
+ dependencies = [
+ ("zilencer", "0061_clean_count_tables"),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name="remoteinstallationcount",
+ name="id",
+ field=models.BigAutoField(
+ auto_created=True, primary_key=True, serialize=False, verbose_name="ID"
+ ),
+ ),
+ migrations.AlterField(
+ model_name="remoterealmcount",
+ name="id",
+ field=models.BigAutoField(
+ auto_created=True, primary_key=True, serialize=False, verbose_name="ID"
+ ),
+ ),
+ ]