diff --git a/backend/api/Migrations/20231002084005_InitialCreate.Designer.cs b/backend/api/Migrations/20231002084005_InitialCreate.Designer.cs deleted file mode 100644 index 2741a60bf..000000000 --- a/backend/api/Migrations/20231002084005_InitialCreate.Designer.cs +++ /dev/null @@ -1,1195 +0,0 @@ -// -using System; -using Api.Database.Context; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace Api.Migrations -{ - [DbContext(typeof(FlotillaDbContext))] - [Migration("20231002084005_InitialCreate")] - partial class InitialCreate - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "7.0.11") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("Api.Database.Models.Area", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("DeckId") - .HasColumnType("text"); - - b.Property("InstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PlantId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("DeckId"); - - b.HasIndex("InstallationId"); - - b.HasIndex("PlantId"); - - b.ToTable("Areas"); - }); - - modelBuilder.Entity("Api.Database.Models.Deck", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("InstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PlantId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("InstallationId"); - - b.HasIndex("PlantId"); - - b.ToTable("Decks"); - }); - - modelBuilder.Entity("Api.Database.Models.Installation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("InstallationCode") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.HasKey("Id"); - - b.HasIndex("InstallationCode") - .IsUnique(); - - b.ToTable("Installations"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionDefinition", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AreaId") - .HasColumnType("text"); - - b.Property("Comment") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("InspectionFrequency") - .HasColumnType("bigint"); - - b.Property("InstallationCode") - .IsRequired() - .HasColumnType("text"); - - b.Property("IsDeprecated") - .HasColumnType("boolean"); - - b.Property("LastRunId") - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("SourceId") - .IsRequired() - .HasColumnType("text"); - - 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("text"); - - b.Property("AreaId") - .HasColumnType("text"); - - b.Property("Comment") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("Description") - .HasMaxLength(450) - .HasColumnType("character varying(450)"); - - b.Property("DesiredStartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("EndTime") - .HasColumnType("timestamp with time zone"); - - b.Property("EstimatedDuration") - .HasColumnType("bigint"); - - b.Property("InstallationCode") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("IsarMissionId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("StartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("StatusReason") - .HasMaxLength(450) - .HasColumnType("character varying(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("text"); - - b.Property("InstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PlantCode") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(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("text"); - - b.Property("BatteryLevel") - .HasColumnType("real"); - - b.Property("CurrentAreaId") - .HasColumnType("text"); - - b.Property("CurrentInstallation") - .IsRequired() - .HasColumnType("text"); - - b.Property("CurrentMissionId") - .HasColumnType("text"); - - b.Property("Enabled") - .HasColumnType("boolean"); - - b.Property("Host") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("IsarId") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("ModelId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Port") - .HasColumnType("integer"); - - b.Property("PressureLevel") - .HasColumnType("real"); - - b.Property("SerialNumber") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("CurrentAreaId"); - - b.HasIndex("ModelId"); - - b.ToTable("Robots"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotBatteryTimeseries", b => - { - b.Property("BatteryLevel") - .HasColumnType("real"); - - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Time") - .HasColumnType("timestamp with time zone"); - - b.ToTable("RobotBatteryTimeseries"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotModel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AverageDurationPerTag") - .HasColumnType("real"); - - b.Property("BatteryWarningThreshold") - .HasColumnType("real"); - - b.Property("LowerPressureWarningThreshold") - .HasColumnType("real"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - b.Property("UpperPressureWarningThreshold") - .HasColumnType("real"); - - b.HasKey("Id"); - - b.HasIndex("Type") - .IsUnique(); - - b.ToTable("RobotModels"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotPoseTimeseries", b => - { - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("OrientationW") - .HasColumnType("real"); - - b.Property("OrientationX") - .HasColumnType("real"); - - b.Property("OrientationY") - .HasColumnType("real"); - - b.Property("OrientationZ") - .HasColumnType("real"); - - b.Property("PositionX") - .HasColumnType("real"); - - b.Property("PositionY") - .HasColumnType("real"); - - b.Property("PositionZ") - .HasColumnType("real"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Time") - .HasColumnType("timestamp with time zone"); - - b.ToTable("RobotPoseTimeseries"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotPressureTimeseries", b => - { - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("Pressure") - .HasColumnType("real"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Time") - .HasColumnType("timestamp with time zone"); - - b.ToTable("RobotPressureTimeseries"); - }); - - modelBuilder.Entity("Api.Database.Models.SafePosition", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AreaId") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("AreaId"); - - b.ToTable("SafePositions"); - }); - - modelBuilder.Entity("Api.Database.Models.Source", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("SourceId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - 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); - - 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("text"); - - b1.HasKey("AreaId"); - - b1.ToTable("Areas"); - - b1.WithOwner() - .HasForeignKey("AreaId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseAreaId") - .HasColumnType("text"); - - 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("text"); - - 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("text"); - - b1.Property("MapName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.HasKey("AreaId"); - - b1.ToTable("Areas"); - - b1.WithOwner() - .HasForeignKey("AreaId"); - - b1.OwnsOne("Api.Database.Models.Boundary", "Boundary", b2 => - { - b2.Property("MapMetadataAreaId") - .HasColumnType("text"); - - b2.Property("X1") - .HasColumnType("double precision"); - - b2.Property("X2") - .HasColumnType("double precision"); - - b2.Property("Y1") - .HasColumnType("double precision"); - - b2.Property("Y2") - .HasColumnType("double precision"); - - b2.Property("Z1") - .HasColumnType("double precision"); - - b2.Property("Z2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataAreaId"); - - b2.ToTable("Areas"); - - b2.WithOwner() - .HasForeignKey("MapMetadataAreaId"); - }); - - b1.OwnsOne("Api.Database.Models.TransformationMatrices", "TransformationMatrices", b2 => - { - b2.Property("MapMetadataAreaId") - .HasColumnType("text"); - - b2.Property("C1") - .HasColumnType("double precision"); - - b2.Property("C2") - .HasColumnType("double precision"); - - b2.Property("D1") - .HasColumnType("double precision"); - - b2.Property("D2") - .HasColumnType("double precision"); - - 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) - .IsRequired(); - - b.HasOne("Api.Database.Models.Plant", "Plant") - .WithMany() - .HasForeignKey("PlantId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - 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", "Map", b1 => - { - b1.Property("MissionRunId") - .HasColumnType("text"); - - b1.Property("MapName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.HasKey("MissionRunId"); - - b1.ToTable("MissionRuns"); - - b1.WithOwner() - .HasForeignKey("MissionRunId"); - - b1.OwnsOne("Api.Database.Models.Boundary", "Boundary", b2 => - { - b2.Property("MapMetadataMissionRunId") - .HasColumnType("text"); - - b2.Property("X1") - .HasColumnType("double precision"); - - b2.Property("X2") - .HasColumnType("double precision"); - - b2.Property("Y1") - .HasColumnType("double precision"); - - b2.Property("Y2") - .HasColumnType("double precision"); - - b2.Property("Z1") - .HasColumnType("double precision"); - - b2.Property("Z2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataMissionRunId"); - - b2.ToTable("MissionRuns"); - - b2.WithOwner() - .HasForeignKey("MapMetadataMissionRunId"); - }); - - b1.OwnsOne("Api.Database.Models.TransformationMatrices", "TransformationMatrices", b2 => - { - b2.Property("MapMetadataMissionRunId") - .HasColumnType("text"); - - b2.Property("C1") - .HasColumnType("double precision"); - - b2.Property("C2") - .HasColumnType("double precision"); - - b2.Property("D1") - .HasColumnType("double precision"); - - b2.Property("D2") - .HasColumnType("double precision"); - - 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("text"); - - b1.Property("Description") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b1.Property("EchoPoseId") - .HasColumnType("integer"); - - b1.Property("EchoTagLink") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.Property("EndTime") - .HasColumnType("timestamp with time zone"); - - b1.Property("IsarTaskId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.Property("MissionRunId") - .IsRequired() - .HasColumnType("text"); - - b1.Property("StartTime") - .HasColumnType("timestamp with time zone"); - - b1.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b1.Property("TagId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.Property("TaskOrder") - .HasColumnType("integer"); - - 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("text"); - - b2.Property("AnalysisType") - .HasColumnType("text"); - - b2.Property("EndTime") - .HasColumnType("timestamp with time zone"); - - b2.Property("InspectionType") - .IsRequired() - .HasColumnType("text"); - - b2.Property("InspectionUrl") - .HasMaxLength(250) - .HasColumnType("character varying(250)"); - - b2.Property("IsarStepId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b2.Property("MissionTaskId") - .IsRequired() - .HasColumnType("text"); - - b2.Property("StartTime") - .HasColumnType("timestamp with time zone"); - - b2.Property("Status") - .IsRequired() - .HasColumnType("text"); - - 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("text"); - - 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("text"); - - b2.HasKey("MissionTaskId"); - - b2.ToTable("MissionTask"); - - b2.WithOwner() - .HasForeignKey("MissionTaskId"); - - b2.OwnsOne("Api.Database.Models.Orientation", "Orientation", b3 => - { - b3.Property("PoseMissionTaskId") - .HasColumnType("text"); - - 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("text"); - - 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("Map"); - - 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) - .IsRequired(); - - 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("text"); - - b1.HasKey("RobotId"); - - b1.ToTable("Robots"); - - b1.WithOwner() - .HasForeignKey("RobotId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseRobotId") - .HasColumnType("text"); - - 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("text"); - - 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("text"); - - b1.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b1.Property("ShouldRotate270Clockwise") - .HasColumnType("boolean"); - - b1.Property("Type") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b1.Property("Url") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(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("text"); - - b1.HasKey("SafePositionId"); - - b1.ToTable("SafePositions"); - - b1.WithOwner() - .HasForeignKey("SafePositionId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseSafePositionId") - .HasColumnType("text"); - - 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("text"); - - 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/20231009102654_AddDefaultLocalizationPoseToDeckAndArea.Designer.cs b/backend/api/Migrations/20231009102654_AddDefaultLocalizationPoseToDeckAndArea.Designer.cs deleted file mode 100644 index e81ee992a..000000000 --- a/backend/api/Migrations/20231009102654_AddDefaultLocalizationPoseToDeckAndArea.Designer.cs +++ /dev/null @@ -1,1231 +0,0 @@ -// -using System; -using Api.Database.Context; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace Api.Migrations -{ - [DbContext(typeof(FlotillaDbContext))] - [Migration("20231009102654_AddDefaultLocalizationPoseToDeckAndArea")] - partial class AddDefaultLocalizationPoseToDeckAndArea - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "7.0.11") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("Api.Database.Models.Area", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("DeckId") - .HasColumnType("text"); - - b.Property("DefaultLocalizationPoseId") - .HasColumnType("text"); - - b.Property("InstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PlantId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("DeckId"); - - b.HasIndex("DefaultLocalizationPoseId"); - - b.HasIndex("InstallationId"); - - b.HasIndex("PlantId"); - - b.ToTable("Areas"); - }); - - modelBuilder.Entity("Api.Database.Models.Deck", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("DefaultLocalizationPoseId") - .HasColumnType("text"); - - b.Property("InstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PlantId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("DefaultLocalizationPoseId"); - - b.HasIndex("InstallationId"); - - b.HasIndex("PlantId"); - - b.ToTable("Decks"); - }); - - modelBuilder.Entity("Api.Database.Models.DefaultLocalizationPose", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.ToTable("DefaultLocalizationPoses"); - }); - - modelBuilder.Entity("Api.Database.Models.Installation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("InstallationCode") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.HasKey("Id"); - - b.HasIndex("InstallationCode") - .IsUnique(); - - b.ToTable("Installations"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionDefinition", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AreaId") - .HasColumnType("text"); - - b.Property("Comment") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("InspectionFrequency") - .HasColumnType("bigint"); - - b.Property("InstallationCode") - .IsRequired() - .HasColumnType("text"); - - b.Property("IsDeprecated") - .HasColumnType("boolean"); - - b.Property("LastRunId") - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("SourceId") - .IsRequired() - .HasColumnType("text"); - - 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("text"); - - b.Property("AreaId") - .HasColumnType("text"); - - b.Property("Comment") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("Description") - .HasMaxLength(450) - .HasColumnType("character varying(450)"); - - b.Property("DesiredStartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("EndTime") - .HasColumnType("timestamp with time zone"); - - b.Property("EstimatedDuration") - .HasColumnType("bigint"); - - b.Property("InstallationCode") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("IsarMissionId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("StartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("StatusReason") - .HasMaxLength(450) - .HasColumnType("character varying(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("text"); - - b.Property("InstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PlantCode") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(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("text"); - - b.Property("BatteryLevel") - .HasColumnType("real"); - - b.Property("CurrentAreaId") - .HasColumnType("text"); - - b.Property("CurrentInstallation") - .IsRequired() - .HasColumnType("text"); - - b.Property("CurrentMissionId") - .HasColumnType("text"); - - b.Property("Enabled") - .HasColumnType("boolean"); - - b.Property("Host") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("IsarId") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("ModelId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Port") - .HasColumnType("integer"); - - b.Property("PressureLevel") - .HasColumnType("real"); - - b.Property("SerialNumber") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("CurrentAreaId"); - - b.HasIndex("ModelId"); - - b.ToTable("Robots"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotBatteryTimeseries", b => - { - b.Property("BatteryLevel") - .HasColumnType("real"); - - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Time") - .HasColumnType("timestamp with time zone"); - - b.ToTable("RobotBatteryTimeseries"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotModel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AverageDurationPerTag") - .HasColumnType("real"); - - b.Property("BatteryWarningThreshold") - .HasColumnType("real"); - - b.Property("LowerPressureWarningThreshold") - .HasColumnType("real"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - b.Property("UpperPressureWarningThreshold") - .HasColumnType("real"); - - b.HasKey("Id"); - - b.HasIndex("Type") - .IsUnique(); - - b.ToTable("RobotModels"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotPoseTimeseries", b => - { - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("OrientationW") - .HasColumnType("real"); - - b.Property("OrientationX") - .HasColumnType("real"); - - b.Property("OrientationY") - .HasColumnType("real"); - - b.Property("OrientationZ") - .HasColumnType("real"); - - b.Property("PositionX") - .HasColumnType("real"); - - b.Property("PositionY") - .HasColumnType("real"); - - b.Property("PositionZ") - .HasColumnType("real"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Time") - .HasColumnType("timestamp with time zone"); - - b.ToTable("RobotPoseTimeseries"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotPressureTimeseries", b => - { - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("Pressure") - .HasColumnType("real"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Time") - .HasColumnType("timestamp with time zone"); - - b.ToTable("RobotPressureTimeseries"); - }); - - modelBuilder.Entity("Api.Database.Models.SafePosition", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AreaId") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("AreaId"); - - b.ToTable("SafePositions"); - }); - - modelBuilder.Entity("Api.Database.Models.Source", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("SourceId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - 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); - - b.HasOne("Api.Database.Models.DefaultLocalizationPose", "DefaultLocalizationPose") - .WithMany() - .HasForeignKey("DefaultLocalizationPoseId"); - - 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.MapMetadata", "MapMetadata", b1 => - { - b1.Property("AreaId") - .HasColumnType("text"); - - b1.Property("MapName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.HasKey("AreaId"); - - b1.ToTable("Areas"); - - b1.WithOwner() - .HasForeignKey("AreaId"); - - b1.OwnsOne("Api.Database.Models.Boundary", "Boundary", b2 => - { - b2.Property("MapMetadataAreaId") - .HasColumnType("text"); - - b2.Property("X1") - .HasColumnType("double precision"); - - b2.Property("X2") - .HasColumnType("double precision"); - - b2.Property("Y1") - .HasColumnType("double precision"); - - b2.Property("Y2") - .HasColumnType("double precision"); - - b2.Property("Z1") - .HasColumnType("double precision"); - - b2.Property("Z2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataAreaId"); - - b2.ToTable("Areas"); - - b2.WithOwner() - .HasForeignKey("MapMetadataAreaId"); - }); - - b1.OwnsOne("Api.Database.Models.TransformationMatrices", "TransformationMatrices", b2 => - { - b2.Property("MapMetadataAreaId") - .HasColumnType("text"); - - b2.Property("C1") - .HasColumnType("double precision"); - - b2.Property("C2") - .HasColumnType("double precision"); - - b2.Property("D1") - .HasColumnType("double precision"); - - b2.Property("D2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataAreaId"); - - b2.ToTable("Areas"); - - b2.WithOwner() - .HasForeignKey("MapMetadataAreaId"); - }); - - b1.Navigation("Boundary") - .IsRequired(); - - b1.Navigation("TransformationMatrices") - .IsRequired(); - }); - - b.Navigation("Deck"); - - b.Navigation("DefaultLocalizationPose"); - - b.Navigation("Installation"); - - b.Navigation("MapMetadata") - .IsRequired(); - - b.Navigation("Plant"); - }); - - modelBuilder.Entity("Api.Database.Models.Deck", b => - { - b.HasOne("Api.Database.Models.DefaultLocalizationPose", "DefaultLocalizationPose") - .WithMany() - .HasForeignKey("DefaultLocalizationPoseId"); - - 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.Navigation("DefaultLocalizationPose"); - - b.Navigation("Installation"); - - b.Navigation("Plant"); - }); - - modelBuilder.Entity("Api.Database.Models.DefaultLocalizationPose", b => - { - b.OwnsOne("Api.Database.Models.Pose", "Pose", b1 => - { - b1.Property("DefaultLocalizationPoseId") - .HasColumnType("text"); - - b1.HasKey("DefaultLocalizationPoseId"); - - b1.ToTable("DefaultLocalizationPoses"); - - b1.WithOwner() - .HasForeignKey("DefaultLocalizationPoseId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseDefaultLocalizationPoseId") - .HasColumnType("text"); - - b2.Property("W") - .HasColumnType("real"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseDefaultLocalizationPoseId"); - - b2.ToTable("DefaultLocalizationPoses"); - - b2.WithOwner() - .HasForeignKey("PoseDefaultLocalizationPoseId"); - }); - - b1.OwnsOne("Api.Database.Models.Position", "Position", b2 => - { - b2.Property("PoseDefaultLocalizationPoseId") - .HasColumnType("text"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseDefaultLocalizationPoseId"); - - b2.ToTable("DefaultLocalizationPoses"); - - b2.WithOwner() - .HasForeignKey("PoseDefaultLocalizationPoseId"); - }); - - b1.Navigation("Orientation") - .IsRequired(); - - b1.Navigation("Position") - .IsRequired(); - }); - - b.Navigation("Pose") - .IsRequired(); - }); - - 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", "Map", b1 => - { - b1.Property("MissionRunId") - .HasColumnType("text"); - - b1.Property("MapName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.HasKey("MissionRunId"); - - b1.ToTable("MissionRuns"); - - b1.WithOwner() - .HasForeignKey("MissionRunId"); - - b1.OwnsOne("Api.Database.Models.Boundary", "Boundary", b2 => - { - b2.Property("MapMetadataMissionRunId") - .HasColumnType("text"); - - b2.Property("X1") - .HasColumnType("double precision"); - - b2.Property("X2") - .HasColumnType("double precision"); - - b2.Property("Y1") - .HasColumnType("double precision"); - - b2.Property("Y2") - .HasColumnType("double precision"); - - b2.Property("Z1") - .HasColumnType("double precision"); - - b2.Property("Z2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataMissionRunId"); - - b2.ToTable("MissionRuns"); - - b2.WithOwner() - .HasForeignKey("MapMetadataMissionRunId"); - }); - - b1.OwnsOne("Api.Database.Models.TransformationMatrices", "TransformationMatrices", b2 => - { - b2.Property("MapMetadataMissionRunId") - .HasColumnType("text"); - - b2.Property("C1") - .HasColumnType("double precision"); - - b2.Property("C2") - .HasColumnType("double precision"); - - b2.Property("D1") - .HasColumnType("double precision"); - - b2.Property("D2") - .HasColumnType("double precision"); - - 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("text"); - - b1.Property("Description") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b1.Property("EchoPoseId") - .HasColumnType("integer"); - - b1.Property("EchoTagLink") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.Property("EndTime") - .HasColumnType("timestamp with time zone"); - - b1.Property("IsarTaskId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.Property("MissionRunId") - .IsRequired() - .HasColumnType("text"); - - b1.Property("StartTime") - .HasColumnType("timestamp with time zone"); - - b1.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b1.Property("TagId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.Property("TaskOrder") - .HasColumnType("integer"); - - 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("text"); - - b2.Property("AnalysisType") - .HasColumnType("text"); - - b2.Property("EndTime") - .HasColumnType("timestamp with time zone"); - - b2.Property("InspectionType") - .IsRequired() - .HasColumnType("text"); - - b2.Property("InspectionUrl") - .HasMaxLength(250) - .HasColumnType("character varying(250)"); - - b2.Property("IsarStepId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b2.Property("MissionTaskId") - .IsRequired() - .HasColumnType("text"); - - b2.Property("StartTime") - .HasColumnType("timestamp with time zone"); - - b2.Property("Status") - .IsRequired() - .HasColumnType("text"); - - 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("text"); - - 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("text"); - - b2.HasKey("MissionTaskId"); - - b2.ToTable("MissionTask"); - - b2.WithOwner() - .HasForeignKey("MissionTaskId"); - - b2.OwnsOne("Api.Database.Models.Orientation", "Orientation", b3 => - { - b3.Property("PoseMissionTaskId") - .HasColumnType("text"); - - 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("text"); - - 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("Map"); - - 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) - .IsRequired(); - - 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("text"); - - b1.HasKey("RobotId"); - - b1.ToTable("Robots"); - - b1.WithOwner() - .HasForeignKey("RobotId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseRobotId") - .HasColumnType("text"); - - 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("text"); - - 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("text"); - - b1.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b1.Property("ShouldRotate270Clockwise") - .HasColumnType("boolean"); - - b1.Property("Type") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b1.Property("Url") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(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("text"); - - b1.HasKey("SafePositionId"); - - b1.ToTable("SafePositions"); - - b1.WithOwner() - .HasForeignKey("SafePositionId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseSafePositionId") - .HasColumnType("text"); - - 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("text"); - - 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/20231009102654_AddDefaultLocalizationPoseToDeckAndArea.cs b/backend/api/Migrations/20231009102654_AddDefaultLocalizationPoseToDeckAndArea.cs deleted file mode 100644 index e9d7572aa..000000000 --- a/backend/api/Migrations/20231009102654_AddDefaultLocalizationPoseToDeckAndArea.cs +++ /dev/null @@ -1,176 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Api.Migrations -{ - /// - public partial class AddDefaultLocalizationPoseToDeckAndArea : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - 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.AddColumn( - name: "DefaultLocalizationPoseId", - table: "Decks", - type: "text", - nullable: true); - - migrationBuilder.AddColumn( - name: "DefaultLocalizationPoseId", - table: "Areas", - type: "text", - nullable: true); - - migrationBuilder.CreateTable( - name: "DefaultLocalizationPoses", - columns: table => new - { - Id = table.Column(type: "text", nullable: false), - Pose_Position_X = table.Column(type: "real", nullable: false), - Pose_Position_Y = table.Column(type: "real", nullable: false), - Pose_Position_Z = table.Column(type: "real", nullable: false), - Pose_Orientation_X = table.Column(type: "real", nullable: false), - Pose_Orientation_Y = table.Column(type: "real", nullable: false), - Pose_Orientation_Z = table.Column(type: "real", nullable: false), - Pose_Orientation_W = table.Column(type: "real", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_DefaultLocalizationPoses", x => x.Id); - }); - - migrationBuilder.CreateIndex( - name: "IX_Decks_DefaultLocalizationPoseId", - table: "Decks", - column: "DefaultLocalizationPoseId"); - - migrationBuilder.CreateIndex( - name: "IX_Areas_DefaultLocalizationPoseId", - table: "Areas", - column: "DefaultLocalizationPoseId"); - - migrationBuilder.AddForeignKey( - name: "FK_Areas_DefaultLocalizationPoses_DefaultLocalizationPoseId", - table: "Areas", - column: "DefaultLocalizationPoseId", - principalTable: "DefaultLocalizationPoses", - principalColumn: "Id"); - - migrationBuilder.AddForeignKey( - name: "FK_Decks_DefaultLocalizationPoses_DefaultLocalizationPoseId", - table: "Decks", - column: "DefaultLocalizationPoseId", - principalTable: "DefaultLocalizationPoses", - principalColumn: "Id"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropForeignKey( - name: "FK_Areas_DefaultLocalizationPoses_DefaultLocalizationPoseId", - table: "Areas"); - - migrationBuilder.DropForeignKey( - name: "FK_Decks_DefaultLocalizationPoses_DefaultLocalizationPoseId", - table: "Decks"); - - migrationBuilder.DropTable( - name: "DefaultLocalizationPoses"); - - migrationBuilder.DropIndex( - name: "IX_Decks_DefaultLocalizationPoseId", - table: "Decks"); - - migrationBuilder.DropIndex( - name: "IX_Areas_DefaultLocalizationPoseId", - table: "Areas"); - - migrationBuilder.DropColumn( - name: "DefaultLocalizationPoseId", - table: "Decks"); - - migrationBuilder.DropColumn( - name: "DefaultLocalizationPoseId", - table: "Areas"); - - 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); - } - } -} diff --git a/backend/api/Migrations/20231016120557_RenameLastRunToLastSuccessfulRun.Designer.cs b/backend/api/Migrations/20231016120557_RenameLastRunToLastSuccessfulRun.Designer.cs deleted file mode 100644 index 71e386202..000000000 --- a/backend/api/Migrations/20231016120557_RenameLastRunToLastSuccessfulRun.Designer.cs +++ /dev/null @@ -1,1231 +0,0 @@ -// -using System; -using Api.Database.Context; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace Api.Migrations -{ - [DbContext(typeof(FlotillaDbContext))] - [Migration("20231016120557_RenameLastRunToLastSuccessfulRun")] - partial class RenameLastRunToLastSuccessfulRun - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "7.0.11") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("Api.Database.Models.Area", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("DeckId") - .HasColumnType("text"); - - b.Property("DefaultLocalizationPoseId") - .HasColumnType("text"); - - b.Property("InstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PlantId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("DeckId"); - - b.HasIndex("DefaultLocalizationPoseId"); - - b.HasIndex("InstallationId"); - - b.HasIndex("PlantId"); - - b.ToTable("Areas"); - }); - - modelBuilder.Entity("Api.Database.Models.Deck", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("DefaultLocalizationPoseId") - .HasColumnType("text"); - - b.Property("InstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PlantId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("DefaultLocalizationPoseId"); - - b.HasIndex("InstallationId"); - - b.HasIndex("PlantId"); - - b.ToTable("Decks"); - }); - - modelBuilder.Entity("Api.Database.Models.DefaultLocalizationPose", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.ToTable("DefaultLocalizationPoses"); - }); - - modelBuilder.Entity("Api.Database.Models.Installation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("InstallationCode") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.HasKey("Id"); - - b.HasIndex("InstallationCode") - .IsUnique(); - - b.ToTable("Installations"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionDefinition", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AreaId") - .HasColumnType("text"); - - b.Property("Comment") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("InspectionFrequency") - .HasColumnType("bigint"); - - b.Property("InstallationCode") - .IsRequired() - .HasColumnType("text"); - - b.Property("IsDeprecated") - .HasColumnType("boolean"); - - b.Property("LastSuccessfulRunId") - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("SourceId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("AreaId"); - - b.HasIndex("LastSuccessfulRunId"); - - b.HasIndex("SourceId"); - - b.ToTable("MissionDefinitions"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionRun", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AreaId") - .HasColumnType("text"); - - b.Property("Comment") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("Description") - .HasMaxLength(450) - .HasColumnType("character varying(450)"); - - b.Property("DesiredStartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("EndTime") - .HasColumnType("timestamp with time zone"); - - b.Property("EstimatedDuration") - .HasColumnType("bigint"); - - b.Property("InstallationCode") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("IsarMissionId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("StartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("StatusReason") - .HasMaxLength(450) - .HasColumnType("character varying(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("text"); - - b.Property("InstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PlantCode") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(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("text"); - - b.Property("BatteryLevel") - .HasColumnType("real"); - - b.Property("CurrentAreaId") - .HasColumnType("text"); - - b.Property("CurrentInstallation") - .IsRequired() - .HasColumnType("text"); - - b.Property("CurrentMissionId") - .HasColumnType("text"); - - b.Property("Enabled") - .HasColumnType("boolean"); - - b.Property("Host") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("IsarId") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("ModelId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Port") - .HasColumnType("integer"); - - b.Property("PressureLevel") - .HasColumnType("real"); - - b.Property("SerialNumber") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("CurrentAreaId"); - - b.HasIndex("ModelId"); - - b.ToTable("Robots"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotBatteryTimeseries", b => - { - b.Property("BatteryLevel") - .HasColumnType("real"); - - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Time") - .HasColumnType("timestamp with time zone"); - - b.ToTable("RobotBatteryTimeseries"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotModel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AverageDurationPerTag") - .HasColumnType("real"); - - b.Property("BatteryWarningThreshold") - .HasColumnType("real"); - - b.Property("LowerPressureWarningThreshold") - .HasColumnType("real"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - b.Property("UpperPressureWarningThreshold") - .HasColumnType("real"); - - b.HasKey("Id"); - - b.HasIndex("Type") - .IsUnique(); - - b.ToTable("RobotModels"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotPoseTimeseries", b => - { - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("OrientationW") - .HasColumnType("real"); - - b.Property("OrientationX") - .HasColumnType("real"); - - b.Property("OrientationY") - .HasColumnType("real"); - - b.Property("OrientationZ") - .HasColumnType("real"); - - b.Property("PositionX") - .HasColumnType("real"); - - b.Property("PositionY") - .HasColumnType("real"); - - b.Property("PositionZ") - .HasColumnType("real"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Time") - .HasColumnType("timestamp with time zone"); - - b.ToTable("RobotPoseTimeseries"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotPressureTimeseries", b => - { - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("Pressure") - .HasColumnType("real"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Time") - .HasColumnType("timestamp with time zone"); - - b.ToTable("RobotPressureTimeseries"); - }); - - modelBuilder.Entity("Api.Database.Models.SafePosition", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AreaId") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("AreaId"); - - b.ToTable("SafePositions"); - }); - - modelBuilder.Entity("Api.Database.Models.Source", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("SourceId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - 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); - - b.HasOne("Api.Database.Models.DefaultLocalizationPose", "DefaultLocalizationPose") - .WithMany() - .HasForeignKey("DefaultLocalizationPoseId"); - - 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.MapMetadata", "MapMetadata", b1 => - { - b1.Property("AreaId") - .HasColumnType("text"); - - b1.Property("MapName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.HasKey("AreaId"); - - b1.ToTable("Areas"); - - b1.WithOwner() - .HasForeignKey("AreaId"); - - b1.OwnsOne("Api.Database.Models.Boundary", "Boundary", b2 => - { - b2.Property("MapMetadataAreaId") - .HasColumnType("text"); - - b2.Property("X1") - .HasColumnType("double precision"); - - b2.Property("X2") - .HasColumnType("double precision"); - - b2.Property("Y1") - .HasColumnType("double precision"); - - b2.Property("Y2") - .HasColumnType("double precision"); - - b2.Property("Z1") - .HasColumnType("double precision"); - - b2.Property("Z2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataAreaId"); - - b2.ToTable("Areas"); - - b2.WithOwner() - .HasForeignKey("MapMetadataAreaId"); - }); - - b1.OwnsOne("Api.Database.Models.TransformationMatrices", "TransformationMatrices", b2 => - { - b2.Property("MapMetadataAreaId") - .HasColumnType("text"); - - b2.Property("C1") - .HasColumnType("double precision"); - - b2.Property("C2") - .HasColumnType("double precision"); - - b2.Property("D1") - .HasColumnType("double precision"); - - b2.Property("D2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataAreaId"); - - b2.ToTable("Areas"); - - b2.WithOwner() - .HasForeignKey("MapMetadataAreaId"); - }); - - b1.Navigation("Boundary") - .IsRequired(); - - b1.Navigation("TransformationMatrices") - .IsRequired(); - }); - - b.Navigation("Deck"); - - b.Navigation("DefaultLocalizationPose"); - - b.Navigation("Installation"); - - b.Navigation("MapMetadata") - .IsRequired(); - - b.Navigation("Plant"); - }); - - modelBuilder.Entity("Api.Database.Models.Deck", b => - { - b.HasOne("Api.Database.Models.DefaultLocalizationPose", "DefaultLocalizationPose") - .WithMany() - .HasForeignKey("DefaultLocalizationPoseId"); - - 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.Navigation("DefaultLocalizationPose"); - - b.Navigation("Installation"); - - b.Navigation("Plant"); - }); - - modelBuilder.Entity("Api.Database.Models.DefaultLocalizationPose", b => - { - b.OwnsOne("Api.Database.Models.Pose", "Pose", b1 => - { - b1.Property("DefaultLocalizationPoseId") - .HasColumnType("text"); - - b1.HasKey("DefaultLocalizationPoseId"); - - b1.ToTable("DefaultLocalizationPoses"); - - b1.WithOwner() - .HasForeignKey("DefaultLocalizationPoseId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseDefaultLocalizationPoseId") - .HasColumnType("text"); - - b2.Property("W") - .HasColumnType("real"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseDefaultLocalizationPoseId"); - - b2.ToTable("DefaultLocalizationPoses"); - - b2.WithOwner() - .HasForeignKey("PoseDefaultLocalizationPoseId"); - }); - - b1.OwnsOne("Api.Database.Models.Position", "Position", b2 => - { - b2.Property("PoseDefaultLocalizationPoseId") - .HasColumnType("text"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseDefaultLocalizationPoseId"); - - b2.ToTable("DefaultLocalizationPoses"); - - b2.WithOwner() - .HasForeignKey("PoseDefaultLocalizationPoseId"); - }); - - b1.Navigation("Orientation") - .IsRequired(); - - b1.Navigation("Position") - .IsRequired(); - }); - - b.Navigation("Pose") - .IsRequired(); - }); - - modelBuilder.Entity("Api.Database.Models.MissionDefinition", b => - { - b.HasOne("Api.Database.Models.Area", "Area") - .WithMany() - .HasForeignKey("AreaId"); - - b.HasOne("Api.Database.Models.MissionRun", "LastSuccessfulRun") - .WithMany() - .HasForeignKey("LastSuccessfulRunId"); - - b.HasOne("Api.Database.Models.Source", "Source") - .WithMany() - .HasForeignKey("SourceId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Area"); - - b.Navigation("LastSuccessfulRun"); - - 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", "Map", b1 => - { - b1.Property("MissionRunId") - .HasColumnType("text"); - - b1.Property("MapName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.HasKey("MissionRunId"); - - b1.ToTable("MissionRuns"); - - b1.WithOwner() - .HasForeignKey("MissionRunId"); - - b1.OwnsOne("Api.Database.Models.Boundary", "Boundary", b2 => - { - b2.Property("MapMetadataMissionRunId") - .HasColumnType("text"); - - b2.Property("X1") - .HasColumnType("double precision"); - - b2.Property("X2") - .HasColumnType("double precision"); - - b2.Property("Y1") - .HasColumnType("double precision"); - - b2.Property("Y2") - .HasColumnType("double precision"); - - b2.Property("Z1") - .HasColumnType("double precision"); - - b2.Property("Z2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataMissionRunId"); - - b2.ToTable("MissionRuns"); - - b2.WithOwner() - .HasForeignKey("MapMetadataMissionRunId"); - }); - - b1.OwnsOne("Api.Database.Models.TransformationMatrices", "TransformationMatrices", b2 => - { - b2.Property("MapMetadataMissionRunId") - .HasColumnType("text"); - - b2.Property("C1") - .HasColumnType("double precision"); - - b2.Property("C2") - .HasColumnType("double precision"); - - b2.Property("D1") - .HasColumnType("double precision"); - - b2.Property("D2") - .HasColumnType("double precision"); - - 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("text"); - - b1.Property("Description") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b1.Property("EchoPoseId") - .HasColumnType("integer"); - - b1.Property("EchoTagLink") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.Property("EndTime") - .HasColumnType("timestamp with time zone"); - - b1.Property("IsarTaskId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.Property("MissionRunId") - .IsRequired() - .HasColumnType("text"); - - b1.Property("StartTime") - .HasColumnType("timestamp with time zone"); - - b1.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b1.Property("TagId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.Property("TaskOrder") - .HasColumnType("integer"); - - 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("text"); - - b2.Property("AnalysisType") - .HasColumnType("text"); - - b2.Property("EndTime") - .HasColumnType("timestamp with time zone"); - - b2.Property("InspectionType") - .IsRequired() - .HasColumnType("text"); - - b2.Property("InspectionUrl") - .HasMaxLength(250) - .HasColumnType("character varying(250)"); - - b2.Property("IsarStepId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b2.Property("MissionTaskId") - .IsRequired() - .HasColumnType("text"); - - b2.Property("StartTime") - .HasColumnType("timestamp with time zone"); - - b2.Property("Status") - .IsRequired() - .HasColumnType("text"); - - 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("text"); - - 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("text"); - - b2.HasKey("MissionTaskId"); - - b2.ToTable("MissionTask"); - - b2.WithOwner() - .HasForeignKey("MissionTaskId"); - - b2.OwnsOne("Api.Database.Models.Orientation", "Orientation", b3 => - { - b3.Property("PoseMissionTaskId") - .HasColumnType("text"); - - 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("text"); - - 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("Map"); - - 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) - .IsRequired(); - - 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("text"); - - b1.HasKey("RobotId"); - - b1.ToTable("Robots"); - - b1.WithOwner() - .HasForeignKey("RobotId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseRobotId") - .HasColumnType("text"); - - 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("text"); - - 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("text"); - - b1.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b1.Property("ShouldRotate270Clockwise") - .HasColumnType("boolean"); - - b1.Property("Type") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b1.Property("Url") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(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("text"); - - b1.HasKey("SafePositionId"); - - b1.ToTable("SafePositions"); - - b1.WithOwner() - .HasForeignKey("SafePositionId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseSafePositionId") - .HasColumnType("text"); - - 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("text"); - - 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/20231016120557_RenameLastRunToLastSuccessfulRun.cs b/backend/api/Migrations/20231016120557_RenameLastRunToLastSuccessfulRun.cs deleted file mode 100644 index 0d410f760..000000000 --- a/backend/api/Migrations/20231016120557_RenameLastRunToLastSuccessfulRun.cs +++ /dev/null @@ -1,60 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Api.Migrations -{ - /// - public partial class RenameLastRunToLastSuccessfulRun : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropForeignKey( - name: "FK_MissionDefinitions_MissionRuns_LastRunId", - table: "MissionDefinitions"); - - migrationBuilder.RenameColumn( - name: "LastRunId", - table: "MissionDefinitions", - newName: "LastSuccessfulRunId"); - - migrationBuilder.RenameIndex( - name: "IX_MissionDefinitions_LastRunId", - table: "MissionDefinitions", - newName: "IX_MissionDefinitions_LastSuccessfulRunId"); - - migrationBuilder.AddForeignKey( - name: "FK_MissionDefinitions_MissionRuns_LastSuccessfulRunId", - table: "MissionDefinitions", - column: "LastSuccessfulRunId", - principalTable: "MissionRuns", - principalColumn: "Id"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropForeignKey( - name: "FK_MissionDefinitions_MissionRuns_LastSuccessfulRunId", - table: "MissionDefinitions"); - - migrationBuilder.RenameColumn( - name: "LastSuccessfulRunId", - table: "MissionDefinitions", - newName: "LastRunId"); - - migrationBuilder.RenameIndex( - name: "IX_MissionDefinitions_LastSuccessfulRunId", - table: "MissionDefinitions", - newName: "IX_MissionDefinitions_LastRunId"); - - migrationBuilder.AddForeignKey( - name: "FK_MissionDefinitions_MissionRuns_LastRunId", - table: "MissionDefinitions", - column: "LastRunId", - principalTable: "MissionRuns", - principalColumn: "Id"); - } - } -} diff --git a/backend/api/Migrations/20231101135310_AddMissionQueueFrozenToRobot.Designer.cs b/backend/api/Migrations/20231101135310_AddMissionQueueFrozenToRobot.Designer.cs deleted file mode 100644 index 84c6b57ba..000000000 --- a/backend/api/Migrations/20231101135310_AddMissionQueueFrozenToRobot.Designer.cs +++ /dev/null @@ -1,1238 +0,0 @@ -// -using System; -using Api.Database.Context; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace Api.Migrations -{ - [DbContext(typeof(FlotillaDbContext))] - [Migration("20231101135310_AddMissionQueueFrozenToRobot")] - partial class AddMissionQueueFrozenToRobot - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "7.0.11") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("Api.Database.Models.Area", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("DeckId") - .HasColumnType("text"); - - b.Property("DefaultLocalizationPoseId") - .HasColumnType("text"); - - b.Property("InstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PlantId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("DeckId"); - - b.HasIndex("DefaultLocalizationPoseId"); - - b.HasIndex("InstallationId"); - - b.HasIndex("PlantId"); - - b.ToTable("Areas"); - }); - - modelBuilder.Entity("Api.Database.Models.Deck", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("DefaultLocalizationPoseId") - .HasColumnType("text"); - - b.Property("InstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PlantId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("DefaultLocalizationPoseId"); - - b.HasIndex("InstallationId"); - - b.HasIndex("PlantId"); - - b.ToTable("Decks"); - }); - - modelBuilder.Entity("Api.Database.Models.DefaultLocalizationPose", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.ToTable("DefaultLocalizationPoses"); - }); - - modelBuilder.Entity("Api.Database.Models.Installation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("InstallationCode") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.HasKey("Id"); - - b.HasIndex("InstallationCode") - .IsUnique(); - - b.ToTable("Installations"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionDefinition", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AreaId") - .HasColumnType("text"); - - b.Property("Comment") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("InspectionFrequency") - .HasColumnType("bigint"); - - b.Property("InstallationCode") - .IsRequired() - .HasColumnType("text"); - - b.Property("IsDeprecated") - .HasColumnType("boolean"); - - b.Property("LastRunId") - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("SourceId") - .IsRequired() - .HasColumnType("text"); - - 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("text"); - - b.Property("AreaId") - .HasColumnType("text"); - - b.Property("Comment") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("Description") - .HasMaxLength(450) - .HasColumnType("character varying(450)"); - - b.Property("DesiredStartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("EndTime") - .HasColumnType("timestamp with time zone"); - - b.Property("EstimatedDuration") - .HasColumnType("bigint"); - - b.Property("InstallationCode") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("IsarMissionId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("MissionRunPriority") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("StartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("StatusReason") - .HasMaxLength(450) - .HasColumnType("character varying(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("text"); - - b.Property("InstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PlantCode") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(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("text"); - - b.Property("BatteryLevel") - .HasColumnType("real"); - - b.Property("CurrentAreaId") - .HasColumnType("text"); - - b.Property("CurrentInstallation") - .IsRequired() - .HasColumnType("text"); - - b.Property("CurrentMissionId") - .HasColumnType("text"); - - b.Property("Enabled") - .HasColumnType("boolean"); - - b.Property("Host") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("IsarId") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionQueueFrozen") - .HasColumnType("boolean"); - - b.Property("ModelId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Port") - .HasColumnType("integer"); - - b.Property("PressureLevel") - .HasColumnType("real"); - - b.Property("SerialNumber") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("CurrentAreaId"); - - b.HasIndex("ModelId"); - - b.ToTable("Robots"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotBatteryTimeseries", b => - { - b.Property("BatteryLevel") - .HasColumnType("real"); - - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Time") - .HasColumnType("timestamp with time zone"); - - b.ToTable("RobotBatteryTimeseries"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotModel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AverageDurationPerTag") - .HasColumnType("real"); - - b.Property("BatteryWarningThreshold") - .HasColumnType("real"); - - b.Property("LowerPressureWarningThreshold") - .HasColumnType("real"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - b.Property("UpperPressureWarningThreshold") - .HasColumnType("real"); - - b.HasKey("Id"); - - b.HasIndex("Type") - .IsUnique(); - - b.ToTable("RobotModels"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotPoseTimeseries", b => - { - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("OrientationW") - .HasColumnType("real"); - - b.Property("OrientationX") - .HasColumnType("real"); - - b.Property("OrientationY") - .HasColumnType("real"); - - b.Property("OrientationZ") - .HasColumnType("real"); - - b.Property("PositionX") - .HasColumnType("real"); - - b.Property("PositionY") - .HasColumnType("real"); - - b.Property("PositionZ") - .HasColumnType("real"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Time") - .HasColumnType("timestamp with time zone"); - - b.ToTable("RobotPoseTimeseries"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotPressureTimeseries", b => - { - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("Pressure") - .HasColumnType("real"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Time") - .HasColumnType("timestamp with time zone"); - - b.ToTable("RobotPressureTimeseries"); - }); - - modelBuilder.Entity("Api.Database.Models.SafePosition", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AreaId") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("AreaId"); - - b.ToTable("SafePositions"); - }); - - modelBuilder.Entity("Api.Database.Models.Source", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("SourceId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - 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); - - b.HasOne("Api.Database.Models.DefaultLocalizationPose", "DefaultLocalizationPose") - .WithMany() - .HasForeignKey("DefaultLocalizationPoseId"); - - 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.MapMetadata", "MapMetadata", b1 => - { - b1.Property("AreaId") - .HasColumnType("text"); - - b1.Property("MapName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.HasKey("AreaId"); - - b1.ToTable("Areas"); - - b1.WithOwner() - .HasForeignKey("AreaId"); - - b1.OwnsOne("Api.Database.Models.Boundary", "Boundary", b2 => - { - b2.Property("MapMetadataAreaId") - .HasColumnType("text"); - - b2.Property("X1") - .HasColumnType("double precision"); - - b2.Property("X2") - .HasColumnType("double precision"); - - b2.Property("Y1") - .HasColumnType("double precision"); - - b2.Property("Y2") - .HasColumnType("double precision"); - - b2.Property("Z1") - .HasColumnType("double precision"); - - b2.Property("Z2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataAreaId"); - - b2.ToTable("Areas"); - - b2.WithOwner() - .HasForeignKey("MapMetadataAreaId"); - }); - - b1.OwnsOne("Api.Database.Models.TransformationMatrices", "TransformationMatrices", b2 => - { - b2.Property("MapMetadataAreaId") - .HasColumnType("text"); - - b2.Property("C1") - .HasColumnType("double precision"); - - b2.Property("C2") - .HasColumnType("double precision"); - - b2.Property("D1") - .HasColumnType("double precision"); - - b2.Property("D2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataAreaId"); - - b2.ToTable("Areas"); - - b2.WithOwner() - .HasForeignKey("MapMetadataAreaId"); - }); - - b1.Navigation("Boundary") - .IsRequired(); - - b1.Navigation("TransformationMatrices") - .IsRequired(); - }); - - b.Navigation("Deck"); - - b.Navigation("DefaultLocalizationPose"); - - b.Navigation("Installation"); - - b.Navigation("MapMetadata") - .IsRequired(); - - b.Navigation("Plant"); - }); - - modelBuilder.Entity("Api.Database.Models.Deck", b => - { - b.HasOne("Api.Database.Models.DefaultLocalizationPose", "DefaultLocalizationPose") - .WithMany() - .HasForeignKey("DefaultLocalizationPoseId"); - - 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.Navigation("DefaultLocalizationPose"); - - b.Navigation("Installation"); - - b.Navigation("Plant"); - }); - - modelBuilder.Entity("Api.Database.Models.DefaultLocalizationPose", b => - { - b.OwnsOne("Api.Database.Models.Pose", "Pose", b1 => - { - b1.Property("DefaultLocalizationPoseId") - .HasColumnType("text"); - - b1.HasKey("DefaultLocalizationPoseId"); - - b1.ToTable("DefaultLocalizationPoses"); - - b1.WithOwner() - .HasForeignKey("DefaultLocalizationPoseId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseDefaultLocalizationPoseId") - .HasColumnType("text"); - - b2.Property("W") - .HasColumnType("real"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseDefaultLocalizationPoseId"); - - b2.ToTable("DefaultLocalizationPoses"); - - b2.WithOwner() - .HasForeignKey("PoseDefaultLocalizationPoseId"); - }); - - b1.OwnsOne("Api.Database.Models.Position", "Position", b2 => - { - b2.Property("PoseDefaultLocalizationPoseId") - .HasColumnType("text"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseDefaultLocalizationPoseId"); - - b2.ToTable("DefaultLocalizationPoses"); - - b2.WithOwner() - .HasForeignKey("PoseDefaultLocalizationPoseId"); - }); - - b1.Navigation("Orientation") - .IsRequired(); - - b1.Navigation("Position") - .IsRequired(); - }); - - b.Navigation("Pose") - .IsRequired(); - }); - - 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", "Map", b1 => - { - b1.Property("MissionRunId") - .HasColumnType("text"); - - b1.Property("MapName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.HasKey("MissionRunId"); - - b1.ToTable("MissionRuns"); - - b1.WithOwner() - .HasForeignKey("MissionRunId"); - - b1.OwnsOne("Api.Database.Models.Boundary", "Boundary", b2 => - { - b2.Property("MapMetadataMissionRunId") - .HasColumnType("text"); - - b2.Property("X1") - .HasColumnType("double precision"); - - b2.Property("X2") - .HasColumnType("double precision"); - - b2.Property("Y1") - .HasColumnType("double precision"); - - b2.Property("Y2") - .HasColumnType("double precision"); - - b2.Property("Z1") - .HasColumnType("double precision"); - - b2.Property("Z2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataMissionRunId"); - - b2.ToTable("MissionRuns"); - - b2.WithOwner() - .HasForeignKey("MapMetadataMissionRunId"); - }); - - b1.OwnsOne("Api.Database.Models.TransformationMatrices", "TransformationMatrices", b2 => - { - b2.Property("MapMetadataMissionRunId") - .HasColumnType("text"); - - b2.Property("C1") - .HasColumnType("double precision"); - - b2.Property("C2") - .HasColumnType("double precision"); - - b2.Property("D1") - .HasColumnType("double precision"); - - b2.Property("D2") - .HasColumnType("double precision"); - - 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("text"); - - b1.Property("Description") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b1.Property("EchoPoseId") - .HasColumnType("integer"); - - b1.Property("EchoTagLink") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.Property("EndTime") - .HasColumnType("timestamp with time zone"); - - b1.Property("IsarTaskId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.Property("MissionRunId") - .IsRequired() - .HasColumnType("text"); - - b1.Property("StartTime") - .HasColumnType("timestamp with time zone"); - - b1.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b1.Property("TagId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.Property("TaskOrder") - .HasColumnType("integer"); - - 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("text"); - - b2.Property("AnalysisType") - .HasColumnType("text"); - - b2.Property("EndTime") - .HasColumnType("timestamp with time zone"); - - b2.Property("InspectionType") - .IsRequired() - .HasColumnType("text"); - - b2.Property("InspectionUrl") - .HasMaxLength(250) - .HasColumnType("character varying(250)"); - - b2.Property("IsarStepId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b2.Property("MissionTaskId") - .IsRequired() - .HasColumnType("text"); - - b2.Property("StartTime") - .HasColumnType("timestamp with time zone"); - - b2.Property("Status") - .IsRequired() - .HasColumnType("text"); - - 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("text"); - - 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("text"); - - b2.HasKey("MissionTaskId"); - - b2.ToTable("MissionTask"); - - b2.WithOwner() - .HasForeignKey("MissionTaskId"); - - b2.OwnsOne("Api.Database.Models.Orientation", "Orientation", b3 => - { - b3.Property("PoseMissionTaskId") - .HasColumnType("text"); - - 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("text"); - - 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("Map"); - - 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) - .IsRequired(); - - 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("text"); - - b1.HasKey("RobotId"); - - b1.ToTable("Robots"); - - b1.WithOwner() - .HasForeignKey("RobotId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseRobotId") - .HasColumnType("text"); - - 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("text"); - - 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("text"); - - b1.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b1.Property("ShouldRotate270Clockwise") - .HasColumnType("boolean"); - - b1.Property("Type") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b1.Property("Url") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(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("text"); - - b1.HasKey("SafePositionId"); - - b1.ToTable("SafePositions"); - - b1.WithOwner() - .HasForeignKey("SafePositionId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseSafePositionId") - .HasColumnType("text"); - - 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("text"); - - 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/20231101135310_AddMissionQueueFrozenToRobot.cs b/backend/api/Migrations/20231101135310_AddMissionQueueFrozenToRobot.cs deleted file mode 100644 index c5e3c9ccc..000000000 --- a/backend/api/Migrations/20231101135310_AddMissionQueueFrozenToRobot.cs +++ /dev/null @@ -1,40 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Api.Migrations -{ - /// - public partial class AddMissionQueueFrozenToRobot : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "MissionQueueFrozen", - table: "Robots", - type: "boolean", - nullable: false, - defaultValue: false); - - migrationBuilder.AddColumn( - name: "MissionRunPriority", - table: "MissionRuns", - type: "text", - nullable: false, - defaultValue: ""); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "MissionQueueFrozen", - table: "Robots"); - - migrationBuilder.DropColumn( - name: "MissionRunPriority", - table: "MissionRuns"); - } - } -} diff --git a/backend/api/Migrations/20231106131042_ChangeToDateTime.Designer.cs b/backend/api/Migrations/20231106131042_ChangeToDateTime.Designer.cs deleted file mode 100644 index 1b82233af..000000000 --- a/backend/api/Migrations/20231106131042_ChangeToDateTime.Designer.cs +++ /dev/null @@ -1,1238 +0,0 @@ -// -using System; -using Api.Database.Context; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace Api.Migrations -{ - [DbContext(typeof(FlotillaDbContext))] - [Migration("20231106131042_ChangeToDateTime")] - partial class ChangeToDateTime - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "7.0.11") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("Api.Database.Models.Area", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("DeckId") - .HasColumnType("text"); - - b.Property("DefaultLocalizationPoseId") - .HasColumnType("text"); - - b.Property("InstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PlantId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("DeckId"); - - b.HasIndex("DefaultLocalizationPoseId"); - - b.HasIndex("InstallationId"); - - b.HasIndex("PlantId"); - - b.ToTable("Areas"); - }); - - modelBuilder.Entity("Api.Database.Models.Deck", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("DefaultLocalizationPoseId") - .HasColumnType("text"); - - b.Property("InstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PlantId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("DefaultLocalizationPoseId"); - - b.HasIndex("InstallationId"); - - b.HasIndex("PlantId"); - - b.ToTable("Decks"); - }); - - modelBuilder.Entity("Api.Database.Models.DefaultLocalizationPose", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.ToTable("DefaultLocalizationPoses"); - }); - - modelBuilder.Entity("Api.Database.Models.Installation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("InstallationCode") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.HasKey("Id"); - - b.HasIndex("InstallationCode") - .IsUnique(); - - b.ToTable("Installations"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionDefinition", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AreaId") - .HasColumnType("text"); - - b.Property("Comment") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("InspectionFrequency") - .HasColumnType("bigint"); - - b.Property("InstallationCode") - .IsRequired() - .HasColumnType("text"); - - b.Property("IsDeprecated") - .HasColumnType("boolean"); - - b.Property("LastRunId") - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("SourceId") - .IsRequired() - .HasColumnType("text"); - - 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("text"); - - b.Property("AreaId") - .HasColumnType("text"); - - b.Property("Comment") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("Description") - .HasMaxLength(450) - .HasColumnType("character varying(450)"); - - b.Property("DesiredStartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("EndTime") - .HasColumnType("timestamp with time zone"); - - b.Property("EstimatedDuration") - .HasColumnType("bigint"); - - b.Property("InstallationCode") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("IsarMissionId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("MissionRunPriority") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("StartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("StatusReason") - .HasMaxLength(450) - .HasColumnType("character varying(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("text"); - - b.Property("InstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PlantCode") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(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("text"); - - b.Property("BatteryLevel") - .HasColumnType("real"); - - b.Property("CurrentAreaId") - .HasColumnType("text"); - - b.Property("CurrentInstallation") - .IsRequired() - .HasColumnType("text"); - - b.Property("CurrentMissionId") - .HasColumnType("text"); - - b.Property("Enabled") - .HasColumnType("boolean"); - - b.Property("Host") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("IsarId") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionQueueFrozen") - .HasColumnType("boolean"); - - b.Property("ModelId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Port") - .HasColumnType("integer"); - - b.Property("PressureLevel") - .HasColumnType("real"); - - b.Property("SerialNumber") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("CurrentAreaId"); - - b.HasIndex("ModelId"); - - b.ToTable("Robots"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotBatteryTimeseries", b => - { - b.Property("BatteryLevel") - .HasColumnType("real"); - - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Time") - .HasColumnType("timestamp with time zone"); - - b.ToTable("RobotBatteryTimeseries"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotModel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AverageDurationPerTag") - .HasColumnType("real"); - - b.Property("BatteryWarningThreshold") - .HasColumnType("real"); - - b.Property("LowerPressureWarningThreshold") - .HasColumnType("real"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - b.Property("UpperPressureWarningThreshold") - .HasColumnType("real"); - - b.HasKey("Id"); - - b.HasIndex("Type") - .IsUnique(); - - b.ToTable("RobotModels"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotPoseTimeseries", b => - { - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("OrientationW") - .HasColumnType("real"); - - b.Property("OrientationX") - .HasColumnType("real"); - - b.Property("OrientationY") - .HasColumnType("real"); - - b.Property("OrientationZ") - .HasColumnType("real"); - - b.Property("PositionX") - .HasColumnType("real"); - - b.Property("PositionY") - .HasColumnType("real"); - - b.Property("PositionZ") - .HasColumnType("real"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Time") - .HasColumnType("timestamp with time zone"); - - b.ToTable("RobotPoseTimeseries"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotPressureTimeseries", b => - { - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("Pressure") - .HasColumnType("real"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Time") - .HasColumnType("timestamp with time zone"); - - b.ToTable("RobotPressureTimeseries"); - }); - - modelBuilder.Entity("Api.Database.Models.SafePosition", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AreaId") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("AreaId"); - - b.ToTable("SafePositions"); - }); - - modelBuilder.Entity("Api.Database.Models.Source", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("SourceId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - 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); - - b.HasOne("Api.Database.Models.DefaultLocalizationPose", "DefaultLocalizationPose") - .WithMany() - .HasForeignKey("DefaultLocalizationPoseId"); - - 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.MapMetadata", "MapMetadata", b1 => - { - b1.Property("AreaId") - .HasColumnType("text"); - - b1.Property("MapName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.HasKey("AreaId"); - - b1.ToTable("Areas"); - - b1.WithOwner() - .HasForeignKey("AreaId"); - - b1.OwnsOne("Api.Database.Models.Boundary", "Boundary", b2 => - { - b2.Property("MapMetadataAreaId") - .HasColumnType("text"); - - b2.Property("X1") - .HasColumnType("double precision"); - - b2.Property("X2") - .HasColumnType("double precision"); - - b2.Property("Y1") - .HasColumnType("double precision"); - - b2.Property("Y2") - .HasColumnType("double precision"); - - b2.Property("Z1") - .HasColumnType("double precision"); - - b2.Property("Z2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataAreaId"); - - b2.ToTable("Areas"); - - b2.WithOwner() - .HasForeignKey("MapMetadataAreaId"); - }); - - b1.OwnsOne("Api.Database.Models.TransformationMatrices", "TransformationMatrices", b2 => - { - b2.Property("MapMetadataAreaId") - .HasColumnType("text"); - - b2.Property("C1") - .HasColumnType("double precision"); - - b2.Property("C2") - .HasColumnType("double precision"); - - b2.Property("D1") - .HasColumnType("double precision"); - - b2.Property("D2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataAreaId"); - - b2.ToTable("Areas"); - - b2.WithOwner() - .HasForeignKey("MapMetadataAreaId"); - }); - - b1.Navigation("Boundary") - .IsRequired(); - - b1.Navigation("TransformationMatrices") - .IsRequired(); - }); - - b.Navigation("Deck"); - - b.Navigation("DefaultLocalizationPose"); - - b.Navigation("Installation"); - - b.Navigation("MapMetadata") - .IsRequired(); - - b.Navigation("Plant"); - }); - - modelBuilder.Entity("Api.Database.Models.Deck", b => - { - b.HasOne("Api.Database.Models.DefaultLocalizationPose", "DefaultLocalizationPose") - .WithMany() - .HasForeignKey("DefaultLocalizationPoseId"); - - 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.Navigation("DefaultLocalizationPose"); - - b.Navigation("Installation"); - - b.Navigation("Plant"); - }); - - modelBuilder.Entity("Api.Database.Models.DefaultLocalizationPose", b => - { - b.OwnsOne("Api.Database.Models.Pose", "Pose", b1 => - { - b1.Property("DefaultLocalizationPoseId") - .HasColumnType("text"); - - b1.HasKey("DefaultLocalizationPoseId"); - - b1.ToTable("DefaultLocalizationPoses"); - - b1.WithOwner() - .HasForeignKey("DefaultLocalizationPoseId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseDefaultLocalizationPoseId") - .HasColumnType("text"); - - b2.Property("W") - .HasColumnType("real"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseDefaultLocalizationPoseId"); - - b2.ToTable("DefaultLocalizationPoses"); - - b2.WithOwner() - .HasForeignKey("PoseDefaultLocalizationPoseId"); - }); - - b1.OwnsOne("Api.Database.Models.Position", "Position", b2 => - { - b2.Property("PoseDefaultLocalizationPoseId") - .HasColumnType("text"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseDefaultLocalizationPoseId"); - - b2.ToTable("DefaultLocalizationPoses"); - - b2.WithOwner() - .HasForeignKey("PoseDefaultLocalizationPoseId"); - }); - - b1.Navigation("Orientation") - .IsRequired(); - - b1.Navigation("Position") - .IsRequired(); - }); - - b.Navigation("Pose") - .IsRequired(); - }); - - 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", "Map", b1 => - { - b1.Property("MissionRunId") - .HasColumnType("text"); - - b1.Property("MapName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.HasKey("MissionRunId"); - - b1.ToTable("MissionRuns"); - - b1.WithOwner() - .HasForeignKey("MissionRunId"); - - b1.OwnsOne("Api.Database.Models.Boundary", "Boundary", b2 => - { - b2.Property("MapMetadataMissionRunId") - .HasColumnType("text"); - - b2.Property("X1") - .HasColumnType("double precision"); - - b2.Property("X2") - .HasColumnType("double precision"); - - b2.Property("Y1") - .HasColumnType("double precision"); - - b2.Property("Y2") - .HasColumnType("double precision"); - - b2.Property("Z1") - .HasColumnType("double precision"); - - b2.Property("Z2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataMissionRunId"); - - b2.ToTable("MissionRuns"); - - b2.WithOwner() - .HasForeignKey("MapMetadataMissionRunId"); - }); - - b1.OwnsOne("Api.Database.Models.TransformationMatrices", "TransformationMatrices", b2 => - { - b2.Property("MapMetadataMissionRunId") - .HasColumnType("text"); - - b2.Property("C1") - .HasColumnType("double precision"); - - b2.Property("C2") - .HasColumnType("double precision"); - - b2.Property("D1") - .HasColumnType("double precision"); - - b2.Property("D2") - .HasColumnType("double precision"); - - 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("text"); - - b1.Property("Description") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b1.Property("EchoPoseId") - .HasColumnType("integer"); - - b1.Property("EchoTagLink") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.Property("EndTime") - .HasColumnType("timestamp with time zone"); - - b1.Property("IsarTaskId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.Property("MissionRunId") - .IsRequired() - .HasColumnType("text"); - - b1.Property("StartTime") - .HasColumnType("timestamp with time zone"); - - b1.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b1.Property("TagId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.Property("TaskOrder") - .HasColumnType("integer"); - - 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("text"); - - b2.Property("AnalysisType") - .HasColumnType("text"); - - b2.Property("EndTime") - .HasColumnType("timestamp with time zone"); - - b2.Property("InspectionType") - .IsRequired() - .HasColumnType("text"); - - b2.Property("InspectionUrl") - .HasMaxLength(250) - .HasColumnType("character varying(250)"); - - b2.Property("IsarStepId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b2.Property("MissionTaskId") - .IsRequired() - .HasColumnType("text"); - - b2.Property("StartTime") - .HasColumnType("timestamp with time zone"); - - b2.Property("Status") - .IsRequired() - .HasColumnType("text"); - - 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("text"); - - 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("text"); - - b2.HasKey("MissionTaskId"); - - b2.ToTable("MissionTask"); - - b2.WithOwner() - .HasForeignKey("MissionTaskId"); - - b2.OwnsOne("Api.Database.Models.Orientation", "Orientation", b3 => - { - b3.Property("PoseMissionTaskId") - .HasColumnType("text"); - - 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("text"); - - 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("Map"); - - 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) - .IsRequired(); - - 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("text"); - - b1.HasKey("RobotId"); - - b1.ToTable("Robots"); - - b1.WithOwner() - .HasForeignKey("RobotId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseRobotId") - .HasColumnType("text"); - - 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("text"); - - 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("text"); - - b1.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b1.Property("ShouldRotate270Clockwise") - .HasColumnType("boolean"); - - b1.Property("Type") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b1.Property("Url") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(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("text"); - - b1.HasKey("SafePositionId"); - - b1.ToTable("SafePositions"); - - b1.WithOwner() - .HasForeignKey("SafePositionId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseSafePositionId") - .HasColumnType("text"); - - 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("text"); - - 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/20231106131042_ChangeToDateTime.cs b/backend/api/Migrations/20231106131042_ChangeToDateTime.cs deleted file mode 100644 index 2706175c9..000000000 --- a/backend/api/Migrations/20231106131042_ChangeToDateTime.cs +++ /dev/null @@ -1,22 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Api.Migrations -{ - /// - public partial class ChangeToDateTime : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - - } - } -} diff --git a/backend/api/Migrations/20231106153232_AddInspectionFindings.Designer.cs b/backend/api/Migrations/20231106153232_AddInspectionFindings.Designer.cs deleted file mode 100644 index 14a1da874..000000000 --- a/backend/api/Migrations/20231106153232_AddInspectionFindings.Designer.cs +++ /dev/null @@ -1,1275 +0,0 @@ -// -using System; -using Api.Database.Context; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace Api.Migrations -{ - [DbContext(typeof(FlotillaDbContext))] - [Migration("20231106153232_AddInspectionFindings")] - partial class AddInspectionFindings - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "7.0.11") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("Api.Database.Models.Area", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("DeckId") - .HasColumnType("text"); - - b.Property("DefaultLocalizationPoseId") - .HasColumnType("text"); - - b.Property("InstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PlantId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("DeckId"); - - b.HasIndex("DefaultLocalizationPoseId"); - - b.HasIndex("InstallationId"); - - b.HasIndex("PlantId"); - - b.ToTable("Areas"); - }); - - modelBuilder.Entity("Api.Database.Models.Deck", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("DefaultLocalizationPoseId") - .HasColumnType("text"); - - b.Property("InstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PlantId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("DefaultLocalizationPoseId"); - - b.HasIndex("InstallationId"); - - b.HasIndex("PlantId"); - - b.ToTable("Decks"); - }); - - modelBuilder.Entity("Api.Database.Models.DefaultLocalizationPose", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.ToTable("DefaultLocalizationPoses"); - }); - - modelBuilder.Entity("Api.Database.Models.Installation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("InstallationCode") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.HasKey("Id"); - - b.HasIndex("InstallationCode") - .IsUnique(); - - b.ToTable("Installations"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionDefinition", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AreaId") - .HasColumnType("text"); - - b.Property("Comment") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("InspectionFrequency") - .HasColumnType("bigint"); - - b.Property("InstallationCode") - .IsRequired() - .HasColumnType("text"); - - b.Property("IsDeprecated") - .HasColumnType("boolean"); - - b.Property("LastRunId") - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("SourceId") - .IsRequired() - .HasColumnType("text"); - - 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("text"); - - b.Property("AreaId") - .HasColumnType("text"); - - b.Property("Comment") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("Description") - .HasMaxLength(450) - .HasColumnType("character varying(450)"); - - b.Property("DesiredStartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("EndTime") - .HasColumnType("timestamp with time zone"); - - b.Property("EstimatedDuration") - .HasColumnType("bigint"); - - b.Property("InstallationCode") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("IsarMissionId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("MissionRunPriority") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("StartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("StatusReason") - .HasMaxLength(450) - .HasColumnType("character varying(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("text"); - - b.Property("InstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PlantCode") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(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("text"); - - b.Property("BatteryLevel") - .HasColumnType("real"); - - b.Property("CurrentAreaId") - .HasColumnType("text"); - - b.Property("CurrentInstallation") - .IsRequired() - .HasColumnType("text"); - - b.Property("CurrentMissionId") - .HasColumnType("text"); - - b.Property("Enabled") - .HasColumnType("boolean"); - - b.Property("Host") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("IsarId") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionQueueFrozen") - .HasColumnType("boolean"); - - b.Property("ModelId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Port") - .HasColumnType("integer"); - - b.Property("PressureLevel") - .HasColumnType("real"); - - b.Property("SerialNumber") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("CurrentAreaId"); - - b.HasIndex("ModelId"); - - b.ToTable("Robots"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotBatteryTimeseries", b => - { - b.Property("BatteryLevel") - .HasColumnType("real"); - - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Time") - .HasColumnType("timestamp with time zone"); - - b.ToTable("RobotBatteryTimeseries"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotModel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AverageDurationPerTag") - .HasColumnType("real"); - - b.Property("BatteryWarningThreshold") - .HasColumnType("real"); - - b.Property("LowerPressureWarningThreshold") - .HasColumnType("real"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - b.Property("UpperPressureWarningThreshold") - .HasColumnType("real"); - - b.HasKey("Id"); - - b.HasIndex("Type") - .IsUnique(); - - b.ToTable("RobotModels"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotPoseTimeseries", b => - { - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("OrientationW") - .HasColumnType("real"); - - b.Property("OrientationX") - .HasColumnType("real"); - - b.Property("OrientationY") - .HasColumnType("real"); - - b.Property("OrientationZ") - .HasColumnType("real"); - - b.Property("PositionX") - .HasColumnType("real"); - - b.Property("PositionY") - .HasColumnType("real"); - - b.Property("PositionZ") - .HasColumnType("real"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Time") - .HasColumnType("timestamp with time zone"); - - b.ToTable("RobotPoseTimeseries"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotPressureTimeseries", b => - { - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("Pressure") - .HasColumnType("real"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Time") - .HasColumnType("timestamp with time zone"); - - b.ToTable("RobotPressureTimeseries"); - }); - - modelBuilder.Entity("Api.Database.Models.SafePosition", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AreaId") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("AreaId"); - - b.ToTable("SafePositions"); - }); - - modelBuilder.Entity("Api.Database.Models.Source", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("SourceId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - 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); - - b.HasOne("Api.Database.Models.DefaultLocalizationPose", "DefaultLocalizationPose") - .WithMany() - .HasForeignKey("DefaultLocalizationPoseId"); - - 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.MapMetadata", "MapMetadata", b1 => - { - b1.Property("AreaId") - .HasColumnType("text"); - - b1.Property("MapName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.HasKey("AreaId"); - - b1.ToTable("Areas"); - - b1.WithOwner() - .HasForeignKey("AreaId"); - - b1.OwnsOne("Api.Database.Models.Boundary", "Boundary", b2 => - { - b2.Property("MapMetadataAreaId") - .HasColumnType("text"); - - b2.Property("X1") - .HasColumnType("double precision"); - - b2.Property("X2") - .HasColumnType("double precision"); - - b2.Property("Y1") - .HasColumnType("double precision"); - - b2.Property("Y2") - .HasColumnType("double precision"); - - b2.Property("Z1") - .HasColumnType("double precision"); - - b2.Property("Z2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataAreaId"); - - b2.ToTable("Areas"); - - b2.WithOwner() - .HasForeignKey("MapMetadataAreaId"); - }); - - b1.OwnsOne("Api.Database.Models.TransformationMatrices", "TransformationMatrices", b2 => - { - b2.Property("MapMetadataAreaId") - .HasColumnType("text"); - - b2.Property("C1") - .HasColumnType("double precision"); - - b2.Property("C2") - .HasColumnType("double precision"); - - b2.Property("D1") - .HasColumnType("double precision"); - - b2.Property("D2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataAreaId"); - - b2.ToTable("Areas"); - - b2.WithOwner() - .HasForeignKey("MapMetadataAreaId"); - }); - - b1.Navigation("Boundary") - .IsRequired(); - - b1.Navigation("TransformationMatrices") - .IsRequired(); - }); - - b.Navigation("Deck"); - - b.Navigation("DefaultLocalizationPose"); - - b.Navigation("Installation"); - - b.Navigation("MapMetadata") - .IsRequired(); - - b.Navigation("Plant"); - }); - - modelBuilder.Entity("Api.Database.Models.Deck", b => - { - b.HasOne("Api.Database.Models.DefaultLocalizationPose", "DefaultLocalizationPose") - .WithMany() - .HasForeignKey("DefaultLocalizationPoseId"); - - 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.Navigation("DefaultLocalizationPose"); - - b.Navigation("Installation"); - - b.Navigation("Plant"); - }); - - modelBuilder.Entity("Api.Database.Models.DefaultLocalizationPose", b => - { - b.OwnsOne("Api.Database.Models.Pose", "Pose", b1 => - { - b1.Property("DefaultLocalizationPoseId") - .HasColumnType("text"); - - b1.HasKey("DefaultLocalizationPoseId"); - - b1.ToTable("DefaultLocalizationPoses"); - - b1.WithOwner() - .HasForeignKey("DefaultLocalizationPoseId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseDefaultLocalizationPoseId") - .HasColumnType("text"); - - b2.Property("W") - .HasColumnType("real"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseDefaultLocalizationPoseId"); - - b2.ToTable("DefaultLocalizationPoses"); - - b2.WithOwner() - .HasForeignKey("PoseDefaultLocalizationPoseId"); - }); - - b1.OwnsOne("Api.Database.Models.Position", "Position", b2 => - { - b2.Property("PoseDefaultLocalizationPoseId") - .HasColumnType("text"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseDefaultLocalizationPoseId"); - - b2.ToTable("DefaultLocalizationPoses"); - - b2.WithOwner() - .HasForeignKey("PoseDefaultLocalizationPoseId"); - }); - - b1.Navigation("Orientation") - .IsRequired(); - - b1.Navigation("Position") - .IsRequired(); - }); - - b.Navigation("Pose") - .IsRequired(); - }); - - 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", "Map", b1 => - { - b1.Property("MissionRunId") - .HasColumnType("text"); - - b1.Property("MapName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.HasKey("MissionRunId"); - - b1.ToTable("MissionRuns"); - - b1.WithOwner() - .HasForeignKey("MissionRunId"); - - b1.OwnsOne("Api.Database.Models.Boundary", "Boundary", b2 => - { - b2.Property("MapMetadataMissionRunId") - .HasColumnType("text"); - - b2.Property("X1") - .HasColumnType("double precision"); - - b2.Property("X2") - .HasColumnType("double precision"); - - b2.Property("Y1") - .HasColumnType("double precision"); - - b2.Property("Y2") - .HasColumnType("double precision"); - - b2.Property("Z1") - .HasColumnType("double precision"); - - b2.Property("Z2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataMissionRunId"); - - b2.ToTable("MissionRuns"); - - b2.WithOwner() - .HasForeignKey("MapMetadataMissionRunId"); - }); - - b1.OwnsOne("Api.Database.Models.TransformationMatrices", "TransformationMatrices", b2 => - { - b2.Property("MapMetadataMissionRunId") - .HasColumnType("text"); - - b2.Property("C1") - .HasColumnType("double precision"); - - b2.Property("C2") - .HasColumnType("double precision"); - - b2.Property("D1") - .HasColumnType("double precision"); - - b2.Property("D2") - .HasColumnType("double precision"); - - 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("text"); - - b1.Property("Description") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b1.Property("EchoPoseId") - .HasColumnType("integer"); - - b1.Property("EchoTagLink") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.Property("EndTime") - .HasColumnType("timestamp with time zone"); - - b1.Property("IsarTaskId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.Property("MissionRunId") - .IsRequired() - .HasColumnType("text"); - - b1.Property("StartTime") - .HasColumnType("timestamp with time zone"); - - b1.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b1.Property("TagId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.Property("TaskOrder") - .HasColumnType("integer"); - - 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("text"); - - b2.Property("AnalysisType") - .HasColumnType("text"); - - b2.Property("EndTime") - .HasColumnType("timestamp with time zone"); - - b2.Property("InspectionType") - .IsRequired() - .HasColumnType("text"); - - b2.Property("InspectionUrl") - .HasMaxLength(250) - .HasColumnType("character varying(250)"); - - b2.Property("IsarStepId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b2.Property("MissionTaskId") - .IsRequired() - .HasColumnType("text"); - - b2.Property("StartTime") - .HasColumnType("timestamp with time zone"); - - b2.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b2.Property("VideoDuration") - .HasColumnType("real"); - - b2.HasKey("Id"); - - b2.HasIndex("MissionTaskId"); - - b2.ToTable("Inspection"); - - b2.WithOwner() - .HasForeignKey("MissionTaskId"); - - b2.OwnsMany("Api.Database.Models.InspectionFindings", "InspectionFindings", b3 => - { - b3.Property("InspectionId") - .HasColumnType("text"); - - b3.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b3.Property("Id")); - - b3.Property("Area") - .IsRequired() - .HasColumnType("text"); - - b3.Property("FindingsTag") - .IsRequired() - .HasColumnType("text"); - - b3.Property("InspectionDate") - .IsRequired() - .HasColumnType("text"); - - b3.Property("RobotName") - .IsRequired() - .HasColumnType("text"); - - b3.HasKey("InspectionId", "Id"); - - b3.ToTable("InspectionFindings"); - - b3.WithOwner() - .HasForeignKey("InspectionId"); - }); - - b2.Navigation("InspectionFindings"); - }); - - b1.OwnsOne("Api.Database.Models.Position", "InspectionTarget", b2 => - { - b2.Property("MissionTaskId") - .HasColumnType("text"); - - 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("text"); - - b2.HasKey("MissionTaskId"); - - b2.ToTable("MissionTask"); - - b2.WithOwner() - .HasForeignKey("MissionTaskId"); - - b2.OwnsOne("Api.Database.Models.Orientation", "Orientation", b3 => - { - b3.Property("PoseMissionTaskId") - .HasColumnType("text"); - - 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("text"); - - 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("Map"); - - 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) - .IsRequired(); - - 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("text"); - - b1.HasKey("RobotId"); - - b1.ToTable("Robots"); - - b1.WithOwner() - .HasForeignKey("RobotId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseRobotId") - .HasColumnType("text"); - - 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("text"); - - 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("text"); - - b1.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b1.Property("ShouldRotate270Clockwise") - .HasColumnType("boolean"); - - b1.Property("Type") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b1.Property("Url") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(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("text"); - - b1.HasKey("SafePositionId"); - - b1.ToTable("SafePositions"); - - b1.WithOwner() - .HasForeignKey("SafePositionId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseSafePositionId") - .HasColumnType("text"); - - 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("text"); - - 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/20231106153232_AddInspectionFindings.cs b/backend/api/Migrations/20231106153232_AddInspectionFindings.cs deleted file mode 100644 index 17286db8a..000000000 --- a/backend/api/Migrations/20231106153232_AddInspectionFindings.cs +++ /dev/null @@ -1,45 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace Api.Migrations -{ - /// - public partial class AddInspectionFindings : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "InspectionFindings", - columns: table => new - { - InspectionId = table.Column(type: "text", nullable: false), - Id = table.Column(type: "integer", nullable: false) - .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), - RobotName = table.Column(type: "text", nullable: false), - InspectionDate = table.Column(type: "text", nullable: false), - Area = table.Column(type: "text", nullable: false), - FindingsTag = table.Column(type: "text", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_InspectionFindings", x => new { x.InspectionId, x.Id }); - table.ForeignKey( - name: "FK_InspectionFindings_Inspection_InspectionId", - column: x => x.InspectionId, - principalTable: "Inspection", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "InspectionFindings"); - } - } -} diff --git a/backend/api/Migrations/20231109194856_MakeInspectionNotOwned.Designer.cs b/backend/api/Migrations/20231109194856_MakeInspectionNotOwned.Designer.cs deleted file mode 100644 index 62e3dd45a..000000000 --- a/backend/api/Migrations/20231109194856_MakeInspectionNotOwned.Designer.cs +++ /dev/null @@ -1,1275 +0,0 @@ -// -using System; -using Api.Database.Context; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace Api.Migrations -{ - [DbContext(typeof(FlotillaDbContext))] - [Migration("20231109194856_MakeInspectionNotOwned")] - partial class MakeInspectionNotOwned - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "7.0.11") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("Api.Database.Models.Area", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("DeckId") - .HasColumnType("text"); - - b.Property("DefaultLocalizationPoseId") - .HasColumnType("text"); - - b.Property("InstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PlantId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("DeckId"); - - b.HasIndex("DefaultLocalizationPoseId"); - - b.HasIndex("InstallationId"); - - b.HasIndex("PlantId"); - - b.ToTable("Areas"); - }); - - modelBuilder.Entity("Api.Database.Models.Deck", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("DefaultLocalizationPoseId") - .HasColumnType("text"); - - b.Property("InstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PlantId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("DefaultLocalizationPoseId"); - - b.HasIndex("InstallationId"); - - b.HasIndex("PlantId"); - - b.ToTable("Decks"); - }); - - modelBuilder.Entity("Api.Database.Models.DefaultLocalizationPose", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.ToTable("DefaultLocalizationPoses"); - }); - - modelBuilder.Entity("Api.Database.Models.Installation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("InstallationCode") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.HasKey("Id"); - - b.HasIndex("InstallationCode") - .IsUnique(); - - b.ToTable("Installations"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionDefinition", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AreaId") - .HasColumnType("text"); - - b.Property("Comment") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("InspectionFrequency") - .HasColumnType("bigint"); - - b.Property("InstallationCode") - .IsRequired() - .HasColumnType("text"); - - b.Property("IsDeprecated") - .HasColumnType("boolean"); - - b.Property("LastSuccessfulRunId") - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("SourceId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("AreaId"); - - b.HasIndex("LastSuccessfulRunId"); - - b.HasIndex("SourceId"); - - b.ToTable("MissionDefinitions"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionRun", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AreaId") - .HasColumnType("text"); - - b.Property("Comment") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("Description") - .HasMaxLength(450) - .HasColumnType("character varying(450)"); - - b.Property("DesiredStartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("EndTime") - .HasColumnType("timestamp with time zone"); - - b.Property("EstimatedDuration") - .HasColumnType("bigint"); - - b.Property("InstallationCode") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("IsarMissionId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("MissionRunPriority") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("StartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("StatusReason") - .HasMaxLength(450) - .HasColumnType("character varying(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("text"); - - b.Property("InstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PlantCode") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(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("text"); - - b.Property("BatteryLevel") - .HasColumnType("real"); - - b.Property("CurrentAreaId") - .HasColumnType("text"); - - b.Property("CurrentInstallation") - .IsRequired() - .HasColumnType("text"); - - b.Property("CurrentMissionId") - .HasColumnType("text"); - - b.Property("Enabled") - .HasColumnType("boolean"); - - b.Property("Host") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("IsarId") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionQueueFrozen") - .HasColumnType("boolean"); - - b.Property("ModelId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Port") - .HasColumnType("integer"); - - b.Property("PressureLevel") - .HasColumnType("real"); - - b.Property("SerialNumber") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("CurrentAreaId"); - - b.HasIndex("ModelId"); - - b.ToTable("Robots"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotBatteryTimeseries", b => - { - b.Property("BatteryLevel") - .HasColumnType("real"); - - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Time") - .HasColumnType("timestamp with time zone"); - - b.ToTable("RobotBatteryTimeseries"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotModel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AverageDurationPerTag") - .HasColumnType("real"); - - b.Property("BatteryWarningThreshold") - .HasColumnType("real"); - - b.Property("LowerPressureWarningThreshold") - .HasColumnType("real"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - b.Property("UpperPressureWarningThreshold") - .HasColumnType("real"); - - b.HasKey("Id"); - - b.HasIndex("Type") - .IsUnique(); - - b.ToTable("RobotModels"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotPoseTimeseries", b => - { - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("OrientationW") - .HasColumnType("real"); - - b.Property("OrientationX") - .HasColumnType("real"); - - b.Property("OrientationY") - .HasColumnType("real"); - - b.Property("OrientationZ") - .HasColumnType("real"); - - b.Property("PositionX") - .HasColumnType("real"); - - b.Property("PositionY") - .HasColumnType("real"); - - b.Property("PositionZ") - .HasColumnType("real"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Time") - .HasColumnType("timestamp with time zone"); - - b.ToTable("RobotPoseTimeseries"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotPressureTimeseries", b => - { - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("Pressure") - .HasColumnType("real"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Time") - .HasColumnType("timestamp with time zone"); - - b.ToTable("RobotPressureTimeseries"); - }); - - modelBuilder.Entity("Api.Database.Models.SafePosition", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AreaId") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("AreaId"); - - b.ToTable("SafePositions"); - }); - - modelBuilder.Entity("Api.Database.Models.Source", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("SourceId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - 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); - - b.HasOne("Api.Database.Models.DefaultLocalizationPose", "DefaultLocalizationPose") - .WithMany() - .HasForeignKey("DefaultLocalizationPoseId"); - - 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.MapMetadata", "MapMetadata", b1 => - { - b1.Property("AreaId") - .HasColumnType("text"); - - b1.Property("MapName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.HasKey("AreaId"); - - b1.ToTable("Areas"); - - b1.WithOwner() - .HasForeignKey("AreaId"); - - b1.OwnsOne("Api.Database.Models.Boundary", "Boundary", b2 => - { - b2.Property("MapMetadataAreaId") - .HasColumnType("text"); - - b2.Property("X1") - .HasColumnType("double precision"); - - b2.Property("X2") - .HasColumnType("double precision"); - - b2.Property("Y1") - .HasColumnType("double precision"); - - b2.Property("Y2") - .HasColumnType("double precision"); - - b2.Property("Z1") - .HasColumnType("double precision"); - - b2.Property("Z2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataAreaId"); - - b2.ToTable("Areas"); - - b2.WithOwner() - .HasForeignKey("MapMetadataAreaId"); - }); - - b1.OwnsOne("Api.Database.Models.TransformationMatrices", "TransformationMatrices", b2 => - { - b2.Property("MapMetadataAreaId") - .HasColumnType("text"); - - b2.Property("C1") - .HasColumnType("double precision"); - - b2.Property("C2") - .HasColumnType("double precision"); - - b2.Property("D1") - .HasColumnType("double precision"); - - b2.Property("D2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataAreaId"); - - b2.ToTable("Areas"); - - b2.WithOwner() - .HasForeignKey("MapMetadataAreaId"); - }); - - b1.Navigation("Boundary") - .IsRequired(); - - b1.Navigation("TransformationMatrices") - .IsRequired(); - }); - - b.Navigation("Deck"); - - b.Navigation("DefaultLocalizationPose"); - - b.Navigation("Installation"); - - b.Navigation("MapMetadata") - .IsRequired(); - - b.Navigation("Plant"); - }); - - modelBuilder.Entity("Api.Database.Models.Deck", b => - { - b.HasOne("Api.Database.Models.DefaultLocalizationPose", "DefaultLocalizationPose") - .WithMany() - .HasForeignKey("DefaultLocalizationPoseId"); - - 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.Navigation("DefaultLocalizationPose"); - - b.Navigation("Installation"); - - b.Navigation("Plant"); - }); - - modelBuilder.Entity("Api.Database.Models.DefaultLocalizationPose", b => - { - b.OwnsOne("Api.Database.Models.Pose", "Pose", b1 => - { - b1.Property("DefaultLocalizationPoseId") - .HasColumnType("text"); - - b1.HasKey("DefaultLocalizationPoseId"); - - b1.ToTable("DefaultLocalizationPoses"); - - b1.WithOwner() - .HasForeignKey("DefaultLocalizationPoseId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseDefaultLocalizationPoseId") - .HasColumnType("text"); - - b2.Property("W") - .HasColumnType("real"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseDefaultLocalizationPoseId"); - - b2.ToTable("DefaultLocalizationPoses"); - - b2.WithOwner() - .HasForeignKey("PoseDefaultLocalizationPoseId"); - }); - - b1.OwnsOne("Api.Database.Models.Position", "Position", b2 => - { - b2.Property("PoseDefaultLocalizationPoseId") - .HasColumnType("text"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseDefaultLocalizationPoseId"); - - b2.ToTable("DefaultLocalizationPoses"); - - b2.WithOwner() - .HasForeignKey("PoseDefaultLocalizationPoseId"); - }); - - b1.Navigation("Orientation") - .IsRequired(); - - b1.Navigation("Position") - .IsRequired(); - }); - - b.Navigation("Pose") - .IsRequired(); - }); - - modelBuilder.Entity("Api.Database.Models.MissionDefinition", b => - { - b.HasOne("Api.Database.Models.Area", "Area") - .WithMany() - .HasForeignKey("AreaId"); - - b.HasOne("Api.Database.Models.MissionRun", "LastSuccessfulRun") - .WithMany() - .HasForeignKey("LastSuccessfulRunId"); - - b.HasOne("Api.Database.Models.Source", "Source") - .WithMany() - .HasForeignKey("SourceId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Area"); - - b.Navigation("LastSuccessfulRun"); - - 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", "Map", b1 => - { - b1.Property("MissionRunId") - .HasColumnType("text"); - - b1.Property("MapName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.HasKey("MissionRunId"); - - b1.ToTable("MissionRuns"); - - b1.WithOwner() - .HasForeignKey("MissionRunId"); - - b1.OwnsOne("Api.Database.Models.Boundary", "Boundary", b2 => - { - b2.Property("MapMetadataMissionRunId") - .HasColumnType("text"); - - b2.Property("X1") - .HasColumnType("double precision"); - - b2.Property("X2") - .HasColumnType("double precision"); - - b2.Property("Y1") - .HasColumnType("double precision"); - - b2.Property("Y2") - .HasColumnType("double precision"); - - b2.Property("Z1") - .HasColumnType("double precision"); - - b2.Property("Z2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataMissionRunId"); - - b2.ToTable("MissionRuns"); - - b2.WithOwner() - .HasForeignKey("MapMetadataMissionRunId"); - }); - - b1.OwnsOne("Api.Database.Models.TransformationMatrices", "TransformationMatrices", b2 => - { - b2.Property("MapMetadataMissionRunId") - .HasColumnType("text"); - - b2.Property("C1") - .HasColumnType("double precision"); - - b2.Property("C2") - .HasColumnType("double precision"); - - b2.Property("D1") - .HasColumnType("double precision"); - - b2.Property("D2") - .HasColumnType("double precision"); - - 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("text"); - - b1.Property("Description") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b1.Property("EchoPoseId") - .HasColumnType("integer"); - - b1.Property("EchoTagLink") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.Property("EndTime") - .HasColumnType("timestamp with time zone"); - - b1.Property("IsarTaskId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.Property("MissionRunId") - .IsRequired() - .HasColumnType("text"); - - b1.Property("StartTime") - .HasColumnType("timestamp with time zone"); - - b1.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b1.Property("TagId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.Property("TaskOrder") - .HasColumnType("integer"); - - 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("text"); - - b2.Property("AnalysisType") - .HasColumnType("text"); - - b2.Property("EndTime") - .HasColumnType("timestamp with time zone"); - - b2.Property("InspectionType") - .IsRequired() - .HasColumnType("text"); - - b2.Property("InspectionUrl") - .HasMaxLength(250) - .HasColumnType("character varying(250)"); - - b2.Property("IsarStepId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b2.Property("MissionTaskId") - .IsRequired() - .HasColumnType("text"); - - b2.Property("StartTime") - .HasColumnType("timestamp with time zone"); - - b2.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b2.Property("VideoDuration") - .HasColumnType("real"); - - b2.HasKey("Id"); - - b2.HasIndex("MissionTaskId"); - - b2.ToTable("Inspections"); - - b2.WithOwner() - .HasForeignKey("MissionTaskId"); - - b2.OwnsMany("Api.Database.Models.InspectionFindings", "InspectionFindings", b3 => - { - b3.Property("InspectionId") - .HasColumnType("text"); - - b3.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b3.Property("Id")); - - b3.Property("Area") - .IsRequired() - .HasColumnType("text"); - - b3.Property("FindingsTag") - .IsRequired() - .HasColumnType("text"); - - b3.Property("InspectionDate") - .IsRequired() - .HasColumnType("text"); - - b3.Property("RobotName") - .IsRequired() - .HasColumnType("text"); - - b3.HasKey("InspectionId", "Id"); - - b3.ToTable("InspectionFindings"); - - b3.WithOwner() - .HasForeignKey("InspectionId"); - }); - - b2.Navigation("InspectionFindings"); - }); - - b1.OwnsOne("Api.Database.Models.Position", "InspectionTarget", b2 => - { - b2.Property("MissionTaskId") - .HasColumnType("text"); - - 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("text"); - - b2.HasKey("MissionTaskId"); - - b2.ToTable("MissionTask"); - - b2.WithOwner() - .HasForeignKey("MissionTaskId"); - - b2.OwnsOne("Api.Database.Models.Orientation", "Orientation", b3 => - { - b3.Property("PoseMissionTaskId") - .HasColumnType("text"); - - 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("text"); - - 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("Map"); - - 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) - .IsRequired(); - - 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("text"); - - b1.HasKey("RobotId"); - - b1.ToTable("Robots"); - - b1.WithOwner() - .HasForeignKey("RobotId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseRobotId") - .HasColumnType("text"); - - 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("text"); - - 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("text"); - - b1.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b1.Property("ShouldRotate270Clockwise") - .HasColumnType("boolean"); - - b1.Property("Type") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b1.Property("Url") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(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("text"); - - b1.HasKey("SafePositionId"); - - b1.ToTable("SafePositions"); - - b1.WithOwner() - .HasForeignKey("SafePositionId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseSafePositionId") - .HasColumnType("text"); - - 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("text"); - - 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/20231109194856_MakeInspectionNotOwned.cs b/backend/api/Migrations/20231109194856_MakeInspectionNotOwned.cs deleted file mode 100644 index 99a44fcdb..000000000 --- a/backend/api/Migrations/20231109194856_MakeInspectionNotOwned.cs +++ /dev/null @@ -1,111 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Api.Migrations -{ - /// - public partial class MakeInspectionNotOwned : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropForeignKey( - name: "FK_InspectionFindings_Inspection_InspectionId", - table: "InspectionFindings"); - - migrationBuilder.DropTable( - name: "Inspection"); - - migrationBuilder.CreateTable( - name: "Inspections", - columns: table => new - { - Id = table.Column(type: "text", nullable: false), - IsarStepId = table.Column(type: "character varying(200)", maxLength: 200, nullable: true), - Status = table.Column(type: "text", nullable: false), - InspectionType = table.Column(type: "text", nullable: false), - VideoDuration = table.Column(type: "real", nullable: true), - AnalysisType = table.Column(type: "text", nullable: true), - InspectionUrl = table.Column(type: "character varying(250)", maxLength: 250, nullable: true), - StartTime = table.Column(type: "timestamp with time zone", nullable: true), - EndTime = table.Column(type: "timestamp with time zone", nullable: true), - MissionTaskId = table.Column(type: "text", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Inspections", x => x.Id); - table.ForeignKey( - name: "FK_Inspections_MissionTask_MissionTaskId", - column: x => x.MissionTaskId, - principalTable: "MissionTask", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateIndex( - name: "IX_Inspections_MissionTaskId", - table: "Inspections", - column: "MissionTaskId"); - - migrationBuilder.AddForeignKey( - name: "FK_InspectionFindings_Inspections_InspectionId", - table: "InspectionFindings", - column: "InspectionId", - principalTable: "Inspections", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropForeignKey( - name: "FK_InspectionFindings_Inspections_InspectionId", - table: "InspectionFindings"); - - migrationBuilder.DropTable( - name: "Inspections"); - - migrationBuilder.CreateTable( - name: "Inspection", - columns: table => new - { - Id = table.Column(type: "text", nullable: false), - AnalysisType = table.Column(type: "text", nullable: true), - EndTime = table.Column(type: "timestamp with time zone", nullable: true), - InspectionType = table.Column(type: "text", nullable: false), - InspectionUrl = table.Column(type: "character varying(250)", maxLength: 250, nullable: true), - IsarStepId = table.Column(type: "character varying(200)", maxLength: 200, nullable: true), - MissionTaskId = table.Column(type: "text", nullable: false), - StartTime = table.Column(type: "timestamp with time zone", nullable: true), - Status = table.Column(type: "text", nullable: false), - VideoDuration = table.Column(type: "real", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Inspection", x => x.Id); - table.ForeignKey( - name: "FK_Inspection_MissionTask_MissionTaskId", - column: x => x.MissionTaskId, - principalTable: "MissionTask", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateIndex( - name: "IX_Inspection_MissionTaskId", - table: "Inspection", - column: "MissionTaskId"); - - migrationBuilder.AddForeignKey( - name: "FK_InspectionFindings_Inspection_InspectionId", - table: "InspectionFindings", - column: "InspectionId", - principalTable: "Inspection", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - } - } -} diff --git a/backend/api/Migrations/20231109195524_MakeMissionTaskNotOwned.Designer.cs b/backend/api/Migrations/20231109195524_MakeMissionTaskNotOwned.Designer.cs deleted file mode 100644 index fbac42b2d..000000000 --- a/backend/api/Migrations/20231109195524_MakeMissionTaskNotOwned.Designer.cs +++ /dev/null @@ -1,1274 +0,0 @@ -// -using System; -using Api.Database.Context; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace Api.Migrations -{ - [DbContext(typeof(FlotillaDbContext))] - [Migration("20231109195524_MakeMissionTaskNotOwned")] - partial class MakeMissionTaskNotOwned - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "7.0.11") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("Api.Database.Models.Area", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("DeckId") - .HasColumnType("text"); - - b.Property("DefaultLocalizationPoseId") - .HasColumnType("text"); - - b.Property("InstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PlantId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("DeckId"); - - b.HasIndex("DefaultLocalizationPoseId"); - - b.HasIndex("InstallationId"); - - b.HasIndex("PlantId"); - - b.ToTable("Areas"); - }); - - modelBuilder.Entity("Api.Database.Models.Deck", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("DefaultLocalizationPoseId") - .HasColumnType("text"); - - b.Property("InstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PlantId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("DefaultLocalizationPoseId"); - - b.HasIndex("InstallationId"); - - b.HasIndex("PlantId"); - - b.ToTable("Decks"); - }); - - modelBuilder.Entity("Api.Database.Models.DefaultLocalizationPose", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.ToTable("DefaultLocalizationPoses"); - }); - - modelBuilder.Entity("Api.Database.Models.Installation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("InstallationCode") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.HasKey("Id"); - - b.HasIndex("InstallationCode") - .IsUnique(); - - b.ToTable("Installations"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionDefinition", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AreaId") - .HasColumnType("text"); - - b.Property("Comment") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("InspectionFrequency") - .HasColumnType("bigint"); - - b.Property("InstallationCode") - .IsRequired() - .HasColumnType("text"); - - b.Property("IsDeprecated") - .HasColumnType("boolean"); - - b.Property("LastSuccessfulRunId") - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("SourceId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("AreaId"); - - b.HasIndex("LastSuccessfulRunId"); - - b.HasIndex("SourceId"); - - b.ToTable("MissionDefinitions"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionRun", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AreaId") - .HasColumnType("text"); - - b.Property("Comment") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("Description") - .HasMaxLength(450) - .HasColumnType("character varying(450)"); - - b.Property("DesiredStartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("EndTime") - .HasColumnType("timestamp with time zone"); - - b.Property("EstimatedDuration") - .HasColumnType("bigint"); - - b.Property("InstallationCode") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("IsarMissionId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("MissionRunPriority") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("StartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("StatusReason") - .HasMaxLength(450) - .HasColumnType("character varying(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("text"); - - b.Property("InstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PlantCode") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(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("text"); - - b.Property("BatteryLevel") - .HasColumnType("real"); - - b.Property("CurrentAreaId") - .HasColumnType("text"); - - b.Property("CurrentInstallation") - .IsRequired() - .HasColumnType("text"); - - b.Property("CurrentMissionId") - .HasColumnType("text"); - - b.Property("Enabled") - .HasColumnType("boolean"); - - b.Property("Host") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("IsarId") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionQueueFrozen") - .HasColumnType("boolean"); - - b.Property("ModelId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Port") - .HasColumnType("integer"); - - b.Property("PressureLevel") - .HasColumnType("real"); - - b.Property("SerialNumber") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("CurrentAreaId"); - - b.HasIndex("ModelId"); - - b.ToTable("Robots"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotBatteryTimeseries", b => - { - b.Property("BatteryLevel") - .HasColumnType("real"); - - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Time") - .HasColumnType("timestamp with time zone"); - - b.ToTable("RobotBatteryTimeseries"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotModel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AverageDurationPerTag") - .HasColumnType("real"); - - b.Property("BatteryWarningThreshold") - .HasColumnType("real"); - - b.Property("LowerPressureWarningThreshold") - .HasColumnType("real"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - b.Property("UpperPressureWarningThreshold") - .HasColumnType("real"); - - b.HasKey("Id"); - - b.HasIndex("Type") - .IsUnique(); - - b.ToTable("RobotModels"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotPoseTimeseries", b => - { - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("OrientationW") - .HasColumnType("real"); - - b.Property("OrientationX") - .HasColumnType("real"); - - b.Property("OrientationY") - .HasColumnType("real"); - - b.Property("OrientationZ") - .HasColumnType("real"); - - b.Property("PositionX") - .HasColumnType("real"); - - b.Property("PositionY") - .HasColumnType("real"); - - b.Property("PositionZ") - .HasColumnType("real"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Time") - .HasColumnType("timestamp with time zone"); - - b.ToTable("RobotPoseTimeseries"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotPressureTimeseries", b => - { - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("Pressure") - .HasColumnType("real"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Time") - .HasColumnType("timestamp with time zone"); - - b.ToTable("RobotPressureTimeseries"); - }); - - modelBuilder.Entity("Api.Database.Models.SafePosition", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AreaId") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("AreaId"); - - b.ToTable("SafePositions"); - }); - - modelBuilder.Entity("Api.Database.Models.Source", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("SourceId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - 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); - - b.HasOne("Api.Database.Models.DefaultLocalizationPose", "DefaultLocalizationPose") - .WithMany() - .HasForeignKey("DefaultLocalizationPoseId"); - - 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.MapMetadata", "MapMetadata", b1 => - { - b1.Property("AreaId") - .HasColumnType("text"); - - b1.Property("MapName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.HasKey("AreaId"); - - b1.ToTable("Areas"); - - b1.WithOwner() - .HasForeignKey("AreaId"); - - b1.OwnsOne("Api.Database.Models.Boundary", "Boundary", b2 => - { - b2.Property("MapMetadataAreaId") - .HasColumnType("text"); - - b2.Property("X1") - .HasColumnType("double precision"); - - b2.Property("X2") - .HasColumnType("double precision"); - - b2.Property("Y1") - .HasColumnType("double precision"); - - b2.Property("Y2") - .HasColumnType("double precision"); - - b2.Property("Z1") - .HasColumnType("double precision"); - - b2.Property("Z2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataAreaId"); - - b2.ToTable("Areas"); - - b2.WithOwner() - .HasForeignKey("MapMetadataAreaId"); - }); - - b1.OwnsOne("Api.Database.Models.TransformationMatrices", "TransformationMatrices", b2 => - { - b2.Property("MapMetadataAreaId") - .HasColumnType("text"); - - b2.Property("C1") - .HasColumnType("double precision"); - - b2.Property("C2") - .HasColumnType("double precision"); - - b2.Property("D1") - .HasColumnType("double precision"); - - b2.Property("D2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataAreaId"); - - b2.ToTable("Areas"); - - b2.WithOwner() - .HasForeignKey("MapMetadataAreaId"); - }); - - b1.Navigation("Boundary") - .IsRequired(); - - b1.Navigation("TransformationMatrices") - .IsRequired(); - }); - - b.Navigation("Deck"); - - b.Navigation("DefaultLocalizationPose"); - - b.Navigation("Installation"); - - b.Navigation("MapMetadata") - .IsRequired(); - - b.Navigation("Plant"); - }); - - modelBuilder.Entity("Api.Database.Models.Deck", b => - { - b.HasOne("Api.Database.Models.DefaultLocalizationPose", "DefaultLocalizationPose") - .WithMany() - .HasForeignKey("DefaultLocalizationPoseId"); - - 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.Navigation("DefaultLocalizationPose"); - - b.Navigation("Installation"); - - b.Navigation("Plant"); - }); - - modelBuilder.Entity("Api.Database.Models.DefaultLocalizationPose", b => - { - b.OwnsOne("Api.Database.Models.Pose", "Pose", b1 => - { - b1.Property("DefaultLocalizationPoseId") - .HasColumnType("text"); - - b1.HasKey("DefaultLocalizationPoseId"); - - b1.ToTable("DefaultLocalizationPoses"); - - b1.WithOwner() - .HasForeignKey("DefaultLocalizationPoseId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseDefaultLocalizationPoseId") - .HasColumnType("text"); - - b2.Property("W") - .HasColumnType("real"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseDefaultLocalizationPoseId"); - - b2.ToTable("DefaultLocalizationPoses"); - - b2.WithOwner() - .HasForeignKey("PoseDefaultLocalizationPoseId"); - }); - - b1.OwnsOne("Api.Database.Models.Position", "Position", b2 => - { - b2.Property("PoseDefaultLocalizationPoseId") - .HasColumnType("text"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseDefaultLocalizationPoseId"); - - b2.ToTable("DefaultLocalizationPoses"); - - b2.WithOwner() - .HasForeignKey("PoseDefaultLocalizationPoseId"); - }); - - b1.Navigation("Orientation") - .IsRequired(); - - b1.Navigation("Position") - .IsRequired(); - }); - - b.Navigation("Pose") - .IsRequired(); - }); - - modelBuilder.Entity("Api.Database.Models.MissionDefinition", b => - { - b.HasOne("Api.Database.Models.Area", "Area") - .WithMany() - .HasForeignKey("AreaId"); - - b.HasOne("Api.Database.Models.MissionRun", "LastSuccessfulRun") - .WithMany() - .HasForeignKey("LastSuccessfulRunId"); - - b.HasOne("Api.Database.Models.Source", "Source") - .WithMany() - .HasForeignKey("SourceId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Area"); - - b.Navigation("LastSuccessfulRun"); - - 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", "Map", b1 => - { - b1.Property("MissionRunId") - .HasColumnType("text"); - - b1.Property("MapName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.HasKey("MissionRunId"); - - b1.ToTable("MissionRuns"); - - b1.WithOwner() - .HasForeignKey("MissionRunId"); - - b1.OwnsOne("Api.Database.Models.Boundary", "Boundary", b2 => - { - b2.Property("MapMetadataMissionRunId") - .HasColumnType("text"); - - b2.Property("X1") - .HasColumnType("double precision"); - - b2.Property("X2") - .HasColumnType("double precision"); - - b2.Property("Y1") - .HasColumnType("double precision"); - - b2.Property("Y2") - .HasColumnType("double precision"); - - b2.Property("Z1") - .HasColumnType("double precision"); - - b2.Property("Z2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataMissionRunId"); - - b2.ToTable("MissionRuns"); - - b2.WithOwner() - .HasForeignKey("MapMetadataMissionRunId"); - }); - - b1.OwnsOne("Api.Database.Models.TransformationMatrices", "TransformationMatrices", b2 => - { - b2.Property("MapMetadataMissionRunId") - .HasColumnType("text"); - - b2.Property("C1") - .HasColumnType("double precision"); - - b2.Property("C2") - .HasColumnType("double precision"); - - b2.Property("D1") - .HasColumnType("double precision"); - - b2.Property("D2") - .HasColumnType("double precision"); - - 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("text"); - - b1.Property("Description") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b1.Property("EchoPoseId") - .HasColumnType("integer"); - - b1.Property("EchoTagLink") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.Property("EndTime") - .HasColumnType("timestamp with time zone"); - - b1.Property("IsarTaskId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.Property("MissionRunId") - .HasColumnType("text"); - - b1.Property("StartTime") - .HasColumnType("timestamp with time zone"); - - b1.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b1.Property("TagId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.Property("TaskOrder") - .HasColumnType("integer"); - - b1.HasKey("Id"); - - b1.HasIndex("MissionRunId"); - - b1.ToTable("MissionTasks"); - - b1.WithOwner() - .HasForeignKey("MissionRunId"); - - b1.OwnsMany("Api.Database.Models.Inspection", "Inspections", b2 => - { - b2.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b2.Property("AnalysisType") - .HasColumnType("text"); - - b2.Property("EndTime") - .HasColumnType("timestamp with time zone"); - - b2.Property("InspectionType") - .IsRequired() - .HasColumnType("text"); - - b2.Property("InspectionUrl") - .HasMaxLength(250) - .HasColumnType("character varying(250)"); - - b2.Property("IsarStepId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b2.Property("MissionTaskId") - .IsRequired() - .HasColumnType("text"); - - b2.Property("StartTime") - .HasColumnType("timestamp with time zone"); - - b2.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b2.Property("VideoDuration") - .HasColumnType("real"); - - b2.HasKey("Id"); - - b2.HasIndex("MissionTaskId"); - - b2.ToTable("Inspections"); - - b2.WithOwner() - .HasForeignKey("MissionTaskId"); - - b2.OwnsMany("Api.Database.Models.InspectionFindings", "InspectionFindings", b3 => - { - b3.Property("InspectionId") - .HasColumnType("text"); - - b3.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b3.Property("Id")); - - b3.Property("Area") - .IsRequired() - .HasColumnType("text"); - - b3.Property("FindingsTag") - .IsRequired() - .HasColumnType("text"); - - b3.Property("InspectionDate") - .IsRequired() - .HasColumnType("text"); - - b3.Property("RobotName") - .IsRequired() - .HasColumnType("text"); - - b3.HasKey("InspectionId", "Id"); - - b3.ToTable("InspectionFindings"); - - b3.WithOwner() - .HasForeignKey("InspectionId"); - }); - - b2.Navigation("InspectionFindings"); - }); - - b1.OwnsOne("Api.Database.Models.Position", "InspectionTarget", b2 => - { - b2.Property("MissionTaskId") - .HasColumnType("text"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("MissionTaskId"); - - b2.ToTable("MissionTasks"); - - b2.WithOwner() - .HasForeignKey("MissionTaskId"); - }); - - b1.OwnsOne("Api.Database.Models.Pose", "RobotPose", b2 => - { - b2.Property("MissionTaskId") - .HasColumnType("text"); - - b2.HasKey("MissionTaskId"); - - b2.ToTable("MissionTasks"); - - b2.WithOwner() - .HasForeignKey("MissionTaskId"); - - b2.OwnsOne("Api.Database.Models.Orientation", "Orientation", b3 => - { - b3.Property("PoseMissionTaskId") - .HasColumnType("text"); - - 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("MissionTasks"); - - b3.WithOwner() - .HasForeignKey("PoseMissionTaskId"); - }); - - b2.OwnsOne("Api.Database.Models.Position", "Position", b3 => - { - b3.Property("PoseMissionTaskId") - .HasColumnType("text"); - - b3.Property("X") - .HasColumnType("real"); - - b3.Property("Y") - .HasColumnType("real"); - - b3.Property("Z") - .HasColumnType("real"); - - b3.HasKey("PoseMissionTaskId"); - - b3.ToTable("MissionTasks"); - - 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("Map"); - - 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) - .IsRequired(); - - 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("text"); - - b1.HasKey("RobotId"); - - b1.ToTable("Robots"); - - b1.WithOwner() - .HasForeignKey("RobotId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseRobotId") - .HasColumnType("text"); - - 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("text"); - - 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("text"); - - b1.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b1.Property("ShouldRotate270Clockwise") - .HasColumnType("boolean"); - - b1.Property("Type") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b1.Property("Url") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(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("text"); - - b1.HasKey("SafePositionId"); - - b1.ToTable("SafePositions"); - - b1.WithOwner() - .HasForeignKey("SafePositionId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseSafePositionId") - .HasColumnType("text"); - - 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("text"); - - 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/20231109195524_MakeMissionTaskNotOwned.cs b/backend/api/Migrations/20231109195524_MakeMissionTaskNotOwned.cs deleted file mode 100644 index 5f49e0628..000000000 --- a/backend/api/Migrations/20231109195524_MakeMissionTaskNotOwned.cs +++ /dev/null @@ -1,133 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Api.Migrations -{ - /// - public partial class MakeMissionTaskNotOwned : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropForeignKey( - name: "FK_Inspections_MissionTask_MissionTaskId", - table: "Inspections"); - - migrationBuilder.DropTable( - name: "MissionTask"); - - migrationBuilder.CreateTable( - name: "MissionTasks", - columns: table => new - { - Id = table.Column(type: "text", nullable: false), - IsarTaskId = table.Column(type: "character varying(200)", maxLength: 200, nullable: true), - TaskOrder = table.Column(type: "integer", nullable: false), - TagId = table.Column(type: "character varying(200)", maxLength: 200, nullable: true), - Description = table.Column(type: "character varying(500)", maxLength: 500, nullable: true), - EchoTagLink = table.Column(type: "character varying(200)", maxLength: 200, nullable: true), - InspectionTarget_X = table.Column(type: "real", nullable: false), - InspectionTarget_Y = table.Column(type: "real", nullable: false), - InspectionTarget_Z = table.Column(type: "real", nullable: false), - RobotPose_Position_X = table.Column(type: "real", nullable: false), - RobotPose_Position_Y = table.Column(type: "real", nullable: false), - RobotPose_Position_Z = table.Column(type: "real", nullable: false), - RobotPose_Orientation_X = table.Column(type: "real", nullable: false), - RobotPose_Orientation_Y = table.Column(type: "real", nullable: false), - RobotPose_Orientation_Z = table.Column(type: "real", nullable: false), - RobotPose_Orientation_W = table.Column(type: "real", nullable: false), - EchoPoseId = table.Column(type: "integer", nullable: true), - Status = table.Column(type: "text", nullable: false), - StartTime = table.Column(type: "timestamp with time zone", nullable: true), - EndTime = table.Column(type: "timestamp with time zone", nullable: true), - MissionRunId = table.Column(type: "text", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_MissionTasks", x => x.Id); - table.ForeignKey( - name: "FK_MissionTasks_MissionRuns_MissionRunId", - column: x => x.MissionRunId, - principalTable: "MissionRuns", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateIndex( - name: "IX_MissionTasks_MissionRunId", - table: "MissionTasks", - column: "MissionRunId"); - - migrationBuilder.AddForeignKey( - name: "FK_Inspections_MissionTasks_MissionTaskId", - table: "Inspections", - column: "MissionTaskId", - principalTable: "MissionTasks", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropForeignKey( - name: "FK_Inspections_MissionTasks_MissionTaskId", - table: "Inspections"); - - migrationBuilder.DropTable( - name: "MissionTasks"); - - migrationBuilder.CreateTable( - name: "MissionTask", - columns: table => new - { - Id = table.Column(type: "text", nullable: false), - Description = table.Column(type: "character varying(500)", maxLength: 500, nullable: true), - EchoPoseId = table.Column(type: "integer", nullable: true), - EchoTagLink = table.Column(type: "character varying(200)", maxLength: 200, nullable: true), - EndTime = table.Column(type: "timestamp with time zone", nullable: true), - IsarTaskId = table.Column(type: "character varying(200)", maxLength: 200, nullable: true), - MissionRunId = table.Column(type: "text", nullable: false), - StartTime = table.Column(type: "timestamp with time zone", nullable: true), - Status = table.Column(type: "text", nullable: false), - TagId = table.Column(type: "character varying(200)", maxLength: 200, nullable: true), - TaskOrder = table.Column(type: "integer", nullable: false), - InspectionTarget_X = table.Column(type: "real", nullable: false), - InspectionTarget_Y = table.Column(type: "real", nullable: false), - InspectionTarget_Z = table.Column(type: "real", nullable: false), - RobotPose_Orientation_W = table.Column(type: "real", nullable: false), - RobotPose_Orientation_X = table.Column(type: "real", nullable: false), - RobotPose_Orientation_Y = table.Column(type: "real", nullable: false), - RobotPose_Orientation_Z = table.Column(type: "real", nullable: false), - RobotPose_Position_X = table.Column(type: "real", nullable: false), - RobotPose_Position_Y = table.Column(type: "real", nullable: false), - RobotPose_Position_Z = table.Column(type: "real", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_MissionTask", x => x.Id); - table.ForeignKey( - name: "FK_MissionTask_MissionRuns_MissionRunId", - column: x => x.MissionRunId, - principalTable: "MissionRuns", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateIndex( - name: "IX_MissionTask_MissionRunId", - table: "MissionTask", - column: "MissionRunId"); - - migrationBuilder.AddForeignKey( - name: "FK_Inspections_MissionTask_MissionTaskId", - table: "Inspections", - column: "MissionTaskId", - principalTable: "MissionTask", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - } - } -} diff --git a/backend/api/Migrations/20231114141124_AddInspectionTargetToInspection.Designer.cs b/backend/api/Migrations/20231114141124_AddInspectionTargetToInspection.Designer.cs deleted file mode 100644 index 05c054ff4..000000000 --- a/backend/api/Migrations/20231114141124_AddInspectionTargetToInspection.Designer.cs +++ /dev/null @@ -1,1312 +0,0 @@ -// -using System; -using Api.Database.Context; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace Api.Migrations -{ - [DbContext(typeof(FlotillaDbContext))] - [Migration("20231114141124_AddInspectionTargetToInspection")] - partial class AddInspectionTargetToInspection - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "7.0.11") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("Api.Database.Models.Area", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("DeckId") - .HasColumnType("text"); - - b.Property("DefaultLocalizationPoseId") - .HasColumnType("text"); - - b.Property("InstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PlantId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("DeckId"); - - b.HasIndex("DefaultLocalizationPoseId"); - - b.HasIndex("InstallationId"); - - b.HasIndex("PlantId"); - - b.ToTable("Areas"); - }); - - modelBuilder.Entity("Api.Database.Models.Deck", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("DefaultLocalizationPoseId") - .HasColumnType("text"); - - b.Property("InstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PlantId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("DefaultLocalizationPoseId"); - - b.HasIndex("InstallationId"); - - b.HasIndex("PlantId"); - - b.ToTable("Decks"); - }); - - modelBuilder.Entity("Api.Database.Models.DefaultLocalizationPose", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.ToTable("DefaultLocalizationPoses"); - }); - - modelBuilder.Entity("Api.Database.Models.Inspection", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AnalysisType") - .HasColumnType("text"); - - b.Property("EndTime") - .HasColumnType("timestamp with time zone"); - - b.Property("InspectionType") - .IsRequired() - .HasColumnType("text"); - - b.Property("InspectionUrl") - .HasMaxLength(250) - .HasColumnType("character varying(250)"); - - b.Property("IsarStepId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionTaskId") - .HasColumnType("text"); - - b.Property("StartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("VideoDuration") - .HasColumnType("real"); - - b.HasKey("Id"); - - b.HasIndex("MissionTaskId"); - - b.ToTable("Inspections"); - }); - - modelBuilder.Entity("Api.Database.Models.Installation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("InstallationCode") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.HasKey("Id"); - - b.HasIndex("InstallationCode") - .IsUnique(); - - b.ToTable("Installations"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionDefinition", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AreaId") - .HasColumnType("text"); - - b.Property("Comment") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("InspectionFrequency") - .HasColumnType("bigint"); - - b.Property("InstallationCode") - .IsRequired() - .HasColumnType("text"); - - b.Property("IsDeprecated") - .HasColumnType("boolean"); - - b.Property("LastSuccessfulRunId") - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("SourceId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("AreaId"); - - b.HasIndex("LastSuccessfulRunId"); - - b.HasIndex("SourceId"); - - b.ToTable("MissionDefinitions"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionRun", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AreaId") - .HasColumnType("text"); - - b.Property("Comment") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("Description") - .HasMaxLength(450) - .HasColumnType("character varying(450)"); - - b.Property("DesiredStartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("EndTime") - .HasColumnType("timestamp with time zone"); - - b.Property("EstimatedDuration") - .HasColumnType("bigint"); - - b.Property("InstallationCode") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("IsarMissionId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("MissionRunPriority") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("StartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("StatusReason") - .HasMaxLength(450) - .HasColumnType("character varying(450)"); - - b.HasKey("Id"); - - b.HasIndex("AreaId"); - - b.HasIndex("RobotId"); - - b.ToTable("MissionRuns"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionTask", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("EchoPoseId") - .HasColumnType("integer"); - - b.Property("EchoTagLink") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("EndTime") - .HasColumnType("timestamp with time zone"); - - b.Property("IsarTaskId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionRunId") - .HasColumnType("text"); - - b.Property("StartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("TagId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("TaskOrder") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("MissionRunId"); - - b.ToTable("MissionTasks"); - }); - - modelBuilder.Entity("Api.Database.Models.Plant", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("InstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PlantCode") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(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("text"); - - b.Property("BatteryLevel") - .HasColumnType("real"); - - b.Property("CurrentAreaId") - .HasColumnType("text"); - - b.Property("CurrentInstallation") - .IsRequired() - .HasColumnType("text"); - - b.Property("CurrentMissionId") - .HasColumnType("text"); - - b.Property("Enabled") - .HasColumnType("boolean"); - - b.Property("Host") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("IsarId") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionQueueFrozen") - .HasColumnType("boolean"); - - b.Property("ModelId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Port") - .HasColumnType("integer"); - - b.Property("PressureLevel") - .HasColumnType("real"); - - b.Property("SerialNumber") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("CurrentAreaId"); - - b.HasIndex("ModelId"); - - b.ToTable("Robots"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotBatteryTimeseries", b => - { - b.Property("BatteryLevel") - .HasColumnType("real"); - - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Time") - .HasColumnType("timestamp with time zone"); - - b.ToTable("RobotBatteryTimeseries"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotModel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AverageDurationPerTag") - .HasColumnType("real"); - - b.Property("BatteryWarningThreshold") - .HasColumnType("real"); - - b.Property("LowerPressureWarningThreshold") - .HasColumnType("real"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - b.Property("UpperPressureWarningThreshold") - .HasColumnType("real"); - - b.HasKey("Id"); - - b.HasIndex("Type") - .IsUnique(); - - b.ToTable("RobotModels"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotPoseTimeseries", b => - { - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("OrientationW") - .HasColumnType("real"); - - b.Property("OrientationX") - .HasColumnType("real"); - - b.Property("OrientationY") - .HasColumnType("real"); - - b.Property("OrientationZ") - .HasColumnType("real"); - - b.Property("PositionX") - .HasColumnType("real"); - - b.Property("PositionY") - .HasColumnType("real"); - - b.Property("PositionZ") - .HasColumnType("real"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Time") - .HasColumnType("timestamp with time zone"); - - b.ToTable("RobotPoseTimeseries"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotPressureTimeseries", b => - { - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("Pressure") - .HasColumnType("real"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Time") - .HasColumnType("timestamp with time zone"); - - b.ToTable("RobotPressureTimeseries"); - }); - - modelBuilder.Entity("Api.Database.Models.SafePosition", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AreaId") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("AreaId"); - - b.ToTable("SafePositions"); - }); - - modelBuilder.Entity("Api.Database.Models.Source", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("SourceId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - 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); - - b.HasOne("Api.Database.Models.DefaultLocalizationPose", "DefaultLocalizationPose") - .WithMany() - .HasForeignKey("DefaultLocalizationPoseId"); - - 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.MapMetadata", "MapMetadata", b1 => - { - b1.Property("AreaId") - .HasColumnType("text"); - - b1.Property("MapName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.HasKey("AreaId"); - - b1.ToTable("Areas"); - - b1.WithOwner() - .HasForeignKey("AreaId"); - - b1.OwnsOne("Api.Database.Models.Boundary", "Boundary", b2 => - { - b2.Property("MapMetadataAreaId") - .HasColumnType("text"); - - b2.Property("X1") - .HasColumnType("double precision"); - - b2.Property("X2") - .HasColumnType("double precision"); - - b2.Property("Y1") - .HasColumnType("double precision"); - - b2.Property("Y2") - .HasColumnType("double precision"); - - b2.Property("Z1") - .HasColumnType("double precision"); - - b2.Property("Z2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataAreaId"); - - b2.ToTable("Areas"); - - b2.WithOwner() - .HasForeignKey("MapMetadataAreaId"); - }); - - b1.OwnsOne("Api.Database.Models.TransformationMatrices", "TransformationMatrices", b2 => - { - b2.Property("MapMetadataAreaId") - .HasColumnType("text"); - - b2.Property("C1") - .HasColumnType("double precision"); - - b2.Property("C2") - .HasColumnType("double precision"); - - b2.Property("D1") - .HasColumnType("double precision"); - - b2.Property("D2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataAreaId"); - - b2.ToTable("Areas"); - - b2.WithOwner() - .HasForeignKey("MapMetadataAreaId"); - }); - - b1.Navigation("Boundary") - .IsRequired(); - - b1.Navigation("TransformationMatrices") - .IsRequired(); - }); - - b.Navigation("Deck"); - - b.Navigation("DefaultLocalizationPose"); - - b.Navigation("Installation"); - - b.Navigation("MapMetadata") - .IsRequired(); - - b.Navigation("Plant"); - }); - - modelBuilder.Entity("Api.Database.Models.Deck", b => - { - b.HasOne("Api.Database.Models.DefaultLocalizationPose", "DefaultLocalizationPose") - .WithMany() - .HasForeignKey("DefaultLocalizationPoseId"); - - 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.Navigation("DefaultLocalizationPose"); - - b.Navigation("Installation"); - - b.Navigation("Plant"); - }); - - modelBuilder.Entity("Api.Database.Models.DefaultLocalizationPose", b => - { - b.OwnsOne("Api.Database.Models.Pose", "Pose", b1 => - { - b1.Property("DefaultLocalizationPoseId") - .HasColumnType("text"); - - b1.HasKey("DefaultLocalizationPoseId"); - - b1.ToTable("DefaultLocalizationPoses"); - - b1.WithOwner() - .HasForeignKey("DefaultLocalizationPoseId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseDefaultLocalizationPoseId") - .HasColumnType("text"); - - b2.Property("W") - .HasColumnType("real"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseDefaultLocalizationPoseId"); - - b2.ToTable("DefaultLocalizationPoses"); - - b2.WithOwner() - .HasForeignKey("PoseDefaultLocalizationPoseId"); - }); - - b1.OwnsOne("Api.Database.Models.Position", "Position", b2 => - { - b2.Property("PoseDefaultLocalizationPoseId") - .HasColumnType("text"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseDefaultLocalizationPoseId"); - - b2.ToTable("DefaultLocalizationPoses"); - - b2.WithOwner() - .HasForeignKey("PoseDefaultLocalizationPoseId"); - }); - - b1.Navigation("Orientation") - .IsRequired(); - - b1.Navigation("Position") - .IsRequired(); - }); - - b.Navigation("Pose") - .IsRequired(); - }); - - modelBuilder.Entity("Api.Database.Models.Inspection", b => - { - b.HasOne("Api.Database.Models.MissionTask", null) - .WithMany("Inspections") - .HasForeignKey("MissionTaskId"); - - b.OwnsOne("Api.Database.Models.Position", "InspectionTarget", b1 => - { - b1.Property("InspectionId") - .HasColumnType("text"); - - b1.Property("X") - .HasColumnType("real"); - - b1.Property("Y") - .HasColumnType("real"); - - b1.Property("Z") - .HasColumnType("real"); - - b1.HasKey("InspectionId"); - - b1.ToTable("Inspections"); - - b1.WithOwner() - .HasForeignKey("InspectionId"); - }); - - b.OwnsMany("Api.Database.Models.InspectionFindings", "InspectionFindings", b1 => - { - b1.Property("InspectionId") - .HasColumnType("text"); - - b1.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b1.Property("Id")); - - b1.Property("Area") - .IsRequired() - .HasColumnType("text"); - - b1.Property("FindingsTag") - .IsRequired() - .HasColumnType("text"); - - b1.Property("InspectionDate") - .IsRequired() - .HasColumnType("text"); - - b1.Property("RobotName") - .IsRequired() - .HasColumnType("text"); - - b1.HasKey("InspectionId", "Id"); - - b1.ToTable("InspectionFindings"); - - b1.WithOwner() - .HasForeignKey("InspectionId"); - }); - - b.Navigation("InspectionFindings"); - - b.Navigation("InspectionTarget") - .IsRequired(); - }); - - modelBuilder.Entity("Api.Database.Models.MissionDefinition", b => - { - b.HasOne("Api.Database.Models.Area", "Area") - .WithMany() - .HasForeignKey("AreaId"); - - b.HasOne("Api.Database.Models.MissionRun", "LastSuccessfulRun") - .WithMany() - .HasForeignKey("LastSuccessfulRunId"); - - b.HasOne("Api.Database.Models.Source", "Source") - .WithMany() - .HasForeignKey("SourceId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Area"); - - b.Navigation("LastSuccessfulRun"); - - 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", "Map", b1 => - { - b1.Property("MissionRunId") - .HasColumnType("text"); - - b1.Property("MapName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.HasKey("MissionRunId"); - - b1.ToTable("MissionRuns"); - - b1.WithOwner() - .HasForeignKey("MissionRunId"); - - b1.OwnsOne("Api.Database.Models.Boundary", "Boundary", b2 => - { - b2.Property("MapMetadataMissionRunId") - .HasColumnType("text"); - - b2.Property("X1") - .HasColumnType("double precision"); - - b2.Property("X2") - .HasColumnType("double precision"); - - b2.Property("Y1") - .HasColumnType("double precision"); - - b2.Property("Y2") - .HasColumnType("double precision"); - - b2.Property("Z1") - .HasColumnType("double precision"); - - b2.Property("Z2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataMissionRunId"); - - b2.ToTable("MissionRuns"); - - b2.WithOwner() - .HasForeignKey("MapMetadataMissionRunId"); - }); - - b1.OwnsOne("Api.Database.Models.TransformationMatrices", "TransformationMatrices", b2 => - { - b2.Property("MapMetadataMissionRunId") - .HasColumnType("text"); - - b2.Property("C1") - .HasColumnType("double precision"); - - b2.Property("C2") - .HasColumnType("double precision"); - - b2.Property("D1") - .HasColumnType("double precision"); - - b2.Property("D2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataMissionRunId"); - - b2.ToTable("MissionRuns"); - - b2.WithOwner() - .HasForeignKey("MapMetadataMissionRunId"); - }); - - b1.Navigation("Boundary") - .IsRequired(); - - b1.Navigation("TransformationMatrices") - .IsRequired(); - }); - - b.Navigation("Area"); - - b.Navigation("Map"); - - b.Navigation("Robot"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionTask", b => - { - b.HasOne("Api.Database.Models.MissionRun", null) - .WithMany("Tasks") - .HasForeignKey("MissionRunId"); - - b.OwnsOne("Api.Database.Models.Position", "InspectionTarget", b1 => - { - b1.Property("MissionTaskId") - .HasColumnType("text"); - - b1.Property("X") - .HasColumnType("real"); - - b1.Property("Y") - .HasColumnType("real"); - - b1.Property("Z") - .HasColumnType("real"); - - b1.HasKey("MissionTaskId"); - - b1.ToTable("MissionTasks"); - - b1.WithOwner() - .HasForeignKey("MissionTaskId"); - }); - - b.OwnsOne("Api.Database.Models.Pose", "RobotPose", b1 => - { - b1.Property("MissionTaskId") - .HasColumnType("text"); - - b1.HasKey("MissionTaskId"); - - b1.ToTable("MissionTasks"); - - b1.WithOwner() - .HasForeignKey("MissionTaskId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseMissionTaskId") - .HasColumnType("text"); - - b2.Property("W") - .HasColumnType("real"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseMissionTaskId"); - - b2.ToTable("MissionTasks"); - - b2.WithOwner() - .HasForeignKey("PoseMissionTaskId"); - }); - - b1.OwnsOne("Api.Database.Models.Position", "Position", b2 => - { - b2.Property("PoseMissionTaskId") - .HasColumnType("text"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseMissionTaskId"); - - b2.ToTable("MissionTasks"); - - b2.WithOwner() - .HasForeignKey("PoseMissionTaskId"); - }); - - b1.Navigation("Orientation") - .IsRequired(); - - b1.Navigation("Position") - .IsRequired(); - }); - - b.Navigation("InspectionTarget") - .IsRequired(); - - b.Navigation("RobotPose") - .IsRequired(); - }); - - modelBuilder.Entity("Api.Database.Models.Plant", b => - { - b.HasOne("Api.Database.Models.Installation", "Installation") - .WithMany() - .HasForeignKey("InstallationId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - 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("text"); - - b1.HasKey("RobotId"); - - b1.ToTable("Robots"); - - b1.WithOwner() - .HasForeignKey("RobotId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseRobotId") - .HasColumnType("text"); - - 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("text"); - - 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("text"); - - b1.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b1.Property("ShouldRotate270Clockwise") - .HasColumnType("boolean"); - - b1.Property("Type") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b1.Property("Url") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(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("text"); - - b1.HasKey("SafePositionId"); - - b1.ToTable("SafePositions"); - - b1.WithOwner() - .HasForeignKey("SafePositionId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseSafePositionId") - .HasColumnType("text"); - - 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("text"); - - 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"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionRun", b => - { - b.Navigation("Tasks"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionTask", b => - { - b.Navigation("Inspections"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/backend/api/Migrations/20231114141124_AddInspectionTargetToInspection.cs b/backend/api/Migrations/20231114141124_AddInspectionTargetToInspection.cs deleted file mode 100644 index f2761f87e..000000000 --- a/backend/api/Migrations/20231114141124_AddInspectionTargetToInspection.cs +++ /dev/null @@ -1,133 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Api.Migrations -{ - /// - public partial class AddInspectionTargetToInspection : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropForeignKey( - name: "FK_Inspections_MissionTasks_MissionTaskId", - table: "Inspections"); - - migrationBuilder.DropForeignKey( - name: "FK_MissionTasks_MissionRuns_MissionRunId", - table: "MissionTasks"); - - migrationBuilder.AlterColumn( - name: "MissionRunId", - table: "MissionTasks", - type: "text", - nullable: true, - oldClrType: typeof(string), - oldType: "text"); - - migrationBuilder.AlterColumn( - name: "MissionTaskId", - table: "Inspections", - type: "text", - nullable: true, - oldClrType: typeof(string), - oldType: "text"); - - migrationBuilder.AddColumn( - name: "InspectionTarget_X", - table: "Inspections", - type: "real", - nullable: false, - defaultValue: 0f); - - migrationBuilder.AddColumn( - name: "InspectionTarget_Y", - table: "Inspections", - type: "real", - nullable: false, - defaultValue: 0f); - - migrationBuilder.AddColumn( - name: "InspectionTarget_Z", - table: "Inspections", - type: "real", - nullable: false, - defaultValue: 0f); - - migrationBuilder.AddForeignKey( - name: "FK_Inspections_MissionTasks_MissionTaskId", - table: "Inspections", - column: "MissionTaskId", - principalTable: "MissionTasks", - principalColumn: "Id"); - - migrationBuilder.AddForeignKey( - name: "FK_MissionTasks_MissionRuns_MissionRunId", - table: "MissionTasks", - column: "MissionRunId", - principalTable: "MissionRuns", - principalColumn: "Id"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropForeignKey( - name: "FK_Inspections_MissionTasks_MissionTaskId", - table: "Inspections"); - - migrationBuilder.DropForeignKey( - name: "FK_MissionTasks_MissionRuns_MissionRunId", - table: "MissionTasks"); - - migrationBuilder.DropColumn( - name: "InspectionTarget_X", - table: "Inspections"); - - migrationBuilder.DropColumn( - name: "InspectionTarget_Y", - table: "Inspections"); - - migrationBuilder.DropColumn( - name: "InspectionTarget_Z", - table: "Inspections"); - - migrationBuilder.AlterColumn( - name: "MissionRunId", - table: "MissionTasks", - type: "text", - nullable: false, - defaultValue: "", - oldClrType: typeof(string), - oldType: "text", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "MissionTaskId", - table: "Inspections", - type: "text", - nullable: false, - defaultValue: "", - oldClrType: typeof(string), - oldType: "text", - oldNullable: true); - - migrationBuilder.AddForeignKey( - name: "FK_Inspections_MissionTasks_MissionTaskId", - table: "Inspections", - column: "MissionTaskId", - principalTable: "MissionTasks", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_MissionTasks_MissionRuns_MissionRunId", - table: "MissionTasks", - column: "MissionRunId", - principalTable: "MissionRuns", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - } - } -} diff --git a/backend/api/Migrations/20231115125019_RemoveInspectionFindingsTable.Designer.cs b/backend/api/Migrations/20231115125019_RemoveInspectionFindingsTable.Designer.cs deleted file mode 100644 index 252784d44..000000000 --- a/backend/api/Migrations/20231115125019_RemoveInspectionFindingsTable.Designer.cs +++ /dev/null @@ -1,1275 +0,0 @@ -// -using System; -using Api.Database.Context; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace Api.Migrations -{ - [DbContext(typeof(FlotillaDbContext))] - [Migration("20231115125019_RemoveInspectionFindingsTable")] - partial class RemoveInspectionFindingsTable - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "7.0.11") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("Api.Database.Models.Area", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("DeckId") - .HasColumnType("text"); - - b.Property("DefaultLocalizationPoseId") - .HasColumnType("text"); - - b.Property("InstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PlantId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("DeckId"); - - b.HasIndex("DefaultLocalizationPoseId"); - - b.HasIndex("InstallationId"); - - b.HasIndex("PlantId"); - - b.ToTable("Areas"); - }); - - modelBuilder.Entity("Api.Database.Models.Deck", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("DefaultLocalizationPoseId") - .HasColumnType("text"); - - b.Property("InstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PlantId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("DefaultLocalizationPoseId"); - - b.HasIndex("InstallationId"); - - b.HasIndex("PlantId"); - - b.ToTable("Decks"); - }); - - modelBuilder.Entity("Api.Database.Models.DefaultLocalizationPose", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.ToTable("DefaultLocalizationPoses"); - }); - - modelBuilder.Entity("Api.Database.Models.Inspection", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AnalysisType") - .HasColumnType("text"); - - b.Property("EndTime") - .HasColumnType("timestamp with time zone"); - - b.Property("InspectionType") - .IsRequired() - .HasColumnType("text"); - - b.Property("InspectionUrl") - .HasMaxLength(250) - .HasColumnType("character varying(250)"); - - b.Property("IsarStepId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionTaskId") - .HasColumnType("text"); - - b.Property("StartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("VideoDuration") - .HasColumnType("real"); - - b.HasKey("Id"); - - b.HasIndex("MissionTaskId"); - - b.ToTable("Inspections"); - }); - - modelBuilder.Entity("Api.Database.Models.Installation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("InstallationCode") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.HasKey("Id"); - - b.HasIndex("InstallationCode") - .IsUnique(); - - b.ToTable("Installations"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionDefinition", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AreaId") - .HasColumnType("text"); - - b.Property("Comment") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("InspectionFrequency") - .HasColumnType("bigint"); - - b.Property("InstallationCode") - .IsRequired() - .HasColumnType("text"); - - b.Property("IsDeprecated") - .HasColumnType("boolean"); - - b.Property("LastSuccessfulRunId") - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("SourceId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("AreaId"); - - b.HasIndex("LastSuccessfulRunId"); - - b.HasIndex("SourceId"); - - b.ToTable("MissionDefinitions"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionRun", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AreaId") - .HasColumnType("text"); - - b.Property("Comment") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("Description") - .HasMaxLength(450) - .HasColumnType("character varying(450)"); - - b.Property("DesiredStartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("EndTime") - .HasColumnType("timestamp with time zone"); - - b.Property("EstimatedDuration") - .HasColumnType("bigint"); - - b.Property("InstallationCode") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("IsarMissionId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("MissionRunPriority") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("StartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("StatusReason") - .HasMaxLength(450) - .HasColumnType("character varying(450)"); - - b.HasKey("Id"); - - b.HasIndex("AreaId"); - - b.HasIndex("RobotId"); - - b.ToTable("MissionRuns"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionTask", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("EchoPoseId") - .HasColumnType("integer"); - - b.Property("EchoTagLink") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("EndTime") - .HasColumnType("timestamp with time zone"); - - b.Property("IsarTaskId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionRunId") - .HasColumnType("text"); - - b.Property("StartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("TagId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("TaskOrder") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("MissionRunId"); - - b.ToTable("MissionTasks"); - }); - - modelBuilder.Entity("Api.Database.Models.Plant", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("InstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PlantCode") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(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("text"); - - b.Property("BatteryLevel") - .HasColumnType("real"); - - b.Property("CurrentAreaId") - .HasColumnType("text"); - - b.Property("CurrentInstallation") - .IsRequired() - .HasColumnType("text"); - - b.Property("CurrentMissionId") - .HasColumnType("text"); - - b.Property("Enabled") - .HasColumnType("boolean"); - - b.Property("Host") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("IsarId") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionQueueFrozen") - .HasColumnType("boolean"); - - b.Property("ModelId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Port") - .HasColumnType("integer"); - - b.Property("PressureLevel") - .HasColumnType("real"); - - b.Property("SerialNumber") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("CurrentAreaId"); - - b.HasIndex("ModelId"); - - b.ToTable("Robots"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotBatteryTimeseries", b => - { - b.Property("BatteryLevel") - .HasColumnType("real"); - - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Time") - .HasColumnType("timestamp with time zone"); - - b.ToTable("RobotBatteryTimeseries"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotModel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AverageDurationPerTag") - .HasColumnType("real"); - - b.Property("BatteryWarningThreshold") - .HasColumnType("real"); - - b.Property("LowerPressureWarningThreshold") - .HasColumnType("real"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - b.Property("UpperPressureWarningThreshold") - .HasColumnType("real"); - - b.HasKey("Id"); - - b.HasIndex("Type") - .IsUnique(); - - b.ToTable("RobotModels"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotPoseTimeseries", b => - { - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("OrientationW") - .HasColumnType("real"); - - b.Property("OrientationX") - .HasColumnType("real"); - - b.Property("OrientationY") - .HasColumnType("real"); - - b.Property("OrientationZ") - .HasColumnType("real"); - - b.Property("PositionX") - .HasColumnType("real"); - - b.Property("PositionY") - .HasColumnType("real"); - - b.Property("PositionZ") - .HasColumnType("real"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Time") - .HasColumnType("timestamp with time zone"); - - b.ToTable("RobotPoseTimeseries"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotPressureTimeseries", b => - { - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("Pressure") - .HasColumnType("real"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Time") - .HasColumnType("timestamp with time zone"); - - b.ToTable("RobotPressureTimeseries"); - }); - - modelBuilder.Entity("Api.Database.Models.SafePosition", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AreaId") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("AreaId"); - - b.ToTable("SafePositions"); - }); - - modelBuilder.Entity("Api.Database.Models.Source", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("SourceId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - 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); - - b.HasOne("Api.Database.Models.DefaultLocalizationPose", "DefaultLocalizationPose") - .WithMany() - .HasForeignKey("DefaultLocalizationPoseId"); - - 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.MapMetadata", "MapMetadata", b1 => - { - b1.Property("AreaId") - .HasColumnType("text"); - - b1.Property("MapName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.HasKey("AreaId"); - - b1.ToTable("Areas"); - - b1.WithOwner() - .HasForeignKey("AreaId"); - - b1.OwnsOne("Api.Database.Models.Boundary", "Boundary", b2 => - { - b2.Property("MapMetadataAreaId") - .HasColumnType("text"); - - b2.Property("X1") - .HasColumnType("double precision"); - - b2.Property("X2") - .HasColumnType("double precision"); - - b2.Property("Y1") - .HasColumnType("double precision"); - - b2.Property("Y2") - .HasColumnType("double precision"); - - b2.Property("Z1") - .HasColumnType("double precision"); - - b2.Property("Z2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataAreaId"); - - b2.ToTable("Areas"); - - b2.WithOwner() - .HasForeignKey("MapMetadataAreaId"); - }); - - b1.OwnsOne("Api.Database.Models.TransformationMatrices", "TransformationMatrices", b2 => - { - b2.Property("MapMetadataAreaId") - .HasColumnType("text"); - - b2.Property("C1") - .HasColumnType("double precision"); - - b2.Property("C2") - .HasColumnType("double precision"); - - b2.Property("D1") - .HasColumnType("double precision"); - - b2.Property("D2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataAreaId"); - - b2.ToTable("Areas"); - - b2.WithOwner() - .HasForeignKey("MapMetadataAreaId"); - }); - - b1.Navigation("Boundary") - .IsRequired(); - - b1.Navigation("TransformationMatrices") - .IsRequired(); - }); - - b.Navigation("Deck"); - - b.Navigation("DefaultLocalizationPose"); - - b.Navigation("Installation"); - - b.Navigation("MapMetadata") - .IsRequired(); - - b.Navigation("Plant"); - }); - - modelBuilder.Entity("Api.Database.Models.Deck", b => - { - b.HasOne("Api.Database.Models.DefaultLocalizationPose", "DefaultLocalizationPose") - .WithMany() - .HasForeignKey("DefaultLocalizationPoseId"); - - 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.Navigation("DefaultLocalizationPose"); - - b.Navigation("Installation"); - - b.Navigation("Plant"); - }); - - modelBuilder.Entity("Api.Database.Models.DefaultLocalizationPose", b => - { - b.OwnsOne("Api.Database.Models.Pose", "Pose", b1 => - { - b1.Property("DefaultLocalizationPoseId") - .HasColumnType("text"); - - b1.HasKey("DefaultLocalizationPoseId"); - - b1.ToTable("DefaultLocalizationPoses"); - - b1.WithOwner() - .HasForeignKey("DefaultLocalizationPoseId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseDefaultLocalizationPoseId") - .HasColumnType("text"); - - b2.Property("W") - .HasColumnType("real"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseDefaultLocalizationPoseId"); - - b2.ToTable("DefaultLocalizationPoses"); - - b2.WithOwner() - .HasForeignKey("PoseDefaultLocalizationPoseId"); - }); - - b1.OwnsOne("Api.Database.Models.Position", "Position", b2 => - { - b2.Property("PoseDefaultLocalizationPoseId") - .HasColumnType("text"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseDefaultLocalizationPoseId"); - - b2.ToTable("DefaultLocalizationPoses"); - - b2.WithOwner() - .HasForeignKey("PoseDefaultLocalizationPoseId"); - }); - - b1.Navigation("Orientation") - .IsRequired(); - - b1.Navigation("Position") - .IsRequired(); - }); - - b.Navigation("Pose") - .IsRequired(); - }); - - modelBuilder.Entity("Api.Database.Models.Inspection", b => - { - b.HasOne("Api.Database.Models.MissionTask", null) - .WithMany("Inspections") - .HasForeignKey("MissionTaskId"); - - b.OwnsOne("Api.Database.Models.Position", "InspectionTarget", b1 => - { - b1.Property("InspectionId") - .HasColumnType("text"); - - b1.Property("X") - .HasColumnType("real"); - - b1.Property("Y") - .HasColumnType("real"); - - b1.Property("Z") - .HasColumnType("real"); - - b1.HasKey("InspectionId"); - - b1.ToTable("Inspections"); - - b1.WithOwner() - .HasForeignKey("InspectionId"); - }); - - b.Navigation("InspectionTarget") - .IsRequired(); - }); - - modelBuilder.Entity("Api.Database.Models.MissionDefinition", b => - { - b.HasOne("Api.Database.Models.Area", "Area") - .WithMany() - .HasForeignKey("AreaId"); - - b.HasOne("Api.Database.Models.MissionRun", "LastSuccessfulRun") - .WithMany() - .HasForeignKey("LastSuccessfulRunId"); - - b.HasOne("Api.Database.Models.Source", "Source") - .WithMany() - .HasForeignKey("SourceId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Area"); - - b.Navigation("LastSuccessfulRun"); - - 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", "Map", b1 => - { - b1.Property("MissionRunId") - .HasColumnType("text"); - - b1.Property("MapName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.HasKey("MissionRunId"); - - b1.ToTable("MissionRuns"); - - b1.WithOwner() - .HasForeignKey("MissionRunId"); - - b1.OwnsOne("Api.Database.Models.Boundary", "Boundary", b2 => - { - b2.Property("MapMetadataMissionRunId") - .HasColumnType("text"); - - b2.Property("X1") - .HasColumnType("double precision"); - - b2.Property("X2") - .HasColumnType("double precision"); - - b2.Property("Y1") - .HasColumnType("double precision"); - - b2.Property("Y2") - .HasColumnType("double precision"); - - b2.Property("Z1") - .HasColumnType("double precision"); - - b2.Property("Z2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataMissionRunId"); - - b2.ToTable("MissionRuns"); - - b2.WithOwner() - .HasForeignKey("MapMetadataMissionRunId"); - }); - - b1.OwnsOne("Api.Database.Models.TransformationMatrices", "TransformationMatrices", b2 => - { - b2.Property("MapMetadataMissionRunId") - .HasColumnType("text"); - - b2.Property("C1") - .HasColumnType("double precision"); - - b2.Property("C2") - .HasColumnType("double precision"); - - b2.Property("D1") - .HasColumnType("double precision"); - - b2.Property("D2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataMissionRunId"); - - b2.ToTable("MissionRuns"); - - b2.WithOwner() - .HasForeignKey("MapMetadataMissionRunId"); - }); - - b1.Navigation("Boundary") - .IsRequired(); - - b1.Navigation("TransformationMatrices") - .IsRequired(); - }); - - b.Navigation("Area"); - - b.Navigation("Map"); - - b.Navigation("Robot"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionTask", b => - { - b.HasOne("Api.Database.Models.MissionRun", null) - .WithMany("Tasks") - .HasForeignKey("MissionRunId"); - - b.OwnsOne("Api.Database.Models.Position", "InspectionTarget", b1 => - { - b1.Property("MissionTaskId") - .HasColumnType("text"); - - b1.Property("X") - .HasColumnType("real"); - - b1.Property("Y") - .HasColumnType("real"); - - b1.Property("Z") - .HasColumnType("real"); - - b1.HasKey("MissionTaskId"); - - b1.ToTable("MissionTasks"); - - b1.WithOwner() - .HasForeignKey("MissionTaskId"); - }); - - b.OwnsOne("Api.Database.Models.Pose", "RobotPose", b1 => - { - b1.Property("MissionTaskId") - .HasColumnType("text"); - - b1.HasKey("MissionTaskId"); - - b1.ToTable("MissionTasks"); - - b1.WithOwner() - .HasForeignKey("MissionTaskId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseMissionTaskId") - .HasColumnType("text"); - - b2.Property("W") - .HasColumnType("real"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseMissionTaskId"); - - b2.ToTable("MissionTasks"); - - b2.WithOwner() - .HasForeignKey("PoseMissionTaskId"); - }); - - b1.OwnsOne("Api.Database.Models.Position", "Position", b2 => - { - b2.Property("PoseMissionTaskId") - .HasColumnType("text"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseMissionTaskId"); - - b2.ToTable("MissionTasks"); - - b2.WithOwner() - .HasForeignKey("PoseMissionTaskId"); - }); - - b1.Navigation("Orientation") - .IsRequired(); - - b1.Navigation("Position") - .IsRequired(); - }); - - b.Navigation("InspectionTarget") - .IsRequired(); - - b.Navigation("RobotPose") - .IsRequired(); - }); - - modelBuilder.Entity("Api.Database.Models.Plant", b => - { - b.HasOne("Api.Database.Models.Installation", "Installation") - .WithMany() - .HasForeignKey("InstallationId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - 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("text"); - - b1.HasKey("RobotId"); - - b1.ToTable("Robots"); - - b1.WithOwner() - .HasForeignKey("RobotId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseRobotId") - .HasColumnType("text"); - - 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("text"); - - 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("text"); - - b1.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b1.Property("ShouldRotate270Clockwise") - .HasColumnType("boolean"); - - b1.Property("Type") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b1.Property("Url") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(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("text"); - - b1.HasKey("SafePositionId"); - - b1.ToTable("SafePositions"); - - b1.WithOwner() - .HasForeignKey("SafePositionId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseSafePositionId") - .HasColumnType("text"); - - 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("text"); - - 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"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionRun", b => - { - b.Navigation("Tasks"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionTask", b => - { - b.Navigation("Inspections"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/backend/api/Migrations/20231115125019_RemoveInspectionFindingsTable.cs b/backend/api/Migrations/20231115125019_RemoveInspectionFindingsTable.cs deleted file mode 100644 index 34d27cdf8..000000000 --- a/backend/api/Migrations/20231115125019_RemoveInspectionFindingsTable.cs +++ /dev/null @@ -1,45 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace Api.Migrations -{ - /// - public partial class RemoveInspectionFindingsTable : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "InspectionFindings"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "InspectionFindings", - columns: table => new - { - InspectionId = table.Column(type: "text", nullable: false), - Id = table.Column(type: "integer", nullable: false) - .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), - Area = table.Column(type: "text", nullable: false), - FindingsTag = table.Column(type: "text", nullable: false), - InspectionDate = table.Column(type: "text", nullable: false), - RobotName = table.Column(type: "text", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_InspectionFindings", x => new { x.InspectionId, x.Id }); - table.ForeignKey( - name: "FK_InspectionFindings_Inspections_InspectionId", - column: x => x.InspectionId, - principalTable: "Inspections", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - } - } -} diff --git a/backend/api/Migrations/20231115130240_AddInspectionFindingsTable.Designer.cs b/backend/api/Migrations/20231115130240_AddInspectionFindingsTable.Designer.cs deleted file mode 100644 index 3ce6a9912..000000000 --- a/backend/api/Migrations/20231115130240_AddInspectionFindingsTable.Designer.cs +++ /dev/null @@ -1,1311 +0,0 @@ -// -using System; -using Api.Database.Context; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace Api.Migrations -{ - [DbContext(typeof(FlotillaDbContext))] - [Migration("20231115130240_AddInspectionFindingsTable")] - partial class AddInspectionFindingsTable - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "7.0.11") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("Api.Database.Models.Area", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("DeckId") - .HasColumnType("text"); - - b.Property("DefaultLocalizationPoseId") - .HasColumnType("text"); - - b.Property("InstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PlantId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("DeckId"); - - b.HasIndex("DefaultLocalizationPoseId"); - - b.HasIndex("InstallationId"); - - b.HasIndex("PlantId"); - - b.ToTable("Areas"); - }); - - modelBuilder.Entity("Api.Database.Models.Deck", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("DefaultLocalizationPoseId") - .HasColumnType("text"); - - b.Property("InstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PlantId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("DefaultLocalizationPoseId"); - - b.HasIndex("InstallationId"); - - b.HasIndex("PlantId"); - - b.ToTable("Decks"); - }); - - modelBuilder.Entity("Api.Database.Models.DefaultLocalizationPose", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.ToTable("DefaultLocalizationPoses"); - }); - - modelBuilder.Entity("Api.Database.Models.Inspection", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AnalysisType") - .HasColumnType("text"); - - b.Property("EndTime") - .HasColumnType("timestamp with time zone"); - - b.Property("InspectionType") - .IsRequired() - .HasColumnType("text"); - - b.Property("InspectionUrl") - .HasMaxLength(250) - .HasColumnType("character varying(250)"); - - b.Property("IsarStepId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionTaskId") - .HasColumnType("text"); - - b.Property("StartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("VideoDuration") - .HasColumnType("real"); - - b.HasKey("Id"); - - b.HasIndex("MissionTaskId"); - - b.ToTable("Inspections"); - }); - - modelBuilder.Entity("Api.Database.Models.Installation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("InstallationCode") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.HasKey("Id"); - - b.HasIndex("InstallationCode") - .IsUnique(); - - b.ToTable("Installations"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionDefinition", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AreaId") - .HasColumnType("text"); - - b.Property("Comment") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("InspectionFrequency") - .HasColumnType("bigint"); - - b.Property("InstallationCode") - .IsRequired() - .HasColumnType("text"); - - b.Property("IsDeprecated") - .HasColumnType("boolean"); - - b.Property("LastSuccessfulRunId") - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("SourceId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("AreaId"); - - b.HasIndex("LastSuccessfulRunId"); - - b.HasIndex("SourceId"); - - b.ToTable("MissionDefinitions"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionRun", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AreaId") - .HasColumnType("text"); - - b.Property("Comment") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("Description") - .HasMaxLength(450) - .HasColumnType("character varying(450)"); - - b.Property("DesiredStartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("EndTime") - .HasColumnType("timestamp with time zone"); - - b.Property("EstimatedDuration") - .HasColumnType("bigint"); - - b.Property("InstallationCode") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("IsarMissionId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("MissionRunPriority") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("StartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("StatusReason") - .HasMaxLength(450) - .HasColumnType("character varying(450)"); - - b.HasKey("Id"); - - b.HasIndex("AreaId"); - - b.HasIndex("RobotId"); - - b.ToTable("MissionRuns"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionTask", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("EchoPoseId") - .HasColumnType("integer"); - - b.Property("EchoTagLink") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("EndTime") - .HasColumnType("timestamp with time zone"); - - b.Property("IsarTaskId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionRunId") - .HasColumnType("text"); - - b.Property("StartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("TagId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("TaskOrder") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("MissionRunId"); - - b.ToTable("MissionTasks"); - }); - - modelBuilder.Entity("Api.Database.Models.Plant", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("InstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PlantCode") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(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("text"); - - b.Property("BatteryLevel") - .HasColumnType("real"); - - b.Property("CurrentAreaId") - .HasColumnType("text"); - - b.Property("CurrentInstallation") - .IsRequired() - .HasColumnType("text"); - - b.Property("CurrentMissionId") - .HasColumnType("text"); - - b.Property("Enabled") - .HasColumnType("boolean"); - - b.Property("Host") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("IsarId") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionQueueFrozen") - .HasColumnType("boolean"); - - b.Property("ModelId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Port") - .HasColumnType("integer"); - - b.Property("PressureLevel") - .HasColumnType("real"); - - b.Property("SerialNumber") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("CurrentAreaId"); - - b.HasIndex("ModelId"); - - b.ToTable("Robots"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotBatteryTimeseries", b => - { - b.Property("BatteryLevel") - .HasColumnType("real"); - - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Time") - .HasColumnType("timestamp with time zone"); - - b.ToTable("RobotBatteryTimeseries"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotModel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AverageDurationPerTag") - .HasColumnType("real"); - - b.Property("BatteryWarningThreshold") - .HasColumnType("real"); - - b.Property("LowerPressureWarningThreshold") - .HasColumnType("real"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - b.Property("UpperPressureWarningThreshold") - .HasColumnType("real"); - - b.HasKey("Id"); - - b.HasIndex("Type") - .IsUnique(); - - b.ToTable("RobotModels"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotPoseTimeseries", b => - { - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("OrientationW") - .HasColumnType("real"); - - b.Property("OrientationX") - .HasColumnType("real"); - - b.Property("OrientationY") - .HasColumnType("real"); - - b.Property("OrientationZ") - .HasColumnType("real"); - - b.Property("PositionX") - .HasColumnType("real"); - - b.Property("PositionY") - .HasColumnType("real"); - - b.Property("PositionZ") - .HasColumnType("real"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Time") - .HasColumnType("timestamp with time zone"); - - b.ToTable("RobotPoseTimeseries"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotPressureTimeseries", b => - { - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("Pressure") - .HasColumnType("real"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Time") - .HasColumnType("timestamp with time zone"); - - b.ToTable("RobotPressureTimeseries"); - }); - - modelBuilder.Entity("Api.Database.Models.SafePosition", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AreaId") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("AreaId"); - - b.ToTable("SafePositions"); - }); - - modelBuilder.Entity("Api.Database.Models.Source", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("SourceId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - 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); - - b.HasOne("Api.Database.Models.DefaultLocalizationPose", "DefaultLocalizationPose") - .WithMany() - .HasForeignKey("DefaultLocalizationPoseId"); - - 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.MapMetadata", "MapMetadata", b1 => - { - b1.Property("AreaId") - .HasColumnType("text"); - - b1.Property("MapName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.HasKey("AreaId"); - - b1.ToTable("Areas"); - - b1.WithOwner() - .HasForeignKey("AreaId"); - - b1.OwnsOne("Api.Database.Models.Boundary", "Boundary", b2 => - { - b2.Property("MapMetadataAreaId") - .HasColumnType("text"); - - b2.Property("X1") - .HasColumnType("double precision"); - - b2.Property("X2") - .HasColumnType("double precision"); - - b2.Property("Y1") - .HasColumnType("double precision"); - - b2.Property("Y2") - .HasColumnType("double precision"); - - b2.Property("Z1") - .HasColumnType("double precision"); - - b2.Property("Z2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataAreaId"); - - b2.ToTable("Areas"); - - b2.WithOwner() - .HasForeignKey("MapMetadataAreaId"); - }); - - b1.OwnsOne("Api.Database.Models.TransformationMatrices", "TransformationMatrices", b2 => - { - b2.Property("MapMetadataAreaId") - .HasColumnType("text"); - - b2.Property("C1") - .HasColumnType("double precision"); - - b2.Property("C2") - .HasColumnType("double precision"); - - b2.Property("D1") - .HasColumnType("double precision"); - - b2.Property("D2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataAreaId"); - - b2.ToTable("Areas"); - - b2.WithOwner() - .HasForeignKey("MapMetadataAreaId"); - }); - - b1.Navigation("Boundary") - .IsRequired(); - - b1.Navigation("TransformationMatrices") - .IsRequired(); - }); - - b.Navigation("Deck"); - - b.Navigation("DefaultLocalizationPose"); - - b.Navigation("Installation"); - - b.Navigation("MapMetadata") - .IsRequired(); - - b.Navigation("Plant"); - }); - - modelBuilder.Entity("Api.Database.Models.Deck", b => - { - b.HasOne("Api.Database.Models.DefaultLocalizationPose", "DefaultLocalizationPose") - .WithMany() - .HasForeignKey("DefaultLocalizationPoseId"); - - 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.Navigation("DefaultLocalizationPose"); - - b.Navigation("Installation"); - - b.Navigation("Plant"); - }); - - modelBuilder.Entity("Api.Database.Models.DefaultLocalizationPose", b => - { - b.OwnsOne("Api.Database.Models.Pose", "Pose", b1 => - { - b1.Property("DefaultLocalizationPoseId") - .HasColumnType("text"); - - b1.HasKey("DefaultLocalizationPoseId"); - - b1.ToTable("DefaultLocalizationPoses"); - - b1.WithOwner() - .HasForeignKey("DefaultLocalizationPoseId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseDefaultLocalizationPoseId") - .HasColumnType("text"); - - b2.Property("W") - .HasColumnType("real"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseDefaultLocalizationPoseId"); - - b2.ToTable("DefaultLocalizationPoses"); - - b2.WithOwner() - .HasForeignKey("PoseDefaultLocalizationPoseId"); - }); - - b1.OwnsOne("Api.Database.Models.Position", "Position", b2 => - { - b2.Property("PoseDefaultLocalizationPoseId") - .HasColumnType("text"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseDefaultLocalizationPoseId"); - - b2.ToTable("DefaultLocalizationPoses"); - - b2.WithOwner() - .HasForeignKey("PoseDefaultLocalizationPoseId"); - }); - - b1.Navigation("Orientation") - .IsRequired(); - - b1.Navigation("Position") - .IsRequired(); - }); - - b.Navigation("Pose") - .IsRequired(); - }); - - modelBuilder.Entity("Api.Database.Models.Inspection", b => - { - b.HasOne("Api.Database.Models.MissionTask", null) - .WithMany("Inspections") - .HasForeignKey("MissionTaskId"); - - b.OwnsOne("Api.Database.Models.Position", "InspectionTarget", b1 => - { - b1.Property("InspectionId") - .HasColumnType("text"); - - b1.Property("X") - .HasColumnType("real"); - - b1.Property("Y") - .HasColumnType("real"); - - b1.Property("Z") - .HasColumnType("real"); - - b1.HasKey("InspectionId"); - - b1.ToTable("Inspections"); - - b1.WithOwner() - .HasForeignKey("InspectionId"); - }); - - b.OwnsMany("Api.Database.Models.InspectionFinding", "InspectionFindings", b1 => - { - b1.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b1.Property("Area") - .IsRequired() - .HasColumnType("text"); - - b1.Property("Findings") - .IsRequired() - .HasColumnType("text"); - - b1.Property("InspectionDate") - .HasColumnType("timestamp with time zone"); - - b1.Property("InspectionId") - .HasColumnType("text"); - - b1.Property("IsarStepId") - .IsRequired() - .HasColumnType("text"); - - b1.HasKey("Id"); - - b1.HasIndex("InspectionId"); - - b1.ToTable("InspectionFinding"); - - b1.WithOwner() - .HasForeignKey("InspectionId"); - }); - - b.Navigation("InspectionFindings"); - - b.Navigation("InspectionTarget") - .IsRequired(); - }); - - modelBuilder.Entity("Api.Database.Models.MissionDefinition", b => - { - b.HasOne("Api.Database.Models.Area", "Area") - .WithMany() - .HasForeignKey("AreaId"); - - b.HasOne("Api.Database.Models.MissionRun", "LastSuccessfulRun") - .WithMany() - .HasForeignKey("LastSuccessfulRunId"); - - b.HasOne("Api.Database.Models.Source", "Source") - .WithMany() - .HasForeignKey("SourceId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Area"); - - b.Navigation("LastSuccessfulRun"); - - 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", "Map", b1 => - { - b1.Property("MissionRunId") - .HasColumnType("text"); - - b1.Property("MapName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.HasKey("MissionRunId"); - - b1.ToTable("MissionRuns"); - - b1.WithOwner() - .HasForeignKey("MissionRunId"); - - b1.OwnsOne("Api.Database.Models.Boundary", "Boundary", b2 => - { - b2.Property("MapMetadataMissionRunId") - .HasColumnType("text"); - - b2.Property("X1") - .HasColumnType("double precision"); - - b2.Property("X2") - .HasColumnType("double precision"); - - b2.Property("Y1") - .HasColumnType("double precision"); - - b2.Property("Y2") - .HasColumnType("double precision"); - - b2.Property("Z1") - .HasColumnType("double precision"); - - b2.Property("Z2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataMissionRunId"); - - b2.ToTable("MissionRuns"); - - b2.WithOwner() - .HasForeignKey("MapMetadataMissionRunId"); - }); - - b1.OwnsOne("Api.Database.Models.TransformationMatrices", "TransformationMatrices", b2 => - { - b2.Property("MapMetadataMissionRunId") - .HasColumnType("text"); - - b2.Property("C1") - .HasColumnType("double precision"); - - b2.Property("C2") - .HasColumnType("double precision"); - - b2.Property("D1") - .HasColumnType("double precision"); - - b2.Property("D2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataMissionRunId"); - - b2.ToTable("MissionRuns"); - - b2.WithOwner() - .HasForeignKey("MapMetadataMissionRunId"); - }); - - b1.Navigation("Boundary") - .IsRequired(); - - b1.Navigation("TransformationMatrices") - .IsRequired(); - }); - - b.Navigation("Area"); - - b.Navigation("Map"); - - b.Navigation("Robot"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionTask", b => - { - b.HasOne("Api.Database.Models.MissionRun", null) - .WithMany("Tasks") - .HasForeignKey("MissionRunId"); - - b.OwnsOne("Api.Database.Models.Position", "InspectionTarget", b1 => - { - b1.Property("MissionTaskId") - .HasColumnType("text"); - - b1.Property("X") - .HasColumnType("real"); - - b1.Property("Y") - .HasColumnType("real"); - - b1.Property("Z") - .HasColumnType("real"); - - b1.HasKey("MissionTaskId"); - - b1.ToTable("MissionTasks"); - - b1.WithOwner() - .HasForeignKey("MissionTaskId"); - }); - - b.OwnsOne("Api.Database.Models.Pose", "RobotPose", b1 => - { - b1.Property("MissionTaskId") - .HasColumnType("text"); - - b1.HasKey("MissionTaskId"); - - b1.ToTable("MissionTasks"); - - b1.WithOwner() - .HasForeignKey("MissionTaskId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseMissionTaskId") - .HasColumnType("text"); - - b2.Property("W") - .HasColumnType("real"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseMissionTaskId"); - - b2.ToTable("MissionTasks"); - - b2.WithOwner() - .HasForeignKey("PoseMissionTaskId"); - }); - - b1.OwnsOne("Api.Database.Models.Position", "Position", b2 => - { - b2.Property("PoseMissionTaskId") - .HasColumnType("text"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseMissionTaskId"); - - b2.ToTable("MissionTasks"); - - b2.WithOwner() - .HasForeignKey("PoseMissionTaskId"); - }); - - b1.Navigation("Orientation") - .IsRequired(); - - b1.Navigation("Position") - .IsRequired(); - }); - - b.Navigation("InspectionTarget") - .IsRequired(); - - b.Navigation("RobotPose") - .IsRequired(); - }); - - modelBuilder.Entity("Api.Database.Models.Plant", b => - { - b.HasOne("Api.Database.Models.Installation", "Installation") - .WithMany() - .HasForeignKey("InstallationId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - 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("text"); - - b1.HasKey("RobotId"); - - b1.ToTable("Robots"); - - b1.WithOwner() - .HasForeignKey("RobotId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseRobotId") - .HasColumnType("text"); - - 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("text"); - - 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("text"); - - b1.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b1.Property("ShouldRotate270Clockwise") - .HasColumnType("boolean"); - - b1.Property("Type") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b1.Property("Url") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(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("text"); - - b1.HasKey("SafePositionId"); - - b1.ToTable("SafePositions"); - - b1.WithOwner() - .HasForeignKey("SafePositionId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseSafePositionId") - .HasColumnType("text"); - - 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("text"); - - 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"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionRun", b => - { - b.Navigation("Tasks"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionTask", b => - { - b.Navigation("Inspections"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/backend/api/Migrations/20231115130240_AddInspectionFindingsTable.cs b/backend/api/Migrations/20231115130240_AddInspectionFindingsTable.cs deleted file mode 100644 index c41c3fc31..000000000 --- a/backend/api/Migrations/20231115130240_AddInspectionFindingsTable.cs +++ /dev/null @@ -1,49 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Api.Migrations -{ - /// - public partial class AddInspectionFindingsTable : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "InspectionFinding", - columns: table => new - { - Id = table.Column(type: "text", nullable: false), - InspectionDate = table.Column(type: "timestamp with time zone", nullable: false), - Area = table.Column(type: "text", nullable: false), - IsarStepId = table.Column(type: "text", nullable: false), - Findings = table.Column(type: "text", nullable: false), - InspectionId = table.Column(type: "text", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_InspectionFinding", x => x.Id); - table.ForeignKey( - name: "FK_InspectionFinding_Inspections_InspectionId", - column: x => x.InspectionId, - principalTable: "Inspections", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateIndex( - name: "IX_InspectionFinding_InspectionId", - table: "InspectionFinding", - column: "InspectionId"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "InspectionFinding"); - } - } -} diff --git a/backend/api/Migrations/20231116095346_RefactorInspectionFindingsTable.Designer.cs b/backend/api/Migrations/20231116095346_RefactorInspectionFindingsTable.Designer.cs deleted file mode 100644 index d5f7fd458..000000000 --- a/backend/api/Migrations/20231116095346_RefactorInspectionFindingsTable.Designer.cs +++ /dev/null @@ -1,1307 +0,0 @@ -// -using System; -using Api.Database.Context; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace Api.Migrations -{ - [DbContext(typeof(FlotillaDbContext))] - [Migration("20231116095346_RefactorInspectionFindingsTable")] - partial class RefactorInspectionFindingsTable - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "7.0.11") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("Api.Database.Models.Area", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("DeckId") - .HasColumnType("text"); - - b.Property("DefaultLocalizationPoseId") - .HasColumnType("text"); - - b.Property("InstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PlantId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("DeckId"); - - b.HasIndex("DefaultLocalizationPoseId"); - - b.HasIndex("InstallationId"); - - b.HasIndex("PlantId"); - - b.ToTable("Areas"); - }); - - modelBuilder.Entity("Api.Database.Models.Deck", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("DefaultLocalizationPoseId") - .HasColumnType("text"); - - b.Property("InstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PlantId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("DefaultLocalizationPoseId"); - - b.HasIndex("InstallationId"); - - b.HasIndex("PlantId"); - - b.ToTable("Decks"); - }); - - modelBuilder.Entity("Api.Database.Models.DefaultLocalizationPose", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.ToTable("DefaultLocalizationPoses"); - }); - - modelBuilder.Entity("Api.Database.Models.Inspection", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AnalysisType") - .HasColumnType("text"); - - b.Property("EndTime") - .HasColumnType("timestamp with time zone"); - - b.Property("InspectionType") - .IsRequired() - .HasColumnType("text"); - - b.Property("InspectionUrl") - .HasMaxLength(250) - .HasColumnType("character varying(250)"); - - b.Property("IsarStepId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionTaskId") - .HasColumnType("text"); - - b.Property("StartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("VideoDuration") - .HasColumnType("real"); - - b.HasKey("Id"); - - b.HasIndex("MissionTaskId"); - - b.ToTable("Inspections"); - }); - - modelBuilder.Entity("Api.Database.Models.Installation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("InstallationCode") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.HasKey("Id"); - - b.HasIndex("InstallationCode") - .IsUnique(); - - b.ToTable("Installations"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionDefinition", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AreaId") - .HasColumnType("text"); - - b.Property("Comment") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("InspectionFrequency") - .HasColumnType("bigint"); - - b.Property("InstallationCode") - .IsRequired() - .HasColumnType("text"); - - b.Property("IsDeprecated") - .HasColumnType("boolean"); - - b.Property("LastSuccessfulRunId") - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("SourceId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("AreaId"); - - b.HasIndex("LastSuccessfulRunId"); - - b.HasIndex("SourceId"); - - b.ToTable("MissionDefinitions"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionRun", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AreaId") - .HasColumnType("text"); - - b.Property("Comment") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("Description") - .HasMaxLength(450) - .HasColumnType("character varying(450)"); - - b.Property("DesiredStartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("EndTime") - .HasColumnType("timestamp with time zone"); - - b.Property("EstimatedDuration") - .HasColumnType("bigint"); - - b.Property("InstallationCode") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("IsarMissionId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("MissionRunPriority") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("StartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("StatusReason") - .HasMaxLength(450) - .HasColumnType("character varying(450)"); - - b.HasKey("Id"); - - b.HasIndex("AreaId"); - - b.HasIndex("RobotId"); - - b.ToTable("MissionRuns"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionTask", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("EchoPoseId") - .HasColumnType("integer"); - - b.Property("EchoTagLink") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("EndTime") - .HasColumnType("timestamp with time zone"); - - b.Property("IsarTaskId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionRunId") - .HasColumnType("text"); - - b.Property("StartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("TagId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("TaskOrder") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("MissionRunId"); - - b.ToTable("MissionTasks"); - }); - - modelBuilder.Entity("Api.Database.Models.Plant", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("InstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PlantCode") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(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("text"); - - b.Property("BatteryLevel") - .HasColumnType("real"); - - b.Property("CurrentAreaId") - .HasColumnType("text"); - - b.Property("CurrentInstallation") - .IsRequired() - .HasColumnType("text"); - - b.Property("CurrentMissionId") - .HasColumnType("text"); - - b.Property("Enabled") - .HasColumnType("boolean"); - - b.Property("Host") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("IsarId") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionQueueFrozen") - .HasColumnType("boolean"); - - b.Property("ModelId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Port") - .HasColumnType("integer"); - - b.Property("PressureLevel") - .HasColumnType("real"); - - b.Property("SerialNumber") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("CurrentAreaId"); - - b.HasIndex("ModelId"); - - b.ToTable("Robots"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotBatteryTimeseries", b => - { - b.Property("BatteryLevel") - .HasColumnType("real"); - - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Time") - .HasColumnType("timestamp with time zone"); - - b.ToTable("RobotBatteryTimeseries"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotModel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AverageDurationPerTag") - .HasColumnType("real"); - - b.Property("BatteryWarningThreshold") - .HasColumnType("real"); - - b.Property("LowerPressureWarningThreshold") - .HasColumnType("real"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - b.Property("UpperPressureWarningThreshold") - .HasColumnType("real"); - - b.HasKey("Id"); - - b.HasIndex("Type") - .IsUnique(); - - b.ToTable("RobotModels"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotPoseTimeseries", b => - { - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("OrientationW") - .HasColumnType("real"); - - b.Property("OrientationX") - .HasColumnType("real"); - - b.Property("OrientationY") - .HasColumnType("real"); - - b.Property("OrientationZ") - .HasColumnType("real"); - - b.Property("PositionX") - .HasColumnType("real"); - - b.Property("PositionY") - .HasColumnType("real"); - - b.Property("PositionZ") - .HasColumnType("real"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Time") - .HasColumnType("timestamp with time zone"); - - b.ToTable("RobotPoseTimeseries"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotPressureTimeseries", b => - { - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("Pressure") - .HasColumnType("real"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Time") - .HasColumnType("timestamp with time zone"); - - b.ToTable("RobotPressureTimeseries"); - }); - - modelBuilder.Entity("Api.Database.Models.SafePosition", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AreaId") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("AreaId"); - - b.ToTable("SafePositions"); - }); - - modelBuilder.Entity("Api.Database.Models.Source", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("SourceId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - 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); - - b.HasOne("Api.Database.Models.DefaultLocalizationPose", "DefaultLocalizationPose") - .WithMany() - .HasForeignKey("DefaultLocalizationPoseId"); - - 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.MapMetadata", "MapMetadata", b1 => - { - b1.Property("AreaId") - .HasColumnType("text"); - - b1.Property("MapName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.HasKey("AreaId"); - - b1.ToTable("Areas"); - - b1.WithOwner() - .HasForeignKey("AreaId"); - - b1.OwnsOne("Api.Database.Models.Boundary", "Boundary", b2 => - { - b2.Property("MapMetadataAreaId") - .HasColumnType("text"); - - b2.Property("X1") - .HasColumnType("double precision"); - - b2.Property("X2") - .HasColumnType("double precision"); - - b2.Property("Y1") - .HasColumnType("double precision"); - - b2.Property("Y2") - .HasColumnType("double precision"); - - b2.Property("Z1") - .HasColumnType("double precision"); - - b2.Property("Z2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataAreaId"); - - b2.ToTable("Areas"); - - b2.WithOwner() - .HasForeignKey("MapMetadataAreaId"); - }); - - b1.OwnsOne("Api.Database.Models.TransformationMatrices", "TransformationMatrices", b2 => - { - b2.Property("MapMetadataAreaId") - .HasColumnType("text"); - - b2.Property("C1") - .HasColumnType("double precision"); - - b2.Property("C2") - .HasColumnType("double precision"); - - b2.Property("D1") - .HasColumnType("double precision"); - - b2.Property("D2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataAreaId"); - - b2.ToTable("Areas"); - - b2.WithOwner() - .HasForeignKey("MapMetadataAreaId"); - }); - - b1.Navigation("Boundary") - .IsRequired(); - - b1.Navigation("TransformationMatrices") - .IsRequired(); - }); - - b.Navigation("Deck"); - - b.Navigation("DefaultLocalizationPose"); - - b.Navigation("Installation"); - - b.Navigation("MapMetadata") - .IsRequired(); - - b.Navigation("Plant"); - }); - - modelBuilder.Entity("Api.Database.Models.Deck", b => - { - b.HasOne("Api.Database.Models.DefaultLocalizationPose", "DefaultLocalizationPose") - .WithMany() - .HasForeignKey("DefaultLocalizationPoseId"); - - 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.Navigation("DefaultLocalizationPose"); - - b.Navigation("Installation"); - - b.Navigation("Plant"); - }); - - modelBuilder.Entity("Api.Database.Models.DefaultLocalizationPose", b => - { - b.OwnsOne("Api.Database.Models.Pose", "Pose", b1 => - { - b1.Property("DefaultLocalizationPoseId") - .HasColumnType("text"); - - b1.HasKey("DefaultLocalizationPoseId"); - - b1.ToTable("DefaultLocalizationPoses"); - - b1.WithOwner() - .HasForeignKey("DefaultLocalizationPoseId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseDefaultLocalizationPoseId") - .HasColumnType("text"); - - b2.Property("W") - .HasColumnType("real"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseDefaultLocalizationPoseId"); - - b2.ToTable("DefaultLocalizationPoses"); - - b2.WithOwner() - .HasForeignKey("PoseDefaultLocalizationPoseId"); - }); - - b1.OwnsOne("Api.Database.Models.Position", "Position", b2 => - { - b2.Property("PoseDefaultLocalizationPoseId") - .HasColumnType("text"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseDefaultLocalizationPoseId"); - - b2.ToTable("DefaultLocalizationPoses"); - - b2.WithOwner() - .HasForeignKey("PoseDefaultLocalizationPoseId"); - }); - - b1.Navigation("Orientation") - .IsRequired(); - - b1.Navigation("Position") - .IsRequired(); - }); - - b.Navigation("Pose") - .IsRequired(); - }); - - modelBuilder.Entity("Api.Database.Models.Inspection", b => - { - b.HasOne("Api.Database.Models.MissionTask", null) - .WithMany("Inspections") - .HasForeignKey("MissionTaskId"); - - b.OwnsOne("Api.Database.Models.Position", "InspectionTarget", b1 => - { - b1.Property("InspectionId") - .HasColumnType("text"); - - b1.Property("X") - .HasColumnType("real"); - - b1.Property("Y") - .HasColumnType("real"); - - b1.Property("Z") - .HasColumnType("real"); - - b1.HasKey("InspectionId"); - - b1.ToTable("Inspections"); - - b1.WithOwner() - .HasForeignKey("InspectionId"); - }); - - b.OwnsMany("Api.Database.Models.InspectionFinding", "InspectionFindings", b1 => - { - b1.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b1.Property("Findings") - .IsRequired() - .HasColumnType("text"); - - b1.Property("InspectionDate") - .HasColumnType("timestamp with time zone"); - - b1.Property("InspectionId") - .HasColumnType("text"); - - b1.Property("IsarStepId") - .IsRequired() - .HasColumnType("text"); - - b1.HasKey("Id"); - - b1.HasIndex("InspectionId"); - - b1.ToTable("InspectionFinding"); - - b1.WithOwner() - .HasForeignKey("InspectionId"); - }); - - b.Navigation("InspectionFindings"); - - b.Navigation("InspectionTarget") - .IsRequired(); - }); - - modelBuilder.Entity("Api.Database.Models.MissionDefinition", b => - { - b.HasOne("Api.Database.Models.Area", "Area") - .WithMany() - .HasForeignKey("AreaId"); - - b.HasOne("Api.Database.Models.MissionRun", "LastSuccessfulRun") - .WithMany() - .HasForeignKey("LastSuccessfulRunId"); - - b.HasOne("Api.Database.Models.Source", "Source") - .WithMany() - .HasForeignKey("SourceId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Area"); - - b.Navigation("LastSuccessfulRun"); - - 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", "Map", b1 => - { - b1.Property("MissionRunId") - .HasColumnType("text"); - - b1.Property("MapName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.HasKey("MissionRunId"); - - b1.ToTable("MissionRuns"); - - b1.WithOwner() - .HasForeignKey("MissionRunId"); - - b1.OwnsOne("Api.Database.Models.Boundary", "Boundary", b2 => - { - b2.Property("MapMetadataMissionRunId") - .HasColumnType("text"); - - b2.Property("X1") - .HasColumnType("double precision"); - - b2.Property("X2") - .HasColumnType("double precision"); - - b2.Property("Y1") - .HasColumnType("double precision"); - - b2.Property("Y2") - .HasColumnType("double precision"); - - b2.Property("Z1") - .HasColumnType("double precision"); - - b2.Property("Z2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataMissionRunId"); - - b2.ToTable("MissionRuns"); - - b2.WithOwner() - .HasForeignKey("MapMetadataMissionRunId"); - }); - - b1.OwnsOne("Api.Database.Models.TransformationMatrices", "TransformationMatrices", b2 => - { - b2.Property("MapMetadataMissionRunId") - .HasColumnType("text"); - - b2.Property("C1") - .HasColumnType("double precision"); - - b2.Property("C2") - .HasColumnType("double precision"); - - b2.Property("D1") - .HasColumnType("double precision"); - - b2.Property("D2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataMissionRunId"); - - b2.ToTable("MissionRuns"); - - b2.WithOwner() - .HasForeignKey("MapMetadataMissionRunId"); - }); - - b1.Navigation("Boundary") - .IsRequired(); - - b1.Navigation("TransformationMatrices") - .IsRequired(); - }); - - b.Navigation("Area"); - - b.Navigation("Map"); - - b.Navigation("Robot"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionTask", b => - { - b.HasOne("Api.Database.Models.MissionRun", null) - .WithMany("Tasks") - .HasForeignKey("MissionRunId"); - - b.OwnsOne("Api.Database.Models.Position", "InspectionTarget", b1 => - { - b1.Property("MissionTaskId") - .HasColumnType("text"); - - b1.Property("X") - .HasColumnType("real"); - - b1.Property("Y") - .HasColumnType("real"); - - b1.Property("Z") - .HasColumnType("real"); - - b1.HasKey("MissionTaskId"); - - b1.ToTable("MissionTasks"); - - b1.WithOwner() - .HasForeignKey("MissionTaskId"); - }); - - b.OwnsOne("Api.Database.Models.Pose", "RobotPose", b1 => - { - b1.Property("MissionTaskId") - .HasColumnType("text"); - - b1.HasKey("MissionTaskId"); - - b1.ToTable("MissionTasks"); - - b1.WithOwner() - .HasForeignKey("MissionTaskId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseMissionTaskId") - .HasColumnType("text"); - - b2.Property("W") - .HasColumnType("real"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseMissionTaskId"); - - b2.ToTable("MissionTasks"); - - b2.WithOwner() - .HasForeignKey("PoseMissionTaskId"); - }); - - b1.OwnsOne("Api.Database.Models.Position", "Position", b2 => - { - b2.Property("PoseMissionTaskId") - .HasColumnType("text"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseMissionTaskId"); - - b2.ToTable("MissionTasks"); - - b2.WithOwner() - .HasForeignKey("PoseMissionTaskId"); - }); - - b1.Navigation("Orientation") - .IsRequired(); - - b1.Navigation("Position") - .IsRequired(); - }); - - b.Navigation("InspectionTarget") - .IsRequired(); - - b.Navigation("RobotPose") - .IsRequired(); - }); - - modelBuilder.Entity("Api.Database.Models.Plant", b => - { - b.HasOne("Api.Database.Models.Installation", "Installation") - .WithMany() - .HasForeignKey("InstallationId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - 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("text"); - - b1.HasKey("RobotId"); - - b1.ToTable("Robots"); - - b1.WithOwner() - .HasForeignKey("RobotId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseRobotId") - .HasColumnType("text"); - - 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("text"); - - 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("text"); - - b1.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b1.Property("ShouldRotate270Clockwise") - .HasColumnType("boolean"); - - b1.Property("Type") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b1.Property("Url") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(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("text"); - - b1.HasKey("SafePositionId"); - - b1.ToTable("SafePositions"); - - b1.WithOwner() - .HasForeignKey("SafePositionId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseSafePositionId") - .HasColumnType("text"); - - 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("text"); - - 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"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionRun", b => - { - b.Navigation("Tasks"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionTask", b => - { - b.Navigation("Inspections"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/backend/api/Migrations/20231116095346_RefactorInspectionFindingsTable.cs b/backend/api/Migrations/20231116095346_RefactorInspectionFindingsTable.cs deleted file mode 100644 index dd89e88bb..000000000 --- a/backend/api/Migrations/20231116095346_RefactorInspectionFindingsTable.cs +++ /dev/null @@ -1,47 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Api.Migrations -{ - /// - public partial class RefactorInspectionFindingsTable : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "Area", - table: "InspectionFinding"); - - migrationBuilder.AlterColumn( - name: "InspectionId", - table: "InspectionFinding", - type: "text", - nullable: true, - oldClrType: typeof(string), - oldType: "text"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.AlterColumn( - name: "InspectionId", - table: "InspectionFinding", - type: "text", - nullable: false, - defaultValue: "", - oldClrType: typeof(string), - oldType: "text", - oldNullable: true); - - migrationBuilder.AddColumn( - name: "Area", - table: "InspectionFinding", - type: "text", - nullable: false, - defaultValue: ""); - } - } -} diff --git a/backend/api/Migrations/20231124081038_InspectionFindingReport.Designer.cs b/backend/api/Migrations/20231124081038_InspectionFindingReport.Designer.cs deleted file mode 100644 index 5ce1ef2b5..000000000 --- a/backend/api/Migrations/20231124081038_InspectionFindingReport.Designer.cs +++ /dev/null @@ -1,1314 +0,0 @@ -// -using System; -using Api.Database.Context; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace Api.Migrations -{ - [DbContext(typeof(FlotillaDbContext))] - [Migration("20231124081038_InspectionFindingReport")] - partial class InspectionFindingReport - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "8.0.0") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("Api.Database.Models.Area", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("DeckId") - .HasColumnType("text"); - - b.Property("DefaultLocalizationPoseId") - .HasColumnType("text"); - - b.Property("InstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PlantId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("DeckId"); - - b.HasIndex("DefaultLocalizationPoseId"); - - b.HasIndex("InstallationId"); - - b.HasIndex("PlantId"); - - b.ToTable("Areas"); - }); - - modelBuilder.Entity("Api.Database.Models.Deck", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("DefaultLocalizationPoseId") - .HasColumnType("text"); - - b.Property("InstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PlantId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("DefaultLocalizationPoseId"); - - b.HasIndex("InstallationId"); - - b.HasIndex("PlantId"); - - b.ToTable("Decks"); - }); - - modelBuilder.Entity("Api.Database.Models.DefaultLocalizationPose", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.ToTable("DefaultLocalizationPoses"); - }); - - modelBuilder.Entity("Api.Database.Models.Inspection", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AnalysisType") - .HasColumnType("text"); - - b.Property("EndTime") - .HasColumnType("timestamp with time zone"); - - b.Property("InspectionType") - .IsRequired() - .HasColumnType("text"); - - b.Property("InspectionUrl") - .HasMaxLength(250) - .HasColumnType("character varying(250)"); - - b.Property("IsarStepId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionTaskId") - .HasColumnType("text"); - - b.Property("StartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("VideoDuration") - .HasColumnType("real"); - - b.HasKey("Id"); - - b.HasIndex("MissionTaskId"); - - b.ToTable("Inspections"); - }); - - modelBuilder.Entity("Api.Database.Models.InspectionFinding", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("Findings") - .IsRequired() - .HasColumnType("text"); - - b.Property("InspectionDate") - .HasColumnType("timestamp with time zone"); - - b.Property("InspectionId") - .HasColumnType("text"); - - b.Property("IsarStepId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("InspectionId"); - - b.ToTable("InspectionFindings"); - }); - - modelBuilder.Entity("Api.Database.Models.Installation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("InstallationCode") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.HasKey("Id"); - - b.HasIndex("InstallationCode") - .IsUnique(); - - b.ToTable("Installations"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionDefinition", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AreaId") - .HasColumnType("text"); - - b.Property("Comment") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("InspectionFrequency") - .HasColumnType("bigint"); - - b.Property("InstallationCode") - .IsRequired() - .HasColumnType("text"); - - b.Property("IsDeprecated") - .HasColumnType("boolean"); - - b.Property("LastSuccessfulRunId") - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("SourceId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("AreaId"); - - b.HasIndex("LastSuccessfulRunId"); - - b.HasIndex("SourceId"); - - b.ToTable("MissionDefinitions"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionRun", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AreaId") - .HasColumnType("text"); - - b.Property("Comment") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("Description") - .HasMaxLength(450) - .HasColumnType("character varying(450)"); - - b.Property("DesiredStartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("EndTime") - .HasColumnType("timestamp with time zone"); - - b.Property("EstimatedDuration") - .HasColumnType("bigint"); - - b.Property("InstallationCode") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("IsarMissionId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("MissionRunPriority") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("StartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("StatusReason") - .HasMaxLength(450) - .HasColumnType("character varying(450)"); - - b.HasKey("Id"); - - b.HasIndex("AreaId"); - - b.HasIndex("RobotId"); - - b.ToTable("MissionRuns"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionTask", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("EchoPoseId") - .HasColumnType("integer"); - - b.Property("EchoTagLink") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("EndTime") - .HasColumnType("timestamp with time zone"); - - b.Property("IsarTaskId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionRunId") - .HasColumnType("text"); - - b.Property("StartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("TagId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("TaskOrder") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("MissionRunId"); - - b.ToTable("MissionTasks"); - }); - - modelBuilder.Entity("Api.Database.Models.Plant", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("InstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PlantCode") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(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("text"); - - b.Property("BatteryLevel") - .HasColumnType("real"); - - b.Property("CurrentAreaId") - .HasColumnType("text"); - - b.Property("CurrentInstallation") - .IsRequired() - .HasColumnType("text"); - - b.Property("CurrentMissionId") - .HasColumnType("text"); - - b.Property("Enabled") - .HasColumnType("boolean"); - - b.Property("Host") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("IsarId") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionQueueFrozen") - .HasColumnType("boolean"); - - b.Property("ModelId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Port") - .HasColumnType("integer"); - - b.Property("PressureLevel") - .HasColumnType("real"); - - b.Property("SerialNumber") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("CurrentAreaId"); - - b.HasIndex("ModelId"); - - b.ToTable("Robots"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotBatteryTimeseries", b => - { - b.Property("BatteryLevel") - .HasColumnType("real"); - - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Time") - .HasColumnType("timestamp with time zone"); - - b.ToTable("RobotBatteryTimeseries"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotModel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AverageDurationPerTag") - .HasColumnType("real"); - - b.Property("BatteryWarningThreshold") - .HasColumnType("real"); - - b.Property("LowerPressureWarningThreshold") - .HasColumnType("real"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - b.Property("UpperPressureWarningThreshold") - .HasColumnType("real"); - - b.HasKey("Id"); - - b.HasIndex("Type") - .IsUnique(); - - b.ToTable("RobotModels"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotPoseTimeseries", b => - { - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("OrientationW") - .HasColumnType("real"); - - b.Property("OrientationX") - .HasColumnType("real"); - - b.Property("OrientationY") - .HasColumnType("real"); - - b.Property("OrientationZ") - .HasColumnType("real"); - - b.Property("PositionX") - .HasColumnType("real"); - - b.Property("PositionY") - .HasColumnType("real"); - - b.Property("PositionZ") - .HasColumnType("real"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Time") - .HasColumnType("timestamp with time zone"); - - b.ToTable("RobotPoseTimeseries"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotPressureTimeseries", b => - { - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("Pressure") - .HasColumnType("real"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Time") - .HasColumnType("timestamp with time zone"); - - b.ToTable("RobotPressureTimeseries"); - }); - - modelBuilder.Entity("Api.Database.Models.SafePosition", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AreaId") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("AreaId"); - - b.ToTable("SafePositions"); - }); - - modelBuilder.Entity("Api.Database.Models.Source", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("SourceId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - 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); - - b.HasOne("Api.Database.Models.DefaultLocalizationPose", "DefaultLocalizationPose") - .WithMany() - .HasForeignKey("DefaultLocalizationPoseId"); - - 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.MapMetadata", "MapMetadata", b1 => - { - b1.Property("AreaId") - .HasColumnType("text"); - - b1.Property("MapName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.HasKey("AreaId"); - - b1.ToTable("Areas"); - - b1.WithOwner() - .HasForeignKey("AreaId"); - - b1.OwnsOne("Api.Database.Models.Boundary", "Boundary", b2 => - { - b2.Property("MapMetadataAreaId") - .HasColumnType("text"); - - b2.Property("X1") - .HasColumnType("double precision"); - - b2.Property("X2") - .HasColumnType("double precision"); - - b2.Property("Y1") - .HasColumnType("double precision"); - - b2.Property("Y2") - .HasColumnType("double precision"); - - b2.Property("Z1") - .HasColumnType("double precision"); - - b2.Property("Z2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataAreaId"); - - b2.ToTable("Areas"); - - b2.WithOwner() - .HasForeignKey("MapMetadataAreaId"); - }); - - b1.OwnsOne("Api.Database.Models.TransformationMatrices", "TransformationMatrices", b2 => - { - b2.Property("MapMetadataAreaId") - .HasColumnType("text"); - - b2.Property("C1") - .HasColumnType("double precision"); - - b2.Property("C2") - .HasColumnType("double precision"); - - b2.Property("D1") - .HasColumnType("double precision"); - - b2.Property("D2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataAreaId"); - - b2.ToTable("Areas"); - - b2.WithOwner() - .HasForeignKey("MapMetadataAreaId"); - }); - - b1.Navigation("Boundary") - .IsRequired(); - - b1.Navigation("TransformationMatrices") - .IsRequired(); - }); - - b.Navigation("Deck"); - - b.Navigation("DefaultLocalizationPose"); - - b.Navigation("Installation"); - - b.Navigation("MapMetadata") - .IsRequired(); - - b.Navigation("Plant"); - }); - - modelBuilder.Entity("Api.Database.Models.Deck", b => - { - b.HasOne("Api.Database.Models.DefaultLocalizationPose", "DefaultLocalizationPose") - .WithMany() - .HasForeignKey("DefaultLocalizationPoseId"); - - 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.Navigation("DefaultLocalizationPose"); - - b.Navigation("Installation"); - - b.Navigation("Plant"); - }); - - modelBuilder.Entity("Api.Database.Models.DefaultLocalizationPose", b => - { - b.OwnsOne("Api.Database.Models.Pose", "Pose", b1 => - { - b1.Property("DefaultLocalizationPoseId") - .HasColumnType("text"); - - b1.HasKey("DefaultLocalizationPoseId"); - - b1.ToTable("DefaultLocalizationPoses"); - - b1.WithOwner() - .HasForeignKey("DefaultLocalizationPoseId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseDefaultLocalizationPoseId") - .HasColumnType("text"); - - b2.Property("W") - .HasColumnType("real"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseDefaultLocalizationPoseId"); - - b2.ToTable("DefaultLocalizationPoses"); - - b2.WithOwner() - .HasForeignKey("PoseDefaultLocalizationPoseId"); - }); - - b1.OwnsOne("Api.Database.Models.Position", "Position", b2 => - { - b2.Property("PoseDefaultLocalizationPoseId") - .HasColumnType("text"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseDefaultLocalizationPoseId"); - - b2.ToTable("DefaultLocalizationPoses"); - - b2.WithOwner() - .HasForeignKey("PoseDefaultLocalizationPoseId"); - }); - - b1.Navigation("Orientation") - .IsRequired(); - - b1.Navigation("Position") - .IsRequired(); - }); - - b.Navigation("Pose") - .IsRequired(); - }); - - modelBuilder.Entity("Api.Database.Models.Inspection", b => - { - b.HasOne("Api.Database.Models.MissionTask", null) - .WithMany("Inspections") - .HasForeignKey("MissionTaskId"); - - b.OwnsOne("Api.Database.Models.Position", "InspectionTarget", b1 => - { - b1.Property("InspectionId") - .HasColumnType("text"); - - b1.Property("X") - .HasColumnType("real"); - - b1.Property("Y") - .HasColumnType("real"); - - b1.Property("Z") - .HasColumnType("real"); - - b1.HasKey("InspectionId"); - - b1.ToTable("Inspections"); - - b1.WithOwner() - .HasForeignKey("InspectionId"); - }); - - b.Navigation("InspectionTarget") - .IsRequired(); - }); - - modelBuilder.Entity("Api.Database.Models.InspectionFinding", b => - { - b.HasOne("Api.Database.Models.Inspection", null) - .WithMany("InspectionFindings") - .HasForeignKey("InspectionId"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionDefinition", b => - { - b.HasOne("Api.Database.Models.Area", "Area") - .WithMany() - .HasForeignKey("AreaId"); - - b.HasOne("Api.Database.Models.MissionRun", "LastSuccessfulRun") - .WithMany() - .HasForeignKey("LastSuccessfulRunId"); - - b.HasOne("Api.Database.Models.Source", "Source") - .WithMany() - .HasForeignKey("SourceId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Area"); - - b.Navigation("LastSuccessfulRun"); - - 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", "Map", b1 => - { - b1.Property("MissionRunId") - .HasColumnType("text"); - - b1.Property("MapName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.HasKey("MissionRunId"); - - b1.ToTable("MissionRuns"); - - b1.WithOwner() - .HasForeignKey("MissionRunId"); - - b1.OwnsOne("Api.Database.Models.Boundary", "Boundary", b2 => - { - b2.Property("MapMetadataMissionRunId") - .HasColumnType("text"); - - b2.Property("X1") - .HasColumnType("double precision"); - - b2.Property("X2") - .HasColumnType("double precision"); - - b2.Property("Y1") - .HasColumnType("double precision"); - - b2.Property("Y2") - .HasColumnType("double precision"); - - b2.Property("Z1") - .HasColumnType("double precision"); - - b2.Property("Z2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataMissionRunId"); - - b2.ToTable("MissionRuns"); - - b2.WithOwner() - .HasForeignKey("MapMetadataMissionRunId"); - }); - - b1.OwnsOne("Api.Database.Models.TransformationMatrices", "TransformationMatrices", b2 => - { - b2.Property("MapMetadataMissionRunId") - .HasColumnType("text"); - - b2.Property("C1") - .HasColumnType("double precision"); - - b2.Property("C2") - .HasColumnType("double precision"); - - b2.Property("D1") - .HasColumnType("double precision"); - - b2.Property("D2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataMissionRunId"); - - b2.ToTable("MissionRuns"); - - b2.WithOwner() - .HasForeignKey("MapMetadataMissionRunId"); - }); - - b1.Navigation("Boundary") - .IsRequired(); - - b1.Navigation("TransformationMatrices") - .IsRequired(); - }); - - b.Navigation("Area"); - - b.Navigation("Map"); - - b.Navigation("Robot"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionTask", b => - { - b.HasOne("Api.Database.Models.MissionRun", null) - .WithMany("Tasks") - .HasForeignKey("MissionRunId"); - - b.OwnsOne("Api.Database.Models.Position", "InspectionTarget", b1 => - { - b1.Property("MissionTaskId") - .HasColumnType("text"); - - b1.Property("X") - .HasColumnType("real"); - - b1.Property("Y") - .HasColumnType("real"); - - b1.Property("Z") - .HasColumnType("real"); - - b1.HasKey("MissionTaskId"); - - b1.ToTable("MissionTasks"); - - b1.WithOwner() - .HasForeignKey("MissionTaskId"); - }); - - b.OwnsOne("Api.Database.Models.Pose", "RobotPose", b1 => - { - b1.Property("MissionTaskId") - .HasColumnType("text"); - - b1.HasKey("MissionTaskId"); - - b1.ToTable("MissionTasks"); - - b1.WithOwner() - .HasForeignKey("MissionTaskId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseMissionTaskId") - .HasColumnType("text"); - - b2.Property("W") - .HasColumnType("real"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseMissionTaskId"); - - b2.ToTable("MissionTasks"); - - b2.WithOwner() - .HasForeignKey("PoseMissionTaskId"); - }); - - b1.OwnsOne("Api.Database.Models.Position", "Position", b2 => - { - b2.Property("PoseMissionTaskId") - .HasColumnType("text"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseMissionTaskId"); - - b2.ToTable("MissionTasks"); - - b2.WithOwner() - .HasForeignKey("PoseMissionTaskId"); - }); - - b1.Navigation("Orientation") - .IsRequired(); - - b1.Navigation("Position") - .IsRequired(); - }); - - b.Navigation("InspectionTarget") - .IsRequired(); - - b.Navigation("RobotPose") - .IsRequired(); - }); - - modelBuilder.Entity("Api.Database.Models.Plant", b => - { - b.HasOne("Api.Database.Models.Installation", "Installation") - .WithMany() - .HasForeignKey("InstallationId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - 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("text"); - - b1.HasKey("RobotId"); - - b1.ToTable("Robots"); - - b1.WithOwner() - .HasForeignKey("RobotId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseRobotId") - .HasColumnType("text"); - - 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("text"); - - 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("text"); - - b1.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b1.Property("ShouldRotate270Clockwise") - .HasColumnType("boolean"); - - b1.Property("Type") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b1.Property("Url") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(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("text"); - - b1.HasKey("SafePositionId"); - - b1.ToTable("SafePositions"); - - b1.WithOwner() - .HasForeignKey("SafePositionId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseSafePositionId") - .HasColumnType("text"); - - 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("text"); - - 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"); - }); - - modelBuilder.Entity("Api.Database.Models.Inspection", b => - { - b.Navigation("InspectionFindings"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionRun", b => - { - b.Navigation("Tasks"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionTask", b => - { - b.Navigation("Inspections"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/backend/api/Migrations/20231124081038_InspectionFindingReport.cs b/backend/api/Migrations/20231124081038_InspectionFindingReport.cs deleted file mode 100644 index 2ecddee0d..000000000 --- a/backend/api/Migrations/20231124081038_InspectionFindingReport.cs +++ /dev/null @@ -1,76 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Api.Migrations -{ - /// - public partial class InspectionFindingReport : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "InspectionFinding"); - - migrationBuilder.CreateTable( - name: "InspectionFindings", - columns: table => new - { - Id = table.Column(type: "text", nullable: false), - InspectionDate = table.Column(type: "timestamp with time zone", nullable: false), - IsarStepId = table.Column(type: "text", nullable: false), - Findings = table.Column(type: "text", nullable: false), - InspectionId = table.Column(type: "text", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_InspectionFindings", x => x.Id); - table.ForeignKey( - name: "FK_InspectionFindings_Inspections_InspectionId", - column: x => x.InspectionId, - principalTable: "Inspections", - principalColumn: "Id"); - }); - - migrationBuilder.CreateIndex( - name: "IX_InspectionFindings_InspectionId", - table: "InspectionFindings", - column: "InspectionId"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "InspectionFindings"); - - migrationBuilder.CreateTable( - name: "InspectionFinding", - columns: table => new - { - Id = table.Column(type: "text", nullable: false), - Findings = table.Column(type: "text", nullable: false), - InspectionDate = table.Column(type: "timestamp with time zone", nullable: false), - InspectionId = table.Column(type: "text", nullable: false), - IsarStepId = table.Column(type: "text", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_InspectionFinding", x => x.Id); - table.ForeignKey( - name: "FK_InspectionFinding_Inspections_InspectionId", - column: x => x.InspectionId, - principalTable: "Inspections", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateIndex( - name: "IX_InspectionFinding_InspectionId", - table: "InspectionFinding", - column: "InspectionId"); - } - } -} diff --git a/backend/api/Migrations/20231128111821_FixNamingConventions.Designer.cs b/backend/api/Migrations/20231128111821_FixNamingConventions.Designer.cs deleted file mode 100644 index 144e14674..000000000 --- a/backend/api/Migrations/20231128111821_FixNamingConventions.Designer.cs +++ /dev/null @@ -1,1314 +0,0 @@ -// -using System; -using Api.Database.Context; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace Api.Migrations -{ - [DbContext(typeof(FlotillaDbContext))] - [Migration("20231128111821_FixNamingConventions")] - partial class FixNamingConventions - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "8.0.0") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("Api.Database.Models.Area", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("DeckId") - .HasColumnType("text"); - - b.Property("DefaultLocalizationPoseId") - .HasColumnType("text"); - - b.Property("InstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PlantId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("DeckId"); - - b.HasIndex("DefaultLocalizationPoseId"); - - b.HasIndex("InstallationId"); - - b.HasIndex("PlantId"); - - b.ToTable("Areas"); - }); - - modelBuilder.Entity("Api.Database.Models.Deck", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("DefaultLocalizationPoseId") - .HasColumnType("text"); - - b.Property("InstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PlantId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("DefaultLocalizationPoseId"); - - b.HasIndex("InstallationId"); - - b.HasIndex("PlantId"); - - b.ToTable("Decks"); - }); - - modelBuilder.Entity("Api.Database.Models.DefaultLocalizationPose", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.ToTable("DefaultLocalizationPoses"); - }); - - modelBuilder.Entity("Api.Database.Models.Inspection", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AnalysisType") - .HasColumnType("text"); - - b.Property("EndTime") - .HasColumnType("timestamp with time zone"); - - b.Property("InspectionType") - .IsRequired() - .HasColumnType("text"); - - b.Property("InspectionUrl") - .HasMaxLength(250) - .HasColumnType("character varying(250)"); - - b.Property("IsarStepId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionTaskId") - .HasColumnType("text"); - - b.Property("StartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("VideoDuration") - .HasColumnType("real"); - - b.HasKey("Id"); - - b.HasIndex("MissionTaskId"); - - b.ToTable("Inspections"); - }); - - modelBuilder.Entity("Api.Database.Models.InspectionFinding", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("Finding") - .IsRequired() - .HasColumnType("text"); - - b.Property("InspectionDate") - .HasColumnType("timestamp with time zone"); - - b.Property("InspectionId") - .HasColumnType("text"); - - b.Property("IsarStepId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("InspectionId"); - - b.ToTable("InspectionFindings"); - }); - - modelBuilder.Entity("Api.Database.Models.Installation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("InstallationCode") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.HasKey("Id"); - - b.HasIndex("InstallationCode") - .IsUnique(); - - b.ToTable("Installations"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionDefinition", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AreaId") - .HasColumnType("text"); - - b.Property("Comment") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("InspectionFrequency") - .HasColumnType("bigint"); - - b.Property("InstallationCode") - .IsRequired() - .HasColumnType("text"); - - b.Property("IsDeprecated") - .HasColumnType("boolean"); - - b.Property("LastSuccessfulRunId") - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("SourceId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("AreaId"); - - b.HasIndex("LastSuccessfulRunId"); - - b.HasIndex("SourceId"); - - b.ToTable("MissionDefinitions"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionRun", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AreaId") - .HasColumnType("text"); - - b.Property("Comment") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("Description") - .HasMaxLength(450) - .HasColumnType("character varying(450)"); - - b.Property("DesiredStartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("EndTime") - .HasColumnType("timestamp with time zone"); - - b.Property("EstimatedDuration") - .HasColumnType("bigint"); - - b.Property("InstallationCode") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("IsarMissionId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("MissionRunPriority") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("StartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("StatusReason") - .HasMaxLength(450) - .HasColumnType("character varying(450)"); - - b.HasKey("Id"); - - b.HasIndex("AreaId"); - - b.HasIndex("RobotId"); - - b.ToTable("MissionRuns"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionTask", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("EchoPoseId") - .HasColumnType("integer"); - - b.Property("EchoTagLink") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("EndTime") - .HasColumnType("timestamp with time zone"); - - b.Property("IsarTaskId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionRunId") - .HasColumnType("text"); - - b.Property("StartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("TagId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("TaskOrder") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("MissionRunId"); - - b.ToTable("MissionTasks"); - }); - - modelBuilder.Entity("Api.Database.Models.Plant", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("InstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PlantCode") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(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("text"); - - b.Property("BatteryLevel") - .HasColumnType("real"); - - b.Property("CurrentAreaId") - .HasColumnType("text"); - - b.Property("CurrentInstallation") - .IsRequired() - .HasColumnType("text"); - - b.Property("CurrentMissionId") - .HasColumnType("text"); - - b.Property("Enabled") - .HasColumnType("boolean"); - - b.Property("Host") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("IsarId") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionQueueFrozen") - .HasColumnType("boolean"); - - b.Property("ModelId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Port") - .HasColumnType("integer"); - - b.Property("PressureLevel") - .HasColumnType("real"); - - b.Property("SerialNumber") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("CurrentAreaId"); - - b.HasIndex("ModelId"); - - b.ToTable("Robots"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotBatteryTimeseries", b => - { - b.Property("BatteryLevel") - .HasColumnType("real"); - - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Time") - .HasColumnType("timestamp with time zone"); - - b.ToTable("RobotBatteryTimeseries"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotModel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AverageDurationPerTag") - .HasColumnType("real"); - - b.Property("BatteryWarningThreshold") - .HasColumnType("real"); - - b.Property("LowerPressureWarningThreshold") - .HasColumnType("real"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - b.Property("UpperPressureWarningThreshold") - .HasColumnType("real"); - - b.HasKey("Id"); - - b.HasIndex("Type") - .IsUnique(); - - b.ToTable("RobotModels"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotPoseTimeseries", b => - { - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("OrientationW") - .HasColumnType("real"); - - b.Property("OrientationX") - .HasColumnType("real"); - - b.Property("OrientationY") - .HasColumnType("real"); - - b.Property("OrientationZ") - .HasColumnType("real"); - - b.Property("PositionX") - .HasColumnType("real"); - - b.Property("PositionY") - .HasColumnType("real"); - - b.Property("PositionZ") - .HasColumnType("real"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Time") - .HasColumnType("timestamp with time zone"); - - b.ToTable("RobotPoseTimeseries"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotPressureTimeseries", b => - { - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("Pressure") - .HasColumnType("real"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Time") - .HasColumnType("timestamp with time zone"); - - b.ToTable("RobotPressureTimeseries"); - }); - - modelBuilder.Entity("Api.Database.Models.SafePosition", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AreaId") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("AreaId"); - - b.ToTable("SafePositions"); - }); - - modelBuilder.Entity("Api.Database.Models.Source", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("SourceId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - 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); - - b.HasOne("Api.Database.Models.DefaultLocalizationPose", "DefaultLocalizationPose") - .WithMany() - .HasForeignKey("DefaultLocalizationPoseId"); - - 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.MapMetadata", "MapMetadata", b1 => - { - b1.Property("AreaId") - .HasColumnType("text"); - - b1.Property("MapName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.HasKey("AreaId"); - - b1.ToTable("Areas"); - - b1.WithOwner() - .HasForeignKey("AreaId"); - - b1.OwnsOne("Api.Database.Models.Boundary", "Boundary", b2 => - { - b2.Property("MapMetadataAreaId") - .HasColumnType("text"); - - b2.Property("X1") - .HasColumnType("double precision"); - - b2.Property("X2") - .HasColumnType("double precision"); - - b2.Property("Y1") - .HasColumnType("double precision"); - - b2.Property("Y2") - .HasColumnType("double precision"); - - b2.Property("Z1") - .HasColumnType("double precision"); - - b2.Property("Z2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataAreaId"); - - b2.ToTable("Areas"); - - b2.WithOwner() - .HasForeignKey("MapMetadataAreaId"); - }); - - b1.OwnsOne("Api.Database.Models.TransformationMatrices", "TransformationMatrices", b2 => - { - b2.Property("MapMetadataAreaId") - .HasColumnType("text"); - - b2.Property("C1") - .HasColumnType("double precision"); - - b2.Property("C2") - .HasColumnType("double precision"); - - b2.Property("D1") - .HasColumnType("double precision"); - - b2.Property("D2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataAreaId"); - - b2.ToTable("Areas"); - - b2.WithOwner() - .HasForeignKey("MapMetadataAreaId"); - }); - - b1.Navigation("Boundary") - .IsRequired(); - - b1.Navigation("TransformationMatrices") - .IsRequired(); - }); - - b.Navigation("Deck"); - - b.Navigation("DefaultLocalizationPose"); - - b.Navigation("Installation"); - - b.Navigation("MapMetadata") - .IsRequired(); - - b.Navigation("Plant"); - }); - - modelBuilder.Entity("Api.Database.Models.Deck", b => - { - b.HasOne("Api.Database.Models.DefaultLocalizationPose", "DefaultLocalizationPose") - .WithMany() - .HasForeignKey("DefaultLocalizationPoseId"); - - 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.Navigation("DefaultLocalizationPose"); - - b.Navigation("Installation"); - - b.Navigation("Plant"); - }); - - modelBuilder.Entity("Api.Database.Models.DefaultLocalizationPose", b => - { - b.OwnsOne("Api.Database.Models.Pose", "Pose", b1 => - { - b1.Property("DefaultLocalizationPoseId") - .HasColumnType("text"); - - b1.HasKey("DefaultLocalizationPoseId"); - - b1.ToTable("DefaultLocalizationPoses"); - - b1.WithOwner() - .HasForeignKey("DefaultLocalizationPoseId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseDefaultLocalizationPoseId") - .HasColumnType("text"); - - b2.Property("W") - .HasColumnType("real"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseDefaultLocalizationPoseId"); - - b2.ToTable("DefaultLocalizationPoses"); - - b2.WithOwner() - .HasForeignKey("PoseDefaultLocalizationPoseId"); - }); - - b1.OwnsOne("Api.Database.Models.Position", "Position", b2 => - { - b2.Property("PoseDefaultLocalizationPoseId") - .HasColumnType("text"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseDefaultLocalizationPoseId"); - - b2.ToTable("DefaultLocalizationPoses"); - - b2.WithOwner() - .HasForeignKey("PoseDefaultLocalizationPoseId"); - }); - - b1.Navigation("Orientation") - .IsRequired(); - - b1.Navigation("Position") - .IsRequired(); - }); - - b.Navigation("Pose") - .IsRequired(); - }); - - modelBuilder.Entity("Api.Database.Models.Inspection", b => - { - b.HasOne("Api.Database.Models.MissionTask", null) - .WithMany("Inspections") - .HasForeignKey("MissionTaskId"); - - b.OwnsOne("Api.Database.Models.Position", "InspectionTarget", b1 => - { - b1.Property("InspectionId") - .HasColumnType("text"); - - b1.Property("X") - .HasColumnType("real"); - - b1.Property("Y") - .HasColumnType("real"); - - b1.Property("Z") - .HasColumnType("real"); - - b1.HasKey("InspectionId"); - - b1.ToTable("Inspections"); - - b1.WithOwner() - .HasForeignKey("InspectionId"); - }); - - b.Navigation("InspectionTarget") - .IsRequired(); - }); - - modelBuilder.Entity("Api.Database.Models.InspectionFinding", b => - { - b.HasOne("Api.Database.Models.Inspection", null) - .WithMany("InspectionFindings") - .HasForeignKey("InspectionId"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionDefinition", b => - { - b.HasOne("Api.Database.Models.Area", "Area") - .WithMany() - .HasForeignKey("AreaId"); - - b.HasOne("Api.Database.Models.MissionRun", "LastSuccessfulRun") - .WithMany() - .HasForeignKey("LastSuccessfulRunId"); - - b.HasOne("Api.Database.Models.Source", "Source") - .WithMany() - .HasForeignKey("SourceId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Area"); - - b.Navigation("LastSuccessfulRun"); - - 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", "Map", b1 => - { - b1.Property("MissionRunId") - .HasColumnType("text"); - - b1.Property("MapName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.HasKey("MissionRunId"); - - b1.ToTable("MissionRuns"); - - b1.WithOwner() - .HasForeignKey("MissionRunId"); - - b1.OwnsOne("Api.Database.Models.Boundary", "Boundary", b2 => - { - b2.Property("MapMetadataMissionRunId") - .HasColumnType("text"); - - b2.Property("X1") - .HasColumnType("double precision"); - - b2.Property("X2") - .HasColumnType("double precision"); - - b2.Property("Y1") - .HasColumnType("double precision"); - - b2.Property("Y2") - .HasColumnType("double precision"); - - b2.Property("Z1") - .HasColumnType("double precision"); - - b2.Property("Z2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataMissionRunId"); - - b2.ToTable("MissionRuns"); - - b2.WithOwner() - .HasForeignKey("MapMetadataMissionRunId"); - }); - - b1.OwnsOne("Api.Database.Models.TransformationMatrices", "TransformationMatrices", b2 => - { - b2.Property("MapMetadataMissionRunId") - .HasColumnType("text"); - - b2.Property("C1") - .HasColumnType("double precision"); - - b2.Property("C2") - .HasColumnType("double precision"); - - b2.Property("D1") - .HasColumnType("double precision"); - - b2.Property("D2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataMissionRunId"); - - b2.ToTable("MissionRuns"); - - b2.WithOwner() - .HasForeignKey("MapMetadataMissionRunId"); - }); - - b1.Navigation("Boundary") - .IsRequired(); - - b1.Navigation("TransformationMatrices") - .IsRequired(); - }); - - b.Navigation("Area"); - - b.Navigation("Map"); - - b.Navigation("Robot"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionTask", b => - { - b.HasOne("Api.Database.Models.MissionRun", null) - .WithMany("Tasks") - .HasForeignKey("MissionRunId"); - - b.OwnsOne("Api.Database.Models.Position", "InspectionTarget", b1 => - { - b1.Property("MissionTaskId") - .HasColumnType("text"); - - b1.Property("X") - .HasColumnType("real"); - - b1.Property("Y") - .HasColumnType("real"); - - b1.Property("Z") - .HasColumnType("real"); - - b1.HasKey("MissionTaskId"); - - b1.ToTable("MissionTasks"); - - b1.WithOwner() - .HasForeignKey("MissionTaskId"); - }); - - b.OwnsOne("Api.Database.Models.Pose", "RobotPose", b1 => - { - b1.Property("MissionTaskId") - .HasColumnType("text"); - - b1.HasKey("MissionTaskId"); - - b1.ToTable("MissionTasks"); - - b1.WithOwner() - .HasForeignKey("MissionTaskId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseMissionTaskId") - .HasColumnType("text"); - - b2.Property("W") - .HasColumnType("real"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseMissionTaskId"); - - b2.ToTable("MissionTasks"); - - b2.WithOwner() - .HasForeignKey("PoseMissionTaskId"); - }); - - b1.OwnsOne("Api.Database.Models.Position", "Position", b2 => - { - b2.Property("PoseMissionTaskId") - .HasColumnType("text"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseMissionTaskId"); - - b2.ToTable("MissionTasks"); - - b2.WithOwner() - .HasForeignKey("PoseMissionTaskId"); - }); - - b1.Navigation("Orientation") - .IsRequired(); - - b1.Navigation("Position") - .IsRequired(); - }); - - b.Navigation("InspectionTarget") - .IsRequired(); - - b.Navigation("RobotPose") - .IsRequired(); - }); - - modelBuilder.Entity("Api.Database.Models.Plant", b => - { - b.HasOne("Api.Database.Models.Installation", "Installation") - .WithMany() - .HasForeignKey("InstallationId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - 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("text"); - - b1.HasKey("RobotId"); - - b1.ToTable("Robots"); - - b1.WithOwner() - .HasForeignKey("RobotId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseRobotId") - .HasColumnType("text"); - - 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("text"); - - 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("text"); - - b1.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b1.Property("ShouldRotate270Clockwise") - .HasColumnType("boolean"); - - b1.Property("Type") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b1.Property("Url") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(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("text"); - - b1.HasKey("SafePositionId"); - - b1.ToTable("SafePositions"); - - b1.WithOwner() - .HasForeignKey("SafePositionId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseSafePositionId") - .HasColumnType("text"); - - 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("text"); - - 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"); - }); - - modelBuilder.Entity("Api.Database.Models.Inspection", b => - { - b.Navigation("InspectionFindings"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionRun", b => - { - b.Navigation("Tasks"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionTask", b => - { - b.Navigation("Inspections"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/backend/api/Migrations/20231128111821_FixNamingConventions.cs b/backend/api/Migrations/20231128111821_FixNamingConventions.cs deleted file mode 100644 index f8b84d141..000000000 --- a/backend/api/Migrations/20231128111821_FixNamingConventions.cs +++ /dev/null @@ -1,28 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Api.Migrations -{ - /// - public partial class FixNamingConventions : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.RenameColumn( - name: "Findings", - table: "InspectionFindings", - newName: "Finding"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.RenameColumn( - name: "Finding", - table: "InspectionFindings", - newName: "Findings"); - } - } -} diff --git a/backend/api/Migrations/20231208115225_AddAccessRoles.Designer.cs b/backend/api/Migrations/20231208115225_AddAccessRoles.Designer.cs deleted file mode 100644 index db7c0436b..000000000 --- a/backend/api/Migrations/20231208115225_AddAccessRoles.Designer.cs +++ /dev/null @@ -1,1347 +0,0 @@ -// -using System; -using Api.Database.Context; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace Api.Migrations -{ - [DbContext(typeof(FlotillaDbContext))] - [Migration("20231208115225_AddAccessRoles")] - partial class AddAccessRoles - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "8.0.0") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("Api.Database.Models.AccessRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AccessLevel") - .IsRequired() - .HasColumnType("text"); - - b.Property("InstallationId") - .HasColumnType("text"); - - b.Property("RoleName") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("InstallationId"); - - b.ToTable("AccessRoles"); - }); - - modelBuilder.Entity("Api.Database.Models.Area", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("DeckId") - .HasColumnType("text"); - - b.Property("DefaultLocalizationPoseId") - .HasColumnType("text"); - - b.Property("InstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PlantId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("DeckId"); - - b.HasIndex("DefaultLocalizationPoseId"); - - b.HasIndex("InstallationId"); - - b.HasIndex("PlantId"); - - b.ToTable("Areas"); - }); - - modelBuilder.Entity("Api.Database.Models.Deck", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("DefaultLocalizationPoseId") - .HasColumnType("text"); - - b.Property("InstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PlantId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("DefaultLocalizationPoseId"); - - b.HasIndex("InstallationId"); - - b.HasIndex("PlantId"); - - b.ToTable("Decks"); - }); - - modelBuilder.Entity("Api.Database.Models.DefaultLocalizationPose", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.ToTable("DefaultLocalizationPoses"); - }); - - modelBuilder.Entity("Api.Database.Models.Inspection", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AnalysisType") - .HasColumnType("text"); - - b.Property("EndTime") - .HasColumnType("timestamp with time zone"); - - b.Property("InspectionType") - .IsRequired() - .HasColumnType("text"); - - b.Property("InspectionUrl") - .HasMaxLength(250) - .HasColumnType("character varying(250)"); - - b.Property("IsarStepId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionTaskId") - .HasColumnType("text"); - - b.Property("StartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("VideoDuration") - .HasColumnType("real"); - - b.HasKey("Id"); - - b.HasIndex("MissionTaskId"); - - b.ToTable("Inspections"); - }); - - modelBuilder.Entity("Api.Database.Models.InspectionFinding", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("Finding") - .IsRequired() - .HasColumnType("text"); - - b.Property("InspectionDate") - .HasColumnType("timestamp with time zone"); - - b.Property("InspectionId") - .HasColumnType("text"); - - b.Property("IsarStepId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("InspectionId"); - - b.ToTable("InspectionFindings"); - }); - - modelBuilder.Entity("Api.Database.Models.Installation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("InstallationCode") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.HasKey("Id"); - - b.HasIndex("InstallationCode") - .IsUnique(); - - b.ToTable("Installations"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionDefinition", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AreaId") - .HasColumnType("text"); - - b.Property("Comment") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("InspectionFrequency") - .HasColumnType("bigint"); - - b.Property("InstallationCode") - .IsRequired() - .HasColumnType("text"); - - b.Property("IsDeprecated") - .HasColumnType("boolean"); - - b.Property("LastSuccessfulRunId") - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("SourceId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("AreaId"); - - b.HasIndex("LastSuccessfulRunId"); - - b.HasIndex("SourceId"); - - b.ToTable("MissionDefinitions"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionRun", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AreaId") - .HasColumnType("text"); - - b.Property("Comment") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("Description") - .HasMaxLength(450) - .HasColumnType("character varying(450)"); - - b.Property("DesiredStartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("EndTime") - .HasColumnType("timestamp with time zone"); - - b.Property("EstimatedDuration") - .HasColumnType("bigint"); - - b.Property("InstallationCode") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("IsarMissionId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("MissionRunPriority") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("StartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("StatusReason") - .HasMaxLength(450) - .HasColumnType("character varying(450)"); - - b.HasKey("Id"); - - b.HasIndex("AreaId"); - - b.HasIndex("RobotId"); - - b.ToTable("MissionRuns"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionTask", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("EchoPoseId") - .HasColumnType("integer"); - - b.Property("EchoTagLink") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("EndTime") - .HasColumnType("timestamp with time zone"); - - b.Property("IsarTaskId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionRunId") - .HasColumnType("text"); - - b.Property("StartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("TagId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("TaskOrder") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("MissionRunId"); - - b.ToTable("MissionTasks"); - }); - - modelBuilder.Entity("Api.Database.Models.Plant", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("InstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PlantCode") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(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("text"); - - b.Property("BatteryLevel") - .HasColumnType("real"); - - b.Property("CurrentAreaId") - .HasColumnType("text"); - - b.Property("CurrentInstallation") - .IsRequired() - .HasColumnType("text"); - - b.Property("CurrentMissionId") - .HasColumnType("text"); - - b.Property("Enabled") - .HasColumnType("boolean"); - - b.Property("Host") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("IsarId") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionQueueFrozen") - .HasColumnType("boolean"); - - b.Property("ModelId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Port") - .HasColumnType("integer"); - - b.Property("PressureLevel") - .HasColumnType("real"); - - b.Property("SerialNumber") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("CurrentAreaId"); - - b.HasIndex("ModelId"); - - b.ToTable("Robots"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotBatteryTimeseries", b => - { - b.Property("BatteryLevel") - .HasColumnType("real"); - - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Time") - .HasColumnType("timestamp with time zone"); - - b.ToTable("RobotBatteryTimeseries"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotModel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AverageDurationPerTag") - .HasColumnType("real"); - - b.Property("BatteryWarningThreshold") - .HasColumnType("real"); - - b.Property("LowerPressureWarningThreshold") - .HasColumnType("real"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - b.Property("UpperPressureWarningThreshold") - .HasColumnType("real"); - - b.HasKey("Id"); - - b.HasIndex("Type") - .IsUnique(); - - b.ToTable("RobotModels"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotPoseTimeseries", b => - { - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("OrientationW") - .HasColumnType("real"); - - b.Property("OrientationX") - .HasColumnType("real"); - - b.Property("OrientationY") - .HasColumnType("real"); - - b.Property("OrientationZ") - .HasColumnType("real"); - - b.Property("PositionX") - .HasColumnType("real"); - - b.Property("PositionY") - .HasColumnType("real"); - - b.Property("PositionZ") - .HasColumnType("real"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Time") - .HasColumnType("timestamp with time zone"); - - b.ToTable("RobotPoseTimeseries"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotPressureTimeseries", b => - { - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("Pressure") - .HasColumnType("real"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Time") - .HasColumnType("timestamp with time zone"); - - b.ToTable("RobotPressureTimeseries"); - }); - - modelBuilder.Entity("Api.Database.Models.SafePosition", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AreaId") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("AreaId"); - - b.ToTable("SafePositions"); - }); - - modelBuilder.Entity("Api.Database.Models.Source", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("SourceId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.ToTable("Sources"); - }); - - modelBuilder.Entity("Api.Database.Models.AccessRole", b => - { - b.HasOne("Api.Database.Models.Installation", "Installation") - .WithMany() - .HasForeignKey("InstallationId"); - - b.Navigation("Installation"); - }); - - modelBuilder.Entity("Api.Database.Models.Area", b => - { - b.HasOne("Api.Database.Models.Deck", "Deck") - .WithMany() - .HasForeignKey("DeckId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("Api.Database.Models.DefaultLocalizationPose", "DefaultLocalizationPose") - .WithMany() - .HasForeignKey("DefaultLocalizationPoseId"); - - 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.MapMetadata", "MapMetadata", b1 => - { - b1.Property("AreaId") - .HasColumnType("text"); - - b1.Property("MapName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.HasKey("AreaId"); - - b1.ToTable("Areas"); - - b1.WithOwner() - .HasForeignKey("AreaId"); - - b1.OwnsOne("Api.Database.Models.Boundary", "Boundary", b2 => - { - b2.Property("MapMetadataAreaId") - .HasColumnType("text"); - - b2.Property("X1") - .HasColumnType("double precision"); - - b2.Property("X2") - .HasColumnType("double precision"); - - b2.Property("Y1") - .HasColumnType("double precision"); - - b2.Property("Y2") - .HasColumnType("double precision"); - - b2.Property("Z1") - .HasColumnType("double precision"); - - b2.Property("Z2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataAreaId"); - - b2.ToTable("Areas"); - - b2.WithOwner() - .HasForeignKey("MapMetadataAreaId"); - }); - - b1.OwnsOne("Api.Database.Models.TransformationMatrices", "TransformationMatrices", b2 => - { - b2.Property("MapMetadataAreaId") - .HasColumnType("text"); - - b2.Property("C1") - .HasColumnType("double precision"); - - b2.Property("C2") - .HasColumnType("double precision"); - - b2.Property("D1") - .HasColumnType("double precision"); - - b2.Property("D2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataAreaId"); - - b2.ToTable("Areas"); - - b2.WithOwner() - .HasForeignKey("MapMetadataAreaId"); - }); - - b1.Navigation("Boundary") - .IsRequired(); - - b1.Navigation("TransformationMatrices") - .IsRequired(); - }); - - b.Navigation("Deck"); - - b.Navigation("DefaultLocalizationPose"); - - b.Navigation("Installation"); - - b.Navigation("MapMetadata") - .IsRequired(); - - b.Navigation("Plant"); - }); - - modelBuilder.Entity("Api.Database.Models.Deck", b => - { - b.HasOne("Api.Database.Models.DefaultLocalizationPose", "DefaultLocalizationPose") - .WithMany() - .HasForeignKey("DefaultLocalizationPoseId"); - - 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.Navigation("DefaultLocalizationPose"); - - b.Navigation("Installation"); - - b.Navigation("Plant"); - }); - - modelBuilder.Entity("Api.Database.Models.DefaultLocalizationPose", b => - { - b.OwnsOne("Api.Database.Models.Pose", "Pose", b1 => - { - b1.Property("DefaultLocalizationPoseId") - .HasColumnType("text"); - - b1.HasKey("DefaultLocalizationPoseId"); - - b1.ToTable("DefaultLocalizationPoses"); - - b1.WithOwner() - .HasForeignKey("DefaultLocalizationPoseId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseDefaultLocalizationPoseId") - .HasColumnType("text"); - - b2.Property("W") - .HasColumnType("real"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseDefaultLocalizationPoseId"); - - b2.ToTable("DefaultLocalizationPoses"); - - b2.WithOwner() - .HasForeignKey("PoseDefaultLocalizationPoseId"); - }); - - b1.OwnsOne("Api.Database.Models.Position", "Position", b2 => - { - b2.Property("PoseDefaultLocalizationPoseId") - .HasColumnType("text"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseDefaultLocalizationPoseId"); - - b2.ToTable("DefaultLocalizationPoses"); - - b2.WithOwner() - .HasForeignKey("PoseDefaultLocalizationPoseId"); - }); - - b1.Navigation("Orientation") - .IsRequired(); - - b1.Navigation("Position") - .IsRequired(); - }); - - b.Navigation("Pose") - .IsRequired(); - }); - - modelBuilder.Entity("Api.Database.Models.Inspection", b => - { - b.HasOne("Api.Database.Models.MissionTask", null) - .WithMany("Inspections") - .HasForeignKey("MissionTaskId"); - - b.OwnsOne("Api.Database.Models.Position", "InspectionTarget", b1 => - { - b1.Property("InspectionId") - .HasColumnType("text"); - - b1.Property("X") - .HasColumnType("real"); - - b1.Property("Y") - .HasColumnType("real"); - - b1.Property("Z") - .HasColumnType("real"); - - b1.HasKey("InspectionId"); - - b1.ToTable("Inspections"); - - b1.WithOwner() - .HasForeignKey("InspectionId"); - }); - - b.Navigation("InspectionTarget") - .IsRequired(); - }); - - modelBuilder.Entity("Api.Database.Models.InspectionFinding", b => - { - b.HasOne("Api.Database.Models.Inspection", null) - .WithMany("InspectionFindings") - .HasForeignKey("InspectionId"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionDefinition", b => - { - b.HasOne("Api.Database.Models.Area", "Area") - .WithMany() - .HasForeignKey("AreaId"); - - b.HasOne("Api.Database.Models.MissionRun", "LastSuccessfulRun") - .WithMany() - .HasForeignKey("LastSuccessfulRunId"); - - b.HasOne("Api.Database.Models.Source", "Source") - .WithMany() - .HasForeignKey("SourceId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Area"); - - b.Navigation("LastSuccessfulRun"); - - 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", "Map", b1 => - { - b1.Property("MissionRunId") - .HasColumnType("text"); - - b1.Property("MapName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.HasKey("MissionRunId"); - - b1.ToTable("MissionRuns"); - - b1.WithOwner() - .HasForeignKey("MissionRunId"); - - b1.OwnsOne("Api.Database.Models.Boundary", "Boundary", b2 => - { - b2.Property("MapMetadataMissionRunId") - .HasColumnType("text"); - - b2.Property("X1") - .HasColumnType("double precision"); - - b2.Property("X2") - .HasColumnType("double precision"); - - b2.Property("Y1") - .HasColumnType("double precision"); - - b2.Property("Y2") - .HasColumnType("double precision"); - - b2.Property("Z1") - .HasColumnType("double precision"); - - b2.Property("Z2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataMissionRunId"); - - b2.ToTable("MissionRuns"); - - b2.WithOwner() - .HasForeignKey("MapMetadataMissionRunId"); - }); - - b1.OwnsOne("Api.Database.Models.TransformationMatrices", "TransformationMatrices", b2 => - { - b2.Property("MapMetadataMissionRunId") - .HasColumnType("text"); - - b2.Property("C1") - .HasColumnType("double precision"); - - b2.Property("C2") - .HasColumnType("double precision"); - - b2.Property("D1") - .HasColumnType("double precision"); - - b2.Property("D2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataMissionRunId"); - - b2.ToTable("MissionRuns"); - - b2.WithOwner() - .HasForeignKey("MapMetadataMissionRunId"); - }); - - b1.Navigation("Boundary") - .IsRequired(); - - b1.Navigation("TransformationMatrices") - .IsRequired(); - }); - - b.Navigation("Area"); - - b.Navigation("Map"); - - b.Navigation("Robot"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionTask", b => - { - b.HasOne("Api.Database.Models.MissionRun", null) - .WithMany("Tasks") - .HasForeignKey("MissionRunId"); - - b.OwnsOne("Api.Database.Models.Position", "InspectionTarget", b1 => - { - b1.Property("MissionTaskId") - .HasColumnType("text"); - - b1.Property("X") - .HasColumnType("real"); - - b1.Property("Y") - .HasColumnType("real"); - - b1.Property("Z") - .HasColumnType("real"); - - b1.HasKey("MissionTaskId"); - - b1.ToTable("MissionTasks"); - - b1.WithOwner() - .HasForeignKey("MissionTaskId"); - }); - - b.OwnsOne("Api.Database.Models.Pose", "RobotPose", b1 => - { - b1.Property("MissionTaskId") - .HasColumnType("text"); - - b1.HasKey("MissionTaskId"); - - b1.ToTable("MissionTasks"); - - b1.WithOwner() - .HasForeignKey("MissionTaskId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseMissionTaskId") - .HasColumnType("text"); - - b2.Property("W") - .HasColumnType("real"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseMissionTaskId"); - - b2.ToTable("MissionTasks"); - - b2.WithOwner() - .HasForeignKey("PoseMissionTaskId"); - }); - - b1.OwnsOne("Api.Database.Models.Position", "Position", b2 => - { - b2.Property("PoseMissionTaskId") - .HasColumnType("text"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseMissionTaskId"); - - b2.ToTable("MissionTasks"); - - b2.WithOwner() - .HasForeignKey("PoseMissionTaskId"); - }); - - b1.Navigation("Orientation") - .IsRequired(); - - b1.Navigation("Position") - .IsRequired(); - }); - - b.Navigation("InspectionTarget") - .IsRequired(); - - b.Navigation("RobotPose") - .IsRequired(); - }); - - modelBuilder.Entity("Api.Database.Models.Plant", b => - { - b.HasOne("Api.Database.Models.Installation", "Installation") - .WithMany() - .HasForeignKey("InstallationId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - 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("text"); - - b1.HasKey("RobotId"); - - b1.ToTable("Robots"); - - b1.WithOwner() - .HasForeignKey("RobotId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseRobotId") - .HasColumnType("text"); - - 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("text"); - - 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("text"); - - b1.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b1.Property("ShouldRotate270Clockwise") - .HasColumnType("boolean"); - - b1.Property("Type") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b1.Property("Url") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(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("text"); - - b1.HasKey("SafePositionId"); - - b1.ToTable("SafePositions"); - - b1.WithOwner() - .HasForeignKey("SafePositionId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseSafePositionId") - .HasColumnType("text"); - - 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("text"); - - 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"); - }); - - modelBuilder.Entity("Api.Database.Models.Inspection", b => - { - b.Navigation("InspectionFindings"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionRun", b => - { - b.Navigation("Tasks"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionTask", b => - { - b.Navigation("Inspections"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/backend/api/Migrations/20231208115225_AddAccessRoles.cs b/backend/api/Migrations/20231208115225_AddAccessRoles.cs deleted file mode 100644 index 3aa24ce9c..000000000 --- a/backend/api/Migrations/20231208115225_AddAccessRoles.cs +++ /dev/null @@ -1,45 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Api.Migrations -{ - /// - public partial class AddAccessRoles : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "AccessRoles", - columns: table => new - { - Id = table.Column(type: "text", nullable: false), - InstallationId = table.Column(type: "text", nullable: true), - RoleName = table.Column(type: "text", nullable: false), - AccessLevel = table.Column(type: "text", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_AccessRoles", x => x.Id); - table.ForeignKey( - name: "FK_AccessRoles_Installations_InstallationId", - column: x => x.InstallationId, - principalTable: "Installations", - principalColumn: "Id"); - }); - - migrationBuilder.CreateIndex( - name: "IX_AccessRoles_InstallationId", - table: "AccessRoles", - column: "InstallationId"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "AccessRoles"); - } - } -} diff --git a/backend/api/Migrations/20231208115904_RemoveCurrentInstallation.Designer.cs b/backend/api/Migrations/20231208115904_RemoveCurrentInstallation.Designer.cs deleted file mode 100644 index 98cab84f3..000000000 --- a/backend/api/Migrations/20231208115904_RemoveCurrentInstallation.Designer.cs +++ /dev/null @@ -1,1343 +0,0 @@ -// -using System; -using Api.Database.Context; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace Api.Migrations -{ - [DbContext(typeof(FlotillaDbContext))] - [Migration("20231208115904_RemoveCurrentInstallation")] - partial class RemoveCurrentInstallation - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "8.0.0") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("Api.Database.Models.AccessRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AccessLevel") - .IsRequired() - .HasColumnType("text"); - - b.Property("InstallationId") - .HasColumnType("text"); - - b.Property("RoleName") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("InstallationId"); - - b.ToTable("AccessRoles"); - }); - - modelBuilder.Entity("Api.Database.Models.Area", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("DeckId") - .HasColumnType("text"); - - b.Property("DefaultLocalizationPoseId") - .HasColumnType("text"); - - b.Property("InstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PlantId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("DeckId"); - - b.HasIndex("DefaultLocalizationPoseId"); - - b.HasIndex("InstallationId"); - - b.HasIndex("PlantId"); - - b.ToTable("Areas"); - }); - - modelBuilder.Entity("Api.Database.Models.Deck", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("DefaultLocalizationPoseId") - .HasColumnType("text"); - - b.Property("InstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PlantId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("DefaultLocalizationPoseId"); - - b.HasIndex("InstallationId"); - - b.HasIndex("PlantId"); - - b.ToTable("Decks"); - }); - - modelBuilder.Entity("Api.Database.Models.DefaultLocalizationPose", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.ToTable("DefaultLocalizationPoses"); - }); - - modelBuilder.Entity("Api.Database.Models.Inspection", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AnalysisType") - .HasColumnType("text"); - - b.Property("EndTime") - .HasColumnType("timestamp with time zone"); - - b.Property("InspectionType") - .IsRequired() - .HasColumnType("text"); - - b.Property("InspectionUrl") - .HasMaxLength(250) - .HasColumnType("character varying(250)"); - - b.Property("IsarStepId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionTaskId") - .HasColumnType("text"); - - b.Property("StartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("VideoDuration") - .HasColumnType("real"); - - b.HasKey("Id"); - - b.HasIndex("MissionTaskId"); - - b.ToTable("Inspections"); - }); - - modelBuilder.Entity("Api.Database.Models.InspectionFinding", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("Finding") - .IsRequired() - .HasColumnType("text"); - - b.Property("InspectionDate") - .HasColumnType("timestamp with time zone"); - - b.Property("InspectionId") - .HasColumnType("text"); - - b.Property("IsarStepId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("InspectionId"); - - b.ToTable("InspectionFindings"); - }); - - modelBuilder.Entity("Api.Database.Models.Installation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("InstallationCode") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.HasKey("Id"); - - b.HasIndex("InstallationCode") - .IsUnique(); - - b.ToTable("Installations"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionDefinition", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AreaId") - .HasColumnType("text"); - - b.Property("Comment") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("InspectionFrequency") - .HasColumnType("bigint"); - - b.Property("InstallationCode") - .IsRequired() - .HasColumnType("text"); - - b.Property("IsDeprecated") - .HasColumnType("boolean"); - - b.Property("LastSuccessfulRunId") - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("SourceId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("AreaId"); - - b.HasIndex("LastSuccessfulRunId"); - - b.HasIndex("SourceId"); - - b.ToTable("MissionDefinitions"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionRun", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AreaId") - .HasColumnType("text"); - - b.Property("Comment") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("Description") - .HasMaxLength(450) - .HasColumnType("character varying(450)"); - - b.Property("DesiredStartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("EndTime") - .HasColumnType("timestamp with time zone"); - - b.Property("EstimatedDuration") - .HasColumnType("bigint"); - - b.Property("InstallationCode") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("IsarMissionId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("MissionRunPriority") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("StartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("StatusReason") - .HasMaxLength(450) - .HasColumnType("character varying(450)"); - - b.HasKey("Id"); - - b.HasIndex("AreaId"); - - b.HasIndex("RobotId"); - - b.ToTable("MissionRuns"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionTask", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("EchoPoseId") - .HasColumnType("integer"); - - b.Property("EchoTagLink") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("EndTime") - .HasColumnType("timestamp with time zone"); - - b.Property("IsarTaskId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionRunId") - .HasColumnType("text"); - - b.Property("StartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("TagId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("TaskOrder") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("MissionRunId"); - - b.ToTable("MissionTasks"); - }); - - modelBuilder.Entity("Api.Database.Models.Plant", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("InstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PlantCode") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(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("text"); - - b.Property("BatteryLevel") - .HasColumnType("real"); - - b.Property("CurrentAreaId") - .HasColumnType("text"); - - b.Property("CurrentMissionId") - .HasColumnType("text"); - - b.Property("Enabled") - .HasColumnType("boolean"); - - b.Property("Host") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("IsarId") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionQueueFrozen") - .HasColumnType("boolean"); - - b.Property("ModelId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Port") - .HasColumnType("integer"); - - b.Property("PressureLevel") - .HasColumnType("real"); - - b.Property("SerialNumber") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("CurrentAreaId"); - - b.HasIndex("ModelId"); - - b.ToTable("Robots"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotBatteryTimeseries", b => - { - b.Property("BatteryLevel") - .HasColumnType("real"); - - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Time") - .HasColumnType("timestamp with time zone"); - - b.ToTable("RobotBatteryTimeseries"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotModel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AverageDurationPerTag") - .HasColumnType("real"); - - b.Property("BatteryWarningThreshold") - .HasColumnType("real"); - - b.Property("LowerPressureWarningThreshold") - .HasColumnType("real"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - b.Property("UpperPressureWarningThreshold") - .HasColumnType("real"); - - b.HasKey("Id"); - - b.HasIndex("Type") - .IsUnique(); - - b.ToTable("RobotModels"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotPoseTimeseries", b => - { - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("OrientationW") - .HasColumnType("real"); - - b.Property("OrientationX") - .HasColumnType("real"); - - b.Property("OrientationY") - .HasColumnType("real"); - - b.Property("OrientationZ") - .HasColumnType("real"); - - b.Property("PositionX") - .HasColumnType("real"); - - b.Property("PositionY") - .HasColumnType("real"); - - b.Property("PositionZ") - .HasColumnType("real"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Time") - .HasColumnType("timestamp with time zone"); - - b.ToTable("RobotPoseTimeseries"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotPressureTimeseries", b => - { - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("Pressure") - .HasColumnType("real"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Time") - .HasColumnType("timestamp with time zone"); - - b.ToTable("RobotPressureTimeseries"); - }); - - modelBuilder.Entity("Api.Database.Models.SafePosition", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AreaId") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("AreaId"); - - b.ToTable("SafePositions"); - }); - - modelBuilder.Entity("Api.Database.Models.Source", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("SourceId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.ToTable("Sources"); - }); - - modelBuilder.Entity("Api.Database.Models.AccessRole", b => - { - b.HasOne("Api.Database.Models.Installation", "Installation") - .WithMany() - .HasForeignKey("InstallationId"); - - b.Navigation("Installation"); - }); - - modelBuilder.Entity("Api.Database.Models.Area", b => - { - b.HasOne("Api.Database.Models.Deck", "Deck") - .WithMany() - .HasForeignKey("DeckId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("Api.Database.Models.DefaultLocalizationPose", "DefaultLocalizationPose") - .WithMany() - .HasForeignKey("DefaultLocalizationPoseId"); - - 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.MapMetadata", "MapMetadata", b1 => - { - b1.Property("AreaId") - .HasColumnType("text"); - - b1.Property("MapName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.HasKey("AreaId"); - - b1.ToTable("Areas"); - - b1.WithOwner() - .HasForeignKey("AreaId"); - - b1.OwnsOne("Api.Database.Models.Boundary", "Boundary", b2 => - { - b2.Property("MapMetadataAreaId") - .HasColumnType("text"); - - b2.Property("X1") - .HasColumnType("double precision"); - - b2.Property("X2") - .HasColumnType("double precision"); - - b2.Property("Y1") - .HasColumnType("double precision"); - - b2.Property("Y2") - .HasColumnType("double precision"); - - b2.Property("Z1") - .HasColumnType("double precision"); - - b2.Property("Z2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataAreaId"); - - b2.ToTable("Areas"); - - b2.WithOwner() - .HasForeignKey("MapMetadataAreaId"); - }); - - b1.OwnsOne("Api.Database.Models.TransformationMatrices", "TransformationMatrices", b2 => - { - b2.Property("MapMetadataAreaId") - .HasColumnType("text"); - - b2.Property("C1") - .HasColumnType("double precision"); - - b2.Property("C2") - .HasColumnType("double precision"); - - b2.Property("D1") - .HasColumnType("double precision"); - - b2.Property("D2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataAreaId"); - - b2.ToTable("Areas"); - - b2.WithOwner() - .HasForeignKey("MapMetadataAreaId"); - }); - - b1.Navigation("Boundary") - .IsRequired(); - - b1.Navigation("TransformationMatrices") - .IsRequired(); - }); - - b.Navigation("Deck"); - - b.Navigation("DefaultLocalizationPose"); - - b.Navigation("Installation"); - - b.Navigation("MapMetadata") - .IsRequired(); - - b.Navigation("Plant"); - }); - - modelBuilder.Entity("Api.Database.Models.Deck", b => - { - b.HasOne("Api.Database.Models.DefaultLocalizationPose", "DefaultLocalizationPose") - .WithMany() - .HasForeignKey("DefaultLocalizationPoseId"); - - 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.Navigation("DefaultLocalizationPose"); - - b.Navigation("Installation"); - - b.Navigation("Plant"); - }); - - modelBuilder.Entity("Api.Database.Models.DefaultLocalizationPose", b => - { - b.OwnsOne("Api.Database.Models.Pose", "Pose", b1 => - { - b1.Property("DefaultLocalizationPoseId") - .HasColumnType("text"); - - b1.HasKey("DefaultLocalizationPoseId"); - - b1.ToTable("DefaultLocalizationPoses"); - - b1.WithOwner() - .HasForeignKey("DefaultLocalizationPoseId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseDefaultLocalizationPoseId") - .HasColumnType("text"); - - b2.Property("W") - .HasColumnType("real"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseDefaultLocalizationPoseId"); - - b2.ToTable("DefaultLocalizationPoses"); - - b2.WithOwner() - .HasForeignKey("PoseDefaultLocalizationPoseId"); - }); - - b1.OwnsOne("Api.Database.Models.Position", "Position", b2 => - { - b2.Property("PoseDefaultLocalizationPoseId") - .HasColumnType("text"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseDefaultLocalizationPoseId"); - - b2.ToTable("DefaultLocalizationPoses"); - - b2.WithOwner() - .HasForeignKey("PoseDefaultLocalizationPoseId"); - }); - - b1.Navigation("Orientation") - .IsRequired(); - - b1.Navigation("Position") - .IsRequired(); - }); - - b.Navigation("Pose") - .IsRequired(); - }); - - modelBuilder.Entity("Api.Database.Models.Inspection", b => - { - b.HasOne("Api.Database.Models.MissionTask", null) - .WithMany("Inspections") - .HasForeignKey("MissionTaskId"); - - b.OwnsOne("Api.Database.Models.Position", "InspectionTarget", b1 => - { - b1.Property("InspectionId") - .HasColumnType("text"); - - b1.Property("X") - .HasColumnType("real"); - - b1.Property("Y") - .HasColumnType("real"); - - b1.Property("Z") - .HasColumnType("real"); - - b1.HasKey("InspectionId"); - - b1.ToTable("Inspections"); - - b1.WithOwner() - .HasForeignKey("InspectionId"); - }); - - b.Navigation("InspectionTarget") - .IsRequired(); - }); - - modelBuilder.Entity("Api.Database.Models.InspectionFinding", b => - { - b.HasOne("Api.Database.Models.Inspection", null) - .WithMany("InspectionFindings") - .HasForeignKey("InspectionId"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionDefinition", b => - { - b.HasOne("Api.Database.Models.Area", "Area") - .WithMany() - .HasForeignKey("AreaId"); - - b.HasOne("Api.Database.Models.MissionRun", "LastSuccessfulRun") - .WithMany() - .HasForeignKey("LastSuccessfulRunId"); - - b.HasOne("Api.Database.Models.Source", "Source") - .WithMany() - .HasForeignKey("SourceId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Area"); - - b.Navigation("LastSuccessfulRun"); - - 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", "Map", b1 => - { - b1.Property("MissionRunId") - .HasColumnType("text"); - - b1.Property("MapName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.HasKey("MissionRunId"); - - b1.ToTable("MissionRuns"); - - b1.WithOwner() - .HasForeignKey("MissionRunId"); - - b1.OwnsOne("Api.Database.Models.Boundary", "Boundary", b2 => - { - b2.Property("MapMetadataMissionRunId") - .HasColumnType("text"); - - b2.Property("X1") - .HasColumnType("double precision"); - - b2.Property("X2") - .HasColumnType("double precision"); - - b2.Property("Y1") - .HasColumnType("double precision"); - - b2.Property("Y2") - .HasColumnType("double precision"); - - b2.Property("Z1") - .HasColumnType("double precision"); - - b2.Property("Z2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataMissionRunId"); - - b2.ToTable("MissionRuns"); - - b2.WithOwner() - .HasForeignKey("MapMetadataMissionRunId"); - }); - - b1.OwnsOne("Api.Database.Models.TransformationMatrices", "TransformationMatrices", b2 => - { - b2.Property("MapMetadataMissionRunId") - .HasColumnType("text"); - - b2.Property("C1") - .HasColumnType("double precision"); - - b2.Property("C2") - .HasColumnType("double precision"); - - b2.Property("D1") - .HasColumnType("double precision"); - - b2.Property("D2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataMissionRunId"); - - b2.ToTable("MissionRuns"); - - b2.WithOwner() - .HasForeignKey("MapMetadataMissionRunId"); - }); - - b1.Navigation("Boundary") - .IsRequired(); - - b1.Navigation("TransformationMatrices") - .IsRequired(); - }); - - b.Navigation("Area"); - - b.Navigation("Map"); - - b.Navigation("Robot"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionTask", b => - { - b.HasOne("Api.Database.Models.MissionRun", null) - .WithMany("Tasks") - .HasForeignKey("MissionRunId"); - - b.OwnsOne("Api.Database.Models.Position", "InspectionTarget", b1 => - { - b1.Property("MissionTaskId") - .HasColumnType("text"); - - b1.Property("X") - .HasColumnType("real"); - - b1.Property("Y") - .HasColumnType("real"); - - b1.Property("Z") - .HasColumnType("real"); - - b1.HasKey("MissionTaskId"); - - b1.ToTable("MissionTasks"); - - b1.WithOwner() - .HasForeignKey("MissionTaskId"); - }); - - b.OwnsOne("Api.Database.Models.Pose", "RobotPose", b1 => - { - b1.Property("MissionTaskId") - .HasColumnType("text"); - - b1.HasKey("MissionTaskId"); - - b1.ToTable("MissionTasks"); - - b1.WithOwner() - .HasForeignKey("MissionTaskId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseMissionTaskId") - .HasColumnType("text"); - - b2.Property("W") - .HasColumnType("real"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseMissionTaskId"); - - b2.ToTable("MissionTasks"); - - b2.WithOwner() - .HasForeignKey("PoseMissionTaskId"); - }); - - b1.OwnsOne("Api.Database.Models.Position", "Position", b2 => - { - b2.Property("PoseMissionTaskId") - .HasColumnType("text"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseMissionTaskId"); - - b2.ToTable("MissionTasks"); - - b2.WithOwner() - .HasForeignKey("PoseMissionTaskId"); - }); - - b1.Navigation("Orientation") - .IsRequired(); - - b1.Navigation("Position") - .IsRequired(); - }); - - b.Navigation("InspectionTarget") - .IsRequired(); - - b.Navigation("RobotPose") - .IsRequired(); - }); - - modelBuilder.Entity("Api.Database.Models.Plant", b => - { - b.HasOne("Api.Database.Models.Installation", "Installation") - .WithMany() - .HasForeignKey("InstallationId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - 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("text"); - - b1.HasKey("RobotId"); - - b1.ToTable("Robots"); - - b1.WithOwner() - .HasForeignKey("RobotId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseRobotId") - .HasColumnType("text"); - - 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("text"); - - 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("text"); - - b1.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b1.Property("ShouldRotate270Clockwise") - .HasColumnType("boolean"); - - b1.Property("Type") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b1.Property("Url") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(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("text"); - - b1.HasKey("SafePositionId"); - - b1.ToTable("SafePositions"); - - b1.WithOwner() - .HasForeignKey("SafePositionId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseSafePositionId") - .HasColumnType("text"); - - 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("text"); - - 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"); - }); - - modelBuilder.Entity("Api.Database.Models.Inspection", b => - { - b.Navigation("InspectionFindings"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionRun", b => - { - b.Navigation("Tasks"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionTask", b => - { - b.Navigation("Inspections"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/backend/api/Migrations/20231208115904_RemoveCurrentInstallation.cs b/backend/api/Migrations/20231208115904_RemoveCurrentInstallation.cs deleted file mode 100644 index 04e318825..000000000 --- a/backend/api/Migrations/20231208115904_RemoveCurrentInstallation.cs +++ /dev/null @@ -1,29 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Api.Migrations -{ - /// - public partial class RemoveCurrentInstallation : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "CurrentInstallation", - table: "Robots"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "CurrentInstallation", - table: "Robots", - type: "text", - nullable: false, - defaultValue: ""); - } - } -} diff --git a/backend/api/Migrations/20231208120216_AddCurrentInstallationAsObject.Designer.cs b/backend/api/Migrations/20231208120216_AddCurrentInstallationAsObject.Designer.cs deleted file mode 100644 index 2cb4f8190..000000000 --- a/backend/api/Migrations/20231208120216_AddCurrentInstallationAsObject.Designer.cs +++ /dev/null @@ -1,1354 +0,0 @@ -// -using System; -using Api.Database.Context; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace Api.Migrations -{ - [DbContext(typeof(FlotillaDbContext))] - [Migration("20231208120216_AddCurrentInstallationAsObject")] - partial class AddCurrentInstallationAsObject - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "8.0.0") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("Api.Database.Models.AccessRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AccessLevel") - .IsRequired() - .HasColumnType("text"); - - b.Property("InstallationId") - .HasColumnType("text"); - - b.Property("RoleName") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("InstallationId"); - - b.ToTable("AccessRoles"); - }); - - modelBuilder.Entity("Api.Database.Models.Area", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("DeckId") - .HasColumnType("text"); - - b.Property("DefaultLocalizationPoseId") - .HasColumnType("text"); - - b.Property("InstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PlantId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("DeckId"); - - b.HasIndex("DefaultLocalizationPoseId"); - - b.HasIndex("InstallationId"); - - b.HasIndex("PlantId"); - - b.ToTable("Areas"); - }); - - modelBuilder.Entity("Api.Database.Models.Deck", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("DefaultLocalizationPoseId") - .HasColumnType("text"); - - b.Property("InstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PlantId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("DefaultLocalizationPoseId"); - - b.HasIndex("InstallationId"); - - b.HasIndex("PlantId"); - - b.ToTable("Decks"); - }); - - modelBuilder.Entity("Api.Database.Models.DefaultLocalizationPose", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.ToTable("DefaultLocalizationPoses"); - }); - - modelBuilder.Entity("Api.Database.Models.Inspection", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AnalysisType") - .HasColumnType("text"); - - b.Property("EndTime") - .HasColumnType("timestamp with time zone"); - - b.Property("InspectionType") - .IsRequired() - .HasColumnType("text"); - - b.Property("InspectionUrl") - .HasMaxLength(250) - .HasColumnType("character varying(250)"); - - b.Property("IsarStepId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionTaskId") - .HasColumnType("text"); - - b.Property("StartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("VideoDuration") - .HasColumnType("real"); - - b.HasKey("Id"); - - b.HasIndex("MissionTaskId"); - - b.ToTable("Inspections"); - }); - - modelBuilder.Entity("Api.Database.Models.InspectionFinding", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("Finding") - .IsRequired() - .HasColumnType("text"); - - b.Property("InspectionDate") - .HasColumnType("timestamp with time zone"); - - b.Property("InspectionId") - .HasColumnType("text"); - - b.Property("IsarStepId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("InspectionId"); - - b.ToTable("InspectionFindings"); - }); - - modelBuilder.Entity("Api.Database.Models.Installation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("InstallationCode") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.HasKey("Id"); - - b.HasIndex("InstallationCode") - .IsUnique(); - - b.ToTable("Installations"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionDefinition", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AreaId") - .HasColumnType("text"); - - b.Property("Comment") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("InspectionFrequency") - .HasColumnType("bigint"); - - b.Property("InstallationCode") - .IsRequired() - .HasColumnType("text"); - - b.Property("IsDeprecated") - .HasColumnType("boolean"); - - b.Property("LastSuccessfulRunId") - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("SourceId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("AreaId"); - - b.HasIndex("LastSuccessfulRunId"); - - b.HasIndex("SourceId"); - - b.ToTable("MissionDefinitions"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionRun", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AreaId") - .HasColumnType("text"); - - b.Property("Comment") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("Description") - .HasMaxLength(450) - .HasColumnType("character varying(450)"); - - b.Property("DesiredStartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("EndTime") - .HasColumnType("timestamp with time zone"); - - b.Property("EstimatedDuration") - .HasColumnType("bigint"); - - b.Property("InstallationCode") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("IsarMissionId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("MissionRunPriority") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("StartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("StatusReason") - .HasMaxLength(450) - .HasColumnType("character varying(450)"); - - b.HasKey("Id"); - - b.HasIndex("AreaId"); - - b.HasIndex("RobotId"); - - b.ToTable("MissionRuns"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionTask", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("EchoPoseId") - .HasColumnType("integer"); - - b.Property("EchoTagLink") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("EndTime") - .HasColumnType("timestamp with time zone"); - - b.Property("IsarTaskId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionRunId") - .HasColumnType("text"); - - b.Property("StartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("TagId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("TaskOrder") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("MissionRunId"); - - b.ToTable("MissionTasks"); - }); - - modelBuilder.Entity("Api.Database.Models.Plant", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("InstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PlantCode") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(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("text"); - - b.Property("BatteryLevel") - .HasColumnType("real"); - - b.Property("CurrentAreaId") - .HasColumnType("text"); - - b.Property("CurrentInstallationId") - .HasColumnType("text"); - - b.Property("CurrentMissionId") - .HasColumnType("text"); - - b.Property("Enabled") - .HasColumnType("boolean"); - - b.Property("Host") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("IsarId") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionQueueFrozen") - .HasColumnType("boolean"); - - b.Property("ModelId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Port") - .HasColumnType("integer"); - - b.Property("PressureLevel") - .HasColumnType("real"); - - b.Property("SerialNumber") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("CurrentAreaId"); - - b.HasIndex("CurrentInstallationId"); - - b.HasIndex("ModelId"); - - b.ToTable("Robots"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotBatteryTimeseries", b => - { - b.Property("BatteryLevel") - .HasColumnType("real"); - - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Time") - .HasColumnType("timestamp with time zone"); - - b.ToTable("RobotBatteryTimeseries"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotModel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AverageDurationPerTag") - .HasColumnType("real"); - - b.Property("BatteryWarningThreshold") - .HasColumnType("real"); - - b.Property("LowerPressureWarningThreshold") - .HasColumnType("real"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - b.Property("UpperPressureWarningThreshold") - .HasColumnType("real"); - - b.HasKey("Id"); - - b.HasIndex("Type") - .IsUnique(); - - b.ToTable("RobotModels"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotPoseTimeseries", b => - { - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("OrientationW") - .HasColumnType("real"); - - b.Property("OrientationX") - .HasColumnType("real"); - - b.Property("OrientationY") - .HasColumnType("real"); - - b.Property("OrientationZ") - .HasColumnType("real"); - - b.Property("PositionX") - .HasColumnType("real"); - - b.Property("PositionY") - .HasColumnType("real"); - - b.Property("PositionZ") - .HasColumnType("real"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Time") - .HasColumnType("timestamp with time zone"); - - b.ToTable("RobotPoseTimeseries"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotPressureTimeseries", b => - { - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("Pressure") - .HasColumnType("real"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Time") - .HasColumnType("timestamp with time zone"); - - b.ToTable("RobotPressureTimeseries"); - }); - - modelBuilder.Entity("Api.Database.Models.SafePosition", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AreaId") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("AreaId"); - - b.ToTable("SafePositions"); - }); - - modelBuilder.Entity("Api.Database.Models.Source", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("SourceId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.ToTable("Sources"); - }); - - modelBuilder.Entity("Api.Database.Models.AccessRole", b => - { - b.HasOne("Api.Database.Models.Installation", "Installation") - .WithMany() - .HasForeignKey("InstallationId"); - - b.Navigation("Installation"); - }); - - modelBuilder.Entity("Api.Database.Models.Area", b => - { - b.HasOne("Api.Database.Models.Deck", "Deck") - .WithMany() - .HasForeignKey("DeckId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("Api.Database.Models.DefaultLocalizationPose", "DefaultLocalizationPose") - .WithMany() - .HasForeignKey("DefaultLocalizationPoseId"); - - 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.MapMetadata", "MapMetadata", b1 => - { - b1.Property("AreaId") - .HasColumnType("text"); - - b1.Property("MapName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.HasKey("AreaId"); - - b1.ToTable("Areas"); - - b1.WithOwner() - .HasForeignKey("AreaId"); - - b1.OwnsOne("Api.Database.Models.Boundary", "Boundary", b2 => - { - b2.Property("MapMetadataAreaId") - .HasColumnType("text"); - - b2.Property("X1") - .HasColumnType("double precision"); - - b2.Property("X2") - .HasColumnType("double precision"); - - b2.Property("Y1") - .HasColumnType("double precision"); - - b2.Property("Y2") - .HasColumnType("double precision"); - - b2.Property("Z1") - .HasColumnType("double precision"); - - b2.Property("Z2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataAreaId"); - - b2.ToTable("Areas"); - - b2.WithOwner() - .HasForeignKey("MapMetadataAreaId"); - }); - - b1.OwnsOne("Api.Database.Models.TransformationMatrices", "TransformationMatrices", b2 => - { - b2.Property("MapMetadataAreaId") - .HasColumnType("text"); - - b2.Property("C1") - .HasColumnType("double precision"); - - b2.Property("C2") - .HasColumnType("double precision"); - - b2.Property("D1") - .HasColumnType("double precision"); - - b2.Property("D2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataAreaId"); - - b2.ToTable("Areas"); - - b2.WithOwner() - .HasForeignKey("MapMetadataAreaId"); - }); - - b1.Navigation("Boundary") - .IsRequired(); - - b1.Navigation("TransformationMatrices") - .IsRequired(); - }); - - b.Navigation("Deck"); - - b.Navigation("DefaultLocalizationPose"); - - b.Navigation("Installation"); - - b.Navigation("MapMetadata") - .IsRequired(); - - b.Navigation("Plant"); - }); - - modelBuilder.Entity("Api.Database.Models.Deck", b => - { - b.HasOne("Api.Database.Models.DefaultLocalizationPose", "DefaultLocalizationPose") - .WithMany() - .HasForeignKey("DefaultLocalizationPoseId"); - - 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.Navigation("DefaultLocalizationPose"); - - b.Navigation("Installation"); - - b.Navigation("Plant"); - }); - - modelBuilder.Entity("Api.Database.Models.DefaultLocalizationPose", b => - { - b.OwnsOne("Api.Database.Models.Pose", "Pose", b1 => - { - b1.Property("DefaultLocalizationPoseId") - .HasColumnType("text"); - - b1.HasKey("DefaultLocalizationPoseId"); - - b1.ToTable("DefaultLocalizationPoses"); - - b1.WithOwner() - .HasForeignKey("DefaultLocalizationPoseId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseDefaultLocalizationPoseId") - .HasColumnType("text"); - - b2.Property("W") - .HasColumnType("real"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseDefaultLocalizationPoseId"); - - b2.ToTable("DefaultLocalizationPoses"); - - b2.WithOwner() - .HasForeignKey("PoseDefaultLocalizationPoseId"); - }); - - b1.OwnsOne("Api.Database.Models.Position", "Position", b2 => - { - b2.Property("PoseDefaultLocalizationPoseId") - .HasColumnType("text"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseDefaultLocalizationPoseId"); - - b2.ToTable("DefaultLocalizationPoses"); - - b2.WithOwner() - .HasForeignKey("PoseDefaultLocalizationPoseId"); - }); - - b1.Navigation("Orientation") - .IsRequired(); - - b1.Navigation("Position") - .IsRequired(); - }); - - b.Navigation("Pose") - .IsRequired(); - }); - - modelBuilder.Entity("Api.Database.Models.Inspection", b => - { - b.HasOne("Api.Database.Models.MissionTask", null) - .WithMany("Inspections") - .HasForeignKey("MissionTaskId"); - - b.OwnsOne("Api.Database.Models.Position", "InspectionTarget", b1 => - { - b1.Property("InspectionId") - .HasColumnType("text"); - - b1.Property("X") - .HasColumnType("real"); - - b1.Property("Y") - .HasColumnType("real"); - - b1.Property("Z") - .HasColumnType("real"); - - b1.HasKey("InspectionId"); - - b1.ToTable("Inspections"); - - b1.WithOwner() - .HasForeignKey("InspectionId"); - }); - - b.Navigation("InspectionTarget") - .IsRequired(); - }); - - modelBuilder.Entity("Api.Database.Models.InspectionFinding", b => - { - b.HasOne("Api.Database.Models.Inspection", null) - .WithMany("InspectionFindings") - .HasForeignKey("InspectionId"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionDefinition", b => - { - b.HasOne("Api.Database.Models.Area", "Area") - .WithMany() - .HasForeignKey("AreaId"); - - b.HasOne("Api.Database.Models.MissionRun", "LastSuccessfulRun") - .WithMany() - .HasForeignKey("LastSuccessfulRunId"); - - b.HasOne("Api.Database.Models.Source", "Source") - .WithMany() - .HasForeignKey("SourceId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Area"); - - b.Navigation("LastSuccessfulRun"); - - 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", "Map", b1 => - { - b1.Property("MissionRunId") - .HasColumnType("text"); - - b1.Property("MapName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.HasKey("MissionRunId"); - - b1.ToTable("MissionRuns"); - - b1.WithOwner() - .HasForeignKey("MissionRunId"); - - b1.OwnsOne("Api.Database.Models.Boundary", "Boundary", b2 => - { - b2.Property("MapMetadataMissionRunId") - .HasColumnType("text"); - - b2.Property("X1") - .HasColumnType("double precision"); - - b2.Property("X2") - .HasColumnType("double precision"); - - b2.Property("Y1") - .HasColumnType("double precision"); - - b2.Property("Y2") - .HasColumnType("double precision"); - - b2.Property("Z1") - .HasColumnType("double precision"); - - b2.Property("Z2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataMissionRunId"); - - b2.ToTable("MissionRuns"); - - b2.WithOwner() - .HasForeignKey("MapMetadataMissionRunId"); - }); - - b1.OwnsOne("Api.Database.Models.TransformationMatrices", "TransformationMatrices", b2 => - { - b2.Property("MapMetadataMissionRunId") - .HasColumnType("text"); - - b2.Property("C1") - .HasColumnType("double precision"); - - b2.Property("C2") - .HasColumnType("double precision"); - - b2.Property("D1") - .HasColumnType("double precision"); - - b2.Property("D2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataMissionRunId"); - - b2.ToTable("MissionRuns"); - - b2.WithOwner() - .HasForeignKey("MapMetadataMissionRunId"); - }); - - b1.Navigation("Boundary") - .IsRequired(); - - b1.Navigation("TransformationMatrices") - .IsRequired(); - }); - - b.Navigation("Area"); - - b.Navigation("Map"); - - b.Navigation("Robot"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionTask", b => - { - b.HasOne("Api.Database.Models.MissionRun", null) - .WithMany("Tasks") - .HasForeignKey("MissionRunId"); - - b.OwnsOne("Api.Database.Models.Position", "InspectionTarget", b1 => - { - b1.Property("MissionTaskId") - .HasColumnType("text"); - - b1.Property("X") - .HasColumnType("real"); - - b1.Property("Y") - .HasColumnType("real"); - - b1.Property("Z") - .HasColumnType("real"); - - b1.HasKey("MissionTaskId"); - - b1.ToTable("MissionTasks"); - - b1.WithOwner() - .HasForeignKey("MissionTaskId"); - }); - - b.OwnsOne("Api.Database.Models.Pose", "RobotPose", b1 => - { - b1.Property("MissionTaskId") - .HasColumnType("text"); - - b1.HasKey("MissionTaskId"); - - b1.ToTable("MissionTasks"); - - b1.WithOwner() - .HasForeignKey("MissionTaskId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseMissionTaskId") - .HasColumnType("text"); - - b2.Property("W") - .HasColumnType("real"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseMissionTaskId"); - - b2.ToTable("MissionTasks"); - - b2.WithOwner() - .HasForeignKey("PoseMissionTaskId"); - }); - - b1.OwnsOne("Api.Database.Models.Position", "Position", b2 => - { - b2.Property("PoseMissionTaskId") - .HasColumnType("text"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseMissionTaskId"); - - b2.ToTable("MissionTasks"); - - b2.WithOwner() - .HasForeignKey("PoseMissionTaskId"); - }); - - b1.Navigation("Orientation") - .IsRequired(); - - b1.Navigation("Position") - .IsRequired(); - }); - - b.Navigation("InspectionTarget") - .IsRequired(); - - b.Navigation("RobotPose") - .IsRequired(); - }); - - modelBuilder.Entity("Api.Database.Models.Plant", b => - { - b.HasOne("Api.Database.Models.Installation", "Installation") - .WithMany() - .HasForeignKey("InstallationId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - 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.Installation", "CurrentInstallation") - .WithMany() - .HasForeignKey("CurrentInstallationId"); - - 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("text"); - - b1.HasKey("RobotId"); - - b1.ToTable("Robots"); - - b1.WithOwner() - .HasForeignKey("RobotId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseRobotId") - .HasColumnType("text"); - - 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("text"); - - 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("text"); - - b1.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b1.Property("ShouldRotate270Clockwise") - .HasColumnType("boolean"); - - b1.Property("Type") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b1.Property("Url") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.HasKey("Id"); - - b1.HasIndex("RobotId"); - - b1.ToTable("VideoStream"); - - b1.WithOwner() - .HasForeignKey("RobotId"); - }); - - b.Navigation("CurrentArea"); - - b.Navigation("CurrentInstallation"); - - 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("text"); - - b1.HasKey("SafePositionId"); - - b1.ToTable("SafePositions"); - - b1.WithOwner() - .HasForeignKey("SafePositionId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseSafePositionId") - .HasColumnType("text"); - - 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("text"); - - 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"); - }); - - modelBuilder.Entity("Api.Database.Models.Inspection", b => - { - b.Navigation("InspectionFindings"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionRun", b => - { - b.Navigation("Tasks"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionTask", b => - { - b.Navigation("Inspections"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/backend/api/Migrations/20231208120216_AddCurrentInstallationAsObject.cs b/backend/api/Migrations/20231208120216_AddCurrentInstallationAsObject.cs deleted file mode 100644 index af6298731..000000000 --- a/backend/api/Migrations/20231208120216_AddCurrentInstallationAsObject.cs +++ /dev/null @@ -1,48 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Api.Migrations -{ - /// - public partial class AddCurrentInstallationAsObject : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "CurrentInstallationId", - table: "Robots", - type: "text", - nullable: true); - - migrationBuilder.CreateIndex( - name: "IX_Robots_CurrentInstallationId", - table: "Robots", - column: "CurrentInstallationId"); - - migrationBuilder.AddForeignKey( - name: "FK_Robots_Installations_CurrentInstallationId", - table: "Robots", - column: "CurrentInstallationId", - principalTable: "Installations", - principalColumn: "Id"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropForeignKey( - name: "FK_Robots_Installations_CurrentInstallationId", - table: "Robots"); - - migrationBuilder.DropIndex( - name: "IX_Robots_CurrentInstallationId", - table: "Robots"); - - migrationBuilder.DropColumn( - name: "CurrentInstallationId", - table: "Robots"); - } - } -} diff --git a/backend/api/Migrations/20231219141748_MakeAreaInMissionsRequired.Designer.cs b/backend/api/Migrations/20231219141748_MakeAreaInMissionsRequired.Designer.cs deleted file mode 100644 index 99387786c..000000000 --- a/backend/api/Migrations/20231219141748_MakeAreaInMissionsRequired.Designer.cs +++ /dev/null @@ -1,1360 +0,0 @@ -// -using System; -using Api.Database.Context; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace Api.Migrations -{ - [DbContext(typeof(FlotillaDbContext))] - [Migration("20231219141748_MakeAreaInMissionsRequired")] - partial class MakeAreaInMissionsRequired - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "8.0.0") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("Api.Database.Models.AccessRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AccessLevel") - .IsRequired() - .HasColumnType("text"); - - b.Property("InstallationId") - .HasColumnType("text"); - - b.Property("RoleName") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("InstallationId"); - - b.ToTable("AccessRoles"); - }); - - modelBuilder.Entity("Api.Database.Models.Area", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("DeckId") - .HasColumnType("text"); - - b.Property("DefaultLocalizationPoseId") - .HasColumnType("text"); - - b.Property("InstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PlantId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("DeckId"); - - b.HasIndex("DefaultLocalizationPoseId"); - - b.HasIndex("InstallationId"); - - b.HasIndex("PlantId"); - - b.ToTable("Areas"); - }); - - modelBuilder.Entity("Api.Database.Models.Deck", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("DefaultLocalizationPoseId") - .HasColumnType("text"); - - b.Property("InstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PlantId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("DefaultLocalizationPoseId"); - - b.HasIndex("InstallationId"); - - b.HasIndex("PlantId"); - - b.ToTable("Decks"); - }); - - modelBuilder.Entity("Api.Database.Models.DefaultLocalizationPose", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.ToTable("DefaultLocalizationPoses"); - }); - - modelBuilder.Entity("Api.Database.Models.Inspection", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AnalysisType") - .HasColumnType("text"); - - b.Property("EndTime") - .HasColumnType("timestamp with time zone"); - - b.Property("InspectionType") - .IsRequired() - .HasColumnType("text"); - - b.Property("InspectionUrl") - .HasMaxLength(250) - .HasColumnType("character varying(250)"); - - b.Property("IsarStepId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionTaskId") - .HasColumnType("text"); - - b.Property("StartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("VideoDuration") - .HasColumnType("real"); - - b.HasKey("Id"); - - b.HasIndex("MissionTaskId"); - - b.ToTable("Inspections"); - }); - - modelBuilder.Entity("Api.Database.Models.InspectionFinding", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("Finding") - .IsRequired() - .HasColumnType("text"); - - b.Property("InspectionDate") - .HasColumnType("timestamp with time zone"); - - b.Property("InspectionId") - .HasColumnType("text"); - - b.Property("IsarStepId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("InspectionId"); - - b.ToTable("InspectionFindings"); - }); - - modelBuilder.Entity("Api.Database.Models.Installation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("InstallationCode") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.HasKey("Id"); - - b.HasIndex("InstallationCode") - .IsUnique(); - - b.ToTable("Installations"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionDefinition", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AreaId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Comment") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("InspectionFrequency") - .HasColumnType("bigint"); - - b.Property("InstallationCode") - .IsRequired() - .HasColumnType("text"); - - b.Property("IsDeprecated") - .HasColumnType("boolean"); - - b.Property("LastSuccessfulRunId") - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("SourceId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("AreaId"); - - b.HasIndex("LastSuccessfulRunId"); - - b.HasIndex("SourceId"); - - b.ToTable("MissionDefinitions"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionRun", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AreaId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Comment") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("Description") - .HasMaxLength(450) - .HasColumnType("character varying(450)"); - - b.Property("DesiredStartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("EndTime") - .HasColumnType("timestamp with time zone"); - - b.Property("EstimatedDuration") - .HasColumnType("bigint"); - - b.Property("InstallationCode") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("IsarMissionId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("MissionRunPriority") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("StartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("StatusReason") - .HasMaxLength(450) - .HasColumnType("character varying(450)"); - - b.HasKey("Id"); - - b.HasIndex("AreaId"); - - b.HasIndex("RobotId"); - - b.ToTable("MissionRuns"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionTask", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("EchoPoseId") - .HasColumnType("integer"); - - b.Property("EchoTagLink") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("EndTime") - .HasColumnType("timestamp with time zone"); - - b.Property("IsarTaskId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionRunId") - .HasColumnType("text"); - - b.Property("StartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("TagId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("TaskOrder") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("MissionRunId"); - - b.ToTable("MissionTasks"); - }); - - modelBuilder.Entity("Api.Database.Models.Plant", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("InstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PlantCode") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(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("text"); - - b.Property("BatteryLevel") - .HasColumnType("real"); - - b.Property("CurrentAreaId") - .HasColumnType("text"); - - b.Property("CurrentInstallationId") - .HasColumnType("text"); - - b.Property("CurrentMissionId") - .HasColumnType("text"); - - b.Property("Enabled") - .HasColumnType("boolean"); - - b.Property("Host") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("IsarId") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionQueueFrozen") - .HasColumnType("boolean"); - - b.Property("ModelId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Port") - .HasColumnType("integer"); - - b.Property("PressureLevel") - .HasColumnType("real"); - - b.Property("SerialNumber") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("CurrentAreaId"); - - b.HasIndex("CurrentInstallationId"); - - b.HasIndex("ModelId"); - - b.ToTable("Robots"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotBatteryTimeseries", b => - { - b.Property("BatteryLevel") - .HasColumnType("real"); - - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Time") - .HasColumnType("timestamp with time zone"); - - b.ToTable("RobotBatteryTimeseries"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotModel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AverageDurationPerTag") - .HasColumnType("real"); - - b.Property("BatteryWarningThreshold") - .HasColumnType("real"); - - b.Property("LowerPressureWarningThreshold") - .HasColumnType("real"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - b.Property("UpperPressureWarningThreshold") - .HasColumnType("real"); - - b.HasKey("Id"); - - b.HasIndex("Type") - .IsUnique(); - - b.ToTable("RobotModels"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotPoseTimeseries", b => - { - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("OrientationW") - .HasColumnType("real"); - - b.Property("OrientationX") - .HasColumnType("real"); - - b.Property("OrientationY") - .HasColumnType("real"); - - b.Property("OrientationZ") - .HasColumnType("real"); - - b.Property("PositionX") - .HasColumnType("real"); - - b.Property("PositionY") - .HasColumnType("real"); - - b.Property("PositionZ") - .HasColumnType("real"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Time") - .HasColumnType("timestamp with time zone"); - - b.ToTable("RobotPoseTimeseries"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotPressureTimeseries", b => - { - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("Pressure") - .HasColumnType("real"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Time") - .HasColumnType("timestamp with time zone"); - - b.ToTable("RobotPressureTimeseries"); - }); - - modelBuilder.Entity("Api.Database.Models.SafePosition", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AreaId") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("AreaId"); - - b.ToTable("SafePositions"); - }); - - modelBuilder.Entity("Api.Database.Models.Source", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("SourceId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.ToTable("Sources"); - }); - - modelBuilder.Entity("Api.Database.Models.AccessRole", b => - { - b.HasOne("Api.Database.Models.Installation", "Installation") - .WithMany() - .HasForeignKey("InstallationId"); - - b.Navigation("Installation"); - }); - - modelBuilder.Entity("Api.Database.Models.Area", b => - { - b.HasOne("Api.Database.Models.Deck", "Deck") - .WithMany() - .HasForeignKey("DeckId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("Api.Database.Models.DefaultLocalizationPose", "DefaultLocalizationPose") - .WithMany() - .HasForeignKey("DefaultLocalizationPoseId"); - - 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.MapMetadata", "MapMetadata", b1 => - { - b1.Property("AreaId") - .HasColumnType("text"); - - b1.Property("MapName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.HasKey("AreaId"); - - b1.ToTable("Areas"); - - b1.WithOwner() - .HasForeignKey("AreaId"); - - b1.OwnsOne("Api.Database.Models.Boundary", "Boundary", b2 => - { - b2.Property("MapMetadataAreaId") - .HasColumnType("text"); - - b2.Property("X1") - .HasColumnType("double precision"); - - b2.Property("X2") - .HasColumnType("double precision"); - - b2.Property("Y1") - .HasColumnType("double precision"); - - b2.Property("Y2") - .HasColumnType("double precision"); - - b2.Property("Z1") - .HasColumnType("double precision"); - - b2.Property("Z2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataAreaId"); - - b2.ToTable("Areas"); - - b2.WithOwner() - .HasForeignKey("MapMetadataAreaId"); - }); - - b1.OwnsOne("Api.Database.Models.TransformationMatrices", "TransformationMatrices", b2 => - { - b2.Property("MapMetadataAreaId") - .HasColumnType("text"); - - b2.Property("C1") - .HasColumnType("double precision"); - - b2.Property("C2") - .HasColumnType("double precision"); - - b2.Property("D1") - .HasColumnType("double precision"); - - b2.Property("D2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataAreaId"); - - b2.ToTable("Areas"); - - b2.WithOwner() - .HasForeignKey("MapMetadataAreaId"); - }); - - b1.Navigation("Boundary") - .IsRequired(); - - b1.Navigation("TransformationMatrices") - .IsRequired(); - }); - - b.Navigation("Deck"); - - b.Navigation("DefaultLocalizationPose"); - - b.Navigation("Installation"); - - b.Navigation("MapMetadata") - .IsRequired(); - - b.Navigation("Plant"); - }); - - modelBuilder.Entity("Api.Database.Models.Deck", b => - { - b.HasOne("Api.Database.Models.DefaultLocalizationPose", "DefaultLocalizationPose") - .WithMany() - .HasForeignKey("DefaultLocalizationPoseId"); - - 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.Navigation("DefaultLocalizationPose"); - - b.Navigation("Installation"); - - b.Navigation("Plant"); - }); - - modelBuilder.Entity("Api.Database.Models.DefaultLocalizationPose", b => - { - b.OwnsOne("Api.Database.Models.Pose", "Pose", b1 => - { - b1.Property("DefaultLocalizationPoseId") - .HasColumnType("text"); - - b1.HasKey("DefaultLocalizationPoseId"); - - b1.ToTable("DefaultLocalizationPoses"); - - b1.WithOwner() - .HasForeignKey("DefaultLocalizationPoseId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseDefaultLocalizationPoseId") - .HasColumnType("text"); - - b2.Property("W") - .HasColumnType("real"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseDefaultLocalizationPoseId"); - - b2.ToTable("DefaultLocalizationPoses"); - - b2.WithOwner() - .HasForeignKey("PoseDefaultLocalizationPoseId"); - }); - - b1.OwnsOne("Api.Database.Models.Position", "Position", b2 => - { - b2.Property("PoseDefaultLocalizationPoseId") - .HasColumnType("text"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseDefaultLocalizationPoseId"); - - b2.ToTable("DefaultLocalizationPoses"); - - b2.WithOwner() - .HasForeignKey("PoseDefaultLocalizationPoseId"); - }); - - b1.Navigation("Orientation") - .IsRequired(); - - b1.Navigation("Position") - .IsRequired(); - }); - - b.Navigation("Pose") - .IsRequired(); - }); - - modelBuilder.Entity("Api.Database.Models.Inspection", b => - { - b.HasOne("Api.Database.Models.MissionTask", null) - .WithMany("Inspections") - .HasForeignKey("MissionTaskId"); - - b.OwnsOne("Api.Database.Models.Position", "InspectionTarget", b1 => - { - b1.Property("InspectionId") - .HasColumnType("text"); - - b1.Property("X") - .HasColumnType("real"); - - b1.Property("Y") - .HasColumnType("real"); - - b1.Property("Z") - .HasColumnType("real"); - - b1.HasKey("InspectionId"); - - b1.ToTable("Inspections"); - - b1.WithOwner() - .HasForeignKey("InspectionId"); - }); - - b.Navigation("InspectionTarget") - .IsRequired(); - }); - - modelBuilder.Entity("Api.Database.Models.InspectionFinding", b => - { - b.HasOne("Api.Database.Models.Inspection", null) - .WithMany("InspectionFindings") - .HasForeignKey("InspectionId"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionDefinition", b => - { - b.HasOne("Api.Database.Models.Area", "Area") - .WithMany() - .HasForeignKey("AreaId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Api.Database.Models.MissionRun", "LastSuccessfulRun") - .WithMany() - .HasForeignKey("LastSuccessfulRunId"); - - b.HasOne("Api.Database.Models.Source", "Source") - .WithMany() - .HasForeignKey("SourceId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Area"); - - b.Navigation("LastSuccessfulRun"); - - b.Navigation("Source"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionRun", b => - { - b.HasOne("Api.Database.Models.Area", "Area") - .WithMany() - .HasForeignKey("AreaId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Api.Database.Models.Robot", "Robot") - .WithMany() - .HasForeignKey("RobotId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.OwnsOne("Api.Database.Models.MapMetadata", "Map", b1 => - { - b1.Property("MissionRunId") - .HasColumnType("text"); - - b1.Property("MapName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.HasKey("MissionRunId"); - - b1.ToTable("MissionRuns"); - - b1.WithOwner() - .HasForeignKey("MissionRunId"); - - b1.OwnsOne("Api.Database.Models.Boundary", "Boundary", b2 => - { - b2.Property("MapMetadataMissionRunId") - .HasColumnType("text"); - - b2.Property("X1") - .HasColumnType("double precision"); - - b2.Property("X2") - .HasColumnType("double precision"); - - b2.Property("Y1") - .HasColumnType("double precision"); - - b2.Property("Y2") - .HasColumnType("double precision"); - - b2.Property("Z1") - .HasColumnType("double precision"); - - b2.Property("Z2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataMissionRunId"); - - b2.ToTable("MissionRuns"); - - b2.WithOwner() - .HasForeignKey("MapMetadataMissionRunId"); - }); - - b1.OwnsOne("Api.Database.Models.TransformationMatrices", "TransformationMatrices", b2 => - { - b2.Property("MapMetadataMissionRunId") - .HasColumnType("text"); - - b2.Property("C1") - .HasColumnType("double precision"); - - b2.Property("C2") - .HasColumnType("double precision"); - - b2.Property("D1") - .HasColumnType("double precision"); - - b2.Property("D2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataMissionRunId"); - - b2.ToTable("MissionRuns"); - - b2.WithOwner() - .HasForeignKey("MapMetadataMissionRunId"); - }); - - b1.Navigation("Boundary") - .IsRequired(); - - b1.Navigation("TransformationMatrices") - .IsRequired(); - }); - - b.Navigation("Area"); - - b.Navigation("Map"); - - b.Navigation("Robot"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionTask", b => - { - b.HasOne("Api.Database.Models.MissionRun", null) - .WithMany("Tasks") - .HasForeignKey("MissionRunId"); - - b.OwnsOne("Api.Database.Models.Position", "InspectionTarget", b1 => - { - b1.Property("MissionTaskId") - .HasColumnType("text"); - - b1.Property("X") - .HasColumnType("real"); - - b1.Property("Y") - .HasColumnType("real"); - - b1.Property("Z") - .HasColumnType("real"); - - b1.HasKey("MissionTaskId"); - - b1.ToTable("MissionTasks"); - - b1.WithOwner() - .HasForeignKey("MissionTaskId"); - }); - - b.OwnsOne("Api.Database.Models.Pose", "RobotPose", b1 => - { - b1.Property("MissionTaskId") - .HasColumnType("text"); - - b1.HasKey("MissionTaskId"); - - b1.ToTable("MissionTasks"); - - b1.WithOwner() - .HasForeignKey("MissionTaskId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseMissionTaskId") - .HasColumnType("text"); - - b2.Property("W") - .HasColumnType("real"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseMissionTaskId"); - - b2.ToTable("MissionTasks"); - - b2.WithOwner() - .HasForeignKey("PoseMissionTaskId"); - }); - - b1.OwnsOne("Api.Database.Models.Position", "Position", b2 => - { - b2.Property("PoseMissionTaskId") - .HasColumnType("text"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseMissionTaskId"); - - b2.ToTable("MissionTasks"); - - b2.WithOwner() - .HasForeignKey("PoseMissionTaskId"); - }); - - b1.Navigation("Orientation") - .IsRequired(); - - b1.Navigation("Position") - .IsRequired(); - }); - - b.Navigation("InspectionTarget") - .IsRequired(); - - b.Navigation("RobotPose") - .IsRequired(); - }); - - modelBuilder.Entity("Api.Database.Models.Plant", b => - { - b.HasOne("Api.Database.Models.Installation", "Installation") - .WithMany() - .HasForeignKey("InstallationId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - 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.Installation", "CurrentInstallation") - .WithMany() - .HasForeignKey("CurrentInstallationId"); - - 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("text"); - - b1.HasKey("RobotId"); - - b1.ToTable("Robots"); - - b1.WithOwner() - .HasForeignKey("RobotId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseRobotId") - .HasColumnType("text"); - - 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("text"); - - 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("text"); - - b1.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b1.Property("ShouldRotate270Clockwise") - .HasColumnType("boolean"); - - b1.Property("Type") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b1.Property("Url") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.HasKey("Id"); - - b1.HasIndex("RobotId"); - - b1.ToTable("VideoStream"); - - b1.WithOwner() - .HasForeignKey("RobotId"); - }); - - b.Navigation("CurrentArea"); - - b.Navigation("CurrentInstallation"); - - 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("text"); - - b1.HasKey("SafePositionId"); - - b1.ToTable("SafePositions"); - - b1.WithOwner() - .HasForeignKey("SafePositionId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseSafePositionId") - .HasColumnType("text"); - - 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("text"); - - 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"); - }); - - modelBuilder.Entity("Api.Database.Models.Inspection", b => - { - b.Navigation("InspectionFindings"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionRun", b => - { - b.Navigation("Tasks"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionTask", b => - { - b.Navigation("Inspections"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/backend/api/Migrations/20231219141748_MakeAreaInMissionsRequired.cs b/backend/api/Migrations/20231219141748_MakeAreaInMissionsRequired.cs deleted file mode 100644 index 36603287f..000000000 --- a/backend/api/Migrations/20231219141748_MakeAreaInMissionsRequired.cs +++ /dev/null @@ -1,100 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Api.Migrations -{ - /// - public partial class MakeAreaInMissionsRequired : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropForeignKey( - name: "FK_MissionDefinitions_Areas_AreaId", - table: "MissionDefinitions"); - - migrationBuilder.DropForeignKey( - name: "FK_MissionRuns_Areas_AreaId", - table: "MissionRuns"); - - migrationBuilder.AlterColumn( - name: "AreaId", - table: "MissionRuns", - type: "text", - nullable: false, - defaultValue: "", - oldClrType: typeof(string), - oldType: "text", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "AreaId", - table: "MissionDefinitions", - type: "text", - nullable: false, - defaultValue: "", - oldClrType: typeof(string), - oldType: "text", - oldNullable: true); - - migrationBuilder.AddForeignKey( - name: "FK_MissionDefinitions_Areas_AreaId", - table: "MissionDefinitions", - column: "AreaId", - principalTable: "Areas", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_MissionRuns_Areas_AreaId", - table: "MissionRuns", - column: "AreaId", - principalTable: "Areas", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropForeignKey( - name: "FK_MissionDefinitions_Areas_AreaId", - table: "MissionDefinitions"); - - migrationBuilder.DropForeignKey( - name: "FK_MissionRuns_Areas_AreaId", - table: "MissionRuns"); - - migrationBuilder.AlterColumn( - name: "AreaId", - table: "MissionRuns", - type: "text", - nullable: true, - oldClrType: typeof(string), - oldType: "text"); - - migrationBuilder.AlterColumn( - name: "AreaId", - table: "MissionDefinitions", - type: "text", - nullable: true, - oldClrType: typeof(string), - oldType: "text"); - - migrationBuilder.AddForeignKey( - name: "FK_MissionDefinitions_Areas_AreaId", - table: "MissionDefinitions", - column: "AreaId", - principalTable: "Areas", - principalColumn: "Id"); - - migrationBuilder.AddForeignKey( - name: "FK_MissionRuns_Areas_AreaId", - table: "MissionRuns", - column: "AreaId", - principalTable: "Areas", - principalColumn: "Id"); - } - } -} diff --git a/backend/api/Migrations/20231219153128_AddTypeToMissionTask.Designer.cs b/backend/api/Migrations/20231219153128_AddTypeToMissionTask.Designer.cs deleted file mode 100644 index b49054298..000000000 --- a/backend/api/Migrations/20231219153128_AddTypeToMissionTask.Designer.cs +++ /dev/null @@ -1,1358 +0,0 @@ -// -using System; -using Api.Database.Context; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace Api.Migrations -{ - [DbContext(typeof(FlotillaDbContext))] - [Migration("20231219153128_AddTypeToMissionTask")] - partial class AddTypeToMissionTask - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "8.0.0") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("Api.Database.Models.AccessRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AccessLevel") - .IsRequired() - .HasColumnType("text"); - - b.Property("InstallationId") - .HasColumnType("text"); - - b.Property("RoleName") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("InstallationId"); - - b.ToTable("AccessRoles"); - }); - - modelBuilder.Entity("Api.Database.Models.Area", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("DeckId") - .HasColumnType("text"); - - b.Property("DefaultLocalizationPoseId") - .HasColumnType("text"); - - b.Property("InstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PlantId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("DeckId"); - - b.HasIndex("DefaultLocalizationPoseId"); - - b.HasIndex("InstallationId"); - - b.HasIndex("PlantId"); - - b.ToTable("Areas"); - }); - - modelBuilder.Entity("Api.Database.Models.Deck", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("DefaultLocalizationPoseId") - .HasColumnType("text"); - - b.Property("InstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PlantId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("DefaultLocalizationPoseId"); - - b.HasIndex("InstallationId"); - - b.HasIndex("PlantId"); - - b.ToTable("Decks"); - }); - - modelBuilder.Entity("Api.Database.Models.DefaultLocalizationPose", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.ToTable("DefaultLocalizationPoses"); - }); - - modelBuilder.Entity("Api.Database.Models.Inspection", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AnalysisType") - .HasColumnType("text"); - - b.Property("EndTime") - .HasColumnType("timestamp with time zone"); - - b.Property("InspectionType") - .IsRequired() - .HasColumnType("text"); - - b.Property("InspectionUrl") - .HasMaxLength(250) - .HasColumnType("character varying(250)"); - - b.Property("IsarStepId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionTaskId") - .HasColumnType("text"); - - b.Property("StartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("VideoDuration") - .HasColumnType("real"); - - b.HasKey("Id"); - - b.HasIndex("MissionTaskId"); - - b.ToTable("Inspections"); - }); - - modelBuilder.Entity("Api.Database.Models.InspectionFinding", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("Finding") - .IsRequired() - .HasColumnType("text"); - - b.Property("InspectionDate") - .HasColumnType("timestamp with time zone"); - - b.Property("InspectionId") - .HasColumnType("text"); - - b.Property("IsarStepId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("InspectionId"); - - b.ToTable("InspectionFindings"); - }); - - modelBuilder.Entity("Api.Database.Models.Installation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("InstallationCode") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.HasKey("Id"); - - b.HasIndex("InstallationCode") - .IsUnique(); - - b.ToTable("Installations"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionDefinition", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AreaId") - .HasColumnType("text"); - - b.Property("Comment") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("InspectionFrequency") - .HasColumnType("bigint"); - - b.Property("InstallationCode") - .IsRequired() - .HasColumnType("text"); - - b.Property("IsDeprecated") - .HasColumnType("boolean"); - - b.Property("LastSuccessfulRunId") - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("SourceId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("AreaId"); - - b.HasIndex("LastSuccessfulRunId"); - - b.HasIndex("SourceId"); - - b.ToTable("MissionDefinitions"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionRun", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AreaId") - .HasColumnType("text"); - - b.Property("Comment") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("Description") - .HasMaxLength(450) - .HasColumnType("character varying(450)"); - - b.Property("DesiredStartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("EndTime") - .HasColumnType("timestamp with time zone"); - - b.Property("EstimatedDuration") - .HasColumnType("bigint"); - - b.Property("InstallationCode") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("IsarMissionId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("MissionRunPriority") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("StartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("StatusReason") - .HasMaxLength(450) - .HasColumnType("character varying(450)"); - - b.HasKey("Id"); - - b.HasIndex("AreaId"); - - b.HasIndex("RobotId"); - - b.ToTable("MissionRuns"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionTask", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("EchoPoseId") - .HasColumnType("integer"); - - b.Property("EchoTagLink") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("EndTime") - .HasColumnType("timestamp with time zone"); - - b.Property("IsarTaskId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionRunId") - .HasColumnType("text"); - - b.Property("StartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("TagId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("TaskOrder") - .HasColumnType("integer"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("MissionRunId"); - - b.ToTable("MissionTasks"); - }); - - modelBuilder.Entity("Api.Database.Models.Plant", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("InstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PlantCode") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(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("text"); - - b.Property("BatteryLevel") - .HasColumnType("real"); - - b.Property("CurrentAreaId") - .HasColumnType("text"); - - b.Property("CurrentInstallationId") - .HasColumnType("text"); - - b.Property("CurrentMissionId") - .HasColumnType("text"); - - b.Property("Enabled") - .HasColumnType("boolean"); - - b.Property("Host") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("IsarId") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionQueueFrozen") - .HasColumnType("boolean"); - - b.Property("ModelId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Port") - .HasColumnType("integer"); - - b.Property("PressureLevel") - .HasColumnType("real"); - - b.Property("SerialNumber") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("CurrentAreaId"); - - b.HasIndex("CurrentInstallationId"); - - b.HasIndex("ModelId"); - - b.ToTable("Robots"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotBatteryTimeseries", b => - { - b.Property("BatteryLevel") - .HasColumnType("real"); - - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Time") - .HasColumnType("timestamp with time zone"); - - b.ToTable("RobotBatteryTimeseries"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotModel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AverageDurationPerTag") - .HasColumnType("real"); - - b.Property("BatteryWarningThreshold") - .HasColumnType("real"); - - b.Property("LowerPressureWarningThreshold") - .HasColumnType("real"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - b.Property("UpperPressureWarningThreshold") - .HasColumnType("real"); - - b.HasKey("Id"); - - b.HasIndex("Type") - .IsUnique(); - - b.ToTable("RobotModels"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotPoseTimeseries", b => - { - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("OrientationW") - .HasColumnType("real"); - - b.Property("OrientationX") - .HasColumnType("real"); - - b.Property("OrientationY") - .HasColumnType("real"); - - b.Property("OrientationZ") - .HasColumnType("real"); - - b.Property("PositionX") - .HasColumnType("real"); - - b.Property("PositionY") - .HasColumnType("real"); - - b.Property("PositionZ") - .HasColumnType("real"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Time") - .HasColumnType("timestamp with time zone"); - - b.ToTable("RobotPoseTimeseries"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotPressureTimeseries", b => - { - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("Pressure") - .HasColumnType("real"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Time") - .HasColumnType("timestamp with time zone"); - - b.ToTable("RobotPressureTimeseries"); - }); - - modelBuilder.Entity("Api.Database.Models.SafePosition", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AreaId") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("AreaId"); - - b.ToTable("SafePositions"); - }); - - modelBuilder.Entity("Api.Database.Models.Source", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("SourceId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.ToTable("Sources"); - }); - - modelBuilder.Entity("Api.Database.Models.AccessRole", b => - { - b.HasOne("Api.Database.Models.Installation", "Installation") - .WithMany() - .HasForeignKey("InstallationId"); - - b.Navigation("Installation"); - }); - - modelBuilder.Entity("Api.Database.Models.Area", b => - { - b.HasOne("Api.Database.Models.Deck", "Deck") - .WithMany() - .HasForeignKey("DeckId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("Api.Database.Models.DefaultLocalizationPose", "DefaultLocalizationPose") - .WithMany() - .HasForeignKey("DefaultLocalizationPoseId"); - - 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.MapMetadata", "MapMetadata", b1 => - { - b1.Property("AreaId") - .HasColumnType("text"); - - b1.Property("MapName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.HasKey("AreaId"); - - b1.ToTable("Areas"); - - b1.WithOwner() - .HasForeignKey("AreaId"); - - b1.OwnsOne("Api.Database.Models.Boundary", "Boundary", b2 => - { - b2.Property("MapMetadataAreaId") - .HasColumnType("text"); - - b2.Property("X1") - .HasColumnType("double precision"); - - b2.Property("X2") - .HasColumnType("double precision"); - - b2.Property("Y1") - .HasColumnType("double precision"); - - b2.Property("Y2") - .HasColumnType("double precision"); - - b2.Property("Z1") - .HasColumnType("double precision"); - - b2.Property("Z2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataAreaId"); - - b2.ToTable("Areas"); - - b2.WithOwner() - .HasForeignKey("MapMetadataAreaId"); - }); - - b1.OwnsOne("Api.Database.Models.TransformationMatrices", "TransformationMatrices", b2 => - { - b2.Property("MapMetadataAreaId") - .HasColumnType("text"); - - b2.Property("C1") - .HasColumnType("double precision"); - - b2.Property("C2") - .HasColumnType("double precision"); - - b2.Property("D1") - .HasColumnType("double precision"); - - b2.Property("D2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataAreaId"); - - b2.ToTable("Areas"); - - b2.WithOwner() - .HasForeignKey("MapMetadataAreaId"); - }); - - b1.Navigation("Boundary") - .IsRequired(); - - b1.Navigation("TransformationMatrices") - .IsRequired(); - }); - - b.Navigation("Deck"); - - b.Navigation("DefaultLocalizationPose"); - - b.Navigation("Installation"); - - b.Navigation("MapMetadata") - .IsRequired(); - - b.Navigation("Plant"); - }); - - modelBuilder.Entity("Api.Database.Models.Deck", b => - { - b.HasOne("Api.Database.Models.DefaultLocalizationPose", "DefaultLocalizationPose") - .WithMany() - .HasForeignKey("DefaultLocalizationPoseId"); - - 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.Navigation("DefaultLocalizationPose"); - - b.Navigation("Installation"); - - b.Navigation("Plant"); - }); - - modelBuilder.Entity("Api.Database.Models.DefaultLocalizationPose", b => - { - b.OwnsOne("Api.Database.Models.Pose", "Pose", b1 => - { - b1.Property("DefaultLocalizationPoseId") - .HasColumnType("text"); - - b1.HasKey("DefaultLocalizationPoseId"); - - b1.ToTable("DefaultLocalizationPoses"); - - b1.WithOwner() - .HasForeignKey("DefaultLocalizationPoseId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseDefaultLocalizationPoseId") - .HasColumnType("text"); - - b2.Property("W") - .HasColumnType("real"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseDefaultLocalizationPoseId"); - - b2.ToTable("DefaultLocalizationPoses"); - - b2.WithOwner() - .HasForeignKey("PoseDefaultLocalizationPoseId"); - }); - - b1.OwnsOne("Api.Database.Models.Position", "Position", b2 => - { - b2.Property("PoseDefaultLocalizationPoseId") - .HasColumnType("text"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseDefaultLocalizationPoseId"); - - b2.ToTable("DefaultLocalizationPoses"); - - b2.WithOwner() - .HasForeignKey("PoseDefaultLocalizationPoseId"); - }); - - b1.Navigation("Orientation") - .IsRequired(); - - b1.Navigation("Position") - .IsRequired(); - }); - - b.Navigation("Pose") - .IsRequired(); - }); - - modelBuilder.Entity("Api.Database.Models.Inspection", b => - { - b.HasOne("Api.Database.Models.MissionTask", null) - .WithMany("Inspections") - .HasForeignKey("MissionTaskId"); - - b.OwnsOne("Api.Database.Models.Position", "InspectionTarget", b1 => - { - b1.Property("InspectionId") - .HasColumnType("text"); - - b1.Property("X") - .HasColumnType("real"); - - b1.Property("Y") - .HasColumnType("real"); - - b1.Property("Z") - .HasColumnType("real"); - - b1.HasKey("InspectionId"); - - b1.ToTable("Inspections"); - - b1.WithOwner() - .HasForeignKey("InspectionId"); - }); - - b.Navigation("InspectionTarget") - .IsRequired(); - }); - - modelBuilder.Entity("Api.Database.Models.InspectionFinding", b => - { - b.HasOne("Api.Database.Models.Inspection", null) - .WithMany("InspectionFindings") - .HasForeignKey("InspectionId"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionDefinition", b => - { - b.HasOne("Api.Database.Models.Area", "Area") - .WithMany() - .HasForeignKey("AreaId"); - - b.HasOne("Api.Database.Models.MissionRun", "LastSuccessfulRun") - .WithMany() - .HasForeignKey("LastSuccessfulRunId"); - - b.HasOne("Api.Database.Models.Source", "Source") - .WithMany() - .HasForeignKey("SourceId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Area"); - - b.Navigation("LastSuccessfulRun"); - - 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", "Map", b1 => - { - b1.Property("MissionRunId") - .HasColumnType("text"); - - b1.Property("MapName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.HasKey("MissionRunId"); - - b1.ToTable("MissionRuns"); - - b1.WithOwner() - .HasForeignKey("MissionRunId"); - - b1.OwnsOne("Api.Database.Models.Boundary", "Boundary", b2 => - { - b2.Property("MapMetadataMissionRunId") - .HasColumnType("text"); - - b2.Property("X1") - .HasColumnType("double precision"); - - b2.Property("X2") - .HasColumnType("double precision"); - - b2.Property("Y1") - .HasColumnType("double precision"); - - b2.Property("Y2") - .HasColumnType("double precision"); - - b2.Property("Z1") - .HasColumnType("double precision"); - - b2.Property("Z2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataMissionRunId"); - - b2.ToTable("MissionRuns"); - - b2.WithOwner() - .HasForeignKey("MapMetadataMissionRunId"); - }); - - b1.OwnsOne("Api.Database.Models.TransformationMatrices", "TransformationMatrices", b2 => - { - b2.Property("MapMetadataMissionRunId") - .HasColumnType("text"); - - b2.Property("C1") - .HasColumnType("double precision"); - - b2.Property("C2") - .HasColumnType("double precision"); - - b2.Property("D1") - .HasColumnType("double precision"); - - b2.Property("D2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataMissionRunId"); - - b2.ToTable("MissionRuns"); - - b2.WithOwner() - .HasForeignKey("MapMetadataMissionRunId"); - }); - - b1.Navigation("Boundary") - .IsRequired(); - - b1.Navigation("TransformationMatrices") - .IsRequired(); - }); - - b.Navigation("Area"); - - b.Navigation("Map"); - - b.Navigation("Robot"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionTask", b => - { - b.HasOne("Api.Database.Models.MissionRun", null) - .WithMany("Tasks") - .HasForeignKey("MissionRunId"); - - b.OwnsOne("Api.Database.Models.Position", "InspectionTarget", b1 => - { - b1.Property("MissionTaskId") - .HasColumnType("text"); - - b1.Property("X") - .HasColumnType("real"); - - b1.Property("Y") - .HasColumnType("real"); - - b1.Property("Z") - .HasColumnType("real"); - - b1.HasKey("MissionTaskId"); - - b1.ToTable("MissionTasks"); - - b1.WithOwner() - .HasForeignKey("MissionTaskId"); - }); - - b.OwnsOne("Api.Database.Models.Pose", "RobotPose", b1 => - { - b1.Property("MissionTaskId") - .HasColumnType("text"); - - b1.HasKey("MissionTaskId"); - - b1.ToTable("MissionTasks"); - - b1.WithOwner() - .HasForeignKey("MissionTaskId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseMissionTaskId") - .HasColumnType("text"); - - b2.Property("W") - .HasColumnType("real"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseMissionTaskId"); - - b2.ToTable("MissionTasks"); - - b2.WithOwner() - .HasForeignKey("PoseMissionTaskId"); - }); - - b1.OwnsOne("Api.Database.Models.Position", "Position", b2 => - { - b2.Property("PoseMissionTaskId") - .HasColumnType("text"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseMissionTaskId"); - - b2.ToTable("MissionTasks"); - - b2.WithOwner() - .HasForeignKey("PoseMissionTaskId"); - }); - - b1.Navigation("Orientation") - .IsRequired(); - - b1.Navigation("Position") - .IsRequired(); - }); - - b.Navigation("InspectionTarget") - .IsRequired(); - - b.Navigation("RobotPose") - .IsRequired(); - }); - - modelBuilder.Entity("Api.Database.Models.Plant", b => - { - b.HasOne("Api.Database.Models.Installation", "Installation") - .WithMany() - .HasForeignKey("InstallationId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - 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.Installation", "CurrentInstallation") - .WithMany() - .HasForeignKey("CurrentInstallationId"); - - 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("text"); - - b1.HasKey("RobotId"); - - b1.ToTable("Robots"); - - b1.WithOwner() - .HasForeignKey("RobotId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseRobotId") - .HasColumnType("text"); - - 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("text"); - - 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("text"); - - b1.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b1.Property("ShouldRotate270Clockwise") - .HasColumnType("boolean"); - - b1.Property("Type") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b1.Property("Url") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.HasKey("Id"); - - b1.HasIndex("RobotId"); - - b1.ToTable("VideoStream"); - - b1.WithOwner() - .HasForeignKey("RobotId"); - }); - - b.Navigation("CurrentArea"); - - b.Navigation("CurrentInstallation"); - - 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("text"); - - b1.HasKey("SafePositionId"); - - b1.ToTable("SafePositions"); - - b1.WithOwner() - .HasForeignKey("SafePositionId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseSafePositionId") - .HasColumnType("text"); - - 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("text"); - - 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"); - }); - - modelBuilder.Entity("Api.Database.Models.Inspection", b => - { - b.Navigation("InspectionFindings"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionRun", b => - { - b.Navigation("Tasks"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionTask", b => - { - b.Navigation("Inspections"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/backend/api/Migrations/20231219153128_AddTypeToMissionTask.cs b/backend/api/Migrations/20231219153128_AddTypeToMissionTask.cs deleted file mode 100644 index 5fce95cc0..000000000 --- a/backend/api/Migrations/20231219153128_AddTypeToMissionTask.cs +++ /dev/null @@ -1,29 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Api.Migrations -{ - /// - public partial class AddTypeToMissionTask : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "Type", - table: "MissionTasks", - type: "text", - nullable: false, - defaultValue: ""); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "Type", - table: "MissionTasks"); - } - } -} diff --git a/backend/api/Migrations/20240104142156_MakeDeckInAreaRequired.Designer.cs b/backend/api/Migrations/20240104142156_MakeDeckInAreaRequired.Designer.cs deleted file mode 100644 index 448c05190..000000000 --- a/backend/api/Migrations/20240104142156_MakeDeckInAreaRequired.Designer.cs +++ /dev/null @@ -1,1366 +0,0 @@ -// -using System; -using Api.Database.Context; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace Api.Migrations -{ - [DbContext(typeof(FlotillaDbContext))] - [Migration("20240104142156_MakeDeckInAreaRequired")] - partial class MakeDeckInAreaRequired - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "8.0.0") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("Api.Database.Models.AccessRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AccessLevel") - .IsRequired() - .HasColumnType("text"); - - b.Property("InstallationId") - .HasColumnType("text"); - - b.Property("RoleName") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("InstallationId"); - - b.ToTable("AccessRoles"); - }); - - modelBuilder.Entity("Api.Database.Models.Area", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("DeckId") - .IsRequired() - .HasColumnType("text"); - - b.Property("DefaultLocalizationPoseId") - .HasColumnType("text"); - - b.Property("InstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PlantId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("DeckId"); - - b.HasIndex("DefaultLocalizationPoseId"); - - b.HasIndex("InstallationId"); - - b.HasIndex("PlantId"); - - b.ToTable("Areas"); - }); - - modelBuilder.Entity("Api.Database.Models.Deck", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("DefaultLocalizationPoseId") - .HasColumnType("text"); - - b.Property("InstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PlantId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("DefaultLocalizationPoseId"); - - b.HasIndex("InstallationId"); - - b.HasIndex("PlantId"); - - b.ToTable("Decks"); - }); - - modelBuilder.Entity("Api.Database.Models.DefaultLocalizationPose", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.ToTable("DefaultLocalizationPoses"); - }); - - modelBuilder.Entity("Api.Database.Models.Inspection", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AnalysisType") - .HasColumnType("text"); - - b.Property("EndTime") - .HasColumnType("timestamp with time zone"); - - b.Property("InspectionType") - .IsRequired() - .HasColumnType("text"); - - b.Property("InspectionUrl") - .HasMaxLength(250) - .HasColumnType("character varying(250)"); - - b.Property("IsarStepId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionTaskId") - .HasColumnType("text"); - - b.Property("StartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("VideoDuration") - .HasColumnType("real"); - - b.HasKey("Id"); - - b.HasIndex("MissionTaskId"); - - b.ToTable("Inspections"); - }); - - modelBuilder.Entity("Api.Database.Models.InspectionFinding", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("Finding") - .IsRequired() - .HasColumnType("text"); - - b.Property("InspectionDate") - .HasColumnType("timestamp with time zone"); - - b.Property("InspectionId") - .HasColumnType("text"); - - b.Property("IsarStepId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("InspectionId"); - - b.ToTable("InspectionFindings"); - }); - - modelBuilder.Entity("Api.Database.Models.Installation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("InstallationCode") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.HasKey("Id"); - - b.HasIndex("InstallationCode") - .IsUnique(); - - b.ToTable("Installations"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionDefinition", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AreaId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Comment") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("InspectionFrequency") - .HasColumnType("bigint"); - - b.Property("InstallationCode") - .IsRequired() - .HasColumnType("text"); - - b.Property("IsDeprecated") - .HasColumnType("boolean"); - - b.Property("LastSuccessfulRunId") - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("SourceId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("AreaId"); - - b.HasIndex("LastSuccessfulRunId"); - - b.HasIndex("SourceId"); - - b.ToTable("MissionDefinitions"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionRun", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AreaId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Comment") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("Description") - .HasMaxLength(450) - .HasColumnType("character varying(450)"); - - b.Property("DesiredStartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("EndTime") - .HasColumnType("timestamp with time zone"); - - b.Property("EstimatedDuration") - .HasColumnType("bigint"); - - b.Property("InstallationCode") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("IsarMissionId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("MissionRunPriority") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("StartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("StatusReason") - .HasMaxLength(450) - .HasColumnType("character varying(450)"); - - b.HasKey("Id"); - - b.HasIndex("AreaId"); - - b.HasIndex("RobotId"); - - b.ToTable("MissionRuns"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionTask", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("EchoPoseId") - .HasColumnType("integer"); - - b.Property("EchoTagLink") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("EndTime") - .HasColumnType("timestamp with time zone"); - - b.Property("IsarTaskId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionRunId") - .HasColumnType("text"); - - b.Property("StartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("TagId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("TaskOrder") - .HasColumnType("integer"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("MissionRunId"); - - b.ToTable("MissionTasks"); - }); - - modelBuilder.Entity("Api.Database.Models.Plant", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("InstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PlantCode") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(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("text"); - - b.Property("BatteryLevel") - .HasColumnType("real"); - - b.Property("CurrentAreaId") - .HasColumnType("text"); - - b.Property("CurrentInstallationId") - .HasColumnType("text"); - - b.Property("CurrentMissionId") - .HasColumnType("text"); - - b.Property("Enabled") - .HasColumnType("boolean"); - - b.Property("Host") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("IsarId") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionQueueFrozen") - .HasColumnType("boolean"); - - b.Property("ModelId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Port") - .HasColumnType("integer"); - - b.Property("PressureLevel") - .HasColumnType("real"); - - b.Property("SerialNumber") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("CurrentAreaId"); - - b.HasIndex("CurrentInstallationId"); - - b.HasIndex("ModelId"); - - b.ToTable("Robots"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotBatteryTimeseries", b => - { - b.Property("BatteryLevel") - .HasColumnType("real"); - - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Time") - .HasColumnType("timestamp with time zone"); - - b.ToTable("RobotBatteryTimeseries"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotModel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AverageDurationPerTag") - .HasColumnType("real"); - - b.Property("BatteryWarningThreshold") - .HasColumnType("real"); - - b.Property("LowerPressureWarningThreshold") - .HasColumnType("real"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - b.Property("UpperPressureWarningThreshold") - .HasColumnType("real"); - - b.HasKey("Id"); - - b.HasIndex("Type") - .IsUnique(); - - b.ToTable("RobotModels"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotPoseTimeseries", b => - { - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("OrientationW") - .HasColumnType("real"); - - b.Property("OrientationX") - .HasColumnType("real"); - - b.Property("OrientationY") - .HasColumnType("real"); - - b.Property("OrientationZ") - .HasColumnType("real"); - - b.Property("PositionX") - .HasColumnType("real"); - - b.Property("PositionY") - .HasColumnType("real"); - - b.Property("PositionZ") - .HasColumnType("real"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Time") - .HasColumnType("timestamp with time zone"); - - b.ToTable("RobotPoseTimeseries"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotPressureTimeseries", b => - { - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("Pressure") - .HasColumnType("real"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Time") - .HasColumnType("timestamp with time zone"); - - b.ToTable("RobotPressureTimeseries"); - }); - - modelBuilder.Entity("Api.Database.Models.SafePosition", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AreaId") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("AreaId"); - - b.ToTable("SafePositions"); - }); - - modelBuilder.Entity("Api.Database.Models.Source", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("SourceId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.ToTable("Sources"); - }); - - modelBuilder.Entity("Api.Database.Models.AccessRole", b => - { - b.HasOne("Api.Database.Models.Installation", "Installation") - .WithMany() - .HasForeignKey("InstallationId"); - - b.Navigation("Installation"); - }); - - 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.DefaultLocalizationPose", "DefaultLocalizationPose") - .WithMany() - .HasForeignKey("DefaultLocalizationPoseId"); - - 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.MapMetadata", "MapMetadata", b1 => - { - b1.Property("AreaId") - .HasColumnType("text"); - - b1.Property("MapName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.HasKey("AreaId"); - - b1.ToTable("Areas"); - - b1.WithOwner() - .HasForeignKey("AreaId"); - - b1.OwnsOne("Api.Database.Models.Boundary", "Boundary", b2 => - { - b2.Property("MapMetadataAreaId") - .HasColumnType("text"); - - b2.Property("X1") - .HasColumnType("double precision"); - - b2.Property("X2") - .HasColumnType("double precision"); - - b2.Property("Y1") - .HasColumnType("double precision"); - - b2.Property("Y2") - .HasColumnType("double precision"); - - b2.Property("Z1") - .HasColumnType("double precision"); - - b2.Property("Z2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataAreaId"); - - b2.ToTable("Areas"); - - b2.WithOwner() - .HasForeignKey("MapMetadataAreaId"); - }); - - b1.OwnsOne("Api.Database.Models.TransformationMatrices", "TransformationMatrices", b2 => - { - b2.Property("MapMetadataAreaId") - .HasColumnType("text"); - - b2.Property("C1") - .HasColumnType("double precision"); - - b2.Property("C2") - .HasColumnType("double precision"); - - b2.Property("D1") - .HasColumnType("double precision"); - - b2.Property("D2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataAreaId"); - - b2.ToTable("Areas"); - - b2.WithOwner() - .HasForeignKey("MapMetadataAreaId"); - }); - - b1.Navigation("Boundary") - .IsRequired(); - - b1.Navigation("TransformationMatrices") - .IsRequired(); - }); - - b.Navigation("Deck"); - - b.Navigation("DefaultLocalizationPose"); - - b.Navigation("Installation"); - - b.Navigation("MapMetadata") - .IsRequired(); - - b.Navigation("Plant"); - }); - - modelBuilder.Entity("Api.Database.Models.Deck", b => - { - b.HasOne("Api.Database.Models.DefaultLocalizationPose", "DefaultLocalizationPose") - .WithMany() - .HasForeignKey("DefaultLocalizationPoseId"); - - 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.Navigation("DefaultLocalizationPose"); - - b.Navigation("Installation"); - - b.Navigation("Plant"); - }); - - modelBuilder.Entity("Api.Database.Models.DefaultLocalizationPose", b => - { - b.OwnsOne("Api.Database.Models.Pose", "Pose", b1 => - { - b1.Property("DefaultLocalizationPoseId") - .HasColumnType("text"); - - b1.HasKey("DefaultLocalizationPoseId"); - - b1.ToTable("DefaultLocalizationPoses"); - - b1.WithOwner() - .HasForeignKey("DefaultLocalizationPoseId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseDefaultLocalizationPoseId") - .HasColumnType("text"); - - b2.Property("W") - .HasColumnType("real"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseDefaultLocalizationPoseId"); - - b2.ToTable("DefaultLocalizationPoses"); - - b2.WithOwner() - .HasForeignKey("PoseDefaultLocalizationPoseId"); - }); - - b1.OwnsOne("Api.Database.Models.Position", "Position", b2 => - { - b2.Property("PoseDefaultLocalizationPoseId") - .HasColumnType("text"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseDefaultLocalizationPoseId"); - - b2.ToTable("DefaultLocalizationPoses"); - - b2.WithOwner() - .HasForeignKey("PoseDefaultLocalizationPoseId"); - }); - - b1.Navigation("Orientation") - .IsRequired(); - - b1.Navigation("Position") - .IsRequired(); - }); - - b.Navigation("Pose") - .IsRequired(); - }); - - modelBuilder.Entity("Api.Database.Models.Inspection", b => - { - b.HasOne("Api.Database.Models.MissionTask", null) - .WithMany("Inspections") - .HasForeignKey("MissionTaskId"); - - b.OwnsOne("Api.Database.Models.Position", "InspectionTarget", b1 => - { - b1.Property("InspectionId") - .HasColumnType("text"); - - b1.Property("X") - .HasColumnType("real"); - - b1.Property("Y") - .HasColumnType("real"); - - b1.Property("Z") - .HasColumnType("real"); - - b1.HasKey("InspectionId"); - - b1.ToTable("Inspections"); - - b1.WithOwner() - .HasForeignKey("InspectionId"); - }); - - b.Navigation("InspectionTarget") - .IsRequired(); - }); - - modelBuilder.Entity("Api.Database.Models.InspectionFinding", b => - { - b.HasOne("Api.Database.Models.Inspection", null) - .WithMany("InspectionFindings") - .HasForeignKey("InspectionId"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionDefinition", b => - { - b.HasOne("Api.Database.Models.Area", "Area") - .WithMany() - .HasForeignKey("AreaId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Api.Database.Models.MissionRun", "LastSuccessfulRun") - .WithMany() - .HasForeignKey("LastSuccessfulRunId"); - - b.HasOne("Api.Database.Models.Source", "Source") - .WithMany() - .HasForeignKey("SourceId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Area"); - - b.Navigation("LastSuccessfulRun"); - - b.Navigation("Source"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionRun", b => - { - b.HasOne("Api.Database.Models.Area", "Area") - .WithMany() - .HasForeignKey("AreaId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Api.Database.Models.Robot", "Robot") - .WithMany() - .HasForeignKey("RobotId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.OwnsOne("Api.Database.Models.MapMetadata", "Map", b1 => - { - b1.Property("MissionRunId") - .HasColumnType("text"); - - b1.Property("MapName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.HasKey("MissionRunId"); - - b1.ToTable("MissionRuns"); - - b1.WithOwner() - .HasForeignKey("MissionRunId"); - - b1.OwnsOne("Api.Database.Models.Boundary", "Boundary", b2 => - { - b2.Property("MapMetadataMissionRunId") - .HasColumnType("text"); - - b2.Property("X1") - .HasColumnType("double precision"); - - b2.Property("X2") - .HasColumnType("double precision"); - - b2.Property("Y1") - .HasColumnType("double precision"); - - b2.Property("Y2") - .HasColumnType("double precision"); - - b2.Property("Z1") - .HasColumnType("double precision"); - - b2.Property("Z2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataMissionRunId"); - - b2.ToTable("MissionRuns"); - - b2.WithOwner() - .HasForeignKey("MapMetadataMissionRunId"); - }); - - b1.OwnsOne("Api.Database.Models.TransformationMatrices", "TransformationMatrices", b2 => - { - b2.Property("MapMetadataMissionRunId") - .HasColumnType("text"); - - b2.Property("C1") - .HasColumnType("double precision"); - - b2.Property("C2") - .HasColumnType("double precision"); - - b2.Property("D1") - .HasColumnType("double precision"); - - b2.Property("D2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataMissionRunId"); - - b2.ToTable("MissionRuns"); - - b2.WithOwner() - .HasForeignKey("MapMetadataMissionRunId"); - }); - - b1.Navigation("Boundary") - .IsRequired(); - - b1.Navigation("TransformationMatrices") - .IsRequired(); - }); - - b.Navigation("Area"); - - b.Navigation("Map"); - - b.Navigation("Robot"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionTask", b => - { - b.HasOne("Api.Database.Models.MissionRun", null) - .WithMany("Tasks") - .HasForeignKey("MissionRunId"); - - b.OwnsOne("Api.Database.Models.Position", "InspectionTarget", b1 => - { - b1.Property("MissionTaskId") - .HasColumnType("text"); - - b1.Property("X") - .HasColumnType("real"); - - b1.Property("Y") - .HasColumnType("real"); - - b1.Property("Z") - .HasColumnType("real"); - - b1.HasKey("MissionTaskId"); - - b1.ToTable("MissionTasks"); - - b1.WithOwner() - .HasForeignKey("MissionTaskId"); - }); - - b.OwnsOne("Api.Database.Models.Pose", "RobotPose", b1 => - { - b1.Property("MissionTaskId") - .HasColumnType("text"); - - b1.HasKey("MissionTaskId"); - - b1.ToTable("MissionTasks"); - - b1.WithOwner() - .HasForeignKey("MissionTaskId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseMissionTaskId") - .HasColumnType("text"); - - b2.Property("W") - .HasColumnType("real"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseMissionTaskId"); - - b2.ToTable("MissionTasks"); - - b2.WithOwner() - .HasForeignKey("PoseMissionTaskId"); - }); - - b1.OwnsOne("Api.Database.Models.Position", "Position", b2 => - { - b2.Property("PoseMissionTaskId") - .HasColumnType("text"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseMissionTaskId"); - - b2.ToTable("MissionTasks"); - - b2.WithOwner() - .HasForeignKey("PoseMissionTaskId"); - }); - - b1.Navigation("Orientation") - .IsRequired(); - - b1.Navigation("Position") - .IsRequired(); - }); - - b.Navigation("InspectionTarget") - .IsRequired(); - - b.Navigation("RobotPose") - .IsRequired(); - }); - - modelBuilder.Entity("Api.Database.Models.Plant", b => - { - b.HasOne("Api.Database.Models.Installation", "Installation") - .WithMany() - .HasForeignKey("InstallationId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - 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.Installation", "CurrentInstallation") - .WithMany() - .HasForeignKey("CurrentInstallationId"); - - 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("text"); - - b1.HasKey("RobotId"); - - b1.ToTable("Robots"); - - b1.WithOwner() - .HasForeignKey("RobotId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseRobotId") - .HasColumnType("text"); - - 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("text"); - - 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("text"); - - b1.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b1.Property("ShouldRotate270Clockwise") - .HasColumnType("boolean"); - - b1.Property("Type") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b1.Property("Url") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.HasKey("Id"); - - b1.HasIndex("RobotId"); - - b1.ToTable("VideoStream"); - - b1.WithOwner() - .HasForeignKey("RobotId"); - }); - - b.Navigation("CurrentArea"); - - b.Navigation("CurrentInstallation"); - - 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("text"); - - b1.HasKey("SafePositionId"); - - b1.ToTable("SafePositions"); - - b1.WithOwner() - .HasForeignKey("SafePositionId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseSafePositionId") - .HasColumnType("text"); - - 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("text"); - - 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"); - }); - - modelBuilder.Entity("Api.Database.Models.Inspection", b => - { - b.Navigation("InspectionFindings"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionRun", b => - { - b.Navigation("Tasks"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionTask", b => - { - b.Navigation("Inspections"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/backend/api/Migrations/20240104142156_MakeDeckInAreaRequired.cs b/backend/api/Migrations/20240104142156_MakeDeckInAreaRequired.cs deleted file mode 100644 index d51cfbc49..000000000 --- a/backend/api/Migrations/20240104142156_MakeDeckInAreaRequired.cs +++ /dev/null @@ -1,36 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Api.Migrations -{ - /// - public partial class MakeDeckInAreaRequired : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AlterColumn( - name: "DeckId", - table: "Areas", - type: "text", - nullable: false, - defaultValue: "", - oldClrType: typeof(string), - oldType: "text", - oldNullable: true); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.AlterColumn( - name: "DeckId", - table: "Areas", - type: "text", - nullable: true, - oldClrType: typeof(string), - oldType: "text"); - } - } -} diff --git a/backend/api/Migrations/20240104143242_MakeCurrentRobotInstallationRequired.Designer.cs b/backend/api/Migrations/20240104143242_MakeCurrentRobotInstallationRequired.Designer.cs deleted file mode 100644 index 9ee1c53ae..000000000 --- a/backend/api/Migrations/20240104143242_MakeCurrentRobotInstallationRequired.Designer.cs +++ /dev/null @@ -1,1369 +0,0 @@ -// -using System; -using Api.Database.Context; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace Api.Migrations -{ - [DbContext(typeof(FlotillaDbContext))] - [Migration("20240104143242_MakeCurrentRobotInstallationRequired")] - partial class MakeCurrentRobotInstallationRequired - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "8.0.0") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("Api.Database.Models.AccessRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AccessLevel") - .IsRequired() - .HasColumnType("text"); - - b.Property("InstallationId") - .HasColumnType("text"); - - b.Property("RoleName") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("InstallationId"); - - b.ToTable("AccessRoles"); - }); - - modelBuilder.Entity("Api.Database.Models.Area", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("DeckId") - .IsRequired() - .HasColumnType("text"); - - b.Property("DefaultLocalizationPoseId") - .HasColumnType("text"); - - b.Property("InstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PlantId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("DeckId"); - - b.HasIndex("DefaultLocalizationPoseId"); - - b.HasIndex("InstallationId"); - - b.HasIndex("PlantId"); - - b.ToTable("Areas"); - }); - - modelBuilder.Entity("Api.Database.Models.Deck", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("DefaultLocalizationPoseId") - .HasColumnType("text"); - - b.Property("InstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PlantId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("DefaultLocalizationPoseId"); - - b.HasIndex("InstallationId"); - - b.HasIndex("PlantId"); - - b.ToTable("Decks"); - }); - - modelBuilder.Entity("Api.Database.Models.DefaultLocalizationPose", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.ToTable("DefaultLocalizationPoses"); - }); - - modelBuilder.Entity("Api.Database.Models.Inspection", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AnalysisType") - .HasColumnType("text"); - - b.Property("EndTime") - .HasColumnType("timestamp with time zone"); - - b.Property("InspectionType") - .IsRequired() - .HasColumnType("text"); - - b.Property("InspectionUrl") - .HasMaxLength(250) - .HasColumnType("character varying(250)"); - - b.Property("IsarStepId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionTaskId") - .HasColumnType("text"); - - b.Property("StartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("VideoDuration") - .HasColumnType("real"); - - b.HasKey("Id"); - - b.HasIndex("MissionTaskId"); - - b.ToTable("Inspections"); - }); - - modelBuilder.Entity("Api.Database.Models.InspectionFinding", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("Finding") - .IsRequired() - .HasColumnType("text"); - - b.Property("InspectionDate") - .HasColumnType("timestamp with time zone"); - - b.Property("InspectionId") - .HasColumnType("text"); - - b.Property("IsarStepId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("InspectionId"); - - b.ToTable("InspectionFindings"); - }); - - modelBuilder.Entity("Api.Database.Models.Installation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("InstallationCode") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.HasKey("Id"); - - b.HasIndex("InstallationCode") - .IsUnique(); - - b.ToTable("Installations"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionDefinition", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AreaId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Comment") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("InspectionFrequency") - .HasColumnType("bigint"); - - b.Property("InstallationCode") - .IsRequired() - .HasColumnType("text"); - - b.Property("IsDeprecated") - .HasColumnType("boolean"); - - b.Property("LastSuccessfulRunId") - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("SourceId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("AreaId"); - - b.HasIndex("LastSuccessfulRunId"); - - b.HasIndex("SourceId"); - - b.ToTable("MissionDefinitions"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionRun", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AreaId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Comment") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("Description") - .HasMaxLength(450) - .HasColumnType("character varying(450)"); - - b.Property("DesiredStartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("EndTime") - .HasColumnType("timestamp with time zone"); - - b.Property("EstimatedDuration") - .HasColumnType("bigint"); - - b.Property("InstallationCode") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("IsarMissionId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("MissionRunPriority") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("StartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("StatusReason") - .HasMaxLength(450) - .HasColumnType("character varying(450)"); - - b.HasKey("Id"); - - b.HasIndex("AreaId"); - - b.HasIndex("RobotId"); - - b.ToTable("MissionRuns"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionTask", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("EchoPoseId") - .HasColumnType("integer"); - - b.Property("EchoTagLink") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("EndTime") - .HasColumnType("timestamp with time zone"); - - b.Property("IsarTaskId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionRunId") - .HasColumnType("text"); - - b.Property("StartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("TagId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("TaskOrder") - .HasColumnType("integer"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("MissionRunId"); - - b.ToTable("MissionTasks"); - }); - - modelBuilder.Entity("Api.Database.Models.Plant", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("InstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PlantCode") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(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("text"); - - b.Property("BatteryLevel") - .HasColumnType("real"); - - b.Property("CurrentAreaId") - .HasColumnType("text"); - - b.Property("CurrentInstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("CurrentMissionId") - .HasColumnType("text"); - - b.Property("Enabled") - .HasColumnType("boolean"); - - b.Property("Host") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("IsarId") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionQueueFrozen") - .HasColumnType("boolean"); - - b.Property("ModelId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Port") - .HasColumnType("integer"); - - b.Property("PressureLevel") - .HasColumnType("real"); - - b.Property("SerialNumber") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("CurrentAreaId"); - - b.HasIndex("CurrentInstallationId"); - - b.HasIndex("ModelId"); - - b.ToTable("Robots"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotBatteryTimeseries", b => - { - b.Property("BatteryLevel") - .HasColumnType("real"); - - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Time") - .HasColumnType("timestamp with time zone"); - - b.ToTable("RobotBatteryTimeseries"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotModel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AverageDurationPerTag") - .HasColumnType("real"); - - b.Property("BatteryWarningThreshold") - .HasColumnType("real"); - - b.Property("LowerPressureWarningThreshold") - .HasColumnType("real"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - b.Property("UpperPressureWarningThreshold") - .HasColumnType("real"); - - b.HasKey("Id"); - - b.HasIndex("Type") - .IsUnique(); - - b.ToTable("RobotModels"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotPoseTimeseries", b => - { - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("OrientationW") - .HasColumnType("real"); - - b.Property("OrientationX") - .HasColumnType("real"); - - b.Property("OrientationY") - .HasColumnType("real"); - - b.Property("OrientationZ") - .HasColumnType("real"); - - b.Property("PositionX") - .HasColumnType("real"); - - b.Property("PositionY") - .HasColumnType("real"); - - b.Property("PositionZ") - .HasColumnType("real"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Time") - .HasColumnType("timestamp with time zone"); - - b.ToTable("RobotPoseTimeseries"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotPressureTimeseries", b => - { - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("Pressure") - .HasColumnType("real"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Time") - .HasColumnType("timestamp with time zone"); - - b.ToTable("RobotPressureTimeseries"); - }); - - modelBuilder.Entity("Api.Database.Models.SafePosition", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AreaId") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("AreaId"); - - b.ToTable("SafePositions"); - }); - - modelBuilder.Entity("Api.Database.Models.Source", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("SourceId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.ToTable("Sources"); - }); - - modelBuilder.Entity("Api.Database.Models.AccessRole", b => - { - b.HasOne("Api.Database.Models.Installation", "Installation") - .WithMany() - .HasForeignKey("InstallationId"); - - b.Navigation("Installation"); - }); - - 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.DefaultLocalizationPose", "DefaultLocalizationPose") - .WithMany() - .HasForeignKey("DefaultLocalizationPoseId"); - - 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.MapMetadata", "MapMetadata", b1 => - { - b1.Property("AreaId") - .HasColumnType("text"); - - b1.Property("MapName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.HasKey("AreaId"); - - b1.ToTable("Areas"); - - b1.WithOwner() - .HasForeignKey("AreaId"); - - b1.OwnsOne("Api.Database.Models.Boundary", "Boundary", b2 => - { - b2.Property("MapMetadataAreaId") - .HasColumnType("text"); - - b2.Property("X1") - .HasColumnType("double precision"); - - b2.Property("X2") - .HasColumnType("double precision"); - - b2.Property("Y1") - .HasColumnType("double precision"); - - b2.Property("Y2") - .HasColumnType("double precision"); - - b2.Property("Z1") - .HasColumnType("double precision"); - - b2.Property("Z2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataAreaId"); - - b2.ToTable("Areas"); - - b2.WithOwner() - .HasForeignKey("MapMetadataAreaId"); - }); - - b1.OwnsOne("Api.Database.Models.TransformationMatrices", "TransformationMatrices", b2 => - { - b2.Property("MapMetadataAreaId") - .HasColumnType("text"); - - b2.Property("C1") - .HasColumnType("double precision"); - - b2.Property("C2") - .HasColumnType("double precision"); - - b2.Property("D1") - .HasColumnType("double precision"); - - b2.Property("D2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataAreaId"); - - b2.ToTable("Areas"); - - b2.WithOwner() - .HasForeignKey("MapMetadataAreaId"); - }); - - b1.Navigation("Boundary") - .IsRequired(); - - b1.Navigation("TransformationMatrices") - .IsRequired(); - }); - - b.Navigation("Deck"); - - b.Navigation("DefaultLocalizationPose"); - - b.Navigation("Installation"); - - b.Navigation("MapMetadata") - .IsRequired(); - - b.Navigation("Plant"); - }); - - modelBuilder.Entity("Api.Database.Models.Deck", b => - { - b.HasOne("Api.Database.Models.DefaultLocalizationPose", "DefaultLocalizationPose") - .WithMany() - .HasForeignKey("DefaultLocalizationPoseId"); - - 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.Navigation("DefaultLocalizationPose"); - - b.Navigation("Installation"); - - b.Navigation("Plant"); - }); - - modelBuilder.Entity("Api.Database.Models.DefaultLocalizationPose", b => - { - b.OwnsOne("Api.Database.Models.Pose", "Pose", b1 => - { - b1.Property("DefaultLocalizationPoseId") - .HasColumnType("text"); - - b1.HasKey("DefaultLocalizationPoseId"); - - b1.ToTable("DefaultLocalizationPoses"); - - b1.WithOwner() - .HasForeignKey("DefaultLocalizationPoseId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseDefaultLocalizationPoseId") - .HasColumnType("text"); - - b2.Property("W") - .HasColumnType("real"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseDefaultLocalizationPoseId"); - - b2.ToTable("DefaultLocalizationPoses"); - - b2.WithOwner() - .HasForeignKey("PoseDefaultLocalizationPoseId"); - }); - - b1.OwnsOne("Api.Database.Models.Position", "Position", b2 => - { - b2.Property("PoseDefaultLocalizationPoseId") - .HasColumnType("text"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseDefaultLocalizationPoseId"); - - b2.ToTable("DefaultLocalizationPoses"); - - b2.WithOwner() - .HasForeignKey("PoseDefaultLocalizationPoseId"); - }); - - b1.Navigation("Orientation") - .IsRequired(); - - b1.Navigation("Position") - .IsRequired(); - }); - - b.Navigation("Pose") - .IsRequired(); - }); - - modelBuilder.Entity("Api.Database.Models.Inspection", b => - { - b.HasOne("Api.Database.Models.MissionTask", null) - .WithMany("Inspections") - .HasForeignKey("MissionTaskId"); - - b.OwnsOne("Api.Database.Models.Position", "InspectionTarget", b1 => - { - b1.Property("InspectionId") - .HasColumnType("text"); - - b1.Property("X") - .HasColumnType("real"); - - b1.Property("Y") - .HasColumnType("real"); - - b1.Property("Z") - .HasColumnType("real"); - - b1.HasKey("InspectionId"); - - b1.ToTable("Inspections"); - - b1.WithOwner() - .HasForeignKey("InspectionId"); - }); - - b.Navigation("InspectionTarget") - .IsRequired(); - }); - - modelBuilder.Entity("Api.Database.Models.InspectionFinding", b => - { - b.HasOne("Api.Database.Models.Inspection", null) - .WithMany("InspectionFindings") - .HasForeignKey("InspectionId"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionDefinition", b => - { - b.HasOne("Api.Database.Models.Area", "Area") - .WithMany() - .HasForeignKey("AreaId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Api.Database.Models.MissionRun", "LastSuccessfulRun") - .WithMany() - .HasForeignKey("LastSuccessfulRunId"); - - b.HasOne("Api.Database.Models.Source", "Source") - .WithMany() - .HasForeignKey("SourceId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Area"); - - b.Navigation("LastSuccessfulRun"); - - b.Navigation("Source"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionRun", b => - { - b.HasOne("Api.Database.Models.Area", "Area") - .WithMany() - .HasForeignKey("AreaId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Api.Database.Models.Robot", "Robot") - .WithMany() - .HasForeignKey("RobotId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.OwnsOne("Api.Database.Models.MapMetadata", "Map", b1 => - { - b1.Property("MissionRunId") - .HasColumnType("text"); - - b1.Property("MapName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.HasKey("MissionRunId"); - - b1.ToTable("MissionRuns"); - - b1.WithOwner() - .HasForeignKey("MissionRunId"); - - b1.OwnsOne("Api.Database.Models.Boundary", "Boundary", b2 => - { - b2.Property("MapMetadataMissionRunId") - .HasColumnType("text"); - - b2.Property("X1") - .HasColumnType("double precision"); - - b2.Property("X2") - .HasColumnType("double precision"); - - b2.Property("Y1") - .HasColumnType("double precision"); - - b2.Property("Y2") - .HasColumnType("double precision"); - - b2.Property("Z1") - .HasColumnType("double precision"); - - b2.Property("Z2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataMissionRunId"); - - b2.ToTable("MissionRuns"); - - b2.WithOwner() - .HasForeignKey("MapMetadataMissionRunId"); - }); - - b1.OwnsOne("Api.Database.Models.TransformationMatrices", "TransformationMatrices", b2 => - { - b2.Property("MapMetadataMissionRunId") - .HasColumnType("text"); - - b2.Property("C1") - .HasColumnType("double precision"); - - b2.Property("C2") - .HasColumnType("double precision"); - - b2.Property("D1") - .HasColumnType("double precision"); - - b2.Property("D2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataMissionRunId"); - - b2.ToTable("MissionRuns"); - - b2.WithOwner() - .HasForeignKey("MapMetadataMissionRunId"); - }); - - b1.Navigation("Boundary") - .IsRequired(); - - b1.Navigation("TransformationMatrices") - .IsRequired(); - }); - - b.Navigation("Area"); - - b.Navigation("Map"); - - b.Navigation("Robot"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionTask", b => - { - b.HasOne("Api.Database.Models.MissionRun", null) - .WithMany("Tasks") - .HasForeignKey("MissionRunId"); - - b.OwnsOne("Api.Database.Models.Position", "InspectionTarget", b1 => - { - b1.Property("MissionTaskId") - .HasColumnType("text"); - - b1.Property("X") - .HasColumnType("real"); - - b1.Property("Y") - .HasColumnType("real"); - - b1.Property("Z") - .HasColumnType("real"); - - b1.HasKey("MissionTaskId"); - - b1.ToTable("MissionTasks"); - - b1.WithOwner() - .HasForeignKey("MissionTaskId"); - }); - - b.OwnsOne("Api.Database.Models.Pose", "RobotPose", b1 => - { - b1.Property("MissionTaskId") - .HasColumnType("text"); - - b1.HasKey("MissionTaskId"); - - b1.ToTable("MissionTasks"); - - b1.WithOwner() - .HasForeignKey("MissionTaskId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseMissionTaskId") - .HasColumnType("text"); - - b2.Property("W") - .HasColumnType("real"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseMissionTaskId"); - - b2.ToTable("MissionTasks"); - - b2.WithOwner() - .HasForeignKey("PoseMissionTaskId"); - }); - - b1.OwnsOne("Api.Database.Models.Position", "Position", b2 => - { - b2.Property("PoseMissionTaskId") - .HasColumnType("text"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseMissionTaskId"); - - b2.ToTable("MissionTasks"); - - b2.WithOwner() - .HasForeignKey("PoseMissionTaskId"); - }); - - b1.Navigation("Orientation") - .IsRequired(); - - b1.Navigation("Position") - .IsRequired(); - }); - - b.Navigation("InspectionTarget") - .IsRequired(); - - b.Navigation("RobotPose") - .IsRequired(); - }); - - modelBuilder.Entity("Api.Database.Models.Plant", b => - { - b.HasOne("Api.Database.Models.Installation", "Installation") - .WithMany() - .HasForeignKey("InstallationId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - 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.Installation", "CurrentInstallation") - .WithMany() - .HasForeignKey("CurrentInstallationId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - 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("text"); - - b1.HasKey("RobotId"); - - b1.ToTable("Robots"); - - b1.WithOwner() - .HasForeignKey("RobotId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseRobotId") - .HasColumnType("text"); - - 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("text"); - - 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("text"); - - b1.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b1.Property("ShouldRotate270Clockwise") - .HasColumnType("boolean"); - - b1.Property("Type") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b1.Property("Url") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.HasKey("Id"); - - b1.HasIndex("RobotId"); - - b1.ToTable("VideoStream"); - - b1.WithOwner() - .HasForeignKey("RobotId"); - }); - - b.Navigation("CurrentArea"); - - b.Navigation("CurrentInstallation"); - - 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("text"); - - b1.HasKey("SafePositionId"); - - b1.ToTable("SafePositions"); - - b1.WithOwner() - .HasForeignKey("SafePositionId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseSafePositionId") - .HasColumnType("text"); - - 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("text"); - - 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"); - }); - - modelBuilder.Entity("Api.Database.Models.Inspection", b => - { - b.Navigation("InspectionFindings"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionRun", b => - { - b.Navigation("Tasks"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionTask", b => - { - b.Navigation("Inspections"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/backend/api/Migrations/20240104143242_MakeCurrentRobotInstallationRequired.cs b/backend/api/Migrations/20240104143242_MakeCurrentRobotInstallationRequired.cs deleted file mode 100644 index 1cfc7073e..000000000 --- a/backend/api/Migrations/20240104143242_MakeCurrentRobotInstallationRequired.cs +++ /dev/null @@ -1,59 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Api.Migrations -{ - /// - public partial class MakeCurrentRobotInstallationRequired : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropForeignKey( - name: "FK_Robots_Installations_CurrentInstallationId", - table: "Robots"); - - migrationBuilder.AlterColumn( - name: "CurrentInstallationId", - table: "Robots", - type: "text", - nullable: false, - defaultValue: "", - oldClrType: typeof(string), - oldType: "text", - oldNullable: true); - - migrationBuilder.AddForeignKey( - name: "FK_Robots_Installations_CurrentInstallationId", - table: "Robots", - column: "CurrentInstallationId", - principalTable: "Installations", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropForeignKey( - name: "FK_Robots_Installations_CurrentInstallationId", - table: "Robots"); - - migrationBuilder.AlterColumn( - name: "CurrentInstallationId", - table: "Robots", - type: "text", - nullable: true, - oldClrType: typeof(string), - oldType: "text"); - - migrationBuilder.AddForeignKey( - name: "FK_Robots_Installations_CurrentInstallationId", - table: "Robots", - column: "CurrentInstallationId", - principalTable: "Installations", - principalColumn: "Id"); - } - } -} diff --git a/backend/api/Migrations/20240112094731_AddRequiredFieldsToInspectionAndPoses.Designer.cs b/backend/api/Migrations/20240112094731_AddRequiredFieldsToInspectionAndPoses.Designer.cs deleted file mode 100644 index d90938647..000000000 --- a/backend/api/Migrations/20240112094731_AddRequiredFieldsToInspectionAndPoses.Designer.cs +++ /dev/null @@ -1,1369 +0,0 @@ -// -using System; -using Api.Database.Context; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace Api.Migrations -{ - [DbContext(typeof(FlotillaDbContext))] - [Migration("20240112094731_AddRequiredFieldsToInspectionAndPoses")] - partial class AddRequiredFieldsToInspectionAndPoses - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "8.0.0") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("Api.Database.Models.AccessRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AccessLevel") - .IsRequired() - .HasColumnType("text"); - - b.Property("InstallationId") - .HasColumnType("text"); - - b.Property("RoleName") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("InstallationId"); - - b.ToTable("AccessRoles"); - }); - - modelBuilder.Entity("Api.Database.Models.Area", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("DeckId") - .IsRequired() - .HasColumnType("text"); - - b.Property("DefaultLocalizationPoseId") - .HasColumnType("text"); - - b.Property("InstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PlantId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("DeckId"); - - b.HasIndex("DefaultLocalizationPoseId"); - - b.HasIndex("InstallationId"); - - b.HasIndex("PlantId"); - - b.ToTable("Areas"); - }); - - modelBuilder.Entity("Api.Database.Models.Deck", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("DefaultLocalizationPoseId") - .HasColumnType("text"); - - b.Property("InstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PlantId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("DefaultLocalizationPoseId"); - - b.HasIndex("InstallationId"); - - b.HasIndex("PlantId"); - - b.ToTable("Decks"); - }); - - modelBuilder.Entity("Api.Database.Models.DefaultLocalizationPose", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.ToTable("DefaultLocalizationPoses"); - }); - - modelBuilder.Entity("Api.Database.Models.Inspection", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AnalysisType") - .HasColumnType("text"); - - b.Property("EndTime") - .HasColumnType("timestamp with time zone"); - - b.Property("InspectionType") - .IsRequired() - .HasColumnType("text"); - - b.Property("InspectionUrl") - .HasMaxLength(250) - .HasColumnType("character varying(250)"); - - b.Property("IsarStepId") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionTaskId") - .HasColumnType("text"); - - b.Property("StartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("VideoDuration") - .HasColumnType("real"); - - b.HasKey("Id"); - - b.HasIndex("MissionTaskId"); - - b.ToTable("Inspections"); - }); - - modelBuilder.Entity("Api.Database.Models.InspectionFinding", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("Finding") - .IsRequired() - .HasColumnType("text"); - - b.Property("InspectionDate") - .HasColumnType("timestamp with time zone"); - - b.Property("InspectionId") - .HasColumnType("text"); - - b.Property("IsarStepId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("InspectionId"); - - b.ToTable("InspectionFindings"); - }); - - modelBuilder.Entity("Api.Database.Models.Installation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("InstallationCode") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.HasKey("Id"); - - b.HasIndex("InstallationCode") - .IsUnique(); - - b.ToTable("Installations"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionDefinition", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AreaId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Comment") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("InspectionFrequency") - .HasColumnType("bigint"); - - b.Property("InstallationCode") - .IsRequired() - .HasColumnType("text"); - - b.Property("IsDeprecated") - .HasColumnType("boolean"); - - b.Property("LastSuccessfulRunId") - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("SourceId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("AreaId"); - - b.HasIndex("LastSuccessfulRunId"); - - b.HasIndex("SourceId"); - - b.ToTable("MissionDefinitions"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionRun", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AreaId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Comment") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("Description") - .HasMaxLength(450) - .HasColumnType("character varying(450)"); - - b.Property("DesiredStartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("EndTime") - .HasColumnType("timestamp with time zone"); - - b.Property("EstimatedDuration") - .HasColumnType("bigint"); - - b.Property("InstallationCode") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("IsarMissionId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("MissionRunPriority") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("StartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("StatusReason") - .HasMaxLength(450) - .HasColumnType("character varying(450)"); - - b.HasKey("Id"); - - b.HasIndex("AreaId"); - - b.HasIndex("RobotId"); - - b.ToTable("MissionRuns"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionTask", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("EchoPoseId") - .HasColumnType("integer"); - - b.Property("EchoTagLink") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("EndTime") - .HasColumnType("timestamp with time zone"); - - b.Property("IsarTaskId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionRunId") - .HasColumnType("text"); - - b.Property("StartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("TagId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("TaskOrder") - .HasColumnType("integer"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("MissionRunId"); - - b.ToTable("MissionTasks"); - }); - - modelBuilder.Entity("Api.Database.Models.Plant", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("InstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PlantCode") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(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("text"); - - b.Property("BatteryLevel") - .HasColumnType("real"); - - b.Property("CurrentAreaId") - .HasColumnType("text"); - - b.Property("CurrentInstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("CurrentMissionId") - .HasColumnType("text"); - - b.Property("Enabled") - .HasColumnType("boolean"); - - b.Property("Host") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("IsarId") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionQueueFrozen") - .HasColumnType("boolean"); - - b.Property("ModelId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Port") - .HasColumnType("integer"); - - b.Property("PressureLevel") - .HasColumnType("real"); - - b.Property("SerialNumber") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("CurrentAreaId"); - - b.HasIndex("CurrentInstallationId"); - - b.HasIndex("ModelId"); - - b.ToTable("Robots"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotBatteryTimeseries", b => - { - b.Property("BatteryLevel") - .HasColumnType("real"); - - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Time") - .HasColumnType("timestamp with time zone"); - - b.ToTable("RobotBatteryTimeseries"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotModel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AverageDurationPerTag") - .HasColumnType("real"); - - b.Property("BatteryWarningThreshold") - .HasColumnType("real"); - - b.Property("LowerPressureWarningThreshold") - .HasColumnType("real"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - b.Property("UpperPressureWarningThreshold") - .HasColumnType("real"); - - b.HasKey("Id"); - - b.HasIndex("Type") - .IsUnique(); - - b.ToTable("RobotModels"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotPoseTimeseries", b => - { - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("OrientationW") - .HasColumnType("real"); - - b.Property("OrientationX") - .HasColumnType("real"); - - b.Property("OrientationY") - .HasColumnType("real"); - - b.Property("OrientationZ") - .HasColumnType("real"); - - b.Property("PositionX") - .HasColumnType("real"); - - b.Property("PositionY") - .HasColumnType("real"); - - b.Property("PositionZ") - .HasColumnType("real"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Time") - .HasColumnType("timestamp with time zone"); - - b.ToTable("RobotPoseTimeseries"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotPressureTimeseries", b => - { - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("Pressure") - .HasColumnType("real"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Time") - .HasColumnType("timestamp with time zone"); - - b.ToTable("RobotPressureTimeseries"); - }); - - modelBuilder.Entity("Api.Database.Models.SafePosition", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AreaId") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("AreaId"); - - b.ToTable("SafePositions"); - }); - - modelBuilder.Entity("Api.Database.Models.Source", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("SourceId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.ToTable("Sources"); - }); - - modelBuilder.Entity("Api.Database.Models.AccessRole", b => - { - b.HasOne("Api.Database.Models.Installation", "Installation") - .WithMany() - .HasForeignKey("InstallationId"); - - b.Navigation("Installation"); - }); - - 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.DefaultLocalizationPose", "DefaultLocalizationPose") - .WithMany() - .HasForeignKey("DefaultLocalizationPoseId"); - - 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.MapMetadata", "MapMetadata", b1 => - { - b1.Property("AreaId") - .HasColumnType("text"); - - b1.Property("MapName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.HasKey("AreaId"); - - b1.ToTable("Areas"); - - b1.WithOwner() - .HasForeignKey("AreaId"); - - b1.OwnsOne("Api.Database.Models.Boundary", "Boundary", b2 => - { - b2.Property("MapMetadataAreaId") - .HasColumnType("text"); - - b2.Property("X1") - .HasColumnType("double precision"); - - b2.Property("X2") - .HasColumnType("double precision"); - - b2.Property("Y1") - .HasColumnType("double precision"); - - b2.Property("Y2") - .HasColumnType("double precision"); - - b2.Property("Z1") - .HasColumnType("double precision"); - - b2.Property("Z2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataAreaId"); - - b2.ToTable("Areas"); - - b2.WithOwner() - .HasForeignKey("MapMetadataAreaId"); - }); - - b1.OwnsOne("Api.Database.Models.TransformationMatrices", "TransformationMatrices", b2 => - { - b2.Property("MapMetadataAreaId") - .HasColumnType("text"); - - b2.Property("C1") - .HasColumnType("double precision"); - - b2.Property("C2") - .HasColumnType("double precision"); - - b2.Property("D1") - .HasColumnType("double precision"); - - b2.Property("D2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataAreaId"); - - b2.ToTable("Areas"); - - b2.WithOwner() - .HasForeignKey("MapMetadataAreaId"); - }); - - b1.Navigation("Boundary") - .IsRequired(); - - b1.Navigation("TransformationMatrices") - .IsRequired(); - }); - - b.Navigation("Deck"); - - b.Navigation("DefaultLocalizationPose"); - - b.Navigation("Installation"); - - b.Navigation("MapMetadata") - .IsRequired(); - - b.Navigation("Plant"); - }); - - modelBuilder.Entity("Api.Database.Models.Deck", b => - { - b.HasOne("Api.Database.Models.DefaultLocalizationPose", "DefaultLocalizationPose") - .WithMany() - .HasForeignKey("DefaultLocalizationPoseId"); - - 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.Navigation("DefaultLocalizationPose"); - - b.Navigation("Installation"); - - b.Navigation("Plant"); - }); - - modelBuilder.Entity("Api.Database.Models.DefaultLocalizationPose", b => - { - b.OwnsOne("Api.Database.Models.Pose", "Pose", b1 => - { - b1.Property("DefaultLocalizationPoseId") - .HasColumnType("text"); - - b1.HasKey("DefaultLocalizationPoseId"); - - b1.ToTable("DefaultLocalizationPoses"); - - b1.WithOwner() - .HasForeignKey("DefaultLocalizationPoseId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseDefaultLocalizationPoseId") - .HasColumnType("text"); - - b2.Property("W") - .HasColumnType("real"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseDefaultLocalizationPoseId"); - - b2.ToTable("DefaultLocalizationPoses"); - - b2.WithOwner() - .HasForeignKey("PoseDefaultLocalizationPoseId"); - }); - - b1.OwnsOne("Api.Database.Models.Position", "Position", b2 => - { - b2.Property("PoseDefaultLocalizationPoseId") - .HasColumnType("text"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseDefaultLocalizationPoseId"); - - b2.ToTable("DefaultLocalizationPoses"); - - b2.WithOwner() - .HasForeignKey("PoseDefaultLocalizationPoseId"); - }); - - b1.Navigation("Orientation") - .IsRequired(); - - b1.Navigation("Position") - .IsRequired(); - }); - - b.Navigation("Pose") - .IsRequired(); - }); - - modelBuilder.Entity("Api.Database.Models.Inspection", b => - { - b.HasOne("Api.Database.Models.MissionTask", null) - .WithMany("Inspections") - .HasForeignKey("MissionTaskId"); - - b.OwnsOne("Api.Database.Models.Position", "InspectionTarget", b1 => - { - b1.Property("InspectionId") - .HasColumnType("text"); - - b1.Property("X") - .HasColumnType("real"); - - b1.Property("Y") - .HasColumnType("real"); - - b1.Property("Z") - .HasColumnType("real"); - - b1.HasKey("InspectionId"); - - b1.ToTable("Inspections"); - - b1.WithOwner() - .HasForeignKey("InspectionId"); - }); - - b.Navigation("InspectionTarget"); - }); - - modelBuilder.Entity("Api.Database.Models.InspectionFinding", b => - { - b.HasOne("Api.Database.Models.Inspection", null) - .WithMany("InspectionFindings") - .HasForeignKey("InspectionId"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionDefinition", b => - { - b.HasOne("Api.Database.Models.Area", "Area") - .WithMany() - .HasForeignKey("AreaId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Api.Database.Models.MissionRun", "LastSuccessfulRun") - .WithMany() - .HasForeignKey("LastSuccessfulRunId"); - - b.HasOne("Api.Database.Models.Source", "Source") - .WithMany() - .HasForeignKey("SourceId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Area"); - - b.Navigation("LastSuccessfulRun"); - - b.Navigation("Source"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionRun", b => - { - b.HasOne("Api.Database.Models.Area", "Area") - .WithMany() - .HasForeignKey("AreaId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Api.Database.Models.Robot", "Robot") - .WithMany() - .HasForeignKey("RobotId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.OwnsOne("Api.Database.Models.MapMetadata", "Map", b1 => - { - b1.Property("MissionRunId") - .HasColumnType("text"); - - b1.Property("MapName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.HasKey("MissionRunId"); - - b1.ToTable("MissionRuns"); - - b1.WithOwner() - .HasForeignKey("MissionRunId"); - - b1.OwnsOne("Api.Database.Models.Boundary", "Boundary", b2 => - { - b2.Property("MapMetadataMissionRunId") - .HasColumnType("text"); - - b2.Property("X1") - .HasColumnType("double precision"); - - b2.Property("X2") - .HasColumnType("double precision"); - - b2.Property("Y1") - .HasColumnType("double precision"); - - b2.Property("Y2") - .HasColumnType("double precision"); - - b2.Property("Z1") - .HasColumnType("double precision"); - - b2.Property("Z2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataMissionRunId"); - - b2.ToTable("MissionRuns"); - - b2.WithOwner() - .HasForeignKey("MapMetadataMissionRunId"); - }); - - b1.OwnsOne("Api.Database.Models.TransformationMatrices", "TransformationMatrices", b2 => - { - b2.Property("MapMetadataMissionRunId") - .HasColumnType("text"); - - b2.Property("C1") - .HasColumnType("double precision"); - - b2.Property("C2") - .HasColumnType("double precision"); - - b2.Property("D1") - .HasColumnType("double precision"); - - b2.Property("D2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataMissionRunId"); - - b2.ToTable("MissionRuns"); - - b2.WithOwner() - .HasForeignKey("MapMetadataMissionRunId"); - }); - - b1.Navigation("Boundary") - .IsRequired(); - - b1.Navigation("TransformationMatrices") - .IsRequired(); - }); - - b.Navigation("Area"); - - b.Navigation("Map"); - - b.Navigation("Robot"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionTask", b => - { - b.HasOne("Api.Database.Models.MissionRun", null) - .WithMany("Tasks") - .HasForeignKey("MissionRunId"); - - b.OwnsOne("Api.Database.Models.Position", "InspectionTarget", b1 => - { - b1.Property("MissionTaskId") - .HasColumnType("text"); - - b1.Property("X") - .HasColumnType("real"); - - b1.Property("Y") - .HasColumnType("real"); - - b1.Property("Z") - .HasColumnType("real"); - - b1.HasKey("MissionTaskId"); - - b1.ToTable("MissionTasks"); - - b1.WithOwner() - .HasForeignKey("MissionTaskId"); - }); - - b.OwnsOne("Api.Database.Models.Pose", "RobotPose", b1 => - { - b1.Property("MissionTaskId") - .HasColumnType("text"); - - b1.HasKey("MissionTaskId"); - - b1.ToTable("MissionTasks"); - - b1.WithOwner() - .HasForeignKey("MissionTaskId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseMissionTaskId") - .HasColumnType("text"); - - b2.Property("W") - .HasColumnType("real"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseMissionTaskId"); - - b2.ToTable("MissionTasks"); - - b2.WithOwner() - .HasForeignKey("PoseMissionTaskId"); - }); - - b1.OwnsOne("Api.Database.Models.Position", "Position", b2 => - { - b2.Property("PoseMissionTaskId") - .HasColumnType("text"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseMissionTaskId"); - - b2.ToTable("MissionTasks"); - - b2.WithOwner() - .HasForeignKey("PoseMissionTaskId"); - }); - - b1.Navigation("Orientation") - .IsRequired(); - - b1.Navigation("Position") - .IsRequired(); - }); - - b.Navigation("InspectionTarget") - .IsRequired(); - - b.Navigation("RobotPose") - .IsRequired(); - }); - - modelBuilder.Entity("Api.Database.Models.Plant", b => - { - b.HasOne("Api.Database.Models.Installation", "Installation") - .WithMany() - .HasForeignKey("InstallationId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - 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.Installation", "CurrentInstallation") - .WithMany() - .HasForeignKey("CurrentInstallationId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - 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("text"); - - b1.HasKey("RobotId"); - - b1.ToTable("Robots"); - - b1.WithOwner() - .HasForeignKey("RobotId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseRobotId") - .HasColumnType("text"); - - 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("text"); - - 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("text"); - - b1.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b1.Property("ShouldRotate270Clockwise") - .HasColumnType("boolean"); - - b1.Property("Type") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b1.Property("Url") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.HasKey("Id"); - - b1.HasIndex("RobotId"); - - b1.ToTable("VideoStream"); - - b1.WithOwner() - .HasForeignKey("RobotId"); - }); - - b.Navigation("CurrentArea"); - - b.Navigation("CurrentInstallation"); - - 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("text"); - - b1.HasKey("SafePositionId"); - - b1.ToTable("SafePositions"); - - b1.WithOwner() - .HasForeignKey("SafePositionId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseSafePositionId") - .HasColumnType("text"); - - 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("text"); - - 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"); - }); - - modelBuilder.Entity("Api.Database.Models.Inspection", b => - { - b.Navigation("InspectionFindings"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionRun", b => - { - b.Navigation("Tasks"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionTask", b => - { - b.Navigation("Inspections"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/backend/api/Migrations/20240112094731_AddRequiredFieldsToInspectionAndPoses.cs b/backend/api/Migrations/20240112094731_AddRequiredFieldsToInspectionAndPoses.cs deleted file mode 100644 index c051d4ba3..000000000 --- a/backend/api/Migrations/20240112094731_AddRequiredFieldsToInspectionAndPoses.cs +++ /dev/null @@ -1,94 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Api.Migrations -{ - /// - public partial class AddRequiredFieldsToInspectionAndPoses : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AlterColumn( - name: "IsarStepId", - table: "Inspections", - type: "character varying(200)", - maxLength: 200, - nullable: false, - defaultValue: "", - oldClrType: typeof(string), - oldType: "character varying(200)", - oldMaxLength: 200, - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "InspectionTarget_Z", - table: "Inspections", - type: "real", - nullable: true, - oldClrType: typeof(float), - oldType: "real"); - - migrationBuilder.AlterColumn( - name: "InspectionTarget_Y", - table: "Inspections", - type: "real", - nullable: true, - oldClrType: typeof(float), - oldType: "real"); - - migrationBuilder.AlterColumn( - name: "InspectionTarget_X", - table: "Inspections", - type: "real", - nullable: true, - oldClrType: typeof(float), - oldType: "real"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.AlterColumn( - name: "IsarStepId", - table: "Inspections", - type: "character varying(200)", - maxLength: 200, - nullable: true, - oldClrType: typeof(string), - oldType: "character varying(200)", - oldMaxLength: 200); - - migrationBuilder.AlterColumn( - name: "InspectionTarget_Z", - table: "Inspections", - type: "real", - nullable: false, - defaultValue: 0f, - oldClrType: typeof(float), - oldType: "real", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "InspectionTarget_Y", - table: "Inspections", - type: "real", - nullable: false, - defaultValue: 0f, - oldClrType: typeof(float), - oldType: "real", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "InspectionTarget_X", - table: "Inspections", - type: "real", - nullable: false, - defaultValue: 0f, - oldClrType: typeof(float), - oldType: "real", - oldNullable: true); - } - } -} diff --git a/backend/api/Migrations/20240126115524_MakeInspectionTargetOptional.Designer.cs b/backend/api/Migrations/20240126115524_MakeInspectionTargetOptional.Designer.cs deleted file mode 100644 index 4ee9af0bf..000000000 --- a/backend/api/Migrations/20240126115524_MakeInspectionTargetOptional.Designer.cs +++ /dev/null @@ -1,1368 +0,0 @@ -// -using System; -using Api.Database.Context; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace Api.Migrations -{ - [DbContext(typeof(FlotillaDbContext))] - [Migration("20240126115524_MakeInspectionTargetOptional")] - partial class MakeInspectionTargetOptional - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "8.0.0") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("Api.Database.Models.AccessRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AccessLevel") - .IsRequired() - .HasColumnType("text"); - - b.Property("InstallationId") - .HasColumnType("text"); - - b.Property("RoleName") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("InstallationId"); - - b.ToTable("AccessRoles"); - }); - - modelBuilder.Entity("Api.Database.Models.Area", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("DeckId") - .IsRequired() - .HasColumnType("text"); - - b.Property("DefaultLocalizationPoseId") - .HasColumnType("text"); - - b.Property("InstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PlantId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("DeckId"); - - b.HasIndex("DefaultLocalizationPoseId"); - - b.HasIndex("InstallationId"); - - b.HasIndex("PlantId"); - - b.ToTable("Areas"); - }); - - modelBuilder.Entity("Api.Database.Models.Deck", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("DefaultLocalizationPoseId") - .HasColumnType("text"); - - b.Property("InstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PlantId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("DefaultLocalizationPoseId"); - - b.HasIndex("InstallationId"); - - b.HasIndex("PlantId"); - - b.ToTable("Decks"); - }); - - modelBuilder.Entity("Api.Database.Models.DefaultLocalizationPose", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.ToTable("DefaultLocalizationPoses"); - }); - - modelBuilder.Entity("Api.Database.Models.Inspection", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AnalysisType") - .HasColumnType("text"); - - b.Property("EndTime") - .HasColumnType("timestamp with time zone"); - - b.Property("InspectionType") - .IsRequired() - .HasColumnType("text"); - - b.Property("InspectionUrl") - .HasMaxLength(250) - .HasColumnType("character varying(250)"); - - b.Property("IsarStepId") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionTaskId") - .HasColumnType("text"); - - b.Property("StartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("VideoDuration") - .HasColumnType("real"); - - b.HasKey("Id"); - - b.HasIndex("MissionTaskId"); - - b.ToTable("Inspections"); - }); - - modelBuilder.Entity("Api.Database.Models.InspectionFinding", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("Finding") - .IsRequired() - .HasColumnType("text"); - - b.Property("InspectionDate") - .HasColumnType("timestamp with time zone"); - - b.Property("InspectionId") - .HasColumnType("text"); - - b.Property("IsarStepId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("InspectionId"); - - b.ToTable("InspectionFindings"); - }); - - modelBuilder.Entity("Api.Database.Models.Installation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("InstallationCode") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.HasKey("Id"); - - b.HasIndex("InstallationCode") - .IsUnique(); - - b.ToTable("Installations"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionDefinition", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AreaId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Comment") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("InspectionFrequency") - .HasColumnType("bigint"); - - b.Property("InstallationCode") - .IsRequired() - .HasColumnType("text"); - - b.Property("IsDeprecated") - .HasColumnType("boolean"); - - b.Property("LastSuccessfulRunId") - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("SourceId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("AreaId"); - - b.HasIndex("LastSuccessfulRunId"); - - b.HasIndex("SourceId"); - - b.ToTable("MissionDefinitions"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionRun", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AreaId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Comment") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("Description") - .HasMaxLength(450) - .HasColumnType("character varying(450)"); - - b.Property("DesiredStartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("EndTime") - .HasColumnType("timestamp with time zone"); - - b.Property("EstimatedDuration") - .HasColumnType("bigint"); - - b.Property("InstallationCode") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("IsarMissionId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("MissionRunPriority") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("StartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("StatusReason") - .HasMaxLength(450) - .HasColumnType("character varying(450)"); - - b.HasKey("Id"); - - b.HasIndex("AreaId"); - - b.HasIndex("RobotId"); - - b.ToTable("MissionRuns"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionTask", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("EchoPoseId") - .HasColumnType("integer"); - - b.Property("EchoTagLink") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("EndTime") - .HasColumnType("timestamp with time zone"); - - b.Property("IsarTaskId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionRunId") - .HasColumnType("text"); - - b.Property("StartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("TagId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("TaskOrder") - .HasColumnType("integer"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("MissionRunId"); - - b.ToTable("MissionTasks"); - }); - - modelBuilder.Entity("Api.Database.Models.Plant", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("InstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PlantCode") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(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("text"); - - b.Property("BatteryLevel") - .HasColumnType("real"); - - b.Property("CurrentAreaId") - .HasColumnType("text"); - - b.Property("CurrentInstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("CurrentMissionId") - .HasColumnType("text"); - - b.Property("Enabled") - .HasColumnType("boolean"); - - b.Property("Host") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("IsarId") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionQueueFrozen") - .HasColumnType("boolean"); - - b.Property("ModelId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Port") - .HasColumnType("integer"); - - b.Property("PressureLevel") - .HasColumnType("real"); - - b.Property("SerialNumber") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("CurrentAreaId"); - - b.HasIndex("CurrentInstallationId"); - - b.HasIndex("ModelId"); - - b.ToTable("Robots"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotBatteryTimeseries", b => - { - b.Property("BatteryLevel") - .HasColumnType("real"); - - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Time") - .HasColumnType("timestamp with time zone"); - - b.ToTable("RobotBatteryTimeseries"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotModel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AverageDurationPerTag") - .HasColumnType("real"); - - b.Property("BatteryWarningThreshold") - .HasColumnType("real"); - - b.Property("LowerPressureWarningThreshold") - .HasColumnType("real"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - b.Property("UpperPressureWarningThreshold") - .HasColumnType("real"); - - b.HasKey("Id"); - - b.HasIndex("Type") - .IsUnique(); - - b.ToTable("RobotModels"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotPoseTimeseries", b => - { - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("OrientationW") - .HasColumnType("real"); - - b.Property("OrientationX") - .HasColumnType("real"); - - b.Property("OrientationY") - .HasColumnType("real"); - - b.Property("OrientationZ") - .HasColumnType("real"); - - b.Property("PositionX") - .HasColumnType("real"); - - b.Property("PositionY") - .HasColumnType("real"); - - b.Property("PositionZ") - .HasColumnType("real"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Time") - .HasColumnType("timestamp with time zone"); - - b.ToTable("RobotPoseTimeseries"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotPressureTimeseries", b => - { - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("Pressure") - .HasColumnType("real"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Time") - .HasColumnType("timestamp with time zone"); - - b.ToTable("RobotPressureTimeseries"); - }); - - modelBuilder.Entity("Api.Database.Models.SafePosition", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AreaId") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("AreaId"); - - b.ToTable("SafePositions"); - }); - - modelBuilder.Entity("Api.Database.Models.Source", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("SourceId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.ToTable("Sources"); - }); - - modelBuilder.Entity("Api.Database.Models.AccessRole", b => - { - b.HasOne("Api.Database.Models.Installation", "Installation") - .WithMany() - .HasForeignKey("InstallationId"); - - b.Navigation("Installation"); - }); - - 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.DefaultLocalizationPose", "DefaultLocalizationPose") - .WithMany() - .HasForeignKey("DefaultLocalizationPoseId"); - - 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.MapMetadata", "MapMetadata", b1 => - { - b1.Property("AreaId") - .HasColumnType("text"); - - b1.Property("MapName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.HasKey("AreaId"); - - b1.ToTable("Areas"); - - b1.WithOwner() - .HasForeignKey("AreaId"); - - b1.OwnsOne("Api.Database.Models.Boundary", "Boundary", b2 => - { - b2.Property("MapMetadataAreaId") - .HasColumnType("text"); - - b2.Property("X1") - .HasColumnType("double precision"); - - b2.Property("X2") - .HasColumnType("double precision"); - - b2.Property("Y1") - .HasColumnType("double precision"); - - b2.Property("Y2") - .HasColumnType("double precision"); - - b2.Property("Z1") - .HasColumnType("double precision"); - - b2.Property("Z2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataAreaId"); - - b2.ToTable("Areas"); - - b2.WithOwner() - .HasForeignKey("MapMetadataAreaId"); - }); - - b1.OwnsOne("Api.Database.Models.TransformationMatrices", "TransformationMatrices", b2 => - { - b2.Property("MapMetadataAreaId") - .HasColumnType("text"); - - b2.Property("C1") - .HasColumnType("double precision"); - - b2.Property("C2") - .HasColumnType("double precision"); - - b2.Property("D1") - .HasColumnType("double precision"); - - b2.Property("D2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataAreaId"); - - b2.ToTable("Areas"); - - b2.WithOwner() - .HasForeignKey("MapMetadataAreaId"); - }); - - b1.Navigation("Boundary") - .IsRequired(); - - b1.Navigation("TransformationMatrices") - .IsRequired(); - }); - - b.Navigation("Deck"); - - b.Navigation("DefaultLocalizationPose"); - - b.Navigation("Installation"); - - b.Navigation("MapMetadata") - .IsRequired(); - - b.Navigation("Plant"); - }); - - modelBuilder.Entity("Api.Database.Models.Deck", b => - { - b.HasOne("Api.Database.Models.DefaultLocalizationPose", "DefaultLocalizationPose") - .WithMany() - .HasForeignKey("DefaultLocalizationPoseId"); - - 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.Navigation("DefaultLocalizationPose"); - - b.Navigation("Installation"); - - b.Navigation("Plant"); - }); - - modelBuilder.Entity("Api.Database.Models.DefaultLocalizationPose", b => - { - b.OwnsOne("Api.Database.Models.Pose", "Pose", b1 => - { - b1.Property("DefaultLocalizationPoseId") - .HasColumnType("text"); - - b1.HasKey("DefaultLocalizationPoseId"); - - b1.ToTable("DefaultLocalizationPoses"); - - b1.WithOwner() - .HasForeignKey("DefaultLocalizationPoseId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseDefaultLocalizationPoseId") - .HasColumnType("text"); - - b2.Property("W") - .HasColumnType("real"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseDefaultLocalizationPoseId"); - - b2.ToTable("DefaultLocalizationPoses"); - - b2.WithOwner() - .HasForeignKey("PoseDefaultLocalizationPoseId"); - }); - - b1.OwnsOne("Api.Database.Models.Position", "Position", b2 => - { - b2.Property("PoseDefaultLocalizationPoseId") - .HasColumnType("text"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseDefaultLocalizationPoseId"); - - b2.ToTable("DefaultLocalizationPoses"); - - b2.WithOwner() - .HasForeignKey("PoseDefaultLocalizationPoseId"); - }); - - b1.Navigation("Orientation") - .IsRequired(); - - b1.Navigation("Position") - .IsRequired(); - }); - - b.Navigation("Pose") - .IsRequired(); - }); - - modelBuilder.Entity("Api.Database.Models.Inspection", b => - { - b.HasOne("Api.Database.Models.MissionTask", null) - .WithMany("Inspections") - .HasForeignKey("MissionTaskId"); - - b.OwnsOne("Api.Database.Models.Position", "InspectionTarget", b1 => - { - b1.Property("InspectionId") - .HasColumnType("text"); - - b1.Property("X") - .HasColumnType("real"); - - b1.Property("Y") - .HasColumnType("real"); - - b1.Property("Z") - .HasColumnType("real"); - - b1.HasKey("InspectionId"); - - b1.ToTable("Inspections"); - - b1.WithOwner() - .HasForeignKey("InspectionId"); - }); - - b.Navigation("InspectionTarget"); - }); - - modelBuilder.Entity("Api.Database.Models.InspectionFinding", b => - { - b.HasOne("Api.Database.Models.Inspection", null) - .WithMany("InspectionFindings") - .HasForeignKey("InspectionId"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionDefinition", b => - { - b.HasOne("Api.Database.Models.Area", "Area") - .WithMany() - .HasForeignKey("AreaId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Api.Database.Models.MissionRun", "LastSuccessfulRun") - .WithMany() - .HasForeignKey("LastSuccessfulRunId"); - - b.HasOne("Api.Database.Models.Source", "Source") - .WithMany() - .HasForeignKey("SourceId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Area"); - - b.Navigation("LastSuccessfulRun"); - - b.Navigation("Source"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionRun", b => - { - b.HasOne("Api.Database.Models.Area", "Area") - .WithMany() - .HasForeignKey("AreaId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Api.Database.Models.Robot", "Robot") - .WithMany() - .HasForeignKey("RobotId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.OwnsOne("Api.Database.Models.MapMetadata", "Map", b1 => - { - b1.Property("MissionRunId") - .HasColumnType("text"); - - b1.Property("MapName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.HasKey("MissionRunId"); - - b1.ToTable("MissionRuns"); - - b1.WithOwner() - .HasForeignKey("MissionRunId"); - - b1.OwnsOne("Api.Database.Models.Boundary", "Boundary", b2 => - { - b2.Property("MapMetadataMissionRunId") - .HasColumnType("text"); - - b2.Property("X1") - .HasColumnType("double precision"); - - b2.Property("X2") - .HasColumnType("double precision"); - - b2.Property("Y1") - .HasColumnType("double precision"); - - b2.Property("Y2") - .HasColumnType("double precision"); - - b2.Property("Z1") - .HasColumnType("double precision"); - - b2.Property("Z2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataMissionRunId"); - - b2.ToTable("MissionRuns"); - - b2.WithOwner() - .HasForeignKey("MapMetadataMissionRunId"); - }); - - b1.OwnsOne("Api.Database.Models.TransformationMatrices", "TransformationMatrices", b2 => - { - b2.Property("MapMetadataMissionRunId") - .HasColumnType("text"); - - b2.Property("C1") - .HasColumnType("double precision"); - - b2.Property("C2") - .HasColumnType("double precision"); - - b2.Property("D1") - .HasColumnType("double precision"); - - b2.Property("D2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataMissionRunId"); - - b2.ToTable("MissionRuns"); - - b2.WithOwner() - .HasForeignKey("MapMetadataMissionRunId"); - }); - - b1.Navigation("Boundary") - .IsRequired(); - - b1.Navigation("TransformationMatrices") - .IsRequired(); - }); - - b.Navigation("Area"); - - b.Navigation("Map"); - - b.Navigation("Robot"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionTask", b => - { - b.HasOne("Api.Database.Models.MissionRun", null) - .WithMany("Tasks") - .HasForeignKey("MissionRunId"); - - b.OwnsOne("Api.Database.Models.Position", "InspectionTarget", b1 => - { - b1.Property("MissionTaskId") - .HasColumnType("text"); - - b1.Property("X") - .HasColumnType("real"); - - b1.Property("Y") - .HasColumnType("real"); - - b1.Property("Z") - .HasColumnType("real"); - - b1.HasKey("MissionTaskId"); - - b1.ToTable("MissionTasks"); - - b1.WithOwner() - .HasForeignKey("MissionTaskId"); - }); - - b.OwnsOne("Api.Database.Models.Pose", "RobotPose", b1 => - { - b1.Property("MissionTaskId") - .HasColumnType("text"); - - b1.HasKey("MissionTaskId"); - - b1.ToTable("MissionTasks"); - - b1.WithOwner() - .HasForeignKey("MissionTaskId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseMissionTaskId") - .HasColumnType("text"); - - b2.Property("W") - .HasColumnType("real"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseMissionTaskId"); - - b2.ToTable("MissionTasks"); - - b2.WithOwner() - .HasForeignKey("PoseMissionTaskId"); - }); - - b1.OwnsOne("Api.Database.Models.Position", "Position", b2 => - { - b2.Property("PoseMissionTaskId") - .HasColumnType("text"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseMissionTaskId"); - - b2.ToTable("MissionTasks"); - - b2.WithOwner() - .HasForeignKey("PoseMissionTaskId"); - }); - - b1.Navigation("Orientation") - .IsRequired(); - - b1.Navigation("Position") - .IsRequired(); - }); - - b.Navigation("InspectionTarget"); - - b.Navigation("RobotPose") - .IsRequired(); - }); - - modelBuilder.Entity("Api.Database.Models.Plant", b => - { - b.HasOne("Api.Database.Models.Installation", "Installation") - .WithMany() - .HasForeignKey("InstallationId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - 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.Installation", "CurrentInstallation") - .WithMany() - .HasForeignKey("CurrentInstallationId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - 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("text"); - - b1.HasKey("RobotId"); - - b1.ToTable("Robots"); - - b1.WithOwner() - .HasForeignKey("RobotId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseRobotId") - .HasColumnType("text"); - - 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("text"); - - 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("text"); - - b1.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b1.Property("ShouldRotate270Clockwise") - .HasColumnType("boolean"); - - b1.Property("Type") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b1.Property("Url") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.HasKey("Id"); - - b1.HasIndex("RobotId"); - - b1.ToTable("VideoStream"); - - b1.WithOwner() - .HasForeignKey("RobotId"); - }); - - b.Navigation("CurrentArea"); - - b.Navigation("CurrentInstallation"); - - 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("text"); - - b1.HasKey("SafePositionId"); - - b1.ToTable("SafePositions"); - - b1.WithOwner() - .HasForeignKey("SafePositionId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseSafePositionId") - .HasColumnType("text"); - - 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("text"); - - 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"); - }); - - modelBuilder.Entity("Api.Database.Models.Inspection", b => - { - b.Navigation("InspectionFindings"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionRun", b => - { - b.Navigation("Tasks"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionTask", b => - { - b.Navigation("Inspections"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/backend/api/Migrations/20240126115524_MakeInspectionTargetOptional.cs b/backend/api/Migrations/20240126115524_MakeInspectionTargetOptional.cs deleted file mode 100644 index c2c44e500..000000000 --- a/backend/api/Migrations/20240126115524_MakeInspectionTargetOptional.cs +++ /dev/null @@ -1,72 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Api.Migrations -{ - /// - public partial class MakeInspectionTargetOptional : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AlterColumn( - name: "InspectionTarget_Z", - table: "MissionTasks", - type: "real", - nullable: true, - oldClrType: typeof(float), - oldType: "real"); - - migrationBuilder.AlterColumn( - name: "InspectionTarget_Y", - table: "MissionTasks", - type: "real", - nullable: true, - oldClrType: typeof(float), - oldType: "real"); - - migrationBuilder.AlterColumn( - name: "InspectionTarget_X", - table: "MissionTasks", - type: "real", - nullable: true, - oldClrType: typeof(float), - oldType: "real"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.AlterColumn( - name: "InspectionTarget_Z", - table: "MissionTasks", - type: "real", - nullable: false, - defaultValue: 0f, - oldClrType: typeof(float), - oldType: "real", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "InspectionTarget_Y", - table: "MissionTasks", - type: "real", - nullable: false, - defaultValue: 0f, - oldClrType: typeof(float), - oldType: "real", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "InspectionTarget_X", - table: "MissionTasks", - type: "real", - nullable: false, - defaultValue: 0f, - oldClrType: typeof(float), - oldType: "real", - oldNullable: true); - } - } -} diff --git a/backend/api/Migrations/20240129130002_AddMissionRunCounter.Designer.cs b/backend/api/Migrations/20240129130002_AddMissionRunCounter.Designer.cs deleted file mode 100644 index da1308201..000000000 --- a/backend/api/Migrations/20240129130002_AddMissionRunCounter.Designer.cs +++ /dev/null @@ -1,1372 +0,0 @@ -// -using System; -using Api.Database.Context; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace Api.Migrations -{ - [DbContext(typeof(FlotillaDbContext))] - [Migration("20240129130002_AddMissionRunCounter")] - partial class AddMissionRunCounter - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "8.0.0") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("Api.Database.Models.AccessRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AccessLevel") - .IsRequired() - .HasColumnType("text"); - - b.Property("InstallationId") - .HasColumnType("text"); - - b.Property("RoleName") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("InstallationId"); - - b.ToTable("AccessRoles"); - }); - - modelBuilder.Entity("Api.Database.Models.Area", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("DeckId") - .IsRequired() - .HasColumnType("text"); - - b.Property("DefaultLocalizationPoseId") - .HasColumnType("text"); - - b.Property("InstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PlantId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("DeckId"); - - b.HasIndex("DefaultLocalizationPoseId"); - - b.HasIndex("InstallationId"); - - b.HasIndex("PlantId"); - - b.ToTable("Areas"); - }); - - modelBuilder.Entity("Api.Database.Models.Deck", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("DefaultLocalizationPoseId") - .HasColumnType("text"); - - b.Property("InstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PlantId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("DefaultLocalizationPoseId"); - - b.HasIndex("InstallationId"); - - b.HasIndex("PlantId"); - - b.ToTable("Decks"); - }); - - modelBuilder.Entity("Api.Database.Models.DefaultLocalizationPose", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.ToTable("DefaultLocalizationPoses"); - }); - - modelBuilder.Entity("Api.Database.Models.Inspection", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AnalysisType") - .HasColumnType("text"); - - b.Property("EndTime") - .HasColumnType("timestamp with time zone"); - - b.Property("InspectionType") - .IsRequired() - .HasColumnType("text"); - - b.Property("InspectionUrl") - .HasMaxLength(250) - .HasColumnType("character varying(250)"); - - b.Property("IsarStepId") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionTaskId") - .HasColumnType("text"); - - b.Property("StartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("VideoDuration") - .HasColumnType("real"); - - b.HasKey("Id"); - - b.HasIndex("MissionTaskId"); - - b.ToTable("Inspections"); - }); - - modelBuilder.Entity("Api.Database.Models.InspectionFinding", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("Finding") - .IsRequired() - .HasColumnType("text"); - - b.Property("InspectionDate") - .HasColumnType("timestamp with time zone"); - - b.Property("InspectionId") - .HasColumnType("text"); - - b.Property("IsarStepId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("InspectionId"); - - b.ToTable("InspectionFindings"); - }); - - modelBuilder.Entity("Api.Database.Models.Installation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("InstallationCode") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.HasKey("Id"); - - b.HasIndex("InstallationCode") - .IsUnique(); - - b.ToTable("Installations"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionDefinition", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AreaId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Comment") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("InspectionFrequency") - .HasColumnType("bigint"); - - b.Property("InstallationCode") - .IsRequired() - .HasColumnType("text"); - - b.Property("IsDeprecated") - .HasColumnType("boolean"); - - b.Property("LastSuccessfulRunId") - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("SourceId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("AreaId"); - - b.HasIndex("LastSuccessfulRunId"); - - b.HasIndex("SourceId"); - - b.ToTable("MissionDefinitions"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionRun", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AreaId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Comment") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("Description") - .HasMaxLength(450) - .HasColumnType("character varying(450)"); - - b.Property("DesiredStartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("EndTime") - .HasColumnType("timestamp with time zone"); - - b.Property("EstimatedDuration") - .HasColumnType("bigint"); - - b.Property("InstallationCode") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("IsarMissionId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("MissionRunCount") - .HasColumnType("integer"); - - b.Property("MissionRunPriority") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("StartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("StatusReason") - .HasMaxLength(450) - .HasColumnType("character varying(450)"); - - b.HasKey("Id"); - - b.HasIndex("AreaId"); - - b.HasIndex("RobotId"); - - b.ToTable("MissionRuns"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionTask", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("EchoPoseId") - .HasColumnType("integer"); - - b.Property("EchoTagLink") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("EndTime") - .HasColumnType("timestamp with time zone"); - - b.Property("IsarTaskId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionRunId") - .HasColumnType("text"); - - b.Property("StartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("TagId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("TaskOrder") - .HasColumnType("integer"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("MissionRunId"); - - b.ToTable("MissionTasks"); - }); - - modelBuilder.Entity("Api.Database.Models.Plant", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("InstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PlantCode") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(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("text"); - - b.Property("BatteryLevel") - .HasColumnType("real"); - - b.Property("CurrentAreaId") - .HasColumnType("text"); - - b.Property("CurrentInstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("CurrentMissionId") - .HasColumnType("text"); - - b.Property("Enabled") - .HasColumnType("boolean"); - - b.Property("Host") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("IsarId") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionQueueFrozen") - .HasColumnType("boolean"); - - b.Property("ModelId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Port") - .HasColumnType("integer"); - - b.Property("PressureLevel") - .HasColumnType("real"); - - b.Property("SerialNumber") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("CurrentAreaId"); - - b.HasIndex("CurrentInstallationId"); - - b.HasIndex("ModelId"); - - b.ToTable("Robots"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotBatteryTimeseries", b => - { - b.Property("BatteryLevel") - .HasColumnType("real"); - - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Time") - .HasColumnType("timestamp with time zone"); - - b.ToTable("RobotBatteryTimeseries"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotModel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AverageDurationPerTag") - .HasColumnType("real"); - - b.Property("BatteryWarningThreshold") - .HasColumnType("real"); - - b.Property("LowerPressureWarningThreshold") - .HasColumnType("real"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - b.Property("UpperPressureWarningThreshold") - .HasColumnType("real"); - - b.HasKey("Id"); - - b.HasIndex("Type") - .IsUnique(); - - b.ToTable("RobotModels"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotPoseTimeseries", b => - { - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("OrientationW") - .HasColumnType("real"); - - b.Property("OrientationX") - .HasColumnType("real"); - - b.Property("OrientationY") - .HasColumnType("real"); - - b.Property("OrientationZ") - .HasColumnType("real"); - - b.Property("PositionX") - .HasColumnType("real"); - - b.Property("PositionY") - .HasColumnType("real"); - - b.Property("PositionZ") - .HasColumnType("real"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Time") - .HasColumnType("timestamp with time zone"); - - b.ToTable("RobotPoseTimeseries"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotPressureTimeseries", b => - { - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("Pressure") - .HasColumnType("real"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Time") - .HasColumnType("timestamp with time zone"); - - b.ToTable("RobotPressureTimeseries"); - }); - - modelBuilder.Entity("Api.Database.Models.SafePosition", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AreaId") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("AreaId"); - - b.ToTable("SafePositions"); - }); - - modelBuilder.Entity("Api.Database.Models.Source", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("SourceId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.ToTable("Sources"); - }); - - modelBuilder.Entity("Api.Database.Models.AccessRole", b => - { - b.HasOne("Api.Database.Models.Installation", "Installation") - .WithMany() - .HasForeignKey("InstallationId"); - - b.Navigation("Installation"); - }); - - 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.DefaultLocalizationPose", "DefaultLocalizationPose") - .WithMany() - .HasForeignKey("DefaultLocalizationPoseId"); - - 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.MapMetadata", "MapMetadata", b1 => - { - b1.Property("AreaId") - .HasColumnType("text"); - - b1.Property("MapName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.HasKey("AreaId"); - - b1.ToTable("Areas"); - - b1.WithOwner() - .HasForeignKey("AreaId"); - - b1.OwnsOne("Api.Database.Models.Boundary", "Boundary", b2 => - { - b2.Property("MapMetadataAreaId") - .HasColumnType("text"); - - b2.Property("X1") - .HasColumnType("double precision"); - - b2.Property("X2") - .HasColumnType("double precision"); - - b2.Property("Y1") - .HasColumnType("double precision"); - - b2.Property("Y2") - .HasColumnType("double precision"); - - b2.Property("Z1") - .HasColumnType("double precision"); - - b2.Property("Z2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataAreaId"); - - b2.ToTable("Areas"); - - b2.WithOwner() - .HasForeignKey("MapMetadataAreaId"); - }); - - b1.OwnsOne("Api.Database.Models.TransformationMatrices", "TransformationMatrices", b2 => - { - b2.Property("MapMetadataAreaId") - .HasColumnType("text"); - - b2.Property("C1") - .HasColumnType("double precision"); - - b2.Property("C2") - .HasColumnType("double precision"); - - b2.Property("D1") - .HasColumnType("double precision"); - - b2.Property("D2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataAreaId"); - - b2.ToTable("Areas"); - - b2.WithOwner() - .HasForeignKey("MapMetadataAreaId"); - }); - - b1.Navigation("Boundary") - .IsRequired(); - - b1.Navigation("TransformationMatrices") - .IsRequired(); - }); - - b.Navigation("Deck"); - - b.Navigation("DefaultLocalizationPose"); - - b.Navigation("Installation"); - - b.Navigation("MapMetadata") - .IsRequired(); - - b.Navigation("Plant"); - }); - - modelBuilder.Entity("Api.Database.Models.Deck", b => - { - b.HasOne("Api.Database.Models.DefaultLocalizationPose", "DefaultLocalizationPose") - .WithMany() - .HasForeignKey("DefaultLocalizationPoseId"); - - 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.Navigation("DefaultLocalizationPose"); - - b.Navigation("Installation"); - - b.Navigation("Plant"); - }); - - modelBuilder.Entity("Api.Database.Models.DefaultLocalizationPose", b => - { - b.OwnsOne("Api.Database.Models.Pose", "Pose", b1 => - { - b1.Property("DefaultLocalizationPoseId") - .HasColumnType("text"); - - b1.HasKey("DefaultLocalizationPoseId"); - - b1.ToTable("DefaultLocalizationPoses"); - - b1.WithOwner() - .HasForeignKey("DefaultLocalizationPoseId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseDefaultLocalizationPoseId") - .HasColumnType("text"); - - b2.Property("W") - .HasColumnType("real"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseDefaultLocalizationPoseId"); - - b2.ToTable("DefaultLocalizationPoses"); - - b2.WithOwner() - .HasForeignKey("PoseDefaultLocalizationPoseId"); - }); - - b1.OwnsOne("Api.Database.Models.Position", "Position", b2 => - { - b2.Property("PoseDefaultLocalizationPoseId") - .HasColumnType("text"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseDefaultLocalizationPoseId"); - - b2.ToTable("DefaultLocalizationPoses"); - - b2.WithOwner() - .HasForeignKey("PoseDefaultLocalizationPoseId"); - }); - - b1.Navigation("Orientation") - .IsRequired(); - - b1.Navigation("Position") - .IsRequired(); - }); - - b.Navigation("Pose") - .IsRequired(); - }); - - modelBuilder.Entity("Api.Database.Models.Inspection", b => - { - b.HasOne("Api.Database.Models.MissionTask", null) - .WithMany("Inspections") - .HasForeignKey("MissionTaskId"); - - b.OwnsOne("Api.Database.Models.Position", "InspectionTarget", b1 => - { - b1.Property("InspectionId") - .HasColumnType("text"); - - b1.Property("X") - .HasColumnType("real"); - - b1.Property("Y") - .HasColumnType("real"); - - b1.Property("Z") - .HasColumnType("real"); - - b1.HasKey("InspectionId"); - - b1.ToTable("Inspections"); - - b1.WithOwner() - .HasForeignKey("InspectionId"); - }); - - b.Navigation("InspectionTarget"); - }); - - modelBuilder.Entity("Api.Database.Models.InspectionFinding", b => - { - b.HasOne("Api.Database.Models.Inspection", null) - .WithMany("InspectionFindings") - .HasForeignKey("InspectionId"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionDefinition", b => - { - b.HasOne("Api.Database.Models.Area", "Area") - .WithMany() - .HasForeignKey("AreaId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Api.Database.Models.MissionRun", "LastSuccessfulRun") - .WithMany() - .HasForeignKey("LastSuccessfulRunId"); - - b.HasOne("Api.Database.Models.Source", "Source") - .WithMany() - .HasForeignKey("SourceId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Area"); - - b.Navigation("LastSuccessfulRun"); - - b.Navigation("Source"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionRun", b => - { - b.HasOne("Api.Database.Models.Area", "Area") - .WithMany() - .HasForeignKey("AreaId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Api.Database.Models.Robot", "Robot") - .WithMany() - .HasForeignKey("RobotId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.OwnsOne("Api.Database.Models.MapMetadata", "Map", b1 => - { - b1.Property("MissionRunId") - .HasColumnType("text"); - - b1.Property("MapName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.HasKey("MissionRunId"); - - b1.ToTable("MissionRuns"); - - b1.WithOwner() - .HasForeignKey("MissionRunId"); - - b1.OwnsOne("Api.Database.Models.Boundary", "Boundary", b2 => - { - b2.Property("MapMetadataMissionRunId") - .HasColumnType("text"); - - b2.Property("X1") - .HasColumnType("double precision"); - - b2.Property("X2") - .HasColumnType("double precision"); - - b2.Property("Y1") - .HasColumnType("double precision"); - - b2.Property("Y2") - .HasColumnType("double precision"); - - b2.Property("Z1") - .HasColumnType("double precision"); - - b2.Property("Z2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataMissionRunId"); - - b2.ToTable("MissionRuns"); - - b2.WithOwner() - .HasForeignKey("MapMetadataMissionRunId"); - }); - - b1.OwnsOne("Api.Database.Models.TransformationMatrices", "TransformationMatrices", b2 => - { - b2.Property("MapMetadataMissionRunId") - .HasColumnType("text"); - - b2.Property("C1") - .HasColumnType("double precision"); - - b2.Property("C2") - .HasColumnType("double precision"); - - b2.Property("D1") - .HasColumnType("double precision"); - - b2.Property("D2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataMissionRunId"); - - b2.ToTable("MissionRuns"); - - b2.WithOwner() - .HasForeignKey("MapMetadataMissionRunId"); - }); - - b1.Navigation("Boundary") - .IsRequired(); - - b1.Navigation("TransformationMatrices") - .IsRequired(); - }); - - b.Navigation("Area"); - - b.Navigation("Map"); - - b.Navigation("Robot"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionTask", b => - { - b.HasOne("Api.Database.Models.MissionRun", null) - .WithMany("Tasks") - .HasForeignKey("MissionRunId"); - - b.OwnsOne("Api.Database.Models.Position", "InspectionTarget", b1 => - { - b1.Property("MissionTaskId") - .HasColumnType("text"); - - b1.Property("X") - .HasColumnType("real"); - - b1.Property("Y") - .HasColumnType("real"); - - b1.Property("Z") - .HasColumnType("real"); - - b1.HasKey("MissionTaskId"); - - b1.ToTable("MissionTasks"); - - b1.WithOwner() - .HasForeignKey("MissionTaskId"); - }); - - b.OwnsOne("Api.Database.Models.Pose", "RobotPose", b1 => - { - b1.Property("MissionTaskId") - .HasColumnType("text"); - - b1.HasKey("MissionTaskId"); - - b1.ToTable("MissionTasks"); - - b1.WithOwner() - .HasForeignKey("MissionTaskId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseMissionTaskId") - .HasColumnType("text"); - - b2.Property("W") - .HasColumnType("real"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseMissionTaskId"); - - b2.ToTable("MissionTasks"); - - b2.WithOwner() - .HasForeignKey("PoseMissionTaskId"); - }); - - b1.OwnsOne("Api.Database.Models.Position", "Position", b2 => - { - b2.Property("PoseMissionTaskId") - .HasColumnType("text"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseMissionTaskId"); - - b2.ToTable("MissionTasks"); - - b2.WithOwner() - .HasForeignKey("PoseMissionTaskId"); - }); - - b1.Navigation("Orientation") - .IsRequired(); - - b1.Navigation("Position") - .IsRequired(); - }); - - b.Navigation("InspectionTarget") - .IsRequired(); - - b.Navigation("RobotPose") - .IsRequired(); - }); - - modelBuilder.Entity("Api.Database.Models.Plant", b => - { - b.HasOne("Api.Database.Models.Installation", "Installation") - .WithMany() - .HasForeignKey("InstallationId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - 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.Installation", "CurrentInstallation") - .WithMany() - .HasForeignKey("CurrentInstallationId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - 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("text"); - - b1.HasKey("RobotId"); - - b1.ToTable("Robots"); - - b1.WithOwner() - .HasForeignKey("RobotId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseRobotId") - .HasColumnType("text"); - - 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("text"); - - 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("text"); - - b1.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b1.Property("ShouldRotate270Clockwise") - .HasColumnType("boolean"); - - b1.Property("Type") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b1.Property("Url") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.HasKey("Id"); - - b1.HasIndex("RobotId"); - - b1.ToTable("VideoStream"); - - b1.WithOwner() - .HasForeignKey("RobotId"); - }); - - b.Navigation("CurrentArea"); - - b.Navigation("CurrentInstallation"); - - 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("text"); - - b1.HasKey("SafePositionId"); - - b1.ToTable("SafePositions"); - - b1.WithOwner() - .HasForeignKey("SafePositionId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseSafePositionId") - .HasColumnType("text"); - - 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("text"); - - 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"); - }); - - modelBuilder.Entity("Api.Database.Models.Inspection", b => - { - b.Navigation("InspectionFindings"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionRun", b => - { - b.Navigation("Tasks"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionTask", b => - { - b.Navigation("Inspections"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/backend/api/Migrations/20240129130002_AddMissionRunCounter.cs b/backend/api/Migrations/20240129130002_AddMissionRunCounter.cs deleted file mode 100644 index 73c67d983..000000000 --- a/backend/api/Migrations/20240129130002_AddMissionRunCounter.cs +++ /dev/null @@ -1,29 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Api.Migrations -{ - /// - public partial class AddMissionRunCounter : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "MissionRunCount", - table: "MissionRuns", - type: "integer", - nullable: false, - defaultValue: 0); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "MissionRunCount", - table: "MissionRuns"); - } - } -} diff --git a/backend/api/Migrations/20240129154746_MakeInspectionTargetRequired.Designer.cs b/backend/api/Migrations/20240129154746_MakeInspectionTargetRequired.Designer.cs deleted file mode 100644 index f781cbd17..000000000 --- a/backend/api/Migrations/20240129154746_MakeInspectionTargetRequired.Designer.cs +++ /dev/null @@ -1,1370 +0,0 @@ -// -using System; -using Api.Database.Context; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace Api.Migrations -{ - [DbContext(typeof(FlotillaDbContext))] - [Migration("20240129154746_MakeInspectionTargetRequired")] - partial class MakeInspectionTargetRequired - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "8.0.0") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("Api.Database.Models.AccessRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AccessLevel") - .IsRequired() - .HasColumnType("text"); - - b.Property("InstallationId") - .HasColumnType("text"); - - b.Property("RoleName") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("InstallationId"); - - b.ToTable("AccessRoles"); - }); - - modelBuilder.Entity("Api.Database.Models.Area", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("DeckId") - .IsRequired() - .HasColumnType("text"); - - b.Property("DefaultLocalizationPoseId") - .HasColumnType("text"); - - b.Property("InstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PlantId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("DeckId"); - - b.HasIndex("DefaultLocalizationPoseId"); - - b.HasIndex("InstallationId"); - - b.HasIndex("PlantId"); - - b.ToTable("Areas"); - }); - - modelBuilder.Entity("Api.Database.Models.Deck", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("DefaultLocalizationPoseId") - .HasColumnType("text"); - - b.Property("InstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PlantId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("DefaultLocalizationPoseId"); - - b.HasIndex("InstallationId"); - - b.HasIndex("PlantId"); - - b.ToTable("Decks"); - }); - - modelBuilder.Entity("Api.Database.Models.DefaultLocalizationPose", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.ToTable("DefaultLocalizationPoses"); - }); - - modelBuilder.Entity("Api.Database.Models.Inspection", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AnalysisType") - .HasColumnType("text"); - - b.Property("EndTime") - .HasColumnType("timestamp with time zone"); - - b.Property("InspectionType") - .IsRequired() - .HasColumnType("text"); - - b.Property("InspectionUrl") - .HasMaxLength(250) - .HasColumnType("character varying(250)"); - - b.Property("IsarStepId") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionTaskId") - .HasColumnType("text"); - - b.Property("StartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("VideoDuration") - .HasColumnType("real"); - - b.HasKey("Id"); - - b.HasIndex("MissionTaskId"); - - b.ToTable("Inspections"); - }); - - modelBuilder.Entity("Api.Database.Models.InspectionFinding", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("Finding") - .IsRequired() - .HasColumnType("text"); - - b.Property("InspectionDate") - .HasColumnType("timestamp with time zone"); - - b.Property("InspectionId") - .HasColumnType("text"); - - b.Property("IsarStepId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("InspectionId"); - - b.ToTable("InspectionFindings"); - }); - - modelBuilder.Entity("Api.Database.Models.Installation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("InstallationCode") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.HasKey("Id"); - - b.HasIndex("InstallationCode") - .IsUnique(); - - b.ToTable("Installations"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionDefinition", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AreaId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Comment") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("InspectionFrequency") - .HasColumnType("bigint"); - - b.Property("InstallationCode") - .IsRequired() - .HasColumnType("text"); - - b.Property("IsDeprecated") - .HasColumnType("boolean"); - - b.Property("LastSuccessfulRunId") - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("SourceId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("AreaId"); - - b.HasIndex("LastSuccessfulRunId"); - - b.HasIndex("SourceId"); - - b.ToTable("MissionDefinitions"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionRun", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AreaId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Comment") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("Description") - .HasMaxLength(450) - .HasColumnType("character varying(450)"); - - b.Property("DesiredStartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("EndTime") - .HasColumnType("timestamp with time zone"); - - b.Property("EstimatedDuration") - .HasColumnType("bigint"); - - b.Property("InstallationCode") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("IsarMissionId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("MissionRunPriority") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("StartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("StatusReason") - .HasMaxLength(450) - .HasColumnType("character varying(450)"); - - b.HasKey("Id"); - - b.HasIndex("AreaId"); - - b.HasIndex("RobotId"); - - b.ToTable("MissionRuns"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionTask", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("EchoPoseId") - .HasColumnType("integer"); - - b.Property("EchoTagLink") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("EndTime") - .HasColumnType("timestamp with time zone"); - - b.Property("IsarTaskId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionRunId") - .HasColumnType("text"); - - b.Property("StartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("TagId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("TaskOrder") - .HasColumnType("integer"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("MissionRunId"); - - b.ToTable("MissionTasks"); - }); - - modelBuilder.Entity("Api.Database.Models.Plant", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("InstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PlantCode") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(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("text"); - - b.Property("BatteryLevel") - .HasColumnType("real"); - - b.Property("CurrentAreaId") - .HasColumnType("text"); - - b.Property("CurrentInstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("CurrentMissionId") - .HasColumnType("text"); - - b.Property("Enabled") - .HasColumnType("boolean"); - - b.Property("Host") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("IsarId") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionQueueFrozen") - .HasColumnType("boolean"); - - b.Property("ModelId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Port") - .HasColumnType("integer"); - - b.Property("PressureLevel") - .HasColumnType("real"); - - b.Property("SerialNumber") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("CurrentAreaId"); - - b.HasIndex("CurrentInstallationId"); - - b.HasIndex("ModelId"); - - b.ToTable("Robots"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotBatteryTimeseries", b => - { - b.Property("BatteryLevel") - .HasColumnType("real"); - - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Time") - .HasColumnType("timestamp with time zone"); - - b.ToTable("RobotBatteryTimeseries"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotModel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AverageDurationPerTag") - .HasColumnType("real"); - - b.Property("BatteryWarningThreshold") - .HasColumnType("real"); - - b.Property("LowerPressureWarningThreshold") - .HasColumnType("real"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - b.Property("UpperPressureWarningThreshold") - .HasColumnType("real"); - - b.HasKey("Id"); - - b.HasIndex("Type") - .IsUnique(); - - b.ToTable("RobotModels"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotPoseTimeseries", b => - { - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("OrientationW") - .HasColumnType("real"); - - b.Property("OrientationX") - .HasColumnType("real"); - - b.Property("OrientationY") - .HasColumnType("real"); - - b.Property("OrientationZ") - .HasColumnType("real"); - - b.Property("PositionX") - .HasColumnType("real"); - - b.Property("PositionY") - .HasColumnType("real"); - - b.Property("PositionZ") - .HasColumnType("real"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Time") - .HasColumnType("timestamp with time zone"); - - b.ToTable("RobotPoseTimeseries"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotPressureTimeseries", b => - { - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("Pressure") - .HasColumnType("real"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Time") - .HasColumnType("timestamp with time zone"); - - b.ToTable("RobotPressureTimeseries"); - }); - - modelBuilder.Entity("Api.Database.Models.SafePosition", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AreaId") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("AreaId"); - - b.ToTable("SafePositions"); - }); - - modelBuilder.Entity("Api.Database.Models.Source", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("SourceId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.ToTable("Sources"); - }); - - modelBuilder.Entity("Api.Database.Models.AccessRole", b => - { - b.HasOne("Api.Database.Models.Installation", "Installation") - .WithMany() - .HasForeignKey("InstallationId"); - - b.Navigation("Installation"); - }); - - 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.DefaultLocalizationPose", "DefaultLocalizationPose") - .WithMany() - .HasForeignKey("DefaultLocalizationPoseId"); - - 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.MapMetadata", "MapMetadata", b1 => - { - b1.Property("AreaId") - .HasColumnType("text"); - - b1.Property("MapName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.HasKey("AreaId"); - - b1.ToTable("Areas"); - - b1.WithOwner() - .HasForeignKey("AreaId"); - - b1.OwnsOne("Api.Database.Models.Boundary", "Boundary", b2 => - { - b2.Property("MapMetadataAreaId") - .HasColumnType("text"); - - b2.Property("X1") - .HasColumnType("double precision"); - - b2.Property("X2") - .HasColumnType("double precision"); - - b2.Property("Y1") - .HasColumnType("double precision"); - - b2.Property("Y2") - .HasColumnType("double precision"); - - b2.Property("Z1") - .HasColumnType("double precision"); - - b2.Property("Z2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataAreaId"); - - b2.ToTable("Areas"); - - b2.WithOwner() - .HasForeignKey("MapMetadataAreaId"); - }); - - b1.OwnsOne("Api.Database.Models.TransformationMatrices", "TransformationMatrices", b2 => - { - b2.Property("MapMetadataAreaId") - .HasColumnType("text"); - - b2.Property("C1") - .HasColumnType("double precision"); - - b2.Property("C2") - .HasColumnType("double precision"); - - b2.Property("D1") - .HasColumnType("double precision"); - - b2.Property("D2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataAreaId"); - - b2.ToTable("Areas"); - - b2.WithOwner() - .HasForeignKey("MapMetadataAreaId"); - }); - - b1.Navigation("Boundary") - .IsRequired(); - - b1.Navigation("TransformationMatrices") - .IsRequired(); - }); - - b.Navigation("Deck"); - - b.Navigation("DefaultLocalizationPose"); - - b.Navigation("Installation"); - - b.Navigation("MapMetadata") - .IsRequired(); - - b.Navigation("Plant"); - }); - - modelBuilder.Entity("Api.Database.Models.Deck", b => - { - b.HasOne("Api.Database.Models.DefaultLocalizationPose", "DefaultLocalizationPose") - .WithMany() - .HasForeignKey("DefaultLocalizationPoseId"); - - 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.Navigation("DefaultLocalizationPose"); - - b.Navigation("Installation"); - - b.Navigation("Plant"); - }); - - modelBuilder.Entity("Api.Database.Models.DefaultLocalizationPose", b => - { - b.OwnsOne("Api.Database.Models.Pose", "Pose", b1 => - { - b1.Property("DefaultLocalizationPoseId") - .HasColumnType("text"); - - b1.HasKey("DefaultLocalizationPoseId"); - - b1.ToTable("DefaultLocalizationPoses"); - - b1.WithOwner() - .HasForeignKey("DefaultLocalizationPoseId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseDefaultLocalizationPoseId") - .HasColumnType("text"); - - b2.Property("W") - .HasColumnType("real"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseDefaultLocalizationPoseId"); - - b2.ToTable("DefaultLocalizationPoses"); - - b2.WithOwner() - .HasForeignKey("PoseDefaultLocalizationPoseId"); - }); - - b1.OwnsOne("Api.Database.Models.Position", "Position", b2 => - { - b2.Property("PoseDefaultLocalizationPoseId") - .HasColumnType("text"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseDefaultLocalizationPoseId"); - - b2.ToTable("DefaultLocalizationPoses"); - - b2.WithOwner() - .HasForeignKey("PoseDefaultLocalizationPoseId"); - }); - - b1.Navigation("Orientation") - .IsRequired(); - - b1.Navigation("Position") - .IsRequired(); - }); - - b.Navigation("Pose") - .IsRequired(); - }); - - modelBuilder.Entity("Api.Database.Models.Inspection", b => - { - b.HasOne("Api.Database.Models.MissionTask", null) - .WithMany("Inspections") - .HasForeignKey("MissionTaskId"); - - b.OwnsOne("Api.Database.Models.Position", "InspectionTarget", b1 => - { - b1.Property("InspectionId") - .HasColumnType("text"); - - b1.Property("X") - .HasColumnType("real"); - - b1.Property("Y") - .HasColumnType("real"); - - b1.Property("Z") - .HasColumnType("real"); - - b1.HasKey("InspectionId"); - - b1.ToTable("Inspections"); - - b1.WithOwner() - .HasForeignKey("InspectionId"); - }); - - b.Navigation("InspectionTarget") - .IsRequired(); - }); - - modelBuilder.Entity("Api.Database.Models.InspectionFinding", b => - { - b.HasOne("Api.Database.Models.Inspection", null) - .WithMany("InspectionFindings") - .HasForeignKey("InspectionId"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionDefinition", b => - { - b.HasOne("Api.Database.Models.Area", "Area") - .WithMany() - .HasForeignKey("AreaId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Api.Database.Models.MissionRun", "LastSuccessfulRun") - .WithMany() - .HasForeignKey("LastSuccessfulRunId"); - - b.HasOne("Api.Database.Models.Source", "Source") - .WithMany() - .HasForeignKey("SourceId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Area"); - - b.Navigation("LastSuccessfulRun"); - - b.Navigation("Source"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionRun", b => - { - b.HasOne("Api.Database.Models.Area", "Area") - .WithMany() - .HasForeignKey("AreaId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Api.Database.Models.Robot", "Robot") - .WithMany() - .HasForeignKey("RobotId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.OwnsOne("Api.Database.Models.MapMetadata", "Map", b1 => - { - b1.Property("MissionRunId") - .HasColumnType("text"); - - b1.Property("MapName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.HasKey("MissionRunId"); - - b1.ToTable("MissionRuns"); - - b1.WithOwner() - .HasForeignKey("MissionRunId"); - - b1.OwnsOne("Api.Database.Models.Boundary", "Boundary", b2 => - { - b2.Property("MapMetadataMissionRunId") - .HasColumnType("text"); - - b2.Property("X1") - .HasColumnType("double precision"); - - b2.Property("X2") - .HasColumnType("double precision"); - - b2.Property("Y1") - .HasColumnType("double precision"); - - b2.Property("Y2") - .HasColumnType("double precision"); - - b2.Property("Z1") - .HasColumnType("double precision"); - - b2.Property("Z2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataMissionRunId"); - - b2.ToTable("MissionRuns"); - - b2.WithOwner() - .HasForeignKey("MapMetadataMissionRunId"); - }); - - b1.OwnsOne("Api.Database.Models.TransformationMatrices", "TransformationMatrices", b2 => - { - b2.Property("MapMetadataMissionRunId") - .HasColumnType("text"); - - b2.Property("C1") - .HasColumnType("double precision"); - - b2.Property("C2") - .HasColumnType("double precision"); - - b2.Property("D1") - .HasColumnType("double precision"); - - b2.Property("D2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataMissionRunId"); - - b2.ToTable("MissionRuns"); - - b2.WithOwner() - .HasForeignKey("MapMetadataMissionRunId"); - }); - - b1.Navigation("Boundary") - .IsRequired(); - - b1.Navigation("TransformationMatrices") - .IsRequired(); - }); - - b.Navigation("Area"); - - b.Navigation("Map"); - - b.Navigation("Robot"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionTask", b => - { - b.HasOne("Api.Database.Models.MissionRun", null) - .WithMany("Tasks") - .HasForeignKey("MissionRunId"); - - b.OwnsOne("Api.Database.Models.Position", "InspectionTarget", b1 => - { - b1.Property("MissionTaskId") - .HasColumnType("text"); - - b1.Property("X") - .HasColumnType("real"); - - b1.Property("Y") - .HasColumnType("real"); - - b1.Property("Z") - .HasColumnType("real"); - - b1.HasKey("MissionTaskId"); - - b1.ToTable("MissionTasks"); - - b1.WithOwner() - .HasForeignKey("MissionTaskId"); - }); - - b.OwnsOne("Api.Database.Models.Pose", "RobotPose", b1 => - { - b1.Property("MissionTaskId") - .HasColumnType("text"); - - b1.HasKey("MissionTaskId"); - - b1.ToTable("MissionTasks"); - - b1.WithOwner() - .HasForeignKey("MissionTaskId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseMissionTaskId") - .HasColumnType("text"); - - b2.Property("W") - .HasColumnType("real"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseMissionTaskId"); - - b2.ToTable("MissionTasks"); - - b2.WithOwner() - .HasForeignKey("PoseMissionTaskId"); - }); - - b1.OwnsOne("Api.Database.Models.Position", "Position", b2 => - { - b2.Property("PoseMissionTaskId") - .HasColumnType("text"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseMissionTaskId"); - - b2.ToTable("MissionTasks"); - - b2.WithOwner() - .HasForeignKey("PoseMissionTaskId"); - }); - - b1.Navigation("Orientation") - .IsRequired(); - - b1.Navigation("Position") - .IsRequired(); - }); - - b.Navigation("InspectionTarget") - .IsRequired(); - - b.Navigation("RobotPose") - .IsRequired(); - }); - - modelBuilder.Entity("Api.Database.Models.Plant", b => - { - b.HasOne("Api.Database.Models.Installation", "Installation") - .WithMany() - .HasForeignKey("InstallationId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - 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.Installation", "CurrentInstallation") - .WithMany() - .HasForeignKey("CurrentInstallationId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - 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("text"); - - b1.HasKey("RobotId"); - - b1.ToTable("Robots"); - - b1.WithOwner() - .HasForeignKey("RobotId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseRobotId") - .HasColumnType("text"); - - 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("text"); - - 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("text"); - - b1.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b1.Property("ShouldRotate270Clockwise") - .HasColumnType("boolean"); - - b1.Property("Type") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b1.Property("Url") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.HasKey("Id"); - - b1.HasIndex("RobotId"); - - b1.ToTable("VideoStream"); - - b1.WithOwner() - .HasForeignKey("RobotId"); - }); - - b.Navigation("CurrentArea"); - - b.Navigation("CurrentInstallation"); - - 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("text"); - - b1.HasKey("SafePositionId"); - - b1.ToTable("SafePositions"); - - b1.WithOwner() - .HasForeignKey("SafePositionId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseSafePositionId") - .HasColumnType("text"); - - 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("text"); - - 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"); - }); - - modelBuilder.Entity("Api.Database.Models.Inspection", b => - { - b.Navigation("InspectionFindings"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionRun", b => - { - b.Navigation("Tasks"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionTask", b => - { - b.Navigation("Inspections"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/backend/api/Migrations/20240129154746_MakeInspectionTargetRequired.cs b/backend/api/Migrations/20240129154746_MakeInspectionTargetRequired.cs deleted file mode 100644 index f0123595d..000000000 --- a/backend/api/Migrations/20240129154746_MakeInspectionTargetRequired.cs +++ /dev/null @@ -1,72 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Api.Migrations -{ - /// - public partial class MakeInspectionTargetRequired : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AlterColumn( - name: "InspectionTarget_Z", - table: "Inspections", - type: "real", - nullable: false, - defaultValue: 0f, - oldClrType: typeof(float), - oldType: "real", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "InspectionTarget_Y", - table: "Inspections", - type: "real", - nullable: false, - defaultValue: 0f, - oldClrType: typeof(float), - oldType: "real", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "InspectionTarget_X", - table: "Inspections", - type: "real", - nullable: false, - defaultValue: 0f, - oldClrType: typeof(float), - oldType: "real", - oldNullable: true); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.AlterColumn( - name: "InspectionTarget_Z", - table: "Inspections", - type: "real", - nullable: true, - oldClrType: typeof(float), - oldType: "real"); - - migrationBuilder.AlterColumn( - name: "InspectionTarget_Y", - table: "Inspections", - type: "real", - nullable: true, - oldClrType: typeof(float), - oldType: "real"); - - migrationBuilder.AlterColumn( - name: "InspectionTarget_X", - table: "Inspections", - type: "real", - nullable: true, - oldClrType: typeof(float), - oldType: "real"); - } - } -} diff --git a/backend/api/Migrations/20240207145750_RemoveMissionRunCounter.Designer.cs b/backend/api/Migrations/20240207145750_RemoveMissionRunCounter.Designer.cs deleted file mode 100644 index 3f9fac595..000000000 --- a/backend/api/Migrations/20240207145750_RemoveMissionRunCounter.Designer.cs +++ /dev/null @@ -1,1369 +0,0 @@ -// -using System; -using Api.Database.Context; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace Api.Migrations -{ - [DbContext(typeof(FlotillaDbContext))] - [Migration("20240207145750_RemoveMissionRunCounter")] - partial class RemoveMissionRunCounter - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "8.0.0") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("Api.Database.Models.AccessRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AccessLevel") - .IsRequired() - .HasColumnType("text"); - - b.Property("InstallationId") - .HasColumnType("text"); - - b.Property("RoleName") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("InstallationId"); - - b.ToTable("AccessRoles"); - }); - - modelBuilder.Entity("Api.Database.Models.Area", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("DeckId") - .IsRequired() - .HasColumnType("text"); - - b.Property("DefaultLocalizationPoseId") - .HasColumnType("text"); - - b.Property("InstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PlantId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("DeckId"); - - b.HasIndex("DefaultLocalizationPoseId"); - - b.HasIndex("InstallationId"); - - b.HasIndex("PlantId"); - - b.ToTable("Areas"); - }); - - modelBuilder.Entity("Api.Database.Models.Deck", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("DefaultLocalizationPoseId") - .HasColumnType("text"); - - b.Property("InstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PlantId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("DefaultLocalizationPoseId"); - - b.HasIndex("InstallationId"); - - b.HasIndex("PlantId"); - - b.ToTable("Decks"); - }); - - modelBuilder.Entity("Api.Database.Models.DefaultLocalizationPose", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.ToTable("DefaultLocalizationPoses"); - }); - - modelBuilder.Entity("Api.Database.Models.Inspection", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AnalysisType") - .HasColumnType("text"); - - b.Property("EndTime") - .HasColumnType("timestamp with time zone"); - - b.Property("InspectionType") - .IsRequired() - .HasColumnType("text"); - - b.Property("InspectionUrl") - .HasMaxLength(250) - .HasColumnType("character varying(250)"); - - b.Property("IsarStepId") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionTaskId") - .HasColumnType("text"); - - b.Property("StartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("VideoDuration") - .HasColumnType("real"); - - b.HasKey("Id"); - - b.HasIndex("MissionTaskId"); - - b.ToTable("Inspections"); - }); - - modelBuilder.Entity("Api.Database.Models.InspectionFinding", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("Finding") - .IsRequired() - .HasColumnType("text"); - - b.Property("InspectionDate") - .HasColumnType("timestamp with time zone"); - - b.Property("InspectionId") - .HasColumnType("text"); - - b.Property("IsarStepId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("InspectionId"); - - b.ToTable("InspectionFindings"); - }); - - modelBuilder.Entity("Api.Database.Models.Installation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("InstallationCode") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.HasKey("Id"); - - b.HasIndex("InstallationCode") - .IsUnique(); - - b.ToTable("Installations"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionDefinition", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AreaId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Comment") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("InspectionFrequency") - .HasColumnType("bigint"); - - b.Property("InstallationCode") - .IsRequired() - .HasColumnType("text"); - - b.Property("IsDeprecated") - .HasColumnType("boolean"); - - b.Property("LastSuccessfulRunId") - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("SourceId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("AreaId"); - - b.HasIndex("LastSuccessfulRunId"); - - b.HasIndex("SourceId"); - - b.ToTable("MissionDefinitions"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionRun", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AreaId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Comment") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("Description") - .HasMaxLength(450) - .HasColumnType("character varying(450)"); - - b.Property("DesiredStartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("EndTime") - .HasColumnType("timestamp with time zone"); - - b.Property("EstimatedDuration") - .HasColumnType("bigint"); - - b.Property("InstallationCode") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("IsarMissionId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("MissionRunPriority") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("StartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("StatusReason") - .HasMaxLength(450) - .HasColumnType("character varying(450)"); - - b.HasKey("Id"); - - b.HasIndex("AreaId"); - - b.HasIndex("RobotId"); - - b.ToTable("MissionRuns"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionTask", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("EchoPoseId") - .HasColumnType("integer"); - - b.Property("EchoTagLink") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("EndTime") - .HasColumnType("timestamp with time zone"); - - b.Property("IsarTaskId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionRunId") - .HasColumnType("text"); - - b.Property("StartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("TagId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("TaskOrder") - .HasColumnType("integer"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("MissionRunId"); - - b.ToTable("MissionTasks"); - }); - - modelBuilder.Entity("Api.Database.Models.Plant", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("InstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PlantCode") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(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("text"); - - b.Property("BatteryLevel") - .HasColumnType("real"); - - b.Property("CurrentAreaId") - .HasColumnType("text"); - - b.Property("CurrentInstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("CurrentMissionId") - .HasColumnType("text"); - - b.Property("Enabled") - .HasColumnType("boolean"); - - b.Property("Host") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("IsarId") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionQueueFrozen") - .HasColumnType("boolean"); - - b.Property("ModelId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Port") - .HasColumnType("integer"); - - b.Property("PressureLevel") - .HasColumnType("real"); - - b.Property("SerialNumber") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("CurrentAreaId"); - - b.HasIndex("CurrentInstallationId"); - - b.HasIndex("ModelId"); - - b.ToTable("Robots"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotBatteryTimeseries", b => - { - b.Property("BatteryLevel") - .HasColumnType("real"); - - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Time") - .HasColumnType("timestamp with time zone"); - - b.ToTable("RobotBatteryTimeseries"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotModel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AverageDurationPerTag") - .HasColumnType("real"); - - b.Property("BatteryWarningThreshold") - .HasColumnType("real"); - - b.Property("LowerPressureWarningThreshold") - .HasColumnType("real"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - b.Property("UpperPressureWarningThreshold") - .HasColumnType("real"); - - b.HasKey("Id"); - - b.HasIndex("Type") - .IsUnique(); - - b.ToTable("RobotModels"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotPoseTimeseries", b => - { - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("OrientationW") - .HasColumnType("real"); - - b.Property("OrientationX") - .HasColumnType("real"); - - b.Property("OrientationY") - .HasColumnType("real"); - - b.Property("OrientationZ") - .HasColumnType("real"); - - b.Property("PositionX") - .HasColumnType("real"); - - b.Property("PositionY") - .HasColumnType("real"); - - b.Property("PositionZ") - .HasColumnType("real"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Time") - .HasColumnType("timestamp with time zone"); - - b.ToTable("RobotPoseTimeseries"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotPressureTimeseries", b => - { - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("Pressure") - .HasColumnType("real"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Time") - .HasColumnType("timestamp with time zone"); - - b.ToTable("RobotPressureTimeseries"); - }); - - modelBuilder.Entity("Api.Database.Models.SafePosition", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AreaId") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("AreaId"); - - b.ToTable("SafePositions"); - }); - - modelBuilder.Entity("Api.Database.Models.Source", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("SourceId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.ToTable("Sources"); - }); - - modelBuilder.Entity("Api.Database.Models.AccessRole", b => - { - b.HasOne("Api.Database.Models.Installation", "Installation") - .WithMany() - .HasForeignKey("InstallationId"); - - b.Navigation("Installation"); - }); - - 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.DefaultLocalizationPose", "DefaultLocalizationPose") - .WithMany() - .HasForeignKey("DefaultLocalizationPoseId"); - - 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.MapMetadata", "MapMetadata", b1 => - { - b1.Property("AreaId") - .HasColumnType("text"); - - b1.Property("MapName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.HasKey("AreaId"); - - b1.ToTable("Areas"); - - b1.WithOwner() - .HasForeignKey("AreaId"); - - b1.OwnsOne("Api.Database.Models.Boundary", "Boundary", b2 => - { - b2.Property("MapMetadataAreaId") - .HasColumnType("text"); - - b2.Property("X1") - .HasColumnType("double precision"); - - b2.Property("X2") - .HasColumnType("double precision"); - - b2.Property("Y1") - .HasColumnType("double precision"); - - b2.Property("Y2") - .HasColumnType("double precision"); - - b2.Property("Z1") - .HasColumnType("double precision"); - - b2.Property("Z2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataAreaId"); - - b2.ToTable("Areas"); - - b2.WithOwner() - .HasForeignKey("MapMetadataAreaId"); - }); - - b1.OwnsOne("Api.Database.Models.TransformationMatrices", "TransformationMatrices", b2 => - { - b2.Property("MapMetadataAreaId") - .HasColumnType("text"); - - b2.Property("C1") - .HasColumnType("double precision"); - - b2.Property("C2") - .HasColumnType("double precision"); - - b2.Property("D1") - .HasColumnType("double precision"); - - b2.Property("D2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataAreaId"); - - b2.ToTable("Areas"); - - b2.WithOwner() - .HasForeignKey("MapMetadataAreaId"); - }); - - b1.Navigation("Boundary") - .IsRequired(); - - b1.Navigation("TransformationMatrices") - .IsRequired(); - }); - - b.Navigation("Deck"); - - b.Navigation("DefaultLocalizationPose"); - - b.Navigation("Installation"); - - b.Navigation("MapMetadata") - .IsRequired(); - - b.Navigation("Plant"); - }); - - modelBuilder.Entity("Api.Database.Models.Deck", b => - { - b.HasOne("Api.Database.Models.DefaultLocalizationPose", "DefaultLocalizationPose") - .WithMany() - .HasForeignKey("DefaultLocalizationPoseId"); - - 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.Navigation("DefaultLocalizationPose"); - - b.Navigation("Installation"); - - b.Navigation("Plant"); - }); - - modelBuilder.Entity("Api.Database.Models.DefaultLocalizationPose", b => - { - b.OwnsOne("Api.Database.Models.Pose", "Pose", b1 => - { - b1.Property("DefaultLocalizationPoseId") - .HasColumnType("text"); - - b1.HasKey("DefaultLocalizationPoseId"); - - b1.ToTable("DefaultLocalizationPoses"); - - b1.WithOwner() - .HasForeignKey("DefaultLocalizationPoseId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseDefaultLocalizationPoseId") - .HasColumnType("text"); - - b2.Property("W") - .HasColumnType("real"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseDefaultLocalizationPoseId"); - - b2.ToTable("DefaultLocalizationPoses"); - - b2.WithOwner() - .HasForeignKey("PoseDefaultLocalizationPoseId"); - }); - - b1.OwnsOne("Api.Database.Models.Position", "Position", b2 => - { - b2.Property("PoseDefaultLocalizationPoseId") - .HasColumnType("text"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseDefaultLocalizationPoseId"); - - b2.ToTable("DefaultLocalizationPoses"); - - b2.WithOwner() - .HasForeignKey("PoseDefaultLocalizationPoseId"); - }); - - b1.Navigation("Orientation") - .IsRequired(); - - b1.Navigation("Position") - .IsRequired(); - }); - - b.Navigation("Pose") - .IsRequired(); - }); - - modelBuilder.Entity("Api.Database.Models.Inspection", b => - { - b.HasOne("Api.Database.Models.MissionTask", null) - .WithMany("Inspections") - .HasForeignKey("MissionTaskId"); - - b.OwnsOne("Api.Database.Models.Position", "InspectionTarget", b1 => - { - b1.Property("InspectionId") - .HasColumnType("text"); - - b1.Property("X") - .HasColumnType("real"); - - b1.Property("Y") - .HasColumnType("real"); - - b1.Property("Z") - .HasColumnType("real"); - - b1.HasKey("InspectionId"); - - b1.ToTable("Inspections"); - - b1.WithOwner() - .HasForeignKey("InspectionId"); - }); - - b.Navigation("InspectionTarget") - .IsRequired(); - }); - - modelBuilder.Entity("Api.Database.Models.InspectionFinding", b => - { - b.HasOne("Api.Database.Models.Inspection", null) - .WithMany("InspectionFindings") - .HasForeignKey("InspectionId"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionDefinition", b => - { - b.HasOne("Api.Database.Models.Area", "Area") - .WithMany() - .HasForeignKey("AreaId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Api.Database.Models.MissionRun", "LastSuccessfulRun") - .WithMany() - .HasForeignKey("LastSuccessfulRunId"); - - b.HasOne("Api.Database.Models.Source", "Source") - .WithMany() - .HasForeignKey("SourceId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Area"); - - b.Navigation("LastSuccessfulRun"); - - b.Navigation("Source"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionRun", b => - { - b.HasOne("Api.Database.Models.Area", "Area") - .WithMany() - .HasForeignKey("AreaId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Api.Database.Models.Robot", "Robot") - .WithMany() - .HasForeignKey("RobotId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.OwnsOne("Api.Database.Models.MapMetadata", "Map", b1 => - { - b1.Property("MissionRunId") - .HasColumnType("text"); - - b1.Property("MapName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.HasKey("MissionRunId"); - - b1.ToTable("MissionRuns"); - - b1.WithOwner() - .HasForeignKey("MissionRunId"); - - b1.OwnsOne("Api.Database.Models.Boundary", "Boundary", b2 => - { - b2.Property("MapMetadataMissionRunId") - .HasColumnType("text"); - - b2.Property("X1") - .HasColumnType("double precision"); - - b2.Property("X2") - .HasColumnType("double precision"); - - b2.Property("Y1") - .HasColumnType("double precision"); - - b2.Property("Y2") - .HasColumnType("double precision"); - - b2.Property("Z1") - .HasColumnType("double precision"); - - b2.Property("Z2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataMissionRunId"); - - b2.ToTable("MissionRuns"); - - b2.WithOwner() - .HasForeignKey("MapMetadataMissionRunId"); - }); - - b1.OwnsOne("Api.Database.Models.TransformationMatrices", "TransformationMatrices", b2 => - { - b2.Property("MapMetadataMissionRunId") - .HasColumnType("text"); - - b2.Property("C1") - .HasColumnType("double precision"); - - b2.Property("C2") - .HasColumnType("double precision"); - - b2.Property("D1") - .HasColumnType("double precision"); - - b2.Property("D2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataMissionRunId"); - - b2.ToTable("MissionRuns"); - - b2.WithOwner() - .HasForeignKey("MapMetadataMissionRunId"); - }); - - b1.Navigation("Boundary") - .IsRequired(); - - b1.Navigation("TransformationMatrices") - .IsRequired(); - }); - - b.Navigation("Area"); - - b.Navigation("Map"); - - b.Navigation("Robot"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionTask", b => - { - b.HasOne("Api.Database.Models.MissionRun", null) - .WithMany("Tasks") - .HasForeignKey("MissionRunId"); - - b.OwnsOne("Api.Database.Models.Position", "InspectionTarget", b1 => - { - b1.Property("MissionTaskId") - .HasColumnType("text"); - - b1.Property("X") - .HasColumnType("real"); - - b1.Property("Y") - .HasColumnType("real"); - - b1.Property("Z") - .HasColumnType("real"); - - b1.HasKey("MissionTaskId"); - - b1.ToTable("MissionTasks"); - - b1.WithOwner() - .HasForeignKey("MissionTaskId"); - }); - - b.OwnsOne("Api.Database.Models.Pose", "RobotPose", b1 => - { - b1.Property("MissionTaskId") - .HasColumnType("text"); - - b1.HasKey("MissionTaskId"); - - b1.ToTable("MissionTasks"); - - b1.WithOwner() - .HasForeignKey("MissionTaskId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseMissionTaskId") - .HasColumnType("text"); - - b2.Property("W") - .HasColumnType("real"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseMissionTaskId"); - - b2.ToTable("MissionTasks"); - - b2.WithOwner() - .HasForeignKey("PoseMissionTaskId"); - }); - - b1.OwnsOne("Api.Database.Models.Position", "Position", b2 => - { - b2.Property("PoseMissionTaskId") - .HasColumnType("text"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseMissionTaskId"); - - b2.ToTable("MissionTasks"); - - b2.WithOwner() - .HasForeignKey("PoseMissionTaskId"); - }); - - b1.Navigation("Orientation") - .IsRequired(); - - b1.Navigation("Position") - .IsRequired(); - }); - - b.Navigation("InspectionTarget"); - - b.Navigation("RobotPose") - .IsRequired(); - }); - - modelBuilder.Entity("Api.Database.Models.Plant", b => - { - b.HasOne("Api.Database.Models.Installation", "Installation") - .WithMany() - .HasForeignKey("InstallationId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - 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.Installation", "CurrentInstallation") - .WithMany() - .HasForeignKey("CurrentInstallationId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - 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("text"); - - b1.HasKey("RobotId"); - - b1.ToTable("Robots"); - - b1.WithOwner() - .HasForeignKey("RobotId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseRobotId") - .HasColumnType("text"); - - 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("text"); - - 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("text"); - - b1.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b1.Property("ShouldRotate270Clockwise") - .HasColumnType("boolean"); - - b1.Property("Type") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b1.Property("Url") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.HasKey("Id"); - - b1.HasIndex("RobotId"); - - b1.ToTable("VideoStream"); - - b1.WithOwner() - .HasForeignKey("RobotId"); - }); - - b.Navigation("CurrentArea"); - - b.Navigation("CurrentInstallation"); - - 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("text"); - - b1.HasKey("SafePositionId"); - - b1.ToTable("SafePositions"); - - b1.WithOwner() - .HasForeignKey("SafePositionId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseSafePositionId") - .HasColumnType("text"); - - 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("text"); - - 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"); - }); - - modelBuilder.Entity("Api.Database.Models.Inspection", b => - { - b.Navigation("InspectionFindings"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionRun", b => - { - b.Navigation("Tasks"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionTask", b => - { - b.Navigation("Inspections"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/backend/api/Migrations/20240207145750_RemoveMissionRunCounter.cs b/backend/api/Migrations/20240207145750_RemoveMissionRunCounter.cs deleted file mode 100644 index a9d8e1296..000000000 --- a/backend/api/Migrations/20240207145750_RemoveMissionRunCounter.cs +++ /dev/null @@ -1,29 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Api.Migrations -{ - /// - public partial class RemoveMissionRunCounter : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "MissionRunCount", - table: "MissionRuns"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "MissionRunCount", - table: "MissionRuns", - type: "integer", - nullable: false, - defaultValue: 0); - } - } -} diff --git a/backend/api/Migrations/20240208092245_RemoveInspectionTarget.Designer.cs b/backend/api/Migrations/20240208092245_RemoveInspectionTarget.Designer.cs deleted file mode 100644 index 3c93dd768..000000000 --- a/backend/api/Migrations/20240208092245_RemoveInspectionTarget.Designer.cs +++ /dev/null @@ -1,1345 +0,0 @@ -// -using System; -using Api.Database.Context; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace Api.Migrations -{ - [DbContext(typeof(FlotillaDbContext))] - [Migration("20240208092245_RemoveInspectionTarget")] - partial class RemoveInspectionTarget - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "8.0.0") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("Api.Database.Models.AccessRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AccessLevel") - .IsRequired() - .HasColumnType("text"); - - b.Property("InstallationId") - .HasColumnType("text"); - - b.Property("RoleName") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("InstallationId"); - - b.ToTable("AccessRoles"); - }); - - modelBuilder.Entity("Api.Database.Models.Area", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("DeckId") - .IsRequired() - .HasColumnType("text"); - - b.Property("DefaultLocalizationPoseId") - .HasColumnType("text"); - - b.Property("InstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PlantId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("DeckId"); - - b.HasIndex("DefaultLocalizationPoseId"); - - b.HasIndex("InstallationId"); - - b.HasIndex("PlantId"); - - b.ToTable("Areas"); - }); - - modelBuilder.Entity("Api.Database.Models.Deck", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("DefaultLocalizationPoseId") - .HasColumnType("text"); - - b.Property("InstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PlantId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("DefaultLocalizationPoseId"); - - b.HasIndex("InstallationId"); - - b.HasIndex("PlantId"); - - b.ToTable("Decks"); - }); - - modelBuilder.Entity("Api.Database.Models.DefaultLocalizationPose", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.ToTable("DefaultLocalizationPoses"); - }); - - modelBuilder.Entity("Api.Database.Models.Inspection", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AnalysisType") - .HasColumnType("text"); - - b.Property("EndTime") - .HasColumnType("timestamp with time zone"); - - b.Property("InspectionType") - .IsRequired() - .HasColumnType("text"); - - b.Property("InspectionUrl") - .HasMaxLength(250) - .HasColumnType("character varying(250)"); - - b.Property("IsarStepId") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionTaskId") - .HasColumnType("text"); - - b.Property("StartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("VideoDuration") - .HasColumnType("real"); - - b.HasKey("Id"); - - b.HasIndex("MissionTaskId"); - - b.ToTable("Inspections"); - }); - - modelBuilder.Entity("Api.Database.Models.InspectionFinding", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("Finding") - .IsRequired() - .HasColumnType("text"); - - b.Property("InspectionDate") - .HasColumnType("timestamp with time zone"); - - b.Property("InspectionId") - .HasColumnType("text"); - - b.Property("IsarStepId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("InspectionId"); - - b.ToTable("InspectionFindings"); - }); - - modelBuilder.Entity("Api.Database.Models.Installation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("InstallationCode") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.HasKey("Id"); - - b.HasIndex("InstallationCode") - .IsUnique(); - - b.ToTable("Installations"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionDefinition", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AreaId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Comment") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("InspectionFrequency") - .HasColumnType("bigint"); - - b.Property("InstallationCode") - .IsRequired() - .HasColumnType("text"); - - b.Property("IsDeprecated") - .HasColumnType("boolean"); - - b.Property("LastSuccessfulRunId") - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("SourceId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("AreaId"); - - b.HasIndex("LastSuccessfulRunId"); - - b.HasIndex("SourceId"); - - b.ToTable("MissionDefinitions"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionRun", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AreaId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Comment") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("Description") - .HasMaxLength(450) - .HasColumnType("character varying(450)"); - - b.Property("DesiredStartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("EndTime") - .HasColumnType("timestamp with time zone"); - - b.Property("EstimatedDuration") - .HasColumnType("bigint"); - - b.Property("InstallationCode") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("IsarMissionId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("MissionRunPriority") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("StartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("StatusReason") - .HasMaxLength(450) - .HasColumnType("character varying(450)"); - - b.HasKey("Id"); - - b.HasIndex("AreaId"); - - b.HasIndex("RobotId"); - - b.ToTable("MissionRuns"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionTask", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("EchoPoseId") - .HasColumnType("integer"); - - b.Property("EchoTagLink") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("EndTime") - .HasColumnType("timestamp with time zone"); - - b.Property("IsarTaskId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionRunId") - .HasColumnType("text"); - - b.Property("StartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("TagId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("TaskOrder") - .HasColumnType("integer"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("MissionRunId"); - - b.ToTable("MissionTasks"); - }); - - modelBuilder.Entity("Api.Database.Models.Plant", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("InstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PlantCode") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(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("text"); - - b.Property("BatteryLevel") - .HasColumnType("real"); - - b.Property("CurrentAreaId") - .HasColumnType("text"); - - b.Property("CurrentInstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("CurrentMissionId") - .HasColumnType("text"); - - b.Property("Enabled") - .HasColumnType("boolean"); - - b.Property("Host") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("IsarId") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionQueueFrozen") - .HasColumnType("boolean"); - - b.Property("ModelId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Port") - .HasColumnType("integer"); - - b.Property("PressureLevel") - .HasColumnType("real"); - - b.Property("SerialNumber") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("CurrentAreaId"); - - b.HasIndex("CurrentInstallationId"); - - b.HasIndex("ModelId"); - - b.ToTable("Robots"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotBatteryTimeseries", b => - { - b.Property("BatteryLevel") - .HasColumnType("real"); - - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Time") - .HasColumnType("timestamp with time zone"); - - b.ToTable("RobotBatteryTimeseries"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotModel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AverageDurationPerTag") - .HasColumnType("real"); - - b.Property("BatteryWarningThreshold") - .HasColumnType("real"); - - b.Property("LowerPressureWarningThreshold") - .HasColumnType("real"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - b.Property("UpperPressureWarningThreshold") - .HasColumnType("real"); - - b.HasKey("Id"); - - b.HasIndex("Type") - .IsUnique(); - - b.ToTable("RobotModels"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotPoseTimeseries", b => - { - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("OrientationW") - .HasColumnType("real"); - - b.Property("OrientationX") - .HasColumnType("real"); - - b.Property("OrientationY") - .HasColumnType("real"); - - b.Property("OrientationZ") - .HasColumnType("real"); - - b.Property("PositionX") - .HasColumnType("real"); - - b.Property("PositionY") - .HasColumnType("real"); - - b.Property("PositionZ") - .HasColumnType("real"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Time") - .HasColumnType("timestamp with time zone"); - - b.ToTable("RobotPoseTimeseries"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotPressureTimeseries", b => - { - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("Pressure") - .HasColumnType("real"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Time") - .HasColumnType("timestamp with time zone"); - - b.ToTable("RobotPressureTimeseries"); - }); - - modelBuilder.Entity("Api.Database.Models.SafePosition", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AreaId") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("AreaId"); - - b.ToTable("SafePositions"); - }); - - modelBuilder.Entity("Api.Database.Models.Source", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("SourceId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.ToTable("Sources"); - }); - - modelBuilder.Entity("Api.Database.Models.AccessRole", b => - { - b.HasOne("Api.Database.Models.Installation", "Installation") - .WithMany() - .HasForeignKey("InstallationId"); - - b.Navigation("Installation"); - }); - - 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.DefaultLocalizationPose", "DefaultLocalizationPose") - .WithMany() - .HasForeignKey("DefaultLocalizationPoseId"); - - 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.MapMetadata", "MapMetadata", b1 => - { - b1.Property("AreaId") - .HasColumnType("text"); - - b1.Property("MapName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.HasKey("AreaId"); - - b1.ToTable("Areas"); - - b1.WithOwner() - .HasForeignKey("AreaId"); - - b1.OwnsOne("Api.Database.Models.Boundary", "Boundary", b2 => - { - b2.Property("MapMetadataAreaId") - .HasColumnType("text"); - - b2.Property("X1") - .HasColumnType("double precision"); - - b2.Property("X2") - .HasColumnType("double precision"); - - b2.Property("Y1") - .HasColumnType("double precision"); - - b2.Property("Y2") - .HasColumnType("double precision"); - - b2.Property("Z1") - .HasColumnType("double precision"); - - b2.Property("Z2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataAreaId"); - - b2.ToTable("Areas"); - - b2.WithOwner() - .HasForeignKey("MapMetadataAreaId"); - }); - - b1.OwnsOne("Api.Database.Models.TransformationMatrices", "TransformationMatrices", b2 => - { - b2.Property("MapMetadataAreaId") - .HasColumnType("text"); - - b2.Property("C1") - .HasColumnType("double precision"); - - b2.Property("C2") - .HasColumnType("double precision"); - - b2.Property("D1") - .HasColumnType("double precision"); - - b2.Property("D2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataAreaId"); - - b2.ToTable("Areas"); - - b2.WithOwner() - .HasForeignKey("MapMetadataAreaId"); - }); - - b1.Navigation("Boundary") - .IsRequired(); - - b1.Navigation("TransformationMatrices") - .IsRequired(); - }); - - b.Navigation("Deck"); - - b.Navigation("DefaultLocalizationPose"); - - b.Navigation("Installation"); - - b.Navigation("MapMetadata") - .IsRequired(); - - b.Navigation("Plant"); - }); - - modelBuilder.Entity("Api.Database.Models.Deck", b => - { - b.HasOne("Api.Database.Models.DefaultLocalizationPose", "DefaultLocalizationPose") - .WithMany() - .HasForeignKey("DefaultLocalizationPoseId"); - - 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.Navigation("DefaultLocalizationPose"); - - b.Navigation("Installation"); - - b.Navigation("Plant"); - }); - - modelBuilder.Entity("Api.Database.Models.DefaultLocalizationPose", b => - { - b.OwnsOne("Api.Database.Models.Pose", "Pose", b1 => - { - b1.Property("DefaultLocalizationPoseId") - .HasColumnType("text"); - - b1.HasKey("DefaultLocalizationPoseId"); - - b1.ToTable("DefaultLocalizationPoses"); - - b1.WithOwner() - .HasForeignKey("DefaultLocalizationPoseId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseDefaultLocalizationPoseId") - .HasColumnType("text"); - - b2.Property("W") - .HasColumnType("real"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseDefaultLocalizationPoseId"); - - b2.ToTable("DefaultLocalizationPoses"); - - b2.WithOwner() - .HasForeignKey("PoseDefaultLocalizationPoseId"); - }); - - b1.OwnsOne("Api.Database.Models.Position", "Position", b2 => - { - b2.Property("PoseDefaultLocalizationPoseId") - .HasColumnType("text"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseDefaultLocalizationPoseId"); - - b2.ToTable("DefaultLocalizationPoses"); - - b2.WithOwner() - .HasForeignKey("PoseDefaultLocalizationPoseId"); - }); - - b1.Navigation("Orientation") - .IsRequired(); - - b1.Navigation("Position") - .IsRequired(); - }); - - b.Navigation("Pose") - .IsRequired(); - }); - - modelBuilder.Entity("Api.Database.Models.Inspection", b => - { - b.HasOne("Api.Database.Models.MissionTask", null) - .WithMany("Inspections") - .HasForeignKey("MissionTaskId"); - - b.OwnsOne("Api.Database.Models.Position", "InspectionTarget", b1 => - { - b1.Property("InspectionId") - .HasColumnType("text"); - - b1.Property("X") - .HasColumnType("real"); - - b1.Property("Y") - .HasColumnType("real"); - - b1.Property("Z") - .HasColumnType("real"); - - b1.HasKey("InspectionId"); - - b1.ToTable("Inspections"); - - b1.WithOwner() - .HasForeignKey("InspectionId"); - }); - - b.Navigation("InspectionTarget") - .IsRequired(); - }); - - modelBuilder.Entity("Api.Database.Models.InspectionFinding", b => - { - b.HasOne("Api.Database.Models.Inspection", null) - .WithMany("InspectionFindings") - .HasForeignKey("InspectionId"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionDefinition", b => - { - b.HasOne("Api.Database.Models.Area", "Area") - .WithMany() - .HasForeignKey("AreaId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Api.Database.Models.MissionRun", "LastSuccessfulRun") - .WithMany() - .HasForeignKey("LastSuccessfulRunId"); - - b.HasOne("Api.Database.Models.Source", "Source") - .WithMany() - .HasForeignKey("SourceId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Area"); - - b.Navigation("LastSuccessfulRun"); - - b.Navigation("Source"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionRun", b => - { - b.HasOne("Api.Database.Models.Area", "Area") - .WithMany() - .HasForeignKey("AreaId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Api.Database.Models.Robot", "Robot") - .WithMany() - .HasForeignKey("RobotId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.OwnsOne("Api.Database.Models.MapMetadata", "Map", b1 => - { - b1.Property("MissionRunId") - .HasColumnType("text"); - - b1.Property("MapName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.HasKey("MissionRunId"); - - b1.ToTable("MissionRuns"); - - b1.WithOwner() - .HasForeignKey("MissionRunId"); - - b1.OwnsOne("Api.Database.Models.Boundary", "Boundary", b2 => - { - b2.Property("MapMetadataMissionRunId") - .HasColumnType("text"); - - b2.Property("X1") - .HasColumnType("double precision"); - - b2.Property("X2") - .HasColumnType("double precision"); - - b2.Property("Y1") - .HasColumnType("double precision"); - - b2.Property("Y2") - .HasColumnType("double precision"); - - b2.Property("Z1") - .HasColumnType("double precision"); - - b2.Property("Z2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataMissionRunId"); - - b2.ToTable("MissionRuns"); - - b2.WithOwner() - .HasForeignKey("MapMetadataMissionRunId"); - }); - - b1.OwnsOne("Api.Database.Models.TransformationMatrices", "TransformationMatrices", b2 => - { - b2.Property("MapMetadataMissionRunId") - .HasColumnType("text"); - - b2.Property("C1") - .HasColumnType("double precision"); - - b2.Property("C2") - .HasColumnType("double precision"); - - b2.Property("D1") - .HasColumnType("double precision"); - - b2.Property("D2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataMissionRunId"); - - b2.ToTable("MissionRuns"); - - b2.WithOwner() - .HasForeignKey("MapMetadataMissionRunId"); - }); - - b1.Navigation("Boundary") - .IsRequired(); - - b1.Navigation("TransformationMatrices") - .IsRequired(); - }); - - b.Navigation("Area"); - - b.Navigation("Map"); - - b.Navigation("Robot"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionTask", b => - { - b.HasOne("Api.Database.Models.MissionRun", null) - .WithMany("Tasks") - .HasForeignKey("MissionRunId"); - - b.OwnsOne("Api.Database.Models.Pose", "RobotPose", b1 => - { - b1.Property("MissionTaskId") - .HasColumnType("text"); - - b1.HasKey("MissionTaskId"); - - b1.ToTable("MissionTasks"); - - b1.WithOwner() - .HasForeignKey("MissionTaskId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseMissionTaskId") - .HasColumnType("text"); - - b2.Property("W") - .HasColumnType("real"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseMissionTaskId"); - - b2.ToTable("MissionTasks"); - - b2.WithOwner() - .HasForeignKey("PoseMissionTaskId"); - }); - - b1.OwnsOne("Api.Database.Models.Position", "Position", b2 => - { - b2.Property("PoseMissionTaskId") - .HasColumnType("text"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseMissionTaskId"); - - b2.ToTable("MissionTasks"); - - b2.WithOwner() - .HasForeignKey("PoseMissionTaskId"); - }); - - b1.Navigation("Orientation") - .IsRequired(); - - b1.Navigation("Position") - .IsRequired(); - }); - - b.Navigation("RobotPose") - .IsRequired(); - }); - - modelBuilder.Entity("Api.Database.Models.Plant", b => - { - b.HasOne("Api.Database.Models.Installation", "Installation") - .WithMany() - .HasForeignKey("InstallationId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - 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.Installation", "CurrentInstallation") - .WithMany() - .HasForeignKey("CurrentInstallationId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - 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("text"); - - b1.HasKey("RobotId"); - - b1.ToTable("Robots"); - - b1.WithOwner() - .HasForeignKey("RobotId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseRobotId") - .HasColumnType("text"); - - 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("text"); - - 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("text"); - - b1.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b1.Property("ShouldRotate270Clockwise") - .HasColumnType("boolean"); - - b1.Property("Type") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b1.Property("Url") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.HasKey("Id"); - - b1.HasIndex("RobotId"); - - b1.ToTable("VideoStream"); - - b1.WithOwner() - .HasForeignKey("RobotId"); - }); - - b.Navigation("CurrentArea"); - - b.Navigation("CurrentInstallation"); - - 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("text"); - - b1.HasKey("SafePositionId"); - - b1.ToTable("SafePositions"); - - b1.WithOwner() - .HasForeignKey("SafePositionId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseSafePositionId") - .HasColumnType("text"); - - 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("text"); - - 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"); - }); - - modelBuilder.Entity("Api.Database.Models.Inspection", b => - { - b.Navigation("InspectionFindings"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionRun", b => - { - b.Navigation("Tasks"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionTask", b => - { - b.Navigation("Inspections"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/backend/api/Migrations/20240208092245_RemoveInspectionTarget.cs b/backend/api/Migrations/20240208092245_RemoveInspectionTarget.cs deleted file mode 100644 index 49054ccec..000000000 --- a/backend/api/Migrations/20240208092245_RemoveInspectionTarget.cs +++ /dev/null @@ -1,48 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Api.Migrations -{ - /// - public partial class RemoveInspectionTarget : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "InspectionTarget_X", - table: "MissionTasks"); - - migrationBuilder.DropColumn( - name: "InspectionTarget_Y", - table: "MissionTasks"); - - migrationBuilder.DropColumn( - name: "InspectionTarget_Z", - table: "MissionTasks"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "InspectionTarget_X", - table: "MissionTasks", - type: "real", - nullable: true); - - migrationBuilder.AddColumn( - name: "InspectionTarget_Y", - table: "MissionTasks", - type: "real", - nullable: true); - - migrationBuilder.AddColumn( - name: "InspectionTarget_Z", - table: "MissionTasks", - type: "real", - nullable: true); - } - } -} diff --git a/backend/api/Migrations/20240304135031_RenameMissionTaskTypeFromDriveToToReturnHome.Designer.cs b/backend/api/Migrations/20240304135031_RenameMissionTaskTypeFromDriveToToReturnHome.Designer.cs deleted file mode 100644 index 2be292cf7..000000000 --- a/backend/api/Migrations/20240304135031_RenameMissionTaskTypeFromDriveToToReturnHome.Designer.cs +++ /dev/null @@ -1,1345 +0,0 @@ -// -using System; -using Api.Database.Context; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace Api.Migrations -{ - [DbContext(typeof(FlotillaDbContext))] - [Migration("20240304135031_RenameMissionTaskTypeFromDriveToToReturnHome")] - partial class RenameMissionTaskTypeFromDriveToToReturnHome - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "8.0.0") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("Api.Database.Models.AccessRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AccessLevel") - .IsRequired() - .HasColumnType("text"); - - b.Property("InstallationId") - .HasColumnType("text"); - - b.Property("RoleName") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("InstallationId"); - - b.ToTable("AccessRoles"); - }); - - modelBuilder.Entity("Api.Database.Models.Area", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("DeckId") - .IsRequired() - .HasColumnType("text"); - - b.Property("DefaultLocalizationPoseId") - .HasColumnType("text"); - - b.Property("InstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PlantId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("DeckId"); - - b.HasIndex("DefaultLocalizationPoseId"); - - b.HasIndex("InstallationId"); - - b.HasIndex("PlantId"); - - b.ToTable("Areas"); - }); - - modelBuilder.Entity("Api.Database.Models.Deck", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("DefaultLocalizationPoseId") - .HasColumnType("text"); - - b.Property("InstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PlantId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("DefaultLocalizationPoseId"); - - b.HasIndex("InstallationId"); - - b.HasIndex("PlantId"); - - b.ToTable("Decks"); - }); - - modelBuilder.Entity("Api.Database.Models.DefaultLocalizationPose", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.ToTable("DefaultLocalizationPoses"); - }); - - modelBuilder.Entity("Api.Database.Models.Inspection", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AnalysisType") - .HasColumnType("text"); - - b.Property("EndTime") - .HasColumnType("timestamp with time zone"); - - b.Property("InspectionType") - .IsRequired() - .HasColumnType("text"); - - b.Property("InspectionUrl") - .HasMaxLength(250) - .HasColumnType("character varying(250)"); - - b.Property("IsarStepId") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionTaskId") - .HasColumnType("text"); - - b.Property("StartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("VideoDuration") - .HasColumnType("real"); - - b.HasKey("Id"); - - b.HasIndex("MissionTaskId"); - - b.ToTable("Inspections"); - }); - - modelBuilder.Entity("Api.Database.Models.InspectionFinding", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("Finding") - .IsRequired() - .HasColumnType("text"); - - b.Property("InspectionDate") - .HasColumnType("timestamp with time zone"); - - b.Property("InspectionId") - .HasColumnType("text"); - - b.Property("IsarStepId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("InspectionId"); - - b.ToTable("InspectionFindings"); - }); - - modelBuilder.Entity("Api.Database.Models.Installation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("InstallationCode") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.HasKey("Id"); - - b.HasIndex("InstallationCode") - .IsUnique(); - - b.ToTable("Installations"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionDefinition", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AreaId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Comment") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("InspectionFrequency") - .HasColumnType("bigint"); - - b.Property("InstallationCode") - .IsRequired() - .HasColumnType("text"); - - b.Property("IsDeprecated") - .HasColumnType("boolean"); - - b.Property("LastSuccessfulRunId") - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("SourceId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("AreaId"); - - b.HasIndex("LastSuccessfulRunId"); - - b.HasIndex("SourceId"); - - b.ToTable("MissionDefinitions"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionRun", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AreaId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Comment") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("Description") - .HasMaxLength(450) - .HasColumnType("character varying(450)"); - - b.Property("DesiredStartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("EndTime") - .HasColumnType("timestamp with time zone"); - - b.Property("EstimatedDuration") - .HasColumnType("bigint"); - - b.Property("InstallationCode") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("IsarMissionId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("MissionRunPriority") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("StartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("StatusReason") - .HasMaxLength(450) - .HasColumnType("character varying(450)"); - - b.HasKey("Id"); - - b.HasIndex("AreaId"); - - b.HasIndex("RobotId"); - - b.ToTable("MissionRuns"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionTask", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("EchoPoseId") - .HasColumnType("integer"); - - b.Property("EchoTagLink") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("EndTime") - .HasColumnType("timestamp with time zone"); - - b.Property("IsarTaskId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionRunId") - .HasColumnType("text"); - - b.Property("StartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("TagId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("TaskOrder") - .HasColumnType("integer"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("MissionRunId"); - - b.ToTable("MissionTasks"); - }); - - modelBuilder.Entity("Api.Database.Models.Plant", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("InstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PlantCode") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(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("text"); - - b.Property("BatteryLevel") - .HasColumnType("real"); - - b.Property("CurrentAreaId") - .HasColumnType("text"); - - b.Property("CurrentInstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("CurrentMissionId") - .HasColumnType("text"); - - b.Property("Enabled") - .HasColumnType("boolean"); - - b.Property("Host") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("IsarId") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionQueueFrozen") - .HasColumnType("boolean"); - - b.Property("ModelId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Port") - .HasColumnType("integer"); - - b.Property("PressureLevel") - .HasColumnType("real"); - - b.Property("SerialNumber") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("CurrentAreaId"); - - b.HasIndex("CurrentInstallationId"); - - b.HasIndex("ModelId"); - - b.ToTable("Robots"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotBatteryTimeseries", b => - { - b.Property("BatteryLevel") - .HasColumnType("real"); - - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Time") - .HasColumnType("timestamp with time zone"); - - b.ToTable("RobotBatteryTimeseries"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotModel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AverageDurationPerTag") - .HasColumnType("real"); - - b.Property("BatteryWarningThreshold") - .HasColumnType("real"); - - b.Property("LowerPressureWarningThreshold") - .HasColumnType("real"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - b.Property("UpperPressureWarningThreshold") - .HasColumnType("real"); - - b.HasKey("Id"); - - b.HasIndex("Type") - .IsUnique(); - - b.ToTable("RobotModels"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotPoseTimeseries", b => - { - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("OrientationW") - .HasColumnType("real"); - - b.Property("OrientationX") - .HasColumnType("real"); - - b.Property("OrientationY") - .HasColumnType("real"); - - b.Property("OrientationZ") - .HasColumnType("real"); - - b.Property("PositionX") - .HasColumnType("real"); - - b.Property("PositionY") - .HasColumnType("real"); - - b.Property("PositionZ") - .HasColumnType("real"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Time") - .HasColumnType("timestamp with time zone"); - - b.ToTable("RobotPoseTimeseries"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotPressureTimeseries", b => - { - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("Pressure") - .HasColumnType("real"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Time") - .HasColumnType("timestamp with time zone"); - - b.ToTable("RobotPressureTimeseries"); - }); - - modelBuilder.Entity("Api.Database.Models.SafePosition", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AreaId") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("AreaId"); - - b.ToTable("SafePositions"); - }); - - modelBuilder.Entity("Api.Database.Models.Source", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("SourceId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.ToTable("Sources"); - }); - - modelBuilder.Entity("Api.Database.Models.AccessRole", b => - { - b.HasOne("Api.Database.Models.Installation", "Installation") - .WithMany() - .HasForeignKey("InstallationId"); - - b.Navigation("Installation"); - }); - - 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.DefaultLocalizationPose", "DefaultLocalizationPose") - .WithMany() - .HasForeignKey("DefaultLocalizationPoseId"); - - 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.MapMetadata", "MapMetadata", b1 => - { - b1.Property("AreaId") - .HasColumnType("text"); - - b1.Property("MapName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.HasKey("AreaId"); - - b1.ToTable("Areas"); - - b1.WithOwner() - .HasForeignKey("AreaId"); - - b1.OwnsOne("Api.Database.Models.Boundary", "Boundary", b2 => - { - b2.Property("MapMetadataAreaId") - .HasColumnType("text"); - - b2.Property("X1") - .HasColumnType("double precision"); - - b2.Property("X2") - .HasColumnType("double precision"); - - b2.Property("Y1") - .HasColumnType("double precision"); - - b2.Property("Y2") - .HasColumnType("double precision"); - - b2.Property("Z1") - .HasColumnType("double precision"); - - b2.Property("Z2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataAreaId"); - - b2.ToTable("Areas"); - - b2.WithOwner() - .HasForeignKey("MapMetadataAreaId"); - }); - - b1.OwnsOne("Api.Database.Models.TransformationMatrices", "TransformationMatrices", b2 => - { - b2.Property("MapMetadataAreaId") - .HasColumnType("text"); - - b2.Property("C1") - .HasColumnType("double precision"); - - b2.Property("C2") - .HasColumnType("double precision"); - - b2.Property("D1") - .HasColumnType("double precision"); - - b2.Property("D2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataAreaId"); - - b2.ToTable("Areas"); - - b2.WithOwner() - .HasForeignKey("MapMetadataAreaId"); - }); - - b1.Navigation("Boundary") - .IsRequired(); - - b1.Navigation("TransformationMatrices") - .IsRequired(); - }); - - b.Navigation("Deck"); - - b.Navigation("DefaultLocalizationPose"); - - b.Navigation("Installation"); - - b.Navigation("MapMetadata") - .IsRequired(); - - b.Navigation("Plant"); - }); - - modelBuilder.Entity("Api.Database.Models.Deck", b => - { - b.HasOne("Api.Database.Models.DefaultLocalizationPose", "DefaultLocalizationPose") - .WithMany() - .HasForeignKey("DefaultLocalizationPoseId"); - - 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.Navigation("DefaultLocalizationPose"); - - b.Navigation("Installation"); - - b.Navigation("Plant"); - }); - - modelBuilder.Entity("Api.Database.Models.DefaultLocalizationPose", b => - { - b.OwnsOne("Api.Database.Models.Pose", "Pose", b1 => - { - b1.Property("DefaultLocalizationPoseId") - .HasColumnType("text"); - - b1.HasKey("DefaultLocalizationPoseId"); - - b1.ToTable("DefaultLocalizationPoses"); - - b1.WithOwner() - .HasForeignKey("DefaultLocalizationPoseId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseDefaultLocalizationPoseId") - .HasColumnType("text"); - - b2.Property("W") - .HasColumnType("real"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseDefaultLocalizationPoseId"); - - b2.ToTable("DefaultLocalizationPoses"); - - b2.WithOwner() - .HasForeignKey("PoseDefaultLocalizationPoseId"); - }); - - b1.OwnsOne("Api.Database.Models.Position", "Position", b2 => - { - b2.Property("PoseDefaultLocalizationPoseId") - .HasColumnType("text"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseDefaultLocalizationPoseId"); - - b2.ToTable("DefaultLocalizationPoses"); - - b2.WithOwner() - .HasForeignKey("PoseDefaultLocalizationPoseId"); - }); - - b1.Navigation("Orientation") - .IsRequired(); - - b1.Navigation("Position") - .IsRequired(); - }); - - b.Navigation("Pose") - .IsRequired(); - }); - - modelBuilder.Entity("Api.Database.Models.Inspection", b => - { - b.HasOne("Api.Database.Models.MissionTask", null) - .WithMany("Inspections") - .HasForeignKey("MissionTaskId"); - - b.OwnsOne("Api.Database.Models.Position", "InspectionTarget", b1 => - { - b1.Property("InspectionId") - .HasColumnType("text"); - - b1.Property("X") - .HasColumnType("real"); - - b1.Property("Y") - .HasColumnType("real"); - - b1.Property("Z") - .HasColumnType("real"); - - b1.HasKey("InspectionId"); - - b1.ToTable("Inspections"); - - b1.WithOwner() - .HasForeignKey("InspectionId"); - }); - - b.Navigation("InspectionTarget") - .IsRequired(); - }); - - modelBuilder.Entity("Api.Database.Models.InspectionFinding", b => - { - b.HasOne("Api.Database.Models.Inspection", null) - .WithMany("InspectionFindings") - .HasForeignKey("InspectionId"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionDefinition", b => - { - b.HasOne("Api.Database.Models.Area", "Area") - .WithMany() - .HasForeignKey("AreaId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Api.Database.Models.MissionRun", "LastSuccessfulRun") - .WithMany() - .HasForeignKey("LastSuccessfulRunId"); - - b.HasOne("Api.Database.Models.Source", "Source") - .WithMany() - .HasForeignKey("SourceId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Area"); - - b.Navigation("LastSuccessfulRun"); - - b.Navigation("Source"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionRun", b => - { - b.HasOne("Api.Database.Models.Area", "Area") - .WithMany() - .HasForeignKey("AreaId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Api.Database.Models.Robot", "Robot") - .WithMany() - .HasForeignKey("RobotId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.OwnsOne("Api.Database.Models.MapMetadata", "Map", b1 => - { - b1.Property("MissionRunId") - .HasColumnType("text"); - - b1.Property("MapName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.HasKey("MissionRunId"); - - b1.ToTable("MissionRuns"); - - b1.WithOwner() - .HasForeignKey("MissionRunId"); - - b1.OwnsOne("Api.Database.Models.Boundary", "Boundary", b2 => - { - b2.Property("MapMetadataMissionRunId") - .HasColumnType("text"); - - b2.Property("X1") - .HasColumnType("double precision"); - - b2.Property("X2") - .HasColumnType("double precision"); - - b2.Property("Y1") - .HasColumnType("double precision"); - - b2.Property("Y2") - .HasColumnType("double precision"); - - b2.Property("Z1") - .HasColumnType("double precision"); - - b2.Property("Z2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataMissionRunId"); - - b2.ToTable("MissionRuns"); - - b2.WithOwner() - .HasForeignKey("MapMetadataMissionRunId"); - }); - - b1.OwnsOne("Api.Database.Models.TransformationMatrices", "TransformationMatrices", b2 => - { - b2.Property("MapMetadataMissionRunId") - .HasColumnType("text"); - - b2.Property("C1") - .HasColumnType("double precision"); - - b2.Property("C2") - .HasColumnType("double precision"); - - b2.Property("D1") - .HasColumnType("double precision"); - - b2.Property("D2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataMissionRunId"); - - b2.ToTable("MissionRuns"); - - b2.WithOwner() - .HasForeignKey("MapMetadataMissionRunId"); - }); - - b1.Navigation("Boundary") - .IsRequired(); - - b1.Navigation("TransformationMatrices") - .IsRequired(); - }); - - b.Navigation("Area"); - - b.Navigation("Map"); - - b.Navigation("Robot"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionTask", b => - { - b.HasOne("Api.Database.Models.MissionRun", null) - .WithMany("Tasks") - .HasForeignKey("MissionRunId"); - - b.OwnsOne("Api.Database.Models.Pose", "RobotPose", b1 => - { - b1.Property("MissionTaskId") - .HasColumnType("text"); - - b1.HasKey("MissionTaskId"); - - b1.ToTable("MissionTasks"); - - b1.WithOwner() - .HasForeignKey("MissionTaskId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseMissionTaskId") - .HasColumnType("text"); - - b2.Property("W") - .HasColumnType("real"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseMissionTaskId"); - - b2.ToTable("MissionTasks"); - - b2.WithOwner() - .HasForeignKey("PoseMissionTaskId"); - }); - - b1.OwnsOne("Api.Database.Models.Position", "Position", b2 => - { - b2.Property("PoseMissionTaskId") - .HasColumnType("text"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseMissionTaskId"); - - b2.ToTable("MissionTasks"); - - b2.WithOwner() - .HasForeignKey("PoseMissionTaskId"); - }); - - b1.Navigation("Orientation") - .IsRequired(); - - b1.Navigation("Position") - .IsRequired(); - }); - - b.Navigation("RobotPose") - .IsRequired(); - }); - - modelBuilder.Entity("Api.Database.Models.Plant", b => - { - b.HasOne("Api.Database.Models.Installation", "Installation") - .WithMany() - .HasForeignKey("InstallationId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - 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.Installation", "CurrentInstallation") - .WithMany() - .HasForeignKey("CurrentInstallationId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - 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("text"); - - b1.HasKey("RobotId"); - - b1.ToTable("Robots"); - - b1.WithOwner() - .HasForeignKey("RobotId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseRobotId") - .HasColumnType("text"); - - 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("text"); - - 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("text"); - - b1.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b1.Property("ShouldRotate270Clockwise") - .HasColumnType("boolean"); - - b1.Property("Type") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b1.Property("Url") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.HasKey("Id"); - - b1.HasIndex("RobotId"); - - b1.ToTable("VideoStream"); - - b1.WithOwner() - .HasForeignKey("RobotId"); - }); - - b.Navigation("CurrentArea"); - - b.Navigation("CurrentInstallation"); - - 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("text"); - - b1.HasKey("SafePositionId"); - - b1.ToTable("SafePositions"); - - b1.WithOwner() - .HasForeignKey("SafePositionId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseSafePositionId") - .HasColumnType("text"); - - 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("text"); - - 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"); - }); - - modelBuilder.Entity("Api.Database.Models.Inspection", b => - { - b.Navigation("InspectionFindings"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionRun", b => - { - b.Navigation("Tasks"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionTask", b => - { - b.Navigation("Inspections"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/backend/api/Migrations/20240304135031_RenameMissionTaskTypeFromDriveToToReturnHome.cs b/backend/api/Migrations/20240304135031_RenameMissionTaskTypeFromDriveToToReturnHome.cs deleted file mode 100644 index e7977e61b..000000000 --- a/backend/api/Migrations/20240304135031_RenameMissionTaskTypeFromDriveToToReturnHome.cs +++ /dev/null @@ -1,22 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Api.Migrations -{ - /// - public partial class RenameMissionTaskTypeFromDriveToToReturnHome : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - - } - } -} diff --git a/backend/api/Migrations/20240322094856_RenameRobotEnabled.Designer.cs b/backend/api/Migrations/20240322094856_RenameRobotEnabled.Designer.cs deleted file mode 100644 index 8fa5a3750..000000000 --- a/backend/api/Migrations/20240322094856_RenameRobotEnabled.Designer.cs +++ /dev/null @@ -1,1345 +0,0 @@ -// -using System; -using Api.Database.Context; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace Api.Migrations -{ - [DbContext(typeof(FlotillaDbContext))] - [Migration("20240322094856_RenameRobotEnabled")] - partial class RenameRobotEnabled - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "8.0.0") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("Api.Database.Models.AccessRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AccessLevel") - .IsRequired() - .HasColumnType("text"); - - b.Property("InstallationId") - .HasColumnType("text"); - - b.Property("RoleName") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("InstallationId"); - - b.ToTable("AccessRoles"); - }); - - modelBuilder.Entity("Api.Database.Models.Area", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("DeckId") - .IsRequired() - .HasColumnType("text"); - - b.Property("DefaultLocalizationPoseId") - .HasColumnType("text"); - - b.Property("InstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PlantId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("DeckId"); - - b.HasIndex("DefaultLocalizationPoseId"); - - b.HasIndex("InstallationId"); - - b.HasIndex("PlantId"); - - b.ToTable("Areas"); - }); - - modelBuilder.Entity("Api.Database.Models.Deck", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("DefaultLocalizationPoseId") - .HasColumnType("text"); - - b.Property("InstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PlantId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("DefaultLocalizationPoseId"); - - b.HasIndex("InstallationId"); - - b.HasIndex("PlantId"); - - b.ToTable("Decks"); - }); - - modelBuilder.Entity("Api.Database.Models.DefaultLocalizationPose", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.ToTable("DefaultLocalizationPoses"); - }); - - modelBuilder.Entity("Api.Database.Models.Inspection", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AnalysisType") - .HasColumnType("text"); - - b.Property("EndTime") - .HasColumnType("timestamp with time zone"); - - b.Property("InspectionType") - .IsRequired() - .HasColumnType("text"); - - b.Property("InspectionUrl") - .HasMaxLength(250) - .HasColumnType("character varying(250)"); - - b.Property("IsarStepId") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionTaskId") - .HasColumnType("text"); - - b.Property("StartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("VideoDuration") - .HasColumnType("real"); - - b.HasKey("Id"); - - b.HasIndex("MissionTaskId"); - - b.ToTable("Inspections"); - }); - - modelBuilder.Entity("Api.Database.Models.InspectionFinding", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("Finding") - .IsRequired() - .HasColumnType("text"); - - b.Property("InspectionDate") - .HasColumnType("timestamp with time zone"); - - b.Property("InspectionId") - .HasColumnType("text"); - - b.Property("IsarStepId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("InspectionId"); - - b.ToTable("InspectionFindings"); - }); - - modelBuilder.Entity("Api.Database.Models.Installation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("InstallationCode") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.HasKey("Id"); - - b.HasIndex("InstallationCode") - .IsUnique(); - - b.ToTable("Installations"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionDefinition", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AreaId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Comment") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("InspectionFrequency") - .HasColumnType("bigint"); - - b.Property("InstallationCode") - .IsRequired() - .HasColumnType("text"); - - b.Property("IsDeprecated") - .HasColumnType("boolean"); - - b.Property("LastSuccessfulRunId") - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("SourceId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("AreaId"); - - b.HasIndex("LastSuccessfulRunId"); - - b.HasIndex("SourceId"); - - b.ToTable("MissionDefinitions"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionRun", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AreaId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Comment") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("Description") - .HasMaxLength(450) - .HasColumnType("character varying(450)"); - - b.Property("DesiredStartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("EndTime") - .HasColumnType("timestamp with time zone"); - - b.Property("EstimatedDuration") - .HasColumnType("bigint"); - - b.Property("InstallationCode") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("IsarMissionId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("MissionRunPriority") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("StartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("StatusReason") - .HasMaxLength(450) - .HasColumnType("character varying(450)"); - - b.HasKey("Id"); - - b.HasIndex("AreaId"); - - b.HasIndex("RobotId"); - - b.ToTable("MissionRuns"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionTask", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("EchoPoseId") - .HasColumnType("integer"); - - b.Property("EchoTagLink") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("EndTime") - .HasColumnType("timestamp with time zone"); - - b.Property("IsarTaskId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionRunId") - .HasColumnType("text"); - - b.Property("StartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("TagId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("TaskOrder") - .HasColumnType("integer"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("MissionRunId"); - - b.ToTable("MissionTasks"); - }); - - modelBuilder.Entity("Api.Database.Models.Plant", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("InstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PlantCode") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(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("text"); - - b.Property("BatteryLevel") - .HasColumnType("real"); - - b.Property("CurrentAreaId") - .HasColumnType("text"); - - b.Property("CurrentInstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("CurrentMissionId") - .HasColumnType("text"); - - b.Property("Host") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("IsarConnected") - .HasColumnType("boolean"); - - b.Property("IsarId") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionQueueFrozen") - .HasColumnType("boolean"); - - b.Property("ModelId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Port") - .HasColumnType("integer"); - - b.Property("PressureLevel") - .HasColumnType("real"); - - b.Property("SerialNumber") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("CurrentAreaId"); - - b.HasIndex("CurrentInstallationId"); - - b.HasIndex("ModelId"); - - b.ToTable("Robots"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotBatteryTimeseries", b => - { - b.Property("BatteryLevel") - .HasColumnType("real"); - - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Time") - .HasColumnType("timestamp with time zone"); - - b.ToTable("RobotBatteryTimeseries"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotModel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AverageDurationPerTag") - .HasColumnType("real"); - - b.Property("BatteryWarningThreshold") - .HasColumnType("real"); - - b.Property("LowerPressureWarningThreshold") - .HasColumnType("real"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - b.Property("UpperPressureWarningThreshold") - .HasColumnType("real"); - - b.HasKey("Id"); - - b.HasIndex("Type") - .IsUnique(); - - b.ToTable("RobotModels"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotPoseTimeseries", b => - { - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("OrientationW") - .HasColumnType("real"); - - b.Property("OrientationX") - .HasColumnType("real"); - - b.Property("OrientationY") - .HasColumnType("real"); - - b.Property("OrientationZ") - .HasColumnType("real"); - - b.Property("PositionX") - .HasColumnType("real"); - - b.Property("PositionY") - .HasColumnType("real"); - - b.Property("PositionZ") - .HasColumnType("real"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Time") - .HasColumnType("timestamp with time zone"); - - b.ToTable("RobotPoseTimeseries"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotPressureTimeseries", b => - { - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("Pressure") - .HasColumnType("real"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Time") - .HasColumnType("timestamp with time zone"); - - b.ToTable("RobotPressureTimeseries"); - }); - - modelBuilder.Entity("Api.Database.Models.SafePosition", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AreaId") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("AreaId"); - - b.ToTable("SafePositions"); - }); - - modelBuilder.Entity("Api.Database.Models.Source", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("SourceId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.ToTable("Sources"); - }); - - modelBuilder.Entity("Api.Database.Models.AccessRole", b => - { - b.HasOne("Api.Database.Models.Installation", "Installation") - .WithMany() - .HasForeignKey("InstallationId"); - - b.Navigation("Installation"); - }); - - 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.DefaultLocalizationPose", "DefaultLocalizationPose") - .WithMany() - .HasForeignKey("DefaultLocalizationPoseId"); - - 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.MapMetadata", "MapMetadata", b1 => - { - b1.Property("AreaId") - .HasColumnType("text"); - - b1.Property("MapName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.HasKey("AreaId"); - - b1.ToTable("Areas"); - - b1.WithOwner() - .HasForeignKey("AreaId"); - - b1.OwnsOne("Api.Database.Models.Boundary", "Boundary", b2 => - { - b2.Property("MapMetadataAreaId") - .HasColumnType("text"); - - b2.Property("X1") - .HasColumnType("double precision"); - - b2.Property("X2") - .HasColumnType("double precision"); - - b2.Property("Y1") - .HasColumnType("double precision"); - - b2.Property("Y2") - .HasColumnType("double precision"); - - b2.Property("Z1") - .HasColumnType("double precision"); - - b2.Property("Z2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataAreaId"); - - b2.ToTable("Areas"); - - b2.WithOwner() - .HasForeignKey("MapMetadataAreaId"); - }); - - b1.OwnsOne("Api.Database.Models.TransformationMatrices", "TransformationMatrices", b2 => - { - b2.Property("MapMetadataAreaId") - .HasColumnType("text"); - - b2.Property("C1") - .HasColumnType("double precision"); - - b2.Property("C2") - .HasColumnType("double precision"); - - b2.Property("D1") - .HasColumnType("double precision"); - - b2.Property("D2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataAreaId"); - - b2.ToTable("Areas"); - - b2.WithOwner() - .HasForeignKey("MapMetadataAreaId"); - }); - - b1.Navigation("Boundary") - .IsRequired(); - - b1.Navigation("TransformationMatrices") - .IsRequired(); - }); - - b.Navigation("Deck"); - - b.Navigation("DefaultLocalizationPose"); - - b.Navigation("Installation"); - - b.Navigation("MapMetadata") - .IsRequired(); - - b.Navigation("Plant"); - }); - - modelBuilder.Entity("Api.Database.Models.Deck", b => - { - b.HasOne("Api.Database.Models.DefaultLocalizationPose", "DefaultLocalizationPose") - .WithMany() - .HasForeignKey("DefaultLocalizationPoseId"); - - 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.Navigation("DefaultLocalizationPose"); - - b.Navigation("Installation"); - - b.Navigation("Plant"); - }); - - modelBuilder.Entity("Api.Database.Models.DefaultLocalizationPose", b => - { - b.OwnsOne("Api.Database.Models.Pose", "Pose", b1 => - { - b1.Property("DefaultLocalizationPoseId") - .HasColumnType("text"); - - b1.HasKey("DefaultLocalizationPoseId"); - - b1.ToTable("DefaultLocalizationPoses"); - - b1.WithOwner() - .HasForeignKey("DefaultLocalizationPoseId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseDefaultLocalizationPoseId") - .HasColumnType("text"); - - b2.Property("W") - .HasColumnType("real"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseDefaultLocalizationPoseId"); - - b2.ToTable("DefaultLocalizationPoses"); - - b2.WithOwner() - .HasForeignKey("PoseDefaultLocalizationPoseId"); - }); - - b1.OwnsOne("Api.Database.Models.Position", "Position", b2 => - { - b2.Property("PoseDefaultLocalizationPoseId") - .HasColumnType("text"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseDefaultLocalizationPoseId"); - - b2.ToTable("DefaultLocalizationPoses"); - - b2.WithOwner() - .HasForeignKey("PoseDefaultLocalizationPoseId"); - }); - - b1.Navigation("Orientation") - .IsRequired(); - - b1.Navigation("Position") - .IsRequired(); - }); - - b.Navigation("Pose") - .IsRequired(); - }); - - modelBuilder.Entity("Api.Database.Models.Inspection", b => - { - b.HasOne("Api.Database.Models.MissionTask", null) - .WithMany("Inspections") - .HasForeignKey("MissionTaskId"); - - b.OwnsOne("Api.Database.Models.Position", "InspectionTarget", b1 => - { - b1.Property("InspectionId") - .HasColumnType("text"); - - b1.Property("X") - .HasColumnType("real"); - - b1.Property("Y") - .HasColumnType("real"); - - b1.Property("Z") - .HasColumnType("real"); - - b1.HasKey("InspectionId"); - - b1.ToTable("Inspections"); - - b1.WithOwner() - .HasForeignKey("InspectionId"); - }); - - b.Navigation("InspectionTarget") - .IsRequired(); - }); - - modelBuilder.Entity("Api.Database.Models.InspectionFinding", b => - { - b.HasOne("Api.Database.Models.Inspection", null) - .WithMany("InspectionFindings") - .HasForeignKey("InspectionId"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionDefinition", b => - { - b.HasOne("Api.Database.Models.Area", "Area") - .WithMany() - .HasForeignKey("AreaId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Api.Database.Models.MissionRun", "LastSuccessfulRun") - .WithMany() - .HasForeignKey("LastSuccessfulRunId"); - - b.HasOne("Api.Database.Models.Source", "Source") - .WithMany() - .HasForeignKey("SourceId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Area"); - - b.Navigation("LastSuccessfulRun"); - - b.Navigation("Source"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionRun", b => - { - b.HasOne("Api.Database.Models.Area", "Area") - .WithMany() - .HasForeignKey("AreaId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Api.Database.Models.Robot", "Robot") - .WithMany() - .HasForeignKey("RobotId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.OwnsOne("Api.Database.Models.MapMetadata", "Map", b1 => - { - b1.Property("MissionRunId") - .HasColumnType("text"); - - b1.Property("MapName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.HasKey("MissionRunId"); - - b1.ToTable("MissionRuns"); - - b1.WithOwner() - .HasForeignKey("MissionRunId"); - - b1.OwnsOne("Api.Database.Models.Boundary", "Boundary", b2 => - { - b2.Property("MapMetadataMissionRunId") - .HasColumnType("text"); - - b2.Property("X1") - .HasColumnType("double precision"); - - b2.Property("X2") - .HasColumnType("double precision"); - - b2.Property("Y1") - .HasColumnType("double precision"); - - b2.Property("Y2") - .HasColumnType("double precision"); - - b2.Property("Z1") - .HasColumnType("double precision"); - - b2.Property("Z2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataMissionRunId"); - - b2.ToTable("MissionRuns"); - - b2.WithOwner() - .HasForeignKey("MapMetadataMissionRunId"); - }); - - b1.OwnsOne("Api.Database.Models.TransformationMatrices", "TransformationMatrices", b2 => - { - b2.Property("MapMetadataMissionRunId") - .HasColumnType("text"); - - b2.Property("C1") - .HasColumnType("double precision"); - - b2.Property("C2") - .HasColumnType("double precision"); - - b2.Property("D1") - .HasColumnType("double precision"); - - b2.Property("D2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataMissionRunId"); - - b2.ToTable("MissionRuns"); - - b2.WithOwner() - .HasForeignKey("MapMetadataMissionRunId"); - }); - - b1.Navigation("Boundary") - .IsRequired(); - - b1.Navigation("TransformationMatrices") - .IsRequired(); - }); - - b.Navigation("Area"); - - b.Navigation("Map"); - - b.Navigation("Robot"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionTask", b => - { - b.HasOne("Api.Database.Models.MissionRun", null) - .WithMany("Tasks") - .HasForeignKey("MissionRunId"); - - b.OwnsOne("Api.Database.Models.Pose", "RobotPose", b1 => - { - b1.Property("MissionTaskId") - .HasColumnType("text"); - - b1.HasKey("MissionTaskId"); - - b1.ToTable("MissionTasks"); - - b1.WithOwner() - .HasForeignKey("MissionTaskId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseMissionTaskId") - .HasColumnType("text"); - - b2.Property("W") - .HasColumnType("real"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseMissionTaskId"); - - b2.ToTable("MissionTasks"); - - b2.WithOwner() - .HasForeignKey("PoseMissionTaskId"); - }); - - b1.OwnsOne("Api.Database.Models.Position", "Position", b2 => - { - b2.Property("PoseMissionTaskId") - .HasColumnType("text"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseMissionTaskId"); - - b2.ToTable("MissionTasks"); - - b2.WithOwner() - .HasForeignKey("PoseMissionTaskId"); - }); - - b1.Navigation("Orientation") - .IsRequired(); - - b1.Navigation("Position") - .IsRequired(); - }); - - b.Navigation("RobotPose") - .IsRequired(); - }); - - modelBuilder.Entity("Api.Database.Models.Plant", b => - { - b.HasOne("Api.Database.Models.Installation", "Installation") - .WithMany() - .HasForeignKey("InstallationId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - 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.Installation", "CurrentInstallation") - .WithMany() - .HasForeignKey("CurrentInstallationId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - 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("text"); - - b1.HasKey("RobotId"); - - b1.ToTable("Robots"); - - b1.WithOwner() - .HasForeignKey("RobotId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseRobotId") - .HasColumnType("text"); - - 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("text"); - - 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("text"); - - b1.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b1.Property("ShouldRotate270Clockwise") - .HasColumnType("boolean"); - - b1.Property("Type") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b1.Property("Url") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.HasKey("Id"); - - b1.HasIndex("RobotId"); - - b1.ToTable("VideoStream"); - - b1.WithOwner() - .HasForeignKey("RobotId"); - }); - - b.Navigation("CurrentArea"); - - b.Navigation("CurrentInstallation"); - - 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("text"); - - b1.HasKey("SafePositionId"); - - b1.ToTable("SafePositions"); - - b1.WithOwner() - .HasForeignKey("SafePositionId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseSafePositionId") - .HasColumnType("text"); - - 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("text"); - - 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"); - }); - - modelBuilder.Entity("Api.Database.Models.Inspection", b => - { - b.Navigation("InspectionFindings"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionRun", b => - { - b.Navigation("Tasks"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionTask", b => - { - b.Navigation("Inspections"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/backend/api/Migrations/20240322094856_RenameRobotEnabled.cs b/backend/api/Migrations/20240322094856_RenameRobotEnabled.cs deleted file mode 100644 index 82c63625f..000000000 --- a/backend/api/Migrations/20240322094856_RenameRobotEnabled.cs +++ /dev/null @@ -1,28 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Api.Migrations -{ - /// - public partial class RenameRobotEnabled : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.RenameColumn( - name: "Enabled", - table: "Robots", - newName: "IsarConnected"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.RenameColumn( - name: "IsarConnected", - table: "Robots", - newName: "Enabled"); - } - } -} diff --git a/backend/api/Migrations/20240322141359_AddDeprecatedToRobot.Designer.cs b/backend/api/Migrations/20240322141359_AddDeprecatedToRobot.Designer.cs deleted file mode 100644 index c0fe60737..000000000 --- a/backend/api/Migrations/20240322141359_AddDeprecatedToRobot.Designer.cs +++ /dev/null @@ -1,1348 +0,0 @@ -// -using System; -using Api.Database.Context; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace Api.Migrations -{ - [DbContext(typeof(FlotillaDbContext))] - [Migration("20240322141359_AddDeprecatedToRobot")] - partial class AddDeprecatedToRobot - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "8.0.0") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("Api.Database.Models.AccessRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AccessLevel") - .IsRequired() - .HasColumnType("text"); - - b.Property("InstallationId") - .HasColumnType("text"); - - b.Property("RoleName") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("InstallationId"); - - b.ToTable("AccessRoles"); - }); - - modelBuilder.Entity("Api.Database.Models.Area", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("DeckId") - .IsRequired() - .HasColumnType("text"); - - b.Property("DefaultLocalizationPoseId") - .HasColumnType("text"); - - b.Property("InstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PlantId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("DeckId"); - - b.HasIndex("DefaultLocalizationPoseId"); - - b.HasIndex("InstallationId"); - - b.HasIndex("PlantId"); - - b.ToTable("Areas"); - }); - - modelBuilder.Entity("Api.Database.Models.Deck", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("DefaultLocalizationPoseId") - .HasColumnType("text"); - - b.Property("InstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PlantId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("DefaultLocalizationPoseId"); - - b.HasIndex("InstallationId"); - - b.HasIndex("PlantId"); - - b.ToTable("Decks"); - }); - - modelBuilder.Entity("Api.Database.Models.DefaultLocalizationPose", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.ToTable("DefaultLocalizationPoses"); - }); - - modelBuilder.Entity("Api.Database.Models.Inspection", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AnalysisType") - .HasColumnType("text"); - - b.Property("EndTime") - .HasColumnType("timestamp with time zone"); - - b.Property("InspectionType") - .IsRequired() - .HasColumnType("text"); - - b.Property("InspectionUrl") - .HasMaxLength(250) - .HasColumnType("character varying(250)"); - - b.Property("IsarStepId") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionTaskId") - .HasColumnType("text"); - - b.Property("StartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("VideoDuration") - .HasColumnType("real"); - - b.HasKey("Id"); - - b.HasIndex("MissionTaskId"); - - b.ToTable("Inspections"); - }); - - modelBuilder.Entity("Api.Database.Models.InspectionFinding", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("Finding") - .IsRequired() - .HasColumnType("text"); - - b.Property("InspectionDate") - .HasColumnType("timestamp with time zone"); - - b.Property("InspectionId") - .HasColumnType("text"); - - b.Property("IsarStepId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("InspectionId"); - - b.ToTable("InspectionFindings"); - }); - - modelBuilder.Entity("Api.Database.Models.Installation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("InstallationCode") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.HasKey("Id"); - - b.HasIndex("InstallationCode") - .IsUnique(); - - b.ToTable("Installations"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionDefinition", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AreaId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Comment") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("InspectionFrequency") - .HasColumnType("bigint"); - - b.Property("InstallationCode") - .IsRequired() - .HasColumnType("text"); - - b.Property("IsDeprecated") - .HasColumnType("boolean"); - - b.Property("LastSuccessfulRunId") - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("SourceId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("AreaId"); - - b.HasIndex("LastSuccessfulRunId"); - - b.HasIndex("SourceId"); - - b.ToTable("MissionDefinitions"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionRun", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AreaId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Comment") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("Description") - .HasMaxLength(450) - .HasColumnType("character varying(450)"); - - b.Property("DesiredStartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("EndTime") - .HasColumnType("timestamp with time zone"); - - b.Property("EstimatedDuration") - .HasColumnType("bigint"); - - b.Property("InstallationCode") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("IsarMissionId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("MissionRunPriority") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("StartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("StatusReason") - .HasMaxLength(450) - .HasColumnType("character varying(450)"); - - b.HasKey("Id"); - - b.HasIndex("AreaId"); - - b.HasIndex("RobotId"); - - b.ToTable("MissionRuns"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionTask", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("EchoPoseId") - .HasColumnType("integer"); - - b.Property("EchoTagLink") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("EndTime") - .HasColumnType("timestamp with time zone"); - - b.Property("IsarTaskId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionRunId") - .HasColumnType("text"); - - b.Property("StartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("TagId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("TaskOrder") - .HasColumnType("integer"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("MissionRunId"); - - b.ToTable("MissionTasks"); - }); - - modelBuilder.Entity("Api.Database.Models.Plant", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("InstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PlantCode") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(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("text"); - - b.Property("BatteryLevel") - .HasColumnType("real"); - - b.Property("CurrentAreaId") - .HasColumnType("text"); - - b.Property("CurrentInstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("CurrentMissionId") - .HasColumnType("text"); - - b.Property("Deprecated") - .HasColumnType("boolean"); - - b.Property("Host") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("IsarConnected") - .HasColumnType("boolean"); - - b.Property("IsarId") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionQueueFrozen") - .HasColumnType("boolean"); - - b.Property("ModelId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Port") - .HasColumnType("integer"); - - b.Property("PressureLevel") - .HasColumnType("real"); - - b.Property("SerialNumber") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("CurrentAreaId"); - - b.HasIndex("CurrentInstallationId"); - - b.HasIndex("ModelId"); - - b.ToTable("Robots"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotBatteryTimeseries", b => - { - b.Property("BatteryLevel") - .HasColumnType("real"); - - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Time") - .HasColumnType("timestamp with time zone"); - - b.ToTable("RobotBatteryTimeseries"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotModel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AverageDurationPerTag") - .HasColumnType("real"); - - b.Property("BatteryWarningThreshold") - .HasColumnType("real"); - - b.Property("LowerPressureWarningThreshold") - .HasColumnType("real"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - b.Property("UpperPressureWarningThreshold") - .HasColumnType("real"); - - b.HasKey("Id"); - - b.HasIndex("Type") - .IsUnique(); - - b.ToTable("RobotModels"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotPoseTimeseries", b => - { - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("OrientationW") - .HasColumnType("real"); - - b.Property("OrientationX") - .HasColumnType("real"); - - b.Property("OrientationY") - .HasColumnType("real"); - - b.Property("OrientationZ") - .HasColumnType("real"); - - b.Property("PositionX") - .HasColumnType("real"); - - b.Property("PositionY") - .HasColumnType("real"); - - b.Property("PositionZ") - .HasColumnType("real"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Time") - .HasColumnType("timestamp with time zone"); - - b.ToTable("RobotPoseTimeseries"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotPressureTimeseries", b => - { - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("Pressure") - .HasColumnType("real"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Time") - .HasColumnType("timestamp with time zone"); - - b.ToTable("RobotPressureTimeseries"); - }); - - modelBuilder.Entity("Api.Database.Models.SafePosition", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AreaId") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("AreaId"); - - b.ToTable("SafePositions"); - }); - - modelBuilder.Entity("Api.Database.Models.Source", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("SourceId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.ToTable("Sources"); - }); - - modelBuilder.Entity("Api.Database.Models.AccessRole", b => - { - b.HasOne("Api.Database.Models.Installation", "Installation") - .WithMany() - .HasForeignKey("InstallationId"); - - b.Navigation("Installation"); - }); - - 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.DefaultLocalizationPose", "DefaultLocalizationPose") - .WithMany() - .HasForeignKey("DefaultLocalizationPoseId"); - - 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.MapMetadata", "MapMetadata", b1 => - { - b1.Property("AreaId") - .HasColumnType("text"); - - b1.Property("MapName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.HasKey("AreaId"); - - b1.ToTable("Areas"); - - b1.WithOwner() - .HasForeignKey("AreaId"); - - b1.OwnsOne("Api.Database.Models.Boundary", "Boundary", b2 => - { - b2.Property("MapMetadataAreaId") - .HasColumnType("text"); - - b2.Property("X1") - .HasColumnType("double precision"); - - b2.Property("X2") - .HasColumnType("double precision"); - - b2.Property("Y1") - .HasColumnType("double precision"); - - b2.Property("Y2") - .HasColumnType("double precision"); - - b2.Property("Z1") - .HasColumnType("double precision"); - - b2.Property("Z2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataAreaId"); - - b2.ToTable("Areas"); - - b2.WithOwner() - .HasForeignKey("MapMetadataAreaId"); - }); - - b1.OwnsOne("Api.Database.Models.TransformationMatrices", "TransformationMatrices", b2 => - { - b2.Property("MapMetadataAreaId") - .HasColumnType("text"); - - b2.Property("C1") - .HasColumnType("double precision"); - - b2.Property("C2") - .HasColumnType("double precision"); - - b2.Property("D1") - .HasColumnType("double precision"); - - b2.Property("D2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataAreaId"); - - b2.ToTable("Areas"); - - b2.WithOwner() - .HasForeignKey("MapMetadataAreaId"); - }); - - b1.Navigation("Boundary") - .IsRequired(); - - b1.Navigation("TransformationMatrices") - .IsRequired(); - }); - - b.Navigation("Deck"); - - b.Navigation("DefaultLocalizationPose"); - - b.Navigation("Installation"); - - b.Navigation("MapMetadata") - .IsRequired(); - - b.Navigation("Plant"); - }); - - modelBuilder.Entity("Api.Database.Models.Deck", b => - { - b.HasOne("Api.Database.Models.DefaultLocalizationPose", "DefaultLocalizationPose") - .WithMany() - .HasForeignKey("DefaultLocalizationPoseId"); - - 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.Navigation("DefaultLocalizationPose"); - - b.Navigation("Installation"); - - b.Navigation("Plant"); - }); - - modelBuilder.Entity("Api.Database.Models.DefaultLocalizationPose", b => - { - b.OwnsOne("Api.Database.Models.Pose", "Pose", b1 => - { - b1.Property("DefaultLocalizationPoseId") - .HasColumnType("text"); - - b1.HasKey("DefaultLocalizationPoseId"); - - b1.ToTable("DefaultLocalizationPoses"); - - b1.WithOwner() - .HasForeignKey("DefaultLocalizationPoseId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseDefaultLocalizationPoseId") - .HasColumnType("text"); - - b2.Property("W") - .HasColumnType("real"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseDefaultLocalizationPoseId"); - - b2.ToTable("DefaultLocalizationPoses"); - - b2.WithOwner() - .HasForeignKey("PoseDefaultLocalizationPoseId"); - }); - - b1.OwnsOne("Api.Database.Models.Position", "Position", b2 => - { - b2.Property("PoseDefaultLocalizationPoseId") - .HasColumnType("text"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseDefaultLocalizationPoseId"); - - b2.ToTable("DefaultLocalizationPoses"); - - b2.WithOwner() - .HasForeignKey("PoseDefaultLocalizationPoseId"); - }); - - b1.Navigation("Orientation") - .IsRequired(); - - b1.Navigation("Position") - .IsRequired(); - }); - - b.Navigation("Pose") - .IsRequired(); - }); - - modelBuilder.Entity("Api.Database.Models.Inspection", b => - { - b.HasOne("Api.Database.Models.MissionTask", null) - .WithMany("Inspections") - .HasForeignKey("MissionTaskId"); - - b.OwnsOne("Api.Database.Models.Position", "InspectionTarget", b1 => - { - b1.Property("InspectionId") - .HasColumnType("text"); - - b1.Property("X") - .HasColumnType("real"); - - b1.Property("Y") - .HasColumnType("real"); - - b1.Property("Z") - .HasColumnType("real"); - - b1.HasKey("InspectionId"); - - b1.ToTable("Inspections"); - - b1.WithOwner() - .HasForeignKey("InspectionId"); - }); - - b.Navigation("InspectionTarget") - .IsRequired(); - }); - - modelBuilder.Entity("Api.Database.Models.InspectionFinding", b => - { - b.HasOne("Api.Database.Models.Inspection", null) - .WithMany("InspectionFindings") - .HasForeignKey("InspectionId"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionDefinition", b => - { - b.HasOne("Api.Database.Models.Area", "Area") - .WithMany() - .HasForeignKey("AreaId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Api.Database.Models.MissionRun", "LastSuccessfulRun") - .WithMany() - .HasForeignKey("LastSuccessfulRunId"); - - b.HasOne("Api.Database.Models.Source", "Source") - .WithMany() - .HasForeignKey("SourceId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Area"); - - b.Navigation("LastSuccessfulRun"); - - b.Navigation("Source"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionRun", b => - { - b.HasOne("Api.Database.Models.Area", "Area") - .WithMany() - .HasForeignKey("AreaId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Api.Database.Models.Robot", "Robot") - .WithMany() - .HasForeignKey("RobotId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.OwnsOne("Api.Database.Models.MapMetadata", "Map", b1 => - { - b1.Property("MissionRunId") - .HasColumnType("text"); - - b1.Property("MapName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.HasKey("MissionRunId"); - - b1.ToTable("MissionRuns"); - - b1.WithOwner() - .HasForeignKey("MissionRunId"); - - b1.OwnsOne("Api.Database.Models.Boundary", "Boundary", b2 => - { - b2.Property("MapMetadataMissionRunId") - .HasColumnType("text"); - - b2.Property("X1") - .HasColumnType("double precision"); - - b2.Property("X2") - .HasColumnType("double precision"); - - b2.Property("Y1") - .HasColumnType("double precision"); - - b2.Property("Y2") - .HasColumnType("double precision"); - - b2.Property("Z1") - .HasColumnType("double precision"); - - b2.Property("Z2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataMissionRunId"); - - b2.ToTable("MissionRuns"); - - b2.WithOwner() - .HasForeignKey("MapMetadataMissionRunId"); - }); - - b1.OwnsOne("Api.Database.Models.TransformationMatrices", "TransformationMatrices", b2 => - { - b2.Property("MapMetadataMissionRunId") - .HasColumnType("text"); - - b2.Property("C1") - .HasColumnType("double precision"); - - b2.Property("C2") - .HasColumnType("double precision"); - - b2.Property("D1") - .HasColumnType("double precision"); - - b2.Property("D2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataMissionRunId"); - - b2.ToTable("MissionRuns"); - - b2.WithOwner() - .HasForeignKey("MapMetadataMissionRunId"); - }); - - b1.Navigation("Boundary") - .IsRequired(); - - b1.Navigation("TransformationMatrices") - .IsRequired(); - }); - - b.Navigation("Area"); - - b.Navigation("Map"); - - b.Navigation("Robot"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionTask", b => - { - b.HasOne("Api.Database.Models.MissionRun", null) - .WithMany("Tasks") - .HasForeignKey("MissionRunId"); - - b.OwnsOne("Api.Database.Models.Pose", "RobotPose", b1 => - { - b1.Property("MissionTaskId") - .HasColumnType("text"); - - b1.HasKey("MissionTaskId"); - - b1.ToTable("MissionTasks"); - - b1.WithOwner() - .HasForeignKey("MissionTaskId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseMissionTaskId") - .HasColumnType("text"); - - b2.Property("W") - .HasColumnType("real"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseMissionTaskId"); - - b2.ToTable("MissionTasks"); - - b2.WithOwner() - .HasForeignKey("PoseMissionTaskId"); - }); - - b1.OwnsOne("Api.Database.Models.Position", "Position", b2 => - { - b2.Property("PoseMissionTaskId") - .HasColumnType("text"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseMissionTaskId"); - - b2.ToTable("MissionTasks"); - - b2.WithOwner() - .HasForeignKey("PoseMissionTaskId"); - }); - - b1.Navigation("Orientation") - .IsRequired(); - - b1.Navigation("Position") - .IsRequired(); - }); - - b.Navigation("RobotPose") - .IsRequired(); - }); - - modelBuilder.Entity("Api.Database.Models.Plant", b => - { - b.HasOne("Api.Database.Models.Installation", "Installation") - .WithMany() - .HasForeignKey("InstallationId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - 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.Installation", "CurrentInstallation") - .WithMany() - .HasForeignKey("CurrentInstallationId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - 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("text"); - - b1.HasKey("RobotId"); - - b1.ToTable("Robots"); - - b1.WithOwner() - .HasForeignKey("RobotId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseRobotId") - .HasColumnType("text"); - - 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("text"); - - 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("text"); - - b1.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b1.Property("ShouldRotate270Clockwise") - .HasColumnType("boolean"); - - b1.Property("Type") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b1.Property("Url") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.HasKey("Id"); - - b1.HasIndex("RobotId"); - - b1.ToTable("VideoStream"); - - b1.WithOwner() - .HasForeignKey("RobotId"); - }); - - b.Navigation("CurrentArea"); - - b.Navigation("CurrentInstallation"); - - 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("text"); - - b1.HasKey("SafePositionId"); - - b1.ToTable("SafePositions"); - - b1.WithOwner() - .HasForeignKey("SafePositionId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseSafePositionId") - .HasColumnType("text"); - - 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("text"); - - 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"); - }); - - modelBuilder.Entity("Api.Database.Models.Inspection", b => - { - b.Navigation("InspectionFindings"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionRun", b => - { - b.Navigation("Tasks"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionTask", b => - { - b.Navigation("Inspections"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/backend/api/Migrations/20240322141359_AddDeprecatedToRobot.cs b/backend/api/Migrations/20240322141359_AddDeprecatedToRobot.cs deleted file mode 100644 index 354a9f640..000000000 --- a/backend/api/Migrations/20240322141359_AddDeprecatedToRobot.cs +++ /dev/null @@ -1,29 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Api.Migrations -{ - /// - public partial class AddDeprecatedToRobot : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "Deprecated", - table: "Robots", - type: "boolean", - nullable: false, - defaultValue: false); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "Deprecated", - table: "Robots"); - } - } -} diff --git a/backend/api/Migrations/20240403071238_AddRobotCapabilitesToRobot.Designer.cs b/backend/api/Migrations/20240403071238_AddRobotCapabilitesToRobot.Designer.cs deleted file mode 100644 index e49a34a82..000000000 --- a/backend/api/Migrations/20240403071238_AddRobotCapabilitesToRobot.Designer.cs +++ /dev/null @@ -1,1351 +0,0 @@ -// -using System; -using Api.Database.Context; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace Api.Migrations -{ - [DbContext(typeof(FlotillaDbContext))] - [Migration("20240403071238_AddRobotCapabilitesToRobot")] - partial class AddRobotCapabilitesToRobot - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "8.0.0") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("Api.Database.Models.AccessRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AccessLevel") - .IsRequired() - .HasColumnType("text"); - - b.Property("InstallationId") - .HasColumnType("text"); - - b.Property("RoleName") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("InstallationId"); - - b.ToTable("AccessRoles"); - }); - - modelBuilder.Entity("Api.Database.Models.Area", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("DeckId") - .IsRequired() - .HasColumnType("text"); - - b.Property("DefaultLocalizationPoseId") - .HasColumnType("text"); - - b.Property("InstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PlantId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("DeckId"); - - b.HasIndex("DefaultLocalizationPoseId"); - - b.HasIndex("InstallationId"); - - b.HasIndex("PlantId"); - - b.ToTable("Areas"); - }); - - modelBuilder.Entity("Api.Database.Models.Deck", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("DefaultLocalizationPoseId") - .HasColumnType("text"); - - b.Property("InstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PlantId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("DefaultLocalizationPoseId"); - - b.HasIndex("InstallationId"); - - b.HasIndex("PlantId"); - - b.ToTable("Decks"); - }); - - modelBuilder.Entity("Api.Database.Models.DefaultLocalizationPose", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.ToTable("DefaultLocalizationPoses"); - }); - - modelBuilder.Entity("Api.Database.Models.Inspection", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AnalysisType") - .HasColumnType("text"); - - b.Property("EndTime") - .HasColumnType("timestamp with time zone"); - - b.Property("InspectionType") - .IsRequired() - .HasColumnType("text"); - - b.Property("InspectionUrl") - .HasMaxLength(250) - .HasColumnType("character varying(250)"); - - b.Property("IsarStepId") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionTaskId") - .HasColumnType("text"); - - b.Property("StartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("VideoDuration") - .HasColumnType("real"); - - b.HasKey("Id"); - - b.HasIndex("MissionTaskId"); - - b.ToTable("Inspections"); - }); - - modelBuilder.Entity("Api.Database.Models.InspectionFinding", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("Finding") - .IsRequired() - .HasColumnType("text"); - - b.Property("InspectionDate") - .HasColumnType("timestamp with time zone"); - - b.Property("InspectionId") - .HasColumnType("text"); - - b.Property("IsarStepId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("InspectionId"); - - b.ToTable("InspectionFindings"); - }); - - modelBuilder.Entity("Api.Database.Models.Installation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("InstallationCode") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.HasKey("Id"); - - b.HasIndex("InstallationCode") - .IsUnique(); - - b.ToTable("Installations"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionDefinition", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AreaId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Comment") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("InspectionFrequency") - .HasColumnType("bigint"); - - b.Property("InstallationCode") - .IsRequired() - .HasColumnType("text"); - - b.Property("IsDeprecated") - .HasColumnType("boolean"); - - b.Property("LastSuccessfulRunId") - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("SourceId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("AreaId"); - - b.HasIndex("LastSuccessfulRunId"); - - b.HasIndex("SourceId"); - - b.ToTable("MissionDefinitions"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionRun", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AreaId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Comment") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("Description") - .HasMaxLength(450) - .HasColumnType("character varying(450)"); - - b.Property("DesiredStartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("EndTime") - .HasColumnType("timestamp with time zone"); - - b.Property("EstimatedDuration") - .HasColumnType("bigint"); - - b.Property("InstallationCode") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("IsarMissionId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("MissionRunPriority") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("StartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("StatusReason") - .HasMaxLength(450) - .HasColumnType("character varying(450)"); - - b.HasKey("Id"); - - b.HasIndex("AreaId"); - - b.HasIndex("RobotId"); - - b.ToTable("MissionRuns"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionTask", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("EchoPoseId") - .HasColumnType("integer"); - - b.Property("EchoTagLink") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("EndTime") - .HasColumnType("timestamp with time zone"); - - b.Property("IsarTaskId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionRunId") - .HasColumnType("text"); - - b.Property("StartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("TagId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("TaskOrder") - .HasColumnType("integer"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("MissionRunId"); - - b.ToTable("MissionTasks"); - }); - - modelBuilder.Entity("Api.Database.Models.Plant", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("InstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PlantCode") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(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("text"); - - b.Property("BatteryLevel") - .HasColumnType("real"); - - b.Property("CurrentAreaId") - .HasColumnType("text"); - - b.Property("CurrentInstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("CurrentMissionId") - .HasColumnType("text"); - - b.Property("Deprecated") - .HasColumnType("boolean"); - - b.Property("Host") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("IsarConnected") - .HasColumnType("boolean"); - - b.Property("IsarId") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionQueueFrozen") - .HasColumnType("boolean"); - - b.Property("ModelId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Port") - .HasColumnType("integer"); - - b.Property("PressureLevel") - .HasColumnType("real"); - - b.Property("RobotCapabilities") - .HasColumnType("text"); - - b.Property("SerialNumber") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("CurrentAreaId"); - - b.HasIndex("CurrentInstallationId"); - - b.HasIndex("ModelId"); - - b.ToTable("Robots"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotBatteryTimeseries", b => - { - b.Property("BatteryLevel") - .HasColumnType("real"); - - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Time") - .HasColumnType("timestamp with time zone"); - - b.ToTable("RobotBatteryTimeseries"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotModel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AverageDurationPerTag") - .HasColumnType("real"); - - b.Property("BatteryWarningThreshold") - .HasColumnType("real"); - - b.Property("LowerPressureWarningThreshold") - .HasColumnType("real"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - b.Property("UpperPressureWarningThreshold") - .HasColumnType("real"); - - b.HasKey("Id"); - - b.HasIndex("Type") - .IsUnique(); - - b.ToTable("RobotModels"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotPoseTimeseries", b => - { - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("OrientationW") - .HasColumnType("real"); - - b.Property("OrientationX") - .HasColumnType("real"); - - b.Property("OrientationY") - .HasColumnType("real"); - - b.Property("OrientationZ") - .HasColumnType("real"); - - b.Property("PositionX") - .HasColumnType("real"); - - b.Property("PositionY") - .HasColumnType("real"); - - b.Property("PositionZ") - .HasColumnType("real"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Time") - .HasColumnType("timestamp with time zone"); - - b.ToTable("RobotPoseTimeseries"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotPressureTimeseries", b => - { - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("Pressure") - .HasColumnType("real"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Time") - .HasColumnType("timestamp with time zone"); - - b.ToTable("RobotPressureTimeseries"); - }); - - modelBuilder.Entity("Api.Database.Models.SafePosition", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AreaId") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("AreaId"); - - b.ToTable("SafePositions"); - }); - - modelBuilder.Entity("Api.Database.Models.Source", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("SourceId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.ToTable("Sources"); - }); - - modelBuilder.Entity("Api.Database.Models.AccessRole", b => - { - b.HasOne("Api.Database.Models.Installation", "Installation") - .WithMany() - .HasForeignKey("InstallationId"); - - b.Navigation("Installation"); - }); - - 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.DefaultLocalizationPose", "DefaultLocalizationPose") - .WithMany() - .HasForeignKey("DefaultLocalizationPoseId"); - - 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.MapMetadata", "MapMetadata", b1 => - { - b1.Property("AreaId") - .HasColumnType("text"); - - b1.Property("MapName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.HasKey("AreaId"); - - b1.ToTable("Areas"); - - b1.WithOwner() - .HasForeignKey("AreaId"); - - b1.OwnsOne("Api.Database.Models.Boundary", "Boundary", b2 => - { - b2.Property("MapMetadataAreaId") - .HasColumnType("text"); - - b2.Property("X1") - .HasColumnType("double precision"); - - b2.Property("X2") - .HasColumnType("double precision"); - - b2.Property("Y1") - .HasColumnType("double precision"); - - b2.Property("Y2") - .HasColumnType("double precision"); - - b2.Property("Z1") - .HasColumnType("double precision"); - - b2.Property("Z2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataAreaId"); - - b2.ToTable("Areas"); - - b2.WithOwner() - .HasForeignKey("MapMetadataAreaId"); - }); - - b1.OwnsOne("Api.Database.Models.TransformationMatrices", "TransformationMatrices", b2 => - { - b2.Property("MapMetadataAreaId") - .HasColumnType("text"); - - b2.Property("C1") - .HasColumnType("double precision"); - - b2.Property("C2") - .HasColumnType("double precision"); - - b2.Property("D1") - .HasColumnType("double precision"); - - b2.Property("D2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataAreaId"); - - b2.ToTable("Areas"); - - b2.WithOwner() - .HasForeignKey("MapMetadataAreaId"); - }); - - b1.Navigation("Boundary") - .IsRequired(); - - b1.Navigation("TransformationMatrices") - .IsRequired(); - }); - - b.Navigation("Deck"); - - b.Navigation("DefaultLocalizationPose"); - - b.Navigation("Installation"); - - b.Navigation("MapMetadata") - .IsRequired(); - - b.Navigation("Plant"); - }); - - modelBuilder.Entity("Api.Database.Models.Deck", b => - { - b.HasOne("Api.Database.Models.DefaultLocalizationPose", "DefaultLocalizationPose") - .WithMany() - .HasForeignKey("DefaultLocalizationPoseId"); - - 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.Navigation("DefaultLocalizationPose"); - - b.Navigation("Installation"); - - b.Navigation("Plant"); - }); - - modelBuilder.Entity("Api.Database.Models.DefaultLocalizationPose", b => - { - b.OwnsOne("Api.Database.Models.Pose", "Pose", b1 => - { - b1.Property("DefaultLocalizationPoseId") - .HasColumnType("text"); - - b1.HasKey("DefaultLocalizationPoseId"); - - b1.ToTable("DefaultLocalizationPoses"); - - b1.WithOwner() - .HasForeignKey("DefaultLocalizationPoseId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseDefaultLocalizationPoseId") - .HasColumnType("text"); - - b2.Property("W") - .HasColumnType("real"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseDefaultLocalizationPoseId"); - - b2.ToTable("DefaultLocalizationPoses"); - - b2.WithOwner() - .HasForeignKey("PoseDefaultLocalizationPoseId"); - }); - - b1.OwnsOne("Api.Database.Models.Position", "Position", b2 => - { - b2.Property("PoseDefaultLocalizationPoseId") - .HasColumnType("text"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseDefaultLocalizationPoseId"); - - b2.ToTable("DefaultLocalizationPoses"); - - b2.WithOwner() - .HasForeignKey("PoseDefaultLocalizationPoseId"); - }); - - b1.Navigation("Orientation") - .IsRequired(); - - b1.Navigation("Position") - .IsRequired(); - }); - - b.Navigation("Pose") - .IsRequired(); - }); - - modelBuilder.Entity("Api.Database.Models.Inspection", b => - { - b.HasOne("Api.Database.Models.MissionTask", null) - .WithMany("Inspections") - .HasForeignKey("MissionTaskId"); - - b.OwnsOne("Api.Database.Models.Position", "InspectionTarget", b1 => - { - b1.Property("InspectionId") - .HasColumnType("text"); - - b1.Property("X") - .HasColumnType("real"); - - b1.Property("Y") - .HasColumnType("real"); - - b1.Property("Z") - .HasColumnType("real"); - - b1.HasKey("InspectionId"); - - b1.ToTable("Inspections"); - - b1.WithOwner() - .HasForeignKey("InspectionId"); - }); - - b.Navigation("InspectionTarget") - .IsRequired(); - }); - - modelBuilder.Entity("Api.Database.Models.InspectionFinding", b => - { - b.HasOne("Api.Database.Models.Inspection", null) - .WithMany("InspectionFindings") - .HasForeignKey("InspectionId"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionDefinition", b => - { - b.HasOne("Api.Database.Models.Area", "Area") - .WithMany() - .HasForeignKey("AreaId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Api.Database.Models.MissionRun", "LastSuccessfulRun") - .WithMany() - .HasForeignKey("LastSuccessfulRunId"); - - b.HasOne("Api.Database.Models.Source", "Source") - .WithMany() - .HasForeignKey("SourceId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Area"); - - b.Navigation("LastSuccessfulRun"); - - b.Navigation("Source"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionRun", b => - { - b.HasOne("Api.Database.Models.Area", "Area") - .WithMany() - .HasForeignKey("AreaId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Api.Database.Models.Robot", "Robot") - .WithMany() - .HasForeignKey("RobotId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.OwnsOne("Api.Database.Models.MapMetadata", "Map", b1 => - { - b1.Property("MissionRunId") - .HasColumnType("text"); - - b1.Property("MapName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.HasKey("MissionRunId"); - - b1.ToTable("MissionRuns"); - - b1.WithOwner() - .HasForeignKey("MissionRunId"); - - b1.OwnsOne("Api.Database.Models.Boundary", "Boundary", b2 => - { - b2.Property("MapMetadataMissionRunId") - .HasColumnType("text"); - - b2.Property("X1") - .HasColumnType("double precision"); - - b2.Property("X2") - .HasColumnType("double precision"); - - b2.Property("Y1") - .HasColumnType("double precision"); - - b2.Property("Y2") - .HasColumnType("double precision"); - - b2.Property("Z1") - .HasColumnType("double precision"); - - b2.Property("Z2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataMissionRunId"); - - b2.ToTable("MissionRuns"); - - b2.WithOwner() - .HasForeignKey("MapMetadataMissionRunId"); - }); - - b1.OwnsOne("Api.Database.Models.TransformationMatrices", "TransformationMatrices", b2 => - { - b2.Property("MapMetadataMissionRunId") - .HasColumnType("text"); - - b2.Property("C1") - .HasColumnType("double precision"); - - b2.Property("C2") - .HasColumnType("double precision"); - - b2.Property("D1") - .HasColumnType("double precision"); - - b2.Property("D2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataMissionRunId"); - - b2.ToTable("MissionRuns"); - - b2.WithOwner() - .HasForeignKey("MapMetadataMissionRunId"); - }); - - b1.Navigation("Boundary") - .IsRequired(); - - b1.Navigation("TransformationMatrices") - .IsRequired(); - }); - - b.Navigation("Area"); - - b.Navigation("Map"); - - b.Navigation("Robot"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionTask", b => - { - b.HasOne("Api.Database.Models.MissionRun", null) - .WithMany("Tasks") - .HasForeignKey("MissionRunId"); - - b.OwnsOne("Api.Database.Models.Pose", "RobotPose", b1 => - { - b1.Property("MissionTaskId") - .HasColumnType("text"); - - b1.HasKey("MissionTaskId"); - - b1.ToTable("MissionTasks"); - - b1.WithOwner() - .HasForeignKey("MissionTaskId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseMissionTaskId") - .HasColumnType("text"); - - b2.Property("W") - .HasColumnType("real"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseMissionTaskId"); - - b2.ToTable("MissionTasks"); - - b2.WithOwner() - .HasForeignKey("PoseMissionTaskId"); - }); - - b1.OwnsOne("Api.Database.Models.Position", "Position", b2 => - { - b2.Property("PoseMissionTaskId") - .HasColumnType("text"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseMissionTaskId"); - - b2.ToTable("MissionTasks"); - - b2.WithOwner() - .HasForeignKey("PoseMissionTaskId"); - }); - - b1.Navigation("Orientation") - .IsRequired(); - - b1.Navigation("Position") - .IsRequired(); - }); - - b.Navigation("RobotPose") - .IsRequired(); - }); - - modelBuilder.Entity("Api.Database.Models.Plant", b => - { - b.HasOne("Api.Database.Models.Installation", "Installation") - .WithMany() - .HasForeignKey("InstallationId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - 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.Installation", "CurrentInstallation") - .WithMany() - .HasForeignKey("CurrentInstallationId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - 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("text"); - - b1.HasKey("RobotId"); - - b1.ToTable("Robots"); - - b1.WithOwner() - .HasForeignKey("RobotId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseRobotId") - .HasColumnType("text"); - - 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("text"); - - 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("text"); - - b1.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b1.Property("ShouldRotate270Clockwise") - .HasColumnType("boolean"); - - b1.Property("Type") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b1.Property("Url") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.HasKey("Id"); - - b1.HasIndex("RobotId"); - - b1.ToTable("VideoStream"); - - b1.WithOwner() - .HasForeignKey("RobotId"); - }); - - b.Navigation("CurrentArea"); - - b.Navigation("CurrentInstallation"); - - 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("text"); - - b1.HasKey("SafePositionId"); - - b1.ToTable("SafePositions"); - - b1.WithOwner() - .HasForeignKey("SafePositionId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseSafePositionId") - .HasColumnType("text"); - - 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("text"); - - 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"); - }); - - modelBuilder.Entity("Api.Database.Models.Inspection", b => - { - b.Navigation("InspectionFindings"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionRun", b => - { - b.Navigation("Tasks"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionTask", b => - { - b.Navigation("Inspections"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/backend/api/Migrations/20240403071238_AddRobotCapabilitesToRobot.cs b/backend/api/Migrations/20240403071238_AddRobotCapabilitesToRobot.cs deleted file mode 100644 index 99ba9be42..000000000 --- a/backend/api/Migrations/20240403071238_AddRobotCapabilitesToRobot.cs +++ /dev/null @@ -1,28 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Api.Migrations -{ - /// - public partial class AddRobotCapabilitesToRobot : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "RobotCapabilities", - table: "Robots", - type: "text", - nullable: true); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "RobotCapabilities", - table: "Robots"); - } - } -} diff --git a/backend/api/Migrations/20240412093857_AddMissionRunType.Designer.cs b/backend/api/Migrations/20240412093857_AddMissionRunType.Designer.cs deleted file mode 100644 index 3497dd277..000000000 --- a/backend/api/Migrations/20240412093857_AddMissionRunType.Designer.cs +++ /dev/null @@ -1,1351 +0,0 @@ -// -using System; -using Api.Database.Context; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace Api.Migrations -{ - [DbContext(typeof(FlotillaDbContext))] - [Migration("20240412093857_AddMissionRunType")] - partial class AddMissionRunType - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "8.0.0") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("Api.Database.Models.AccessRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AccessLevel") - .IsRequired() - .HasColumnType("text"); - - b.Property("InstallationId") - .HasColumnType("text"); - - b.Property("RoleName") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("InstallationId"); - - b.ToTable("AccessRoles"); - }); - - modelBuilder.Entity("Api.Database.Models.Area", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("DeckId") - .IsRequired() - .HasColumnType("text"); - - b.Property("DefaultLocalizationPoseId") - .HasColumnType("text"); - - b.Property("InstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PlantId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("DeckId"); - - b.HasIndex("DefaultLocalizationPoseId"); - - b.HasIndex("InstallationId"); - - b.HasIndex("PlantId"); - - b.ToTable("Areas"); - }); - - modelBuilder.Entity("Api.Database.Models.Deck", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("DefaultLocalizationPoseId") - .HasColumnType("text"); - - b.Property("InstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PlantId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("DefaultLocalizationPoseId"); - - b.HasIndex("InstallationId"); - - b.HasIndex("PlantId"); - - b.ToTable("Decks"); - }); - - modelBuilder.Entity("Api.Database.Models.DefaultLocalizationPose", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.ToTable("DefaultLocalizationPoses"); - }); - - modelBuilder.Entity("Api.Database.Models.Inspection", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AnalysisType") - .HasColumnType("text"); - - b.Property("EndTime") - .HasColumnType("timestamp with time zone"); - - b.Property("InspectionType") - .IsRequired() - .HasColumnType("text"); - - b.Property("InspectionUrl") - .HasMaxLength(250) - .HasColumnType("character varying(250)"); - - b.Property("IsarStepId") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionTaskId") - .HasColumnType("text"); - - b.Property("StartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("VideoDuration") - .HasColumnType("real"); - - b.HasKey("Id"); - - b.HasIndex("MissionTaskId"); - - b.ToTable("Inspections"); - }); - - modelBuilder.Entity("Api.Database.Models.InspectionFinding", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("Finding") - .IsRequired() - .HasColumnType("text"); - - b.Property("InspectionDate") - .HasColumnType("timestamp with time zone"); - - b.Property("InspectionId") - .HasColumnType("text"); - - b.Property("IsarStepId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("InspectionId"); - - b.ToTable("InspectionFindings"); - }); - - modelBuilder.Entity("Api.Database.Models.Installation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("InstallationCode") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.HasKey("Id"); - - b.HasIndex("InstallationCode") - .IsUnique(); - - b.ToTable("Installations"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionDefinition", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AreaId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Comment") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("InspectionFrequency") - .HasColumnType("bigint"); - - b.Property("InstallationCode") - .IsRequired() - .HasColumnType("text"); - - b.Property("IsDeprecated") - .HasColumnType("boolean"); - - b.Property("LastSuccessfulRunId") - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("SourceId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("AreaId"); - - b.HasIndex("LastSuccessfulRunId"); - - b.HasIndex("SourceId"); - - b.ToTable("MissionDefinitions"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionRun", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AreaId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Comment") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("Description") - .HasMaxLength(450) - .HasColumnType("character varying(450)"); - - b.Property("DesiredStartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("EndTime") - .HasColumnType("timestamp with time zone"); - - b.Property("EstimatedDuration") - .HasColumnType("bigint"); - - b.Property("InstallationCode") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("IsarMissionId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("MissionRunType") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("StartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("StatusReason") - .HasMaxLength(450) - .HasColumnType("character varying(450)"); - - b.HasKey("Id"); - - b.HasIndex("AreaId"); - - b.HasIndex("RobotId"); - - b.ToTable("MissionRuns"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionTask", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("EchoPoseId") - .HasColumnType("integer"); - - b.Property("EchoTagLink") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("EndTime") - .HasColumnType("timestamp with time zone"); - - b.Property("IsarTaskId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionRunId") - .HasColumnType("text"); - - b.Property("StartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("TagId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("TaskOrder") - .HasColumnType("integer"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("MissionRunId"); - - b.ToTable("MissionTasks"); - }); - - modelBuilder.Entity("Api.Database.Models.Plant", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("InstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PlantCode") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(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("text"); - - b.Property("BatteryLevel") - .HasColumnType("real"); - - b.Property("CurrentAreaId") - .HasColumnType("text"); - - b.Property("CurrentInstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("CurrentMissionId") - .HasColumnType("text"); - - b.Property("Deprecated") - .HasColumnType("boolean"); - - b.Property("Host") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("IsarConnected") - .HasColumnType("boolean"); - - b.Property("IsarId") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionQueueFrozen") - .HasColumnType("boolean"); - - b.Property("ModelId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Port") - .HasColumnType("integer"); - - b.Property("PressureLevel") - .HasColumnType("real"); - - b.Property("RobotCapabilities") - .HasColumnType("text"); - - b.Property("SerialNumber") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("CurrentAreaId"); - - b.HasIndex("CurrentInstallationId"); - - b.HasIndex("ModelId"); - - b.ToTable("Robots"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotBatteryTimeseries", b => - { - b.Property("BatteryLevel") - .HasColumnType("real"); - - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Time") - .HasColumnType("timestamp with time zone"); - - b.ToTable("RobotBatteryTimeseries"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotModel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AverageDurationPerTag") - .HasColumnType("real"); - - b.Property("BatteryWarningThreshold") - .HasColumnType("real"); - - b.Property("LowerPressureWarningThreshold") - .HasColumnType("real"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - b.Property("UpperPressureWarningThreshold") - .HasColumnType("real"); - - b.HasKey("Id"); - - b.HasIndex("Type") - .IsUnique(); - - b.ToTable("RobotModels"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotPoseTimeseries", b => - { - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("OrientationW") - .HasColumnType("real"); - - b.Property("OrientationX") - .HasColumnType("real"); - - b.Property("OrientationY") - .HasColumnType("real"); - - b.Property("OrientationZ") - .HasColumnType("real"); - - b.Property("PositionX") - .HasColumnType("real"); - - b.Property("PositionY") - .HasColumnType("real"); - - b.Property("PositionZ") - .HasColumnType("real"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Time") - .HasColumnType("timestamp with time zone"); - - b.ToTable("RobotPoseTimeseries"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotPressureTimeseries", b => - { - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("Pressure") - .HasColumnType("real"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Time") - .HasColumnType("timestamp with time zone"); - - b.ToTable("RobotPressureTimeseries"); - }); - - modelBuilder.Entity("Api.Database.Models.SafePosition", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AreaId") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("AreaId"); - - b.ToTable("SafePositions"); - }); - - modelBuilder.Entity("Api.Database.Models.Source", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("SourceId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.ToTable("Sources"); - }); - - modelBuilder.Entity("Api.Database.Models.AccessRole", b => - { - b.HasOne("Api.Database.Models.Installation", "Installation") - .WithMany() - .HasForeignKey("InstallationId"); - - b.Navigation("Installation"); - }); - - 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.DefaultLocalizationPose", "DefaultLocalizationPose") - .WithMany() - .HasForeignKey("DefaultLocalizationPoseId"); - - 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.MapMetadata", "MapMetadata", b1 => - { - b1.Property("AreaId") - .HasColumnType("text"); - - b1.Property("MapName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.HasKey("AreaId"); - - b1.ToTable("Areas"); - - b1.WithOwner() - .HasForeignKey("AreaId"); - - b1.OwnsOne("Api.Database.Models.Boundary", "Boundary", b2 => - { - b2.Property("MapMetadataAreaId") - .HasColumnType("text"); - - b2.Property("X1") - .HasColumnType("double precision"); - - b2.Property("X2") - .HasColumnType("double precision"); - - b2.Property("Y1") - .HasColumnType("double precision"); - - b2.Property("Y2") - .HasColumnType("double precision"); - - b2.Property("Z1") - .HasColumnType("double precision"); - - b2.Property("Z2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataAreaId"); - - b2.ToTable("Areas"); - - b2.WithOwner() - .HasForeignKey("MapMetadataAreaId"); - }); - - b1.OwnsOne("Api.Database.Models.TransformationMatrices", "TransformationMatrices", b2 => - { - b2.Property("MapMetadataAreaId") - .HasColumnType("text"); - - b2.Property("C1") - .HasColumnType("double precision"); - - b2.Property("C2") - .HasColumnType("double precision"); - - b2.Property("D1") - .HasColumnType("double precision"); - - b2.Property("D2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataAreaId"); - - b2.ToTable("Areas"); - - b2.WithOwner() - .HasForeignKey("MapMetadataAreaId"); - }); - - b1.Navigation("Boundary") - .IsRequired(); - - b1.Navigation("TransformationMatrices") - .IsRequired(); - }); - - b.Navigation("Deck"); - - b.Navigation("DefaultLocalizationPose"); - - b.Navigation("Installation"); - - b.Navigation("MapMetadata") - .IsRequired(); - - b.Navigation("Plant"); - }); - - modelBuilder.Entity("Api.Database.Models.Deck", b => - { - b.HasOne("Api.Database.Models.DefaultLocalizationPose", "DefaultLocalizationPose") - .WithMany() - .HasForeignKey("DefaultLocalizationPoseId"); - - 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.Navigation("DefaultLocalizationPose"); - - b.Navigation("Installation"); - - b.Navigation("Plant"); - }); - - modelBuilder.Entity("Api.Database.Models.DefaultLocalizationPose", b => - { - b.OwnsOne("Api.Database.Models.Pose", "Pose", b1 => - { - b1.Property("DefaultLocalizationPoseId") - .HasColumnType("text"); - - b1.HasKey("DefaultLocalizationPoseId"); - - b1.ToTable("DefaultLocalizationPoses"); - - b1.WithOwner() - .HasForeignKey("DefaultLocalizationPoseId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseDefaultLocalizationPoseId") - .HasColumnType("text"); - - b2.Property("W") - .HasColumnType("real"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseDefaultLocalizationPoseId"); - - b2.ToTable("DefaultLocalizationPoses"); - - b2.WithOwner() - .HasForeignKey("PoseDefaultLocalizationPoseId"); - }); - - b1.OwnsOne("Api.Database.Models.Position", "Position", b2 => - { - b2.Property("PoseDefaultLocalizationPoseId") - .HasColumnType("text"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseDefaultLocalizationPoseId"); - - b2.ToTable("DefaultLocalizationPoses"); - - b2.WithOwner() - .HasForeignKey("PoseDefaultLocalizationPoseId"); - }); - - b1.Navigation("Orientation") - .IsRequired(); - - b1.Navigation("Position") - .IsRequired(); - }); - - b.Navigation("Pose") - .IsRequired(); - }); - - modelBuilder.Entity("Api.Database.Models.Inspection", b => - { - b.HasOne("Api.Database.Models.MissionTask", null) - .WithMany("Inspections") - .HasForeignKey("MissionTaskId"); - - b.OwnsOne("Api.Database.Models.Position", "InspectionTarget", b1 => - { - b1.Property("InspectionId") - .HasColumnType("text"); - - b1.Property("X") - .HasColumnType("real"); - - b1.Property("Y") - .HasColumnType("real"); - - b1.Property("Z") - .HasColumnType("real"); - - b1.HasKey("InspectionId"); - - b1.ToTable("Inspections"); - - b1.WithOwner() - .HasForeignKey("InspectionId"); - }); - - b.Navigation("InspectionTarget") - .IsRequired(); - }); - - modelBuilder.Entity("Api.Database.Models.InspectionFinding", b => - { - b.HasOne("Api.Database.Models.Inspection", null) - .WithMany("InspectionFindings") - .HasForeignKey("InspectionId"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionDefinition", b => - { - b.HasOne("Api.Database.Models.Area", "Area") - .WithMany() - .HasForeignKey("AreaId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Api.Database.Models.MissionRun", "LastSuccessfulRun") - .WithMany() - .HasForeignKey("LastSuccessfulRunId"); - - b.HasOne("Api.Database.Models.Source", "Source") - .WithMany() - .HasForeignKey("SourceId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Area"); - - b.Navigation("LastSuccessfulRun"); - - b.Navigation("Source"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionRun", b => - { - b.HasOne("Api.Database.Models.Area", "Area") - .WithMany() - .HasForeignKey("AreaId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Api.Database.Models.Robot", "Robot") - .WithMany() - .HasForeignKey("RobotId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.OwnsOne("Api.Database.Models.MapMetadata", "Map", b1 => - { - b1.Property("MissionRunId") - .HasColumnType("text"); - - b1.Property("MapName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.HasKey("MissionRunId"); - - b1.ToTable("MissionRuns"); - - b1.WithOwner() - .HasForeignKey("MissionRunId"); - - b1.OwnsOne("Api.Database.Models.Boundary", "Boundary", b2 => - { - b2.Property("MapMetadataMissionRunId") - .HasColumnType("text"); - - b2.Property("X1") - .HasColumnType("double precision"); - - b2.Property("X2") - .HasColumnType("double precision"); - - b2.Property("Y1") - .HasColumnType("double precision"); - - b2.Property("Y2") - .HasColumnType("double precision"); - - b2.Property("Z1") - .HasColumnType("double precision"); - - b2.Property("Z2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataMissionRunId"); - - b2.ToTable("MissionRuns"); - - b2.WithOwner() - .HasForeignKey("MapMetadataMissionRunId"); - }); - - b1.OwnsOne("Api.Database.Models.TransformationMatrices", "TransformationMatrices", b2 => - { - b2.Property("MapMetadataMissionRunId") - .HasColumnType("text"); - - b2.Property("C1") - .HasColumnType("double precision"); - - b2.Property("C2") - .HasColumnType("double precision"); - - b2.Property("D1") - .HasColumnType("double precision"); - - b2.Property("D2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataMissionRunId"); - - b2.ToTable("MissionRuns"); - - b2.WithOwner() - .HasForeignKey("MapMetadataMissionRunId"); - }); - - b1.Navigation("Boundary") - .IsRequired(); - - b1.Navigation("TransformationMatrices") - .IsRequired(); - }); - - b.Navigation("Area"); - - b.Navigation("Map"); - - b.Navigation("Robot"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionTask", b => - { - b.HasOne("Api.Database.Models.MissionRun", null) - .WithMany("Tasks") - .HasForeignKey("MissionRunId"); - - b.OwnsOne("Api.Database.Models.Pose", "RobotPose", b1 => - { - b1.Property("MissionTaskId") - .HasColumnType("text"); - - b1.HasKey("MissionTaskId"); - - b1.ToTable("MissionTasks"); - - b1.WithOwner() - .HasForeignKey("MissionTaskId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseMissionTaskId") - .HasColumnType("text"); - - b2.Property("W") - .HasColumnType("real"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseMissionTaskId"); - - b2.ToTable("MissionTasks"); - - b2.WithOwner() - .HasForeignKey("PoseMissionTaskId"); - }); - - b1.OwnsOne("Api.Database.Models.Position", "Position", b2 => - { - b2.Property("PoseMissionTaskId") - .HasColumnType("text"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseMissionTaskId"); - - b2.ToTable("MissionTasks"); - - b2.WithOwner() - .HasForeignKey("PoseMissionTaskId"); - }); - - b1.Navigation("Orientation") - .IsRequired(); - - b1.Navigation("Position") - .IsRequired(); - }); - - b.Navigation("RobotPose") - .IsRequired(); - }); - - modelBuilder.Entity("Api.Database.Models.Plant", b => - { - b.HasOne("Api.Database.Models.Installation", "Installation") - .WithMany() - .HasForeignKey("InstallationId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - 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.Installation", "CurrentInstallation") - .WithMany() - .HasForeignKey("CurrentInstallationId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - 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("text"); - - b1.HasKey("RobotId"); - - b1.ToTable("Robots"); - - b1.WithOwner() - .HasForeignKey("RobotId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseRobotId") - .HasColumnType("text"); - - 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("text"); - - 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("text"); - - b1.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b1.Property("ShouldRotate270Clockwise") - .HasColumnType("boolean"); - - b1.Property("Type") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b1.Property("Url") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.HasKey("Id"); - - b1.HasIndex("RobotId"); - - b1.ToTable("VideoStream"); - - b1.WithOwner() - .HasForeignKey("RobotId"); - }); - - b.Navigation("CurrentArea"); - - b.Navigation("CurrentInstallation"); - - 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("text"); - - b1.HasKey("SafePositionId"); - - b1.ToTable("SafePositions"); - - b1.WithOwner() - .HasForeignKey("SafePositionId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseSafePositionId") - .HasColumnType("text"); - - 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("text"); - - 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"); - }); - - modelBuilder.Entity("Api.Database.Models.Inspection", b => - { - b.Navigation("InspectionFindings"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionRun", b => - { - b.Navigation("Tasks"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionTask", b => - { - b.Navigation("Inspections"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/backend/api/Migrations/20240412093857_AddMissionRunType.cs b/backend/api/Migrations/20240412093857_AddMissionRunType.cs deleted file mode 100644 index 7a0503650..000000000 --- a/backend/api/Migrations/20240412093857_AddMissionRunType.cs +++ /dev/null @@ -1,28 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Api.Migrations -{ - /// - public partial class AddMissionRunType : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.RenameColumn( - name: "MissionRunPriority", - table: "MissionRuns", - newName: "MissionRunType"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.RenameColumn( - name: "MissionRunType", - table: "MissionRuns", - newName: "MissionRunPriority"); - } - } -} diff --git a/backend/api/Migrations/20240716132916_AddDockToDefaultLocalisationPose.Designer.cs b/backend/api/Migrations/20240716132916_AddDockToDefaultLocalisationPose.Designer.cs deleted file mode 100644 index db87d45d9..000000000 --- a/backend/api/Migrations/20240716132916_AddDockToDefaultLocalisationPose.Designer.cs +++ /dev/null @@ -1,1354 +0,0 @@ -// -using System; -using Api.Database.Context; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace Api.Migrations -{ - [DbContext(typeof(FlotillaDbContext))] - [Migration("20240716132916_AddDockToDefaultLocalisationPose")] - partial class AddDockToDefaultLocalisationPose - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "8.0.0") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("Api.Database.Models.AccessRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AccessLevel") - .IsRequired() - .HasColumnType("text"); - - b.Property("InstallationId") - .HasColumnType("text"); - - b.Property("RoleName") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("InstallationId"); - - b.ToTable("AccessRoles"); - }); - - modelBuilder.Entity("Api.Database.Models.Area", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("DeckId") - .IsRequired() - .HasColumnType("text"); - - b.Property("DefaultLocalizationPoseId") - .HasColumnType("text"); - - b.Property("InstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PlantId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("DeckId"); - - b.HasIndex("DefaultLocalizationPoseId"); - - b.HasIndex("InstallationId"); - - b.HasIndex("PlantId"); - - b.ToTable("Areas"); - }); - - modelBuilder.Entity("Api.Database.Models.Deck", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("DefaultLocalizationPoseId") - .HasColumnType("text"); - - b.Property("InstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PlantId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("DefaultLocalizationPoseId"); - - b.HasIndex("InstallationId"); - - b.HasIndex("PlantId"); - - b.ToTable("Decks"); - }); - - modelBuilder.Entity("Api.Database.Models.DefaultLocalizationPose", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("DockingEnabled") - .HasColumnType("boolean"); - - b.HasKey("Id"); - - b.ToTable("DefaultLocalizationPoses"); - }); - - modelBuilder.Entity("Api.Database.Models.Inspection", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AnalysisType") - .HasColumnType("text"); - - b.Property("EndTime") - .HasColumnType("timestamp with time zone"); - - b.Property("InspectionType") - .IsRequired() - .HasColumnType("text"); - - b.Property("InspectionUrl") - .HasMaxLength(250) - .HasColumnType("character varying(250)"); - - b.Property("IsarStepId") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionTaskId") - .HasColumnType("text"); - - b.Property("StartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("VideoDuration") - .HasColumnType("real"); - - b.HasKey("Id"); - - b.HasIndex("MissionTaskId"); - - b.ToTable("Inspections"); - }); - - modelBuilder.Entity("Api.Database.Models.InspectionFinding", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("Finding") - .IsRequired() - .HasColumnType("text"); - - b.Property("InspectionDate") - .HasColumnType("timestamp with time zone"); - - b.Property("InspectionId") - .HasColumnType("text"); - - b.Property("IsarStepId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("InspectionId"); - - b.ToTable("InspectionFindings"); - }); - - modelBuilder.Entity("Api.Database.Models.Installation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("InstallationCode") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.HasKey("Id"); - - b.HasIndex("InstallationCode") - .IsUnique(); - - b.ToTable("Installations"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionDefinition", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AreaId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Comment") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("InspectionFrequency") - .HasColumnType("bigint"); - - b.Property("InstallationCode") - .IsRequired() - .HasColumnType("text"); - - b.Property("IsDeprecated") - .HasColumnType("boolean"); - - b.Property("LastSuccessfulRunId") - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("SourceId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("AreaId"); - - b.HasIndex("LastSuccessfulRunId"); - - b.HasIndex("SourceId"); - - b.ToTable("MissionDefinitions"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionRun", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AreaId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Comment") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("Description") - .HasMaxLength(450) - .HasColumnType("character varying(450)"); - - b.Property("DesiredStartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("EndTime") - .HasColumnType("timestamp with time zone"); - - b.Property("EstimatedDuration") - .HasColumnType("bigint"); - - b.Property("InstallationCode") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("IsarMissionId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("MissionRunType") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("StartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("StatusReason") - .HasMaxLength(450) - .HasColumnType("character varying(450)"); - - b.HasKey("Id"); - - b.HasIndex("AreaId"); - - b.HasIndex("RobotId"); - - b.ToTable("MissionRuns"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionTask", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("EchoPoseId") - .HasColumnType("integer"); - - b.Property("EchoTagLink") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("EndTime") - .HasColumnType("timestamp with time zone"); - - b.Property("IsarTaskId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionRunId") - .HasColumnType("text"); - - b.Property("StartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("TagId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("TaskOrder") - .HasColumnType("integer"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("MissionRunId"); - - b.ToTable("MissionTasks"); - }); - - modelBuilder.Entity("Api.Database.Models.Plant", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("InstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PlantCode") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(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("text"); - - b.Property("BatteryLevel") - .HasColumnType("real"); - - b.Property("CurrentAreaId") - .HasColumnType("text"); - - b.Property("CurrentInstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("CurrentMissionId") - .HasColumnType("text"); - - b.Property("Deprecated") - .HasColumnType("boolean"); - - b.Property("Host") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("IsarConnected") - .HasColumnType("boolean"); - - b.Property("IsarId") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionQueueFrozen") - .HasColumnType("boolean"); - - b.Property("ModelId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Port") - .HasColumnType("integer"); - - b.Property("PressureLevel") - .HasColumnType("real"); - - b.Property("RobotCapabilities") - .HasColumnType("text"); - - b.Property("SerialNumber") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("CurrentAreaId"); - - b.HasIndex("CurrentInstallationId"); - - b.HasIndex("ModelId"); - - b.ToTable("Robots"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotBatteryTimeseries", b => - { - b.Property("BatteryLevel") - .HasColumnType("real"); - - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Time") - .HasColumnType("timestamp with time zone"); - - b.ToTable("RobotBatteryTimeseries"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotModel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AverageDurationPerTag") - .HasColumnType("real"); - - b.Property("BatteryWarningThreshold") - .HasColumnType("real"); - - b.Property("LowerPressureWarningThreshold") - .HasColumnType("real"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - b.Property("UpperPressureWarningThreshold") - .HasColumnType("real"); - - b.HasKey("Id"); - - b.HasIndex("Type") - .IsUnique(); - - b.ToTable("RobotModels"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotPoseTimeseries", b => - { - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("OrientationW") - .HasColumnType("real"); - - b.Property("OrientationX") - .HasColumnType("real"); - - b.Property("OrientationY") - .HasColumnType("real"); - - b.Property("OrientationZ") - .HasColumnType("real"); - - b.Property("PositionX") - .HasColumnType("real"); - - b.Property("PositionY") - .HasColumnType("real"); - - b.Property("PositionZ") - .HasColumnType("real"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Time") - .HasColumnType("timestamp with time zone"); - - b.ToTable("RobotPoseTimeseries"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotPressureTimeseries", b => - { - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("Pressure") - .HasColumnType("real"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Time") - .HasColumnType("timestamp with time zone"); - - b.ToTable("RobotPressureTimeseries"); - }); - - modelBuilder.Entity("Api.Database.Models.SafePosition", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AreaId") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("AreaId"); - - b.ToTable("SafePositions"); - }); - - modelBuilder.Entity("Api.Database.Models.Source", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("SourceId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.ToTable("Sources"); - }); - - modelBuilder.Entity("Api.Database.Models.AccessRole", b => - { - b.HasOne("Api.Database.Models.Installation", "Installation") - .WithMany() - .HasForeignKey("InstallationId"); - - b.Navigation("Installation"); - }); - - 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.DefaultLocalizationPose", "DefaultLocalizationPose") - .WithMany() - .HasForeignKey("DefaultLocalizationPoseId"); - - 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.MapMetadata", "MapMetadata", b1 => - { - b1.Property("AreaId") - .HasColumnType("text"); - - b1.Property("MapName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.HasKey("AreaId"); - - b1.ToTable("Areas"); - - b1.WithOwner() - .HasForeignKey("AreaId"); - - b1.OwnsOne("Api.Database.Models.Boundary", "Boundary", b2 => - { - b2.Property("MapMetadataAreaId") - .HasColumnType("text"); - - b2.Property("X1") - .HasColumnType("double precision"); - - b2.Property("X2") - .HasColumnType("double precision"); - - b2.Property("Y1") - .HasColumnType("double precision"); - - b2.Property("Y2") - .HasColumnType("double precision"); - - b2.Property("Z1") - .HasColumnType("double precision"); - - b2.Property("Z2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataAreaId"); - - b2.ToTable("Areas"); - - b2.WithOwner() - .HasForeignKey("MapMetadataAreaId"); - }); - - b1.OwnsOne("Api.Database.Models.TransformationMatrices", "TransformationMatrices", b2 => - { - b2.Property("MapMetadataAreaId") - .HasColumnType("text"); - - b2.Property("C1") - .HasColumnType("double precision"); - - b2.Property("C2") - .HasColumnType("double precision"); - - b2.Property("D1") - .HasColumnType("double precision"); - - b2.Property("D2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataAreaId"); - - b2.ToTable("Areas"); - - b2.WithOwner() - .HasForeignKey("MapMetadataAreaId"); - }); - - b1.Navigation("Boundary") - .IsRequired(); - - b1.Navigation("TransformationMatrices") - .IsRequired(); - }); - - b.Navigation("Deck"); - - b.Navigation("DefaultLocalizationPose"); - - b.Navigation("Installation"); - - b.Navigation("MapMetadata") - .IsRequired(); - - b.Navigation("Plant"); - }); - - modelBuilder.Entity("Api.Database.Models.Deck", b => - { - b.HasOne("Api.Database.Models.DefaultLocalizationPose", "DefaultLocalizationPose") - .WithMany() - .HasForeignKey("DefaultLocalizationPoseId"); - - 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.Navigation("DefaultLocalizationPose"); - - b.Navigation("Installation"); - - b.Navigation("Plant"); - }); - - modelBuilder.Entity("Api.Database.Models.DefaultLocalizationPose", b => - { - b.OwnsOne("Api.Database.Models.Pose", "Pose", b1 => - { - b1.Property("DefaultLocalizationPoseId") - .HasColumnType("text"); - - b1.HasKey("DefaultLocalizationPoseId"); - - b1.ToTable("DefaultLocalizationPoses"); - - b1.WithOwner() - .HasForeignKey("DefaultLocalizationPoseId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseDefaultLocalizationPoseId") - .HasColumnType("text"); - - b2.Property("W") - .HasColumnType("real"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseDefaultLocalizationPoseId"); - - b2.ToTable("DefaultLocalizationPoses"); - - b2.WithOwner() - .HasForeignKey("PoseDefaultLocalizationPoseId"); - }); - - b1.OwnsOne("Api.Database.Models.Position", "Position", b2 => - { - b2.Property("PoseDefaultLocalizationPoseId") - .HasColumnType("text"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseDefaultLocalizationPoseId"); - - b2.ToTable("DefaultLocalizationPoses"); - - b2.WithOwner() - .HasForeignKey("PoseDefaultLocalizationPoseId"); - }); - - b1.Navigation("Orientation") - .IsRequired(); - - b1.Navigation("Position") - .IsRequired(); - }); - - b.Navigation("Pose") - .IsRequired(); - }); - - modelBuilder.Entity("Api.Database.Models.Inspection", b => - { - b.HasOne("Api.Database.Models.MissionTask", null) - .WithMany("Inspections") - .HasForeignKey("MissionTaskId"); - - b.OwnsOne("Api.Database.Models.Position", "InspectionTarget", b1 => - { - b1.Property("InspectionId") - .HasColumnType("text"); - - b1.Property("X") - .HasColumnType("real"); - - b1.Property("Y") - .HasColumnType("real"); - - b1.Property("Z") - .HasColumnType("real"); - - b1.HasKey("InspectionId"); - - b1.ToTable("Inspections"); - - b1.WithOwner() - .HasForeignKey("InspectionId"); - }); - - b.Navigation("InspectionTarget") - .IsRequired(); - }); - - modelBuilder.Entity("Api.Database.Models.InspectionFinding", b => - { - b.HasOne("Api.Database.Models.Inspection", null) - .WithMany("InspectionFindings") - .HasForeignKey("InspectionId"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionDefinition", b => - { - b.HasOne("Api.Database.Models.Area", "Area") - .WithMany() - .HasForeignKey("AreaId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Api.Database.Models.MissionRun", "LastSuccessfulRun") - .WithMany() - .HasForeignKey("LastSuccessfulRunId"); - - b.HasOne("Api.Database.Models.Source", "Source") - .WithMany() - .HasForeignKey("SourceId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Area"); - - b.Navigation("LastSuccessfulRun"); - - b.Navigation("Source"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionRun", b => - { - b.HasOne("Api.Database.Models.Area", "Area") - .WithMany() - .HasForeignKey("AreaId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Api.Database.Models.Robot", "Robot") - .WithMany() - .HasForeignKey("RobotId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.OwnsOne("Api.Database.Models.MapMetadata", "Map", b1 => - { - b1.Property("MissionRunId") - .HasColumnType("text"); - - b1.Property("MapName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.HasKey("MissionRunId"); - - b1.ToTable("MissionRuns"); - - b1.WithOwner() - .HasForeignKey("MissionRunId"); - - b1.OwnsOne("Api.Database.Models.Boundary", "Boundary", b2 => - { - b2.Property("MapMetadataMissionRunId") - .HasColumnType("text"); - - b2.Property("X1") - .HasColumnType("double precision"); - - b2.Property("X2") - .HasColumnType("double precision"); - - b2.Property("Y1") - .HasColumnType("double precision"); - - b2.Property("Y2") - .HasColumnType("double precision"); - - b2.Property("Z1") - .HasColumnType("double precision"); - - b2.Property("Z2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataMissionRunId"); - - b2.ToTable("MissionRuns"); - - b2.WithOwner() - .HasForeignKey("MapMetadataMissionRunId"); - }); - - b1.OwnsOne("Api.Database.Models.TransformationMatrices", "TransformationMatrices", b2 => - { - b2.Property("MapMetadataMissionRunId") - .HasColumnType("text"); - - b2.Property("C1") - .HasColumnType("double precision"); - - b2.Property("C2") - .HasColumnType("double precision"); - - b2.Property("D1") - .HasColumnType("double precision"); - - b2.Property("D2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataMissionRunId"); - - b2.ToTable("MissionRuns"); - - b2.WithOwner() - .HasForeignKey("MapMetadataMissionRunId"); - }); - - b1.Navigation("Boundary") - .IsRequired(); - - b1.Navigation("TransformationMatrices") - .IsRequired(); - }); - - b.Navigation("Area"); - - b.Navigation("Map"); - - b.Navigation("Robot"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionTask", b => - { - b.HasOne("Api.Database.Models.MissionRun", null) - .WithMany("Tasks") - .HasForeignKey("MissionRunId"); - - b.OwnsOne("Api.Database.Models.Pose", "RobotPose", b1 => - { - b1.Property("MissionTaskId") - .HasColumnType("text"); - - b1.HasKey("MissionTaskId"); - - b1.ToTable("MissionTasks"); - - b1.WithOwner() - .HasForeignKey("MissionTaskId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseMissionTaskId") - .HasColumnType("text"); - - b2.Property("W") - .HasColumnType("real"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseMissionTaskId"); - - b2.ToTable("MissionTasks"); - - b2.WithOwner() - .HasForeignKey("PoseMissionTaskId"); - }); - - b1.OwnsOne("Api.Database.Models.Position", "Position", b2 => - { - b2.Property("PoseMissionTaskId") - .HasColumnType("text"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseMissionTaskId"); - - b2.ToTable("MissionTasks"); - - b2.WithOwner() - .HasForeignKey("PoseMissionTaskId"); - }); - - b1.Navigation("Orientation") - .IsRequired(); - - b1.Navigation("Position") - .IsRequired(); - }); - - b.Navigation("RobotPose") - .IsRequired(); - }); - - modelBuilder.Entity("Api.Database.Models.Plant", b => - { - b.HasOne("Api.Database.Models.Installation", "Installation") - .WithMany() - .HasForeignKey("InstallationId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - 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.Installation", "CurrentInstallation") - .WithMany() - .HasForeignKey("CurrentInstallationId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - 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("text"); - - b1.HasKey("RobotId"); - - b1.ToTable("Robots"); - - b1.WithOwner() - .HasForeignKey("RobotId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseRobotId") - .HasColumnType("text"); - - 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("text"); - - 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("text"); - - b1.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b1.Property("ShouldRotate270Clockwise") - .HasColumnType("boolean"); - - b1.Property("Type") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b1.Property("Url") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.HasKey("Id"); - - b1.HasIndex("RobotId"); - - b1.ToTable("VideoStream"); - - b1.WithOwner() - .HasForeignKey("RobotId"); - }); - - b.Navigation("CurrentArea"); - - b.Navigation("CurrentInstallation"); - - 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("text"); - - b1.HasKey("SafePositionId"); - - b1.ToTable("SafePositions"); - - b1.WithOwner() - .HasForeignKey("SafePositionId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseSafePositionId") - .HasColumnType("text"); - - 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("text"); - - 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"); - }); - - modelBuilder.Entity("Api.Database.Models.Inspection", b => - { - b.Navigation("InspectionFindings"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionRun", b => - { - b.Navigation("Tasks"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionTask", b => - { - b.Navigation("Inspections"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/backend/api/Migrations/20240716132916_AddDockToDefaultLocalisationPose.cs b/backend/api/Migrations/20240716132916_AddDockToDefaultLocalisationPose.cs deleted file mode 100644 index 3a0dd72be..000000000 --- a/backend/api/Migrations/20240716132916_AddDockToDefaultLocalisationPose.cs +++ /dev/null @@ -1,29 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Api.Migrations -{ - /// - public partial class AddDockToDefaultLocalisationPose : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "DockingEnabled", - table: "DefaultLocalizationPoses", - type: "boolean", - nullable: false, - defaultValue: false); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "DockingEnabled", - table: "DefaultLocalizationPoses"); - } - } -} diff --git a/backend/api/Migrations/20240717092121_AddMissionRunIsDeprecated.Designer.cs b/backend/api/Migrations/20240717092121_AddMissionRunIsDeprecated.Designer.cs deleted file mode 100644 index 0e3bdca26..000000000 --- a/backend/api/Migrations/20240717092121_AddMissionRunIsDeprecated.Designer.cs +++ /dev/null @@ -1,1357 +0,0 @@ -// -using System; -using Api.Database.Context; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace Api.Migrations -{ - [DbContext(typeof(FlotillaDbContext))] - [Migration("20240717092121_AddMissionRunIsDeprecated")] - partial class AddMissionRunIsDeprecated - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "8.0.0") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("Api.Database.Models.AccessRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AccessLevel") - .IsRequired() - .HasColumnType("text"); - - b.Property("InstallationId") - .HasColumnType("text"); - - b.Property("RoleName") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("InstallationId"); - - b.ToTable("AccessRoles"); - }); - - modelBuilder.Entity("Api.Database.Models.Area", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("DeckId") - .IsRequired() - .HasColumnType("text"); - - b.Property("DefaultLocalizationPoseId") - .HasColumnType("text"); - - b.Property("InstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PlantId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("DeckId"); - - b.HasIndex("DefaultLocalizationPoseId"); - - b.HasIndex("InstallationId"); - - b.HasIndex("PlantId"); - - b.ToTable("Areas"); - }); - - modelBuilder.Entity("Api.Database.Models.Deck", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("DefaultLocalizationPoseId") - .HasColumnType("text"); - - b.Property("InstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PlantId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("DefaultLocalizationPoseId"); - - b.HasIndex("InstallationId"); - - b.HasIndex("PlantId"); - - b.ToTable("Decks"); - }); - - modelBuilder.Entity("Api.Database.Models.DefaultLocalizationPose", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("DockingEnabled") - .HasColumnType("boolean"); - - b.HasKey("Id"); - - b.ToTable("DefaultLocalizationPoses"); - }); - - modelBuilder.Entity("Api.Database.Models.Inspection", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AnalysisType") - .HasColumnType("text"); - - b.Property("EndTime") - .HasColumnType("timestamp with time zone"); - - b.Property("InspectionType") - .IsRequired() - .HasColumnType("text"); - - b.Property("InspectionUrl") - .HasMaxLength(250) - .HasColumnType("character varying(250)"); - - b.Property("IsarStepId") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionTaskId") - .HasColumnType("text"); - - b.Property("StartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("VideoDuration") - .HasColumnType("real"); - - b.HasKey("Id"); - - b.HasIndex("MissionTaskId"); - - b.ToTable("Inspections"); - }); - - modelBuilder.Entity("Api.Database.Models.InspectionFinding", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("Finding") - .IsRequired() - .HasColumnType("text"); - - b.Property("InspectionDate") - .HasColumnType("timestamp with time zone"); - - b.Property("InspectionId") - .HasColumnType("text"); - - b.Property("IsarStepId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("InspectionId"); - - b.ToTable("InspectionFindings"); - }); - - modelBuilder.Entity("Api.Database.Models.Installation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("InstallationCode") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.HasKey("Id"); - - b.HasIndex("InstallationCode") - .IsUnique(); - - b.ToTable("Installations"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionDefinition", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AreaId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Comment") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("InspectionFrequency") - .HasColumnType("bigint"); - - b.Property("InstallationCode") - .IsRequired() - .HasColumnType("text"); - - b.Property("IsDeprecated") - .HasColumnType("boolean"); - - b.Property("LastSuccessfulRunId") - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("SourceId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("AreaId"); - - b.HasIndex("LastSuccessfulRunId"); - - b.HasIndex("SourceId"); - - b.ToTable("MissionDefinitions"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionRun", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AreaId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Comment") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("Description") - .HasMaxLength(450) - .HasColumnType("character varying(450)"); - - b.Property("DesiredStartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("EndTime") - .HasColumnType("timestamp with time zone"); - - b.Property("EstimatedDuration") - .HasColumnType("bigint"); - - b.Property("InstallationCode") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("IsDeprecated") - .HasColumnType("boolean"); - - b.Property("IsarMissionId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("MissionRunType") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("StartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("StatusReason") - .HasMaxLength(450) - .HasColumnType("character varying(450)"); - - b.HasKey("Id"); - - b.HasIndex("AreaId"); - - b.HasIndex("RobotId"); - - b.ToTable("MissionRuns"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionTask", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("EchoPoseId") - .HasColumnType("integer"); - - b.Property("EchoTagLink") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("EndTime") - .HasColumnType("timestamp with time zone"); - - b.Property("IsarTaskId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionRunId") - .HasColumnType("text"); - - b.Property("StartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("TagId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("TaskOrder") - .HasColumnType("integer"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("MissionRunId"); - - b.ToTable("MissionTasks"); - }); - - modelBuilder.Entity("Api.Database.Models.Plant", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("InstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PlantCode") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(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("text"); - - b.Property("BatteryLevel") - .HasColumnType("real"); - - b.Property("CurrentAreaId") - .HasColumnType("text"); - - b.Property("CurrentInstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("CurrentMissionId") - .HasColumnType("text"); - - b.Property("Deprecated") - .HasColumnType("boolean"); - - b.Property("Host") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("IsarConnected") - .HasColumnType("boolean"); - - b.Property("IsarId") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionQueueFrozen") - .HasColumnType("boolean"); - - b.Property("ModelId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Port") - .HasColumnType("integer"); - - b.Property("PressureLevel") - .HasColumnType("real"); - - b.Property("RobotCapabilities") - .HasColumnType("text"); - - b.Property("SerialNumber") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("CurrentAreaId"); - - b.HasIndex("CurrentInstallationId"); - - b.HasIndex("ModelId"); - - b.ToTable("Robots"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotBatteryTimeseries", b => - { - b.Property("BatteryLevel") - .HasColumnType("real"); - - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Time") - .HasColumnType("timestamp with time zone"); - - b.ToTable("RobotBatteryTimeseries"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotModel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AverageDurationPerTag") - .HasColumnType("real"); - - b.Property("BatteryWarningThreshold") - .HasColumnType("real"); - - b.Property("LowerPressureWarningThreshold") - .HasColumnType("real"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - b.Property("UpperPressureWarningThreshold") - .HasColumnType("real"); - - b.HasKey("Id"); - - b.HasIndex("Type") - .IsUnique(); - - b.ToTable("RobotModels"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotPoseTimeseries", b => - { - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("OrientationW") - .HasColumnType("real"); - - b.Property("OrientationX") - .HasColumnType("real"); - - b.Property("OrientationY") - .HasColumnType("real"); - - b.Property("OrientationZ") - .HasColumnType("real"); - - b.Property("PositionX") - .HasColumnType("real"); - - b.Property("PositionY") - .HasColumnType("real"); - - b.Property("PositionZ") - .HasColumnType("real"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Time") - .HasColumnType("timestamp with time zone"); - - b.ToTable("RobotPoseTimeseries"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotPressureTimeseries", b => - { - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("Pressure") - .HasColumnType("real"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Time") - .HasColumnType("timestamp with time zone"); - - b.ToTable("RobotPressureTimeseries"); - }); - - modelBuilder.Entity("Api.Database.Models.SafePosition", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AreaId") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("AreaId"); - - b.ToTable("SafePositions"); - }); - - modelBuilder.Entity("Api.Database.Models.Source", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("SourceId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.ToTable("Sources"); - }); - - modelBuilder.Entity("Api.Database.Models.AccessRole", b => - { - b.HasOne("Api.Database.Models.Installation", "Installation") - .WithMany() - .HasForeignKey("InstallationId"); - - b.Navigation("Installation"); - }); - - 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.DefaultLocalizationPose", "DefaultLocalizationPose") - .WithMany() - .HasForeignKey("DefaultLocalizationPoseId"); - - 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.MapMetadata", "MapMetadata", b1 => - { - b1.Property("AreaId") - .HasColumnType("text"); - - b1.Property("MapName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.HasKey("AreaId"); - - b1.ToTable("Areas"); - - b1.WithOwner() - .HasForeignKey("AreaId"); - - b1.OwnsOne("Api.Database.Models.Boundary", "Boundary", b2 => - { - b2.Property("MapMetadataAreaId") - .HasColumnType("text"); - - b2.Property("X1") - .HasColumnType("double precision"); - - b2.Property("X2") - .HasColumnType("double precision"); - - b2.Property("Y1") - .HasColumnType("double precision"); - - b2.Property("Y2") - .HasColumnType("double precision"); - - b2.Property("Z1") - .HasColumnType("double precision"); - - b2.Property("Z2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataAreaId"); - - b2.ToTable("Areas"); - - b2.WithOwner() - .HasForeignKey("MapMetadataAreaId"); - }); - - b1.OwnsOne("Api.Database.Models.TransformationMatrices", "TransformationMatrices", b2 => - { - b2.Property("MapMetadataAreaId") - .HasColumnType("text"); - - b2.Property("C1") - .HasColumnType("double precision"); - - b2.Property("C2") - .HasColumnType("double precision"); - - b2.Property("D1") - .HasColumnType("double precision"); - - b2.Property("D2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataAreaId"); - - b2.ToTable("Areas"); - - b2.WithOwner() - .HasForeignKey("MapMetadataAreaId"); - }); - - b1.Navigation("Boundary") - .IsRequired(); - - b1.Navigation("TransformationMatrices") - .IsRequired(); - }); - - b.Navigation("Deck"); - - b.Navigation("DefaultLocalizationPose"); - - b.Navigation("Installation"); - - b.Navigation("MapMetadata") - .IsRequired(); - - b.Navigation("Plant"); - }); - - modelBuilder.Entity("Api.Database.Models.Deck", b => - { - b.HasOne("Api.Database.Models.DefaultLocalizationPose", "DefaultLocalizationPose") - .WithMany() - .HasForeignKey("DefaultLocalizationPoseId"); - - 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.Navigation("DefaultLocalizationPose"); - - b.Navigation("Installation"); - - b.Navigation("Plant"); - }); - - modelBuilder.Entity("Api.Database.Models.DefaultLocalizationPose", b => - { - b.OwnsOne("Api.Database.Models.Pose", "Pose", b1 => - { - b1.Property("DefaultLocalizationPoseId") - .HasColumnType("text"); - - b1.HasKey("DefaultLocalizationPoseId"); - - b1.ToTable("DefaultLocalizationPoses"); - - b1.WithOwner() - .HasForeignKey("DefaultLocalizationPoseId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseDefaultLocalizationPoseId") - .HasColumnType("text"); - - b2.Property("W") - .HasColumnType("real"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseDefaultLocalizationPoseId"); - - b2.ToTable("DefaultLocalizationPoses"); - - b2.WithOwner() - .HasForeignKey("PoseDefaultLocalizationPoseId"); - }); - - b1.OwnsOne("Api.Database.Models.Position", "Position", b2 => - { - b2.Property("PoseDefaultLocalizationPoseId") - .HasColumnType("text"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseDefaultLocalizationPoseId"); - - b2.ToTable("DefaultLocalizationPoses"); - - b2.WithOwner() - .HasForeignKey("PoseDefaultLocalizationPoseId"); - }); - - b1.Navigation("Orientation") - .IsRequired(); - - b1.Navigation("Position") - .IsRequired(); - }); - - b.Navigation("Pose") - .IsRequired(); - }); - - modelBuilder.Entity("Api.Database.Models.Inspection", b => - { - b.HasOne("Api.Database.Models.MissionTask", null) - .WithMany("Inspections") - .HasForeignKey("MissionTaskId"); - - b.OwnsOne("Api.Database.Models.Position", "InspectionTarget", b1 => - { - b1.Property("InspectionId") - .HasColumnType("text"); - - b1.Property("X") - .HasColumnType("real"); - - b1.Property("Y") - .HasColumnType("real"); - - b1.Property("Z") - .HasColumnType("real"); - - b1.HasKey("InspectionId"); - - b1.ToTable("Inspections"); - - b1.WithOwner() - .HasForeignKey("InspectionId"); - }); - - b.Navigation("InspectionTarget") - .IsRequired(); - }); - - modelBuilder.Entity("Api.Database.Models.InspectionFinding", b => - { - b.HasOne("Api.Database.Models.Inspection", null) - .WithMany("InspectionFindings") - .HasForeignKey("InspectionId"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionDefinition", b => - { - b.HasOne("Api.Database.Models.Area", "Area") - .WithMany() - .HasForeignKey("AreaId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Api.Database.Models.MissionRun", "LastSuccessfulRun") - .WithMany() - .HasForeignKey("LastSuccessfulRunId"); - - b.HasOne("Api.Database.Models.Source", "Source") - .WithMany() - .HasForeignKey("SourceId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Area"); - - b.Navigation("LastSuccessfulRun"); - - b.Navigation("Source"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionRun", b => - { - b.HasOne("Api.Database.Models.Area", "Area") - .WithMany() - .HasForeignKey("AreaId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Api.Database.Models.Robot", "Robot") - .WithMany() - .HasForeignKey("RobotId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.OwnsOne("Api.Database.Models.MapMetadata", "Map", b1 => - { - b1.Property("MissionRunId") - .HasColumnType("text"); - - b1.Property("MapName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.HasKey("MissionRunId"); - - b1.ToTable("MissionRuns"); - - b1.WithOwner() - .HasForeignKey("MissionRunId"); - - b1.OwnsOne("Api.Database.Models.Boundary", "Boundary", b2 => - { - b2.Property("MapMetadataMissionRunId") - .HasColumnType("text"); - - b2.Property("X1") - .HasColumnType("double precision"); - - b2.Property("X2") - .HasColumnType("double precision"); - - b2.Property("Y1") - .HasColumnType("double precision"); - - b2.Property("Y2") - .HasColumnType("double precision"); - - b2.Property("Z1") - .HasColumnType("double precision"); - - b2.Property("Z2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataMissionRunId"); - - b2.ToTable("MissionRuns"); - - b2.WithOwner() - .HasForeignKey("MapMetadataMissionRunId"); - }); - - b1.OwnsOne("Api.Database.Models.TransformationMatrices", "TransformationMatrices", b2 => - { - b2.Property("MapMetadataMissionRunId") - .HasColumnType("text"); - - b2.Property("C1") - .HasColumnType("double precision"); - - b2.Property("C2") - .HasColumnType("double precision"); - - b2.Property("D1") - .HasColumnType("double precision"); - - b2.Property("D2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataMissionRunId"); - - b2.ToTable("MissionRuns"); - - b2.WithOwner() - .HasForeignKey("MapMetadataMissionRunId"); - }); - - b1.Navigation("Boundary") - .IsRequired(); - - b1.Navigation("TransformationMatrices") - .IsRequired(); - }); - - b.Navigation("Area"); - - b.Navigation("Map"); - - b.Navigation("Robot"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionTask", b => - { - b.HasOne("Api.Database.Models.MissionRun", null) - .WithMany("Tasks") - .HasForeignKey("MissionRunId"); - - b.OwnsOne("Api.Database.Models.Pose", "RobotPose", b1 => - { - b1.Property("MissionTaskId") - .HasColumnType("text"); - - b1.HasKey("MissionTaskId"); - - b1.ToTable("MissionTasks"); - - b1.WithOwner() - .HasForeignKey("MissionTaskId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseMissionTaskId") - .HasColumnType("text"); - - b2.Property("W") - .HasColumnType("real"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseMissionTaskId"); - - b2.ToTable("MissionTasks"); - - b2.WithOwner() - .HasForeignKey("PoseMissionTaskId"); - }); - - b1.OwnsOne("Api.Database.Models.Position", "Position", b2 => - { - b2.Property("PoseMissionTaskId") - .HasColumnType("text"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseMissionTaskId"); - - b2.ToTable("MissionTasks"); - - b2.WithOwner() - .HasForeignKey("PoseMissionTaskId"); - }); - - b1.Navigation("Orientation") - .IsRequired(); - - b1.Navigation("Position") - .IsRequired(); - }); - - b.Navigation("RobotPose") - .IsRequired(); - }); - - modelBuilder.Entity("Api.Database.Models.Plant", b => - { - b.HasOne("Api.Database.Models.Installation", "Installation") - .WithMany() - .HasForeignKey("InstallationId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - 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.Installation", "CurrentInstallation") - .WithMany() - .HasForeignKey("CurrentInstallationId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - 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("text"); - - b1.HasKey("RobotId"); - - b1.ToTable("Robots"); - - b1.WithOwner() - .HasForeignKey("RobotId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseRobotId") - .HasColumnType("text"); - - 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("text"); - - 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("text"); - - b1.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b1.Property("ShouldRotate270Clockwise") - .HasColumnType("boolean"); - - b1.Property("Type") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b1.Property("Url") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.HasKey("Id"); - - b1.HasIndex("RobotId"); - - b1.ToTable("VideoStream"); - - b1.WithOwner() - .HasForeignKey("RobotId"); - }); - - b.Navigation("CurrentArea"); - - b.Navigation("CurrentInstallation"); - - 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("text"); - - b1.HasKey("SafePositionId"); - - b1.ToTable("SafePositions"); - - b1.WithOwner() - .HasForeignKey("SafePositionId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseSafePositionId") - .HasColumnType("text"); - - 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("text"); - - 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"); - }); - - modelBuilder.Entity("Api.Database.Models.Inspection", b => - { - b.Navigation("InspectionFindings"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionRun", b => - { - b.Navigation("Tasks"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionTask", b => - { - b.Navigation("Inspections"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/backend/api/Migrations/20240717092121_AddMissionRunIsDeprecated.cs b/backend/api/Migrations/20240717092121_AddMissionRunIsDeprecated.cs deleted file mode 100644 index f2c392bb1..000000000 --- a/backend/api/Migrations/20240717092121_AddMissionRunIsDeprecated.cs +++ /dev/null @@ -1,29 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Api.Migrations -{ - /// - public partial class AddMissionRunIsDeprecated : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "IsDeprecated", - table: "MissionRuns", - type: "boolean", - nullable: false, - defaultValue: false); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "IsDeprecated", - table: "MissionRuns"); - } - } -} diff --git a/backend/api/Migrations/20240724102244_AddRobotFlotillaStatus.Designer.cs b/backend/api/Migrations/20240724102244_AddRobotFlotillaStatus.Designer.cs deleted file mode 100644 index f0beacf1c..000000000 --- a/backend/api/Migrations/20240724102244_AddRobotFlotillaStatus.Designer.cs +++ /dev/null @@ -1,1361 +0,0 @@ -// -using System; -using Api.Database.Context; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace Api.Migrations -{ - [DbContext(typeof(FlotillaDbContext))] - [Migration("20240724102244_AddRobotFlotillaStatus")] - partial class AddRobotFlotillaStatus - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "8.0.7") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("Api.Database.Models.AccessRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AccessLevel") - .IsRequired() - .HasColumnType("text"); - - b.Property("InstallationId") - .HasColumnType("text"); - - b.Property("RoleName") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("InstallationId"); - - b.ToTable("AccessRoles"); - }); - - modelBuilder.Entity("Api.Database.Models.Area", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("DeckId") - .IsRequired() - .HasColumnType("text"); - - b.Property("DefaultLocalizationPoseId") - .HasColumnType("text"); - - b.Property("InstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PlantId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("DeckId"); - - b.HasIndex("DefaultLocalizationPoseId"); - - b.HasIndex("InstallationId"); - - b.HasIndex("PlantId"); - - b.ToTable("Areas"); - }); - - modelBuilder.Entity("Api.Database.Models.Deck", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("DefaultLocalizationPoseId") - .HasColumnType("text"); - - b.Property("InstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PlantId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("DefaultLocalizationPoseId"); - - b.HasIndex("InstallationId"); - - b.HasIndex("PlantId"); - - b.ToTable("Decks"); - }); - - modelBuilder.Entity("Api.Database.Models.DefaultLocalizationPose", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("DockingEnabled") - .HasColumnType("boolean"); - - b.HasKey("Id"); - - b.ToTable("DefaultLocalizationPoses"); - }); - - modelBuilder.Entity("Api.Database.Models.Inspection", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AnalysisType") - .HasColumnType("text"); - - b.Property("EndTime") - .HasColumnType("timestamp with time zone"); - - b.Property("InspectionType") - .IsRequired() - .HasColumnType("text"); - - b.Property("InspectionUrl") - .HasMaxLength(250) - .HasColumnType("character varying(250)"); - - b.Property("IsarStepId") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionTaskId") - .HasColumnType("text"); - - b.Property("StartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("VideoDuration") - .HasColumnType("real"); - - b.HasKey("Id"); - - b.HasIndex("MissionTaskId"); - - b.ToTable("Inspections"); - }); - - modelBuilder.Entity("Api.Database.Models.InspectionFinding", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("Finding") - .IsRequired() - .HasColumnType("text"); - - b.Property("InspectionDate") - .HasColumnType("timestamp with time zone"); - - b.Property("InspectionId") - .HasColumnType("text"); - - b.Property("IsarStepId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("InspectionId"); - - b.ToTable("InspectionFindings"); - }); - - modelBuilder.Entity("Api.Database.Models.Installation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("InstallationCode") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.HasKey("Id"); - - b.HasIndex("InstallationCode") - .IsUnique(); - - b.ToTable("Installations"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionDefinition", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AreaId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Comment") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("InspectionFrequency") - .HasColumnType("bigint"); - - b.Property("InstallationCode") - .IsRequired() - .HasColumnType("text"); - - b.Property("IsDeprecated") - .HasColumnType("boolean"); - - b.Property("LastSuccessfulRunId") - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("SourceId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("AreaId"); - - b.HasIndex("LastSuccessfulRunId"); - - b.HasIndex("SourceId"); - - b.ToTable("MissionDefinitions"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionRun", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AreaId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Comment") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("Description") - .HasMaxLength(450) - .HasColumnType("character varying(450)"); - - b.Property("DesiredStartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("EndTime") - .HasColumnType("timestamp with time zone"); - - b.Property("EstimatedDuration") - .HasColumnType("bigint"); - - b.Property("InstallationCode") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("IsDeprecated") - .HasColumnType("boolean"); - - b.Property("IsarMissionId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("MissionRunType") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("StartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("StatusReason") - .HasMaxLength(450) - .HasColumnType("character varying(450)"); - - b.HasKey("Id"); - - b.HasIndex("AreaId"); - - b.HasIndex("RobotId"); - - b.ToTable("MissionRuns"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionTask", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("EchoPoseId") - .HasColumnType("integer"); - - b.Property("EchoTagLink") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("EndTime") - .HasColumnType("timestamp with time zone"); - - b.Property("IsarTaskId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionRunId") - .HasColumnType("text"); - - b.Property("StartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("TagId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("TaskOrder") - .HasColumnType("integer"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("MissionRunId"); - - b.ToTable("MissionTasks"); - }); - - modelBuilder.Entity("Api.Database.Models.Plant", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("InstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PlantCode") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(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("text"); - - b.Property("BatteryLevel") - .HasColumnType("real"); - - b.Property("CurrentAreaId") - .HasColumnType("text"); - - b.Property("CurrentInstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("CurrentMissionId") - .HasColumnType("text"); - - b.Property("Deprecated") - .HasColumnType("boolean"); - - b.Property("FlotillaStatus") - .IsRequired() - .HasColumnType("text"); - - b.Property("Host") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("IsarConnected") - .HasColumnType("boolean"); - - b.Property("IsarId") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionQueueFrozen") - .HasColumnType("boolean"); - - b.Property("ModelId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Port") - .HasColumnType("integer"); - - b.Property("PressureLevel") - .HasColumnType("real"); - - b.Property("RobotCapabilities") - .HasColumnType("text"); - - b.Property("SerialNumber") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("CurrentAreaId"); - - b.HasIndex("CurrentInstallationId"); - - b.HasIndex("ModelId"); - - b.ToTable("Robots"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotBatteryTimeseries", b => - { - b.Property("BatteryLevel") - .HasColumnType("real"); - - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Time") - .HasColumnType("timestamp with time zone"); - - b.ToTable("RobotBatteryTimeseries"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotModel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AverageDurationPerTag") - .HasColumnType("real"); - - b.Property("BatteryWarningThreshold") - .HasColumnType("real"); - - b.Property("LowerPressureWarningThreshold") - .HasColumnType("real"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - b.Property("UpperPressureWarningThreshold") - .HasColumnType("real"); - - b.HasKey("Id"); - - b.HasIndex("Type") - .IsUnique(); - - b.ToTable("RobotModels"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotPoseTimeseries", b => - { - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("OrientationW") - .HasColumnType("real"); - - b.Property("OrientationX") - .HasColumnType("real"); - - b.Property("OrientationY") - .HasColumnType("real"); - - b.Property("OrientationZ") - .HasColumnType("real"); - - b.Property("PositionX") - .HasColumnType("real"); - - b.Property("PositionY") - .HasColumnType("real"); - - b.Property("PositionZ") - .HasColumnType("real"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Time") - .HasColumnType("timestamp with time zone"); - - b.ToTable("RobotPoseTimeseries"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotPressureTimeseries", b => - { - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("Pressure") - .HasColumnType("real"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Time") - .HasColumnType("timestamp with time zone"); - - b.ToTable("RobotPressureTimeseries"); - }); - - modelBuilder.Entity("Api.Database.Models.SafePosition", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AreaId") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("AreaId"); - - b.ToTable("SafePositions"); - }); - - modelBuilder.Entity("Api.Database.Models.Source", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("SourceId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.ToTable("Sources"); - }); - - modelBuilder.Entity("Api.Database.Models.AccessRole", b => - { - b.HasOne("Api.Database.Models.Installation", "Installation") - .WithMany() - .HasForeignKey("InstallationId"); - - b.Navigation("Installation"); - }); - - 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.DefaultLocalizationPose", "DefaultLocalizationPose") - .WithMany() - .HasForeignKey("DefaultLocalizationPoseId"); - - 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.MapMetadata", "MapMetadata", b1 => - { - b1.Property("AreaId") - .HasColumnType("text"); - - b1.Property("MapName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.HasKey("AreaId"); - - b1.ToTable("Areas"); - - b1.WithOwner() - .HasForeignKey("AreaId"); - - b1.OwnsOne("Api.Database.Models.Boundary", "Boundary", b2 => - { - b2.Property("MapMetadataAreaId") - .HasColumnType("text"); - - b2.Property("X1") - .HasColumnType("double precision"); - - b2.Property("X2") - .HasColumnType("double precision"); - - b2.Property("Y1") - .HasColumnType("double precision"); - - b2.Property("Y2") - .HasColumnType("double precision"); - - b2.Property("Z1") - .HasColumnType("double precision"); - - b2.Property("Z2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataAreaId"); - - b2.ToTable("Areas"); - - b2.WithOwner() - .HasForeignKey("MapMetadataAreaId"); - }); - - b1.OwnsOne("Api.Database.Models.TransformationMatrices", "TransformationMatrices", b2 => - { - b2.Property("MapMetadataAreaId") - .HasColumnType("text"); - - b2.Property("C1") - .HasColumnType("double precision"); - - b2.Property("C2") - .HasColumnType("double precision"); - - b2.Property("D1") - .HasColumnType("double precision"); - - b2.Property("D2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataAreaId"); - - b2.ToTable("Areas"); - - b2.WithOwner() - .HasForeignKey("MapMetadataAreaId"); - }); - - b1.Navigation("Boundary") - .IsRequired(); - - b1.Navigation("TransformationMatrices") - .IsRequired(); - }); - - b.Navigation("Deck"); - - b.Navigation("DefaultLocalizationPose"); - - b.Navigation("Installation"); - - b.Navigation("MapMetadata") - .IsRequired(); - - b.Navigation("Plant"); - }); - - modelBuilder.Entity("Api.Database.Models.Deck", b => - { - b.HasOne("Api.Database.Models.DefaultLocalizationPose", "DefaultLocalizationPose") - .WithMany() - .HasForeignKey("DefaultLocalizationPoseId"); - - 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.Navigation("DefaultLocalizationPose"); - - b.Navigation("Installation"); - - b.Navigation("Plant"); - }); - - modelBuilder.Entity("Api.Database.Models.DefaultLocalizationPose", b => - { - b.OwnsOne("Api.Database.Models.Pose", "Pose", b1 => - { - b1.Property("DefaultLocalizationPoseId") - .HasColumnType("text"); - - b1.HasKey("DefaultLocalizationPoseId"); - - b1.ToTable("DefaultLocalizationPoses"); - - b1.WithOwner() - .HasForeignKey("DefaultLocalizationPoseId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseDefaultLocalizationPoseId") - .HasColumnType("text"); - - b2.Property("W") - .HasColumnType("real"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseDefaultLocalizationPoseId"); - - b2.ToTable("DefaultLocalizationPoses"); - - b2.WithOwner() - .HasForeignKey("PoseDefaultLocalizationPoseId"); - }); - - b1.OwnsOne("Api.Database.Models.Position", "Position", b2 => - { - b2.Property("PoseDefaultLocalizationPoseId") - .HasColumnType("text"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseDefaultLocalizationPoseId"); - - b2.ToTable("DefaultLocalizationPoses"); - - b2.WithOwner() - .HasForeignKey("PoseDefaultLocalizationPoseId"); - }); - - b1.Navigation("Orientation") - .IsRequired(); - - b1.Navigation("Position") - .IsRequired(); - }); - - b.Navigation("Pose") - .IsRequired(); - }); - - modelBuilder.Entity("Api.Database.Models.Inspection", b => - { - b.HasOne("Api.Database.Models.MissionTask", null) - .WithMany("Inspections") - .HasForeignKey("MissionTaskId"); - - b.OwnsOne("Api.Database.Models.Position", "InspectionTarget", b1 => - { - b1.Property("InspectionId") - .HasColumnType("text"); - - b1.Property("X") - .HasColumnType("real"); - - b1.Property("Y") - .HasColumnType("real"); - - b1.Property("Z") - .HasColumnType("real"); - - b1.HasKey("InspectionId"); - - b1.ToTable("Inspections"); - - b1.WithOwner() - .HasForeignKey("InspectionId"); - }); - - b.Navigation("InspectionTarget") - .IsRequired(); - }); - - modelBuilder.Entity("Api.Database.Models.InspectionFinding", b => - { - b.HasOne("Api.Database.Models.Inspection", null) - .WithMany("InspectionFindings") - .HasForeignKey("InspectionId"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionDefinition", b => - { - b.HasOne("Api.Database.Models.Area", "Area") - .WithMany() - .HasForeignKey("AreaId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Api.Database.Models.MissionRun", "LastSuccessfulRun") - .WithMany() - .HasForeignKey("LastSuccessfulRunId"); - - b.HasOne("Api.Database.Models.Source", "Source") - .WithMany() - .HasForeignKey("SourceId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Area"); - - b.Navigation("LastSuccessfulRun"); - - b.Navigation("Source"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionRun", b => - { - b.HasOne("Api.Database.Models.Area", "Area") - .WithMany() - .HasForeignKey("AreaId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Api.Database.Models.Robot", "Robot") - .WithMany() - .HasForeignKey("RobotId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.OwnsOne("Api.Database.Models.MapMetadata", "Map", b1 => - { - b1.Property("MissionRunId") - .HasColumnType("text"); - - b1.Property("MapName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.HasKey("MissionRunId"); - - b1.ToTable("MissionRuns"); - - b1.WithOwner() - .HasForeignKey("MissionRunId"); - - b1.OwnsOne("Api.Database.Models.Boundary", "Boundary", b2 => - { - b2.Property("MapMetadataMissionRunId") - .HasColumnType("text"); - - b2.Property("X1") - .HasColumnType("double precision"); - - b2.Property("X2") - .HasColumnType("double precision"); - - b2.Property("Y1") - .HasColumnType("double precision"); - - b2.Property("Y2") - .HasColumnType("double precision"); - - b2.Property("Z1") - .HasColumnType("double precision"); - - b2.Property("Z2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataMissionRunId"); - - b2.ToTable("MissionRuns"); - - b2.WithOwner() - .HasForeignKey("MapMetadataMissionRunId"); - }); - - b1.OwnsOne("Api.Database.Models.TransformationMatrices", "TransformationMatrices", b2 => - { - b2.Property("MapMetadataMissionRunId") - .HasColumnType("text"); - - b2.Property("C1") - .HasColumnType("double precision"); - - b2.Property("C2") - .HasColumnType("double precision"); - - b2.Property("D1") - .HasColumnType("double precision"); - - b2.Property("D2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataMissionRunId"); - - b2.ToTable("MissionRuns"); - - b2.WithOwner() - .HasForeignKey("MapMetadataMissionRunId"); - }); - - b1.Navigation("Boundary") - .IsRequired(); - - b1.Navigation("TransformationMatrices") - .IsRequired(); - }); - - b.Navigation("Area"); - - b.Navigation("Map"); - - b.Navigation("Robot"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionTask", b => - { - b.HasOne("Api.Database.Models.MissionRun", null) - .WithMany("Tasks") - .HasForeignKey("MissionRunId"); - - b.OwnsOne("Api.Database.Models.Pose", "RobotPose", b1 => - { - b1.Property("MissionTaskId") - .HasColumnType("text"); - - b1.HasKey("MissionTaskId"); - - b1.ToTable("MissionTasks"); - - b1.WithOwner() - .HasForeignKey("MissionTaskId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseMissionTaskId") - .HasColumnType("text"); - - b2.Property("W") - .HasColumnType("real"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseMissionTaskId"); - - b2.ToTable("MissionTasks"); - - b2.WithOwner() - .HasForeignKey("PoseMissionTaskId"); - }); - - b1.OwnsOne("Api.Database.Models.Position", "Position", b2 => - { - b2.Property("PoseMissionTaskId") - .HasColumnType("text"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseMissionTaskId"); - - b2.ToTable("MissionTasks"); - - b2.WithOwner() - .HasForeignKey("PoseMissionTaskId"); - }); - - b1.Navigation("Orientation") - .IsRequired(); - - b1.Navigation("Position") - .IsRequired(); - }); - - b.Navigation("RobotPose") - .IsRequired(); - }); - - modelBuilder.Entity("Api.Database.Models.Plant", b => - { - b.HasOne("Api.Database.Models.Installation", "Installation") - .WithMany() - .HasForeignKey("InstallationId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - 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.Installation", "CurrentInstallation") - .WithMany() - .HasForeignKey("CurrentInstallationId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - 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("text"); - - b1.HasKey("RobotId"); - - b1.ToTable("Robots"); - - b1.WithOwner() - .HasForeignKey("RobotId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseRobotId") - .HasColumnType("text"); - - 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("text"); - - 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("text"); - - b1.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b1.Property("ShouldRotate270Clockwise") - .HasColumnType("boolean"); - - b1.Property("Type") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b1.Property("Url") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.HasKey("Id"); - - b1.HasIndex("RobotId"); - - b1.ToTable("VideoStream"); - - b1.WithOwner() - .HasForeignKey("RobotId"); - }); - - b.Navigation("CurrentArea"); - - b.Navigation("CurrentInstallation"); - - 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("text"); - - b1.HasKey("SafePositionId"); - - b1.ToTable("SafePositions"); - - b1.WithOwner() - .HasForeignKey("SafePositionId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseSafePositionId") - .HasColumnType("text"); - - 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("text"); - - 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"); - }); - - modelBuilder.Entity("Api.Database.Models.Inspection", b => - { - b.Navigation("InspectionFindings"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionRun", b => - { - b.Navigation("Tasks"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionTask", b => - { - b.Navigation("Inspections"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/backend/api/Migrations/20240724102244_AddRobotFlotillaStatus.cs b/backend/api/Migrations/20240724102244_AddRobotFlotillaStatus.cs deleted file mode 100644 index 1aa34aa5d..000000000 --- a/backend/api/Migrations/20240724102244_AddRobotFlotillaStatus.cs +++ /dev/null @@ -1,29 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Api.Migrations -{ - /// - public partial class AddRobotFlotillaStatus : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "FlotillaStatus", - table: "Robots", - type: "text", - nullable: false, - defaultValue: ""); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "FlotillaStatus", - table: "Robots"); - } - } -} diff --git a/backend/api/Migrations/20240726090053_MoveCustomMissionTasksToSourceTable.Designer.cs b/backend/api/Migrations/20240726090053_MoveCustomMissionTasksToSourceTable.Designer.cs deleted file mode 100644 index 880f0878d..000000000 --- a/backend/api/Migrations/20240726090053_MoveCustomMissionTasksToSourceTable.Designer.cs +++ /dev/null @@ -1,1360 +0,0 @@ -// -using System; -using Api.Database.Context; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace Api.Migrations -{ - [DbContext(typeof(FlotillaDbContext))] - [Migration("20240726090053_MoveCustomMissionTasksToSourceTable")] - partial class MoveCustomMissionTasksToSourceTable - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "8.0.7") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("Api.Database.Models.AccessRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AccessLevel") - .IsRequired() - .HasColumnType("text"); - - b.Property("InstallationId") - .HasColumnType("text"); - - b.Property("RoleName") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("InstallationId"); - - b.ToTable("AccessRoles"); - }); - - modelBuilder.Entity("Api.Database.Models.Area", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("DeckId") - .IsRequired() - .HasColumnType("text"); - - b.Property("DefaultLocalizationPoseId") - .HasColumnType("text"); - - b.Property("InstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PlantId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("DeckId"); - - b.HasIndex("DefaultLocalizationPoseId"); - - b.HasIndex("InstallationId"); - - b.HasIndex("PlantId"); - - b.ToTable("Areas"); - }); - - modelBuilder.Entity("Api.Database.Models.Deck", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("DefaultLocalizationPoseId") - .HasColumnType("text"); - - b.Property("InstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PlantId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("DefaultLocalizationPoseId"); - - b.HasIndex("InstallationId"); - - b.HasIndex("PlantId"); - - b.ToTable("Decks"); - }); - - modelBuilder.Entity("Api.Database.Models.DefaultLocalizationPose", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("DockingEnabled") - .HasColumnType("boolean"); - - b.HasKey("Id"); - - b.ToTable("DefaultLocalizationPoses"); - }); - - modelBuilder.Entity("Api.Database.Models.Inspection", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AnalysisType") - .HasColumnType("text"); - - b.Property("EndTime") - .HasColumnType("timestamp with time zone"); - - b.Property("InspectionType") - .IsRequired() - .HasColumnType("text"); - - b.Property("InspectionUrl") - .HasMaxLength(250) - .HasColumnType("character varying(250)"); - - b.Property("IsarStepId") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionTaskId") - .HasColumnType("text"); - - b.Property("StartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("VideoDuration") - .HasColumnType("real"); - - b.HasKey("Id"); - - b.HasIndex("MissionTaskId"); - - b.ToTable("Inspections"); - }); - - modelBuilder.Entity("Api.Database.Models.InspectionFinding", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("Finding") - .IsRequired() - .HasColumnType("text"); - - b.Property("InspectionDate") - .HasColumnType("timestamp with time zone"); - - b.Property("InspectionId") - .HasColumnType("text"); - - b.Property("IsarStepId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("InspectionId"); - - b.ToTable("InspectionFindings"); - }); - - modelBuilder.Entity("Api.Database.Models.Installation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("InstallationCode") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.HasKey("Id"); - - b.HasIndex("InstallationCode") - .IsUnique(); - - b.ToTable("Installations"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionDefinition", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AreaId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Comment") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("InspectionFrequency") - .HasColumnType("bigint"); - - b.Property("InstallationCode") - .IsRequired() - .HasColumnType("text"); - - b.Property("IsDeprecated") - .HasColumnType("boolean"); - - b.Property("LastSuccessfulRunId") - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("SourceId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("AreaId"); - - b.HasIndex("LastSuccessfulRunId"); - - b.HasIndex("SourceId"); - - b.ToTable("MissionDefinitions"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionRun", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AreaId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Comment") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("Description") - .HasMaxLength(450) - .HasColumnType("character varying(450)"); - - b.Property("DesiredStartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("EndTime") - .HasColumnType("timestamp with time zone"); - - b.Property("EstimatedDuration") - .HasColumnType("bigint"); - - b.Property("InstallationCode") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("IsDeprecated") - .HasColumnType("boolean"); - - b.Property("IsarMissionId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("MissionRunType") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("StartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("StatusReason") - .HasMaxLength(450) - .HasColumnType("character varying(450)"); - - b.HasKey("Id"); - - b.HasIndex("AreaId"); - - b.HasIndex("RobotId"); - - b.ToTable("MissionRuns"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionTask", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("EchoPoseId") - .HasColumnType("integer"); - - b.Property("EchoTagLink") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("EndTime") - .HasColumnType("timestamp with time zone"); - - b.Property("IsarTaskId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionRunId") - .HasColumnType("text"); - - b.Property("StartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("TagId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("TaskOrder") - .HasColumnType("integer"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("MissionRunId"); - - b.ToTable("MissionTasks"); - }); - - modelBuilder.Entity("Api.Database.Models.Plant", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("InstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PlantCode") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(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("text"); - - b.Property("BatteryLevel") - .HasColumnType("real"); - - b.Property("CurrentAreaId") - .HasColumnType("text"); - - b.Property("CurrentInstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("CurrentMissionId") - .HasColumnType("text"); - - b.Property("Deprecated") - .HasColumnType("boolean"); - - b.Property("Host") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("IsarConnected") - .HasColumnType("boolean"); - - b.Property("IsarId") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionQueueFrozen") - .HasColumnType("boolean"); - - b.Property("ModelId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Port") - .HasColumnType("integer"); - - b.Property("PressureLevel") - .HasColumnType("real"); - - b.Property("RobotCapabilities") - .HasColumnType("text"); - - b.Property("SerialNumber") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("CurrentAreaId"); - - b.HasIndex("CurrentInstallationId"); - - b.HasIndex("ModelId"); - - b.ToTable("Robots"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotBatteryTimeseries", b => - { - b.Property("BatteryLevel") - .HasColumnType("real"); - - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Time") - .HasColumnType("timestamp with time zone"); - - b.ToTable("RobotBatteryTimeseries"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotModel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AverageDurationPerTag") - .HasColumnType("real"); - - b.Property("BatteryWarningThreshold") - .HasColumnType("real"); - - b.Property("LowerPressureWarningThreshold") - .HasColumnType("real"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - b.Property("UpperPressureWarningThreshold") - .HasColumnType("real"); - - b.HasKey("Id"); - - b.HasIndex("Type") - .IsUnique(); - - b.ToTable("RobotModels"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotPoseTimeseries", b => - { - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("OrientationW") - .HasColumnType("real"); - - b.Property("OrientationX") - .HasColumnType("real"); - - b.Property("OrientationY") - .HasColumnType("real"); - - b.Property("OrientationZ") - .HasColumnType("real"); - - b.Property("PositionX") - .HasColumnType("real"); - - b.Property("PositionY") - .HasColumnType("real"); - - b.Property("PositionZ") - .HasColumnType("real"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Time") - .HasColumnType("timestamp with time zone"); - - b.ToTable("RobotPoseTimeseries"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotPressureTimeseries", b => - { - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("Pressure") - .HasColumnType("real"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Time") - .HasColumnType("timestamp with time zone"); - - b.ToTable("RobotPressureTimeseries"); - }); - - modelBuilder.Entity("Api.Database.Models.SafePosition", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AreaId") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("AreaId"); - - b.ToTable("SafePositions"); - }); - - modelBuilder.Entity("Api.Database.Models.Source", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("CustomMissionTasks") - .HasColumnType("text"); - - b.Property("SourceId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.ToTable("Sources"); - }); - - modelBuilder.Entity("Api.Database.Models.AccessRole", b => - { - b.HasOne("Api.Database.Models.Installation", "Installation") - .WithMany() - .HasForeignKey("InstallationId"); - - b.Navigation("Installation"); - }); - - 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.DefaultLocalizationPose", "DefaultLocalizationPose") - .WithMany() - .HasForeignKey("DefaultLocalizationPoseId"); - - 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.MapMetadata", "MapMetadata", b1 => - { - b1.Property("AreaId") - .HasColumnType("text"); - - b1.Property("MapName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.HasKey("AreaId"); - - b1.ToTable("Areas"); - - b1.WithOwner() - .HasForeignKey("AreaId"); - - b1.OwnsOne("Api.Database.Models.Boundary", "Boundary", b2 => - { - b2.Property("MapMetadataAreaId") - .HasColumnType("text"); - - b2.Property("X1") - .HasColumnType("double precision"); - - b2.Property("X2") - .HasColumnType("double precision"); - - b2.Property("Y1") - .HasColumnType("double precision"); - - b2.Property("Y2") - .HasColumnType("double precision"); - - b2.Property("Z1") - .HasColumnType("double precision"); - - b2.Property("Z2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataAreaId"); - - b2.ToTable("Areas"); - - b2.WithOwner() - .HasForeignKey("MapMetadataAreaId"); - }); - - b1.OwnsOne("Api.Database.Models.TransformationMatrices", "TransformationMatrices", b2 => - { - b2.Property("MapMetadataAreaId") - .HasColumnType("text"); - - b2.Property("C1") - .HasColumnType("double precision"); - - b2.Property("C2") - .HasColumnType("double precision"); - - b2.Property("D1") - .HasColumnType("double precision"); - - b2.Property("D2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataAreaId"); - - b2.ToTable("Areas"); - - b2.WithOwner() - .HasForeignKey("MapMetadataAreaId"); - }); - - b1.Navigation("Boundary") - .IsRequired(); - - b1.Navigation("TransformationMatrices") - .IsRequired(); - }); - - b.Navigation("Deck"); - - b.Navigation("DefaultLocalizationPose"); - - b.Navigation("Installation"); - - b.Navigation("MapMetadata") - .IsRequired(); - - b.Navigation("Plant"); - }); - - modelBuilder.Entity("Api.Database.Models.Deck", b => - { - b.HasOne("Api.Database.Models.DefaultLocalizationPose", "DefaultLocalizationPose") - .WithMany() - .HasForeignKey("DefaultLocalizationPoseId"); - - 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.Navigation("DefaultLocalizationPose"); - - b.Navigation("Installation"); - - b.Navigation("Plant"); - }); - - modelBuilder.Entity("Api.Database.Models.DefaultLocalizationPose", b => - { - b.OwnsOne("Api.Database.Models.Pose", "Pose", b1 => - { - b1.Property("DefaultLocalizationPoseId") - .HasColumnType("text"); - - b1.HasKey("DefaultLocalizationPoseId"); - - b1.ToTable("DefaultLocalizationPoses"); - - b1.WithOwner() - .HasForeignKey("DefaultLocalizationPoseId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseDefaultLocalizationPoseId") - .HasColumnType("text"); - - b2.Property("W") - .HasColumnType("real"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseDefaultLocalizationPoseId"); - - b2.ToTable("DefaultLocalizationPoses"); - - b2.WithOwner() - .HasForeignKey("PoseDefaultLocalizationPoseId"); - }); - - b1.OwnsOne("Api.Database.Models.Position", "Position", b2 => - { - b2.Property("PoseDefaultLocalizationPoseId") - .HasColumnType("text"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseDefaultLocalizationPoseId"); - - b2.ToTable("DefaultLocalizationPoses"); - - b2.WithOwner() - .HasForeignKey("PoseDefaultLocalizationPoseId"); - }); - - b1.Navigation("Orientation") - .IsRequired(); - - b1.Navigation("Position") - .IsRequired(); - }); - - b.Navigation("Pose") - .IsRequired(); - }); - - modelBuilder.Entity("Api.Database.Models.Inspection", b => - { - b.HasOne("Api.Database.Models.MissionTask", null) - .WithMany("Inspections") - .HasForeignKey("MissionTaskId"); - - b.OwnsOne("Api.Database.Models.Position", "InspectionTarget", b1 => - { - b1.Property("InspectionId") - .HasColumnType("text"); - - b1.Property("X") - .HasColumnType("real"); - - b1.Property("Y") - .HasColumnType("real"); - - b1.Property("Z") - .HasColumnType("real"); - - b1.HasKey("InspectionId"); - - b1.ToTable("Inspections"); - - b1.WithOwner() - .HasForeignKey("InspectionId"); - }); - - b.Navigation("InspectionTarget") - .IsRequired(); - }); - - modelBuilder.Entity("Api.Database.Models.InspectionFinding", b => - { - b.HasOne("Api.Database.Models.Inspection", null) - .WithMany("InspectionFindings") - .HasForeignKey("InspectionId"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionDefinition", b => - { - b.HasOne("Api.Database.Models.Area", "Area") - .WithMany() - .HasForeignKey("AreaId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Api.Database.Models.MissionRun", "LastSuccessfulRun") - .WithMany() - .HasForeignKey("LastSuccessfulRunId"); - - b.HasOne("Api.Database.Models.Source", "Source") - .WithMany() - .HasForeignKey("SourceId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Area"); - - b.Navigation("LastSuccessfulRun"); - - b.Navigation("Source"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionRun", b => - { - b.HasOne("Api.Database.Models.Area", "Area") - .WithMany() - .HasForeignKey("AreaId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Api.Database.Models.Robot", "Robot") - .WithMany() - .HasForeignKey("RobotId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.OwnsOne("Api.Database.Models.MapMetadata", "Map", b1 => - { - b1.Property("MissionRunId") - .HasColumnType("text"); - - b1.Property("MapName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.HasKey("MissionRunId"); - - b1.ToTable("MissionRuns"); - - b1.WithOwner() - .HasForeignKey("MissionRunId"); - - b1.OwnsOne("Api.Database.Models.Boundary", "Boundary", b2 => - { - b2.Property("MapMetadataMissionRunId") - .HasColumnType("text"); - - b2.Property("X1") - .HasColumnType("double precision"); - - b2.Property("X2") - .HasColumnType("double precision"); - - b2.Property("Y1") - .HasColumnType("double precision"); - - b2.Property("Y2") - .HasColumnType("double precision"); - - b2.Property("Z1") - .HasColumnType("double precision"); - - b2.Property("Z2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataMissionRunId"); - - b2.ToTable("MissionRuns"); - - b2.WithOwner() - .HasForeignKey("MapMetadataMissionRunId"); - }); - - b1.OwnsOne("Api.Database.Models.TransformationMatrices", "TransformationMatrices", b2 => - { - b2.Property("MapMetadataMissionRunId") - .HasColumnType("text"); - - b2.Property("C1") - .HasColumnType("double precision"); - - b2.Property("C2") - .HasColumnType("double precision"); - - b2.Property("D1") - .HasColumnType("double precision"); - - b2.Property("D2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataMissionRunId"); - - b2.ToTable("MissionRuns"); - - b2.WithOwner() - .HasForeignKey("MapMetadataMissionRunId"); - }); - - b1.Navigation("Boundary") - .IsRequired(); - - b1.Navigation("TransformationMatrices") - .IsRequired(); - }); - - b.Navigation("Area"); - - b.Navigation("Map"); - - b.Navigation("Robot"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionTask", b => - { - b.HasOne("Api.Database.Models.MissionRun", null) - .WithMany("Tasks") - .HasForeignKey("MissionRunId"); - - b.OwnsOne("Api.Database.Models.Pose", "RobotPose", b1 => - { - b1.Property("MissionTaskId") - .HasColumnType("text"); - - b1.HasKey("MissionTaskId"); - - b1.ToTable("MissionTasks"); - - b1.WithOwner() - .HasForeignKey("MissionTaskId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseMissionTaskId") - .HasColumnType("text"); - - b2.Property("W") - .HasColumnType("real"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseMissionTaskId"); - - b2.ToTable("MissionTasks"); - - b2.WithOwner() - .HasForeignKey("PoseMissionTaskId"); - }); - - b1.OwnsOne("Api.Database.Models.Position", "Position", b2 => - { - b2.Property("PoseMissionTaskId") - .HasColumnType("text"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseMissionTaskId"); - - b2.ToTable("MissionTasks"); - - b2.WithOwner() - .HasForeignKey("PoseMissionTaskId"); - }); - - b1.Navigation("Orientation") - .IsRequired(); - - b1.Navigation("Position") - .IsRequired(); - }); - - b.Navigation("RobotPose") - .IsRequired(); - }); - - modelBuilder.Entity("Api.Database.Models.Plant", b => - { - b.HasOne("Api.Database.Models.Installation", "Installation") - .WithMany() - .HasForeignKey("InstallationId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - 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.Installation", "CurrentInstallation") - .WithMany() - .HasForeignKey("CurrentInstallationId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - 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("text"); - - b1.HasKey("RobotId"); - - b1.ToTable("Robots"); - - b1.WithOwner() - .HasForeignKey("RobotId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseRobotId") - .HasColumnType("text"); - - 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("text"); - - 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("text"); - - b1.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b1.Property("ShouldRotate270Clockwise") - .HasColumnType("boolean"); - - b1.Property("Type") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b1.Property("Url") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.HasKey("Id"); - - b1.HasIndex("RobotId"); - - b1.ToTable("VideoStream"); - - b1.WithOwner() - .HasForeignKey("RobotId"); - }); - - b.Navigation("CurrentArea"); - - b.Navigation("CurrentInstallation"); - - 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("text"); - - b1.HasKey("SafePositionId"); - - b1.ToTable("SafePositions"); - - b1.WithOwner() - .HasForeignKey("SafePositionId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseSafePositionId") - .HasColumnType("text"); - - 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("text"); - - 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"); - }); - - modelBuilder.Entity("Api.Database.Models.Inspection", b => - { - b.Navigation("InspectionFindings"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionRun", b => - { - b.Navigation("Tasks"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionTask", b => - { - b.Navigation("Inspections"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/backend/api/Migrations/20240726090053_MoveCustomMissionTasksToSourceTable.cs b/backend/api/Migrations/20240726090053_MoveCustomMissionTasksToSourceTable.cs deleted file mode 100644 index 11196e598..000000000 --- a/backend/api/Migrations/20240726090053_MoveCustomMissionTasksToSourceTable.cs +++ /dev/null @@ -1,28 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Api.Migrations -{ - /// - public partial class MoveCustomMissionTasksToSourceTable : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "CustomMissionTasks", - table: "Sources", - type: "text", - nullable: true); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "CustomMissionTasks", - table: "Sources"); - } - } -} diff --git a/backend/api/Migrations/20240813114738_AddUserInfoTable.Designer.cs b/backend/api/Migrations/20240813114738_AddUserInfoTable.Designer.cs deleted file mode 100644 index fee0147ab..000000000 --- a/backend/api/Migrations/20240813114738_AddUserInfoTable.Designer.cs +++ /dev/null @@ -1,1379 +0,0 @@ -// -using System; -using Api.Database.Context; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace Api.Migrations -{ - [DbContext(typeof(FlotillaDbContext))] - [Migration("20240813114738_AddUserInfoTable")] - partial class AddUserInfoTable - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "8.0.7") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("Api.Database.Models.AccessRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AccessLevel") - .IsRequired() - .HasColumnType("text"); - - b.Property("InstallationId") - .HasColumnType("text"); - - b.Property("RoleName") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("InstallationId"); - - b.ToTable("AccessRoles"); - }); - - modelBuilder.Entity("Api.Database.Models.Area", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("DeckId") - .IsRequired() - .HasColumnType("text"); - - b.Property("DefaultLocalizationPoseId") - .HasColumnType("text"); - - b.Property("InstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PlantId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("DeckId"); - - b.HasIndex("DefaultLocalizationPoseId"); - - b.HasIndex("InstallationId"); - - b.HasIndex("PlantId"); - - b.ToTable("Areas"); - }); - - modelBuilder.Entity("Api.Database.Models.Deck", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("DefaultLocalizationPoseId") - .HasColumnType("text"); - - b.Property("InstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PlantId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("DefaultLocalizationPoseId"); - - b.HasIndex("InstallationId"); - - b.HasIndex("PlantId"); - - b.ToTable("Decks"); - }); - - modelBuilder.Entity("Api.Database.Models.DefaultLocalizationPose", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("DockingEnabled") - .HasColumnType("boolean"); - - b.HasKey("Id"); - - b.ToTable("DefaultLocalizationPoses"); - }); - - modelBuilder.Entity("Api.Database.Models.Inspection", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AnalysisType") - .HasColumnType("text"); - - b.Property("EndTime") - .HasColumnType("timestamp with time zone"); - - b.Property("InspectionType") - .IsRequired() - .HasColumnType("text"); - - b.Property("InspectionUrl") - .HasMaxLength(250) - .HasColumnType("character varying(250)"); - - b.Property("IsarStepId") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionTaskId") - .HasColumnType("text"); - - b.Property("StartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("VideoDuration") - .HasColumnType("real"); - - b.HasKey("Id"); - - b.HasIndex("MissionTaskId"); - - b.ToTable("Inspections"); - }); - - modelBuilder.Entity("Api.Database.Models.InspectionFinding", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("Finding") - .IsRequired() - .HasColumnType("text"); - - b.Property("InspectionDate") - .HasColumnType("timestamp with time zone"); - - b.Property("InspectionId") - .HasColumnType("text"); - - b.Property("IsarStepId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("InspectionId"); - - b.ToTable("InspectionFindings"); - }); - - modelBuilder.Entity("Api.Database.Models.Installation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("InstallationCode") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.HasKey("Id"); - - b.HasIndex("InstallationCode") - .IsUnique(); - - b.ToTable("Installations"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionDefinition", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AreaId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Comment") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("InspectionFrequency") - .HasColumnType("bigint"); - - b.Property("InstallationCode") - .IsRequired() - .HasColumnType("text"); - - b.Property("IsDeprecated") - .HasColumnType("boolean"); - - b.Property("LastSuccessfulRunId") - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("SourceId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("AreaId"); - - b.HasIndex("LastSuccessfulRunId"); - - b.HasIndex("SourceId"); - - b.ToTable("MissionDefinitions"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionRun", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AreaId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Comment") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("Description") - .HasMaxLength(450) - .HasColumnType("character varying(450)"); - - b.Property("DesiredStartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("EndTime") - .HasColumnType("timestamp with time zone"); - - b.Property("EstimatedDuration") - .HasColumnType("bigint"); - - b.Property("InstallationCode") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("IsDeprecated") - .HasColumnType("boolean"); - - b.Property("IsarMissionId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("MissionRunType") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("StartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("StatusReason") - .HasMaxLength(450) - .HasColumnType("character varying(450)"); - - b.HasKey("Id"); - - b.HasIndex("AreaId"); - - b.HasIndex("RobotId"); - - b.ToTable("MissionRuns"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionTask", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("EchoPoseId") - .HasColumnType("integer"); - - b.Property("EchoTagLink") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("EndTime") - .HasColumnType("timestamp with time zone"); - - b.Property("IsarTaskId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionRunId") - .HasColumnType("text"); - - b.Property("StartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("TagId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("TaskOrder") - .HasColumnType("integer"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("MissionRunId"); - - b.ToTable("MissionTasks"); - }); - - modelBuilder.Entity("Api.Database.Models.Plant", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("InstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PlantCode") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(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("text"); - - b.Property("BatteryLevel") - .HasColumnType("real"); - - b.Property("CurrentAreaId") - .HasColumnType("text"); - - b.Property("CurrentInstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("CurrentMissionId") - .HasColumnType("text"); - - b.Property("Deprecated") - .HasColumnType("boolean"); - - b.Property("FlotillaStatus") - .IsRequired() - .HasColumnType("text"); - - b.Property("Host") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("IsarConnected") - .HasColumnType("boolean"); - - b.Property("IsarId") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionQueueFrozen") - .HasColumnType("boolean"); - - b.Property("ModelId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Port") - .HasColumnType("integer"); - - b.Property("PressureLevel") - .HasColumnType("real"); - - b.Property("RobotCapabilities") - .HasColumnType("text"); - - b.Property("SerialNumber") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("CurrentAreaId"); - - b.HasIndex("CurrentInstallationId"); - - b.HasIndex("ModelId"); - - b.ToTable("Robots"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotBatteryTimeseries", b => - { - b.Property("BatteryLevel") - .HasColumnType("real"); - - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Time") - .HasColumnType("timestamp with time zone"); - - b.ToTable("RobotBatteryTimeseries"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotModel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AverageDurationPerTag") - .HasColumnType("real"); - - b.Property("BatteryWarningThreshold") - .HasColumnType("real"); - - b.Property("LowerPressureWarningThreshold") - .HasColumnType("real"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - b.Property("UpperPressureWarningThreshold") - .HasColumnType("real"); - - b.HasKey("Id"); - - b.HasIndex("Type") - .IsUnique(); - - b.ToTable("RobotModels"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotPoseTimeseries", b => - { - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("OrientationW") - .HasColumnType("real"); - - b.Property("OrientationX") - .HasColumnType("real"); - - b.Property("OrientationY") - .HasColumnType("real"); - - b.Property("OrientationZ") - .HasColumnType("real"); - - b.Property("PositionX") - .HasColumnType("real"); - - b.Property("PositionY") - .HasColumnType("real"); - - b.Property("PositionZ") - .HasColumnType("real"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Time") - .HasColumnType("timestamp with time zone"); - - b.ToTable("RobotPoseTimeseries"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotPressureTimeseries", b => - { - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("Pressure") - .HasColumnType("real"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Time") - .HasColumnType("timestamp with time zone"); - - b.ToTable("RobotPressureTimeseries"); - }); - - modelBuilder.Entity("Api.Database.Models.SafePosition", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AreaId") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("AreaId"); - - b.ToTable("SafePositions"); - }); - - modelBuilder.Entity("Api.Database.Models.Source", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("CustomMissionTasks") - .HasColumnType("text"); - - b.Property("SourceId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.ToTable("Sources"); - }); - - modelBuilder.Entity("Api.Database.Models.UserInfo", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("Oid") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.ToTable("UserInfos"); - }); - - modelBuilder.Entity("Api.Database.Models.AccessRole", b => - { - b.HasOne("Api.Database.Models.Installation", "Installation") - .WithMany() - .HasForeignKey("InstallationId"); - - b.Navigation("Installation"); - }); - - 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.DefaultLocalizationPose", "DefaultLocalizationPose") - .WithMany() - .HasForeignKey("DefaultLocalizationPoseId"); - - 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.MapMetadata", "MapMetadata", b1 => - { - b1.Property("AreaId") - .HasColumnType("text"); - - b1.Property("MapName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.HasKey("AreaId"); - - b1.ToTable("Areas"); - - b1.WithOwner() - .HasForeignKey("AreaId"); - - b1.OwnsOne("Api.Database.Models.Boundary", "Boundary", b2 => - { - b2.Property("MapMetadataAreaId") - .HasColumnType("text"); - - b2.Property("X1") - .HasColumnType("double precision"); - - b2.Property("X2") - .HasColumnType("double precision"); - - b2.Property("Y1") - .HasColumnType("double precision"); - - b2.Property("Y2") - .HasColumnType("double precision"); - - b2.Property("Z1") - .HasColumnType("double precision"); - - b2.Property("Z2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataAreaId"); - - b2.ToTable("Areas"); - - b2.WithOwner() - .HasForeignKey("MapMetadataAreaId"); - }); - - b1.OwnsOne("Api.Database.Models.TransformationMatrices", "TransformationMatrices", b2 => - { - b2.Property("MapMetadataAreaId") - .HasColumnType("text"); - - b2.Property("C1") - .HasColumnType("double precision"); - - b2.Property("C2") - .HasColumnType("double precision"); - - b2.Property("D1") - .HasColumnType("double precision"); - - b2.Property("D2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataAreaId"); - - b2.ToTable("Areas"); - - b2.WithOwner() - .HasForeignKey("MapMetadataAreaId"); - }); - - b1.Navigation("Boundary") - .IsRequired(); - - b1.Navigation("TransformationMatrices") - .IsRequired(); - }); - - b.Navigation("Deck"); - - b.Navigation("DefaultLocalizationPose"); - - b.Navigation("Installation"); - - b.Navigation("MapMetadata") - .IsRequired(); - - b.Navigation("Plant"); - }); - - modelBuilder.Entity("Api.Database.Models.Deck", b => - { - b.HasOne("Api.Database.Models.DefaultLocalizationPose", "DefaultLocalizationPose") - .WithMany() - .HasForeignKey("DefaultLocalizationPoseId"); - - 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.Navigation("DefaultLocalizationPose"); - - b.Navigation("Installation"); - - b.Navigation("Plant"); - }); - - modelBuilder.Entity("Api.Database.Models.DefaultLocalizationPose", b => - { - b.OwnsOne("Api.Database.Models.Pose", "Pose", b1 => - { - b1.Property("DefaultLocalizationPoseId") - .HasColumnType("text"); - - b1.HasKey("DefaultLocalizationPoseId"); - - b1.ToTable("DefaultLocalizationPoses"); - - b1.WithOwner() - .HasForeignKey("DefaultLocalizationPoseId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseDefaultLocalizationPoseId") - .HasColumnType("text"); - - b2.Property("W") - .HasColumnType("real"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseDefaultLocalizationPoseId"); - - b2.ToTable("DefaultLocalizationPoses"); - - b2.WithOwner() - .HasForeignKey("PoseDefaultLocalizationPoseId"); - }); - - b1.OwnsOne("Api.Database.Models.Position", "Position", b2 => - { - b2.Property("PoseDefaultLocalizationPoseId") - .HasColumnType("text"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseDefaultLocalizationPoseId"); - - b2.ToTable("DefaultLocalizationPoses"); - - b2.WithOwner() - .HasForeignKey("PoseDefaultLocalizationPoseId"); - }); - - b1.Navigation("Orientation") - .IsRequired(); - - b1.Navigation("Position") - .IsRequired(); - }); - - b.Navigation("Pose") - .IsRequired(); - }); - - modelBuilder.Entity("Api.Database.Models.Inspection", b => - { - b.HasOne("Api.Database.Models.MissionTask", null) - .WithMany("Inspections") - .HasForeignKey("MissionTaskId"); - - b.OwnsOne("Api.Database.Models.Position", "InspectionTarget", b1 => - { - b1.Property("InspectionId") - .HasColumnType("text"); - - b1.Property("X") - .HasColumnType("real"); - - b1.Property("Y") - .HasColumnType("real"); - - b1.Property("Z") - .HasColumnType("real"); - - b1.HasKey("InspectionId"); - - b1.ToTable("Inspections"); - - b1.WithOwner() - .HasForeignKey("InspectionId"); - }); - - b.Navigation("InspectionTarget") - .IsRequired(); - }); - - modelBuilder.Entity("Api.Database.Models.InspectionFinding", b => - { - b.HasOne("Api.Database.Models.Inspection", null) - .WithMany("InspectionFindings") - .HasForeignKey("InspectionId"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionDefinition", b => - { - b.HasOne("Api.Database.Models.Area", "Area") - .WithMany() - .HasForeignKey("AreaId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Api.Database.Models.MissionRun", "LastSuccessfulRun") - .WithMany() - .HasForeignKey("LastSuccessfulRunId"); - - b.HasOne("Api.Database.Models.Source", "Source") - .WithMany() - .HasForeignKey("SourceId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Area"); - - b.Navigation("LastSuccessfulRun"); - - b.Navigation("Source"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionRun", b => - { - b.HasOne("Api.Database.Models.Area", "Area") - .WithMany() - .HasForeignKey("AreaId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Api.Database.Models.Robot", "Robot") - .WithMany() - .HasForeignKey("RobotId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.OwnsOne("Api.Database.Models.MapMetadata", "Map", b1 => - { - b1.Property("MissionRunId") - .HasColumnType("text"); - - b1.Property("MapName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.HasKey("MissionRunId"); - - b1.ToTable("MissionRuns"); - - b1.WithOwner() - .HasForeignKey("MissionRunId"); - - b1.OwnsOne("Api.Database.Models.Boundary", "Boundary", b2 => - { - b2.Property("MapMetadataMissionRunId") - .HasColumnType("text"); - - b2.Property("X1") - .HasColumnType("double precision"); - - b2.Property("X2") - .HasColumnType("double precision"); - - b2.Property("Y1") - .HasColumnType("double precision"); - - b2.Property("Y2") - .HasColumnType("double precision"); - - b2.Property("Z1") - .HasColumnType("double precision"); - - b2.Property("Z2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataMissionRunId"); - - b2.ToTable("MissionRuns"); - - b2.WithOwner() - .HasForeignKey("MapMetadataMissionRunId"); - }); - - b1.OwnsOne("Api.Database.Models.TransformationMatrices", "TransformationMatrices", b2 => - { - b2.Property("MapMetadataMissionRunId") - .HasColumnType("text"); - - b2.Property("C1") - .HasColumnType("double precision"); - - b2.Property("C2") - .HasColumnType("double precision"); - - b2.Property("D1") - .HasColumnType("double precision"); - - b2.Property("D2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataMissionRunId"); - - b2.ToTable("MissionRuns"); - - b2.WithOwner() - .HasForeignKey("MapMetadataMissionRunId"); - }); - - b1.Navigation("Boundary") - .IsRequired(); - - b1.Navigation("TransformationMatrices") - .IsRequired(); - }); - - b.Navigation("Area"); - - b.Navigation("Map"); - - b.Navigation("Robot"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionTask", b => - { - b.HasOne("Api.Database.Models.MissionRun", null) - .WithMany("Tasks") - .HasForeignKey("MissionRunId"); - - b.OwnsOne("Api.Database.Models.Pose", "RobotPose", b1 => - { - b1.Property("MissionTaskId") - .HasColumnType("text"); - - b1.HasKey("MissionTaskId"); - - b1.ToTable("MissionTasks"); - - b1.WithOwner() - .HasForeignKey("MissionTaskId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseMissionTaskId") - .HasColumnType("text"); - - b2.Property("W") - .HasColumnType("real"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseMissionTaskId"); - - b2.ToTable("MissionTasks"); - - b2.WithOwner() - .HasForeignKey("PoseMissionTaskId"); - }); - - b1.OwnsOne("Api.Database.Models.Position", "Position", b2 => - { - b2.Property("PoseMissionTaskId") - .HasColumnType("text"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseMissionTaskId"); - - b2.ToTable("MissionTasks"); - - b2.WithOwner() - .HasForeignKey("PoseMissionTaskId"); - }); - - b1.Navigation("Orientation") - .IsRequired(); - - b1.Navigation("Position") - .IsRequired(); - }); - - b.Navigation("RobotPose") - .IsRequired(); - }); - - modelBuilder.Entity("Api.Database.Models.Plant", b => - { - b.HasOne("Api.Database.Models.Installation", "Installation") - .WithMany() - .HasForeignKey("InstallationId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - 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.Installation", "CurrentInstallation") - .WithMany() - .HasForeignKey("CurrentInstallationId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - 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("text"); - - b1.HasKey("RobotId"); - - b1.ToTable("Robots"); - - b1.WithOwner() - .HasForeignKey("RobotId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseRobotId") - .HasColumnType("text"); - - 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("text"); - - 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("text"); - - b1.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b1.Property("ShouldRotate270Clockwise") - .HasColumnType("boolean"); - - b1.Property("Type") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b1.Property("Url") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.HasKey("Id"); - - b1.HasIndex("RobotId"); - - b1.ToTable("VideoStream"); - - b1.WithOwner() - .HasForeignKey("RobotId"); - }); - - b.Navigation("CurrentArea"); - - b.Navigation("CurrentInstallation"); - - 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("text"); - - b1.HasKey("SafePositionId"); - - b1.ToTable("SafePositions"); - - b1.WithOwner() - .HasForeignKey("SafePositionId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseSafePositionId") - .HasColumnType("text"); - - 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("text"); - - 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"); - }); - - modelBuilder.Entity("Api.Database.Models.Inspection", b => - { - b.Navigation("InspectionFindings"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionRun", b => - { - b.Navigation("Tasks"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionTask", b => - { - b.Navigation("Inspections"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/backend/api/Migrations/20240813114738_AddUserInfoTable.cs b/backend/api/Migrations/20240813114738_AddUserInfoTable.cs deleted file mode 100644 index 7ab31d85d..000000000 --- a/backend/api/Migrations/20240813114738_AddUserInfoTable.cs +++ /dev/null @@ -1,33 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Api.Migrations -{ - /// - public partial class AddUserInfoTable : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "UserInfos", - columns: table => new - { - Id = table.Column(type: "text", nullable: false), - Oid = table.Column(type: "text", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_UserInfos", x => x.Id); - }); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "UserInfos"); - } - } -} diff --git a/backend/api/Migrations/20240829080813_RenameEchoProperties.Designer.cs b/backend/api/Migrations/20240829080813_RenameEchoProperties.Designer.cs deleted file mode 100644 index 13b242a9c..000000000 --- a/backend/api/Migrations/20240829080813_RenameEchoProperties.Designer.cs +++ /dev/null @@ -1,1375 +0,0 @@ -// -using System; -using Api.Database.Context; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace Api.Migrations -{ - [DbContext(typeof(FlotillaDbContext))] - [Migration("20240829080813_RenameEchoProperties")] - partial class RenameEchoProperties - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "8.0.7") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("Api.Database.Models.AccessRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AccessLevel") - .IsRequired() - .HasColumnType("text"); - - b.Property("InstallationId") - .HasColumnType("text"); - - b.Property("RoleName") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("InstallationId"); - - b.ToTable("AccessRoles"); - }); - - modelBuilder.Entity("Api.Database.Models.Area", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("DeckId") - .IsRequired() - .HasColumnType("text"); - - b.Property("DefaultLocalizationPoseId") - .HasColumnType("text"); - - b.Property("InstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PlantId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("DeckId"); - - b.HasIndex("DefaultLocalizationPoseId"); - - b.HasIndex("InstallationId"); - - b.HasIndex("PlantId"); - - b.ToTable("Areas"); - }); - - modelBuilder.Entity("Api.Database.Models.Deck", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("DefaultLocalizationPoseId") - .HasColumnType("text"); - - b.Property("InstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PlantId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("DefaultLocalizationPoseId"); - - b.HasIndex("InstallationId"); - - b.HasIndex("PlantId"); - - b.ToTable("Decks"); - }); - - modelBuilder.Entity("Api.Database.Models.DefaultLocalizationPose", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("DockingEnabled") - .HasColumnType("boolean"); - - b.HasKey("Id"); - - b.ToTable("DefaultLocalizationPoses"); - }); - - modelBuilder.Entity("Api.Database.Models.Inspection", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AnalysisType") - .HasColumnType("text"); - - b.Property("EndTime") - .HasColumnType("timestamp with time zone"); - - b.Property("InspectionType") - .IsRequired() - .HasColumnType("text"); - - b.Property("InspectionUrl") - .HasMaxLength(250) - .HasColumnType("character varying(250)"); - - b.Property("IsarStepId") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionTaskId") - .HasColumnType("text"); - - b.Property("StartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("VideoDuration") - .HasColumnType("real"); - - b.HasKey("Id"); - - b.HasIndex("MissionTaskId"); - - b.ToTable("Inspections"); - }); - - modelBuilder.Entity("Api.Database.Models.InspectionFinding", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("Finding") - .IsRequired() - .HasColumnType("text"); - - b.Property("InspectionDate") - .HasColumnType("timestamp with time zone"); - - b.Property("InspectionId") - .HasColumnType("text"); - - b.Property("IsarStepId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("InspectionId"); - - b.ToTable("InspectionFindings"); - }); - - modelBuilder.Entity("Api.Database.Models.Installation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("InstallationCode") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.HasKey("Id"); - - b.HasIndex("InstallationCode") - .IsUnique(); - - b.ToTable("Installations"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionDefinition", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AreaId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Comment") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("InspectionFrequency") - .HasColumnType("bigint"); - - b.Property("InstallationCode") - .IsRequired() - .HasColumnType("text"); - - b.Property("IsDeprecated") - .HasColumnType("boolean"); - - b.Property("LastSuccessfulRunId") - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("SourceId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("AreaId"); - - b.HasIndex("LastSuccessfulRunId"); - - b.HasIndex("SourceId"); - - b.ToTable("MissionDefinitions"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionRun", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AreaId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Comment") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)"); - - b.Property("Description") - .HasMaxLength(450) - .HasColumnType("character varying(450)"); - - b.Property("DesiredStartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("EndTime") - .HasColumnType("timestamp with time zone"); - - b.Property("EstimatedDuration") - .HasColumnType("bigint"); - - b.Property("InstallationCode") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("IsDeprecated") - .HasColumnType("boolean"); - - b.Property("IsarMissionId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("MissionRunType") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("StartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("StatusReason") - .HasMaxLength(450) - .HasColumnType("character varying(450)"); - - b.HasKey("Id"); - - b.HasIndex("AreaId"); - - b.HasIndex("RobotId"); - - b.ToTable("MissionRuns"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionTask", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("EndTime") - .HasColumnType("timestamp with time zone"); - - b.Property("IsarTaskId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionRunId") - .HasColumnType("text"); - - b.Property("PoseId") - .HasColumnType("integer"); - - b.Property("StartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("TagId") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("TagLink") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("TaskOrder") - .HasColumnType("integer"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("MissionRunId"); - - b.ToTable("MissionTasks"); - }); - - modelBuilder.Entity("Api.Database.Models.Plant", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("InstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("PlantCode") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(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("text"); - - b.Property("BatteryLevel") - .HasColumnType("real"); - - b.Property("CurrentAreaId") - .HasColumnType("text"); - - b.Property("CurrentInstallationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("CurrentMissionId") - .HasColumnType("text"); - - b.Property("Deprecated") - .HasColumnType("boolean"); - - b.Property("FlotillaStatus") - .IsRequired() - .HasColumnType("text"); - - b.Property("Host") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("IsarConnected") - .HasColumnType("boolean"); - - b.Property("IsarId") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("MissionQueueFrozen") - .HasColumnType("boolean"); - - b.Property("ModelId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Port") - .HasColumnType("integer"); - - b.Property("PressureLevel") - .HasColumnType("real"); - - b.Property("RobotCapabilities") - .HasColumnType("text"); - - b.Property("SerialNumber") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("CurrentAreaId"); - - b.HasIndex("CurrentInstallationId"); - - b.HasIndex("ModelId"); - - b.ToTable("Robots"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotBatteryTimeseries", b => - { - b.Property("BatteryLevel") - .HasColumnType("real"); - - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Time") - .HasColumnType("timestamp with time zone"); - - b.ToTable("RobotBatteryTimeseries"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotModel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AverageDurationPerTag") - .HasColumnType("real"); - - b.Property("BatteryWarningThreshold") - .HasColumnType("real"); - - b.Property("LowerPressureWarningThreshold") - .HasColumnType("real"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - b.Property("UpperPressureWarningThreshold") - .HasColumnType("real"); - - b.HasKey("Id"); - - b.HasIndex("Type") - .IsUnique(); - - b.ToTable("RobotModels"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotPoseTimeseries", b => - { - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("OrientationW") - .HasColumnType("real"); - - b.Property("OrientationX") - .HasColumnType("real"); - - b.Property("OrientationY") - .HasColumnType("real"); - - b.Property("OrientationZ") - .HasColumnType("real"); - - b.Property("PositionX") - .HasColumnType("real"); - - b.Property("PositionY") - .HasColumnType("real"); - - b.Property("PositionZ") - .HasColumnType("real"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Time") - .HasColumnType("timestamp with time zone"); - - b.ToTable("RobotPoseTimeseries"); - }); - - modelBuilder.Entity("Api.Database.Models.RobotPressureTimeseries", b => - { - b.Property("MissionId") - .HasColumnType("text"); - - b.Property("Pressure") - .HasColumnType("real"); - - b.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Time") - .HasColumnType("timestamp with time zone"); - - b.ToTable("RobotPressureTimeseries"); - }); - - modelBuilder.Entity("Api.Database.Models.SafePosition", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("AreaId") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("AreaId"); - - b.ToTable("SafePositions"); - }); - - modelBuilder.Entity("Api.Database.Models.Source", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("CustomMissionTasks") - .HasColumnType("text"); - - b.Property("SourceId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.ToTable("Sources"); - }); - - modelBuilder.Entity("Api.Database.Models.UserInfo", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("Oid") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.ToTable("UserInfos"); - }); - - modelBuilder.Entity("Api.Database.Models.AccessRole", b => - { - b.HasOne("Api.Database.Models.Installation", "Installation") - .WithMany() - .HasForeignKey("InstallationId"); - - b.Navigation("Installation"); - }); - - 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.DefaultLocalizationPose", "DefaultLocalizationPose") - .WithMany() - .HasForeignKey("DefaultLocalizationPoseId"); - - 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.MapMetadata", "MapMetadata", b1 => - { - b1.Property("AreaId") - .HasColumnType("text"); - - b1.Property("MapName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.HasKey("AreaId"); - - b1.ToTable("Areas"); - - b1.WithOwner() - .HasForeignKey("AreaId"); - - b1.OwnsOne("Api.Database.Models.Boundary", "Boundary", b2 => - { - b2.Property("MapMetadataAreaId") - .HasColumnType("text"); - - b2.Property("X1") - .HasColumnType("double precision"); - - b2.Property("X2") - .HasColumnType("double precision"); - - b2.Property("Y1") - .HasColumnType("double precision"); - - b2.Property("Y2") - .HasColumnType("double precision"); - - b2.Property("Z1") - .HasColumnType("double precision"); - - b2.Property("Z2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataAreaId"); - - b2.ToTable("Areas"); - - b2.WithOwner() - .HasForeignKey("MapMetadataAreaId"); - }); - - b1.OwnsOne("Api.Database.Models.TransformationMatrices", "TransformationMatrices", b2 => - { - b2.Property("MapMetadataAreaId") - .HasColumnType("text"); - - b2.Property("C1") - .HasColumnType("double precision"); - - b2.Property("C2") - .HasColumnType("double precision"); - - b2.Property("D1") - .HasColumnType("double precision"); - - b2.Property("D2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataAreaId"); - - b2.ToTable("Areas"); - - b2.WithOwner() - .HasForeignKey("MapMetadataAreaId"); - }); - - b1.Navigation("Boundary") - .IsRequired(); - - b1.Navigation("TransformationMatrices") - .IsRequired(); - }); - - b.Navigation("Deck"); - - b.Navigation("DefaultLocalizationPose"); - - b.Navigation("Installation"); - - b.Navigation("MapMetadata") - .IsRequired(); - - b.Navigation("Plant"); - }); - - modelBuilder.Entity("Api.Database.Models.Deck", b => - { - b.HasOne("Api.Database.Models.DefaultLocalizationPose", "DefaultLocalizationPose") - .WithMany() - .HasForeignKey("DefaultLocalizationPoseId"); - - 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.Navigation("DefaultLocalizationPose"); - - b.Navigation("Installation"); - - b.Navigation("Plant"); - }); - - modelBuilder.Entity("Api.Database.Models.DefaultLocalizationPose", b => - { - b.OwnsOne("Api.Database.Models.Pose", "Pose", b1 => - { - b1.Property("DefaultLocalizationPoseId") - .HasColumnType("text"); - - b1.HasKey("DefaultLocalizationPoseId"); - - b1.ToTable("DefaultLocalizationPoses"); - - b1.WithOwner() - .HasForeignKey("DefaultLocalizationPoseId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseDefaultLocalizationPoseId") - .HasColumnType("text"); - - b2.Property("W") - .HasColumnType("real"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseDefaultLocalizationPoseId"); - - b2.ToTable("DefaultLocalizationPoses"); - - b2.WithOwner() - .HasForeignKey("PoseDefaultLocalizationPoseId"); - }); - - b1.OwnsOne("Api.Database.Models.Position", "Position", b2 => - { - b2.Property("PoseDefaultLocalizationPoseId") - .HasColumnType("text"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseDefaultLocalizationPoseId"); - - b2.ToTable("DefaultLocalizationPoses"); - - b2.WithOwner() - .HasForeignKey("PoseDefaultLocalizationPoseId"); - }); - - b1.Navigation("Orientation") - .IsRequired(); - - b1.Navigation("Position") - .IsRequired(); - }); - - b.Navigation("Pose") - .IsRequired(); - }); - - modelBuilder.Entity("Api.Database.Models.Inspection", b => - { - b.HasOne("Api.Database.Models.MissionTask", null) - .WithMany("Inspections") - .HasForeignKey("MissionTaskId"); - - b.OwnsOne("Api.Database.Models.Position", "InspectionTarget", b1 => - { - b1.Property("InspectionId") - .HasColumnType("text"); - - b1.Property("X") - .HasColumnType("real"); - - b1.Property("Y") - .HasColumnType("real"); - - b1.Property("Z") - .HasColumnType("real"); - - b1.HasKey("InspectionId"); - - b1.ToTable("Inspections"); - - b1.WithOwner() - .HasForeignKey("InspectionId"); - }); - - b.Navigation("InspectionTarget") - .IsRequired(); - }); - - modelBuilder.Entity("Api.Database.Models.InspectionFinding", b => - { - b.HasOne("Api.Database.Models.Inspection", null) - .WithMany("InspectionFindings") - .HasForeignKey("InspectionId"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionDefinition", b => - { - b.HasOne("Api.Database.Models.Area", "Area") - .WithMany() - .HasForeignKey("AreaId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Api.Database.Models.MissionRun", "LastSuccessfulRun") - .WithMany() - .HasForeignKey("LastSuccessfulRunId"); - - b.HasOne("Api.Database.Models.Source", "Source") - .WithMany() - .HasForeignKey("SourceId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Area"); - - b.Navigation("LastSuccessfulRun"); - - b.Navigation("Source"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionRun", b => - { - b.HasOne("Api.Database.Models.Area", "Area") - .WithMany() - .HasForeignKey("AreaId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Api.Database.Models.Robot", "Robot") - .WithMany() - .HasForeignKey("RobotId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.OwnsOne("Api.Database.Models.MapMetadata", "Map", b1 => - { - b1.Property("MissionRunId") - .HasColumnType("text"); - - b1.Property("MapName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.HasKey("MissionRunId"); - - b1.ToTable("MissionRuns"); - - b1.WithOwner() - .HasForeignKey("MissionRunId"); - - b1.OwnsOne("Api.Database.Models.Boundary", "Boundary", b2 => - { - b2.Property("MapMetadataMissionRunId") - .HasColumnType("text"); - - b2.Property("X1") - .HasColumnType("double precision"); - - b2.Property("X2") - .HasColumnType("double precision"); - - b2.Property("Y1") - .HasColumnType("double precision"); - - b2.Property("Y2") - .HasColumnType("double precision"); - - b2.Property("Z1") - .HasColumnType("double precision"); - - b2.Property("Z2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataMissionRunId"); - - b2.ToTable("MissionRuns"); - - b2.WithOwner() - .HasForeignKey("MapMetadataMissionRunId"); - }); - - b1.OwnsOne("Api.Database.Models.TransformationMatrices", "TransformationMatrices", b2 => - { - b2.Property("MapMetadataMissionRunId") - .HasColumnType("text"); - - b2.Property("C1") - .HasColumnType("double precision"); - - b2.Property("C2") - .HasColumnType("double precision"); - - b2.Property("D1") - .HasColumnType("double precision"); - - b2.Property("D2") - .HasColumnType("double precision"); - - b2.HasKey("MapMetadataMissionRunId"); - - b2.ToTable("MissionRuns"); - - b2.WithOwner() - .HasForeignKey("MapMetadataMissionRunId"); - }); - - b1.Navigation("Boundary") - .IsRequired(); - - b1.Navigation("TransformationMatrices") - .IsRequired(); - }); - - b.Navigation("Area"); - - b.Navigation("Map"); - - b.Navigation("Robot"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionTask", b => - { - b.HasOne("Api.Database.Models.MissionRun", null) - .WithMany("Tasks") - .HasForeignKey("MissionRunId"); - - b.OwnsOne("Api.Database.Models.Pose", "RobotPose", b1 => - { - b1.Property("MissionTaskId") - .HasColumnType("text"); - - b1.HasKey("MissionTaskId"); - - b1.ToTable("MissionTasks"); - - b1.WithOwner() - .HasForeignKey("MissionTaskId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseMissionTaskId") - .HasColumnType("text"); - - b2.Property("W") - .HasColumnType("real"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseMissionTaskId"); - - b2.ToTable("MissionTasks"); - - b2.WithOwner() - .HasForeignKey("PoseMissionTaskId"); - }); - - b1.OwnsOne("Api.Database.Models.Position", "Position", b2 => - { - b2.Property("PoseMissionTaskId") - .HasColumnType("text"); - - b2.Property("X") - .HasColumnType("real"); - - b2.Property("Y") - .HasColumnType("real"); - - b2.Property("Z") - .HasColumnType("real"); - - b2.HasKey("PoseMissionTaskId"); - - b2.ToTable("MissionTasks"); - - b2.WithOwner() - .HasForeignKey("PoseMissionTaskId"); - }); - - b1.Navigation("Orientation") - .IsRequired(); - - b1.Navigation("Position") - .IsRequired(); - }); - - b.Navigation("RobotPose") - .IsRequired(); - }); - - modelBuilder.Entity("Api.Database.Models.Plant", b => - { - b.HasOne("Api.Database.Models.Installation", "Installation") - .WithMany() - .HasForeignKey("InstallationId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - 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.Installation", "CurrentInstallation") - .WithMany() - .HasForeignKey("CurrentInstallationId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - 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("text"); - - b1.HasKey("RobotId"); - - b1.ToTable("Robots"); - - b1.WithOwner() - .HasForeignKey("RobotId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseRobotId") - .HasColumnType("text"); - - 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("text"); - - 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("text"); - - b1.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.Property("RobotId") - .IsRequired() - .HasColumnType("text"); - - b1.Property("ShouldRotate270Clockwise") - .HasColumnType("boolean"); - - b1.Property("Type") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b1.Property("Url") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.HasKey("Id"); - - b1.HasIndex("RobotId"); - - b1.ToTable("VideoStream"); - - b1.WithOwner() - .HasForeignKey("RobotId"); - }); - - b.Navigation("CurrentArea"); - - b.Navigation("CurrentInstallation"); - - 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("text"); - - b1.HasKey("SafePositionId"); - - b1.ToTable("SafePositions"); - - b1.WithOwner() - .HasForeignKey("SafePositionId"); - - b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 => - { - b2.Property("PoseSafePositionId") - .HasColumnType("text"); - - 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("text"); - - 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"); - }); - - modelBuilder.Entity("Api.Database.Models.Inspection", b => - { - b.Navigation("InspectionFindings"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionRun", b => - { - b.Navigation("Tasks"); - }); - - modelBuilder.Entity("Api.Database.Models.MissionTask", b => - { - b.Navigation("Inspections"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/backend/api/Migrations/20240829080813_RenameEchoProperties.cs b/backend/api/Migrations/20240829080813_RenameEchoProperties.cs deleted file mode 100644 index 89f01a532..000000000 --- a/backend/api/Migrations/20240829080813_RenameEchoProperties.cs +++ /dev/null @@ -1,49 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Api.Migrations -{ - /// - public partial class RenameEchoProperties : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "Type", - table: "Sources"); - - migrationBuilder.RenameColumn( - name: "EchoTagLink", - table: "MissionTasks", - newName: "TagLink"); - - migrationBuilder.RenameColumn( - name: "EchoPoseId", - table: "MissionTasks", - newName: "PoseId"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.RenameColumn( - name: "TagLink", - table: "MissionTasks", - newName: "EchoTagLink"); - - migrationBuilder.RenameColumn( - name: "PoseId", - table: "MissionTasks", - newName: "EchoPoseId"); - - migrationBuilder.AddColumn( - name: "Type", - table: "Sources", - type: "text", - nullable: false, - defaultValue: ""); - } - } -} diff --git a/backend/api/Migrations/20240910132840_AddDocumentationToRobot.cs b/backend/api/Migrations/20240910132840_AddDocumentationToRobot.cs deleted file mode 100644 index 1b7f2b49a..000000000 --- a/backend/api/Migrations/20240910132840_AddDocumentationToRobot.cs +++ /dev/null @@ -1,46 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Api.Migrations -{ - /// - public partial class AddDocumentationToRobot : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "DocumentInfo", - columns: table => new - { - Id = table.Column(type: "text", nullable: false), - Name = table.Column(type: "character varying(200)", maxLength: 200, nullable: false), - Url = table.Column(type: "character varying(200)", maxLength: 200, nullable: false), - RobotId = table.Column(type: "text", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_DocumentInfo", x => x.Id); - table.ForeignKey( - name: "FK_DocumentInfo_Robots_RobotId", - column: x => x.RobotId, - principalTable: "Robots", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateIndex( - name: "IX_DocumentInfo_RobotId", - table: "DocumentInfo", - column: "RobotId"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "DocumentInfo"); - } - } -} diff --git a/backend/api/Migrations/20240910132840_AddDocumentationToRobot.Designer.cs b/backend/api/Migrations/20241017111347_AddMigrationsForNewDatabase.Designer.cs similarity index 98% rename from backend/api/Migrations/20240910132840_AddDocumentationToRobot.Designer.cs rename to backend/api/Migrations/20241017111347_AddMigrationsForNewDatabase.Designer.cs index b5fd5aed4..bbc75081f 100644 --- a/backend/api/Migrations/20240910132840_AddDocumentationToRobot.Designer.cs +++ b/backend/api/Migrations/20241017111347_AddMigrationsForNewDatabase.Designer.cs @@ -12,15 +12,15 @@ namespace Api.Migrations { [DbContext(typeof(FlotillaDbContext))] - [Migration("20240910132840_AddDocumentationToRobot")] - partial class AddDocumentationToRobot + [Migration("20241017111347_AddMigrationsForNewDatabase")] + partial class AddMigrationsForNewDatabase { /// protected override void BuildTargetModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder - .HasAnnotation("ProductVersion", "8.0.8") + .HasAnnotation("ProductVersion", "8.0.7") .HasAnnotation("Relational:MaxIdentifierLength", 63); NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); @@ -155,14 +155,11 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) .HasMaxLength(250) .HasColumnType("character varying(250)"); - b.Property("IsarStepId") + b.Property("IsarTaskId") .IsRequired() .HasMaxLength(200) .HasColumnType("character varying(200)"); - b.Property("MissionTaskId") - .HasColumnType("text"); - b.Property("StartTime") .HasColumnType("timestamp with time zone"); @@ -175,8 +172,6 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.HasIndex("MissionTaskId"); - b.ToTable("Inspections"); }); @@ -196,7 +191,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.Property("InspectionId") .HasColumnType("text"); - b.Property("IsarStepId") + b.Property("IsarTaskId") .IsRequired() .HasColumnType("text"); @@ -366,6 +361,9 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.Property("EndTime") .HasColumnType("timestamp with time zone"); + b.Property("InspectionId") + .HasColumnType("text"); + b.Property("IsarTaskId") .HasMaxLength(200) .HasColumnType("character varying(200)"); @@ -400,6 +398,8 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.HasKey("Id"); + b.HasIndex("InspectionId"); + b.HasIndex("MissionRunId"); b.ToTable("MissionTasks"); @@ -890,10 +890,6 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) modelBuilder.Entity("Api.Database.Models.Inspection", b => { - b.HasOne("Api.Database.Models.MissionTask", null) - .WithMany("Inspections") - .HasForeignKey("MissionTaskId"); - b.OwnsOne("Api.Database.Models.Position", "InspectionTarget", b1 => { b1.Property("InspectionId") @@ -1055,6 +1051,10 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) modelBuilder.Entity("Api.Database.Models.MissionTask", b => { + b.HasOne("Api.Database.Models.Inspection", "Inspection") + .WithMany() + .HasForeignKey("InspectionId"); + b.HasOne("Api.Database.Models.MissionRun", null) .WithMany("Tasks") .HasForeignKey("MissionRunId"); @@ -1125,6 +1125,8 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) .IsRequired(); }); + b.Navigation("Inspection"); + b.Navigation("RobotPose") .IsRequired(); }); @@ -1396,11 +1398,6 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) { b.Navigation("Tasks"); }); - - modelBuilder.Entity("Api.Database.Models.MissionTask", b => - { - b.Navigation("Inspections"); - }); #pragma warning restore 612, 618 } } diff --git a/backend/api/Migrations/20231002084005_InitialCreate.cs b/backend/api/Migrations/20241017111347_AddMigrationsForNewDatabase.cs similarity index 72% rename from backend/api/Migrations/20231002084005_InitialCreate.cs rename to backend/api/Migrations/20241017111347_AddMigrationsForNewDatabase.cs index 7364a7fee..302448b0d 100644 --- a/backend/api/Migrations/20231002084005_InitialCreate.cs +++ b/backend/api/Migrations/20241017111347_AddMigrationsForNewDatabase.cs @@ -1,11 +1,12 @@ -using Microsoft.EntityFrameworkCore.Migrations; +using System; +using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace Api.Migrations { /// - public partial class InitialCreate : Migration + public partial class AddMigrationsForNewDatabase : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) @@ -15,6 +16,47 @@ protected override void Up(MigrationBuilder migrationBuilder) migrationBuilder.Sql("CREATE EXTENSION IF NOT EXISTS timescaledb CASCADE;"); // + migrationBuilder.CreateTable( + name: "DefaultLocalizationPoses", + columns: table => new + { + Id = table.Column(type: "text", nullable: false), + Pose_Position_X = table.Column(type: "real", nullable: false), + Pose_Position_Y = table.Column(type: "real", nullable: false), + Pose_Position_Z = table.Column(type: "real", nullable: false), + Pose_Orientation_X = table.Column(type: "real", nullable: false), + Pose_Orientation_Y = table.Column(type: "real", nullable: false), + Pose_Orientation_Z = table.Column(type: "real", nullable: false), + Pose_Orientation_W = table.Column(type: "real", nullable: false), + DockingEnabled = table.Column(type: "boolean", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_DefaultLocalizationPoses", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Inspections", + columns: table => new + { + Id = table.Column(type: "text", nullable: false), + IsarTaskId = table.Column(type: "character varying(200)", maxLength: 200, nullable: false), + InspectionTarget_X = table.Column(type: "real", nullable: false), + InspectionTarget_Y = table.Column(type: "real", nullable: false), + InspectionTarget_Z = table.Column(type: "real", nullable: false), + Status = table.Column(type: "text", nullable: false), + InspectionType = table.Column(type: "text", nullable: false), + VideoDuration = table.Column(type: "real", nullable: true), + AnalysisType = table.Column(type: "text", nullable: true), + InspectionUrl = table.Column(type: "character varying(250)", maxLength: 250, nullable: true), + StartTime = table.Column(type: "timestamp with time zone", nullable: true), + EndTime = table.Column(type: "timestamp with time zone", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Inspections", x => x.Id); + }); + migrationBuilder.CreateTable( name: "Installations", columns: table => new @@ -33,14 +75,13 @@ protected override void Up(MigrationBuilder migrationBuilder) columns: table => new { BatteryLevel = table.Column(type: "real", nullable: false), - Time = table.Column(type: "timestamp with time zone", nullable: false), + Time = table.Column(type: "timestamp with time zone", nullable: false), RobotId = table.Column(type: "text", nullable: false), MissionId = table.Column(type: "text", nullable: true) }, constraints: table => { }); - migrationBuilder.Sql( "SELECT create_hypertable( '\"RobotBatteryTimeseries\"', 'Time');\n" ); @@ -72,32 +113,29 @@ protected override void Up(MigrationBuilder migrationBuilder) OrientationY = table.Column(type: "real", nullable: false), OrientationZ = table.Column(type: "real", nullable: false), OrientationW = table.Column(type: "real", nullable: false), - Time = table.Column(type: "timestamp with time zone", nullable: false), + Time = table.Column(type: "timestamp with time zone", nullable: false), RobotId = table.Column(type: "text", nullable: false), MissionId = table.Column(type: "text", nullable: true) }, constraints: table => { }); - migrationBuilder.Sql( "SELECT create_hypertable( '\"RobotPoseTimeseries\"', 'Time');\n" ); - migrationBuilder.CreateTable( name: "RobotPressureTimeseries", columns: table => new { Pressure = table.Column(type: "real", nullable: false), - Time = table.Column(type: "timestamp with time zone", nullable: false), + Time = table.Column(type: "timestamp with time zone", nullable: false), RobotId = table.Column(type: "text", nullable: false), MissionId = table.Column(type: "text", nullable: true) }, constraints: table => { }); - migrationBuilder.Sql( "SELECT create_hypertable( '\"RobotPressureTimeseries\"', 'Time');\n" ); @@ -108,13 +146,64 @@ protected override void Up(MigrationBuilder migrationBuilder) { Id = table.Column(type: "text", nullable: false), SourceId = table.Column(type: "text", nullable: false), - Type = table.Column(type: "text", nullable: false) + CustomMissionTasks = table.Column(type: "text", nullable: true) }, constraints: table => { table.PrimaryKey("PK_Sources", x => x.Id); }); + migrationBuilder.CreateTable( + name: "UserInfos", + columns: table => new + { + Id = table.Column(type: "text", nullable: false), + Oid = table.Column(type: "text", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_UserInfos", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "InspectionFindings", + columns: table => new + { + Id = table.Column(type: "text", nullable: false), + InspectionDate = table.Column(type: "timestamp with time zone", nullable: false), + IsarTaskId = table.Column(type: "text", nullable: false), + Finding = table.Column(type: "text", nullable: false), + InspectionId = table.Column(type: "text", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_InspectionFindings", x => x.Id); + table.ForeignKey( + name: "FK_InspectionFindings_Inspections_InspectionId", + column: x => x.InspectionId, + principalTable: "Inspections", + principalColumn: "Id"); + }); + + migrationBuilder.CreateTable( + name: "AccessRoles", + columns: table => new + { + Id = table.Column(type: "text", nullable: false), + InstallationId = table.Column(type: "text", nullable: true), + RoleName = table.Column(type: "text", nullable: false), + AccessLevel = table.Column(type: "text", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_AccessRoles", x => x.Id); + table.ForeignKey( + name: "FK_AccessRoles_Installations_InstallationId", + column: x => x.InstallationId, + principalTable: "Installations", + principalColumn: "Id"); + }); + migrationBuilder.CreateTable( name: "Plants", columns: table => new @@ -142,11 +231,17 @@ protected override void Up(MigrationBuilder migrationBuilder) Id = table.Column(type: "text", nullable: false), PlantId = table.Column(type: "text", nullable: false), InstallationId = table.Column(type: "text", nullable: false), + DefaultLocalizationPoseId = table.Column(type: "text", nullable: true), Name = table.Column(type: "character varying(200)", maxLength: 200, nullable: false) }, constraints: table => { table.PrimaryKey("PK_Decks", x => x.Id); + table.ForeignKey( + name: "FK_Decks_DefaultLocalizationPoses_DefaultLocalizationPoseId", + column: x => x.DefaultLocalizationPoseId, + principalTable: "DefaultLocalizationPoses", + principalColumn: "Id"); table.ForeignKey( name: "FK_Decks_Installations_InstallationId", column: x => x.InstallationId, @@ -166,7 +261,7 @@ protected override void Up(MigrationBuilder migrationBuilder) columns: table => new { Id = table.Column(type: "text", nullable: false), - DeckId = table.Column(type: "text", nullable: true), + DeckId = table.Column(type: "text", nullable: false), PlantId = table.Column(type: "text", nullable: false), InstallationId = table.Column(type: "text", nullable: false), Name = table.Column(type: "character varying(200)", maxLength: 200, nullable: false), @@ -181,13 +276,7 @@ protected override void Up(MigrationBuilder migrationBuilder) MapMetadata_TransformationMatrices_C2 = table.Column(type: "double precision", nullable: false), MapMetadata_TransformationMatrices_D1 = table.Column(type: "double precision", nullable: false), MapMetadata_TransformationMatrices_D2 = table.Column(type: "double precision", nullable: false), - DefaultLocalizationPose_Position_X = table.Column(type: "real", nullable: false), - DefaultLocalizationPose_Position_Y = table.Column(type: "real", nullable: false), - DefaultLocalizationPose_Position_Z = table.Column(type: "real", nullable: false), - DefaultLocalizationPose_Orientation_X = table.Column(type: "real", nullable: false), - DefaultLocalizationPose_Orientation_Y = table.Column(type: "real", nullable: false), - DefaultLocalizationPose_Orientation_Z = table.Column(type: "real", nullable: false), - DefaultLocalizationPose_Orientation_W = table.Column(type: "real", nullable: false) + DefaultLocalizationPoseId = table.Column(type: "text", nullable: true) }, constraints: table => { @@ -198,6 +287,11 @@ protected override void Up(MigrationBuilder migrationBuilder) principalTable: "Decks", principalColumn: "Id", onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_Areas_DefaultLocalizationPoses_DefaultLocalizationPoseId", + column: x => x.DefaultLocalizationPoseId, + principalTable: "DefaultLocalizationPoses", + principalColumn: "Id"); table.ForeignKey( name: "FK_Areas_Installations_InstallationId", column: x => x.InstallationId, @@ -221,14 +315,18 @@ protected override void Up(MigrationBuilder migrationBuilder) IsarId = table.Column(type: "character varying(200)", maxLength: 200, nullable: false), ModelId = table.Column(type: "text", nullable: false), SerialNumber = table.Column(type: "character varying(200)", maxLength: 200, nullable: false), - CurrentInstallation = table.Column(type: "text", nullable: false), + CurrentInstallationId = table.Column(type: "text", nullable: false), CurrentAreaId = table.Column(type: "text", nullable: true), BatteryLevel = table.Column(type: "real", nullable: false), PressureLevel = table.Column(type: "real", nullable: true), Host = table.Column(type: "character varying(200)", maxLength: 200, nullable: false), Port = table.Column(type: "integer", nullable: false), - Enabled = table.Column(type: "boolean", nullable: false), + RobotCapabilities = table.Column(type: "text", nullable: true), + IsarConnected = table.Column(type: "boolean", nullable: false), + Deprecated = table.Column(type: "boolean", nullable: false), + MissionQueueFrozen = table.Column(type: "boolean", nullable: false), Status = table.Column(type: "text", nullable: false), + FlotillaStatus = table.Column(type: "text", nullable: false), Pose_Position_X = table.Column(type: "real", nullable: false), Pose_Position_Y = table.Column(type: "real", nullable: false), Pose_Position_Z = table.Column(type: "real", nullable: false), @@ -246,6 +344,12 @@ protected override void Up(MigrationBuilder migrationBuilder) column: x => x.CurrentAreaId, principalTable: "Areas", principalColumn: "Id"); + table.ForeignKey( + name: "FK_Robots_Installations_CurrentInstallationId", + column: x => x.CurrentInstallationId, + principalTable: "Installations", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_Robots_RobotModels_ModelId", column: x => x.ModelId, @@ -278,22 +382,42 @@ protected override void Up(MigrationBuilder migrationBuilder) principalColumn: "Id"); }); + migrationBuilder.CreateTable( + name: "DocumentInfo", + columns: table => new + { + Id = table.Column(type: "text", nullable: false), + Name = table.Column(type: "character varying(200)", maxLength: 200, nullable: false), + Url = table.Column(type: "character varying(200)", maxLength: 200, nullable: false), + RobotId = table.Column(type: "text", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_DocumentInfo", x => x.Id); + table.ForeignKey( + name: "FK_DocumentInfo_Robots_RobotId", + column: x => x.RobotId, + principalTable: "Robots", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + migrationBuilder.CreateTable( name: "MissionRuns", columns: table => new { Id = table.Column(type: "text", nullable: false), MissionId = table.Column(type: "text", nullable: true), - Name = table.Column(type: "character varying(200)", maxLength: 200, nullable: false), Status = table.Column(type: "text", nullable: false), InstallationCode = table.Column(type: "character varying(200)", maxLength: 200, nullable: false), - DesiredStartTime = table.Column(type: "timestamp with time zone", nullable: false), + DesiredStartTime = table.Column(type: "timestamp with time zone", nullable: false), RobotId = table.Column(type: "text", nullable: false), + MissionRunType = table.Column(type: "text", nullable: false), IsarMissionId = table.Column(type: "character varying(200)", maxLength: 200, nullable: true), Description = table.Column(type: "character varying(450)", maxLength: 450, nullable: true), StatusReason = table.Column(type: "character varying(450)", maxLength: 450, nullable: true), Comment = table.Column(type: "character varying(1000)", maxLength: 1000, nullable: true), - AreaId = table.Column(type: "text", nullable: true), + AreaId = table.Column(type: "text", nullable: false), Map_MapName = table.Column(type: "character varying(200)", maxLength: 200, nullable: true), Map_Boundary_X1 = table.Column(type: "double precision", nullable: true), Map_Boundary_X2 = table.Column(type: "double precision", nullable: true), @@ -305,9 +429,11 @@ protected override void Up(MigrationBuilder migrationBuilder) Map_TransformationMatrices_C2 = table.Column(type: "double precision", nullable: true), Map_TransformationMatrices_D1 = table.Column(type: "double precision", nullable: true), Map_TransformationMatrices_D2 = table.Column(type: "double precision", nullable: true), - StartTime = table.Column(type: "timestamp with time zone", nullable: true), - EndTime = table.Column(type: "timestamp with time zone", nullable: true), - EstimatedDuration = table.Column(type: "bigint", nullable: true) + StartTime = table.Column(type: "timestamp with time zone", nullable: true), + EndTime = table.Column(type: "timestamp with time zone", nullable: true), + EstimatedDuration = table.Column(type: "bigint", nullable: true), + Name = table.Column(type: "character varying(200)", maxLength: 200, nullable: false), + IsDeprecated = table.Column(type: "boolean", nullable: false) }, constraints: table => { @@ -316,7 +442,8 @@ protected override void Up(MigrationBuilder migrationBuilder) name: "FK_MissionRuns_Areas_AreaId", column: x => x.AreaId, principalTable: "Areas", - principalColumn: "Id"); + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_MissionRuns_Robots_RobotId", column: x => x.RobotId, @@ -357,8 +484,8 @@ protected override void Up(MigrationBuilder migrationBuilder) InstallationCode = table.Column(type: "text", nullable: false), Comment = table.Column(type: "character varying(1000)", maxLength: 1000, nullable: true), InspectionFrequency = table.Column(type: "bigint", nullable: true), - LastRunId = table.Column(type: "text", nullable: true), - AreaId = table.Column(type: "text", nullable: true), + LastSuccessfulRunId = table.Column(type: "text", nullable: true), + AreaId = table.Column(type: "text", nullable: false), IsDeprecated = table.Column(type: "boolean", nullable: false) }, constraints: table => @@ -368,10 +495,11 @@ protected override void Up(MigrationBuilder migrationBuilder) name: "FK_MissionDefinitions_Areas_AreaId", column: x => x.AreaId, principalTable: "Areas", - principalColumn: "Id"); + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); table.ForeignKey( - name: "FK_MissionDefinitions_MissionRuns_LastRunId", - column: x => x.LastRunId, + name: "FK_MissionDefinitions_MissionRuns_LastSuccessfulRunId", + column: x => x.LastSuccessfulRunId, principalTable: "MissionRuns", principalColumn: "Id"); table.ForeignKey( @@ -383,18 +511,16 @@ protected override void Up(MigrationBuilder migrationBuilder) }); migrationBuilder.CreateTable( - name: "MissionTask", + name: "MissionTasks", columns: table => new { Id = table.Column(type: "text", nullable: false), IsarTaskId = table.Column(type: "character varying(200)", maxLength: 200, nullable: true), TaskOrder = table.Column(type: "integer", nullable: false), + Type = table.Column(type: "text", nullable: false), TagId = table.Column(type: "character varying(200)", maxLength: 200, nullable: true), Description = table.Column(type: "character varying(500)", maxLength: 500, nullable: true), - EchoTagLink = table.Column(type: "character varying(200)", maxLength: 200, nullable: true), - InspectionTarget_X = table.Column(type: "real", nullable: false), - InspectionTarget_Y = table.Column(type: "real", nullable: false), - InspectionTarget_Z = table.Column(type: "real", nullable: false), + TagLink = table.Column(type: "character varying(200)", maxLength: 200, nullable: true), RobotPose_Position_X = table.Column(type: "real", nullable: false), RobotPose_Position_Y = table.Column(type: "real", nullable: false), RobotPose_Position_Z = table.Column(type: "real", nullable: false), @@ -402,54 +528,43 @@ protected override void Up(MigrationBuilder migrationBuilder) RobotPose_Orientation_Y = table.Column(type: "real", nullable: false), RobotPose_Orientation_Z = table.Column(type: "real", nullable: false), RobotPose_Orientation_W = table.Column(type: "real", nullable: false), - EchoPoseId = table.Column(type: "integer", nullable: true), + PoseId = table.Column(type: "integer", nullable: true), Status = table.Column(type: "text", nullable: false), - StartTime = table.Column(type: "timestamp with time zone", nullable: true), - EndTime = table.Column(type: "timestamp with time zone", nullable: true), - MissionRunId = table.Column(type: "text", nullable: false) + StartTime = table.Column(type: "timestamp with time zone", nullable: true), + EndTime = table.Column(type: "timestamp with time zone", nullable: true), + InspectionId = table.Column(type: "text", nullable: true), + MissionRunId = table.Column(type: "text", nullable: true) }, constraints: table => { - table.PrimaryKey("PK_MissionTask", x => x.Id); + table.PrimaryKey("PK_MissionTasks", x => x.Id); table.ForeignKey( - name: "FK_MissionTask_MissionRuns_MissionRunId", + name: "FK_MissionTasks_Inspections_InspectionId", + column: x => x.InspectionId, + principalTable: "Inspections", + principalColumn: "Id"); + table.ForeignKey( + name: "FK_MissionTasks_MissionRuns_MissionRunId", column: x => x.MissionRunId, principalTable: "MissionRuns", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); + principalColumn: "Id"); }); - migrationBuilder.CreateTable( - name: "Inspection", - columns: table => new - { - Id = table.Column(type: "text", nullable: false), - IsarStepId = table.Column(type: "character varying(200)", maxLength: 200, nullable: true), - Status = table.Column(type: "text", nullable: false), - InspectionType = table.Column(type: "text", nullable: false), - VideoDuration = table.Column(type: "real", nullable: true), - AnalysisType = table.Column(type: "text", nullable: true), - InspectionUrl = table.Column(type: "character varying(250)", maxLength: 250, nullable: true), - StartTime = table.Column(type: "timestamp with time zone", nullable: true), - EndTime = table.Column(type: "timestamp with time zone", nullable: true), - MissionTaskId = table.Column(type: "text", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Inspection", x => x.Id); - table.ForeignKey( - name: "FK_Inspection_MissionTask_MissionTaskId", - column: x => x.MissionTaskId, - principalTable: "MissionTask", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); + migrationBuilder.CreateIndex( + name: "IX_AccessRoles_InstallationId", + table: "AccessRoles", + column: "InstallationId"); migrationBuilder.CreateIndex( name: "IX_Areas_DeckId", table: "Areas", column: "DeckId"); + migrationBuilder.CreateIndex( + name: "IX_Areas_DefaultLocalizationPoseId", + table: "Areas", + column: "DefaultLocalizationPoseId"); + migrationBuilder.CreateIndex( name: "IX_Areas_InstallationId", table: "Areas", @@ -460,6 +575,11 @@ protected override void Up(MigrationBuilder migrationBuilder) table: "Areas", column: "PlantId"); + migrationBuilder.CreateIndex( + name: "IX_Decks_DefaultLocalizationPoseId", + table: "Decks", + column: "DefaultLocalizationPoseId"); + migrationBuilder.CreateIndex( name: "IX_Decks_InstallationId", table: "Decks", @@ -471,9 +591,14 @@ protected override void Up(MigrationBuilder migrationBuilder) column: "PlantId"); migrationBuilder.CreateIndex( - name: "IX_Inspection_MissionTaskId", - table: "Inspection", - column: "MissionTaskId"); + name: "IX_DocumentInfo_RobotId", + table: "DocumentInfo", + column: "RobotId"); + + migrationBuilder.CreateIndex( + name: "IX_InspectionFindings_InspectionId", + table: "InspectionFindings", + column: "InspectionId"); migrationBuilder.CreateIndex( name: "IX_Installations_InstallationCode", @@ -487,9 +612,9 @@ protected override void Up(MigrationBuilder migrationBuilder) column: "AreaId"); migrationBuilder.CreateIndex( - name: "IX_MissionDefinitions_LastRunId", + name: "IX_MissionDefinitions_LastSuccessfulRunId", table: "MissionDefinitions", - column: "LastRunId"); + column: "LastSuccessfulRunId"); migrationBuilder.CreateIndex( name: "IX_MissionDefinitions_SourceId", @@ -507,8 +632,13 @@ protected override void Up(MigrationBuilder migrationBuilder) column: "RobotId"); migrationBuilder.CreateIndex( - name: "IX_MissionTask_MissionRunId", - table: "MissionTask", + name: "IX_MissionTasks_InspectionId", + table: "MissionTasks", + column: "InspectionId"); + + migrationBuilder.CreateIndex( + name: "IX_MissionTasks_MissionRunId", + table: "MissionTasks", column: "MissionRunId"); migrationBuilder.CreateIndex( @@ -533,6 +663,11 @@ protected override void Up(MigrationBuilder migrationBuilder) table: "Robots", column: "CurrentAreaId"); + migrationBuilder.CreateIndex( + name: "IX_Robots_CurrentInstallationId", + table: "Robots", + column: "CurrentInstallationId"); + migrationBuilder.CreateIndex( name: "IX_Robots_ModelId", table: "Robots", @@ -553,11 +688,20 @@ protected override void Up(MigrationBuilder migrationBuilder) protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( - name: "Inspection"); + name: "AccessRoles"); + + migrationBuilder.DropTable( + name: "DocumentInfo"); + + migrationBuilder.DropTable( + name: "InspectionFindings"); migrationBuilder.DropTable( name: "MissionDefinitions"); + migrationBuilder.DropTable( + name: "MissionTasks"); + migrationBuilder.DropTable( name: "RobotBatteryTimeseries"); @@ -571,14 +715,17 @@ protected override void Down(MigrationBuilder migrationBuilder) name: "SafePositions"); migrationBuilder.DropTable( - name: "VideoStream"); + name: "UserInfos"); migrationBuilder.DropTable( - name: "MissionTask"); + name: "VideoStream"); migrationBuilder.DropTable( name: "Sources"); + migrationBuilder.DropTable( + name: "Inspections"); + migrationBuilder.DropTable( name: "MissionRuns"); @@ -594,6 +741,9 @@ protected override void Down(MigrationBuilder migrationBuilder) migrationBuilder.DropTable( name: "Decks"); + migrationBuilder.DropTable( + name: "DefaultLocalizationPoses"); + migrationBuilder.DropTable( name: "Plants"); diff --git a/backend/api/Migrations/FlotillaDbContextModelSnapshot.cs b/backend/api/Migrations/FlotillaDbContextModelSnapshot.cs index e3972ee92..6b30116c7 100644 --- a/backend/api/Migrations/FlotillaDbContextModelSnapshot.cs +++ b/backend/api/Migrations/FlotillaDbContextModelSnapshot.cs @@ -152,14 +152,11 @@ protected override void BuildModel(ModelBuilder modelBuilder) .HasMaxLength(250) .HasColumnType("character varying(250)"); - b.Property("IsarStepId") + b.Property("IsarTaskId") .IsRequired() .HasMaxLength(200) .HasColumnType("character varying(200)"); - b.Property("MissionTaskId") - .HasColumnType("text"); - b.Property("StartTime") .HasColumnType("timestamp with time zone"); @@ -172,8 +169,6 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.HasIndex("MissionTaskId"); - b.ToTable("Inspections"); }); @@ -193,7 +188,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("InspectionId") .HasColumnType("text"); - b.Property("IsarStepId") + b.Property("IsarTaskId") .IsRequired() .HasColumnType("text"); @@ -363,6 +358,9 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("EndTime") .HasColumnType("timestamp with time zone"); + b.Property("InspectionId") + .HasColumnType("text"); + b.Property("IsarTaskId") .HasMaxLength(200) .HasColumnType("character varying(200)"); @@ -397,6 +395,8 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); + b.HasIndex("InspectionId"); + b.HasIndex("MissionRunId"); b.ToTable("MissionTasks"); @@ -887,10 +887,6 @@ protected override void BuildModel(ModelBuilder modelBuilder) modelBuilder.Entity("Api.Database.Models.Inspection", b => { - b.HasOne("Api.Database.Models.MissionTask", null) - .WithMany("Inspections") - .HasForeignKey("MissionTaskId"); - b.OwnsOne("Api.Database.Models.Position", "InspectionTarget", b1 => { b1.Property("InspectionId") @@ -1052,6 +1048,10 @@ protected override void BuildModel(ModelBuilder modelBuilder) modelBuilder.Entity("Api.Database.Models.MissionTask", b => { + b.HasOne("Api.Database.Models.Inspection", "Inspection") + .WithMany() + .HasForeignKey("InspectionId"); + b.HasOne("Api.Database.Models.MissionRun", null) .WithMany("Tasks") .HasForeignKey("MissionRunId"); @@ -1122,6 +1122,8 @@ protected override void BuildModel(ModelBuilder modelBuilder) .IsRequired(); }); + b.Navigation("Inspection"); + b.Navigation("RobotPose") .IsRequired(); }); @@ -1393,11 +1395,6 @@ protected override void BuildModel(ModelBuilder modelBuilder) { b.Navigation("Tasks"); }); - - modelBuilder.Entity("Api.Database.Models.MissionTask", b => - { - b.Navigation("Inspections"); - }); #pragma warning restore 612, 618 } }