mirror of
https://github.com/zulip/zulip.git
synced 2025-10-24 08:33:43 +00:00
Adds two simplifying assumptions to how we process analytics stats: * Sets the atomic unit of work to: a stat processed at an hour boundary. * For any given stat, only allows these atomic units of work to be processed in chronological order. Adds a table FillState that, for each stat, keeps track of the last unit of work that was processed.
27 lines
839 B
Python
27 lines
839 B
Python
# -*- coding: utf-8 -*-
|
|
from __future__ import unicode_literals
|
|
|
|
from django.db import migrations, models
|
|
import zerver.lib.str_utils
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
dependencies = [
|
|
('analytics', '0002_remove_huddlecount'),
|
|
]
|
|
|
|
operations = [
|
|
migrations.CreateModel(
|
|
name='FillState',
|
|
fields=[
|
|
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
|
('property', models.CharField(unique=True, max_length=40)),
|
|
('end_time', models.DateTimeField()),
|
|
('state', models.PositiveSmallIntegerField()),
|
|
('last_modified', models.DateTimeField(auto_now=True)),
|
|
],
|
|
bases=(zerver.lib.str_utils.ModelReprMixin, models.Model),
|
|
),
|
|
]
|