# -*- coding: utf-8 -*-
# Generated by Django 1.9.12 on 2017-04-13 18:10
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):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Partner',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('uid', models.CharField(editable=False, max_length=8, unique=True)),
                ('name', models.CharField(max_length=250)),
                ('active', models.BooleanField(default=False)),
            ],
        ),
        migrations.CreateModel(
            name='Subscription',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('trigger', models.CharField(max_length=100)),
                ('callback_url', models.URLField()),
                ('partner', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='subscriptions', to='affiliations.Partner')),
            ],
        ),
        migrations.CreateModel(
            name='Visitor',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('referred_on', models.DateTimeField(auto_now_add=True)),
                ('entry_point', models.URLField()),
                ('successful_on', models.DateTimeField(null=True)),
                ('partner', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='visitors', to='affiliations.Partner')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='visitors', to=settings.AUTH_USER_MODEL)),
            ],
        ),
    ]
