# Generated by Django 2.1.5 on 2019-01-11 10:08

from django.db import migrations, models
import django.db.models.deletion
import djtools.blog.utils


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Post',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('updated', models.DateTimeField(auto_now=True)),
                ('title', models.CharField(max_length=255)),
                ('slug', models.SlugField(max_length=255, unique=True)),
                ('subtitle', models.CharField(blank=True, max_length=255, null=True)),
                ('body', models.TextField()),
                ('image', models.ImageField(upload_to=djtools.blog.utils.photo_upload_to)),
            ],
            options={
                'ordering': ['-created'],
            },
        ),
        migrations.CreateModel(
            name='PostPhoto',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('updated', models.DateTimeField(auto_now=True)),
                ('image', models.ImageField(upload_to=djtools.blog.utils.post_photo_upload_to)),
                ('title', models.CharField(blank=True, help_text='This text will be used for the img alt attribute and for the image caption', max_length=255, null=True)),
                ('order', models.PositiveIntegerField(default=0)),
                ('featured', models.BooleanField(default=False)),
                ('post', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='djtools_blog.Post')),
            ],
            options={
                'ordering': ('-featured', 'order', '-updated'),
            },
        ),
        migrations.AlterIndexTogether(
            name='postphoto',
            index_together={('featured', 'order', 'updated')},
        ),
    ]
