# Generated by Django 3.1.7 on 2021-03-29 10:12

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


class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Building',
            fields=[
                ('building_id', models.CharField(max_length=10, primary_key=True, serialize=False)),
                ('building_name', models.CharField(max_length=30)),
                ('n_floors', models.IntegerField(default=0)),
                ('n_flats', models.IntegerField(default=0)),
            ],
        ),
        migrations.CreateModel(
            name='Flat',
            fields=[
                ('flat_id', models.CharField(max_length=10, primary_key=True, serialize=False)),
                ('flat_no', models.CharField(max_length=20)),
                ('flat_type', models.IntegerField()),
                ('flat_area', models.IntegerField(default=0)),
                ('vaccancy', models.IntegerField(default=0)),
                ('building_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='buildings.building')),
            ],
        ),
        migrations.CreateModel(
            name='Service_Directory',
            fields=[
                ('service_id', models.CharField(max_length=10, primary_key=True, serialize=False)),
                ('name', models.CharField(max_length=50)),
                ('profession', models.CharField(max_length=30)),
                ('building_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='buildings.building')),
            ],
        ),
        migrations.CreateModel(
            name='Phone_Directory',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('phone_no', phonenumber_field.modelfields.PhoneNumberField(max_length=128, region=None)),
                ('user_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='buildings.service_directory')),
            ],
        ),
        migrations.CreateModel(
            name='Occupies',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('ownership', models.CharField(choices=[('Tenant', 'Tenant'), ('Owner', 'Owner')], max_length=10)),
                ('flat_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='buildings.flat')),
                ('user_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
    ]
