# -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-05-24 20:05
from __future__ import unicode_literals

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

class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('users', '0012_auto_20170513_0710'),
        ('data', '0019_data_auto_20170523_2012'),
    ]

    operations = [
        migrations.CreateModel(
            name='APIIntegration',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('source', models.TextField(unique=True)),
                ('source_display', models.TextField(blank=True, null=True)),
                ('source_icon', models.TextField(blank=True, null=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
            ],
        ),
        migrations.CreateModel(
            name='APIIntegrationSource',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('model', models.TextField()),
                ('model_display', models.TextField(blank=True, null=True)),
                ('model_icon', models.TextField(blank=True, null=True)),
                ('field', models.TextField()),
                ('field_display', models.TextField(blank=True, null=True)),
                ('field_icon', models.TextField(blank=True, null=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('integration', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='api_integration_sources', to='data.APIIntegration')),
            ],
        ),
        migrations.CreateModel(
            name='CustomFieldIntegration',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('account', models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, related_name='custom_field_integrations', to='users.Account')),
            ],
        ),
        migrations.AddField(
            model_name='customfieldintegration',
            name='field',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='custom_field_integrations', to='data.CustomField'),
        ),
        migrations.AddField(
            model_name='customfieldintegration',
            name='integration',
            field=models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, related_name='custom_field_integrations', to='data.APIIntegration'),
        ),
        migrations.AddField(
            model_name='customfieldintegration',
            name='owner',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='custom_field_integrations', to=settings.AUTH_USER_MODEL),
        ),
    ]
