# Generated by Django 2.1.7 on 2019-03-14 18:19

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

"""
MOTIVATION:

Source name and homepage are a redundant field in the case model. To save disk space and allow queries by source,
we must move source meta data to an extra model.

MIGRATION GUIDE:

0. Stop web server
1. Backup database!!!
2. Pull changes from git
3. Create source model: ./manage.py migrate sources
4. Add source foreign key: ./manage.py migrate cases 0019
5. Run data migrations: ./manage.py migrate cases 0020
6. Update code (remove fields from case model)
7. Run ./manage.py migrate cases 0021

"""


class Migration(migrations.Migration):
    dependencies = [
        ("sources", "0001_initial"),
        ("cases", "0018_add_db_indexes"),
    ]

    operations = [
        migrations.AddField(
            model_name="case",
            name="source",
            field=models.ForeignKey(
                default=1,
                on_delete=django.db.models.deletion.SET_DEFAULT,
                to="sources.Source",
            ),
        ),
    ]
