# Generated by Django 2.0.1 on 2018-01-26 10:54

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import sandbox_app.models
import uuid


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='Attachment',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(blank=True, max_length=255, null=True, verbose_name='file name')),
                ('uid', models.UUIDField(default=uuid.uuid4, editable=False, unique=True, verbose_name='public identifier')),
                ('created', models.DateTimeField(auto_now_add=True, verbose_name='created time')),
                ('file', models.FileField(upload_to=sandbox_app.models.upload_directory_path, verbose_name='uploaded file')),
            ],
            options={
                'verbose_name': 'attachment',
                'verbose_name_plural': 'attachments',
                'ordering': ['-created'],
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Post',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=255, verbose_name='title')),
                ('body', models.TextField(verbose_name='content body')),
                ('created', models.DateTimeField(auto_now_add=True, verbose_name='created time')),
                ('author', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='posts', to=settings.AUTH_USER_MODEL, verbose_name='author')),
            ],
            options={
                'ordering': ['-created'],
            },
        ),
        migrations.AddField(
            model_name='attachment',
            name='post',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='attachments', to='sandbox_app.Post', verbose_name='post'),
        ),
    ]
