# Generated by Django 2.0.4 on 2018-10-16 11:32

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('accounts', '__first__'),
    ]

    operations = [
        migrations.CreateModel(
            name='Category',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=32)),
            ],
        ),
        migrations.CreateModel(
            name='Dimension',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('width', models.FloatField()),
                ('height', models.FloatField()),
                ('depth', models.FloatField()),
            ],
        ),
        migrations.CreateModel(
            name='Image',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('file', models.ImageField(upload_to=respool.models.image_path)),
                ('thumb', models.ImageField(blank=True, null=True, upload_to=respool.models.thumb_path)),
                ('order_id', models.PositiveSmallIntegerField()),
            ],
            options={
                'ordering': ['order_id'],
            },
        ),
        migrations.CreateModel(
            name='Item',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=64)),
                ('description', models.TextField(max_length=1024)),
                ('type', models.IntegerField(choices=[(0, 'Veranstaltungsort'), (1, 'Dienstleistung'), (2, 'Objekt')])),
                ('weight', models.FloatField(blank=True, null=True)),
                ('amount', models.PositiveIntegerField(blank=True, null=True)),
                ('categories', models.ManyToManyField(blank=True, to='respool.Category')),
                ('dimension', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='respool.Dimension')),
                ('images', models.ManyToManyField(blank=True, to='respool.Image')),
                ('lender', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='accounts.Lender')),
            ],
        ),
        migrations.CreateModel(
            name='Loan',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('caution', models.FloatField(blank=True, null=True)),
                ('single_rent', models.FloatField(blank=True, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='LoanAgreement',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('file', models.FileField(upload_to='agreements/')),
            ],
        ),
        migrations.CreateModel(
            name='Location',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(blank=True, max_length=32, null=True)),
                ('house_number', models.PositiveIntegerField()),
                ('street', models.CharField(max_length=32)),
                ('city', models.CharField(default='Bamberg', max_length=32)),
                ('longitude', models.FloatField(blank=True, null=True)),
                ('latitude', models.FloatField(blank=True, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='RentalFee',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('interval_unit', models.IntegerField(choices=[(0, 'Stunde'), (1, 'Tag'), (2, 'Woche'), (3, 'Monat')])),
                ('costs', models.FloatField()),
            ],
        ),
        migrations.CreateModel(
            name='TimeInterval',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('start_time', models.DateTimeField()),
                ('end_time', models.DateTimeField()),
            ],
        ),
        migrations.AddField(
            model_name='loan',
            name='rental_fee',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='respool.RentalFee'),
        ),
        migrations.AddField(
            model_name='item',
            name='loan',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='respool.Loan'),
        ),
        migrations.AddField(
            model_name='item',
            name='loan_agreement',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='respool.LoanAgreement'),
        ),
        migrations.AddField(
            model_name='item',
            name='location',
            field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='respool.Location'),
        ),
        migrations.AddField(
            model_name='item',
            name='occupancies',
            field=models.ManyToManyField(blank=True, to='respool.TimeInterval'),
        ),
    ]
