# Generated by Django 3.1.1 on 2020-11-17 01:38

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='ActividadEconomica',
            fields=[
                ('codActividadEconomica', models.CharField(max_length=15, primary_key=True, serialize=False)),
                ('nombreActividadEconomica', models.CharField(max_length=100)),
                ('descripcionActividadEconomica', models.CharField(blank=True, max_length=100, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='Empresa',
            fields=[
                ('codEmpresa', models.CharField(max_length=15, primary_key=True, serialize=False)),
                ('nombreEmpresa', models.CharField(max_length=100)),
                ('descripcionEmpresa', models.CharField(blank=True, max_length=250, null=True)),
                ('codActividadEconomica', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='proyecto.actividadeconomica')),
            ],
        ),
        migrations.CreateModel(
            name='RazonesFinanciera',
            fields=[
                ('codRazon', models.CharField(max_length=10, primary_key=True, serialize=False)),
                ('nombreRazon', models.CharField(max_length=100)),
            ],
        ),
        migrations.CreateModel(
            name='Rubro',
            fields=[
                ('codRubro', models.CharField(max_length=50, primary_key=True, serialize=False)),
                ('nombreRubro', models.CharField(max_length=100)),
            ],
        ),
        migrations.CreateModel(
            name='Sector',
            fields=[
                ('codSector', models.CharField(max_length=15, primary_key=True, serialize=False)),
                ('nombreSector', models.CharField(max_length=100)),
                ('descripcionSector', models.CharField(blank=True, max_length=250, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='TipoCuenta',
            fields=[
                ('codTipoCuenta', models.CharField(max_length=15, primary_key=True, serialize=False)),
                ('nombreTipoCuenta', models.CharField(max_length=100)),
            ],
        ),
        migrations.CreateModel(
            name='Ratio',
            fields=[
                ('codRatio', models.CharField(max_length=10, primary_key=True, serialize=False)),
                ('nombreRatio', models.CharField(max_length=100)),
                ('codRazon', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='proyecto.razonesfinanciera')),
            ],
        ),
        migrations.CreateModel(
            name='CatalogoCuenta',
            fields=[
                ('codCuenta', models.CharField(max_length=50, primary_key=True, serialize=False)),
                ('nombreCuenta', models.CharField(max_length=100)),
                ('codEmpresa', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='proyecto.empresa')),
                ('codRubro', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='proyecto.rubro')),
                ('codTipoCuenta', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='proyecto.tipocuenta')),
            ],
            options={
                'unique_together': {('codEmpresa', 'codCuenta')},
            },
        ),
        migrations.AddField(
            model_name='actividadeconomica',
            name='codSector',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='proyecto.sector'),
        ),
        migrations.CreateModel(
            name='RatiosSector',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('parametroComparacion', models.DecimalField(decimal_places=3, max_digits=18)),
                ('codActividadEconomica', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='proyecto.actividadeconomica')),
                ('codRatio', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='proyecto.ratio')),
            ],
            options={
                'unique_together': {('codActividadEconomica', 'codRatio')},
            },
        ),
        migrations.CreateModel(
            name='RatiosEmpresaSector',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('año', models.IntegerField()),
                ('valorSector', models.DecimalField(decimal_places=3, max_digits=18)),
                ('promEmpresas', models.DecimalField(decimal_places=3, max_digits=18)),
                ('empresasCumplenSector', models.CharField(max_length=300)),
                ('empresasCumplenEmpresa', models.CharField(max_length=300)),
                ('codActividadEconomica', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='proyecto.actividadeconomica')),
                ('codRatio', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='proyecto.ratio')),
            ],
            options={
                'unique_together': {('codActividadEconomica', 'año', 'codRatio')},
            },
        ),
        migrations.CreateModel(
            name='RatiosEmpresa',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('valorRatioEmpresa', models.DecimalField(decimal_places=3, max_digits=18)),
                ('año', models.IntegerField()),
                ('codEmpresa', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='proyecto.empresa')),
                ('codRatio', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='proyecto.ratio')),
            ],
            options={
                'unique_together': {('codEmpresa', 'codRatio', 'año')},
            },
        ),
        migrations.CreateModel(
            name='CuentaBalance',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('año', models.IntegerField()),
                ('valor', models.DecimalField(decimal_places=2, max_digits=18)),
                ('codCuenta', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='proyecto.catalogocuenta')),
                ('codEmpresa', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='proyecto.empresa')),
            ],
            options={
                'unique_together': {('codEmpresa', 'codCuenta', 'año')},
            },
        ),
        migrations.CreateModel(
            name='AnalisisVertical',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('año', models.IntegerField()),
                ('valor', models.DecimalField(decimal_places=3, max_digits=18)),
                ('codCuenta', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='proyecto.catalogocuenta')),
                ('codEmpresa', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='proyecto.empresa')),
                ('codRubro', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='proyecto.rubro')),
            ],
            options={
                'unique_together': {('codEmpresa', 'codCuenta', 'año')},
            },
        ),
        migrations.CreateModel(
            name='AnalisisHorizontal',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('añoActual', models.IntegerField()),
                ('valorActual', models.DecimalField(decimal_places=2, max_digits=18)),
                ('añoAnterior', models.IntegerField()),
                ('valorAnterior', models.DecimalField(decimal_places=2, max_digits=18)),
                ('valorAbsoluto', models.DecimalField(decimal_places=3, max_digits=18)),
                ('valorRelativo', models.DecimalField(decimal_places=3, max_digits=18)),
                ('codCuenta', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='proyecto.catalogocuenta')),
                ('codEmpresa', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='proyecto.empresa')),
            ],
            options={
                'unique_together': {('codEmpresa', 'codCuenta', 'añoActual')},
            },
        ),
    ]
