# -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2015-12-17 18:01
from __future__ import unicode_literals

from django.db import migrations, models
import django.db.models.deletion
import uuid


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='fac_ret_demand',
            fields=[
                ('did', models.AutoField(primary_key=True, serialize=False)),
                ('turn', models.IntegerField()),
                ('quantity', models.IntegerField()),
            ],
        ),
        migrations.CreateModel(
            name='fac_ret_supply',
            fields=[
                ('sid', models.AutoField(primary_key=True, serialize=False)),
                ('turn', models.IntegerField()),
                ('quantity', models.IntegerField()),
            ],
        ),
        migrations.CreateModel(
            name='factories',
            fields=[
                ('fid', models.AutoField(primary_key=True, serialize=False)),
                ('fcode', models.CharField(blank=True, default=uuid.uuid4, max_length=100, unique=True)),
                ('money', models.IntegerField()),
            ],
        ),
        migrations.CreateModel(
            name='factory_factory',
            fields=[
                ('mid', models.AutoField(primary_key=True, serialize=False)),
                ('fac1', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='his_factory', to='beerf_15.factories')),
                ('fac2', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='opponent', to='beerf_15.factories')),
            ],
        ),
        migrations.CreateModel(
            name='factory_order',
            fields=[
                ('ord_id', models.AutoField(primary_key=True, serialize=False)),
                ('turn', models.IntegerField()),
                ('quantity', models.IntegerField()),
                ('fid', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='beerf_15.factories')),
            ],
        ),
        migrations.CreateModel(
            name='factory_retailer',
            fields=[
                ('frid', models.AutoField(primary_key=True, serialize=False)),
                ('fid', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='beerf_15.factories')),
            ],
        ),
        migrations.CreateModel(
            name='retailers',
            fields=[
                ('rid', models.AutoField(primary_key=True, serialize=False)),
                ('rcode', models.CharField(blank=True, default=uuid.uuid4, max_length=100, unique=True)),
            ],
        ),
        migrations.CreateModel(
            name='users',
            fields=[
                ('pid', models.AutoField(primary_key=True, serialize=False)),
                ('name', models.CharField(max_length=150)),
                ('email', models.EmailField(max_length=254)),
                ('factory', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='beerf_15.factories')),
            ],
        ),
        migrations.AddField(
            model_name='factory_retailer',
            name='rid',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='beerf_15.retailers'),
        ),
        migrations.AddField(
            model_name='fac_ret_supply',
            name='frid',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='beerf_15.factory_retailer'),
        ),
        migrations.AddField(
            model_name='fac_ret_demand',
            name='frid',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='beerf_15.factory_retailer'),
        ),
    ]
