From b557297dd28c3846ee8e642688cad45ce21846b8 Mon Sep 17 00:00:00 2001 From: Alex Vandiver Date: Fri, 31 May 2024 20:02:02 +0000 Subject: [PATCH] zilencer: Drop data which is no longer sent by remote servers. --- .../migrations/0061_clean_count_tables.py | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 zilencer/migrations/0061_clean_count_tables.py diff --git a/zilencer/migrations/0061_clean_count_tables.py b/zilencer/migrations/0061_clean_count_tables.py new file mode 100644 index 0000000000..84f51a3194 --- /dev/null +++ b/zilencer/migrations/0061_clean_count_tables.py @@ -0,0 +1,30 @@ +from django.db import migrations + +# This matches analytics.lib.counts.LOGGING_COUNT_STAT_PROPERTIES_NOT_SENT_TO_BOUNCER +IGNORED = ( + "invites_sent::day", + "mobile_pushes_sent::day", + "active_users_log:is_bot:day", + "active_users:is_bot:day", +) + + +class Migration(migrations.Migration): + elidable = True + + dependencies = [ + ( + "zilencer", + "0060_remove_remoterealmcount_unique_remote_realm_installation_count_and_more", + ), + ] + + operations = [ + migrations.RunSQL( + [ + ("DELETE FROM zilencer_remoterealmcount WHERE property IN %s", (IGNORED,)), + ("DELETE FROM zilencer_remoteinstallationcount WHERE property IN %s", (IGNORED,)), + ], + elidable=True, + ), + ]