# Generated by Django 3.2.6 on 2021-08-27 18:17

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='Address',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('street', models.CharField(max_length=250)),
                ('number', models.CharField(max_length=250)),
                ('city', models.CharField(max_length=250)),
                ('postal_code', models.CharField(max_length=250)),
                ('country', models.CharField(choices=[('SK', 'Slovakia'), ('CZ', 'Czechia'), ('HU', 'Hungary'), ('PL', 'Poland')], default='SK', max_length=2)),
            ],
        ),
        migrations.CreateModel(
            name='Membership',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('effective_from', models.DateField()),
                ('effective_to', models.DateField(blank=True, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='School',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=250)),
                ('description', models.TextField(blank=True, help_text='Brief description about school.', null=True)),
                ('district', models.CharField(blank=True, max_length=50, null=True)),
                ('region', models.CharField(blank=True, max_length=50, null=True)),
                ('founder', models.CharField(blank=True, max_length=50, null=True)),
                ('school_type', models.CharField(blank=True, max_length=50, null=True)),
                ('gps_x', models.CharField(blank=True, max_length=50, null=True)),
                ('gps_y', models.CharField(blank=True, max_length=50, null=True)),
                ('school_code', models.CharField(blank=True, max_length=50, null=True)),
                ('ineko_id', models.CharField(blank=True, max_length=50, null=True)),
                ('underprivileged', models.IntegerField(blank=True, null=True)),
                ('address', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='profiles.address')),
                ('members', models.ManyToManyField(through='profiles.Membership', to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Profile',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('phone_number', models.CharField(max_length=15)),
                ('gender', models.CharField(choices=[('M', 'Male'), ('F', 'Female')], max_length=1)),
                ('account_type', models.CharField(choices=[('PT', 'Primary School Teacher'), ('ST', 'Secondary School Teacher'), ('S', 'Student'), ('P', 'Parent'), ('L', 'Lecturer'), ('O', 'Other')], max_length=2)),
                ('about', models.TextField(blank=True, null=True)),
                ('country', models.CharField(choices=[('SK', 'Slovakia'), ('CZ', 'Czechia'), ('HU', 'Hungary'), ('PL', 'Poland')], default='SK', max_length=2)),
                ('address', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='profiles.address')),
                ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.AddField(
            model_name='membership',
            name='school',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='profiles.school'),
        ),
        migrations.AddField(
            model_name='membership',
            name='user',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL),
        ),
    ]
