From 4e1ff0c5e15620d4640a0bd3d393d532171db6dc Mon Sep 17 00:00:00 2001 From: Christian de Jonge Date: Tue, 10 Dec 2024 10:45:30 +0100 Subject: [PATCH] Squash migration history --- ...otMissionStartBatteryThreshold.Designer.cs | 1410 ----------------- ...06_AddRobotMissionStartBatteryThreshold.cs | 28 - ...47_AddMigrationsForNewDatabase.Designer.cs | 1404 ---------------- ...09_AddDockPositionInsteadOfSafePosition.cs | 50 - ...0241210093952_Reset-Structure.Designer.cs} | 4 +- ...e.cs => 20241210093952_Reset-Structure.cs} | 44 +- 6 files changed, 4 insertions(+), 2936 deletions(-) delete mode 100644 backend/api/Migrations/20241015070506_AddRobotMissionStartBatteryThreshold.Designer.cs delete mode 100644 backend/api/Migrations/20241015070506_AddRobotMissionStartBatteryThreshold.cs delete mode 100644 backend/api/Migrations/20241017111347_AddMigrationsForNewDatabase.Designer.cs delete mode 100644 backend/api/Migrations/20241031134209_AddDockPositionInsteadOfSafePosition.cs rename backend/api/Migrations/{20241031134209_AddDockPositionInsteadOfSafePosition.Designer.cs => 20241210093952_Reset-Structure.Designer.cs} (99%) rename backend/api/Migrations/{20241017111347_AddMigrationsForNewDatabase.cs => 20241210093952_Reset-Structure.cs} (94%) diff --git a/backend/api/Migrations/20241015070506_AddRobotMissionStartBatteryThreshold.Designer.cs b/backend/api/Migrations/20241015070506_AddRobotMissionStartBatteryThreshold.Designer.cs deleted file mode 100644 index cdcd14651..000000000 --- a/backend/api/Migrations/20241015070506_AddRobotMissionStartBatteryThreshold.Designer.cs +++ /dev/null @@ -1,1410 +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("20241015070506_AddRobotMissionStartBatteryThreshold")] - partial class AddRobotMissionStartBatteryThreshold - { - /// - 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("BatteryMissionStartThreshold") - .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.OwnsMany("Api.Database.Models.DocumentInfo", "Documentation", 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("Url") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.HasKey("Id"); - - b1.HasIndex("RobotId"); - - b1.ToTable("DocumentInfo"); - - b1.WithOwner() - .HasForeignKey("RobotId"); - }); - - 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("Documentation"); - - 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/20241015070506_AddRobotMissionStartBatteryThreshold.cs b/backend/api/Migrations/20241015070506_AddRobotMissionStartBatteryThreshold.cs deleted file mode 100644 index dd799164a..000000000 --- a/backend/api/Migrations/20241015070506_AddRobotMissionStartBatteryThreshold.cs +++ /dev/null @@ -1,28 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Api.Migrations -{ - /// - public partial class AddRobotMissionStartBatteryThreshold : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "BatteryMissionStartThreshold", - table: "RobotModels", - type: "real", - nullable: true); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "BatteryMissionStartThreshold", - table: "RobotModels"); - } - } -} diff --git a/backend/api/Migrations/20241017111347_AddMigrationsForNewDatabase.Designer.cs b/backend/api/Migrations/20241017111347_AddMigrationsForNewDatabase.Designer.cs deleted file mode 100644 index bbc75081f..000000000 --- a/backend/api/Migrations/20241017111347_AddMigrationsForNewDatabase.Designer.cs +++ /dev/null @@ -1,1404 +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("20241017111347_AddMigrationsForNewDatabase")] - partial class AddMigrationsForNewDatabase - { - /// - 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("IsarTaskId") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("StartTime") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("VideoDuration") - .HasColumnType("real"); - - b.HasKey("Id"); - - 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("IsarTaskId") - .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("InspectionId") - .HasColumnType("text"); - - 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("InspectionId"); - - 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.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.Inspection", "Inspection") - .WithMany() - .HasForeignKey("InspectionId"); - - 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("Inspection"); - - 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.OwnsMany("Api.Database.Models.DocumentInfo", "Documentation", 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("Url") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b1.HasKey("Id"); - - b1.HasIndex("RobotId"); - - b1.ToTable("DocumentInfo"); - - b1.WithOwner() - .HasForeignKey("RobotId"); - }); - - 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("Documentation"); - - 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"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/backend/api/Migrations/20241031134209_AddDockPositionInsteadOfSafePosition.cs b/backend/api/Migrations/20241031134209_AddDockPositionInsteadOfSafePosition.cs deleted file mode 100644 index 62d6aad20..000000000 --- a/backend/api/Migrations/20241031134209_AddDockPositionInsteadOfSafePosition.cs +++ /dev/null @@ -1,50 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Api.Migrations -{ - /// - public partial class AddDockPositionInsteadOfSafePosition : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "SafePositions"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "SafePositions", - columns: table => new - { - Id = table.Column(type: "text", nullable: false), - AreaId = table.Column(type: "text", nullable: true), - Pose_Orientation_W = 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_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) - }, - constraints: table => - { - table.PrimaryKey("PK_SafePositions", x => x.Id); - table.ForeignKey( - name: "FK_SafePositions_Areas_AreaId", - column: x => x.AreaId, - principalTable: "Areas", - principalColumn: "Id"); - }); - - migrationBuilder.CreateIndex( - name: "IX_SafePositions_AreaId", - table: "SafePositions", - column: "AreaId"); - } - } -} diff --git a/backend/api/Migrations/20241031134209_AddDockPositionInsteadOfSafePosition.Designer.cs b/backend/api/Migrations/20241210093952_Reset-Structure.Designer.cs similarity index 99% rename from backend/api/Migrations/20241031134209_AddDockPositionInsteadOfSafePosition.Designer.cs rename to backend/api/Migrations/20241210093952_Reset-Structure.Designer.cs index 3a30ad641..d68089023 100644 --- a/backend/api/Migrations/20241031134209_AddDockPositionInsteadOfSafePosition.Designer.cs +++ b/backend/api/Migrations/20241210093952_Reset-Structure.Designer.cs @@ -12,8 +12,8 @@ namespace Api.Migrations { [DbContext(typeof(FlotillaDbContext))] - [Migration("20241031134209_AddDockPositionInsteadOfSafePosition")] - partial class AddDockPositionInsteadOfSafePosition + [Migration("20241210093952_Reset-Structure")] + partial class ResetStructure { /// protected override void BuildTargetModel(ModelBuilder modelBuilder) diff --git a/backend/api/Migrations/20241017111347_AddMigrationsForNewDatabase.cs b/backend/api/Migrations/20241210093952_Reset-Structure.cs similarity index 94% rename from backend/api/Migrations/20241017111347_AddMigrationsForNewDatabase.cs rename to backend/api/Migrations/20241210093952_Reset-Structure.cs index 302448b0d..7349f2699 100644 --- a/backend/api/Migrations/20241017111347_AddMigrationsForNewDatabase.cs +++ b/backend/api/Migrations/20241210093952_Reset-Structure.cs @@ -6,7 +6,7 @@ namespace Api.Migrations { /// - public partial class AddMigrationsForNewDatabase : Migration + public partial class ResetStructure : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) @@ -82,9 +82,6 @@ protected override void Up(MigrationBuilder migrationBuilder) constraints: table => { }); - migrationBuilder.Sql( - "SELECT create_hypertable( '\"RobotBatteryTimeseries\"', 'Time');\n" - ); migrationBuilder.CreateTable( name: "RobotModels", @@ -95,6 +92,7 @@ protected override void Up(MigrationBuilder migrationBuilder) BatteryWarningThreshold = table.Column(type: "real", nullable: true), UpperPressureWarningThreshold = table.Column(type: "real", nullable: true), LowerPressureWarningThreshold = table.Column(type: "real", nullable: true), + BatteryMissionStartThreshold = table.Column(type: "real", nullable: true), AverageDurationPerTag = table.Column(type: "real", nullable: true) }, constraints: table => @@ -120,9 +118,6 @@ protected override void Up(MigrationBuilder migrationBuilder) constraints: table => { }); - migrationBuilder.Sql( - "SELECT create_hypertable( '\"RobotPoseTimeseries\"', 'Time');\n" - ); migrationBuilder.CreateTable( name: "RobotPressureTimeseries", @@ -136,9 +131,6 @@ protected override void Up(MigrationBuilder migrationBuilder) constraints: table => { }); - migrationBuilder.Sql( - "SELECT create_hypertable( '\"RobotPressureTimeseries\"', 'Time');\n" - ); migrationBuilder.CreateTable( name: "Sources", @@ -358,30 +350,6 @@ protected override void Up(MigrationBuilder migrationBuilder) onDelete: ReferentialAction.Cascade); }); - migrationBuilder.CreateTable( - name: "SafePositions", - 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), - AreaId = table.Column(type: "text", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_SafePositions", x => x.Id); - table.ForeignKey( - name: "FK_SafePositions_Areas_AreaId", - column: x => x.AreaId, - principalTable: "Areas", - principalColumn: "Id"); - }); - migrationBuilder.CreateTable( name: "DocumentInfo", columns: table => new @@ -673,11 +641,6 @@ protected override void Up(MigrationBuilder migrationBuilder) table: "Robots", column: "ModelId"); - migrationBuilder.CreateIndex( - name: "IX_SafePositions_AreaId", - table: "SafePositions", - column: "AreaId"); - migrationBuilder.CreateIndex( name: "IX_VideoStream_RobotId", table: "VideoStream", @@ -711,9 +674,6 @@ protected override void Down(MigrationBuilder migrationBuilder) migrationBuilder.DropTable( name: "RobotPressureTimeseries"); - migrationBuilder.DropTable( - name: "SafePositions"); - migrationBuilder.DropTable( name: "UserInfos");