# Generated by Django 3.0.6 on 2020-07-08 20:49

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('user', '0001_initial'),
        ('transfos', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Classes',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('designation', models.IntegerField(choices=[(0, 'CLASSE 1'), (1, 'CLASSE 2'), (3, 'CLASSE 3')])),
                ('p_max', models.FloatField()),
                ('q_max', models.FloatField()),
            ],
        ),
        migrations.CreateModel(
            name='Compteur',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('modele', models.IntegerField(choices=[(0, 'Monophasé'), (1, 'Biphasé'), (2, 'Triphasé')])),
                ('credit', models.FloatField(default=0)),
                ('active_class', models.IntegerField(choices=[(0, 'Domestique'), (1, 'Semi-industriel'), (2, 'Industriel')], default=0)),
                ('p_total', models.FloatField(default=0)),
                ('q_total', models.FloatField(default=0)),
                ('i_phase1', models.FloatField(default=0)),
                ('i_phase2', models.FloatField(default=0)),
                ('i_phase3', models.FloatField(default=0)),
                ('u_phase1', models.FloatField(default=0)),
                ('u_phase2', models.FloatField(default=0)),
                ('u_phase3', models.FloatField(default=0)),
                ('p_phase1', models.FloatField(default=0)),
                ('p_phase2', models.FloatField(default=0)),
                ('p_phase3', models.FloatField(default=0)),
                ('q_phase1', models.FloatField(default=0)),
                ('q_phase2', models.FloatField(default=0)),
                ('q_phase3', models.FloatField(default=0)),
                ('global_state', models.CharField(choices=[('OFF', 'Eteint'), ('ON', 'Allumé')], default='OFF', max_length=10)),
                ('appartement', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='user.Appartement')),
                ('transformateur', models.ForeignKey(default=None, null=True, on_delete=django.db.models.deletion.DO_NOTHING, to='transfos.Transformateur')),
            ],
        ),
        migrations.CreateModel(
            name='TransfertCredit',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('date_heure', models.DateTimeField(auto_now=True, verbose_name='Date et heure du transfert')),
                ('qteTransfert', models.FloatField()),
                ('destinataire', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, related_name='destinataire', to='compteur.Compteur')),
                ('expeditaire', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, related_name='expediteur', to='compteur.Compteur')),
            ],
        ),
        migrations.CreateModel(
            name='DetailsCompteur',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('instant', models.DateTimeField(auto_now=True)),
                ('i_phase1', models.FloatField(default=0)),
                ('i_phase2', models.FloatField(default=0)),
                ('i_phase3', models.FloatField(default=0)),
                ('u_phase1', models.FloatField(default=0)),
                ('u_phase2', models.FloatField(default=0)),
                ('u_phase3', models.FloatField(default=0)),
                ('p_phase1', models.FloatField(default=0)),
                ('p_phase2', models.FloatField(default=0)),
                ('p_phase3', models.FloatField(default=0)),
                ('q_phase1', models.FloatField(default=0)),
                ('q_phase2', models.FloatField(default=0)),
                ('q_phase3', models.FloatField(default=0)),
                ('p_total', models.FloatField(default=0)),
                ('q_total', models.FloatField(default=0)),
                ('etat', models.CharField(max_length=45)),
                ('compteur', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='compteur.Compteur')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Balance',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('balance1', models.FloatField()),
                ('balance2', models.FloatField()),
                ('balance3', models.FloatField()),
                ('compteur', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='compteur.Compteur')),
            ],
        ),
        migrations.CreateModel(
            name='Abonnement',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('date_heure', models.DateTimeField(auto_now=True, verbose_name="Date et heure de l'Abonnement")),
                ('montant', models.FloatField()),
                ('qte_energie', models.FloatField()),
                ('etat', models.IntegerField(choices=[(0, 'En cours'), (1, 'Terminé')])),
                ('classe', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='compteur.Classes')),
                ('compteur', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='compteur.Compteur')),
            ],
        ),
    ]
