# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2017-05-10 03:08
from __future__ import unicode_literals

import bitfield.models
from django.conf import settings
import django.contrib.postgres.fields
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import picklefield.fields


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='Application',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=64)),
                ('description', models.CharField(max_length=50)),
                ('repository', models.CharField(max_length=50)),
                ('date_added', models.DateTimeField(default=django.utils.timezone.now)),
                ('owner', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Depoloyment',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('status', models.CharField(choices=[('CREATED', 'CREATED'), ('PENGING', 'PENDING'), ('EXECUTING', 'EXECUTING'), ('DONE', 'DONE'), ('FAILED', 'FAILED')], max_length=10)),
            ],
        ),
        migrations.CreateModel(
            name='Dog',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=200)),
            ],
        ),
        migrations.CreateModel(
            name='Environment',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50)),
                ('description', models.CharField(max_length=100)),
                ('jenkins_job_url', models.URLField()),
                ('max_unavailable_number', models.PositiveIntegerField()),
                ('concurrency', models.PositiveIntegerField()),
                ('application', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='hello.Application')),
            ],
        ),
        migrations.CreateModel(
            name='Foo',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('bar', models.CharField(max_length=10)),
            ],
        ),
        migrations.CreateModel(
            name='MyModel',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('flags', bitfield.models.BitField(('awesome_flag', 'flaggy_foo', 'baz_bar'), default=None)),
            ],
        ),
        migrations.CreateModel(
            name='Node',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('hostname', models.CharField(max_length=30)),
                ('ip_address', models.GenericIPAddressField()),
                ('environment', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='nodes', to='hello.Environment')),
            ],
        ),
        migrations.CreateModel(
            name='Post',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=200)),
                ('tags', django.contrib.postgres.fields.ArrayField(base_field=models.CharField(max_length=200), blank=True, size=None)),
            ],
        ),
        migrations.CreateModel(
            name='SomeObject',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('args', picklefield.fields.PickledObjectField(editable=False)),
            ],
        ),
        migrations.CreateModel(
            name='Task',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50)),
                ('stdout', models.TextField()),
                ('stderr', models.TextField()),
                ('deployment', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='tasks', to='hello.Depoloyment')),
            ],
        ),
        migrations.CreateModel(
            name='Version',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=10)),
                ('branch', models.CharField(max_length=30)),
                ('is_build_successful', models.BooleanField()),
                ('jenkins_build_status', models.CharField(choices=[('SUCCESS', 'SUCCESS'), ('FAILURE', 'FAILURE')], max_length=10)),
                ('artifact_url', models.CharField(max_length=50)),
                ('environment', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='versions', to='hello.Environment')),
            ],
        ),
        migrations.AddField(
            model_name='depoloyment',
            name='environment',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='deployments', to='hello.Environment'),
        ),
        migrations.AddField(
            model_name='depoloyment',
            name='nodes',
            field=models.ManyToManyField(to='hello.Node'),
        ),
        migrations.AddField(
            model_name='depoloyment',
            name='version',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='hello.Version'),
        ),
    ]
