mirror of
https://github.com/zulip/zulip.git
synced 2025-11-20 14:38:46 +00:00
Analytics database tables are getting big, and so we're likely moving to a model where ~all stats are day stats, and we keep hourly stats only for the last N days. Also changed the name because: * messages_sent_* suggests the counts (summed over subgroup) should be the same as the other messages_sent stats, but they are different (these don't include PMs). * messages_sent_by_stream:is_bot:day is longer than 32 characters, the max allowable length for a BaseCount.property. Includes a database migration to remove the old stat from the analytics tables.
21 lines
626 B
Python
21 lines
626 B
Python
# -*- coding: utf-8 -*-
|
|
from django.db.backends.postgresql_psycopg2.schema import DatabaseSchemaEditor
|
|
from django.db.migrations.state import StateApps
|
|
from django.db import migrations
|
|
|
|
from analytics.lib.counts import do_delete_count_stat
|
|
|
|
def delete_messages_sent_to_stream_stat(apps, schema_editor):
|
|
# type: (StateApps, DatabaseSchemaEditor) -> None
|
|
do_delete_count_stat('messages_sent_to_stream:is_bot')
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
dependencies = [
|
|
('analytics', '0008_add_count_indexes'),
|
|
]
|
|
|
|
operations = [
|
|
migrations.RunPython(delete_messages_sent_to_stream_stat),
|
|
]
|