diff --git a/backend/api/Migrations/20230727135235_AddErrorReasonAndDescription.Designer.cs b/backend/api/Migrations/20230727135235_AddErrorReasonAndDescription.Designer.cs
new file mode 100644
index 000000000..f2df25dc8
--- /dev/null
+++ b/backend/api/Migrations/20230727135235_AddErrorReasonAndDescription.Designer.cs
@@ -0,0 +1,1153 @@
+//
+using System;
+using Api.Database.Context;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Metadata;
+using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+
+#nullable disable
+
+namespace Api.Migrations
+{
+ [DbContext(typeof(FlotillaDbContext))]
+ [Migration("20230727135235_AddErrorReasonAndDescription")]
+ partial class AddErrorReasonAndDescription
+ {
+ ///
+ protected override void BuildTargetModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder
+ .HasAnnotation("ProductVersion", "7.0.8")
+ .HasAnnotation("Relational:MaxIdentifierLength", 128);
+
+ SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
+
+ modelBuilder.Entity("Api.Database.Models.Area", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("nvarchar(450)");
+
+ b.Property("DeckId")
+ .IsRequired()
+ .HasColumnType("nvarchar(450)");
+
+ b.Property("InstallationId")
+ .IsRequired()
+ .HasColumnType("nvarchar(450)");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("nvarchar(200)");
+
+ b.Property("PlantId")
+ .IsRequired()
+ .HasColumnType("nvarchar(450)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("DeckId");
+
+ b.HasIndex("InstallationId");
+
+ b.HasIndex("PlantId");
+
+ b.ToTable("Areas");
+ });
+
+ modelBuilder.Entity("Api.Database.Models.AssetDeck", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("nvarchar(450)");
+
+ b.Property("AssetCode")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("nvarchar(200)");
+
+ b.Property("DeckName")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("nvarchar(200)");
+
+ b.HasKey("Id");
+
+ b.ToTable("AssetDecks");
+ });
+
+ modelBuilder.Entity("Api.Database.Models.Deck", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("nvarchar(450)");
+
+ b.Property("InstallationId")
+ .HasColumnType("nvarchar(450)");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("nvarchar(200)");
+
+ b.Property("PlantId")
+ .HasColumnType("nvarchar(450)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("InstallationId");
+
+ b.HasIndex("PlantId");
+
+ b.ToTable("Decks");
+ });
+
+ modelBuilder.Entity("Api.Database.Models.Installation", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("nvarchar(450)");
+
+ b.Property("InstallationCode")
+ .IsRequired()
+ .HasMaxLength(10)
+ .HasColumnType("nvarchar(10)");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("nvarchar(200)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("InstallationCode")
+ .IsUnique();
+
+ b.ToTable("Installations");
+ });
+
+ modelBuilder.Entity("Api.Database.Models.MissionDefinition", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("nvarchar(450)");
+
+ b.Property("AreaId")
+ .HasColumnType("nvarchar(450)");
+
+ b.Property("Comment")
+ .HasMaxLength(1000)
+ .HasColumnType("nvarchar(1000)");
+
+ b.Property("InspectionFrequency")
+ .HasColumnType("time");
+
+ b.Property("InstallationCode")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("IsDeprecated")
+ .HasColumnType("bit");
+
+ b.Property("LastRunId")
+ .HasColumnType("nvarchar(450)");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("nvarchar(200)");
+
+ b.Property("SourceId")
+ .IsRequired()
+ .HasColumnType("nvarchar(450)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("AreaId");
+
+ b.HasIndex("LastRunId");
+
+ b.HasIndex("SourceId");
+
+ b.ToTable("MissionDefinitions");
+ });
+
+ modelBuilder.Entity("Api.Database.Models.MissionRun", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("nvarchar(450)");
+
+ b.Property("AreaId")
+ .HasColumnType("nvarchar(450)");
+
+ b.Property("Comment")
+ .HasMaxLength(1000)
+ .HasColumnType("nvarchar(1000)");
+
+ b.Property("Description")
+ .HasMaxLength(450)
+ .HasColumnType("nvarchar(450)");
+
+ b.Property("DesiredStartTime")
+ .HasColumnType("datetimeoffset");
+
+ b.Property("EndTime")
+ .HasColumnType("datetimeoffset");
+
+ b.Property("ErrorDescription")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("ErrorReason")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("EstimatedDuration")
+ .HasColumnType("bigint");
+
+ b.Property("InstallationCode")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("nvarchar(200)");
+
+ b.Property("IsarMissionId")
+ .HasMaxLength(200)
+ .HasColumnType("nvarchar(200)");
+
+ b.Property("MissionId")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("nvarchar(200)");
+
+ b.Property("RobotId")
+ .IsRequired()
+ .HasColumnType("nvarchar(450)");
+
+ b.Property("StartTime")
+ .HasColumnType("datetimeoffset");
+
+ b.Property("Status")
+ .HasColumnType("int");
+
+ b.Property("StatusReason")
+ .HasMaxLength(450)
+ .HasColumnType("nvarchar(450)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("AreaId");
+
+ b.HasIndex("RobotId");
+
+ b.ToTable("MissionRuns");
+ });
+
+ modelBuilder.Entity("Api.Database.Models.Plant", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("nvarchar(450)");
+
+ b.Property("InstallationId")
+ .HasColumnType("nvarchar(450)");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("nvarchar(200)");
+
+ b.Property("PlantCode")
+ .IsRequired()
+ .HasMaxLength(10)
+ .HasColumnType("nvarchar(10)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("InstallationId");
+
+ b.HasIndex("PlantCode")
+ .IsUnique();
+
+ b.ToTable("Plants");
+ });
+
+ modelBuilder.Entity("Api.Database.Models.Robot", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("nvarchar(450)");
+
+ b.Property("BatteryLevel")
+ .HasColumnType("real");
+
+ b.Property("CurrentAreaId")
+ .HasColumnType("nvarchar(450)");
+
+ b.Property("CurrentInstallation")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("CurrentMissionId")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Enabled")
+ .HasColumnType("bit");
+
+ b.Property("Host")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("nvarchar(200)");
+
+ b.Property("IsarId")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("nvarchar(200)");
+
+ b.Property("ModelId")
+ .IsRequired()
+ .HasColumnType("nvarchar(450)");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("nvarchar(200)");
+
+ b.Property("Port")
+ .HasColumnType("int");
+
+ b.Property("PressureLevel")
+ .HasColumnType("real");
+
+ b.Property("SerialNumber")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("nvarchar(200)");
+
+ b.Property("Status")
+ .HasColumnType("int");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CurrentAreaId");
+
+ b.HasIndex("ModelId");
+
+ b.ToTable("Robots");
+ });
+
+ modelBuilder.Entity("Api.Database.Models.RobotModel", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("nvarchar(450)");
+
+ b.Property("AverageDurationPerTag")
+ .HasColumnType("real");
+
+ b.Property("BatteryWarningThreshold")
+ .HasColumnType("real");
+
+ b.Property("LowerPressureWarningThreshold")
+ .HasColumnType("real");
+
+ b.Property("Type")
+ .IsRequired()
+ .HasColumnType("nvarchar(56)");
+
+ b.Property("UpperPressureWarningThreshold")
+ .HasColumnType("real");
+
+ b.HasKey("Id");
+
+ b.HasIndex("Type")
+ .IsUnique();
+
+ b.ToTable("RobotModels");
+ });
+
+ modelBuilder.Entity("Api.Database.Models.SafePosition", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("nvarchar(450)");
+
+ b.Property("AreaId")
+ .HasColumnType("nvarchar(450)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("AreaId");
+
+ b.ToTable("SafePositions");
+ });
+
+ modelBuilder.Entity("Api.Database.Models.Source", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("nvarchar(450)");
+
+ b.Property("SourceId")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Type")
+ .HasColumnType("int");
+
+ b.HasKey("Id");
+
+ b.ToTable("Sources");
+ });
+
+ modelBuilder.Entity("Api.Database.Models.Area", b =>
+ {
+ b.HasOne("Api.Database.Models.Deck", "Deck")
+ .WithMany()
+ .HasForeignKey("DeckId")
+ .OnDelete(DeleteBehavior.Restrict)
+ .IsRequired();
+
+ b.HasOne("Api.Database.Models.Installation", "Installation")
+ .WithMany()
+ .HasForeignKey("InstallationId")
+ .OnDelete(DeleteBehavior.Restrict)
+ .IsRequired();
+
+ b.HasOne("Api.Database.Models.Plant", "Plant")
+ .WithMany()
+ .HasForeignKey("PlantId")
+ .OnDelete(DeleteBehavior.Restrict)
+ .IsRequired();
+
+ b.OwnsOne("Api.Database.Models.Pose", "DefaultLocalizationPose", b1 =>
+ {
+ b1.Property("AreaId")
+ .HasColumnType("nvarchar(450)");
+
+ b1.HasKey("AreaId");
+
+ b1.ToTable("Areas");
+
+ b1.WithOwner()
+ .HasForeignKey("AreaId");
+
+ b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 =>
+ {
+ b2.Property("PoseAreaId")
+ .HasColumnType("nvarchar(450)");
+
+ b2.Property("W")
+ .HasColumnType("real");
+
+ b2.Property("X")
+ .HasColumnType("real");
+
+ b2.Property("Y")
+ .HasColumnType("real");
+
+ b2.Property("Z")
+ .HasColumnType("real");
+
+ b2.HasKey("PoseAreaId");
+
+ b2.ToTable("Areas");
+
+ b2.WithOwner()
+ .HasForeignKey("PoseAreaId");
+ });
+
+ b1.OwnsOne("Api.Database.Models.Position", "Position", b2 =>
+ {
+ b2.Property("PoseAreaId")
+ .HasColumnType("nvarchar(450)");
+
+ b2.Property("X")
+ .HasColumnType("real");
+
+ b2.Property("Y")
+ .HasColumnType("real");
+
+ b2.Property("Z")
+ .HasColumnType("real");
+
+ b2.HasKey("PoseAreaId");
+
+ b2.ToTable("Areas");
+
+ b2.WithOwner()
+ .HasForeignKey("PoseAreaId");
+ });
+
+ b1.Navigation("Orientation")
+ .IsRequired();
+
+ b1.Navigation("Position")
+ .IsRequired();
+ });
+
+ b.OwnsOne("Api.Database.Models.MapMetadata", "MapMetadata", b1 =>
+ {
+ b1.Property("AreaId")
+ .HasColumnType("nvarchar(450)");
+
+ b1.Property("MapName")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("nvarchar(200)");
+
+ b1.HasKey("AreaId");
+
+ b1.ToTable("Areas");
+
+ b1.WithOwner()
+ .HasForeignKey("AreaId");
+
+ b1.OwnsOne("Api.Database.Models.Boundary", "Boundary", b2 =>
+ {
+ b2.Property("MapMetadataAreaId")
+ .HasColumnType("nvarchar(450)");
+
+ b2.Property("X1")
+ .HasColumnType("float");
+
+ b2.Property("X2")
+ .HasColumnType("float");
+
+ b2.Property("Y1")
+ .HasColumnType("float");
+
+ b2.Property("Y2")
+ .HasColumnType("float");
+
+ b2.Property("Z1")
+ .HasColumnType("float");
+
+ b2.Property("Z2")
+ .HasColumnType("float");
+
+ b2.HasKey("MapMetadataAreaId");
+
+ b2.ToTable("Areas");
+
+ b2.WithOwner()
+ .HasForeignKey("MapMetadataAreaId");
+ });
+
+ b1.OwnsOne("Api.Database.Models.TransformationMatrices", "TransformationMatrices", b2 =>
+ {
+ b2.Property("MapMetadataAreaId")
+ .HasColumnType("nvarchar(450)");
+
+ b2.Property("C1")
+ .HasColumnType("float");
+
+ b2.Property("C2")
+ .HasColumnType("float");
+
+ b2.Property("D1")
+ .HasColumnType("float");
+
+ b2.Property("D2")
+ .HasColumnType("float");
+
+ b2.HasKey("MapMetadataAreaId");
+
+ b2.ToTable("Areas");
+
+ b2.WithOwner()
+ .HasForeignKey("MapMetadataAreaId");
+ });
+
+ b1.Navigation("Boundary")
+ .IsRequired();
+
+ b1.Navigation("TransformationMatrices")
+ .IsRequired();
+ });
+
+ b.Navigation("Deck");
+
+ b.Navigation("DefaultLocalizationPose")
+ .IsRequired();
+
+ b.Navigation("Installation");
+
+ b.Navigation("MapMetadata")
+ .IsRequired();
+
+ b.Navigation("Plant");
+ });
+
+ modelBuilder.Entity("Api.Database.Models.Deck", b =>
+ {
+ b.HasOne("Api.Database.Models.Installation", "Installation")
+ .WithMany()
+ .HasForeignKey("InstallationId")
+ .OnDelete(DeleteBehavior.Restrict);
+
+ b.HasOne("Api.Database.Models.Plant", "Plant")
+ .WithMany()
+ .HasForeignKey("PlantId")
+ .OnDelete(DeleteBehavior.Restrict);
+
+ b.Navigation("Installation");
+
+ b.Navigation("Plant");
+ });
+
+ modelBuilder.Entity("Api.Database.Models.MissionDefinition", b =>
+ {
+ b.HasOne("Api.Database.Models.Area", "Area")
+ .WithMany()
+ .HasForeignKey("AreaId");
+
+ b.HasOne("Api.Database.Models.MissionRun", "LastRun")
+ .WithMany()
+ .HasForeignKey("LastRunId");
+
+ b.HasOne("Api.Database.Models.Source", "Source")
+ .WithMany()
+ .HasForeignKey("SourceId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("Area");
+
+ b.Navigation("LastRun");
+
+ b.Navigation("Source");
+ });
+
+ modelBuilder.Entity("Api.Database.Models.MissionRun", b =>
+ {
+ b.HasOne("Api.Database.Models.Area", "Area")
+ .WithMany()
+ .HasForeignKey("AreaId");
+
+ b.HasOne("Api.Database.Models.Robot", "Robot")
+ .WithMany()
+ .HasForeignKey("RobotId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.OwnsOne("Api.Database.Models.MapMetadata", "MapMetadata", b1 =>
+ {
+ b1.Property("MissionRunId")
+ .HasColumnType("nvarchar(450)");
+
+ b1.Property("MapName")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("nvarchar(200)");
+
+ b1.HasKey("MissionRunId");
+
+ b1.ToTable("MissionRuns");
+
+ b1.WithOwner()
+ .HasForeignKey("MissionRunId");
+
+ b1.OwnsOne("Api.Database.Models.Boundary", "Boundary", b2 =>
+ {
+ b2.Property("MapMetadataMissionRunId")
+ .HasColumnType("nvarchar(450)");
+
+ b2.Property("X1")
+ .HasColumnType("float");
+
+ b2.Property("X2")
+ .HasColumnType("float");
+
+ b2.Property("Y1")
+ .HasColumnType("float");
+
+ b2.Property("Y2")
+ .HasColumnType("float");
+
+ b2.Property("Z1")
+ .HasColumnType("float");
+
+ b2.Property("Z2")
+ .HasColumnType("float");
+
+ b2.HasKey("MapMetadataMissionRunId");
+
+ b2.ToTable("MissionRuns");
+
+ b2.WithOwner()
+ .HasForeignKey("MapMetadataMissionRunId");
+ });
+
+ b1.OwnsOne("Api.Database.Models.TransformationMatrices", "TransformationMatrices", b2 =>
+ {
+ b2.Property("MapMetadataMissionRunId")
+ .HasColumnType("nvarchar(450)");
+
+ b2.Property("C1")
+ .HasColumnType("float");
+
+ b2.Property("C2")
+ .HasColumnType("float");
+
+ b2.Property("D1")
+ .HasColumnType("float");
+
+ b2.Property("D2")
+ .HasColumnType("float");
+
+ b2.HasKey("MapMetadataMissionRunId");
+
+ b2.ToTable("MissionRuns");
+
+ b2.WithOwner()
+ .HasForeignKey("MapMetadataMissionRunId");
+ });
+
+ b1.Navigation("Boundary")
+ .IsRequired();
+
+ b1.Navigation("TransformationMatrices")
+ .IsRequired();
+ });
+
+ b.OwnsMany("Api.Database.Models.MissionTask", "Tasks", b1 =>
+ {
+ b1.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("nvarchar(450)");
+
+ b1.Property("Description")
+ .HasMaxLength(500)
+ .HasColumnType("nvarchar(500)");
+
+ b1.Property("EchoPoseId")
+ .HasColumnType("int");
+
+ b1.Property("EchoTagLink")
+ .HasMaxLength(200)
+ .HasColumnType("nvarchar(200)");
+
+ b1.Property("EndTime")
+ .HasColumnType("datetimeoffset");
+
+ b1.Property("ErrorDescription")
+ .HasColumnType("nvarchar(max)");
+
+ b1.Property("ErrorReason")
+ .HasColumnType("nvarchar(max)");
+
+ b1.Property("IsarTaskId")
+ .HasMaxLength(200)
+ .HasColumnType("nvarchar(200)");
+
+ b1.Property("MissionRunId")
+ .IsRequired()
+ .HasColumnType("nvarchar(450)");
+
+ b1.Property("StartTime")
+ .HasColumnType("datetimeoffset");
+
+ b1.Property("Status")
+ .HasColumnType("int");
+
+ b1.Property("TagId")
+ .HasMaxLength(200)
+ .HasColumnType("nvarchar(200)");
+
+ b1.Property("TaskOrder")
+ .HasColumnType("int");
+
+ b1.HasKey("Id");
+
+ b1.HasIndex("MissionRunId");
+
+ b1.ToTable("MissionTask");
+
+ b1.WithOwner()
+ .HasForeignKey("MissionRunId");
+
+ b1.OwnsMany("Api.Database.Models.Inspection", "Inspections", b2 =>
+ {
+ b2.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("nvarchar(450)");
+
+ b2.Property("AnalysisTypes")
+ .HasMaxLength(250)
+ .HasColumnType("nvarchar(250)");
+
+ b2.Property("EndTime")
+ .HasColumnType("datetimeoffset");
+
+ b2.Property("ErrorDescription")
+ .HasColumnType("nvarchar(max)");
+
+ b2.Property("ErrorReason")
+ .HasColumnType("nvarchar(max)");
+
+ b2.Property("InspectionType")
+ .HasColumnType("int");
+
+ b2.Property("InspectionUrl")
+ .HasMaxLength(250)
+ .HasColumnType("nvarchar(250)");
+
+ b2.Property("IsarStepId")
+ .HasMaxLength(200)
+ .HasColumnType("nvarchar(200)");
+
+ b2.Property("MissionTaskId")
+ .IsRequired()
+ .HasColumnType("nvarchar(450)");
+
+ b2.Property("StartTime")
+ .HasColumnType("datetimeoffset");
+
+ b2.Property("Status")
+ .HasColumnType("int");
+
+ b2.Property("VideoDuration")
+ .HasColumnType("real");
+
+ b2.HasKey("Id");
+
+ b2.HasIndex("MissionTaskId");
+
+ b2.ToTable("Inspection");
+
+ b2.WithOwner()
+ .HasForeignKey("MissionTaskId");
+ });
+
+ b1.OwnsOne("Api.Database.Models.Position", "InspectionTarget", b2 =>
+ {
+ b2.Property("MissionTaskId")
+ .HasColumnType("nvarchar(450)");
+
+ b2.Property("X")
+ .HasColumnType("real");
+
+ b2.Property("Y")
+ .HasColumnType("real");
+
+ b2.Property("Z")
+ .HasColumnType("real");
+
+ b2.HasKey("MissionTaskId");
+
+ b2.ToTable("MissionTask");
+
+ b2.WithOwner()
+ .HasForeignKey("MissionTaskId");
+ });
+
+ b1.OwnsOne("Api.Database.Models.Pose", "RobotPose", b2 =>
+ {
+ b2.Property("MissionTaskId")
+ .HasColumnType("nvarchar(450)");
+
+ b2.HasKey("MissionTaskId");
+
+ b2.ToTable("MissionTask");
+
+ b2.WithOwner()
+ .HasForeignKey("MissionTaskId");
+
+ b2.OwnsOne("Api.Database.Models.Orientation", "Orientation", b3 =>
+ {
+ b3.Property("PoseMissionTaskId")
+ .HasColumnType("nvarchar(450)");
+
+ b3.Property("W")
+ .HasColumnType("real");
+
+ b3.Property("X")
+ .HasColumnType("real");
+
+ b3.Property("Y")
+ .HasColumnType("real");
+
+ b3.Property("Z")
+ .HasColumnType("real");
+
+ b3.HasKey("PoseMissionTaskId");
+
+ b3.ToTable("MissionTask");
+
+ b3.WithOwner()
+ .HasForeignKey("PoseMissionTaskId");
+ });
+
+ b2.OwnsOne("Api.Database.Models.Position", "Position", b3 =>
+ {
+ b3.Property("PoseMissionTaskId")
+ .HasColumnType("nvarchar(450)");
+
+ b3.Property("X")
+ .HasColumnType("real");
+
+ b3.Property("Y")
+ .HasColumnType("real");
+
+ b3.Property("Z")
+ .HasColumnType("real");
+
+ b3.HasKey("PoseMissionTaskId");
+
+ b3.ToTable("MissionTask");
+
+ b3.WithOwner()
+ .HasForeignKey("PoseMissionTaskId");
+ });
+
+ b2.Navigation("Orientation")
+ .IsRequired();
+
+ b2.Navigation("Position")
+ .IsRequired();
+ });
+
+ b1.Navigation("InspectionTarget")
+ .IsRequired();
+
+ b1.Navigation("Inspections");
+
+ b1.Navigation("RobotPose")
+ .IsRequired();
+ });
+
+ b.Navigation("Area");
+
+ b.Navigation("MapMetadata");
+
+ b.Navigation("Robot");
+
+ b.Navigation("Tasks");
+ });
+
+ modelBuilder.Entity("Api.Database.Models.Plant", b =>
+ {
+ b.HasOne("Api.Database.Models.Installation", "Installation")
+ .WithMany()
+ .HasForeignKey("InstallationId")
+ .OnDelete(DeleteBehavior.Restrict);
+
+ b.Navigation("Installation");
+ });
+
+ modelBuilder.Entity("Api.Database.Models.Robot", b =>
+ {
+ b.HasOne("Api.Database.Models.Area", "CurrentArea")
+ .WithMany()
+ .HasForeignKey("CurrentAreaId");
+
+ b.HasOne("Api.Database.Models.RobotModel", "Model")
+ .WithMany()
+ .HasForeignKey("ModelId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.OwnsOne("Api.Database.Models.Pose", "Pose", b1 =>
+ {
+ b1.Property("RobotId")
+ .HasColumnType("nvarchar(450)");
+
+ b1.HasKey("RobotId");
+
+ b1.ToTable("Robots");
+
+ b1.WithOwner()
+ .HasForeignKey("RobotId");
+
+ b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 =>
+ {
+ b2.Property("PoseRobotId")
+ .HasColumnType("nvarchar(450)");
+
+ b2.Property("W")
+ .HasColumnType("real");
+
+ b2.Property("X")
+ .HasColumnType("real");
+
+ b2.Property("Y")
+ .HasColumnType("real");
+
+ b2.Property("Z")
+ .HasColumnType("real");
+
+ b2.HasKey("PoseRobotId");
+
+ b2.ToTable("Robots");
+
+ b2.WithOwner()
+ .HasForeignKey("PoseRobotId");
+ });
+
+ b1.OwnsOne("Api.Database.Models.Position", "Position", b2 =>
+ {
+ b2.Property("PoseRobotId")
+ .HasColumnType("nvarchar(450)");
+
+ b2.Property("X")
+ .HasColumnType("real");
+
+ b2.Property("Y")
+ .HasColumnType("real");
+
+ b2.Property("Z")
+ .HasColumnType("real");
+
+ b2.HasKey("PoseRobotId");
+
+ b2.ToTable("Robots");
+
+ b2.WithOwner()
+ .HasForeignKey("PoseRobotId");
+ });
+
+ b1.Navigation("Orientation")
+ .IsRequired();
+
+ b1.Navigation("Position")
+ .IsRequired();
+ });
+
+ b.OwnsMany("Api.Database.Models.VideoStream", "VideoStreams", b1 =>
+ {
+ b1.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("nvarchar(450)");
+
+ b1.Property("Name")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("nvarchar(200)");
+
+ b1.Property("RobotId")
+ .IsRequired()
+ .HasColumnType("nvarchar(450)");
+
+ b1.Property("ShouldRotate270Clockwise")
+ .HasColumnType("bit");
+
+ b1.Property("Type")
+ .IsRequired()
+ .HasMaxLength(64)
+ .HasColumnType("nvarchar(64)");
+
+ b1.Property("Url")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("nvarchar(200)");
+
+ b1.HasKey("Id");
+
+ b1.HasIndex("RobotId");
+
+ b1.ToTable("VideoStream");
+
+ b1.WithOwner()
+ .HasForeignKey("RobotId");
+ });
+
+ b.Navigation("CurrentArea");
+
+ b.Navigation("Model");
+
+ b.Navigation("Pose")
+ .IsRequired();
+
+ b.Navigation("VideoStreams");
+ });
+
+ modelBuilder.Entity("Api.Database.Models.SafePosition", b =>
+ {
+ b.HasOne("Api.Database.Models.Area", null)
+ .WithMany("SafePositions")
+ .HasForeignKey("AreaId");
+
+ b.OwnsOne("Api.Database.Models.Pose", "Pose", b1 =>
+ {
+ b1.Property("SafePositionId")
+ .HasColumnType("nvarchar(450)");
+
+ b1.HasKey("SafePositionId");
+
+ b1.ToTable("SafePositions");
+
+ b1.WithOwner()
+ .HasForeignKey("SafePositionId");
+
+ b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 =>
+ {
+ b2.Property("PoseSafePositionId")
+ .HasColumnType("nvarchar(450)");
+
+ b2.Property("W")
+ .HasColumnType("real");
+
+ b2.Property("X")
+ .HasColumnType("real");
+
+ b2.Property("Y")
+ .HasColumnType("real");
+
+ b2.Property("Z")
+ .HasColumnType("real");
+
+ b2.HasKey("PoseSafePositionId");
+
+ b2.ToTable("SafePositions");
+
+ b2.WithOwner()
+ .HasForeignKey("PoseSafePositionId");
+ });
+
+ b1.OwnsOne("Api.Database.Models.Position", "Position", b2 =>
+ {
+ b2.Property("PoseSafePositionId")
+ .HasColumnType("nvarchar(450)");
+
+ b2.Property("X")
+ .HasColumnType("real");
+
+ b2.Property("Y")
+ .HasColumnType("real");
+
+ b2.Property("Z")
+ .HasColumnType("real");
+
+ b2.HasKey("PoseSafePositionId");
+
+ b2.ToTable("SafePositions");
+
+ b2.WithOwner()
+ .HasForeignKey("PoseSafePositionId");
+ });
+
+ b1.Navigation("Orientation")
+ .IsRequired();
+
+ b1.Navigation("Position")
+ .IsRequired();
+ });
+
+ b.Navigation("Pose")
+ .IsRequired();
+ });
+
+ modelBuilder.Entity("Api.Database.Models.Area", b =>
+ {
+ b.Navigation("SafePositions");
+ });
+#pragma warning restore 612, 618
+ }
+ }
+}
diff --git a/backend/api/Migrations/20230727135235_AddErrorReasonAndDescription.cs b/backend/api/Migrations/20230727135235_AddErrorReasonAndDescription.cs
new file mode 100644
index 000000000..d9e19ced1
--- /dev/null
+++ b/backend/api/Migrations/20230727135235_AddErrorReasonAndDescription.cs
@@ -0,0 +1,1915 @@
+using Microsoft.EntityFrameworkCore.Migrations;
+
+#nullable disable
+
+namespace Api.Migrations
+{
+ ///
+ public partial class AddErrorReasonAndDescription : Migration
+ {
+ ///
+ protected override void Up(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.DropForeignKey(
+ name: "FK_Area_Deck_DeckId",
+ table: "Area");
+
+ migrationBuilder.DropForeignKey(
+ name: "FK_Area_Installation_InstallationId",
+ table: "Area");
+
+ migrationBuilder.DropForeignKey(
+ name: "FK_Area_Plant_PlantId",
+ table: "Area");
+
+ migrationBuilder.DropForeignKey(
+ name: "FK_Deck_Installation_InstallationId",
+ table: "Deck");
+
+ migrationBuilder.DropForeignKey(
+ name: "FK_Deck_Plant_PlantId",
+ table: "Deck");
+
+ migrationBuilder.DropForeignKey(
+ name: "FK_MissionDefinition_Area_AreaId",
+ table: "MissionDefinition");
+
+ migrationBuilder.DropForeignKey(
+ name: "FK_MissionDefinition_MissionRun_LastRunId",
+ table: "MissionDefinition");
+
+ migrationBuilder.DropForeignKey(
+ name: "FK_MissionDefinition_Source_SourceId",
+ table: "MissionDefinition");
+
+ migrationBuilder.DropForeignKey(
+ name: "FK_MissionRun_Area_AreaId",
+ table: "MissionRun");
+
+ migrationBuilder.DropForeignKey(
+ name: "FK_MissionRun_Robot_RobotId",
+ table: "MissionRun");
+
+ migrationBuilder.DropForeignKey(
+ name: "FK_MissionTask_MissionRun_MissionRunId",
+ table: "MissionTask");
+
+ migrationBuilder.DropForeignKey(
+ name: "FK_Plant_Installation_InstallationId",
+ table: "Plant");
+
+ migrationBuilder.DropForeignKey(
+ name: "FK_Robot_Area_CurrentAreaId",
+ table: "Robot");
+
+ migrationBuilder.DropForeignKey(
+ name: "FK_Robot_RobotModel_ModelId",
+ table: "Robot");
+
+ migrationBuilder.DropForeignKey(
+ name: "FK_SafePosition_Area_AreaId",
+ table: "SafePosition");
+
+ migrationBuilder.DropForeignKey(
+ name: "FK_VideoStream_Robot_RobotId",
+ table: "VideoStream");
+
+ migrationBuilder.DropTable(
+ name: "Area.DefaultLocalizationPose#Pose.Orientation#Orientation");
+
+ migrationBuilder.DropTable(
+ name: "Area.DefaultLocalizationPose#Pose.Position#Position");
+
+ migrationBuilder.DropTable(
+ name: "Area.MapMetadata#MapMetadata.Boundary#Boundary");
+
+ migrationBuilder.DropTable(
+ name: "Area.MapMetadata#MapMetadata.TransformationMatrices#TransformationMatrices");
+
+ migrationBuilder.DropTable(
+ name: "MissionRun.MapMetadata#MapMetadata.Boundary#Boundary");
+
+ migrationBuilder.DropTable(
+ name: "MissionRun.MapMetadata#MapMetadata.TransformationMatrices#TransformationMatrices");
+
+ migrationBuilder.DropTable(
+ name: "MissionTask.InspectionTarget#Position");
+
+ migrationBuilder.DropTable(
+ name: "MissionTask.RobotPose#Pose.Orientation#Orientation");
+
+ migrationBuilder.DropTable(
+ name: "MissionTask.RobotPose#Pose.Position#Position");
+
+ migrationBuilder.DropTable(
+ name: "Robot.Pose#Pose.Orientation#Orientation");
+
+ migrationBuilder.DropTable(
+ name: "Robot.Pose#Pose.Position#Position");
+
+ migrationBuilder.DropTable(
+ name: "SafePosition.Pose#Pose.Orientation#Orientation");
+
+ migrationBuilder.DropTable(
+ name: "SafePosition.Pose#Pose.Position#Position");
+
+ migrationBuilder.DropTable(
+ name: "Area.DefaultLocalizationPose#Pose");
+
+ migrationBuilder.DropTable(
+ name: "Area.MapMetadata#MapMetadata");
+
+ migrationBuilder.DropTable(
+ name: "MissionRun.MapMetadata#MapMetadata");
+
+ migrationBuilder.DropTable(
+ name: "MissionTask.RobotPose#Pose");
+
+ migrationBuilder.DropTable(
+ name: "Robot.Pose#Pose");
+
+ migrationBuilder.DropTable(
+ name: "SafePosition.Pose#Pose");
+
+ migrationBuilder.DropPrimaryKey(
+ name: "PK_Source",
+ table: "Source");
+
+ migrationBuilder.DropPrimaryKey(
+ name: "PK_SafePosition",
+ table: "SafePosition");
+
+ migrationBuilder.DropPrimaryKey(
+ name: "PK_RobotModel",
+ table: "RobotModel");
+
+ migrationBuilder.DropPrimaryKey(
+ name: "PK_Robot",
+ table: "Robot");
+
+ migrationBuilder.DropPrimaryKey(
+ name: "PK_Plant",
+ table: "Plant");
+
+ migrationBuilder.DropPrimaryKey(
+ name: "PK_MissionRun",
+ table: "MissionRun");
+
+ migrationBuilder.DropPrimaryKey(
+ name: "PK_MissionDefinition",
+ table: "MissionDefinition");
+
+ migrationBuilder.DropPrimaryKey(
+ name: "PK_Installation",
+ table: "Installation");
+
+ migrationBuilder.DropPrimaryKey(
+ name: "PK_Deck",
+ table: "Deck");
+
+ migrationBuilder.DropPrimaryKey(
+ name: "PK_AssetDeck",
+ table: "AssetDeck");
+
+ migrationBuilder.DropPrimaryKey(
+ name: "PK_Area",
+ table: "Area");
+
+ migrationBuilder.RenameTable(
+ name: "Source",
+ newName: "Sources");
+
+ migrationBuilder.RenameTable(
+ name: "SafePosition",
+ newName: "SafePositions");
+
+ migrationBuilder.RenameTable(
+ name: "RobotModel",
+ newName: "RobotModels");
+
+ migrationBuilder.RenameTable(
+ name: "Robot",
+ newName: "Robots");
+
+ migrationBuilder.RenameTable(
+ name: "Plant",
+ newName: "Plants");
+
+ migrationBuilder.RenameTable(
+ name: "MissionRun",
+ newName: "MissionRuns");
+
+ migrationBuilder.RenameTable(
+ name: "MissionDefinition",
+ newName: "MissionDefinitions");
+
+ migrationBuilder.RenameTable(
+ name: "Installation",
+ newName: "Installations");
+
+ migrationBuilder.RenameTable(
+ name: "Deck",
+ newName: "Decks");
+
+ migrationBuilder.RenameTable(
+ name: "AssetDeck",
+ newName: "AssetDecks");
+
+ migrationBuilder.RenameTable(
+ name: "Area",
+ newName: "Areas");
+
+ migrationBuilder.RenameIndex(
+ name: "IX_SafePosition_AreaId",
+ table: "SafePositions",
+ newName: "IX_SafePositions_AreaId");
+
+ migrationBuilder.RenameIndex(
+ name: "IX_RobotModel_Type",
+ table: "RobotModels",
+ newName: "IX_RobotModels_Type");
+
+ migrationBuilder.RenameIndex(
+ name: "IX_Robot_ModelId",
+ table: "Robots",
+ newName: "IX_Robots_ModelId");
+
+ migrationBuilder.RenameIndex(
+ name: "IX_Robot_CurrentAreaId",
+ table: "Robots",
+ newName: "IX_Robots_CurrentAreaId");
+
+ migrationBuilder.RenameIndex(
+ name: "IX_Plant_PlantCode",
+ table: "Plants",
+ newName: "IX_Plants_PlantCode");
+
+ migrationBuilder.RenameIndex(
+ name: "IX_Plant_InstallationId",
+ table: "Plants",
+ newName: "IX_Plants_InstallationId");
+
+ migrationBuilder.RenameIndex(
+ name: "IX_MissionRun_RobotId",
+ table: "MissionRuns",
+ newName: "IX_MissionRuns_RobotId");
+
+ migrationBuilder.RenameIndex(
+ name: "IX_MissionRun_AreaId",
+ table: "MissionRuns",
+ newName: "IX_MissionRuns_AreaId");
+
+ migrationBuilder.RenameIndex(
+ name: "IX_MissionDefinition_SourceId",
+ table: "MissionDefinitions",
+ newName: "IX_MissionDefinitions_SourceId");
+
+ migrationBuilder.RenameIndex(
+ name: "IX_MissionDefinition_LastRunId",
+ table: "MissionDefinitions",
+ newName: "IX_MissionDefinitions_LastRunId");
+
+ migrationBuilder.RenameIndex(
+ name: "IX_MissionDefinition_AreaId",
+ table: "MissionDefinitions",
+ newName: "IX_MissionDefinitions_AreaId");
+
+ migrationBuilder.RenameIndex(
+ name: "IX_Installation_InstallationCode",
+ table: "Installations",
+ newName: "IX_Installations_InstallationCode");
+
+ migrationBuilder.RenameIndex(
+ name: "IX_Deck_PlantId",
+ table: "Decks",
+ newName: "IX_Decks_PlantId");
+
+ migrationBuilder.RenameIndex(
+ name: "IX_Deck_InstallationId",
+ table: "Decks",
+ newName: "IX_Decks_InstallationId");
+
+ migrationBuilder.RenameIndex(
+ name: "IX_Area_PlantId",
+ table: "Areas",
+ newName: "IX_Areas_PlantId");
+
+ migrationBuilder.RenameIndex(
+ name: "IX_Area_InstallationId",
+ table: "Areas",
+ newName: "IX_Areas_InstallationId");
+
+ migrationBuilder.RenameIndex(
+ name: "IX_Area_DeckId",
+ table: "Areas",
+ newName: "IX_Areas_DeckId");
+
+ migrationBuilder.AddColumn(
+ name: "ErrorDescription",
+ table: "MissionTask",
+ type: "nvarchar(max)",
+ nullable: true);
+
+ migrationBuilder.AddColumn(
+ name: "ErrorReason",
+ table: "MissionTask",
+ type: "nvarchar(max)",
+ nullable: true);
+
+ migrationBuilder.AddColumn(
+ name: "InspectionTarget_X",
+ table: "MissionTask",
+ type: "real",
+ nullable: false,
+ defaultValue: 0f);
+
+ migrationBuilder.AddColumn(
+ name: "InspectionTarget_Y",
+ table: "MissionTask",
+ type: "real",
+ nullable: false,
+ defaultValue: 0f);
+
+ migrationBuilder.AddColumn(
+ name: "InspectionTarget_Z",
+ table: "MissionTask",
+ type: "real",
+ nullable: false,
+ defaultValue: 0f);
+
+ migrationBuilder.AddColumn(
+ name: "RobotPose_Orientation_W",
+ table: "MissionTask",
+ type: "real",
+ nullable: false,
+ defaultValue: 0f);
+
+ migrationBuilder.AddColumn(
+ name: "RobotPose_Orientation_X",
+ table: "MissionTask",
+ type: "real",
+ nullable: false,
+ defaultValue: 0f);
+
+ migrationBuilder.AddColumn(
+ name: "RobotPose_Orientation_Y",
+ table: "MissionTask",
+ type: "real",
+ nullable: false,
+ defaultValue: 0f);
+
+ migrationBuilder.AddColumn(
+ name: "RobotPose_Orientation_Z",
+ table: "MissionTask",
+ type: "real",
+ nullable: false,
+ defaultValue: 0f);
+
+ migrationBuilder.AddColumn(
+ name: "RobotPose_Position_X",
+ table: "MissionTask",
+ type: "real",
+ nullable: false,
+ defaultValue: 0f);
+
+ migrationBuilder.AddColumn(
+ name: "RobotPose_Position_Y",
+ table: "MissionTask",
+ type: "real",
+ nullable: false,
+ defaultValue: 0f);
+
+ migrationBuilder.AddColumn(
+ name: "RobotPose_Position_Z",
+ table: "MissionTask",
+ type: "real",
+ nullable: false,
+ defaultValue: 0f);
+
+ migrationBuilder.AddColumn(
+ name: "ErrorDescription",
+ table: "Inspection",
+ type: "nvarchar(max)",
+ nullable: true);
+
+ migrationBuilder.AddColumn(
+ name: "ErrorReason",
+ table: "Inspection",
+ type: "nvarchar(max)",
+ nullable: true);
+
+ migrationBuilder.AddColumn(
+ name: "Pose_Orientation_W",
+ table: "SafePositions",
+ type: "real",
+ nullable: false,
+ defaultValue: 0f);
+
+ migrationBuilder.AddColumn(
+ name: "Pose_Orientation_X",
+ table: "SafePositions",
+ type: "real",
+ nullable: false,
+ defaultValue: 0f);
+
+ migrationBuilder.AddColumn(
+ name: "Pose_Orientation_Y",
+ table: "SafePositions",
+ type: "real",
+ nullable: false,
+ defaultValue: 0f);
+
+ migrationBuilder.AddColumn(
+ name: "Pose_Orientation_Z",
+ table: "SafePositions",
+ type: "real",
+ nullable: false,
+ defaultValue: 0f);
+
+ migrationBuilder.AddColumn(
+ name: "Pose_Position_X",
+ table: "SafePositions",
+ type: "real",
+ nullable: false,
+ defaultValue: 0f);
+
+ migrationBuilder.AddColumn(
+ name: "Pose_Position_Y",
+ table: "SafePositions",
+ type: "real",
+ nullable: false,
+ defaultValue: 0f);
+
+ migrationBuilder.AddColumn(
+ name: "Pose_Position_Z",
+ table: "SafePositions",
+ type: "real",
+ nullable: false,
+ defaultValue: 0f);
+
+ migrationBuilder.AddColumn(
+ name: "Pose_Orientation_W",
+ table: "Robots",
+ type: "real",
+ nullable: false,
+ defaultValue: 0f);
+
+ migrationBuilder.AddColumn(
+ name: "Pose_Orientation_X",
+ table: "Robots",
+ type: "real",
+ nullable: false,
+ defaultValue: 0f);
+
+ migrationBuilder.AddColumn(
+ name: "Pose_Orientation_Y",
+ table: "Robots",
+ type: "real",
+ nullable: false,
+ defaultValue: 0f);
+
+ migrationBuilder.AddColumn(
+ name: "Pose_Orientation_Z",
+ table: "Robots",
+ type: "real",
+ nullable: false,
+ defaultValue: 0f);
+
+ migrationBuilder.AddColumn(
+ name: "Pose_Position_X",
+ table: "Robots",
+ type: "real",
+ nullable: false,
+ defaultValue: 0f);
+
+ migrationBuilder.AddColumn(
+ name: "Pose_Position_Y",
+ table: "Robots",
+ type: "real",
+ nullable: false,
+ defaultValue: 0f);
+
+ migrationBuilder.AddColumn(
+ name: "Pose_Position_Z",
+ table: "Robots",
+ type: "real",
+ nullable: false,
+ defaultValue: 0f);
+
+ migrationBuilder.AddColumn(
+ name: "ErrorDescription",
+ table: "MissionRuns",
+ type: "nvarchar(max)",
+ nullable: true);
+
+ migrationBuilder.AddColumn(
+ name: "ErrorReason",
+ table: "MissionRuns",
+ type: "nvarchar(max)",
+ nullable: true);
+
+ migrationBuilder.AddColumn(
+ name: "MapMetadata_Boundary_X1",
+ table: "MissionRuns",
+ type: "float",
+ nullable: true);
+
+ migrationBuilder.AddColumn(
+ name: "MapMetadata_Boundary_X2",
+ table: "MissionRuns",
+ type: "float",
+ nullable: true);
+
+ migrationBuilder.AddColumn(
+ name: "MapMetadata_Boundary_Y1",
+ table: "MissionRuns",
+ type: "float",
+ nullable: true);
+
+ migrationBuilder.AddColumn(
+ name: "MapMetadata_Boundary_Y2",
+ table: "MissionRuns",
+ type: "float",
+ nullable: true);
+
+ migrationBuilder.AddColumn(
+ name: "MapMetadata_Boundary_Z1",
+ table: "MissionRuns",
+ type: "float",
+ nullable: true);
+
+ migrationBuilder.AddColumn(
+ name: "MapMetadata_Boundary_Z2",
+ table: "MissionRuns",
+ type: "float",
+ nullable: true);
+
+ migrationBuilder.AddColumn(
+ name: "MapMetadata_MapName",
+ table: "MissionRuns",
+ type: "nvarchar(200)",
+ maxLength: 200,
+ nullable: true);
+
+ migrationBuilder.AddColumn(
+ name: "MapMetadata_TransformationMatrices_C1",
+ table: "MissionRuns",
+ type: "float",
+ nullable: true);
+
+ migrationBuilder.AddColumn(
+ name: "MapMetadata_TransformationMatrices_C2",
+ table: "MissionRuns",
+ type: "float",
+ nullable: true);
+
+ migrationBuilder.AddColumn(
+ name: "MapMetadata_TransformationMatrices_D1",
+ table: "MissionRuns",
+ type: "float",
+ nullable: true);
+
+ migrationBuilder.AddColumn(
+ name: "MapMetadata_TransformationMatrices_D2",
+ table: "MissionRuns",
+ type: "float",
+ nullable: true);
+
+ migrationBuilder.AddColumn(
+ name: "DefaultLocalizationPose_Orientation_W",
+ table: "Areas",
+ type: "real",
+ nullable: false,
+ defaultValue: 0f);
+
+ migrationBuilder.AddColumn(
+ name: "DefaultLocalizationPose_Orientation_X",
+ table: "Areas",
+ type: "real",
+ nullable: false,
+ defaultValue: 0f);
+
+ migrationBuilder.AddColumn(
+ name: "DefaultLocalizationPose_Orientation_Y",
+ table: "Areas",
+ type: "real",
+ nullable: false,
+ defaultValue: 0f);
+
+ migrationBuilder.AddColumn(
+ name: "DefaultLocalizationPose_Orientation_Z",
+ table: "Areas",
+ type: "real",
+ nullable: false,
+ defaultValue: 0f);
+
+ migrationBuilder.AddColumn(
+ name: "DefaultLocalizationPose_Position_X",
+ table: "Areas",
+ type: "real",
+ nullable: false,
+ defaultValue: 0f);
+
+ migrationBuilder.AddColumn(
+ name: "DefaultLocalizationPose_Position_Y",
+ table: "Areas",
+ type: "real",
+ nullable: false,
+ defaultValue: 0f);
+
+ migrationBuilder.AddColumn(
+ name: "DefaultLocalizationPose_Position_Z",
+ table: "Areas",
+ type: "real",
+ nullable: false,
+ defaultValue: 0f);
+
+ migrationBuilder.AddColumn(
+ name: "MapMetadata_Boundary_X1",
+ table: "Areas",
+ type: "float",
+ nullable: false,
+ defaultValue: 0.0);
+
+ migrationBuilder.AddColumn(
+ name: "MapMetadata_Boundary_X2",
+ table: "Areas",
+ type: "float",
+ nullable: false,
+ defaultValue: 0.0);
+
+ migrationBuilder.AddColumn(
+ name: "MapMetadata_Boundary_Y1",
+ table: "Areas",
+ type: "float",
+ nullable: false,
+ defaultValue: 0.0);
+
+ migrationBuilder.AddColumn(
+ name: "MapMetadata_Boundary_Y2",
+ table: "Areas",
+ type: "float",
+ nullable: false,
+ defaultValue: 0.0);
+
+ migrationBuilder.AddColumn(
+ name: "MapMetadata_Boundary_Z1",
+ table: "Areas",
+ type: "float",
+ nullable: false,
+ defaultValue: 0.0);
+
+ migrationBuilder.AddColumn(
+ name: "MapMetadata_Boundary_Z2",
+ table: "Areas",
+ type: "float",
+ nullable: false,
+ defaultValue: 0.0);
+
+ migrationBuilder.AddColumn(
+ name: "MapMetadata_MapName",
+ table: "Areas",
+ type: "nvarchar(200)",
+ maxLength: 200,
+ nullable: false,
+ defaultValue: "");
+
+ migrationBuilder.AddColumn(
+ name: "MapMetadata_TransformationMatrices_C1",
+ table: "Areas",
+ type: "float",
+ nullable: false,
+ defaultValue: 0.0);
+
+ migrationBuilder.AddColumn(
+ name: "MapMetadata_TransformationMatrices_C2",
+ table: "Areas",
+ type: "float",
+ nullable: false,
+ defaultValue: 0.0);
+
+ migrationBuilder.AddColumn(
+ name: "MapMetadata_TransformationMatrices_D1",
+ table: "Areas",
+ type: "float",
+ nullable: false,
+ defaultValue: 0.0);
+
+ migrationBuilder.AddColumn(
+ name: "MapMetadata_TransformationMatrices_D2",
+ table: "Areas",
+ type: "float",
+ nullable: false,
+ defaultValue: 0.0);
+
+ migrationBuilder.AddPrimaryKey(
+ name: "PK_Sources",
+ table: "Sources",
+ column: "Id");
+
+ migrationBuilder.AddPrimaryKey(
+ name: "PK_SafePositions",
+ table: "SafePositions",
+ column: "Id");
+
+ migrationBuilder.AddPrimaryKey(
+ name: "PK_RobotModels",
+ table: "RobotModels",
+ column: "Id");
+
+ migrationBuilder.AddPrimaryKey(
+ name: "PK_Robots",
+ table: "Robots",
+ column: "Id");
+
+ migrationBuilder.AddPrimaryKey(
+ name: "PK_Plants",
+ table: "Plants",
+ column: "Id");
+
+ migrationBuilder.AddPrimaryKey(
+ name: "PK_MissionRuns",
+ table: "MissionRuns",
+ column: "Id");
+
+ migrationBuilder.AddPrimaryKey(
+ name: "PK_MissionDefinitions",
+ table: "MissionDefinitions",
+ column: "Id");
+
+ migrationBuilder.AddPrimaryKey(
+ name: "PK_Installations",
+ table: "Installations",
+ column: "Id");
+
+ migrationBuilder.AddPrimaryKey(
+ name: "PK_Decks",
+ table: "Decks",
+ column: "Id");
+
+ migrationBuilder.AddPrimaryKey(
+ name: "PK_AssetDecks",
+ table: "AssetDecks",
+ column: "Id");
+
+ migrationBuilder.AddPrimaryKey(
+ name: "PK_Areas",
+ table: "Areas",
+ column: "Id");
+
+ migrationBuilder.AddForeignKey(
+ name: "FK_Areas_Decks_DeckId",
+ table: "Areas",
+ column: "DeckId",
+ principalTable: "Decks",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Restrict);
+
+ migrationBuilder.AddForeignKey(
+ name: "FK_Areas_Installations_InstallationId",
+ table: "Areas",
+ column: "InstallationId",
+ principalTable: "Installations",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Restrict);
+
+ migrationBuilder.AddForeignKey(
+ name: "FK_Areas_Plants_PlantId",
+ table: "Areas",
+ column: "PlantId",
+ principalTable: "Plants",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Restrict);
+
+ migrationBuilder.AddForeignKey(
+ name: "FK_Decks_Installations_InstallationId",
+ table: "Decks",
+ column: "InstallationId",
+ principalTable: "Installations",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Restrict);
+
+ migrationBuilder.AddForeignKey(
+ name: "FK_Decks_Plants_PlantId",
+ table: "Decks",
+ column: "PlantId",
+ principalTable: "Plants",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Restrict);
+
+ migrationBuilder.AddForeignKey(
+ name: "FK_MissionDefinitions_Areas_AreaId",
+ table: "MissionDefinitions",
+ column: "AreaId",
+ principalTable: "Areas",
+ principalColumn: "Id");
+
+ migrationBuilder.AddForeignKey(
+ name: "FK_MissionDefinitions_MissionRuns_LastRunId",
+ table: "MissionDefinitions",
+ column: "LastRunId",
+ principalTable: "MissionRuns",
+ principalColumn: "Id");
+
+ migrationBuilder.AddForeignKey(
+ name: "FK_MissionDefinitions_Sources_SourceId",
+ table: "MissionDefinitions",
+ column: "SourceId",
+ principalTable: "Sources",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Cascade);
+
+ migrationBuilder.AddForeignKey(
+ name: "FK_MissionRuns_Areas_AreaId",
+ table: "MissionRuns",
+ column: "AreaId",
+ principalTable: "Areas",
+ principalColumn: "Id");
+
+ migrationBuilder.AddForeignKey(
+ name: "FK_MissionRuns_Robots_RobotId",
+ table: "MissionRuns",
+ column: "RobotId",
+ principalTable: "Robots",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Cascade);
+
+ migrationBuilder.AddForeignKey(
+ name: "FK_MissionTask_MissionRuns_MissionRunId",
+ table: "MissionTask",
+ column: "MissionRunId",
+ principalTable: "MissionRuns",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Cascade);
+
+ migrationBuilder.AddForeignKey(
+ name: "FK_Plants_Installations_InstallationId",
+ table: "Plants",
+ column: "InstallationId",
+ principalTable: "Installations",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Restrict);
+
+ migrationBuilder.AddForeignKey(
+ name: "FK_Robots_Areas_CurrentAreaId",
+ table: "Robots",
+ column: "CurrentAreaId",
+ principalTable: "Areas",
+ principalColumn: "Id");
+
+ migrationBuilder.AddForeignKey(
+ name: "FK_Robots_RobotModels_ModelId",
+ table: "Robots",
+ column: "ModelId",
+ principalTable: "RobotModels",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Cascade);
+
+ migrationBuilder.AddForeignKey(
+ name: "FK_SafePositions_Areas_AreaId",
+ table: "SafePositions",
+ column: "AreaId",
+ principalTable: "Areas",
+ principalColumn: "Id");
+
+ migrationBuilder.AddForeignKey(
+ name: "FK_VideoStream_Robots_RobotId",
+ table: "VideoStream",
+ column: "RobotId",
+ principalTable: "Robots",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Cascade);
+ }
+
+ ///
+ protected override void Down(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.DropForeignKey(
+ name: "FK_Areas_Decks_DeckId",
+ table: "Areas");
+
+ migrationBuilder.DropForeignKey(
+ name: "FK_Areas_Installations_InstallationId",
+ table: "Areas");
+
+ migrationBuilder.DropForeignKey(
+ name: "FK_Areas_Plants_PlantId",
+ table: "Areas");
+
+ migrationBuilder.DropForeignKey(
+ name: "FK_Decks_Installations_InstallationId",
+ table: "Decks");
+
+ migrationBuilder.DropForeignKey(
+ name: "FK_Decks_Plants_PlantId",
+ table: "Decks");
+
+ migrationBuilder.DropForeignKey(
+ name: "FK_MissionDefinitions_Areas_AreaId",
+ table: "MissionDefinitions");
+
+ migrationBuilder.DropForeignKey(
+ name: "FK_MissionDefinitions_MissionRuns_LastRunId",
+ table: "MissionDefinitions");
+
+ migrationBuilder.DropForeignKey(
+ name: "FK_MissionDefinitions_Sources_SourceId",
+ table: "MissionDefinitions");
+
+ migrationBuilder.DropForeignKey(
+ name: "FK_MissionRuns_Areas_AreaId",
+ table: "MissionRuns");
+
+ migrationBuilder.DropForeignKey(
+ name: "FK_MissionRuns_Robots_RobotId",
+ table: "MissionRuns");
+
+ migrationBuilder.DropForeignKey(
+ name: "FK_MissionTask_MissionRuns_MissionRunId",
+ table: "MissionTask");
+
+ migrationBuilder.DropForeignKey(
+ name: "FK_Plants_Installations_InstallationId",
+ table: "Plants");
+
+ migrationBuilder.DropForeignKey(
+ name: "FK_Robots_Areas_CurrentAreaId",
+ table: "Robots");
+
+ migrationBuilder.DropForeignKey(
+ name: "FK_Robots_RobotModels_ModelId",
+ table: "Robots");
+
+ migrationBuilder.DropForeignKey(
+ name: "FK_SafePositions_Areas_AreaId",
+ table: "SafePositions");
+
+ migrationBuilder.DropForeignKey(
+ name: "FK_VideoStream_Robots_RobotId",
+ table: "VideoStream");
+
+ migrationBuilder.DropPrimaryKey(
+ name: "PK_Sources",
+ table: "Sources");
+
+ migrationBuilder.DropPrimaryKey(
+ name: "PK_SafePositions",
+ table: "SafePositions");
+
+ migrationBuilder.DropPrimaryKey(
+ name: "PK_Robots",
+ table: "Robots");
+
+ migrationBuilder.DropPrimaryKey(
+ name: "PK_RobotModels",
+ table: "RobotModels");
+
+ migrationBuilder.DropPrimaryKey(
+ name: "PK_Plants",
+ table: "Plants");
+
+ migrationBuilder.DropPrimaryKey(
+ name: "PK_MissionRuns",
+ table: "MissionRuns");
+
+ migrationBuilder.DropPrimaryKey(
+ name: "PK_MissionDefinitions",
+ table: "MissionDefinitions");
+
+ migrationBuilder.DropPrimaryKey(
+ name: "PK_Installations",
+ table: "Installations");
+
+ migrationBuilder.DropPrimaryKey(
+ name: "PK_Decks",
+ table: "Decks");
+
+ migrationBuilder.DropPrimaryKey(
+ name: "PK_AssetDecks",
+ table: "AssetDecks");
+
+ migrationBuilder.DropPrimaryKey(
+ name: "PK_Areas",
+ table: "Areas");
+
+ migrationBuilder.DropColumn(
+ name: "ErrorDescription",
+ table: "MissionTask");
+
+ migrationBuilder.DropColumn(
+ name: "ErrorReason",
+ table: "MissionTask");
+
+ migrationBuilder.DropColumn(
+ name: "InspectionTarget_X",
+ table: "MissionTask");
+
+ migrationBuilder.DropColumn(
+ name: "InspectionTarget_Y",
+ table: "MissionTask");
+
+ migrationBuilder.DropColumn(
+ name: "InspectionTarget_Z",
+ table: "MissionTask");
+
+ migrationBuilder.DropColumn(
+ name: "RobotPose_Orientation_W",
+ table: "MissionTask");
+
+ migrationBuilder.DropColumn(
+ name: "RobotPose_Orientation_X",
+ table: "MissionTask");
+
+ migrationBuilder.DropColumn(
+ name: "RobotPose_Orientation_Y",
+ table: "MissionTask");
+
+ migrationBuilder.DropColumn(
+ name: "RobotPose_Orientation_Z",
+ table: "MissionTask");
+
+ migrationBuilder.DropColumn(
+ name: "RobotPose_Position_X",
+ table: "MissionTask");
+
+ migrationBuilder.DropColumn(
+ name: "RobotPose_Position_Y",
+ table: "MissionTask");
+
+ migrationBuilder.DropColumn(
+ name: "RobotPose_Position_Z",
+ table: "MissionTask");
+
+ migrationBuilder.DropColumn(
+ name: "ErrorDescription",
+ table: "Inspection");
+
+ migrationBuilder.DropColumn(
+ name: "ErrorReason",
+ table: "Inspection");
+
+ migrationBuilder.DropColumn(
+ name: "Pose_Orientation_W",
+ table: "SafePositions");
+
+ migrationBuilder.DropColumn(
+ name: "Pose_Orientation_X",
+ table: "SafePositions");
+
+ migrationBuilder.DropColumn(
+ name: "Pose_Orientation_Y",
+ table: "SafePositions");
+
+ migrationBuilder.DropColumn(
+ name: "Pose_Orientation_Z",
+ table: "SafePositions");
+
+ migrationBuilder.DropColumn(
+ name: "Pose_Position_X",
+ table: "SafePositions");
+
+ migrationBuilder.DropColumn(
+ name: "Pose_Position_Y",
+ table: "SafePositions");
+
+ migrationBuilder.DropColumn(
+ name: "Pose_Position_Z",
+ table: "SafePositions");
+
+ migrationBuilder.DropColumn(
+ name: "Pose_Orientation_W",
+ table: "Robots");
+
+ migrationBuilder.DropColumn(
+ name: "Pose_Orientation_X",
+ table: "Robots");
+
+ migrationBuilder.DropColumn(
+ name: "Pose_Orientation_Y",
+ table: "Robots");
+
+ migrationBuilder.DropColumn(
+ name: "Pose_Orientation_Z",
+ table: "Robots");
+
+ migrationBuilder.DropColumn(
+ name: "Pose_Position_X",
+ table: "Robots");
+
+ migrationBuilder.DropColumn(
+ name: "Pose_Position_Y",
+ table: "Robots");
+
+ migrationBuilder.DropColumn(
+ name: "Pose_Position_Z",
+ table: "Robots");
+
+ migrationBuilder.DropColumn(
+ name: "ErrorDescription",
+ table: "MissionRuns");
+
+ migrationBuilder.DropColumn(
+ name: "ErrorReason",
+ table: "MissionRuns");
+
+ migrationBuilder.DropColumn(
+ name: "MapMetadata_Boundary_X1",
+ table: "MissionRuns");
+
+ migrationBuilder.DropColumn(
+ name: "MapMetadata_Boundary_X2",
+ table: "MissionRuns");
+
+ migrationBuilder.DropColumn(
+ name: "MapMetadata_Boundary_Y1",
+ table: "MissionRuns");
+
+ migrationBuilder.DropColumn(
+ name: "MapMetadata_Boundary_Y2",
+ table: "MissionRuns");
+
+ migrationBuilder.DropColumn(
+ name: "MapMetadata_Boundary_Z1",
+ table: "MissionRuns");
+
+ migrationBuilder.DropColumn(
+ name: "MapMetadata_Boundary_Z2",
+ table: "MissionRuns");
+
+ migrationBuilder.DropColumn(
+ name: "MapMetadata_MapName",
+ table: "MissionRuns");
+
+ migrationBuilder.DropColumn(
+ name: "MapMetadata_TransformationMatrices_C1",
+ table: "MissionRuns");
+
+ migrationBuilder.DropColumn(
+ name: "MapMetadata_TransformationMatrices_C2",
+ table: "MissionRuns");
+
+ migrationBuilder.DropColumn(
+ name: "MapMetadata_TransformationMatrices_D1",
+ table: "MissionRuns");
+
+ migrationBuilder.DropColumn(
+ name: "MapMetadata_TransformationMatrices_D2",
+ table: "MissionRuns");
+
+ migrationBuilder.DropColumn(
+ name: "DefaultLocalizationPose_Orientation_W",
+ table: "Areas");
+
+ migrationBuilder.DropColumn(
+ name: "DefaultLocalizationPose_Orientation_X",
+ table: "Areas");
+
+ migrationBuilder.DropColumn(
+ name: "DefaultLocalizationPose_Orientation_Y",
+ table: "Areas");
+
+ migrationBuilder.DropColumn(
+ name: "DefaultLocalizationPose_Orientation_Z",
+ table: "Areas");
+
+ migrationBuilder.DropColumn(
+ name: "DefaultLocalizationPose_Position_X",
+ table: "Areas");
+
+ migrationBuilder.DropColumn(
+ name: "DefaultLocalizationPose_Position_Y",
+ table: "Areas");
+
+ migrationBuilder.DropColumn(
+ name: "DefaultLocalizationPose_Position_Z",
+ table: "Areas");
+
+ migrationBuilder.DropColumn(
+ name: "MapMetadata_Boundary_X1",
+ table: "Areas");
+
+ migrationBuilder.DropColumn(
+ name: "MapMetadata_Boundary_X2",
+ table: "Areas");
+
+ migrationBuilder.DropColumn(
+ name: "MapMetadata_Boundary_Y1",
+ table: "Areas");
+
+ migrationBuilder.DropColumn(
+ name: "MapMetadata_Boundary_Y2",
+ table: "Areas");
+
+ migrationBuilder.DropColumn(
+ name: "MapMetadata_Boundary_Z1",
+ table: "Areas");
+
+ migrationBuilder.DropColumn(
+ name: "MapMetadata_Boundary_Z2",
+ table: "Areas");
+
+ migrationBuilder.DropColumn(
+ name: "MapMetadata_MapName",
+ table: "Areas");
+
+ migrationBuilder.DropColumn(
+ name: "MapMetadata_TransformationMatrices_C1",
+ table: "Areas");
+
+ migrationBuilder.DropColumn(
+ name: "MapMetadata_TransformationMatrices_C2",
+ table: "Areas");
+
+ migrationBuilder.DropColumn(
+ name: "MapMetadata_TransformationMatrices_D1",
+ table: "Areas");
+
+ migrationBuilder.DropColumn(
+ name: "MapMetadata_TransformationMatrices_D2",
+ table: "Areas");
+
+ migrationBuilder.RenameTable(
+ name: "Sources",
+ newName: "Source");
+
+ migrationBuilder.RenameTable(
+ name: "SafePositions",
+ newName: "SafePosition");
+
+ migrationBuilder.RenameTable(
+ name: "Robots",
+ newName: "Robot");
+
+ migrationBuilder.RenameTable(
+ name: "RobotModels",
+ newName: "RobotModel");
+
+ migrationBuilder.RenameTable(
+ name: "Plants",
+ newName: "Plant");
+
+ migrationBuilder.RenameTable(
+ name: "MissionRuns",
+ newName: "MissionRun");
+
+ migrationBuilder.RenameTable(
+ name: "MissionDefinitions",
+ newName: "MissionDefinition");
+
+ migrationBuilder.RenameTable(
+ name: "Installations",
+ newName: "Installation");
+
+ migrationBuilder.RenameTable(
+ name: "Decks",
+ newName: "Deck");
+
+ migrationBuilder.RenameTable(
+ name: "AssetDecks",
+ newName: "AssetDeck");
+
+ migrationBuilder.RenameTable(
+ name: "Areas",
+ newName: "Area");
+
+ migrationBuilder.RenameIndex(
+ name: "IX_SafePositions_AreaId",
+ table: "SafePosition",
+ newName: "IX_SafePosition_AreaId");
+
+ migrationBuilder.RenameIndex(
+ name: "IX_Robots_ModelId",
+ table: "Robot",
+ newName: "IX_Robot_ModelId");
+
+ migrationBuilder.RenameIndex(
+ name: "IX_Robots_CurrentAreaId",
+ table: "Robot",
+ newName: "IX_Robot_CurrentAreaId");
+
+ migrationBuilder.RenameIndex(
+ name: "IX_RobotModels_Type",
+ table: "RobotModel",
+ newName: "IX_RobotModel_Type");
+
+ migrationBuilder.RenameIndex(
+ name: "IX_Plants_PlantCode",
+ table: "Plant",
+ newName: "IX_Plant_PlantCode");
+
+ migrationBuilder.RenameIndex(
+ name: "IX_Plants_InstallationId",
+ table: "Plant",
+ newName: "IX_Plant_InstallationId");
+
+ migrationBuilder.RenameIndex(
+ name: "IX_MissionRuns_RobotId",
+ table: "MissionRun",
+ newName: "IX_MissionRun_RobotId");
+
+ migrationBuilder.RenameIndex(
+ name: "IX_MissionRuns_AreaId",
+ table: "MissionRun",
+ newName: "IX_MissionRun_AreaId");
+
+ migrationBuilder.RenameIndex(
+ name: "IX_MissionDefinitions_SourceId",
+ table: "MissionDefinition",
+ newName: "IX_MissionDefinition_SourceId");
+
+ migrationBuilder.RenameIndex(
+ name: "IX_MissionDefinitions_LastRunId",
+ table: "MissionDefinition",
+ newName: "IX_MissionDefinition_LastRunId");
+
+ migrationBuilder.RenameIndex(
+ name: "IX_MissionDefinitions_AreaId",
+ table: "MissionDefinition",
+ newName: "IX_MissionDefinition_AreaId");
+
+ migrationBuilder.RenameIndex(
+ name: "IX_Installations_InstallationCode",
+ table: "Installation",
+ newName: "IX_Installation_InstallationCode");
+
+ migrationBuilder.RenameIndex(
+ name: "IX_Decks_PlantId",
+ table: "Deck",
+ newName: "IX_Deck_PlantId");
+
+ migrationBuilder.RenameIndex(
+ name: "IX_Decks_InstallationId",
+ table: "Deck",
+ newName: "IX_Deck_InstallationId");
+
+ migrationBuilder.RenameIndex(
+ name: "IX_Areas_PlantId",
+ table: "Area",
+ newName: "IX_Area_PlantId");
+
+ migrationBuilder.RenameIndex(
+ name: "IX_Areas_InstallationId",
+ table: "Area",
+ newName: "IX_Area_InstallationId");
+
+ migrationBuilder.RenameIndex(
+ name: "IX_Areas_DeckId",
+ table: "Area",
+ newName: "IX_Area_DeckId");
+
+ migrationBuilder.AddPrimaryKey(
+ name: "PK_Source",
+ table: "Source",
+ column: "Id");
+
+ migrationBuilder.AddPrimaryKey(
+ name: "PK_SafePosition",
+ table: "SafePosition",
+ column: "Id");
+
+ migrationBuilder.AddPrimaryKey(
+ name: "PK_Robot",
+ table: "Robot",
+ column: "Id");
+
+ migrationBuilder.AddPrimaryKey(
+ name: "PK_RobotModel",
+ table: "RobotModel",
+ column: "Id");
+
+ migrationBuilder.AddPrimaryKey(
+ name: "PK_Plant",
+ table: "Plant",
+ column: "Id");
+
+ migrationBuilder.AddPrimaryKey(
+ name: "PK_MissionRun",
+ table: "MissionRun",
+ column: "Id");
+
+ migrationBuilder.AddPrimaryKey(
+ name: "PK_MissionDefinition",
+ table: "MissionDefinition",
+ column: "Id");
+
+ migrationBuilder.AddPrimaryKey(
+ name: "PK_Installation",
+ table: "Installation",
+ column: "Id");
+
+ migrationBuilder.AddPrimaryKey(
+ name: "PK_Deck",
+ table: "Deck",
+ column: "Id");
+
+ migrationBuilder.AddPrimaryKey(
+ name: "PK_AssetDeck",
+ table: "AssetDeck",
+ column: "Id");
+
+ migrationBuilder.AddPrimaryKey(
+ name: "PK_Area",
+ table: "Area",
+ column: "Id");
+
+ migrationBuilder.CreateTable(
+ name: "Area.DefaultLocalizationPose#Pose",
+ columns: table => new
+ {
+ AreaId = table.Column(type: "nvarchar(450)", nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_Area.DefaultLocalizationPose#Pose", x => x.AreaId);
+ table.ForeignKey(
+ name: "FK_Area.DefaultLocalizationPose#Pose_Area_AreaId",
+ column: x => x.AreaId,
+ principalTable: "Area",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Cascade);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "Area.MapMetadata#MapMetadata",
+ columns: table => new
+ {
+ AreaId = table.Column(type: "nvarchar(450)", nullable: false),
+ MapName = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_Area.MapMetadata#MapMetadata", x => x.AreaId);
+ table.ForeignKey(
+ name: "FK_Area.MapMetadata#MapMetadata_Area_AreaId",
+ column: x => x.AreaId,
+ principalTable: "Area",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Cascade);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "MissionRun.MapMetadata#MapMetadata",
+ columns: table => new
+ {
+ MissionRunId = table.Column(type: "nvarchar(450)", nullable: false),
+ MapName = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_MissionRun.MapMetadata#MapMetadata", x => x.MissionRunId);
+ table.ForeignKey(
+ name: "FK_MissionRun.MapMetadata#MapMetadata_MissionRun_MissionRunId",
+ column: x => x.MissionRunId,
+ principalTable: "MissionRun",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Cascade);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "MissionTask.InspectionTarget#Position",
+ columns: table => new
+ {
+ MissionTaskId = table.Column(type: "nvarchar(450)", nullable: false),
+ X = table.Column(type: "real", nullable: false),
+ Y = table.Column(type: "real", nullable: false),
+ Z = table.Column(type: "real", nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_MissionTask.InspectionTarget#Position", x => x.MissionTaskId);
+ table.ForeignKey(
+ name: "FK_MissionTask.InspectionTarget#Position_MissionTask_MissionTaskId",
+ column: x => x.MissionTaskId,
+ principalTable: "MissionTask",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Cascade);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "MissionTask.RobotPose#Pose",
+ columns: table => new
+ {
+ MissionTaskId = table.Column(type: "nvarchar(450)", nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_MissionTask.RobotPose#Pose", x => x.MissionTaskId);
+ table.ForeignKey(
+ name: "FK_MissionTask.RobotPose#Pose_MissionTask_MissionTaskId",
+ column: x => x.MissionTaskId,
+ principalTable: "MissionTask",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Cascade);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "Robot.Pose#Pose",
+ columns: table => new
+ {
+ RobotId = table.Column(type: "nvarchar(450)", nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_Robot.Pose#Pose", x => x.RobotId);
+ table.ForeignKey(
+ name: "FK_Robot.Pose#Pose_Robot_RobotId",
+ column: x => x.RobotId,
+ principalTable: "Robot",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Cascade);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "SafePosition.Pose#Pose",
+ columns: table => new
+ {
+ SafePositionId = table.Column(type: "nvarchar(450)", nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_SafePosition.Pose#Pose", x => x.SafePositionId);
+ table.ForeignKey(
+ name: "FK_SafePosition.Pose#Pose_SafePosition_SafePositionId",
+ column: x => x.SafePositionId,
+ principalTable: "SafePosition",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Cascade);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "Area.DefaultLocalizationPose#Pose.Orientation#Orientation",
+ columns: table => new
+ {
+ PoseAreaId = table.Column(type: "nvarchar(450)", nullable: false),
+ W = table.Column(type: "real", nullable: false),
+ X = table.Column(type: "real", nullable: false),
+ Y = table.Column(type: "real", nullable: false),
+ Z = table.Column(type: "real", nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_Area.DefaultLocalizationPose#Pose.Orientation#Orientation", x => x.PoseAreaId);
+ table.ForeignKey(
+ name: "FK_Area.DefaultLocalizationPose#Pose.Orientation#Orientation_Area.DefaultLocalizationPose#Pose_PoseAreaId",
+ column: x => x.PoseAreaId,
+ principalTable: "Area.DefaultLocalizationPose#Pose",
+ principalColumn: "AreaId",
+ onDelete: ReferentialAction.Cascade);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "Area.DefaultLocalizationPose#Pose.Position#Position",
+ columns: table => new
+ {
+ PoseAreaId = table.Column(type: "nvarchar(450)", nullable: false),
+ X = table.Column(type: "real", nullable: false),
+ Y = table.Column(type: "real", nullable: false),
+ Z = table.Column(type: "real", nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_Area.DefaultLocalizationPose#Pose.Position#Position", x => x.PoseAreaId);
+ table.ForeignKey(
+ name: "FK_Area.DefaultLocalizationPose#Pose.Position#Position_Area.DefaultLocalizationPose#Pose_PoseAreaId",
+ column: x => x.PoseAreaId,
+ principalTable: "Area.DefaultLocalizationPose#Pose",
+ principalColumn: "AreaId",
+ onDelete: ReferentialAction.Cascade);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "Area.MapMetadata#MapMetadata.Boundary#Boundary",
+ columns: table => new
+ {
+ MapMetadataAreaId = table.Column(type: "nvarchar(450)", nullable: false),
+ X1 = table.Column