Skip to content

Commit 794b0b1

Browse files
committed
Remove timeseries from postgreSQL database
This functionality has not been used and should thus be removed. In addition, it simplifies an upcoming implementation of postgreSQL database as part of tests.
1 parent 426b258 commit 794b0b1

11 files changed

+0
-776
lines changed

backend/api/Controllers/TimeseriesController.cs

Lines changed: 0 additions & 111 deletions
This file was deleted.

backend/api/Database/Context/FlotillaDbContext.cs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,6 @@ public FlotillaDbContext(DbContextOptions options)
3333
public DbSet<UserInfo> UserInfos => Set<UserInfo>();
3434
public DbSet<TagInspectionMetadata> TagInspectionMetadata => Set<TagInspectionMetadata>();
3535

36-
// Timeseries:
37-
public DbSet<RobotPressureTimeseries> RobotPressureTimeseries =>
38-
Set<RobotPressureTimeseries>();
39-
public DbSet<RobotBatteryTimeseries> RobotBatteryTimeseries =>
40-
Set<RobotBatteryTimeseries>();
41-
public DbSet<RobotPoseTimeseries> RobotPoseTimeseries => Set<RobotPoseTimeseries>();
42-
4336
protected override void OnModelCreating(ModelBuilder modelBuilder)
4437
{
4538
bool isSqlLite = Database.ProviderName == "Microsoft.EntityFrameworkCore.Sqlite";

backend/api/Database/Models/RobotBatteryTimeseries.cs

Lines changed: 0 additions & 12 deletions
This file was deleted.

backend/api/Database/Models/RobotPoseTimeseries.cs

Lines changed: 0 additions & 45 deletions
This file was deleted.

backend/api/Database/Models/RobotPressureTimeseries.cs

Lines changed: 0 additions & 12 deletions
This file was deleted.

backend/api/Database/Models/TimeseriesBase.cs

Lines changed: 0 additions & 17 deletions
This file was deleted.

backend/api/Migrations/20241210093952_Reset-Structure.cs

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,6 @@ public partial class ResetStructure : Migration
1111
/// <inheritdoc />
1212
protected override void Up(MigrationBuilder migrationBuilder)
1313
{
14-
// MANUALLY ADDED:
15-
// Adding timescale extension to the database
16-
migrationBuilder.Sql("CREATE EXTENSION IF NOT EXISTS timescaledb CASCADE;");
17-
//
18-
1914
migrationBuilder.CreateTable(
2015
name: "DefaultLocalizationPoses",
2116
columns: table => new
@@ -70,19 +65,6 @@ protected override void Up(MigrationBuilder migrationBuilder)
7065
table.PrimaryKey("PK_Installations", x => x.Id);
7166
});
7267

73-
migrationBuilder.CreateTable(
74-
name: "RobotBatteryTimeseries",
75-
columns: table => new
76-
{
77-
BatteryLevel = table.Column<float>(type: "real", nullable: false),
78-
Time = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
79-
RobotId = table.Column<string>(type: "text", nullable: false),
80-
MissionId = table.Column<string>(type: "text", nullable: true)
81-
},
82-
constraints: table =>
83-
{
84-
});
85-
8668
migrationBuilder.CreateTable(
8769
name: "RobotModels",
8870
columns: table => new
@@ -100,38 +82,6 @@ protected override void Up(MigrationBuilder migrationBuilder)
10082
table.PrimaryKey("PK_RobotModels", x => x.Id);
10183
});
10284

