# Generated by Django 2.2.4 on 2019-08-29 17:49

import capdb.versioning
from django.db import migrations, models
import django.db.models.deletion
import simple_history.models


class Migration(migrations.Migration):

    dependencies = [
        ('capdb', '0078_auto_20190829_1720'),
    ]

    operations = [
        migrations.AddField(
            model_name='citation',
            name='sys_period',
            field=capdb.versioning.DefaultDateTimeRangeField(),
            preserve_default=False,
        ),
        migrations.CreateModel(
            name='HistoricalCitation',
            fields=[
                ('id', models.IntegerField(auto_created=True, blank=True, db_index=True, verbose_name='ID')),
                ('type', models.CharField(choices=[('official', 'official'), ('parallel', 'parallel')], max_length=100)),
                ('category', models.CharField(blank=True, max_length=100, null=True)),
                ('cite', models.CharField(db_index=True, max_length=10000)),
                ('duplicative', models.BooleanField(default=False)),
                ('normalized_cite', models.SlugField(max_length=10000, null=True)),
                ('sys_period', capdb.versioning.DefaultDateTimeRangeField()),
                ('history_id', models.AutoField(primary_key=True, serialize=False)),
                ('case', models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='capdb.CaseMetadata')),
            ],
            options={
                'db_table': 'capdb_citation_history',
                'get_latest_by': 'history_date',
                'verbose_name': 'historical citation',
                'ordering': ('-sys_period', '-history_id'),
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
    ]
