# -*- coding: utf-8 -*-
# Generated by Django 1.9.5 on 2016-05-27 08:44
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):

    dependencies = [
        ('auth', '0007_alter_validators_add_error_messages'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('web', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Charts',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('table_name', models.CharField(max_length=100)),
                ('columns_name', models.CharField(max_length=512)),
                ('chart_type', models.CharField(max_length=50)),
                ('y_name', models.CharField(max_length=50)),
            ],
            options={
                'db_table': 'charts',
            },
        ),
        migrations.CreateModel(
            name='Client',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('company_name', models.CharField(max_length=130)),
                ('address', models.CharField(blank=True, max_length=256)),
                ('postal_code', models.CharField(blank=True, max_length=30)),
                ('phone', models.CharField(blank=True, max_length=20)),
                ('website', models.CharField(blank=True, max_length=520)),
                ('company_logo', models.ImageField(blank=True, upload_to='/static/images/')),
                ('contact_name', models.CharField(blank=True, max_length=50)),
                ('email', models.EmailField(blank=True, max_length=128)),
            ],
            options={
                'db_table': 'client',
            },
        ),
        migrations.CreateModel(
            name='Company',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('title', models.CharField(max_length=128)),
            ],
            options={
                'permissions': (('admin', 'Administrator'), ('user_short', 'User Short'), ('user_admin', 'User Administrator')),
                'db_table': 'company',
            },
        ),
        migrations.CreateModel(
            name='CustomUser',
            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)),
                ('company_type', models.IntegerField(choices=[(1, 'L_Package'), (2, 'XL_Package')], default=1)),
                ('company', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='web.Client')),
            ],
            options={
                'verbose_name_plural': 'users',
                'abstract': False,
                'verbose_name': 'user',
            },
            bases=('auth.user',),
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='UserBD',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('username', models.CharField(max_length=40)),
                ('title', models.CharField(max_length=40)),
                ('password', models.CharField(max_length=520)),
            ],
            options={
                'db_table': 'user_db',
            },
        ),
        migrations.AddField(
            model_name='customuser',
            name='user',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='web.UserBD'),
        ),
        migrations.AddField(
            model_name='client',
            name='user',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='charts',
            name='company',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='web.Client'),
        ),
    ]
