# Generated by Django 3.0.8 on 2020-07-22 21:10

from django.db import migrations, models
import django.db.models.deletion
import django.db.models.functions.text
import django_expression_index.index


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Lexem',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('surface', models.CharField(db_index=True, max_length=255, unique=True)),
            ],
        ),
        migrations.CreateModel(
            name='LexemTail',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('surface', models.CharField(db_index=True, max_length=255)),
                ('lexem', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='tails', related_query_name='tail', to='django_native_search.Lexem')),
            ],
        ),
        migrations.AddIndex(
            model_name='lexem',
            index=django_expression_index.index.ExpressionIndex(expressions=[django.db.models.functions.text.Lower('surface')], name='django_native_searc_9a3539_idx'),
        ),
        migrations.AddIndex(
            model_name='lexemtail',
            index=django_expression_index.index.ExpressionIndex(expressions=[django.db.models.functions.text.Lower('surface')], name='django_native_searc_87adea_idx'),
        ),
        migrations.AlterUniqueTogether(
            name='lexemtail',
            unique_together={('lexem', 'surface')},
        ),
    ]
