# Generated by Django 3.2.6 on 2021-09-19 16:33

import News.models
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='News',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('image', models.ImageField(upload_to=News.models.upload_to)),
                ('title', models.TextField(max_length=100, null=True)),
                ('data', models.DateTimeField(auto_now=True)),
                ('short_text', models.CharField(max_length=1000)),
                ('text', models.TextField()),
                ('newslink', models.URLField(blank=True, null=True)),
            ],
            options={
                'verbose_name': 'Новости',
            },
        ),
        migrations.CreateModel(
            name='ImageNews',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('image', models.ImageField(upload_to=News.models.upload_to)),
                ('news', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='images', to='News.news')),
            ],
            options={
                'verbose_name': 'Изображение для новости',
            },
        ),
        migrations.CreateModel(
            name='Favourite',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('news', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='News.news')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name': 'Избранное Новостей',
            },
        ),
    ]
