# Generated by Django 4.2.15 on 2024-11-09 18:35

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ("sensors", "0001_initial"),
    ]

    operations = [
        migrations.CreateModel(
            name="FloorPlan",
            fields=[
                ("id", models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
                ("name", models.CharField(help_text="The name of the floor plan", max_length=100)),
                ("image", models.ImageField(help_text="The image of the floor plan", upload_to="floor_plans/")),
                (
                    "is_default",
                    models.BooleanField(default=False, help_text="Whether this floor plan is the default one"),
                ),
            ],
            options={
                "abstract": False,
            },
        ),
        migrations.CreateModel(
            name="FloorPlanIcon",
            fields=[
                ("id", models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
                ("name", models.CharField(help_text="The name of the icon", max_length=100)),
                ("image", models.ImageField(help_text="The image of the icon", upload_to="floor_plan_icons/")),
            ],
            options={
                "abstract": False,
            },
        ),
        migrations.CreateModel(
            name="FloorPlanNode",
            fields=[
                ("id", models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
                ("type", models.IntegerField(choices=[(0, "Portal"), (1, "Sensor")], default=1)),
                ("icon_scale", models.FloatField(default=1.0)),
                ("x", models.FloatField(help_text="The x percentage coordinate of the node")),
                ("y", models.FloatField(help_text="The y percentage coordinate of the node")),
                (
                    "font_size",
                    models.FloatField(blank=True, default=25, help_text="The font size of the node label", null=True),
                ),
                (
                    "floor_plan",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="nodes",
                        to="NEMO_floor_plans.floorplan",
                    ),
                ),
                (
                    "icon",
                    models.ForeignKey(
                        blank=True,
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        to="NEMO_floor_plans.floorplanicon",
                    ),
                ),
                (
                    "portal_to",
                    models.ForeignKey(
                        blank=True,
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        to="NEMO_floor_plans.floorplan",
                    ),
                ),
                (
                    "sensor",
                    models.ForeignKey(
                        blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to="sensors.sensor"
                    ),
                ),
            ],
            options={
                "abstract": False,
            },
        ),
    ]
