# Generated by Django 3.2.7 on 2021-09-14 09:49

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


class Migration(migrations.Migration):

    dependencies = [
        ('users', '0002_alter_profile_username'),
    ]

    operations = [
        migrations.CreateModel(
            name='BlogTag',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('tag', models.CharField(max_length=50, verbose_name='Tag')),
            ],
            options={
                'verbose_name_plural': 'Blog Tags',
            },
        ),
        migrations.CreateModel(
            name='Blog',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=50, verbose_name='Blog title')),
                ('body', models.TextField(verbose_name='Blog content')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('author', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='blogs', to=settings.AUTH_USER_MODEL)),
                ('blog_tags', models.ManyToManyField(blank=True, related_name='blog_tags', to='users.BlogTag')),
            ],
            options={
                'verbose_name_plural': 'Blogs',
                'unique_together': {('title', 'author')},
            },
        ),
    ]
