# Generated by Django 3.0.6 on 2020-06-03 21:36

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


class Migration(migrations.Migration):

    dependencies = [
        ('photograph', '0001_initial'),
        ('cv', '0002_auto_20200529_1241'),
    ]

    operations = [
        migrations.CreateModel(
            name='CloseMatchRun',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_on', models.DateTimeField(auto_now_add=True, db_index=True, help_text='Date created (automatically recorded)')),
                ('last_updated', models.DateField(auto_now=True, db_index=True, help_text='Date last modified (automatically recorded)')),
                ('max_neighbors', models.PositiveIntegerField(default=6, help_text='Number of nearest neighbors to request from the index.')),
                ('cutoff_distance', models.FloatField(help_text='Photographs returned from the index query farther away from the photograph will be excluded.')),
                ('exclude_future_distance', models.FloatField(help_text='Photographs returned from the index query farther away than this measure will be excluded from future consideration from any CloseMatchSet in this run.')),
            ],
        ),
        migrations.CreateModel(
            name='CloseMatchSet',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_on', models.DateTimeField(auto_now_add=True, db_index=True, help_text='Date created (automatically recorded)')),
                ('last_updated', models.DateField(auto_now=True, db_index=True, help_text='Date last modified (automatically recorded)')),
                ('close_match_run', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='close_match_sets', to='cv.CloseMatchRun')),
                ('seed_photograph', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='seeded_close_match_sets', to='photograph.Photograph')),
            ],
            options={
                'unique_together': {('close_match_run', 'seed_photograph')},
            },
        ),
        migrations.CreateModel(
            name='CloseMatchSetMembership',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('distance', models.FloatField()),
                ('close_match_set', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='memberships', to='cv.CloseMatchSet')),
                ('photograph', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='close_match_memberships', to='photograph.Photograph')),
            ],
            options={
                'unique_together': {('close_match_set', 'photograph')},
            },
        ),
        migrations.AlterUniqueTogether(
            name='similaritymatchset',
            unique_together=None,
        ),
        migrations.RemoveField(
            model_name='similaritymatchset',
            name='seed_photograph',
        ),
        migrations.RemoveField(
            model_name='similaritymatchset',
            name='similarity_match_run',
        ),
        migrations.AlterUniqueTogether(
            name='similaritymatchsetmembership',
            unique_together=None,
        ),
        migrations.RemoveField(
            model_name='similaritymatchsetmembership',
            name='photograph',
        ),
        migrations.RemoveField(
            model_name='similaritymatchsetmembership',
            name='similarity_match_set',
        ),
        migrations.AlterField(
            model_name='annoyidx',
            name='pytorch_model',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='pytorch_model_ann_indices', to='cv.PyTorchModel'),
        ),
        migrations.DeleteModel(
            name='SimilarityMatchRun',
        ),
        migrations.DeleteModel(
            name='SimilarityMatchSet',
        ),
        migrations.DeleteModel(
            name='SimilarityMatchSetMembership',
        ),
        migrations.AddField(
            model_name='closematchrun',
            name='annoy_idx',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='close_match_runs', to='cv.AnnoyIdx'),
        ),
        migrations.AddField(
            model_name='closematchrun',
            name='pytorch_model',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='close_match_runs', to='cv.PyTorchModel'),
        ),
        migrations.AlterUniqueTogether(
            name='closematchrun',
            unique_together={('pytorch_model', 'annoy_idx', 'max_neighbors', 'cutoff_distance', 'exclude_future_distance')},
        ),
    ]
