# Generated by Django 3.1.13 on 2022-02-21 08:17

import django.contrib.gis.db.models.fields
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    dependencies = [
        ('simple_locations', '0011_denormed_border_fields'),
    ]

    operations = [
        migrations.CreateModel(
            name='ProjectedArea',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('geom', django.contrib.gis.db.models.fields.MultiPolygonField(blank=True, null=True, srid=3857)),
                ('area', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='simple_locations.area')),
            ],
        ),
        migrations.RunSQL(
            "TRUNCATE simple_locations_projectedarea; INSERT INTO simple_locations_projectedarea (geom, area_id) (SELECT st_transform(geom, 3857), id FROM simple_locations_area);",
            reverse_sql=None
        )
    ]
