# -*- coding: utf-8 -*-
# Generated by Django 1.9.4 on 2016-05-28 01:53
from __future__ import unicode_literals

from django.db import migrations, models

def migrate_status(apps, schema_editor):
    # We can't import the Event model directly as it may be a newer
    # version than this migration expects. We use the historical version.
    Event = apps.get_model("artbot_website", "Event")
    for event in Event.objects.all():
        event.status = 1 if event.published else 0
        event.save()

class Migration(migrations.Migration):

    dependencies = [
        ('artbot_website', '0008_auto_20160318_0511'),
    ]

    operations = [
        migrations.AddField(
            model_name='event',
            name='status',
            field=models.IntegerField(choices=[(0, b'Draft'), (1, b'Published'), (2, b'Hidden')], default=0),
        ),
        migrations.RunPython(migrate_status),
    ]
