# Generated by Django 2.1.3 on 2018-11-15 22:59

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='City',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('cityName', models.CharField(max_length=100)),
            ],
        ),
        migrations.CreateModel(
            name='Country',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('countryName', models.CharField(max_length=100)),
            ],
        ),
        migrations.CreateModel(
            name='PermissionType',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(choices=[('read', 'Read'), ('write', 'Write'), ('update', 'Update'), ('delete', 'Delete')], default=myapp.models.PermissionTypeChoices('read'), max_length=100, unique=True)),
            ],
            options={
                'db_table': 'myapp_permissiontype',
            },
        ),
        migrations.CreateModel(
            name='Property',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('propertyID', models.IntegerField()),
                ('propertyTitle', models.CharField(max_length=100)),
                ('propertyStreet', models.CharField(max_length=200)),
                ('propertyPostalCode', models.CharField(max_length=200)),
                ('propertyStreetNumber', models.CharField(max_length=200)),
                ('propertyConstructionDate', models.DateField()),
                ('propertyRegistrationDate', models.DateField()),
                ('propertyNoOfHalls', models.IntegerField()),
                ('propertyNoOfRooms', models.IntegerField()),
                ('propertyNoOfBathRooms', models.FloatField()),
                ('propertyNoOfFloors', models.IntegerField()),
                ('propertyTotalArea', models.FloatField()),
                ('propertyAskingPrice', models.DecimalField(decimal_places=2, max_digits=10)),
                ('propertySellingPrice', models.DecimalField(decimal_places=2, max_digits=10)),
                ('memberName', models.CharField(max_length=100)),
            ],
        ),
        migrations.CreateModel(
            name='PropertyCategory',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('propertyCategory', models.CharField(choices=[('Single House', 'Single House'), ('Attached House', 'Attached House'), ('Town House', 'Town House'), ('Apartment', 'Apartment'), ('Store', 'Store'), ('Farm', 'Farm'), ('Factory', 'Factory'), ('Mall', 'Mall'), ('Building', 'Building'), ('Other', 'Other')], max_length=20)),
            ],
        ),
        migrations.CreateModel(
            name='PropertyFacing',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('propertyFacing', models.CharField(choices=[('North', 'North'), ('South', 'South'), ('East', 'East'), ('West', 'West'), ('Other', 'Other')], max_length=20)),
            ],
        ),
        migrations.CreateModel(
            name='PropertyImages',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('propertyImage', models.ImageField(blank=True, null=True, upload_to='photo/')),
                ('propertyImageID', models.CharField(max_length=200)),
                ('propertyImageDescription', models.CharField(max_length=500)),
                ('propertyID', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='myapp.Property')),
            ],
        ),
        migrations.CreateModel(
            name='PropertySector',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('propertySector', models.CharField(choices=[('Private', 'Private'), ('Residential', 'Residential'), ('Commercial', 'Commercial'), ('Government', 'Government'), ('Rural', 'Rural'), ('Other', 'Other')], max_length=20)),
            ],
        ),
        migrations.CreateModel(
            name='Province',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('provinceName', models.CharField(max_length=100)),
                ('countryName', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='myapp.Country')),
            ],
        ),
        migrations.CreateModel(
            name='RoleCode',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('roleName', models.CharField(max_length=55)),
            ],
            options={
                'db_table': 'myapp_rolecode',
            },
        ),
        migrations.CreateModel(
            name='RolePermission',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('sysFeature', models.CharField(max_length=75)),
                ('code', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='myapp.RoleCode')),
                ('permissions', models.ManyToManyField(to='myapp.PermissionType')),
            ],
            options={
                'db_table': 'myapp_rolepermission',
                'ordering': ['id'],
            },
        ),
        migrations.CreateModel(
            name='User',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('firstName', models.CharField(max_length=25)),
                ('lastName', models.CharField(max_length=25)),
                ('email', models.CharField(max_length=55)),
                ('isActive', models.BooleanField(default=True)),
            ],
            options={
                'db_table': 'myapp_user',
            },
        ),
        migrations.CreateModel(
            name='UserRole',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('date_assigned', models.DateField(auto_now=True)),
                ('role', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='role_code', to='myapp.RoleCode')),
            ],
            options={
                'db_table': 'myapp_userrole',
            },
        ),
        migrations.CreateModel(
            name='Password',
            fields=[
                ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, serialize=False, to='myapp.User')),
                ('username', models.CharField(max_length=25)),
                ('encryptedPassword', models.CharField(max_length=255)),
                ('salt', models.CharField(max_length=255)),
                ('userAccountExpiryDate', models.DateField()),
                ('passwordMustChanged', models.DateTimeField(default=datetime.datetime(2021, 4, 25, 4, 59, 30, 698535))),
                ('passwordReset', models.BooleanField(default=False)),
            ],
            options={
                'db_table': 'myapp_password',
            },
        ),
        migrations.AddField(
            model_name='userrole',
            name='user',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='roles', to='myapp.User'),
        ),
        migrations.AddField(
            model_name='rolecode',
            name='code',
            field=models.ManyToManyField(through='myapp.UserRole', to='myapp.User'),
        ),
        migrations.AddField(
            model_name='property',
            name='propertyCategory',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='myapp.PropertyCategory'),
        ),
        migrations.AddField(
            model_name='property',
            name='propertyCity',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='myapp.City'),
        ),
        migrations.AddField(
            model_name='property',
            name='propertyCountry',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='myapp.Country'),
        ),
        migrations.AddField(
            model_name='property',
            name='propertyFacing',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='myapp.PropertyFacing'),
        ),
        migrations.AddField(
            model_name='property',
            name='propertyProvince',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='myapp.Province'),
        ),
        migrations.AddField(
            model_name='property',
            name='propertySector',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='myapp.PropertySector'),
        ),
        migrations.AddField(
            model_name='city',
            name='countryName',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='myapp.Country'),
        ),
        migrations.AddField(
            model_name='city',
            name='provinceName',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='myapp.Province'),
        ),
        migrations.AlterUniqueTogether(
            name='userrole',
            unique_together={('user', 'role')},
        ),
    ]
