# Generated by Django 2.2.7 on 2019-11-14 16:47

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Cles',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('cles_nom', models.CharField(max_length=100)),
                ('cles_description', models.TextField()),
                ('cles_categorie', models.IntegerField(choices=[(1, 'Zoologie'), (2, 'Botanique'), (3, 'Géologie'), (4, 'Minéralogie'), (5, 'Autre')], default=1)),
                ('cles_public', models.BooleanField(default=True)),
            ],
            options={
                'verbose_name': 'Cles',
                'ordering': ['cles_nom'],
            },
        ),
        migrations.CreateModel(
            name='Question',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('question_intitule', models.CharField(max_length=1000)),
                ('question_detail', models.CharField(max_length=1000, null=True)),
                ('question_end', models.BooleanField(default=False)),
                ('question_ref_cle', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='application_cles_identification.Cles')),
            ],
            options={
                'verbose_name': 'Question',
                'ordering': ['question_intitule'],
            },
        ),
        migrations.CreateModel(
            name='Taxon',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('taxon_nom', models.CharField(max_length=100)),
                ('taxon_description', models.TextField()),
                ('taxon_nom_scientifique', models.CharField(max_length=100, null=True)),
                ('taxon_photo', models.CharField(max_length=500, null=True)),
            ],
            options={
                'verbose_name': 'Taxon',
                'ordering': ['taxon_nom'],
            },
        ),
        migrations.CreateModel(
            name='Utilisateur',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('utilisateur_nom', models.CharField(max_length=100)),
                ('utilisateur_prenom', models.CharField(max_length=100)),
                ('utilisateur_pseudonyme', models.CharField(max_length=100, unique=True)),
                ('utilisateur_email', models.EmailField(max_length=70, null=True, unique=True)),
                ('utilisateur_date_inscription', models.DateTimeField(default=datetime.datetime.now, verbose_name="Date d'inscription")),
            ],
            options={
                'verbose_name': 'Utilisateur',
                'ordering': ['utilisateur_nom'],
            },
        ),
        migrations.CreateModel(
            name='Reponse',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('reponse_intitule', models.CharField(max_length=1000)),
                ('reponse_photo', models.CharField(max_length=500, null=True)),
                ('reponse_detail', models.CharField(max_length=1000, null=True)),
                ('reponse_end', models.BooleanField(default=False)),
                ('reponse_fille', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='reponse', to='application_cles_identification.Question', unique=True)),
                ('reponse_mere', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='reponse_origine', to='application_cles_identification.Question')),
                ('reponse_taxon', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='application_cles_identification.Taxon')),
            ],
            options={
                'verbose_name': 'Reponse',
                'ordering': ['reponse_intitule'],
            },
        ),
        migrations.AddField(
            model_name='cles',
            name='cles_utilisateur',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='application_cles_identification.Utilisateur'),
        ),
    ]
