# -*- coding: utf-8 -*-
# Generated by Django 1.9.10 on 2017-05-09 07:14
from __future__ import unicode_literals

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('contenttypes', '0002_remove_content_type_name'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='ObjectEvent',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('creation_date', models.DateTimeField(auto_now_add=True, verbose_name='Creation date')),
                ('email_sent', models.BooleanField(default=False, verbose_name='Has been sent in an email?')),
                ('read_by_user', models.BooleanField(default=False, verbose_name='Has been noticed by the user?')),
                ('object_id', models.PositiveIntegerField(blank=True, null=True)),
                ('event_object_id', models.PositiveIntegerField(blank=True, null=True)),
                ('additional_text', models.CharField(blank=True, max_length=128, verbose_name='Additional text')),
                ('content_type', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='event_content_objects', to='contenttypes.ContentType')),
                ('event_content_type', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='event_objects', to='contenttypes.ContentType')),
            ],
            options={
                'ordering': ['-creation_date'],
            },
        ),
        migrations.CreateModel(
            name='ObjectEventType',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.SlugField(help_text='Please use a slugified name, e.g. "student-news".', max_length=256, unique=True, verbose_name='Title')),
            ],
            options={
                'ordering': ['title'],
            },
        ),
        migrations.AddField(
            model_name='objectevent',
            name='event_type',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='events', to='object_events.ObjectEventType', verbose_name='Type'),
        ),
        migrations.AddField(
            model_name='objectevent',
            name='user',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='object_events', to=settings.AUTH_USER_MODEL, verbose_name='User'),
        ),
    ]
