# Generated by Django 2.0.2 on 2018-05-16 14:31

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Cliente',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('nome', models.CharField(max_length=64, null=True, unique=True)),
                ('descricao', models.CharField(max_length=512, null=True)),
            ],
            options={
                'db_table': 'cliente',
                'ordering': ['-id'],
            },
        ),
        migrations.CreateModel(
            name='Componente',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('nome', models.CharField(max_length=128, null=True)),
                ('tag', models.CharField(max_length=32, null=True, unique=True)),
                ('descricao', models.CharField(max_length=512, null=True)),
                ('quantidade', models.IntegerField(default=0)),
            ],
            options={
                'db_table': 'componentesEstrutura',
                'ordering': ['-id'],
            },
        ),
        migrations.CreateModel(
            name='ConfigTenda',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('tag', models.CharField(max_length=64, null=True, unique=True)),
                ('descricao', models.CharField(max_length=512, null=True)),
            ],
            options={
                'db_table': 'configTenda',
                'ordering': ['-id'],
            },
        ),
        migrations.CreateModel(
            name='FamiliaComponentes',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('nome', models.CharField(max_length=128, null=True)),
                ('tag', models.CharField(max_length=32, null=True, unique=True)),
                ('descricao', models.CharField(max_length=512, null=True)),
            ],
            options={
                'db_table': 'familiaComponente',
                'ordering': ['-id'],
            },
        ),
        migrations.CreateModel(
            name='Obras',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('date', models.DateTimeField(blank=True, default=datetime.datetime.now)),
                ('local', models.CharField(max_length=64, null=True)),
                ('cliente', models.ForeignKey(db_column='cliente_id', on_delete=django.db.models.deletion.CASCADE, to='sdp.Cliente')),
            ],
            options={
                'db_table': 'obras',
                'ordering': ['-id'],
            },
        ),
        migrations.CreateModel(
            name='TipoTenda',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('title', models.CharField(max_length=64, null=True)),
                ('description', models.CharField(max_length=512, null=True)),
            ],
            options={
                'db_table': 'tipoTenda',
                'ordering': ['-id'],
            },
        ),
        migrations.CreateModel(
            name='User',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('name', models.CharField(max_length=64, null=True)),
                ('email', models.CharField(max_length=64, null=True, unique=True)),
                ('username', models.CharField(max_length=64)),
                ('password', models.CharField(max_length=64, null=True)),
            ],
            options={
                'db_table': 'users',
                'ordering': ['-id'],
            },
        ),
        migrations.CreateModel(
            name='Viga',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('nome', models.CharField(max_length=128, null=True)),
                ('tag', models.CharField(max_length=32, null=True, unique=True)),
                ('descricao', models.CharField(max_length=512, null=True)),
                ('quantidade', models.IntegerField(default=0)),
                ('componente', models.ForeignKey(db_column='componente_id', on_delete=django.db.models.deletion.CASCADE, to='sdp.Componente')),
            ],
            options={
                'db_table': 'viga',
                'ordering': ['-id'],
            },
        ),
        migrations.CreateModel(
            name='vigaConfig',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('tipoConfig', models.ForeignKey(db_column='configTenda_id', on_delete=django.db.models.deletion.CASCADE, to='sdp.ConfigTenda')),
                ('viga', models.ForeignKey(db_column='viga_id', on_delete=django.db.models.deletion.CASCADE, to='sdp.Viga')),
            ],
            options={
                'db_table': 'vigaConfig',
                'ordering': ['-id'],
            },
        ),
        migrations.AddField(
            model_name='configtenda',
            name='tipo',
            field=models.ForeignKey(db_column='tipoTenda_id', on_delete=django.db.models.deletion.CASCADE, to='sdp.TipoTenda'),
        ),
        migrations.AddField(
            model_name='componente',
            name='familia',
            field=models.ForeignKey(db_column='familiaComponente_id', on_delete=django.db.models.deletion.CASCADE, to='sdp.FamiliaComponentes'),
        ),
    ]
