# Generated by Django 2.2.13 on 2021-07-20 17:06

import django.core.validators
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    dependencies = [
        ('application', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Redmine',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=20, unique=True, validators=[django.core.validators.RegexValidator(message='名前は半角英数字、アンスコ4文字〜20文字です。', regex='^[A-Za-z0-9_]{4,20}$')], verbose_name='Name')),
                ('url', models.URLField(help_text='http://redmine.redmine:8085', verbose_name='URL')),
                ('access_key', models.CharField(max_length=50, verbose_name='Access Key')),
                ('project_id', models.CharField(help_text='Project ID, not a Project name.', max_length=50, verbose_name='Project ID')),
                ('tracker', models.CharField(help_text='Tracker name.', max_length=50, verbose_name='Tracker')),
            ],
            options={
                'verbose_name': 'Redmine',
                'verbose_name_plural': 'Redmine List',
            },
        ),
        migrations.CreateModel(
            name='RedmineVul',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('contrast_org_id', models.CharField(max_length=36, verbose_name='Organization ID')),
                ('contrast_app_id', models.CharField(max_length=36, verbose_name='Application ID')),
                ('contrast_vul_id', models.CharField(max_length=19, verbose_name='Vulnerability ID')),
                ('issue_id', models.CharField(max_length=100, verbose_name='Issue ID')),
                ('redmine', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='vuls', related_query_name='vul', to='application.Redmine', verbose_name='Redmine')),
            ],
            options={
                'verbose_name': 'Redmine Vulnerability',
                'verbose_name_plural': 'Redmine Vulnerabilities',
            },
        ),
        migrations.CreateModel(
            name='RedmineNote',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('note', models.TextField(verbose_name='Note')),
                ('creator', models.CharField(max_length=200, verbose_name='Creator')),
                ('created_at', models.DateTimeField(blank=True, null=True, verbose_name='Created')),
                ('updated_at', models.DateTimeField(blank=True, null=True, verbose_name='Updated')),
                ('contrast_note_id', models.CharField(max_length=36, unique=True, verbose_name='Contrast Note ID')),
                ('note_id', models.CharField(max_length=100, verbose_name='Redmine Comment ID')),
                ('vul', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='notes', related_query_name='note', to='application.RedmineVul', verbose_name='Redmine Vulnerability')),
            ],
            options={
                'verbose_name': 'Redmine Vulnerability Note',
                'verbose_name_plural': 'Redmine Vulnerability Notes',
            },
        ),
        migrations.CreateModel(
            name='RedmineLib',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('contrast_org_id', models.CharField(max_length=36, verbose_name='Organization ID')),
                ('contrast_app_id', models.CharField(max_length=36, verbose_name='Application ID')),
                ('contrast_lib_lg', models.CharField(blank=True, max_length=20, null=True, verbose_name='Library Language')),
                ('contrast_lib_id', models.CharField(blank=True, max_length=40, null=True, verbose_name='Library ID')),
                ('issue_id', models.CharField(max_length=100, verbose_name='Issue ID')),
                ('redmine', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='libs', related_query_name='lib', to='application.Redmine', verbose_name='Redmine')),
            ],
            options={
                'verbose_name': 'Redmine Library',
                'verbose_name_plural': 'Redmine Libraries',
            },
        ),
    ]
