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

from django.db import models, migrations
import django_extensions.db.fields.json
import django_extensions.db.fields


class Migration(migrations.Migration):

    dependencies = [
        ('sync', '0001_initial'),
        ('contenttypes', '0002_remove_content_type_name'),
        ('eventlog', '0002_auto_20150417_1815'),
    ]

    operations = [
        migrations.CreateModel(
            name='EventLog',
            fields=[
                ('is_deleted', models.BooleanField(default=False)),
                ('update_locally', models.BooleanField(default=False)),
                ('id', django_extensions.db.fields.UUIDField(blank=True, primary_key=True, serialize=False, editable=False)),
                ('created_at', models.DateTimeField(auto_now=True, db_index=True)),
                ('action', models.CharField(choices=[('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, max_length=64)),
                ('subject_pk', django_extensions.db.fields.UUIDField(blank=True, editable=False)),
                ('source_pk', django_extensions.db.fields.UUIDField(blank=True, null=True, editable=False)),
                ('target_pk', django_extensions.db.fields.UUIDField(blank=True, null=True, editable=False)),
                ('extra', django_extensions.db.fields.json.JSONField(blank=True)),
                ('first_update', models.ForeignKey(to='sync.Update', blank=True, related_name='eventlog_by_first', null=True)),
                ('last_update', models.ForeignKey(to='sync.Update', blank=True, related_name='eventlog_by_last', null=True)),
                ('source_type', models.ForeignKey(to='contenttypes.ContentType', blank=True, related_name='events_from', null=True)),
                ('subject_type', models.ForeignKey(to='contenttypes.ContentType', related_name='events_on')),
                ('target_type', models.ForeignKey(to='contenttypes.ContentType', blank=True, related_name='events_to', null=True)),
            ],
            options={
                'ordering': ('-created_at',),
            },
        ),
        migrations.RemoveField(
            model_name='event',
            name='document',
        ),
        migrations.RemoveField(
            model_name='event',
            name='first_update',
        ),
        migrations.RemoveField(
            model_name='event',
            name='last_update',
        ),
        migrations.RemoveField(
            model_name='event',
            name='session',
        ),
        migrations.RemoveField(
            model_name='event',
            name='user',
        ),
        migrations.DeleteModel(
            name='Event',
        ),
    ]
