Skip to content

Commit

Permalink
Squash stats migrations
Browse files Browse the repository at this point in the history
  • Loading branch information
brianhelba committed Mar 20, 2022
1 parent 9396b09 commit cfa1ef9
Showing 1 changed file with 107 additions and 0 deletions.
107 changes: 107 additions & 0 deletions isic/stats/migrations/0001_initial_squashed.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
from django.db import migrations, models
import django.db.models.deletion
import django.db.models.expressions
import django_extensions.db.fields


class Migration(migrations.Migration):
replaces = [
('stats', '0001_initial'),
('stats', '0002_imagedownload'),
('stats', '0003_auto_20220306_0902'),
('stats', '0004_id_big_auto_field'),
('stats', '0005_imagedownload_user_agent'),
]

initial = True

dependencies = [
('core', '0002_merge_default_site'),
]

operations = [
migrations.CreateModel(
name='GaMetrics',
fields=[
(
'id',
models.BigAutoField(
auto_created=True, primary_key=True, serialize=False, verbose_name='ID'
),
),
(
'created',
django_extensions.db.fields.CreationDateTimeField(
auto_now_add=True, verbose_name='created'
),
),
(
'modified',
django_extensions.db.fields.ModificationDateTimeField(
auto_now=True, verbose_name='modified'
),
),
('range_start', models.DateTimeField()),
('range_end', models.DateTimeField()),
('num_sessions', models.PositiveIntegerField()),
('sessions_per_country', models.JSONField()),
],
options={
'get_latest_by': 'modified',
'abstract': False,
},
),
migrations.CreateModel(
name='ImageDownload',
fields=[
(
'id',
models.BigAutoField(
auto_created=True, primary_key=True, serialize=False, verbose_name='ID'
),
),
(
'modified',
django_extensions.db.fields.ModificationDateTimeField(
auto_now=True, verbose_name='modified'
),
),
(
'created',
django_extensions.db.fields.CreationDateTimeField(
auto_now_add=True, db_index=True
),
),
('download_time', models.DateTimeField()),
('ip_address', models.GenericIPAddressField()),
('user_agent', models.CharField(max_length=200, null=True)),
('request_id', models.CharField(max_length=200, unique=True)),
(
'image',
models.ForeignKey(
on_delete=django.db.models.deletion.PROTECT,
related_name='downloads',
to='core.image',
),
),
],
options={
'get_latest_by': 'modified',
'abstract': False,
},
),
migrations.AddConstraint(
model_name='gametrics',
constraint=models.CheckConstraint(
check=models.Q(('range_start__lt', django.db.models.expressions.F('range_end'))),
name='range_end_gt_range_start',
),
),
migrations.AddConstraint(
model_name='imagedownload',
constraint=models.CheckConstraint(
check=models.Q(('download_time__lt', django.db.models.expressions.F('created'))),
name='download_occurred_before_tracking',
),
),
]

0 comments on commit cfa1ef9

Please sign in to comment.