# -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-07-04 16:40
from __future__ import unicode_literals

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone


class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('editor', '0010_auto_20170704_1431'),
    ]

    operations = [
        migrations.CreateModel(
            name='ChangeSetUpdate',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('datetime', models.DateTimeField(auto_now_add=True, verbose_name='datetime')),
                ('comment', models.TextField(max_length=1000, null=True)),
                ('state', models.CharField(choices=[('unproposed', 'unproposed'), ('proposed', 'proposed'), ('review', 'in review'), ('rejected', 'rejected'), ('reproposed', 'reproposed'), ('finallyrejected', 'finally rejected'), ('applied', 'accepted')], db_index=True, max_length=20, null=None)),
                ('title', models.CharField(max_length=100, null=True)),
                ('description', models.TextField(max_length=1000, null=True)),
                ('objects_changed', models.BooleanField(default=False)),
                ('assigned_to', models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, related_name='+', to=settings.AUTH_USER_MODEL)),
                ('author', models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, related_name='+', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name': 'Change set update',
                'verbose_name_plural': 'Change set updates',
                'ordering': ['datetime', 'pk'],
            },
        ),
        migrations.AddField(
            model_name='changeset',
            name='last_update',
            field=models.DateTimeField(auto_now_add=True, default=django.utils.timezone.now, verbose_name='last update'),
            preserve_default=False,
        ),
        migrations.AlterField(
            model_name='changeset',
            name='session_id',
            field=models.CharField(db_index=True, max_length=32, null=True, unique=True),
        ),
        migrations.AlterField(
            model_name='changeset',
            name='state',
            field=models.CharField(choices=[('unproposed', 'unproposed'), ('proposed', 'proposed'), ('review', 'in review'), ('rejected', 'rejected'), ('reproposed', 'reproposed'), ('finallyrejected', 'finally rejected'), ('applied', 'accepted')], db_index=True, default='unproposed', max_length=20),
        ),
        migrations.AddField(
            model_name='changesetupdate',
            name='changeset',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='updates', to='editor.ChangeSet'),
        ),
        migrations.AddField(
            model_name='changesetupdate',
            name='session_user',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, related_name='+', to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='changesetupdate',
            name='user',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, related_name='+', to=settings.AUTH_USER_MODEL),
        ),
    ]
