# Generated by Django 3.1.1 on 2020-11-30 18:42

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='Post',
            fields=[
                ('idPost', models.AutoField(primary_key=True, serialize=False, verbose_name='idPost')),
                ('title', models.CharField(max_length=255, verbose_name='Заголовок поста')),
                ('text', models.TextField(verbose_name='Текст поста')),
                ('timestamp', models.DateTimeField(auto_now_add=True, verbose_name='Дата создания поста')),
            ],
            options={
                'verbose_name': 'Пост',
                'verbose_name_plural': 'Посты',
                'db_table': 'posts',
                'ordering': ['idPost'],
            },
        ),
        migrations.CreateModel(
            name='News',
            fields=[
                ('idSubscr', models.AutoField(primary_key=True, serialize=False, verbose_name='idSubscr')),
                ('notRead', models.BooleanField(default=True, verbose_name='Пост не прочитан')),
                ('owner', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='userown', to=settings.AUTH_USER_MODEL, verbose_name='Владелец подписки')),
                ('post', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='ubserv.post', verbose_name='Пост')),
                ('userNameSub', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, verbose_name='Автор поста')),
            ],
            options={
                'verbose_name': 'Подписка',
                'verbose_name_plural': 'Подписка',
                'db_table': 'news',
                'ordering': ['-idSubscr'],
            },
        ),
    ]
