# Generated by Django 2.2.4 on 2019-08-29 11:51

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


class Migration(migrations.Migration):
    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name="CommunePage",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "code",
                    models.CharField(
                        editable=False, max_length=5, verbose_name="Code INSEE"
                    ),
                ),
                (
                    "code_departement",
                    models.CharField(
                        editable=False, max_length=3, verbose_name="Code département"
                    ),
                ),
                (
                    "coordinates",
                    django.contrib.gis.db.models.fields.MultiPolygonField(
                        geography=True,
                        srid=4326,
                        verbose_name="Périmètre de la commune",
                    ),
                ),
                (
                    "name",
                    models.CharField(max_length=255, verbose_name="Nom de la commune"),
                ),
                ("slug", models.SlugField(verbose_name="Slug")),
            ],
        ),
        migrations.AddConstraint(
            model_name="communepage",
            constraint=models.UniqueConstraint(
                fields=("code_departement", "slug"), name="dep_slug"
            ),
        ),
    ]
