# Generated by Django 3.2.3 on 2021-06-03 07:10

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Author',
            fields=[
                ('username', models.SlugField(primary_key=True, serialize=False)),
                ('email', models.EmailField(max_length=254)),
            ],
        ),
        migrations.CreateModel(
            name='Change',
            fields=[
                ('slug', models.SlugField(primary_key=True, serialize=False)),
                ('name', models.CharField(max_length=20)),
            ],
        ),
        migrations.CreateModel(
            name='ContentData',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=50)),
                ('content', models.TextField()),
            ],
        ),
        migrations.CreateModel(
            name='File',
            fields=[
                ('slug', models.SlugField(primary_key=True, serialize=False)),
                ('file', models.FileField(upload_to=test_app.models.upload_with_unique_name)),
            ],
        ),
        migrations.CreateModel(
            name='Language',
            fields=[
                ('code', models.CharField(max_length=7, primary_key=True, serialize=False)),
                ('name', models.CharField(max_length=30)),
            ],
        ),
        migrations.CreateModel(
            name='Profile',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('first_name', models.CharField(max_length=15)),
                ('last_name', models.CharField(max_length=20)),
            ],
        ),
        migrations.CreateModel(
            name='Tag',
            fields=[
                ('slug', models.SlugField(primary_key=True, serialize=False)),
            ],
        ),
        migrations.CreateModel(
            name='Post',
            fields=[
                ('slug', models.SlugField(primary_key=True, serialize=False)),
                ('author', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='test_app.author')),
                ('change', models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, to='test_app.change')),
                ('content_data', models.ManyToManyField(to='test_app.ContentData')),
                ('tag', models.ManyToManyField(to='test_app.Tag')),
            ],
        ),
        migrations.AddField(
            model_name='contentdata',
            name='language',
            field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='test_app.language'),
        ),
        migrations.AddField(
            model_name='author',
            name='profile',
            field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='test_app.profile'),
        ),
    ]
