# -*- coding: utf-8 -*-
# Generated by Django 1.11.6 on 2017-10-08 04:07
from __future__ import unicode_literals

from django.conf import settings
import django.contrib.auth.models
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('auth', '0008_alter_user_username_max_length'),
    ]

    operations = [
        migrations.CreateModel(
            name='AllocatedQuantity',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
            ],
        ),
        migrations.CreateModel(
            name='Category',
            fields=[
                ('pid', models.IntegerField(primary_key=True, serialize=False)),
                ('hash_pid', models.CharField(default='0', max_length=255)),
                ('name', models.CharField(max_length=30)),
                ('level', models.IntegerField()),
                ('related_category', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='horizon.Category')),
            ],
        ),
        migrations.CreateModel(
            name='Company',
            fields=[
                ('pid', models.IntegerField(primary_key=True, serialize=False)),
                ('hash_pid', models.CharField(default='0', max_length=255)),
                ('name', models.CharField(max_length=255)),
                ('register_number', models.CharField(default='0', max_length=30)),
                ('note', models.TextField(blank=True, null=True)),
                ('categories', models.ManyToManyField(to='horizon.Category')),
            ],
        ),
        migrations.CreateModel(
            name='Cost',
            fields=[
                ('pid', models.IntegerField(primary_key=True, serialize=False)),
                ('hash_pid', models.CharField(default='0', max_length=255)),
                ('value', models.FloatField()),
                ('total', models.BooleanField()),
            ],
        ),
        migrations.CreateModel(
            name='Currency',
            fields=[
                ('pid', models.IntegerField(primary_key=True, serialize=False)),
                ('hash_pid', models.CharField(default='0', max_length=255)),
                ('name', models.CharField(max_length=3)),
                ('long_name', models.CharField(max_length=20)),
            ],
        ),
        migrations.CreateModel(
            name='DataDate',
            fields=[
                ('pid', models.IntegerField(primary_key=True, serialize=False)),
                ('hash_pid', models.CharField(default='0', max_length=255)),
                ('date', models.DateField(auto_now_add=True)),
                ('sequence', models.IntegerField()),
            ],
        ),
        migrations.CreateModel(
            name='DataSheet',
            fields=[
                ('pid', models.IntegerField(primary_key=True, serialize=False)),
                ('name', models.CharField(max_length=255)),
                ('hash_pid', models.CharField(default='0', max_length=255)),
                ('number_of_price_fields', models.IntegerField(blank=True, default=0, null=True)),
                ('setting_locked', models.BooleanField(default=False)),
                ('data_locked', models.BooleanField(default=False)),
                ('xltemplate_file_name', models.CharField(blank=True, max_length=255, null=True)),
                ('xltemplate_file_fullname', models.CharField(blank=True, max_length=255, null=True)),
                ('xltemplate_file_fullpath', models.CharField(blank=True, max_length=255, null=True)),
                ('xldatasheet_file_name', models.CharField(blank=True, max_length=255, null=True)),
                ('category', models.ForeignKey(default=67004, on_delete=django.db.models.deletion.CASCADE, to='horizon.Category')),
            ],
            options={
                'ordering': ['pid'],
            },
        ),
        migrations.CreateModel(
            name='DataSheetElement',
            fields=[
                ('pid', models.IntegerField(primary_key=True, serialize=False)),
                ('hash_pid', models.CharField(default='0', max_length=255)),
            ],
            options={
                'ordering': ['pid'],
            },
        ),
        migrations.CreateModel(
            name='DataSheetField',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('display_name', models.CharField(max_length=255)),
                ('field_type', models.CharField(blank=True, max_length=30, null=True)),
                ('sequence', models.IntegerField(blank=True, null=True)),
                ('quantity_role', models.CharField(blank=True, max_length=4, null=True)),
                ('datasheet', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='horizon.DataSheet')),
            ],
            options={
                'ordering': ['sequence'],
            },
        ),
        migrations.CreateModel(
            name='DataSheetSetting',
            fields=[
                ('pid', models.IntegerField(primary_key=True, serialize=False)),
                ('hash_pid', models.CharField(default='0', max_length=255)),
                ('value', models.CharField(max_length=255)),
                ('datasheet', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='horizon.DataSheet')),
            ],
            options={
                'ordering': ['pid'],
            },
        ),
        migrations.CreateModel(
            name='Element',
            fields=[
                ('pid', models.IntegerField(primary_key=True, serialize=False)),
                ('hash_pid', models.CharField(default='0', max_length=255)),
                ('name', models.CharField(max_length=255)),
                ('category', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='horizon.Category')),
            ],
        ),
        migrations.CreateModel(
            name='Geo',
            fields=[
                ('pid', models.IntegerField(primary_key=True, serialize=False)),
                ('hash_pid', models.CharField(default='0', max_length=255)),
                ('name', models.CharField(max_length=200)),
                ('level', models.IntegerField(blank=True, null=True)),
                ('related_geo', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='horizon.Geo')),
            ],
            options={
                'verbose_name': 'Geography',
            },
        ),
        migrations.CreateModel(
            name='HorizonSetting',
            fields=[
                ('pid', models.IntegerField(primary_key=True, serialize=False)),
                ('hash_pid', models.CharField(default='0', max_length=255)),
                ('name', models.CharField(max_length=50)),
                ('value', models.CharField(blank=True, max_length=50, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='HorizonUser',
            fields=[
                ('user_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to=settings.AUTH_USER_MODEL)),
                ('pid', models.IntegerField(blank=True, null=True)),
                ('hash_pid', models.CharField(default='0', max_length=255)),
                ('default_language', models.CharField(blank=True, max_length=4, null=True)),
                ('permissions', models.CharField(blank=True, max_length=100, null=True)),
                ('company', models.ForeignKey(default=6707, on_delete=django.db.models.deletion.CASCADE, to='horizon.Company')),
            ],
            options={
                'ordering': ['pid'],
            },
            bases=('auth.user',),
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='Location',
            fields=[
                ('pid', models.IntegerField(primary_key=True, serialize=False)),
                ('hash_pid', models.CharField(default='0', max_length=255)),
                ('name', models.CharField(default='', max_length=255)),
                ('sequence', models.IntegerField()),
                ('datasheet_element', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='horizon.DataSheetElement')),
                ('geo', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='horizon.Geo')),
            ],
            options={
                'ordering': ['pid'],
            },
        ),
        migrations.CreateModel(
            name='Price',
            fields=[
                ('pid', models.IntegerField(primary_key=True, serialize=False)),
                ('hash_pid', models.CharField(default='0', max_length=255)),
                ('value', models.FloatField(blank=True, null=True)),
                ('category', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='horizon.Category')),
                ('currency', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='horizon.Currency')),
            ],
            options={
                'ordering': ['pid'],
            },
        ),
        migrations.CreateModel(
            name='PriceCondition',
            fields=[
                ('pid', models.IntegerField(primary_key=True, serialize=False)),
                ('hash_pid', models.CharField(default='0', max_length=255)),
                ('name', models.CharField(max_length=255)),
                ('display_name', models.CharField(blank=True, max_length=255, null=True)),
                ('group', models.IntegerField(blank=True, null=True)),
                ('low', models.FloatField(blank=True, null=True)),
                ('high', models.FloatField(blank=True, null=True)),
            ],
            options={
                'ordering': ['pid'],
            },
        ),
        migrations.CreateModel(
            name='PriceSheet',
            fields=[
                ('pid', models.IntegerField(primary_key=True, serialize=False)),
                ('hash_pid', models.CharField(default='0', max_length=255)),
                ('name', models.CharField(max_length=255)),
            ],
        ),
        migrations.CreateModel(
            name='PriceSheetElement',
            fields=[
                ('pid', models.IntegerField(primary_key=True, serialize=False)),
                ('hash_pid', models.CharField(default='0', max_length=255)),
                ('element', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='horizon.Element')),
                ('vendor', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='horizon.Company')),
            ],
        ),
        migrations.CreateModel(
            name='PriceSheetField',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('display_name', models.CharField(max_length=255)),
                ('field_type', models.CharField(blank=True, max_length=30, null=True)),
                ('sequence', models.IntegerField()),
                ('price_conditions', models.ManyToManyField(to='horizon.PriceCondition')),
                ('price_sheet', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='horizon.PriceSheet')),
            ],
            options={
                'ordering': ['sequence'],
            },
        ),
        migrations.CreateModel(
            name='Quantity',
            fields=[
                ('pid', models.IntegerField(primary_key=True, serialize=False)),
                ('hash_pid', models.CharField(default='0', max_length=255)),
                ('value', models.FloatField(blank=True, null=True)),
                ('role', models.CharField(blank=True, max_length=10, null=True)),
                ('converting_factor', models.FloatField(blank=True, null=True)),
                ('comparison', models.CharField(blank=True, choices=[('min', 'Minimum'), ('max', 'Maximum')], max_length=3, null=True)),
                ('sequence', models.IntegerField(blank=True, null=True)),
                ('datasheet_element', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='horizon.DataSheetElement')),
            ],
        ),
        migrations.CreateModel(
            name='Scheme',
            fields=[
                ('pid', models.IntegerField(primary_key=True, serialize=False)),
                ('hash_pid', models.CharField(default='0', max_length=255)),
                ('name', models.CharField(max_length=255)),
                ('setting_locked', models.BooleanField()),
                ('owners', models.ManyToManyField(to='horizon.HorizonUser')),
            ],
            options={
                'ordering': ['pid'],
            },
        ),
        migrations.CreateModel(
            name='SchemeSetting',
            fields=[
                ('pid', models.IntegerField(primary_key=True, serialize=False)),
                ('hash_pid', models.CharField(default='0', max_length=255)),
                ('value', models.CharField(max_length=255)),
                ('scheme', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='horizon.Scheme')),
            ],
            options={
                'ordering': ['pid'],
            },
        ),
        migrations.CreateModel(
            name='Service',
            fields=[
                ('pid', models.IntegerField(primary_key=True, serialize=False)),
                ('hash_pid', models.CharField(default='0', max_length=255)),
                ('name', models.CharField(max_length=50)),
                ('code_name', models.CharField(max_length=50)),
                ('note', models.CharField(blank=True, max_length=255, null=True)),
                ('owners', models.ManyToManyField(to='horizon.HorizonUser')),
            ],
        ),
        migrations.CreateModel(
            name='Setting',
            fields=[
                ('pid', models.IntegerField(primary_key=True, serialize=False)),
                ('hash_pid', models.CharField(default='0', max_length=255)),
                ('name', models.CharField(max_length=50)),
                ('type', models.CharField(max_length=20, null=True)),
                ('list', models.CharField(blank=True, max_length=50, null=True)),
                ('note', models.CharField(blank=True, max_length=255, null=True)),
                ('level', models.IntegerField()),
            ],
            options={
                'ordering': ['pid'],
            },
        ),
        migrations.CreateModel(
            name='UoM',
            fields=[
                ('pid', models.IntegerField(primary_key=True, serialize=False)),
                ('hash_pid', models.CharField(default='0', max_length=255)),
                ('name', models.CharField(max_length=10)),
                ('long_name', models.CharField(blank=True, max_length=30, null=True)),
            ],
            options={
                'ordering': ['pid'],
            },
        ),
        migrations.AddField(
            model_name='schemesetting',
            name='setting',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='horizon.Setting'),
        ),
        migrations.AddField(
            model_name='quantity',
            name='uom',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='horizon.UoM'),
        ),
        migrations.AddField(
            model_name='pricesheet',
            name='price_sheet_elements',
            field=models.ManyToManyField(to='horizon.PriceSheetElement'),
        ),
        migrations.AddField(
            model_name='pricesheet',
            name='vendor',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='horizon.Company'),
        ),
        migrations.AddField(
            model_name='pricecondition',
            name='uom',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='horizon.UoM'),
        ),
        migrations.AddField(
            model_name='price',
            name='price_conditions',
            field=models.ManyToManyField(to='horizon.PriceCondition'),
        ),
        migrations.AddField(
            model_name='price',
            name='price_sheet_element',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='horizon.PriceSheetElement'),
        ),
        migrations.AddField(
            model_name='price',
            name='uom',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='horizon.UoM'),
        ),
        migrations.AddField(
            model_name='datasheetsetting',
            name='setting',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='horizon.Setting'),
        ),
        migrations.AddField(
            model_name='datasheetfield',
            name='quantity_uom',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='horizon.UoM'),
        ),
        migrations.AddField(
            model_name='datasheetelement',
            name='element',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='horizon.Element'),
        ),
        migrations.AddField(
            model_name='datasheetelement',
            name='vendor',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='horizon.Company'),
        ),
        migrations.AddField(
            model_name='datasheet',
            name='datasheet_elements',
            field=models.ManyToManyField(to='horizon.DataSheetElement'),
        ),
        migrations.AddField(
            model_name='datasheet',
            name='scheme',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='horizon.Scheme'),
        ),
        migrations.AddField(
            model_name='datadate',
            name='datasheet_element',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='horizon.DataSheetElement'),
        ),
        migrations.AddField(
            model_name='cost',
            name='datasheet_element',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='horizon.DataSheetElement'),
        ),
    ]
