# Generated by Django 2.2.5 on 2019-09-16 12:57

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Appartment',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=200)),
                ('address', models.CharField(help_text='Rue et n° de rue', max_length=200)),
                ('city', models.CharField(help_text='Ville', max_length=50)),
                ('zipcode', models.CharField(help_text='Code postal', max_length=10)),
                ('price', models.IntegerField(default=0, help_text='Prix à la journée en €')),
                ('cover_picture', models.ImageField(help_text="Photo de couverture de l'appartement", null=True, upload_to='')),
                ('nb_bedrooms', models.IntegerField(default=0, help_text='Nombre de chambres')),
                ('nb_bathrooms', models.IntegerField(default=0, help_text='Nombre de salles de bains')),
                ('surface', models.IntegerField(default=0, help_text='Surface en m2')),
                ('description', models.TextField(help_text="Description de l'appartement")),
                ('is_visible', models.BooleanField(default=False, help_text="Cocher pour rendre l'appartement publiquement visible")),
                ('is_bookable', models.BooleanField(default=False, help_text="Cocher pour que n'importe qui puisse faire une demande de réservation")),
                ('slug', models.SlugField(editable=False, max_length=255, unique=True)),
            ],
        ),
        migrations.CreateModel(
            name='Reservation',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('start_date', models.DateField()),
                ('end_date', models.DateField()),
                ('name', models.CharField(max_length=200)),
                ('email', models.EmailField(max_length=254)),
                ('status', models.CharField(choices=[('waiting', 'Waiting approval'), ('accepted', 'Accepted'), ('refused', 'Refused')], default='waiting', max_length=20)),
                ('created_date', models.DateTimeField(auto_now_add=True, verbose_name='Date de création')),
                ('modified_date', models.DateTimeField(auto_now=True, verbose_name='Date de dernière modification')),
                ('appartment', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='reservations.Appartment')),
            ],
        ),
        migrations.CreateModel(
            name='AppartmentImage',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('image', models.ImageField(upload_to='')),
                ('apparment', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='images', to='reservations.Appartment')),
            ],
        ),
    ]
