# Generated by Django 2.2.1 on 2019-05-02 18:41

import django.db.models.deletion
import django.utils.timezone
from django.db import migrations, models

import django_fsm
import model_utils.fields

import builds.models


class Migration(migrations.Migration):

    initial = True

    dependencies = [("projects", "0001_initial"), ("accounts", "0001_initial")]

    operations = [
        migrations.CreateModel(
            name="Build",
            fields=[
                ("id", models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
                (
                    "created",
                    model_utils.fields.AutoCreatedField(
                        default=django.utils.timezone.now, editable=False, verbose_name="created"
                    ),
                ),
                (
                    "modified",
                    model_utils.fields.AutoLastModifiedField(
                        default=django.utils.timezone.now, editable=False, verbose_name="modified"
                    ),
                ),
                (
                    "number",
                    models.CharField(
                        help_text="Execution ID of WorkFlow/Job/Build in Builder",
                        max_length=255,
                        verbose_name="Build Number",
                    ),
                ),
                (
                    "builder",
                    models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to="accounts.BuilderAccount"),
                ),
                ("target", models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to="projects.Target")),
                ("version", models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to="projects.Version")),
            ],
            options={"abstract": False},
            managers=[("objects", builds.models.BuildManager())],
        ),
        migrations.CreateModel(
            name="TestOutcome",
            fields=[
                ("id", models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
                (
                    "created",
                    model_utils.fields.AutoCreatedField(
                        default=django.utils.timezone.now, editable=False, verbose_name="created"
                    ),
                ),
                (
                    "modified",
                    model_utils.fields.AutoLastModifiedField(
                        default=django.utils.timezone.now, editable=False, verbose_name="modified"
                    ),
                ),
                (
                    "result",
                    django_fsm.FSMIntegerField(
                        choices=[(0, "Error"), (1, "Failed"), (2, "Passed"), (3, "Skipped"), (4, "XFailed")],
                        default=builds.models.Results(0),
                        protected=True,
                    ),
                ),
                ("build", models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to="builds.Build")),
                ("test", models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to="projects.Test")),
            ],
            options={"abstract": False},
        ),
    ]
