# Generated by Django 4.1.10 on 2023-09-08 12:20

from django.db import migrations, models
from django.db.models import F
from django_scopes import scopes_disabled


def apply_migration(apps, schema_editor):
    with scopes_disabled():
        MealPlan = apps.get_model('cookbook', 'MealPlan')
        MealPlan.objects.update(to_date=F('from_date'))


class Migration(migrations.Migration):
    dependencies = [
        ('cookbook', '0200_alter_propertytype_options_remove_keyword_icon_and_more'),
    ]

    operations = [
        migrations.RenameField(
            model_name='mealplan',
            old_name='date',
            new_name='from_date',
        ),
        migrations.AddField(
            model_name='mealplan',
            name='to_date',
            field=models.DateField(blank=True, null=True),
        ),
        migrations.RunPython(apply_migration),
        migrations.AlterField(
            model_name='mealplan',
            name='to_date',
            field=models.DateField(),
        ),
    ]
