# Generated by Django 2.0.4 on 2018-05-05 14:57

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


class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Comment',
            fields=[
                ('comment_id', models.IntegerField(primary_key=True, serialize=False)),
                ('comment_content', models.TextField()),
                ('publish_date', models.DateTimeField()),
                ('edit_date', models.DateTimeField()),
                ('slug', models.SlugField()),
                ('likes', models.IntegerField(default=0)),
                ('comment_author', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='comments', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'ordering': ['likes', 'publish_date', 'edit_date', 'post_author__name'],
            },
        ),
        migrations.CreateModel(
            name='Post',
            fields=[
                ('post_id', models.IntegerField(primary_key=True, serialize=False)),
                ('post_title', models.CharField(max_length=75, unique=True)),
                ('post_content', models.TextField()),
                ('publish_date', models.DateTimeField(editable=False)),
                ('edit_date', models.DateTimeField()),
                ('slug', models.SlugField(editable=False, unique=True)),
                ('post_author', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='posts', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'ordering': ['publish_date', 'edit_date', 'post_author__name'],
            },
        ),
        migrations.AddField(
            model_name='comment',
            name='post',
            field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='blog.Post'),
        ),
    ]
