# -*- coding: utf-8 -*-
# Generated by Django 1.11.16 on 2018-11-23 12:28


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


class Migration(migrations.Migration):

    dependencies = [
        ('annotations', '0026_auto_20181003_0851'),
    ]

    operations = [
        migrations.CreateModel(
            name='SubCorpus',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=200)),
            ],
            options={
                'verbose_name_plural': 'SubCorpora',
            },
        ),
        migrations.CreateModel(
            name='SubSentence',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('xml_id', models.CharField(max_length=20)),
            ],
            options={
                'verbose_name_plural': 'SubSentences',
            },
        ),
        migrations.AddIndex(
            model_name='word',
            index=models.Index(fields=['xml_id'], name='annotations_xml_id_4487c7_idx'),
        ),
        migrations.AddIndex(
            model_name='sentence',
            index=models.Index(fields=['xml_id'], name='annotations_xml_id_9ad5bf_idx'),
        ),
        migrations.AddField(
            model_name='subsentence',
            name='document',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='annotations.Document'),
        ),
        migrations.AddField(
            model_name='subsentence',
            name='subcorpus',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='annotations.SubCorpus'),
        ),
        migrations.AddField(
            model_name='subcorpus',
            name='corpus',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='annotations.Corpus'),
        ),
        migrations.AddField(
            model_name='subcorpus',
            name='language',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='annotations.Language'),
        ),
        migrations.AddField(
            model_name='corpus',
            name='current_subcorpus',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='current_subcorpus', to='annotations.SubCorpus'),
        ),
        migrations.AlterUniqueTogether(
            name='subsentence',
            unique_together=set([('document', 'subcorpus', 'xml_id')]),
        ),
        migrations.AlterUniqueTogether(
            name='subcorpus',
            unique_together=set([('corpus', 'title')]),
        ),
    ]
