# -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-02-27 14:48
from __future__ import unicode_literals

import django.contrib.postgres.fields.jsonb
from django.db import migrations, models
import django.db.models.deletion
import uuid


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('sites', '0002_alter_domain_unique'),
    ]

    operations = [
        migrations.CreateModel(
            name='EmailMessage',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('data', django.contrib.postgres.fields.jsonb.JSONField(blank=True, default=dict, verbose_name='Data')),
                ('sent', models.BooleanField(default=False, verbose_name='Sent')),
                ('added', models.DateTimeField(auto_now_add=True, verbose_name='Added')),
                ('changed', models.DateTimeField(auto_now=True, verbose_name='Changed')),
                ('site', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='email_messages', to='sites.Site', verbose_name='Site')),
            ],
            options={
                'ordering': ('-added',),
                'verbose_name': 'Email message',
                'verbose_name_plural': 'Email messages',
            },
        ),
        migrations.CreateModel(
            name='EmailTemplate',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('name', models.CharField(max_length=255, unique=True, verbose_name='Name')),
                ('subject', models.CharField(max_length=255, verbose_name='Subject')),
                ('mjml_template', models.TextField(blank=True, default='', verbose_name='MJML template')),
                ('html_template', models.TextField(blank=True, default='', verbose_name='HTML template')),
                ('text_template', models.TextField(blank=True, default='', verbose_name='Text template')),
                ('added', models.DateTimeField(auto_now_add=True, verbose_name='Added')),
                ('changed', models.DateTimeField(auto_now=True, verbose_name='Changed')),
            ],
            options={
                'ordering': ('name',),
                'verbose_name': 'Email template',
                'verbose_name_plural': 'Email templates',
            },
        ),
        migrations.AddField(
            model_name='emailmessage',
            name='template',
            field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='email_messages', to='pcart_messaging.EmailTemplate', verbose_name='Template'),
        ),
    ]
