# Generated by Django 2.1.3 on 2019-03-20 08:22

import cartoview.layers.validators
import django.contrib.postgres.fields
import django.contrib.postgres.fields.jsonb
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('base_resource', '0001_initial'),
        ('connections', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Layer',
            fields=[
                ('basemodel_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='base_resource.BaseModel')),
                ('name', models.CharField(max_length=255)),
                ('bounding_box', django.contrib.postgres.fields.ArrayField(base_field=models.DecimalField(blank=True, decimal_places=15, max_digits=30, null=True), size=4)),
                ('projection', models.CharField(max_length=30, validators=[cartoview.layers.validators.validate_projection])),
                ('valid', models.BooleanField(default=True)),
                ('extra', django.contrib.postgres.fields.jsonb.JSONField()),
                ('server', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='layers', to='connections.Server')),
            ],
            options={
                'abstract': False,
            },
            bases=('base_resource.basemodel', models.Model),
        ),
        migrations.AlterUniqueTogether(
            name='layer',
            unique_together={('name', 'server')},
        ),
    ]
