<gh_stars>1-10
# Generated by Django 3.1.4 on 2021-01-08 00:15

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('cat', '0001_initial'),
        ('file', '0001_initial'),
        ('campus', '0001_initial'),
    ]

    operations = [
        migrations.AddField(
            model_name='entry',
            name='author',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL, verbose_name='记录者'),
        ),
        migrations.AddField(
            model_name='entry',
            name='cat',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='entries', related_query_name='entry', to='cat.cat', verbose_name='猫猫'),
        ),
        migrations.AddField(
            model_name='catdetail',
            name='avatar',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='file.photo', verbose_name='头像'),
        ),
        migrations.AddField(
            model_name='catdetail',
            name='cat',
            field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='detail', to='cat.cat', verbose_name='主模型'),
        ),
        migrations.AddField(
            model_name='catdetail',
            name='cover_photo',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='file.photo', verbose_name='封面照'),
        ),
        migrations.AddField(
            model_name='catdetail',
            name='parent',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='kids', related_query_name='kid', to=settings.AUTH_USER_MODEL, verbose_name='紧急联系人'),
        ),
        migrations.AddField(
            model_name='cat',
            name='campus',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='cats', related_query_name='cat', to='campus.campus', verbose_name='校区'),
        ),
        migrations.AddField(
            model_name='cat',
            name='mom',
            field=models.ForeignKey(blank=True, limit_choices_to={'gender': 1}, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='kids', related_query_name='kid', to='cat.cat', verbose_name='猫妈'),
        ),
        migrations.AddIndex(
            model_name='entry',
            index=models.Index(fields=['cat'], name='cat_entry_cat_id_ea3f00_idx'),
        ),
        migrations.AddIndex(
            model_name='entry',
            index=models.Index(fields=['name'], name='cat_entry_name_82f5f0_idx'),
        ),
        migrations.AddIndex(
            model_name='cat',
            index=models.Index(fields=['name'], name='cat_cat_name_a7bed7_idx'),
        ),
        migrations.AddConstraint(
            model_name='cat',
            constraint=models.UniqueConstraint(fields=('name', 'campus'), name='unique_name'),
        ),
    ]
