# Generated by Django 2.2.4 on 2019-08-07 21:05

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Communication',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=200)),
                ('html', models.TextField(verbose_name='HTML')),
                ('sent_on', models.DateTimeField(blank=True, null=True, verbose_name='Date')),
            ],
        ),
        migrations.CreateModel(
            name='MailingList',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=150, unique=True, verbose_name='Name')),
                ('email', models.EmailField(max_length=255, verbose_name='Email')),
            ],
        ),
        migrations.CreateModel(
            name='Subject',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('active', models.BooleanField(verbose_name='Active')),
                ('name', models.CharField(max_length=255)),
                ('text', models.TextField(blank=True, null=True, verbose_name='Text')),
                ('order', models.IntegerField(verbose_name='Order')),
            ],
        ),
        migrations.CreateModel(
            name='Template',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255, verbose_name='Name')),
                ('code', models.TextField(verbose_name='Code')),
            ],
        ),
        migrations.CreateModel(
            name='Message',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('publish_start', models.DateField(blank=True, null=True, verbose_name='Start publish date')),
                ('publish_end', models.DateField(blank=True, null=True, verbose_name='End publish date')),
                ('order', models.IntegerField(blank=True, null=True, verbose_name='Order')),
                ('name', models.CharField(max_length=200, verbose_name='Name')),
                ('image', models.ImageField(blank=True, max_length=300, upload_to='uploads/message/', verbose_name='Image')),
                ('date', models.DateTimeField(blank=True, null=True, verbose_name='Date')),
                ('text', models.TextField(blank=True, null=True, verbose_name='Text')),
                ('is_event', models.BooleanField(default=True, verbose_name='Is an event')),
                ('location', models.CharField(blank=True, max_length=200, null=True, verbose_name='Location')),
                ('start', models.DateTimeField(blank=True, null=True, verbose_name='Start')),
                ('end', models.DateTimeField(blank=True, null=True, verbose_name='End')),
                ('first_newsletter', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='firsts_msgs', to='news.Communication')),
                ('last_newsletter', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='lasts_msgs', to='news.Communication')),
                ('mailing_list', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='news.MailingList')),
                ('subject', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='news.Subject')),
            ],
        ),
        migrations.AddField(
            model_name='mailinglist',
            name='template',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='news.Template'),
        ),
        migrations.AddField(
            model_name='communication',
            name='sent_to',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='news.MailingList'),
        ),
    ]
