# -*- coding: utf-8 -*-
# Generated by Django 1.11.4 on 2017-10-26 07:35
from __future__ import unicode_literals

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


class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='CPFL_Settings',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=150)),
                ('documento', models.CharField(max_length=14)),
                ('imovel', models.CharField(max_length=12)),
            ],
        ),
        migrations.CreateModel(
            name='Integration',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name_id', models.CharField(max_length=30, unique=True)),
                ('name', models.CharField(max_length=50)),
            ],
        ),
        migrations.CreateModel(
            name='IntegrationSettings',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('last_sync', models.DateTimeField()),
                ('status', models.PositiveIntegerField(choices=[(0, 'Success'), (1, 'Fail'), (2, 'Partial success')])),
                ('integration', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='integrations.Integration')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
            bases=(models.Model, integrations.models.base.HasStatus),
        ),
        migrations.CreateModel(
            name='SyncHistory',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('status', models.PositiveIntegerField(choices=[(0, 'Success'), (1, 'Fail'), (2, 'Partial success')])),
                ('result', models.CharField(max_length=120)),
                ('details', models.TextField()),
                ('trigger', models.PositiveIntegerField(choices=[(0, 'Auto'), (1, 'Manual')])),
                ('settings', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='integrations.IntegrationSettings')),
            ],
            bases=(models.Model, integrations.models.base.HasStatus),
        ),
        migrations.AddField(
            model_name='cpfl_settings',
            name='settings',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='integrations.IntegrationSettings'),
        ),
        migrations.AlterUniqueTogether(
            name='integrationsettings',
            unique_together=set([('user', 'integration')]),
        ),
    ]
