# -*- coding: utf-8 -*-
# Generated by Django 1.9.4 on 2016-03-24 08:29
from __future__ import unicode_literals

import django.core.validators
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('crafting', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Kingdom',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('modified', models.DateTimeField(auto_now=True)),
                ('name', models.CharField(max_length=100)),
            ],
        ),
        migrations.CreateModel(
            name='Node',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('modified', models.DateTimeField(auto_now=True)),
                ('name', models.CharField(max_length=100)),
                ('is_hub', models.BooleanField(default=False)),
                ('contribution_cost', models.IntegerField(blank=True, null=True, validators=[django.core.validators.MinValueValidator(0)])),
                ('node_manager', models.CharField(blank=True, max_length=100, null=True)),
                ('connected_nodes', models.ManyToManyField(blank=True, related_name='_node_connected_nodes_+', to='nodes.Node')),
            ],
        ),
        migrations.CreateModel(
            name='Property',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('modified', models.DateTimeField(auto_now=True)),
                ('name', models.CharField(max_length=100)),
                ('node', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='properties', to='nodes.Node')),
                ('parent_property', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='child_properties', to='nodes.Property')),
            ],
            options={
                'verbose_name_plural': 'properties',
            },
        ),
        migrations.CreateModel(
            name='PropertyStation',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('modified', models.DateTimeField(auto_now=True)),
                ('max_level', models.IntegerField()),
                ('property', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='nodes.Property')),
                ('station', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='crafting.Station')),
            ],
            options={
                'verbose_name_plural': 'property stations',
            },
        ),
        migrations.CreateModel(
            name='Resource',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('modified', models.DateTimeField(auto_now=True)),
                ('contribution_cost', models.IntegerField(validators=[django.core.validators.MinValueValidator(0)])),
                ('material', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='resources', to='crafting.Material')),
                ('node', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='resources', to='nodes.Node')),
            ],
        ),
        migrations.CreateModel(
            name='Territory',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('modified', models.DateTimeField(auto_now=True)),
                ('name', models.CharField(max_length=100)),
                ('kingdom', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='territories', to='nodes.Kingdom')),
            ],
            options={
                'verbose_name_plural': 'territories',
            },
        ),
        migrations.AddField(
            model_name='property',
            name='stations',
            field=models.ManyToManyField(related_name='properties', through='nodes.PropertyStation', to='crafting.Station'),
        ),
        migrations.AddField(
            model_name='node',
            name='territory',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='nodes', to='nodes.Territory'),
        ),
    ]
