# Generated by Django 2.2.6 on 2020-10-25 18:48

import datetime
from django.conf import settings
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
from django.utils.timezone import utc


class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='City',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100)),
            ],
            options={
                'verbose_name_plural': 'Cities',
            },
        ),
        migrations.CreateModel(
            name='Property',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=500)),
                ('description', models.CharField(max_length=1000)),
                ('maxPax', models.PositiveIntegerField(default=1, validators=[django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(100)])),
                ('image', models.ImageField(null=True, upload_to='property')),
                ('dailyCost', models.DecimalField(decimal_places=2, max_digits=10)),
                ('city', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='rentalProperty.City')),
                ('owner', models.ForeignKey(on_delete=models.SET('null'), to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name_plural': 'Properties',
            },
        ),
        migrations.CreateModel(
            name='Reservation',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=120)),
                ('lastName', models.CharField(max_length=120)),
                ('email', models.EmailField(max_length=200)),
                ('date', models.DateField(default=datetime.datetime(2020, 10, 25, 18, 48, 40, 729740, tzinfo=utc))),
                ('totalCost', models.FloatField(default=0.0, validators=[django.core.validators.MinValueValidator(0.0)])),
                ('code', models.IntegerField()),
                ('property', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='rentalProperty.Property')),
            ],
            options={
                'verbose_name_plural': 'Reservations',
            },
        ),
        migrations.CreateModel(
            name='RentalDate',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('date', models.DateField()),
                ('property', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='rentalProperty.Property')),
                ('reservation', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='rentalProperty.Reservation')),
            ],
            options={
                'verbose_name_plural': 'RentalDates',
                'ordering': ('date', 'property'),
            },
        ),
    ]
