# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2018-02-27 06:37
from __future__ import unicode_literals

from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import django_extensions.db.fields


class Migration(migrations.Migration):

    replaces = [('timeline', '0001_initial'), ('timeline', '0002_remove_timelineeventinserterrulebook_last'), ('timeline', '0003_timelineeventinserterrulebook_last'), ('timeline', '0004_timelineevent'), ('timeline', '0005_auto_20180212_1217'), ('timeline', '0006_auto_20180213_1202'), ('timeline', '0007_auto_20180216_1433'), ('timeline', '0008_auto_20180216_1753'), ('timeline', '0009_auto_20180217_1202'), ('timeline', '0010_auto_20180217_1347'), ('timeline', '0011_auto_20180227_0349')]

    dependencies = [
        ('package', '0004_move_timelineevent_model_to_timeline_app'),
        ('profiles', '0001_initial'),
        ('package', '0003_created_by_field_removed'),
    ]

    operations = [
        migrations.CreateModel(
            name='TimelineEventInserterRule',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('type', models.CharField(choices=[('AuthorTimelineEventRule', 'Author'), ('TagTimelineEventRule', 'Tag'), ('AfterDatetimeTimelineEventRule', 'After'), ('TitleRegexpTimelineEventRule', 'Title regexp'), ('TitlePrefixTimelineEventRule', 'Title prefix')], max_length=64)),
                ('argument', models.CharField(max_length=256)),
            ],
        ),
        migrations.CreateModel(
            name='TimelineEventInserterRulebook',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('service_type', models.CharField(choices=[('SteemPostService', 'Steem Post')], max_length=64)),
                ('project', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='timeline_rulebooks', to='package.Project')),
                ('last', models.DateTimeField(blank=True, default=None, null=True)),
            ],
        ),
        migrations.AddField(
            model_name='timelineeventinserterrule',
            name='rulebook',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='rules', to='timeline.TimelineEventInserterRulebook'),
        ),
        migrations.SeparateDatabaseAndState(
            state_operations=[
                migrations.CreateModel(
                    name='TimelineEvent',
                    fields=[
                        ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                        ('created', django_extensions.db.fields.CreationDateTimeField(auto_now_add=True, verbose_name='created')),
                        ('modified', django_extensions.db.fields.ModificationDateTimeField(auto_now=True, verbose_name='modified')),
                        ('name', models.CharField(max_length=100, verbose_name='Event Name')),
                        ('url', models.URLField(verbose_name='URL')),
                        ('date', models.DateField(default=django.utils.timezone.now)),
                        ('project', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='events', to='package.Project')),
                    ],
                    options={
                        'abstract': False,
                        'db_table': 'timeline_timelineevent',
                    },
                ),
            ],
        ),
        migrations.AlterUniqueTogether(
            name='timelineevent',
            unique_together=set([('name', 'url', 'date', 'project')]),
        ),
        migrations.AlterModelTable(
            name='timelineevent',
            table=None,
        ),
        migrations.AlterField(
            model_name='timelineeventinserterrulebook',
            name='service_type',
            field=models.CharField(choices=[('SteemPostService', 'new post is published on Steem'), ('GithubReleaseService', 'new release is published on Github')], max_length=64),
        ),
        migrations.AlterField(
            model_name='timelineeventinserterrule',
            name='type',
            field=models.CharField(choices=[('SteemAuthorTimelineEventRule', 'Published by'), ('SteemTagTimelineEventRule', 'Has a tag'), ('SteemAfterDatetimeTimelineEventRule', 'Published after'), ('SteemTitleRegexpTimelineEventRule', 'Title regexp'), ('SteemTitlePrefixTimelineEventRule', 'Title prefix')], max_length=64),
        ),
        migrations.AddField(
            model_name='timelineevent',
            name='added_by',
            field=models.ForeignKey(default=None, null=True, on_delete=django.db.models.deletion.CASCADE, to='profiles.Profile'),
        ),
        migrations.AddField(
            model_name='timelineevent',
            name='ruleset',
            field=models.ForeignKey(default=None, null=True, on_delete=django.db.models.deletion.CASCADE, to='timeline.TimelineEventInserterRulebook'),
        ),
        migrations.AlterField(
            model_name='timelineeventinserterrule',
            name='type',
            field=models.CharField(choices=[('SteemAuthorTimelineEventRule', 'Published by'), ('SteemTagTimelineEventRule', 'Has a tag'), ('SteemAfterDatetimeTimelineEventRule', 'Published after'), ('SteemTitleRegexpTimelineEventRule', 'Title regexp'), ('SteemTitlePrefixTimelineEventRule', 'Title prefix'), ('GithubRepositoryTimelineEventRule', 'In repository')], max_length=64),
        ),
        migrations.AlterField(
            model_name='timelineeventinserterrule',
            name='type',
            field=models.CharField(choices=[('SteemAuthorTimelineEventRule', 'Published by'), ('SteemTagTimelineEventRule', 'Has a tag'), ('SteemAfterDatetimeTimelineEventRule', 'Published after'), ('SteemTitleRegexpTimelineEventRule', 'Title regexp'), ('SteemTitlePrefixTimelineEventRule', 'Title prefix')], max_length=64),
        ),
        migrations.AlterField(
            model_name='timelineeventinserterrulebook',
            name='service_type',
            field=models.CharField(choices=[('SteemPostService', 'new post is published on Steem')], max_length=64),
        ),
        migrations.AddField(
            model_name='timelineeventinserterrulebook',
            name='notify',
            field=models.BooleanField(default=True),
        ),
        migrations.AlterField(
            model_name='timelineeventinserterrule',
            name='type',
            field=models.CharField(choices=[('SteemAuthorTimelineEventRule', 'Published by'), ('SteemTagTimelineEventRule', 'Has a tag'), ('SteemTitlePrefixTimelineEventRule', 'Title starts with'), ('SteemTitleContainsTimelineEventRule', 'Title contains')], max_length=64),
        ),
        migrations.AlterField(
            model_name='timelineeventinserterrulebook',
            name='last',
            field=models.DateTimeField(auto_now_add=True, null=True),
        ),
    ]
