# Generated by Django 2.1.7 on 2019-04-09 15:30

import colorfield.fields
import django.contrib.postgres.fields
from django.db import migrations, models
import django.db.models.deletion
import mohaverekhan.models.base_models
import uuid


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Normalizer',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.SlugField(default='unknown-normalizer', unique=True)),
                ('show_name', models.CharField(default='نرمال\u200cکننده نامشخص', max_length=200)),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('owner', models.CharField(default='undefined', max_length=100)),
                ('is_automatic', models.BooleanField(default=False)),
                ('model_details', mohaverekhan.models.base_models.UTF8JSONField(blank=True, default=dict)),
                ('last_update', models.DateTimeField(auto_now=True)),
            ],
            options={
                'verbose_name': 'Normalizer',
                'verbose_name_plural': 'Normalizers',
                'ordering': ('-created',),
            },
        ),
        migrations.CreateModel(
            name='Tag',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('name', models.CharField(max_length=15)),
                ('persian', models.CharField(max_length=30)),
                ('color', colorfield.fields.ColorField(max_length=18)),
                ('examples', django.contrib.postgres.fields.ArrayField(base_field=models.CharField(max_length=50), blank=True, default=list, size=None)),
            ],
            options={
                'verbose_name': 'Tag',
                'verbose_name_plural': 'Tags',
                'ordering': ('-created',),
            },
        ),
        migrations.CreateModel(
            name='Tagger',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.SlugField(default='unknown-tagger', unique=True)),
                ('show_name', models.CharField(default='برچسب\u200cزن نامشخص', max_length=200)),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('owner', models.CharField(default='undefined', max_length=100)),
                ('is_automatic', models.BooleanField(default=False)),
                ('model_details', mohaverekhan.models.base_models.UTF8JSONField(blank=True, default=dict)),
                ('last_update', models.DateTimeField(auto_now=True)),
            ],
            options={
                'verbose_name': 'Tagger',
                'verbose_name_plural': 'Taggers',
                'ordering': ('-created',),
            },
        ),
        migrations.CreateModel(
            name='TagSet',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('name', models.SlugField(default='unknown-tag-set', unique=True)),
                ('last_update', models.DateTimeField(auto_now=True)),
            ],
            options={
                'verbose_name': 'Tag Set',
                'verbose_name_plural': 'Tag Sets',
                'ordering': ('-created',),
            },
        ),
        migrations.CreateModel(
            name='Text',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('content', models.TextField()),
                ('normalizers_sequence', django.contrib.postgres.fields.ArrayField(base_field=models.CharField(max_length=200), blank=True, default=list, size=None)),
            ],
            options={
                'verbose_name': 'Text',
                'verbose_name_plural': 'Texts',
                'ordering': ('-created',),
            },
        ),
        migrations.CreateModel(
            name='TextTag',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('tagged_tokens', mohaverekhan.models.base_models.UTF8JSONField(default=list)),
                ('accuracy', models.FloatField(blank=True, default=0)),
                ('is_valid', models.BooleanField(blank=True, default=None, null=True)),
                ('tagger', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='text_tags', related_query_name='text_tag', to='mohaverekhan.Tagger')),
            ],
            options={
                'verbose_name': 'Text Tag',
                'verbose_name_plural': 'Text Tags',
                'ordering': ('-created',),
            },
        ),
        migrations.CreateModel(
            name='Token',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('content', models.CharField(max_length=200, unique=True)),
            ],
            options={
                'verbose_name': 'Token',
                'verbose_name_plural': 'Tokens',
                'ordering': ('-created',),
            },
        ),
        migrations.CreateModel(
            name='TokenTag',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('tag', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='token_tags', related_query_name='token_tag', to='mohaverekhan.Tag')),
                ('token', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='token_tags', related_query_name='token_tag', to='mohaverekhan.Token')),
            ],
            options={
                'verbose_name': 'Token Tag',
                'verbose_name_plural': 'Token Tags',
                'ordering': ('-created',),
            },
        ),
        migrations.CreateModel(
            name='Validator',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.SlugField(default='unknown-validator', unique=True)),
                ('show_name', models.CharField(default='اعتبارسنج نامشخص', max_length=200)),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('owner', models.CharField(default='undefined', max_length=100)),
            ],
            options={
                'verbose_name': 'Validator',
                'verbose_name_plural': 'Validators',
                'ordering': ('-created',),
            },
        ),
        migrations.CreateModel(
            name='Word',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('content', models.CharField(max_length=200)),
            ],
            options={
                'verbose_name': 'Word',
                'verbose_name_plural': 'Words',
                'ordering': ('-created',),
            },
        ),
        migrations.CreateModel(
            name='WordNormal',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('content', models.CharField(max_length=200)),
                ('is_valid', models.BooleanField(blank=True, default=None, null=True)),
                ('normalizer', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='word_normals', related_query_name='word_normal', to='mohaverekhan.Normalizer')),
                ('validator', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='word_normals', related_query_name='word_normal', to='mohaverekhan.Validator')),
                ('word', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='word_normals', related_query_name='word_normal', to='mohaverekhan.Word')),
            ],
            options={
                'verbose_name': 'Word Normal',
                'verbose_name_plural': 'Word Normals',
                'ordering': ('-created',),
            },
        ),
        migrations.CreateModel(
            name='TextNormal',
            fields=[
                ('text_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='mohaverekhan.Text')),
                ('is_valid', models.BooleanField(blank=True, default=None, null=True)),
            ],
            options={
                'verbose_name': 'Text Normal',
                'verbose_name_plural': 'Text Normals',
                'ordering': ('-created',),
            },
            bases=('mohaverekhan.text',),
        ),
        migrations.AddField(
            model_name='word',
            name='normalizers',
            field=models.ManyToManyField(blank=True, related_name='words', related_query_name='word', through='mohaverekhan.WordNormal', to='mohaverekhan.Normalizer'),
        ),
        migrations.AddField(
            model_name='token',
            name='tags',
            field=models.ManyToManyField(blank=True, related_name='tokens', related_query_name='token', through='mohaverekhan.TokenTag', to='mohaverekhan.Tag'),
        ),
        migrations.AddField(
            model_name='texttag',
            name='text',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='text_tags', related_query_name='text_tag', to='mohaverekhan.Text'),
        ),
        migrations.AddField(
            model_name='texttag',
            name='true_text_tag',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='+', to='mohaverekhan.TextTag'),
        ),
        migrations.AddField(
            model_name='texttag',
            name='validator',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='text_tags', related_query_name='text_tag', to='mohaverekhan.Validator'),
        ),
        migrations.AddField(
            model_name='tagger',
            name='tag_set',
            field=models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, related_name='taggers', related_query_name='tagger', to='mohaverekhan.TagSet'),
        ),
        migrations.AddField(
            model_name='tag',
            name='tag_set',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='tags', related_query_name='tag', to='mohaverekhan.TagSet'),
        ),
        migrations.CreateModel(
            name='BitianistFormalNLTKTagger',
            fields=[
            ],
            options={
                'proxy': True,
                'indexes': [],
            },
            bases=('mohaverekhan.tagger',),
        ),
        migrations.CreateModel(
            name='BitianistInformalNLTKTagger',
            fields=[
            ],
            options={
                'proxy': True,
                'indexes': [],
            },
            bases=('mohaverekhan.tagger',),
        ),
        migrations.CreateModel(
            name='BitianistInformalRefinementNormalizer',
            fields=[
            ],
            options={
                'proxy': True,
                'indexes': [],
            },
            bases=('mohaverekhan.normalizer',),
        ),
        migrations.CreateModel(
            name='BitianistInformalReplacementNormalizer',
            fields=[
            ],
            options={
                'proxy': True,
                'indexes': [],
            },
            bases=('mohaverekhan.normalizer',),
        ),
        migrations.CreateModel(
            name='BitianistInformalSeq2SeqNormalizer',
            fields=[
            ],
            options={
                'proxy': True,
                'indexes': [],
            },
            bases=('mohaverekhan.normalizer',),
        ),
        migrations.AlterUniqueTogether(
            name='tokentag',
            unique_together={('token', 'tag')},
        ),
        migrations.AddField(
            model_name='textnormal',
            name='normalizer',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='text_normals', related_query_name='text_normal', to='mohaverekhan.Normalizer'),
        ),
        migrations.AddField(
            model_name='textnormal',
            name='text',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='text_normals', related_query_name='text_normal', to='mohaverekhan.Text'),
        ),
        migrations.AddField(
            model_name='textnormal',
            name='validator',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='text_normals', related_query_name='text_normal', to='mohaverekhan.Validator'),
        ),
        migrations.AddField(
            model_name='text',
            name='normalizers',
            field=models.ManyToManyField(blank=True, related_name='texts', related_query_name='text', through='mohaverekhan.TextNormal', to='mohaverekhan.Normalizer'),
        ),
        migrations.AlterUniqueTogether(
            name='tag',
            unique_together={('name', 'tag_set'), ('persian', 'tag_set')},
        ),
    ]
