# -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2017-10-19 08:10
from __future__ import unicode_literals

import django.contrib.postgres.fields.jsonb
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import model_utils.fields


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('partner', '0024_auto_20171011_0333'),
    ]

    operations = [
        migrations.CreateModel(
            name='SanctionedItem',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created')),
                ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified')),
                ('sanctioned_type', models.CharField(choices=[('Ent', 'Sanctioned Entity'), ('Ind', 'Sanctioned Individual')], max_length=3)),
                ('is_active', models.BooleanField(default=True)),
                ('data_id', models.IntegerField(db_index=True, unique=True)),
                ('listed_on', models.DateField(blank=True, null=True)),
                ('last_updated', models.DateField(blank=True, null=True)),
                ('metadata', django.contrib.postgres.fields.jsonb.JSONField(blank=True, null=True)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='SanctionedName',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created')),
                ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified')),
                ('name', models.CharField(max_length=255)),
                ('is_active', models.BooleanField(default=True)),
                ('item', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='check_names', to='sanctionslist.SanctionedItem')),
            ],
        ),
        migrations.CreateModel(
            name='SanctionedNameMatch',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created')),
                ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified')),
                ('can_ignore', models.BooleanField(default=False)),
                ('match_type', models.CharField(choices=[('Usr', 'User Match'), ('Brd', 'Board Match'), ('Org', 'Organization Name Match')], max_length=3)),
                ('match_text', models.TextField(blank=True, null=True)),
                ('can_ignore_text', models.TextField(blank=True, null=True)),
                ('name', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='matches', to='sanctionslist.SanctionedName')),
                ('partner', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='sanction_matches', to='partner.Partner')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AlterUniqueTogether(
            name='sanctionedname',
            unique_together=set([('item', 'name')]),
        ),
    ]
