# Generated by Django 2.0.7 on 2018-07-31 13:42

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='ComunidadAutonoma',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('nombre', models.CharField(max_length=100)),
            ],
        ),
        migrations.CreateModel(
            name='Municipio',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('nombre', models.CharField(max_length=100)),
            ],
        ),
        migrations.CreateModel(
            name='Provincia',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('nombre', models.CharField(max_length=100)),
                ('comunidad_autonoma', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='mapviewer.ComunidadAutonoma')),
            ],
        ),
        migrations.CreateModel(
            name='TipoFaseHistorica',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('nombre', models.CharField(max_length=100)),
            ],
        ),
        migrations.CreateModel(
            name='TipoYacimiento',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('nombre', models.CharField(max_length=100)),
            ],
        ),
        migrations.CreateModel(
            name='Yacimiento',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('nombre', models.CharField(max_length=200)),
                ('localizacion', django.contrib.gis.db.models.fields.PolygonField(srid=4326)),
                ('observaciones', models.TextField()),
                ('comunidad_autonoma', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='mapviewer.ComunidadAutonoma')),
                ('fase_historica', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='mapviewer.TipoFaseHistorica')),
                ('municipio', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='mapviewer.Municipio')),
                ('provincia', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='mapviewer.Provincia')),
                ('tipo', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='mapviewer.TipoYacimiento')),
                ('usuario', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.AddField(
            model_name='municipio',
            name='provincia',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='mapviewer.Provincia'),
        ),
    ]
