# -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-01-31 21:55
from __future__ import unicode_literals
from datetime import date

from django.db import migrations, models


def datetime_to_date(apps, schema_editor):
    Item = apps.get_model('menu', 'item')
    for item in Item.objects.all():
        item.c_date = item.created_date.date()
        item.save()


class Migration(migrations.Migration):

    dependencies = [
        ('menu', '0007_auto_20170131_1316'),
    ]

    operations = [
        migrations.AddField(
            model_name='item',
            name='c_date',
            field=models.DateField(default=date.today),
            preserve_default=True,
        ),
        migrations.RunPython(datetime_to_date),
        migrations.RemoveField(
            model_name='item',
            name='created_date'
        ),
        migrations.RenameField(
            model_name='item',
            old_name='c_date',
            new_name='created_date'
        ),
    ]
