# -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-01-30 01:38
from __future__ import unicode_literals

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import jsonfield.fields


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='Action',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(help_text='A brief summary of the Action.', max_length=128)),
                ('specification', jsonfield.fields.JSONField(blank=True, default={}, help_text='Data that is interpreted by the ActionType for generating call scripts, etc.')),
                ('created', models.DateTimeField(auto_now_add=True, db_index=True)),
                ('updated', models.DateTimeField(auto_now=True, db_index=True)),
                ('extra', jsonfield.fields.JSONField(blank=True, default={}, help_text='Additional information stored with this object.')),
            ],
        ),
        migrations.CreateModel(
            name='ActionType',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(help_text='The display name of the ActionType.', max_length=128)),
                ('specification', jsonfield.fields.JSONField(blank=True, default={}, help_text='Data on what this ActionType is actually about.')),
                ('created', models.DateTimeField(auto_now_add=True, db_index=True)),
                ('updated', models.DateTimeField(auto_now=True, db_index=True)),
                ('extra', jsonfield.fields.JSONField(blank=True, default={}, help_text='Additional information stored with this object.')),
                ('owner', models.ForeignKey(help_text='The User that created the ActionType.', on_delete=django.db.models.deletion.CASCADE, related_name='action_types', to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Campaign',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(help_text='The display name of the Campaign.', max_length=128)),
                ('active', models.BooleanField(default=False, help_text='Whether this campaign is currently running.')),
                ('created', models.DateTimeField(auto_now_add=True, db_index=True)),
                ('updated', models.DateTimeField(auto_now=True, db_index=True)),
                ('extra', jsonfield.fields.JSONField(blank=True, default={}, help_text='Additional information stored with this object.')),
                ('owner', models.ForeignKey(help_text='The User that owns the Campaign.', on_delete=django.db.models.deletion.CASCADE, related_name='campaigns', to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='UserAction',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('details', jsonfield.fields.JSONField(blank=True, default={}, help_text='Data that is filled in by the ActionType for generating call scripts, etc.')),
                ('state', models.CharField(blank=True, help_text='The status of the Action.', max_length=16, null=True)),
                ('created', models.DateTimeField(auto_now_add=True, db_index=True)),
                ('updated', models.DateTimeField(auto_now=True, db_index=True)),
                ('extra', jsonfield.fields.JSONField(blank=True, default={}, help_text='Additional information stored with this object.')),
                ('action', models.ForeignKey(help_text='The Action that was taken.', on_delete=django.db.models.deletion.CASCADE, related_name='useractions', to='campaigns.Action')),
                ('user', models.ForeignKey(help_text='The User that took this action.', on_delete=django.db.models.deletion.CASCADE, related_name='actions', to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.AddField(
            model_name='action',
            name='action_type',
            field=models.ForeignKey(help_text='The ActionType that specifies what sort of action this is.', on_delete=django.db.models.deletion.CASCADE, related_name='actions', to='campaigns.ActionType'),
        ),
        migrations.AddField(
            model_name='action',
            name='campaign',
            field=models.ForeignKey(help_text='The Campaign that this Action is a part of.', on_delete=django.db.models.deletion.CASCADE, related_name='actions', to='campaigns.Campaign'),
        ),
    ]
