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

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'),
    ]

    operations = [
        migrations.CreateModel(
            name='App',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=200, unique=True)),
                ('title', models.CharField(max_length=200, unique=True)),
                ('description', models.TextField(blank=True, null=True)),
                ('license', models.CharField(blank=True, max_length=200, null=True)),
                ('date_installed', models.DateTimeField(auto_now_add=True, null=True, verbose_name='Date Installed')),
                ('single_instance', models.BooleanField(default=False)),
                ('status', models.CharField(default='Alpha', max_length=100)),
                ('app_img_url', models.TextField(blank=True, max_length=1000, null=True)),
                ('version', models.CharField(max_length=10)),
                ('order', models.IntegerField(default=0, unique=True)),
                ('default_config', django.contrib.postgres.fields.jsonb.JSONField(blank=True, default=dict, null=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
            ],
            options={
                'ordering': ['order'],
                'permissions': (('install_app', 'Install App'), ('uninstall_app', 'Uninstall App'), ('change_state', 'Change App State (active, suspend)')),
            },
        ),
        migrations.CreateModel(
            name='AppInstance',
            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')),
                ('config', django.contrib.postgres.fields.jsonb.JSONField(blank=True, default=None, null=True)),
                ('app', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='instances', to='app_manager.App')),
            ],
            bases=('base_resource.basemodel',),
        ),
        migrations.CreateModel(
            name='AppStore',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=256)),
                ('url', models.URLField(verbose_name='App Store URL')),
                ('is_default', models.BooleanField(default=False)),
                ('server_type', models.CharField(choices=[('Exchange', 'Exchange'), ('Geoserver', 'Geoserver'), ('QGISServer', 'QGISServer')], default='Geoserver', max_length=256)),
            ],
            options={
                'ordering': ['-name'],
            },
        ),
        migrations.CreateModel(
            name='AppType',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=200, unique=True)),
            ],
            options={
                'ordering': ['-name'],
            },
        ),
    ]
