# -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-07-22 01:24
from __future__ import unicode_literals

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='HistoricalTemplate',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('body', models.TextField()),
                ('version', models.IntegerField()),
                ('archived_at', models.DateTimeField(auto_now_add=True)),
            ],
            options={
                'ordering': ('-version',),
            },
        ),
        migrations.CreateModel(
            name='TemplateModel',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.SlugField(unique=True)),
                ('layout', models.SlugField(null=True)),
                ('subject', models.TextField(null=True)),
                ('body', models.TextField(null=True)),
                ('version', models.IntegerField(default=1)),
                ('enabled', models.BooleanField(default=False)),
                ('updated_at', models.DateTimeField(auto_now=True)),
            ],
            options={
                'ordering': ('name',),
                'verbose_name': 'Template',
            },
        ),
        migrations.AddField(
            model_name='historicaltemplate',
            name='template',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='happymailer.TemplateModel'),
        ),
    ]
