# -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2016-03-28 00:42
from __future__ import unicode_literals

import django.contrib.postgres.fields.jsonb
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Headline',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('text', models.TextField()),
                ('winner', models.BooleanField(default=False)),
            ],
        ),
        migrations.CreateModel(
            name='HeadlineVote',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('voter', models.EmailField(max_length=254)),
                ('timestamp', models.DateTimeField(auto_now_add=True)),
                ('headline', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='budget.Headline')),
            ],
        ),
        migrations.CreateModel(
            name='Item',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('slug', models.CharField(max_length=100, unique=True)),
                ('type', models.CharField(choices=[(b'text', b'Text'), (b'photo', b'Photo'), (b'video', b'Video'), (b'audio', b'Audio'), (b'graphic', b'Graphic'), (b'interactive', b'Interactive'), (b'other', b'Other')], default=b'text', max_length=25)),
                ('editors', django.contrib.postgres.fields.jsonb.JSONField(blank=True, null=True)),
                ('authors', django.contrib.postgres.fields.jsonb.JSONField(blank=True, null=True)),
                ('subscribers', django.contrib.postgres.fields.jsonb.JSONField(blank=True, null=True)),
                ('is_ready', models.BooleanField(default=False)),
                ('budget_line', models.TextField()),
                ('length', models.PositiveIntegerField(blank=True, help_text=b'How long is this article?', null=True, verbose_name=b'Length (in inches)')),
            ],
            options={
                'ordering': ['slug'],
            },
        ),
        migrations.CreateModel(
            name='Package',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('vertical', models.CharField(blank=True, max_length=100, null=True)),
                ('hub', models.CharField(max_length=100)),
                ('url', models.URLField(blank=True, null=True)),
                ('print_issue', models.DateField(blank=True, null=True)),
                ('print_pages', models.CharField(blank=True, max_length=50, null=True)),
                ('pub_date', models.DateTimeField()),
                ('pub_date_resolution', models.CharField(choices=[(b'm', b'Month'), (b'w', b'Week'), (b'd', b'Day'), (b't', b'Time')], default=b'd', max_length=1)),
                ('notes', models.TextField(blank=True, null=True)),
                ('created_by', models.EmailField(blank=True, max_length=254, null=True)),
                ('last_changed_by', models.EmailField(blank=True, max_length=254, null=True)),
                ('serialized_object', django.contrib.postgres.fields.jsonb.JSONField(blank=True, null=True)),
                ('headline_voting_open', models.BooleanField(default=False)),
            ],
            options={
                'ordering': ['pub_date', 'primary_content__slug'],
            },
        ),
        migrations.AddField(
            model_name='item',
            name='additional_for_package',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='additional_content', to='budget.Package'),
        ),
        migrations.AddField(
            model_name='item',
            name='primary_for_package',
            field=models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='primary_content', to='budget.Package'),
        ),
        migrations.AddField(
            model_name='headline',
            name='package',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='headlines', to='budget.Package'),
        ),
        migrations.AlterUniqueTogether(
            name='headlinevote',
            unique_together=set([('headline', 'voter')]),
        ),
    ]
