# Generated by Django 3.2.5 on 2021-08-05 13:46

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Abonne',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('password', models.CharField(max_length=128, verbose_name='password')),
                ('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')),
                ('email', models.EmailField(max_length=254, unique=True, verbose_name='email')),
                ('username', models.CharField(max_length=60, unique=True)),
                ('is_admin', models.BooleanField(default=False)),
                ('is_active', models.BooleanField(default=True)),
                ('is_staff', models.BooleanField(default=False)),
                ('is_superuser', models.BooleanField(default=False)),
                ('date_de_naissance', models.DateField()),
                ('numero_de_tel', models.IntegerField()),
                ('type', models.CharField(choices=[('Et', 'Etudiant'), ('En', 'Enseignant'), ('Admin', 'Administrateur')], default='Et', max_length=20)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Chapitre',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('titre_chapitre', models.CharField(max_length=255)),
                ('slug', models.CharField(db_index=True, max_length=255)),
            ],
        ),
        migrations.CreateModel(
            name='Niveau',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('nom_niveau', models.CharField(max_length=255)),
                ('slug', models.CharField(db_index=True, max_length=255)),
            ],
        ),
        migrations.CreateModel(
            name='Video',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('titre_video', models.CharField(max_length=255)),
                ('slug', models.CharField(db_index=True, max_length=255)),
                ('nb_like', models.IntegerField()),
                ('nb_dislike', models.IntegerField()),
                ('videofile', models.FileField(null=True, upload_to='videos/', verbose_name='')),
                ('Chapitre', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='Abonne.chapitre')),
            ],
        ),
        migrations.CreateModel(
            name='Matiere',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('Nom_matiere', models.CharField(max_length=255)),
                ('slug', models.CharField(db_index=True, max_length=255)),
                ('Niveau', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='matiers', to='Abonne.niveau')),
            ],
        ),
        migrations.CreateModel(
            name='Document',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('titre_doc', models.CharField(max_length=255)),
                ('description_doc', models.ImageField(upload_to='images/')),
                ('slug', models.CharField(db_index=True, max_length=255)),
                ('Chapitre', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='Abonne.chapitre')),
            ],
        ),
        migrations.AddField(
            model_name='chapitre',
            name='matiere',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='Abonne.matiere'),
        ),
        migrations.CreateModel(
            name='Etudiant',
            fields=[
                ('abonne_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='Abonne.abonne')),
                ('Niveau', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='Abonne.niveau')),
            ],
            options={
                'abstract': False,
            },
            bases=('Abonne.abonne',),
        ),
        migrations.CreateModel(
            name='Enseignant',
            fields=[
                ('abonne_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='Abonne.abonne')),
                ('Matiere', models.ManyToManyField(to='Abonne.Matiere')),
                ('Niveau', models.ManyToManyField(to='Abonne.Niveau')),
            ],
            options={
                'abstract': False,
            },
            bases=('Abonne.abonne',),
        ),
    ]