103-
migrationBuilder.CreateTable(
104-
name: "RobotPoseTimeseries",
105-
columns: table => new
106-
{
107-
PositionX = table.Column<float>(type: "real", nullable: false),
108-
PositionY = table.Column<float>(type: "real", nullable: false),
109-
PositionZ = table.Column<float>(type: "real", nullable: false),
110-
OrientationX = table.Column<float>(type: "real", nullable: false),
111-
OrientationY = table.Column<float>(type: "real", nullable: false),
112-
OrientationZ = table.Column<float>(type: "real", nullable: false),
113-
OrientationW = table.Column<float>(type: "real", nullable: false),
114-
Time = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
115-
RobotId = table.Column<string>(type: "text", nullable: false),
116-
MissionId = table.Column<string>(type: "text", nullable: true)
117-
},
118-
constraints: table =>
119-
{
120-
});
121-
122-
migrationBuilder.CreateTable(
123-
name: "RobotPressureTimeseries",
124-
columns: table => new
125-
{
126-
Pressure = table.Column<float>(type: "real", nullable: false),
127-
Time = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
128-
RobotId = table.Column<string>(type: "text", nullable: false),
129-
MissionId = table.Column<string>(type: "text", nullable: true)
130-
},
131-
constraints: table =>
132-
{
133-
});
134-
13585
migrationBuilder.CreateTable(
13686
name: "Sources",
13787
columns: table => new

backend/api/Migrations/FlotillaDbContextModelSnapshot.cs

Lines changed: 0 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -521,24 +521,6 @@ protected override void BuildModel(ModelBuilder modelBuilder)
521521
b.ToTable("Robots");
522522
});
523523

524-
modelBuilder.Entity("Api.Database.Models.RobotBatteryTimeseries", b =>
525-
{
526-
b.Property<float>("BatteryLevel")
527-
.HasColumnType("real");
528-
529-
b.Property<string>("MissionId")
530-
.HasColumnType("text");
531-
532-
b.Property<string>("RobotId")
533-
.IsRequired()
534-
.HasColumnType("text");
535-
536-
b.Property<DateTime>("Time")
537-
.HasColumnType("timestamp with time zone");
538-
539-
b.ToTable("RobotBatteryTimeseries");
540-
});
541-
542524
modelBuilder.Entity("Api.Database.Models.RobotModel", b =>
543525
{
544526
b.Property<string>("Id")
@@ -572,60 +554,6 @@ protected override void BuildModel(ModelBuilder modelBuilder)
572554
b.ToTable("RobotModels");
573555
});
574556

575-
modelBuilder.Entity("Api.Database.Models.RobotPoseTimeseries", b =>
576-
{
577-
b.Property<string>("MissionId")
578-
.HasColumnType("text");
579-
580-
b.Property<float>("OrientationW")
581-
.HasColumnType("real");
582-
583-
b.Property<float>("OrientationX")
584-
.HasColumnType("real");
585-
586-
b.Property<float>("OrientationY")
587-
.HasColumnType("real");
588-
589-
b.Property<float>("OrientationZ")
590-
.HasColumnType("real");
591-
592-
b.Property<float>("PositionX")
593-
.HasColumnType("real");
594-
595-
b.Property<float>("PositionY")
596-
.HasColumnType("real");
597-
598-
b.Property<float>("PositionZ")
599-
.HasColumnType("real");
600-
601-
b.Property<string>("RobotId")
602-
.IsRequired()
603-
.HasColumnType("text");
604-
605-
b.Property<DateTime>("Time")
606-
.HasColumnType("timestamp with time zone");
607-
608-
b.ToTable("RobotPoseTimeseries");
609-
});
610-
611-
modelBuilder.Entity("Api.Database.Models.RobotPressureTimeseries", b =>
612-
{
613-
b.Property<string>("MissionId")
614-
.HasColumnType("text");
615-
616-
b.Property<float>("Pressure")
617-
.HasColumnType("real");
618-
619-
b.Property<string>("RobotId")
620-
.IsRequired()
621-
.HasColumnType("text");
622-
623-
b.Property<DateTime>("Time")
624-
.HasColumnType("timestamp with time zone");
625-
626-
b.ToTable("RobotPressureTimeseries");
627-
});
628-
629557
modelBuilder.Entity("Api.Database.Models.Source", b =>
630558
{
631559
b.Property<string>("Id")

backend/api/Program.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,6 @@
9898
.Configuration.GetSection("Database")
9999
.GetValue<bool>("UseInMemoryDatabase");
100100

101-
if (useInMemoryDatabase)
102-
builder.Services.AddScoped<ITimeseriesService, TimeseriesServiceSqlLite>();
103-
else
104-
builder.Services.AddScoped<ITimeseriesService, TimeseriesService>();
105101
builder.Services.AddScoped<RobotController>();
106102
builder.Services.AddScoped<EmergencyActionController>();
107103
builder.Services.AddScoped<InspectionFindingService>();

0 commit comments

Comments
 (0)