# Generated by Django 3.0.5 on 2020-04-21 09:39

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('auth', '0011_update_proxy_permissions'),
    ]

    operations = [
        migrations.CreateModel(
            name='Editor',
            fields=[
                ('password', models.CharField(max_length=128, verbose_name='password')),
                ('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')),
                ('is_superuser', models.BooleanField(default=False, help_text='Designates that this user has all permissions without explicitly assigning them.', verbose_name='superuser status')),
                ('editor_id', models.AutoField(primary_key=True, serialize=False)),
                ('name', models.CharField(max_length=255)),
                ('email', models.EmailField(max_length=255, unique=True)),
                ('is_admin', models.BooleanField(default=False)),
                ('groups', models.ManyToManyField(blank=True, help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.', related_name='user_set', related_query_name='user', to='auth.Group', verbose_name='groups')),
                ('user_permissions', models.ManyToManyField(blank=True, help_text='Specific permissions for this user.', related_name='user_set', related_query_name='user', to='auth.Permission', verbose_name='user permissions')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='District',
            fields=[
                ('district_id', models.AutoField(primary_key=True, serialize=False)),
                ('district_name', models.CharField(max_length=100)),
                ('description', models.CharField(max_length=1000)),
                ('zone', models.CharField(max_length=255)),
            ],
        ),
        migrations.CreateModel(
            name='Request',
            fields=[
                ('request_id', models.AutoField(primary_key=True, serialize=False)),
                ('request_time', models.TimeField()),
                ('district_id', models.ForeignKey(db_column='district_id', on_delete=django.db.models.deletion.CASCADE, to='api.District')),
                ('editor_id', models.ForeignKey(db_column='editor_id', on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='ServiceType',
            fields=[
                ('service_type_id', models.AutoField(primary_key=True, serialize=False)),
                ('service_type', models.CharField(max_length=100)),
            ],
        ),
        migrations.CreateModel(
            name='Service',
            fields=[
                ('service_id', models.AutoField(primary_key=True, serialize=False)),
                ('latitude', models.CharField(max_length=150)),
                ('longitude', models.CharField(max_length=150)),
                ('open_time', models.TimeField()),
                ('close_time', models.TimeField()),
                ('district_id', models.ForeignKey(db_column='district_id', on_delete=django.db.models.deletion.CASCADE, to='api.District')),
                ('service_type_id', models.ForeignKey(db_column='service_type_id', on_delete=django.db.models.deletion.CASCADE, to='api.ServiceType')),
            ],
        ),
        migrations.CreateModel(
            name='RequestChange',
            fields=[
                ('change_id', models.AutoField(primary_key=True, serialize=False)),
                ('request_id', models.ForeignKey(db_column='request_id', on_delete=django.db.models.deletion.CASCADE, to='api.Request')),
                ('service_id', models.ForeignKey(db_column='service_id', on_delete=django.db.models.deletion.CASCADE, to='api.Service')),
            ],
        ),
        migrations.CreateModel(
            name='RequestApproved',
            fields=[
                ('request_approval_id', models.AutoField(primary_key=True, serialize=False)),
                ('approved_by', models.ForeignKey(db_column='editor_id', on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
                ('request_id', models.ForeignKey(db_column='request_id', on_delete=django.db.models.deletion.CASCADE, to='api.Request')),
            ],
        ),
        migrations.AddField(
            model_name='request',
            name='service_id',
            field=models.ForeignKey(db_column='service_id', on_delete=django.db.models.deletion.CASCADE, to='api.Service'),
        ),
    ]
