mirror of
https://github.com/zulip/zulip.git
synced 2025-10-23 04:52:12 +00:00
zilencer: Extract BaseRemoteCount class.
This commit is contained in:
committed by
Tim Abbott
parent
3cbb651942
commit
1af84c1231
@@ -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 server
|
||||
remote_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")
|
||||
|
Reference in New Issue
Block a user