Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
zilencer: Extract BaseRemoteCount class.
Mateusz Mandera1af84c1231ce
diff --git a/zilencer/models.py b/zilencer/models.pyindex f2571039f3c..9b69107b082 100644--- a/zilencer/models.py+++ b/zilencer/models.py@@ -130,11 +130,16 @@ class RemoteRealmAuditLog(AbstractRealmAuditLog):]-class RemoteInstallationCount(BaseCount):+class BaseRemoteCount(BaseCount):server = models.ForeignKey(RemoteZulipServer, on_delete=models.CASCADE)# The remote_id field lets us deduplicate data from the remote serverremote_id = models.IntegerField()+ class Meta:+ abstract = True+++class RemoteInstallationCount(BaseRemoteCount):class Meta:unique_together = ("server", "property", "subgroup", "end_time")indexes = [@@ -150,11 +155,8 @@ class RemoteInstallationCount(BaseCount):# We can't subclass RealmCount because we only have a realm_id here, not a foreign key.-class RemoteRealmCount(BaseCount):- server = models.ForeignKey(RemoteZulipServer, on_delete=models.CASCADE)+class RemoteRealmCount(BaseRemoteCount):realm_id = models.IntegerField()- # The remote_id field lets us deduplicate data from the remote server- remote_id = models.IntegerField()class Meta:unique_together = ("server", "realm_id", "property", "subgroup", "end_time")