// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using RobotNet.MapManager.Data;

#nullable disable

namespace RobotNet.MapManager.Data.Migrations
{
    [DbContext(typeof(MapEditorDbContext))]
    [Migration("20250812041834_AddZoneName")]
    partial class AddZoneName
    {
        /// <inheritdoc />
        protected override void BuildTargetModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
                .HasAnnotation("ProductVersion", "9.0.7")
                .HasAnnotation("Relational:MaxIdentifierLength", 128);

            SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);

            modelBuilder.Entity("RobotNet.MapManager.Data.Action", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("uniqueidentifier")
                        .HasColumnName("Id");

                    b.Property<string>("Content")
                        .HasColumnType("nvarchar(max)")
                        .HasColumnName("Content");

                    b.Property<Guid>("MapId")
                        .HasColumnType("uniqueidentifier")
                        .HasColumnName("MapId");

                    b.Property<string>("Name")
                        .HasColumnType("nvarchar(64)")
                        .HasColumnName("Name");

                    b.HasKey("Id");

                    b.HasIndex(new[] { "MapId", "Name" }, "IX_Action_MapId_Name");

                    b.ToTable("Actions");
                });

            modelBuilder.Entity("RobotNet.MapManager.Data.Edge", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("uniqueidentifier")
                        .HasColumnName("Id");

                    b.Property<string>("Actions")
                        .HasColumnType("nvarchar(max)")
                        .HasColumnName("Actions");

                    b.Property<double>("AllowedDeviationTheta")
                        .HasColumnType("float")
                        .HasColumnName("AllowedDeviationTheta");

                    b.Property<double>("AllowedDeviationXy")
                        .HasColumnType("float")
                        .HasColumnName("AllowedDeviationXy");

                    b.Property<double>("ControlPoint1X")
                        .HasColumnType("float")
                        .HasColumnName("ControlPoint1X");

                    b.Property<double>("ControlPoint1Y")
                        .HasColumnType("float")
                        .HasColumnName("ControlPoint1Y");

                    b.Property<double>("ControlPoint2X")
                        .HasColumnType("float")
                        .HasColumnName("ControlPoint2X");

                    b.Property<double>("ControlPoint2Y")
                        .HasColumnType("float")
                        .HasColumnName("ControlPoint2Y");

                    b.Property<byte>("DirectionAllowed")
                        .HasColumnType("tinyint")
                        .HasColumnName("DirectionAllowed");

                    b.Property<Guid>("EndNodeId")
                        .HasColumnType("uniqueidentifier")
                        .HasColumnName("EndNodeId");

                    b.Property<Guid>("MapId")
                        .HasColumnType("uniqueidentifier")
                        .HasColumnName("MapId");

                    b.Property<double>("MaxHeight")
                        .HasColumnType("float")
                        .HasColumnName("MaxHeight");

                    b.Property<double>("MaxRotationSpeed")
                        .HasColumnType("float")
                        .HasColumnName("MaxRotationSpeed");

                    b.Property<double>("MaxSpeed")
                        .HasColumnType("float")
                        .HasColumnName("MaxSpeed");

                    b.Property<double>("MinHeight")
                        .HasColumnType("float")
                        .HasColumnName("MinHeight");

                    b.Property<bool>("RotationAllowed")
                        .HasColumnType("bit")
                        .HasColumnName("RotationAllowed");

                    b.Property<Guid>("StartNodeId")
                        .HasColumnType("uniqueidentifier")
                        .HasColumnName("StartNodeId");

                    b.Property<byte>("TrajectoryDegree")
                        .HasColumnType("tinyint")
                        .HasColumnName("TrajectoryDegree");

                    b.HasKey("Id");

                    b.HasIndex("EndNodeId");

                    b.HasIndex("StartNodeId");

                    b.HasIndex(new[] { "MapId" }, "IX_Edge_MapId");

                    b.ToTable("Edges");
                });

            modelBuilder.Entity("RobotNet.MapManager.Data.Element", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("uniqueidentifier")
                        .HasColumnName("Id");

                    b.Property<string>("Content")
                        .HasColumnType("nvarchar(max)")
                        .HasColumnName("Content");

                    b.Property<bool>("IsOpen")
                        .HasColumnType("bit")
                        .HasColumnName("IsOpen");

                    b.Property<Guid>("MapId")
                        .HasColumnType("uniqueidentifier")
                        .HasColumnName("MapId");

                    b.Property<Guid>("ModelId")
                        .HasColumnType("uniqueidentifier")
                        .HasColumnName("ModelId");

                    b.Property<string>("Name")
                        .HasColumnType("nvarchar(64)")
                        .HasColumnName("Name");

                    b.Property<Guid>("NodeId")
                        .HasColumnType("uniqueidentifier")
                        .HasColumnName("NodeId");

                    b.Property<double>("OffsetX")
                        .HasColumnType("float")
                        .HasColumnName("OffsetX");

                    b.Property<double>("OffsetY")
                        .HasColumnType("float")
                        .HasColumnName("OffsetY");

                    b.HasKey("Id");

                    b.HasIndex("ModelId");

                    b.HasIndex("NodeId")
                        .IsUnique();

                    b.HasIndex(new[] { "MapId", "ModelId" }, "IX_Element_MapId_ModelId");

                    b.ToTable("Elements");
                });

            modelBuilder.Entity("RobotNet.MapManager.Data.ElementModel", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("uniqueidentifier")
                        .HasColumnName("Id");

                    b.Property<string>("Content")
                        .HasColumnType("nvarchar(max)")
                        .HasColumnName("Content");

                    b.Property<double>("Height")
                        .HasColumnType("float")
                        .HasColumnName("Height");

                    b.Property<int>("Image1Height")
                        .HasColumnType("int")
                        .HasColumnName("Image1Height");

                    b.Property<int>("Image1Width")
                        .HasColumnType("int")
                        .HasColumnName("Image1Width");

                    b.Property<int>("Image2Height")
                        .HasColumnType("int")
                        .HasColumnName("Image2Height");

                    b.Property<int>("Image2Width")
                        .HasColumnType("int")
                        .HasColumnName("Image2Width");

                    b.Property<Guid>("MapId")
                        .HasColumnType("uniqueidentifier")
                        .HasColumnName("MapId");

                    b.Property<string>("Name")
                        .HasColumnType("nvarchar(64)")
                        .HasColumnName("Name");

                    b.Property<double>("Width")
                        .HasColumnType("float")
                        .HasColumnName("Width");

                    b.HasKey("Id");

                    b.HasIndex(new[] { "MapId", "Name" }, "IX_ElementModel_MapId_Name");

                    b.ToTable("ElementModels");
                });

            modelBuilder.Entity("RobotNet.MapManager.Data.Map", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("uniqueidentifier")
                        .HasColumnName("Id");

                    b.Property<bool>("Active")
                        .HasColumnType("bit")
                        .HasColumnName("Active");

                    b.Property<string>("Description")
                        .HasColumnType("ntext")
                        .HasColumnName("Description");

                    b.Property<double>("EdgeAllowedDeviationThetaDefault")
                        .HasColumnType("float")
                        .HasColumnName("EdgeAllowedDeviationThetaDefault");

                    b.Property<double>("EdgeAllowedDeviationXyDefault")
                        .HasColumnType("float")
                        .HasColumnName("EdgeAllowedDeviationXyDefault");

                    b.Property<double>("EdgeCurveMaxSpeedDefault")
                        .HasColumnType("float")
                        .HasColumnName("EdgeCurveMaxSpeedDefault");

                    b.Property<byte>("EdgeDirectionAllowedDefault")
                        .HasColumnType("tinyint")
                        .HasColumnName("EdgeDirectionAllowedDefault");

                    b.Property<double>("EdgeMaxHeightDefault")
                        .HasColumnType("float")
                        .HasColumnName("EdgeMaxHeightDefault");

                    b.Property<double>("EdgeMaxRotationSpeedDefault")
                        .HasColumnType("float")
                        .HasColumnName("EdgeMaxRoataionSpeedDefault");

                    b.Property<double>("EdgeMinHeightDefault")
                        .HasColumnType("float")
                        .HasColumnName("EdgeMinHeightDefault");

                    b.Property<double>("EdgeMinLengthDefault")
                        .HasColumnType("float")
                        .HasColumnName("EdgeMinLengthDefault");

                    b.Property<bool>("EdgeRotationAllowedDefault")
                        .HasColumnType("bit")
                        .HasColumnName("EdgeRotationAllowedDefault");

                    b.Property<double>("EdgeStraightMaxSpeedDefault")
                        .HasColumnType("float")
                        .HasColumnName("EdgeStraightMaxSpeedDefault");

                    b.Property<double>("ImageHeight")
                        .HasColumnType("float")
                        .HasColumnName("ImageHeight");

                    b.Property<double>("ImageWidth")
                        .HasColumnType("float")
                        .HasColumnName("ImageWidth");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasColumnType("nvarchar(64)")
                        .HasColumnName("Name");

                    b.Property<double>("NodeAllowedDeviationThetaDefault")
                        .HasColumnType("float")
                        .HasColumnName("NodeAllowedDeviationThetaDefault");

                    b.Property<double>("NodeAllowedDeviationXyDefault")
                        .HasColumnType("float")
                        .HasColumnName("NodeAllowedDeviationXyDefault");

                    b.Property<long>("NodeCount")
                        .HasColumnType("BigInt")
                        .HasColumnName("NodeCount");

                    b.Property<bool>("NodeNameAutoGenerate")
                        .HasColumnType("bit")
                        .HasColumnName("NodeNameAutoGenerate");

                    b.Property<string>("NodeNameTemplateDefault")
                        .HasColumnType("nvarchar(64)")
                        .HasColumnName("NodeNameTemplateDefault");

                    b.Property<double>("OriginX")
                        .HasColumnType("float")
                        .HasColumnName("OriginX");

                    b.Property<double>("OriginY")
                        .HasColumnType("float")
                        .HasColumnName("OriginY");

                    b.Property<double>("Resolution")
                        .HasColumnType("float")
                        .HasColumnName("Resolution");

                    b.Property<string>("VDA5050")
                        .HasColumnType("nvarchar(max)")
                        .HasColumnName("VDA5050");

                    b.Property<Guid>("VersionId")
                        .HasColumnType("uniqueidentifier")
                        .HasColumnName("VersionId");

                    b.Property<double>("ViewHeight")
                        .HasColumnType("float")
                        .HasColumnName("ViewHeight");

                    b.Property<double>("ViewWidth")
                        .HasColumnType("float")
                        .HasColumnName("ViewWidth");

                    b.Property<double>("ViewX")
                        .HasColumnType("float")
                        .HasColumnName("ViewX");

                    b.Property<double>("ViewY")
                        .HasColumnType("float")
                        .HasColumnName("ViewY");

                    b.Property<double>("ZoneMinSquareDefault")
                        .HasColumnType("float")
                        .HasColumnName("ZoneMinSquareDefault");

                    b.HasKey("Id");

                    b.ToTable("Maps");
                });

            modelBuilder.Entity("RobotNet.MapManager.Data.Node", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("uniqueidentifier")
                        .HasColumnName("Id");

                    b.Property<string>("Actions")
                        .HasColumnType("nvarchar(max)")
                        .HasColumnName("Actions");

                    b.Property<double>("AllowedDeviationTheta")
                        .HasColumnType("float")
                        .HasColumnName("AllowedDeviationTheta");

                    b.Property<double>("AllowedDeviationXy")
                        .HasColumnType("float")
                        .HasColumnName("AllowedDeviationXy");

                    b.Property<Guid>("MapId")
                        .HasColumnType("uniqueidentifier")
                        .HasColumnName("MapId");

                    b.Property<string>("Name")
                        .HasColumnType("nvarchar(64)")
                        .HasColumnName("Name");

                    b.Property<double>("Theta")
                        .HasColumnType("float")
                        .HasColumnName("Theta");

                    b.Property<double>("X")
                        .HasColumnType("float")
                        .HasColumnName("X");

                    b.Property<double>("Y")
                        .HasColumnType("float")
                        .HasColumnName("Y");

                    b.HasKey("Id");

                    b.HasIndex(new[] { "MapId", "Name" }, "IX_Node_MapId_Name");

                    b.ToTable("Nodes");
                });

            modelBuilder.Entity("RobotNet.MapManager.Data.Zone", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("uniqueidentifier")
                        .HasColumnName("Id");

                    b.Property<Guid>("MapId")
                        .HasColumnType("uniqueidentifier")
                        .HasColumnName("MapId");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasColumnType("nvarchar(64)")
                        .HasColumnName("Name");

                    b.Property<int>("Type")
                        .HasColumnType("int")
                        .HasColumnName("Type");

                    b.Property<double>("X1")
                        .HasColumnType("float")
                        .HasColumnName("X1");

                    b.Property<double>("X2")
                        .HasColumnType("float")
                        .HasColumnName("X2");

                    b.Property<double>("X3")
                        .HasColumnType("float")
                        .HasColumnName("X3");

                    b.Property<double>("X4")
                        .HasColumnType("float")
                        .HasColumnName("X4");

                    b.Property<double>("Y1")
                        .HasColumnType("float")
                        .HasColumnName("Y1");

                    b.Property<double>("Y2")
                        .HasColumnType("float")
                        .HasColumnName("Y2");

                    b.Property<double>("Y3")
                        .HasColumnType("float")
                        .HasColumnName("Y3");

                    b.Property<double>("Y4")
                        .HasColumnType("float")
                        .HasColumnName("Y4");

                    b.HasKey("Id");

                    b.HasIndex(new[] { "MapId" }, "IX_Zone_MapId");

                    b.ToTable("Zones");
                });

            modelBuilder.Entity("RobotNet.MapManager.Data.Action", b =>
                {
                    b.HasOne("RobotNet.MapManager.Data.Map", "Map")
                        .WithMany("Actions")
                        .HasForeignKey("MapId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.Navigation("Map");
                });

            modelBuilder.Entity("RobotNet.MapManager.Data.Edge", b =>
                {
                    b.HasOne("RobotNet.MapManager.Data.Node", "EndNode")
                        .WithMany("EndEdges")
                        .HasForeignKey("EndNodeId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.HasOne("RobotNet.MapManager.Data.Map", "Map")
                        .WithMany("Edges")
                        .HasForeignKey("MapId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.HasOne("RobotNet.MapManager.Data.Node", "StartNode")
                        .WithMany("StartEdges")
                        .HasForeignKey("StartNodeId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.Navigation("EndNode");

                    b.Navigation("Map");

                    b.Navigation("StartNode");
                });

            modelBuilder.Entity("RobotNet.MapManager.Data.Element", b =>
                {
                    b.HasOne("RobotNet.MapManager.Data.Map", "Map")
                        .WithMany("Elements")
                        .HasForeignKey("MapId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.HasOne("RobotNet.MapManager.Data.ElementModel", "Model")
                        .WithMany("Elements")
                        .HasForeignKey("ModelId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.HasOne("RobotNet.MapManager.Data.Node", "Node")
                        .WithOne("Element")
                        .HasForeignKey("RobotNet.MapManager.Data.Element", "NodeId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.Navigation("Map");

                    b.Navigation("Model");

                    b.Navigation("Node");
                });

            modelBuilder.Entity("RobotNet.MapManager.Data.ElementModel", b =>
                {
                    b.HasOne("RobotNet.MapManager.Data.Map", "Map")
                        .WithMany("ElementModels")
                        .HasForeignKey("MapId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.Navigation("Map");
                });

            modelBuilder.Entity("RobotNet.MapManager.Data.Node", b =>
                {
                    b.HasOne("RobotNet.MapManager.Data.Map", "Map")
                        .WithMany("Nodes")
                        .HasForeignKey("MapId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.Navigation("Map");
                });

            modelBuilder.Entity("RobotNet.MapManager.Data.Zone", b =>
                {
                    b.HasOne("RobotNet.MapManager.Data.Map", "Map")
                        .WithMany("Zones")
                        .HasForeignKey("MapId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.Navigation("Map");
                });

            modelBuilder.Entity("RobotNet.MapManager.Data.ElementModel", b =>
                {
                    b.Navigation("Elements");
                });

            modelBuilder.Entity("RobotNet.MapManager.Data.Map", b =>
                {
                    b.Navigation("Actions");

                    b.Navigation("Edges");

                    b.Navigation("ElementModels");

                    b.Navigation("Elements");

                    b.Navigation("Nodes");

                    b.Navigation("Zones");
                });

            modelBuilder.Entity("RobotNet.MapManager.Data.Node", b =>
                {
                    b.Navigation("Element");

                    b.Navigation("EndEdges");

                    b.Navigation("StartEdges");
                });
#pragma warning restore 612, 618
        }
    }
}
