# Generated by Django 3.0.5 on 2020-04-22 12:07

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='Group',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50)),
                ('description', models.TextField(blank=True, null=True)),
                ('image', models.ImageField(blank=True, null=True, upload_to='Group/')),
                ('join_link', models.TextField(blank=True, null=True)),
                ('date_updated', models.DateTimeField(blank=True, default=datetime.datetime(2020, 4, 22, 17, 37, 5, 166879))),
                ('createdBy', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL)),
                ('students', models.ManyToManyField(related_name='GroupStudents', to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Plan',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('price', models.DecimalField(decimal_places=2, default=0, max_digits=6)),
                ('name', models.CharField(blank=True, max_length=20, null=True)),
                ('max_group', models.IntegerField(default=0)),
                ('max_group_member', models.IntegerField(default=0)),
                ('date_created', models.DateTimeField(blank=True, default=datetime.datetime(2020, 4, 22, 17, 37, 5, 157903))),
            ],
        ),
        migrations.CreateModel(
            name='Profile',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('phone', models.CharField(default='', max_length=20, null=True)),
                ('image', models.ImageField(blank=True, null=True, upload_to='User/')),
                ('date_renwed', models.DateTimeField(blank=True)),
                ('date_expiry', models.DateTimeField(blank=True)),
                ('plan', models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='users.Plan')),
                ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Invoice',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('payment_id', models.CharField(default='None', max_length=100, null=True)),
                ('price', models.DecimalField(decimal_places=2, max_digits=8)),
                ('status', models.CharField(default='Unpaid', max_length=20, null=True)),
                ('date_created', models.DateTimeField(blank=True, default=datetime.datetime(2020, 4, 22, 17, 37, 5, 161891))),
                ('date_updated', models.DateTimeField(blank=True, default=datetime.datetime(2020, 4, 22, 17, 37, 5, 161891))),
                ('plan', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='users.Plan')),
                ('profile', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='users.Profile')),
            ],
        ),
        migrations.CreateModel(
            name='GroupRole',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('role', models.TextField(default='student')),
                ('date_updated', models.DateTimeField(blank=True, default=datetime.datetime(2020, 4, 22, 17, 37, 5, 171865))),
                ('group', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='users.Group')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='GroupInvitation',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('role', models.TextField(default='student')),
                ('joined', models.TextField(default='false')),
                ('date_updated', models.DateTimeField(blank=True, default=datetime.datetime(2020, 4, 22, 17, 37, 5, 173860))),
                ('group', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='users.Group')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
    ]
