2016-07-29 21:52:45 +02:00
|
|
|
# -*- coding: utf-8 -*-
|
2017-06-01 10:44:51 +02:00
|
|
|
import django.db.models.deletion
|
2016-07-29 21:52:45 +02:00
|
|
|
from django.conf import settings
|
2017-11-16 00:55:49 +01:00
|
|
|
from django.db import migrations, models
|
2016-07-29 21:52:45 +02:00
|
|
|
|
2017-11-16 00:55:49 +01:00
|
|
|
import zerver.lib.str_utils
|
2016-07-29 21:52:45 +02:00
|
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
|
|
|
|
dependencies = [
|
2016-10-06 23:25:55 +02:00
|
|
|
('zerver', '0030_realm_org_type'),
|
2016-07-29 21:52:45 +02:00
|
|
|
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
|
|
|
]
|
|
|
|
|
|
|
|
operations = [
|
|
|
|
migrations.CreateModel(
|
|
|
|
name='Anomaly',
|
|
|
|
fields=[
|
|
|
|
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
|
|
|
('info', models.CharField(max_length=1000)),
|
|
|
|
],
|
2018-05-16 04:11:22 +02:00
|
|
|
bases=(models.Model,),
|
2016-07-29 21:52:45 +02:00
|
|
|
),
|
|
|
|
migrations.CreateModel(
|
|
|
|
name='HuddleCount',
|
|
|
|
fields=[
|
|
|
|
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
2017-06-01 10:44:51 +02:00
|
|
|
('huddle', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='zerver.Recipient')),
|
|
|
|
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
|
2016-07-29 21:52:45 +02:00
|
|
|
('property', models.CharField(max_length=40)),
|
|
|
|
('end_time', models.DateTimeField()),
|
|
|
|
('interval', models.CharField(max_length=20)),
|
2016-10-06 23:25:55 +02:00
|
|
|
('value', models.BigIntegerField()),
|
2017-06-01 10:44:51 +02:00
|
|
|
('anomaly', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='analytics.Anomaly', null=True)),
|
2016-07-29 21:52:45 +02:00
|
|
|
],
|
2018-05-16 04:11:22 +02:00
|
|
|
bases=(models.Model,),
|
2016-07-29 21:52:45 +02:00
|
|
|
),
|
|
|
|
migrations.CreateModel(
|
|
|
|
name='InstallationCount',
|
|
|
|
fields=[
|
|
|
|
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
|
|
|
('property', models.CharField(max_length=40)),
|
|
|
|
('end_time', models.DateTimeField()),
|
|
|
|
('interval', models.CharField(max_length=20)),
|
2016-10-06 23:25:55 +02:00
|
|
|
('value', models.BigIntegerField()),
|
2017-06-01 10:44:51 +02:00
|
|
|
('anomaly', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='analytics.Anomaly', null=True)),
|
2016-07-29 21:52:45 +02:00
|
|
|
],
|
2018-05-16 04:11:22 +02:00
|
|
|
bases=(models.Model,),
|
2016-07-29 21:52:45 +02:00
|
|
|
),
|
|
|
|
migrations.CreateModel(
|
|
|
|
name='RealmCount',
|
|
|
|
fields=[
|
|
|
|
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
2017-06-01 10:44:51 +02:00
|
|
|
('realm', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='zerver.Realm')),
|
2016-07-29 21:52:45 +02:00
|
|
|
('property', models.CharField(max_length=40)),
|
|
|
|
('end_time', models.DateTimeField()),
|
|
|
|
('interval', models.CharField(max_length=20)),
|
2016-10-06 23:25:55 +02:00
|
|
|
('value', models.BigIntegerField()),
|
2017-06-01 10:44:51 +02:00
|
|
|
('anomaly', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='analytics.Anomaly', null=True)),
|
2016-10-06 23:25:55 +02:00
|
|
|
|
2016-07-29 21:52:45 +02:00
|
|
|
],
|
2018-05-16 04:11:22 +02:00
|
|
|
bases=(models.Model,),
|
2016-07-29 21:52:45 +02:00
|
|
|
),
|
|
|
|
migrations.CreateModel(
|
|
|
|
name='StreamCount',
|
|
|
|
fields=[
|
|
|
|
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
2017-06-01 10:44:51 +02:00
|
|
|
('realm', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='zerver.Realm')),
|
|
|
|
('stream', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='zerver.Stream')),
|
2016-07-29 21:52:45 +02:00
|
|
|
('property', models.CharField(max_length=40)),
|
|
|
|
('end_time', models.DateTimeField()),
|
|
|
|
('interval', models.CharField(max_length=20)),
|
2016-10-06 23:25:55 +02:00
|
|
|
('value', models.BigIntegerField()),
|
2017-06-01 10:44:51 +02:00
|
|
|
('anomaly', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='analytics.Anomaly', null=True)),
|
2016-07-29 21:52:45 +02:00
|
|
|
],
|
2018-05-16 04:11:22 +02:00
|
|
|
bases=(models.Model,),
|
2016-07-29 21:52:45 +02:00
|
|
|
),
|
|
|
|
migrations.CreateModel(
|
|
|
|
name='UserCount',
|
|
|
|
fields=[
|
|
|
|
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
2017-06-01 10:44:51 +02:00
|
|
|
('realm', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='zerver.Realm')),
|
|
|
|
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
|
2016-07-29 21:52:45 +02:00
|
|
|
('property', models.CharField(max_length=40)),
|
|
|
|
('end_time', models.DateTimeField()),
|
|
|
|
('interval', models.CharField(max_length=20)),
|
2016-10-06 23:25:55 +02:00
|
|
|
('value', models.BigIntegerField()),
|
2017-06-01 10:44:51 +02:00
|
|
|
('anomaly', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='analytics.Anomaly', null=True)),
|
2016-07-29 21:52:45 +02:00
|
|
|
],
|
2018-05-16 04:11:22 +02:00
|
|
|
bases=(models.Model,),
|
2016-07-29 21:52:45 +02:00
|
|
|
),
|
|
|
|
migrations.AlterUniqueTogether(
|
|
|
|
name='usercount',
|
|
|
|
unique_together=set([('user', 'property', 'end_time', 'interval')]),
|
|
|
|
),
|
|
|
|
migrations.AlterUniqueTogether(
|
|
|
|
name='streamcount',
|
|
|
|
unique_together=set([('stream', 'property', 'end_time', 'interval')]),
|
|
|
|
),
|
|
|
|
migrations.AlterUniqueTogether(
|
|
|
|
name='realmcount',
|
|
|
|
unique_together=set([('realm', 'property', 'end_time', 'interval')]),
|
|
|
|
),
|
|
|
|
migrations.AlterUniqueTogether(
|
|
|
|
name='installationcount',
|
|
|
|
unique_together=set([('property', 'end_time', 'interval')]),
|
|
|
|
),
|
|
|
|
migrations.AlterUniqueTogether(
|
|
|
|
name='huddlecount',
|
|
|
|
unique_together=set([('huddle', 'property', 'end_time', 'interval')]),
|
|
|
|
),
|
|
|
|
]
|