# Generated by Django 3.1.2 on 2020-11-01 07:58

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


class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('memorization', '0005_populate_lang_table'),
    ]

    operations = [
        migrations.RenameField(
            model_name='word',
            old_name='word',
            new_name='name',
        ),
        migrations.AlterField(
            model_name='word',
            name='definition',
            field=models.CharField(blank=True, max_length=300, null=True, verbose_name='one word definition'),
        ),
        migrations.AlterUniqueTogether(
            name='word',
            unique_together={('name', 'language')},
        ),
        migrations.CreateModel(
            name='NoteBook',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('entry_date', models.DateTimeField(auto_now_add=True, verbose_name='date and time when entry was created')),
                ('memorization_date', models.DateTimeField(blank=True, null=True, verbose_name='date when word was memorized')),
                ('attempts', models.PositiveSmallIntegerField(default=0, verbose_name='quantity of memorization attempts')),
                ('learn_in_language', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='memorization.language', verbose_name='language to learn in')),
                ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, verbose_name='notebook owner')),
                ('word', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='memorization.word', verbose_name='word to learn')),
            ],
            options={
                'verbose_name': 'Notebook',
                'verbose_name_plural': 'Notebooks',
                'unique_together': {('word', 'learn_in_language')},
            },
        ),
    ]
