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

import datetime
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import fernet_fields.fields


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('contenttypes', '0002_remove_content_type_name'),
    ]

    operations = [
        migrations.CreateModel(
            name='Server',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('server_type', models.CharField(choices=[('ESRI', 'ArcGIS Server'), ('MS', 'MapServer'), ('GS', 'Geoserver'), ('G', 'Geonode')], help_text='Server Type', max_length=5)),
                ('resources_type', models.CharField(choices=[('wms', 'Web Map Service'), ('wfs', 'Web Feature Service')], help_text='Resources Type', max_length=50)),
                ('title', models.CharField(help_text='Server Title', max_length=150)),
                ('url', models.URLField(help_text='Base Server URL')),
                ('object_id', models.PositiveIntegerField(blank=True, null=True)),
                ('refresh_interval', models.DurationField(default=datetime.timedelta(days=7))),
                ('content_type', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='contenttypes.ContentType')),
                ('owner', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'ordering': ('-created_at', '-updated_at'),
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='SimpleAuthConnection',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('username', models.CharField(help_text='Server Type', max_length=200)),
                ('password', fernet_fields.fields.EncryptedTextField(help_text='User Password')),
                ('auth_type', models.CharField(choices=[('BASIC', 'Basic Authentication'), ('DIGEST', 'Digest Authentication')], help_text='Authentication Type', max_length=6)),
                ('owner', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'ordering': ('-created_at', '-updated_at'),
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='TokenAuthConnection',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('token', models.TextField(help_text='Access Token')),
                ('prefix', models.CharField(blank=True, default='Bearer', help_text='Authentication Header Value Prefix', max_length=60)),
                ('owner', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'ordering': ('-created_at', '-updated_at'),
                'abstract': False,
            },
        ),
    ]
