# -*- coding: utf-8 -*-
# Generated by Django 1.11.7 on 2017-12-20 12:51
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='Channel',
            fields=[
                ('channel_id', models.AutoField(primary_key=True, serialize=False)),
                ('channel_name', models.CharField(max_length=100, unique=True)),
            ],
            options={
                'db_table': 'Channel',
            },
        ),
        migrations.CreateModel(
            name='ChannelGroup',
            fields=[
                ('channelgroup_id', models.AutoField(primary_key=True, serialize=False)),
                ('channelgroup_name', models.CharField(max_length=150)),
                ('channelgroup_budget', models.FloatField(blank=True, null=True)),
                ('channelgroup_R_fixed', models.FloatField(blank=True, null=True)),
            ],
            options={
                'db_table': 'ChannelGroups',
            },
        ),
        migrations.CreateModel(
            name='Channels_in_group',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('user_CPM', models.FloatField(blank=True, null=True)),
                ('channel_budget_limit_min', models.FloatField(blank=True, null=True)),
                ('channel_budget_limit_max', models.FloatField(blank=True, null=True)),
                ('channel_show_limit_min', models.IntegerField(blank=True, null=True)),
                ('channel_show_limit_max', models.IntegerField(blank=True, null=True)),
                ('channel_fixed_budget', models.FloatField(blank=True, null=True)),
                ('channel_fixed_show', models.IntegerField(blank=True, null=True)),
                ('channel', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='channels.Channel')),
                ('group', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='channels.ChannelGroup')),
            ],
            options={
                'db_table': 'Channels_in_groups',
            },
        ),
        migrations.CreateModel(
            name='TA',
            fields=[
                ('TA_id', models.AutoField(primary_key=True, serialize=False)),
                ('TA_name', models.CharField(max_length=100, unique=True)),
                ('TA_Size', models.IntegerField()),
            ],
            options={
                'db_table': 'TA',
            },
        ),
        migrations.CreateModel(
            name='TA_in_channel',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('default_CPM', models.FloatField()),
                ('TA_CBU_Z', models.FloatField()),
                ('TA_CBU_P', models.FloatField()),
                ('TA_CBU_L', models.FloatField()),
                ('Channel_TA_R', models.FloatField()),
                ('TA', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='channels.TA')),
                ('channel', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='channels.Channel')),
            ],
            options={
                'db_table': 'TA_in_channels',
            },
        ),
        migrations.AddField(
            model_name='channelgroup',
            name='channelgroup_TA',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='channels.TA'),
        ),
        migrations.AddField(
            model_name='channelgroup',
            name='channelgroup_Userowner',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL),
        ),
    ]
