# -*- coding: utf-8 -*-
# Generated by Django 1.9.9 on 2018-06-19 14:10
from __future__ import unicode_literals

from django.db import migrations


def change_datetime_to_date(apps, schema_editor):
    menus = apps.get_model('menu', 'Menu').objects.all()
    for menu in menus:
        menu.created_day = menu.created_date.date()
        if menu.expiration_date:
            menu.expiration_day = menu.expiration_date.date()
        menu.save()

    items = apps.get_model('menu', 'Item').objects.all()
    for item in items:
        item.created_day = item.created_date.date()
        item.save()


class Migration(migrations.Migration):

    dependencies = [
        ('menu', '0004_auto_20180619_0740'),
    ]

    operations = [
        migrations.RunPython(change_datetime_to_date)
    ]
