# -*- coding: utf-8 -*-
# Generated by Django 1.10.2 on 2016-11-03 14:19
from __future__ import unicode_literals

import datetime
from django.db import migrations, models
import django.db.models.deletion
from django.utils.timezone import utc


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='advertisement',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('upload', models.FileField(upload_to='uploads/')),
                ('time_len', models.IntegerField(default=30)),
            ],
        ),
        migrations.CreateModel(
            name='devices',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('username', models.CharField(max_length=10, unique=True)),
            ],
        ),
        migrations.CreateModel(
            name='running',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('slot_no', models.IntegerField(default=0)),
                ('alloted', models.IntegerField(default=0)),
            ],
        ),
        migrations.CreateModel(
            name='running_ads',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('slot_no', models.IntegerField(default=0)),
                ('given', models.IntegerField(default=0)),
                ('ad', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='ssad15.advertisement')),
            ],
        ),
        migrations.CreateModel(
            name='running_slots',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('slot', models.IntegerField(default=1)),
                ('start_time', models.DateTimeField(default=datetime.datetime(2016, 11, 3, 14, 19, 1, 708451, tzinfo=utc), verbose_name='Starting week of the advertisement')),
            ],
        ),
        migrations.CreateModel(
            name='scheduler',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('bundles_tobegiven', models.DecimalField(decimal_places=2, default=0, max_digits=5)),
                ('is_starting', models.BooleanField(default=True)),
                ('advertisement_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='ssad15.advertisement')),
            ],
        ),
        migrations.CreateModel(
            name='slot',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('slot_no', models.IntegerField(default=0)),
                ('is_starting', models.BooleanField(default=True)),
                ('bundles_tobegiven', models.DecimalField(decimal_places=2, default=0, max_digits=5)),
                ('advertisement_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='ssad15.advertisement')),
            ],
        ),
        migrations.CreateModel(
            name='slots',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('week', models.IntegerField(default=0)),
                ('slot_no', models.IntegerField(default=0)),
                ('no_of_bundles_used', models.IntegerField(default=0)),
            ],
        ),
        migrations.CreateModel(
            name='zone',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('bottom_left_coordinate_x', models.DecimalField(decimal_places=17, default=0, max_digits=20)),
                ('bottom_left_coordinate_y', models.DecimalField(decimal_places=17, default=0, max_digits=20)),
            ],
        ),
        migrations.CreateModel(
            name='zone_info',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('week', models.IntegerField(default=0)),
                ('cost', models.IntegerField(default=-1)),
                ('no_of_bundles', models.IntegerField(default=10)),
                ('zone', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='ssad15.zone')),
            ],
        ),
        migrations.AddField(
            model_name='slots',
            name='zone',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='ssad15.zone'),
        ),
        migrations.AddField(
            model_name='slot',
            name='zone_id',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='ssad15.zone'),
        ),
        migrations.AddField(
            model_name='scheduler',
            name='slots_id',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='ssad15.slots'),
        ),
        migrations.AddField(
            model_name='running_slots',
            name='zone',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='ssad15.zone'),
        ),
        migrations.AddField(
            model_name='running_ads',
            name='zone',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='ssad15.zone'),
        ),
        migrations.AddField(
            model_name='running',
            name='zone',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='ssad15.zone'),
        ),
    ]
