# Generated by Django 3.0.3 on 2021-05-15 14:56

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='DailyScan',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('error_complex', models.IntegerField(blank=True, null=True)),
                ('error_price_sqm', models.IntegerField(blank=True, null=True)),
                ('populated_count', models.IntegerField(blank=True, null=True)),
                ('ads_searched', models.IntegerField(blank=True, null=True)),
                ('date', models.DateField(auto_now_add=True)),
            ],
        ),
        migrations.CreateModel(
            name='ErrorListings',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('listing', models.URLField(max_length=500)),
                ('error_message', models.CharField(blank=True, max_length=200, null=True)),
                ('date', models.DateField(auto_now_add=True)),
            ],
        ),
        migrations.CreateModel(
            name='MarketModel',
            fields=[
                ('district', models.CharField(max_length=100, primary_key=True, serialize=False)),
            ],
        ),
        migrations.CreateModel(
            name='ZipCodeModel',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('housetype', models.CharField(blank=True, max_length=200, null=True)),
                ('zipcode', models.IntegerField(blank=True, null=True)),
                ('database', models.IntegerField(blank=True, default=1, null=True)),
                ('market', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='zipcode', to='scraper.MarketModel')),
            ],
        ),
        migrations.CreateModel(
            name='TotalModel',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('total_listings', models.IntegerField(blank=True, default=0, null=True)),
                ('total_value', models.IntegerField(blank=True, default=0, null=True)),
                ('total_sqm', models.IntegerField(blank=True, default=0, null=True)),
                ('market', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='total', to='scraper.MarketModel')),
            ],
        ),
        migrations.CreateModel(
            name='PriceModel',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('price', models.FloatField(blank=True, null=True)),
                ('date', models.DateField(auto_now_add=True)),
                ('market', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='price', to='scraper.MarketModel')),
            ],
        ),
        migrations.CreateModel(
            name='MonthlyStatistic',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('listings_value_mm', models.IntegerField(blank=True, null=True)),
                ('highest_listing_mm', models.IntegerField(blank=True, null=True)),
                ('lowest_listing_mm', models.IntegerField(blank=True, null=True)),
                ('total_listings_mm', models.IntegerField(blank=True, null=True)),
                ('percent_change_mm', models.FloatField(blank=True, null=True)),
                ('date', models.DateField(auto_now_add=True)),
                ('market', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='monthly', to='scraper.MarketModel')),
            ],
        ),
        migrations.CreateModel(
            name='DailyStatistic',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('listings_value_dd', models.IntegerField(blank=True, default=0, null=True)),
                ('total_listings_dd', models.IntegerField(blank=True, default=0, null=True)),
                ('percent_change_dd', models.FloatField(blank=True, null=True)),
                ('date', models.DateField(blank=True, null=True)),
                ('market', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='daily', to='scraper.MarketModel')),
            ],
        ),
        migrations.CreateModel(
            name='AverageModel',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('average_price', models.FloatField(blank=True, null=True)),
                ('average_sqm', models.FloatField(blank=True, null=True)),
                ('average_price_over_sqm', models.FloatField(blank=True, null=True)),
                ('market', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='average', to='scraper.MarketModel')),
            ],
        ),
        migrations.CreateModel(
            name='HouseModel',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('adress', models.CharField(max_length=200)),
                ('postnummer', models.IntegerField(blank=True, null=True)),
                ('prisantydning', models.IntegerField(blank=True, null=True)),
                ('fellesgjeld', models.IntegerField(blank=True, null=True)),
                ('omkostninger', models.IntegerField(blank=True, null=True)),
                ('totalpris', models.IntegerField(blank=True, null=True)),
                ('felleskostnader', models.IntegerField(blank=True, null=True)),
                ('boligtype', models.CharField(blank=True, max_length=200, null=True)),
                ('eieform', models.CharField(blank=True, max_length=20, null=True)),
                ('soverom', models.IntegerField(blank=True, null=True)),
                ('primærrom', models.IntegerField(blank=True, null=True)),
                ('bruksareal', models.IntegerField(blank=True, null=True)),
                ('grunnflate', models.IntegerField(blank=True, null=True)),
                ('etasje', models.IntegerField(blank=True, null=True)),
                ('byggeår', models.IntegerField(blank=True, null=True)),
                ('rom', models.IntegerField(blank=True, null=True)),
                ('tomteareal', models.IntegerField(blank=True, null=True)),
                ('bruttoareal', models.IntegerField(blank=True, null=True)),
                ('areal', models.IntegerField(blank=True, null=True)),
                ('url', models.CharField(max_length=200)),
                ('bilde', models.URLField(blank=True, null=True)),
                ('date', models.DateField(auto_now_add=True)),
                ('market', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='listing', to='scraper.MarketModel')),
            ],
            options={
                'unique_together': {('prisantydning', 'adress')},
            },
        ),
    ]
