# Generated by Django 3.2.5 on 2021-08-02 08:43

import ckeditor.fields
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Article',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=190, verbose_name='Article Title')),
                ('slug', models.SlugField(max_length=190, unique_for_date='date_published')),
                ('date_created', models.DateTimeField(auto_now_add=True, verbose_name='Create on')),
                ('date_published', models.DateTimeField(default=django.utils.timezone.now, verbose_name='Published on')),
                ('date_updated', models.DateTimeField(auto_now=True, verbose_name='Updated on')),
                ('content', ckeditor.fields.RichTextField(verbose_name='Article Content')),
                ('status', models.CharField(choices=[('draft', 'Draft'), ('publish', 'Publish')], max_length=15, verbose_name='Article Status')),
                ('coverimage', models.ImageField(default='coverimage.png', upload_to='cover_img/%Y/%m/%d')),
            ],
            options={
                'ordering': ('-date_published', 'title'),
            },
        ),
        migrations.CreateModel(
            name='Category',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=190, verbose_name='Category')),
                ('description', models.TextField(verbose_name='Description')),
            ],
            options={
                'ordering': ('name',),
            },
        ),
        migrations.CreateModel(
            name='Comment',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('content', ckeditor.fields.RichTextField(verbose_name='Comment')),
                ('rating', models.IntegerField(help_text='Rating from 1 to 5')),
                ('date_created', models.DateTimeField(auto_now_add=True, verbose_name='Created on')),
                ('date_updated', models.DateTimeField(auto_now=True, verbose_name='Updated on')),
                ('active', models.BooleanField(default=True)),
                ('article', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='blog_article.article')),
            ],
            options={
                'ordering': ('-date_created',),
            },
        ),
    ]
