mirror of
https://github.com/zulip/zulip.git
synced 2025-11-10 00:46:03 +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)
|
server = models.ForeignKey(RemoteZulipServer, on_delete=models.CASCADE)
|
||||||
# The remote_id field lets us deduplicate data from the remote server
|
# The remote_id field lets us deduplicate data from the remote server
|
||||||
remote_id = models.IntegerField()
|
remote_id = models.IntegerField()
|
||||||
|
|
||||||
|
class Meta:
|
||||||
|
abstract = True
|
||||||
|
|
||||||
|
|
||||||
|
class RemoteInstallationCount(BaseRemoteCount):
|
||||||
class Meta:
|
class Meta:
|
||||||
unique_together = ("server", "property", "subgroup", "end_time")
|
unique_together = ("server", "property", "subgroup", "end_time")
|
||||||
indexes = [
|
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.
|
# We can't subclass RealmCount because we only have a realm_id here, not a foreign key.
|
||||||
class RemoteRealmCount(BaseCount):
|
class RemoteRealmCount(BaseRemoteCount):
|
||||||
server = models.ForeignKey(RemoteZulipServer, on_delete=models.CASCADE)
|
|
||||||
realm_id = models.IntegerField()
|
realm_id = models.IntegerField()
|
||||||
# The remote_id field lets us deduplicate data from the remote server
|
|
||||||
remote_id = models.IntegerField()
|
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
unique_together = ("server", "realm_id", "property", "subgroup", "end_time")
|
unique_together = ("server", "realm_id", "property", "subgroup", "end_time")
|
||||||
|
|||||||
Reference in New Issue
Block a user