# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import models, migrations
import django_extensions.db.fields.json
from django.conf import settings
import django_extensions.db.fields
import django.utils.timezone


class Migration(migrations.Migration):

    dependencies = [
        ('sync', '__first__'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('trainings', '__first__'),
        ('documents', '__first__'),
    ]

    operations = [
        migrations.CreateModel(
            name='Event',
            fields=[
                ('is_deleted', models.BooleanField(default=False)),
                ('update_locally', models.BooleanField(default=False)),
                ('id', django_extensions.db.fields.UUIDField(serialize=False, primary_key=True, blank=True, editable=False)),
                ('date_logged', models.DateTimeField(default=django.utils.timezone.now, db_index=True)),
                ('action', models.CharField(max_length=64, choices=[('registration', 'User was registered'), ('cms_login', 'User logged into the CMS'), ('app_login', 'User logged into the iOS app'), ('session_create', 'User created a session'), ('session_register', 'User was registered for a session'), ('session_start', 'User started a session'), ('session_join', 'User joined a session'), ('session_quit', 'User quit a session'), ('document_download', 'User downloaded a document')], db_index=True)),
                ('extra_data', django_extensions.db.fields.json.JSONField(blank=True)),
                ('document', models.ForeignKey(blank=True, null=True, to='documents.Document')),
                ('first_update', models.ForeignKey(related_name='event_by_first', blank=True, null=True, to='sync.Update')),
                ('last_update', models.ForeignKey(related_name='event_by_last', blank=True, null=True, to='sync.Update')),
                ('session', models.ForeignKey(blank=True, null=True, to='trainings.TrainingSession')),
                ('user', models.ForeignKey(blank=True, null=True, to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'ordering': ('-date_logged',),
            },
            bases=(models.Model,),
        ),
    ]
