# Generated by Django 3.0.7 on 2020-07-06 17:54

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Organizacao',
            fields=[
                ('organizacao_id', models.IntegerField(primary_key=True, serialize=False)),
                ('nome_org', models.CharField(max_length=40)),
                ('ceo', models.CharField(max_length=50)),
            ],
            options={
                'db_table': 'organizacao',
                'managed': True,
            },
        ),
        migrations.CreateModel(
            name='Usuario',
            fields=[
                ('user_id', models.IntegerField(primary_key=True, serialize=False)),
                ('tel_ddd', models.SmallIntegerField()),
                ('tel_numero', models.IntegerField()),
                ('cpf', models.CharField(max_length=11)),
                ('saldo', models.IntegerField()),
                ('senha', models.CharField(max_length=30)),
                ('email', models.CharField(max_length=60)),
                ('nome', models.CharField(max_length=80, unique=True)),
                ('sexo', models.CharField(max_length=1)),
            ],
            options={
                'db_table': 'usuario',
                'managed': True,
            },
        ),
        migrations.CreateModel(
            name='UsuarioPremium',
            fields=[
                ('premium', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, serialize=False, to='aposta.Usuario')),
                ('projeto_id', models.IntegerField(unique=True)),
            ],
            options={
                'db_table': 'usuario_premium',
                'managed': True,
            },
        ),
        migrations.CreateModel(
            name='Pertence',
            fields=[
                ('userpremium_id', models.IntegerField(primary_key=True, serialize=False)),
                ('userorg_id', models.IntegerField()),
            ],
            options={
                'db_table': 'pertence',
                'managed': True,
                'unique_together': {('userpremium_id', 'userorg_id')},
            },
        ),
        migrations.CreateModel(
            name='Aposta',
            fields=[
                ('aposta_id', models.IntegerField(primary_key=True, serialize=False)),
                ('venceu_aposta', models.BooleanField(blank=True, null=True)),
                ('valor', models.DecimalField(decimal_places=2, max_digits=10)),
                ('aposta_vencedor', models.CharField(max_length=40)),
                ('odd', models.DecimalField(decimal_places=2, max_digits=6)),
                ('data_hora', models.DateTimeField()),
                ('partida_id', models.IntegerField()),
                ('torneio_id', models.IntegerField()),
                ('aposta_finalizada', models.BooleanField(blank=True, null=True)),
                ('id_usuario_aposta', models.ForeignKey(db_column='id_usuario_aposta', on_delete=django.db.models.deletion.CASCADE, to='aposta.Usuario')),
            ],
            options={
                'db_table': 'aposta',
                'managed': True,
            },
        ),
        migrations.CreateModel(
            name='Projeto',
            fields=[
                ('projeto_user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, serialize=False, to='aposta.UsuarioPremium')),
                ('nome_projeto', models.CharField(max_length=40)),
            ],
            options={
                'db_table': 'projeto',
                'managed': True,
                'unique_together': {('projeto_user', 'nome_projeto')},
            },
        ),
    ]
