# Generated by Django 3.2.5 on 2021-07-23 02:16

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


class Migration(migrations.Migration):

    dependencies = [
        ('blog', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Collection',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255, unique=True)),
                ('slug', models.SlugField(max_length=255)),
            ],
        ),
        migrations.RemoveField(
            model_name='post',
            name='is_featured',
        ),
        migrations.CreateModel(
            name='CollectionPost',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('collection', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='collectionpost', to='blog.collection')),
                ('post', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='collectionpost', to='blog.post')),
            ],
            options={
                'unique_together': {('collection', 'post')},
            },
        ),
        migrations.AddField(
            model_name='collection',
            name='posts',
            field=models.ManyToManyField(blank=True, related_name='collections', through='blog.CollectionPost', to='blog.Post'),
        ),
    ]
