<gh_stars>0
# Generated by Django 3.2.8 on 2021-10-22 13:13

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='User',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')),
                ('is_staff', models.BooleanField(default=False)),
                ('email', models.EmailField(max_length=255, unique=True, verbose_name='email address')),
                ('username', models.CharField(max_length=150, unique=True, verbose_name='username')),
                ('password', models.CharField(blank=True, max_length=150, verbose_name='password')),
            ],
            options={
                'verbose_name': 'пользователь',
                'verbose_name_plural': 'пользователи',
                'ordering': ('-id',),
            },
        ),
        migrations.CreateModel(
            name='Category',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=30)),
            ],
            options={
                'ordering': ('name',),
            },
        ),
        migrations.CreateModel(
            name='Word',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('english', models.CharField(max_length=30)),
                ('russian', models.CharField(max_length=30)),
                ('is_new', models.BooleanField(default=True)),
                ('is_well_known', models.BooleanField(default=False)),
                ('is_known', models.BooleanField(default=False)),
                ('category', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='words', to='words.category')),
            ],
            options={
                'ordering': ('english',),
            },
        ),
        migrations.CreateModel(
            name='Rating',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('rating', models.IntegerField(default=0)),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, verbose_name='word_rating')),
                ('word', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='words.word', verbose_name='word_rating')),
            ],
            options={
                'ordering': ('user', 'word'),
            },
        ),
        migrations.AddField(
            model_name='user',
            name='words',
            field=models.ManyToManyField(blank=True, null=True, related_name='users', through='words.Rating', to='words.Word'),
        ),
    ]
