# Generated by Django 2.2.8 on 2020-01-03 12:21

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


class Migration(migrations.Migration):

    dependencies = [
        ('core', '0017_auto_20191231_1437'),
    ]

    operations = [
        migrations.AlterModelOptions(
            name='apartmentsensorvalue',
            options={'ordering': ['-updated_at']},
        ),
        migrations.AlterField(
            model_name='apartment',
            name='user',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='apartments', to=settings.AUTH_USER_MODEL),
        ),
        migrations.AlterField(
            model_name='apartmentsensorvalue',
            name='attribute',
            field=models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, related_name='apartment_sensor_values', to='core.SensorAttribute'),
        ),
        migrations.AlterUniqueTogether(
            name='subscription',
            unique_together=set(),
        ),
        migrations.CreateModel(
            name='ApartmentSensorAttribute',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('apartment_sensor', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='attributes', to='core.ApartmentSensor')),
                ('attribute', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='apartment_sensor_attributes', to='core.SensorAttribute')),
            ],
        ),
        migrations.AddField(
            model_name='apartmentsensorvalue',
            name='apartment_sensor_attribute',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='values', to='core.ApartmentSensorAttribute'),
        ),
    ]
