# -*- coding: utf-8 -*-
# Generated by Django 1.9.5 on 2016-04-18 17:03
from __future__ import unicode_literals

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


class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('leprikon', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Message',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('sent', models.DateTimeField(auto_now_add=True, verbose_name='sent')),
                ('subject', models.CharField(max_length=150, verbose_name='subject')),
                ('text', djangocms_text_ckeditor.fields.HTMLField(default='', verbose_name='text')),
            ],
            options={
                'ordering': ('-sent',),
                'verbose_name': 'message',
                'verbose_name_plural': 'messages',
            },
        ),
        migrations.CreateModel(
            name='MessageRecipient',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('slug', models.SlugField(editable=False)),
                ('sent', models.DateTimeField(auto_now_add=True, verbose_name='sent')),
                ('received', models.DateTimeField(default=None, null=True, verbose_name='received')),
                ('message', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='recipients', to='leprikon.Message', verbose_name='message')),
                ('recipient', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='leprikon_messages', to=settings.AUTH_USER_MODEL, verbose_name='recipient')),
            ],
            options={
                'ordering': ('-message__sent',),
            },
        ),
        migrations.AlterUniqueTogether(
            name='messagerecipient',
            unique_together=set([('message', 'recipient')]),
        ),
    ]
