# -*- coding: utf-8 -*-
# Generated by Django 1.11.28 on 2020-04-18 17:36
from __future__ import unicode_literals

from django.db import migrations, models
import django.db.models.deletion
import re2o.mixins


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ("machines", "0106_auto_20191120_0159"),
        ("contenttypes", "0002_remove_content_type_name"),
    ]

    operations = [
        migrations.CreateModel(
            name="Deployment",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "machine",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to="machines.Machine",
                    ),
                ),
            ],
            bases=(re2o.mixins.RevMixin, re2o.mixins.AclMixin, models.Model),
        ),
        migrations.CreateModel(
            name="Parameter",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("name", models.CharField(max_length=255, verbose_name="name")),
                (
                    "_value",
                    models.TextField(
                        blank=True,
                        default="",
                        help_text="optional.",
                        verbose_name="Value for this parameter",
                    ),
                ),
                ("object_id", models.PositiveIntegerField()),
                ("update_required", models.BooleanField(default=False)),
                (
                    "content_type",
                    models.ForeignKey(
                        help_text="This must be filled for dynamic parameters.",
                        on_delete=django.db.models.deletion.CASCADE,
                        to="contenttypes.ContentType",
                        verbose_name="Model name",
                    ),
                ),
            ],
            bases=(re2o.mixins.RevMixin, re2o.mixins.AclMixin, models.Model),
        ),
        migrations.CreateModel(
            name="ParameterType",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("name", models.CharField(max_length=255, verbose_name="name")),
                (
                    "value",
                    models.CharField(
                        max_length=50, verbose_name="how the value should be determined"
                    ),
                ),
                (
                    "default_value",
                    models.TextField(
                        blank=True,
                        default="",
                        help_text="This must be filled for fixed parameters",
                        verbose_name="Default value for this parameter",
                    ),
                ),
                (
                    "dynamic_field",
                    models.CharField(
                        blank=True,
                        help_text="Field name that is to be fetched, this must be filled for dynamic parameters.",
                        max_length=255,
                        verbose_name="Field name.",
                    ),
                ),
                (
                    "content_type",
                    models.ForeignKey(
                        help_text="This must be filled for dynamic parameters.",
                        on_delete=django.db.models.deletion.CASCADE,
                        to="contenttypes.ContentType",
                        verbose_name="Model name",
                    ),
                ),
            ],
            bases=(re2o.mixins.RevMixin, re2o.mixins.AclMixin, models.Model),
        ),
        migrations.CreateModel(
            name="Preference",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "compagnon_url",
                    models.URLField(verbose_name="URL for the compagnon website."),
                ),
            ],
            bases=(re2o.mixins.RevMixin, re2o.mixins.AclMixin, models.Model),
        ),
        migrations.CreateModel(
            name="Recipe",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("name", models.CharField(max_length=255, verbose_name="name")),
                (
                    "description",
                    models.TextField(
                        blank=True,
                        default="",
                        help_text="optional.",
                        verbose_name="description of this recipe.",
                    ),
                ),
            ],
            bases=(re2o.mixins.RevMixin, re2o.mixins.AclMixin, models.Model),
        ),
        migrations.AddField(
            model_name="parametertype",
            name="recipe",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE, to="deployments.Recipe"
            ),
        ),
        migrations.AddField(
            model_name="parameter",
            name="type",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                to="deployments.ParameterType",
            ),
        ),
        migrations.AddField(
            model_name="deployment",
            name="recipe",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE, to="deployments.Recipe"
            ),
        ),
    ]
