# Generated by Django 2.1.5 on 2019-09-16 02:58

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('orgs', '0009_organization_logo'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('common', '0004_auto_20190605_1830'),
        ('applications', '0016_auto_20190529_1551'),
    ]

    operations = [
        migrations.CreateModel(
            name='FeatureImpactDesign',
            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)),
            ],
            options={
                'managed': False,
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='EsbInterfaces',
            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)),
                ('service_name', models.CharField(max_length=128, verbose_name='服务名')),
                ('service_desc', models.CharField(max_length=128, verbose_name='服务描述')),
                ('operation_name', models.CharField(max_length=128, verbose_name='操作名')),
                ('operation_desc', models.CharField(max_length=128, verbose_name='操作描述')),
                ('attachments', models.ManyToManyField(blank=True, related_name='esb_interface_attachments', to='common.Attachment', verbose_name='ESB服务附件')),
                ('created_by', models.ForeignKey(on_delete=models.SET(-999), to=settings.AUTH_USER_MODEL)),
                ('org', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='orgs.Organization')),
            ],
            options={
                'ordering': ['-created_at'],
                'db_table': 'interface_esb',
            },
        ),
        migrations.CreateModel(
            name='InterfaceDictionary',
            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)),
                ('name', models.CharField(max_length=128, verbose_name='名称')),
                ('type', models.CharField(choices=[('string', 'string'), ('number', 'number'), ('boolean', 'boolean'), ('integer', 'integer'), ('array', 'array')], max_length=20, verbose_name='类型')),
                ('description', models.TextField(blank=True, null=True, verbose_name='描述')),
                ('created_by', models.ForeignKey(on_delete=models.SET(-999), to=settings.AUTH_USER_MODEL)),
                ('org', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='orgs.Organization')),
            ],
            options={
                'ordering': ['-created_at'],
                'db_table': 'interface_dictionary',
            },
        ),
        migrations.CreateModel(
            name='InterfaceGroup',
            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)),
                ('name', models.CharField(max_length=128, verbose_name='组名')),
                ('parentId', models.IntegerField(default=-1, verbose_name='父id')),
                ('application', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='group_application', to='applications.Application', verbose_name='归属应用')),
                ('created_by', models.ForeignKey(on_delete=models.SET(-999), to=settings.AUTH_USER_MODEL)),
                ('org', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='orgs.Organization')),
            ],
            options={
                'db_table': 'interface_group',
            },
        ),
        migrations.CreateModel(
            name='Interfaces',
            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)),
                ('name', models.CharField(max_length=128, verbose_name='接口名')),
                ('url', models.CharField(max_length=64, verbose_name='url')),
                ('method', models.CharField(choices=[('GET', ''), ('POST', ''), ('PUT', ''), ('PATCH', ''), ('DELETE', '')], max_length=32, verbose_name='http方法')),
                ('description', models.TextField(null=True, verbose_name='描述')),
                ('version', models.CharField(max_length=16, verbose_name='版本')),
                ('status', models.CharField(choices=[('0', '0'), ('1', '1')], max_length=2, verbose_name='状态')),
                ('open', models.BooleanField(default=True, verbose_name='是否开放')),
                ('info', models.TextField(blank=True, null=True, verbose_name='接口信息')),
                ('application', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='interface_application', to='applications.Application')),
                ('created_by', models.ForeignKey(on_delete=models.SET(-999), to=settings.AUTH_USER_MODEL)),
                ('group', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='interface_group', to='designs.InterfaceGroup')),
                ('org', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='orgs.Organization')),
            ],
            options={
                'ordering': ['-created_at'],
                'db_table': 'interfaces',
            },
        ),
        migrations.CreateModel(
            name='InterfaceTest',
            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)),
                ('body', models.TextField(verbose_name='请求body')),
                ('response', models.TextField(blank=True, null=True, verbose_name='response')),
                ('created_by', models.ForeignKey(on_delete=models.SET(-999), to=settings.AUTH_USER_MODEL)),
                ('interface', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='test_interface', to='designs.Interfaces')),
                ('org', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='orgs.Organization')),
            ],
            options={
                'ordering': ['-created_at'],
                'db_table': 'interface_test',
            },
        ),
        migrations.AlterUniqueTogether(
            name='interfacetest',
            unique_together={('interface',)},
        ),
        migrations.AlterUniqueTogether(
            name='interfaces',
            unique_together={('url',)},
        ),
        migrations.AlterUniqueTogether(
            name='interfacegroup',
            unique_together={('name', 'application')},
        ),
        migrations.AlterUniqueTogether(
            name='interfacedictionary',
            unique_together={('name', 'type')},
        ),
        migrations.AlterUniqueTogether(
            name='esbinterfaces',
            unique_together={('operation_name',)},
        ),
    ]
