Skip to content

Commit

Permalink
Remove timeseries from postgreSQL database
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
aeshub committed Jan 21, 2025
1 parent 6da3a19 commit 28e3d31
Show file tree
Hide file tree
Showing 11 changed files with 0 additions and 776 deletions.
111 changes: 0 additions & 111 deletions backend/api/Controllers/TimeseriesController.cs

This file was deleted.

7 changes: 0 additions & 7 deletions backend/api/Database/Context/FlotillaDbContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,6 @@ public FlotillaDbContext(DbContextOptions options)
public DbSet<UserInfo> UserInfos => Set<UserInfo>();
public DbSet<TagInspectionMetadata> TagInspectionMetadata => Set<TagInspectionMetadata>();

// Timeseries:
public DbSet<RobotPressureTimeseries> RobotPressureTimeseries =>
Set<RobotPressureTimeseries>();
public DbSet<RobotBatteryTimeseries> RobotBatteryTimeseries =>
Set<RobotBatteryTimeseries>();
public DbSet<RobotPoseTimeseries> RobotPoseTimeseries => Set<RobotPoseTimeseries>();

protected override void OnModelCreating(ModelBuilder modelBuilder)
{
bool isSqlLite = Database.ProviderName == "Microsoft.EntityFrameworkCore.Sqlite";
Expand Down
12 changes: 0 additions & 12 deletions backend/api/Database/Models/RobotBatteryTimeseries.cs

This file was deleted.

45 changes: 0 additions & 45 deletions backend/api/Database/Models/RobotPoseTimeseries.cs

This file was deleted.

12 changes: 0 additions & 12 deletions backend/api/Database/Models/RobotPressureTimeseries.cs

This file was deleted.

17 changes: 0 additions & 17 deletions backend/api/Database/Models/TimeseriesBase.cs

This file was deleted.

50 changes: 0 additions & 50 deletions backend/api/Migrations/20241210093952_Reset-Structure.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,6 @@ public partial class ResetStructure : Migration
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
// MANUALLY ADDED:
// Adding timescale extension to the database
migrationBuilder.Sql("CREATE EXTENSION IF NOT EXISTS timescaledb CASCADE;");
//

migrationBuilder.CreateTable(
name: "DefaultLocalizationPoses",
columns: table => new
Expand Down Expand Up @@ -70,19 +65,6 @@ protected override void Up(MigrationBuilder migrationBuilder)
table.PrimaryKey("PK_Installations", x => x.Id);
});

migrationBuilder.CreateTable(
name: "RobotBatteryTimeseries",
columns: table => new
{
BatteryLevel = table.Column<float>(type: "real", nullable: false),
Time = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
RobotId = table.Column<string>(type: "text", nullable: false),
MissionId = table.Column<string>(type: "text", nullable: true)
},
constraints: table =>
{
});

migrationBuilder.CreateTable(
name: "RobotModels",
columns: table => new
Expand All @@ -100,38 +82,6 @@ protected override void Up(MigrationBuilder migrationBuilder)
table.PrimaryKey("PK_RobotModels", x => x.Id);
});

migrationBuilder.CreateTable(
name: "RobotPoseTimeseries",
columns: table => new
{
PositionX = table.Column<float>(type: "real", nullable: false),
PositionY = table.Column<float>(type: "real", nullable: false),
PositionZ = table.Column<float>(type: "real", nullable: false),
OrientationX = table.Column<float>(type: "real", nullable: false),
OrientationY = table.Column<float>(type: "real", nullable: false),
OrientationZ = table.Column<float>(type: "real", nullable: false),
OrientationW = table.Column<float>(type: "real", nullable: false),
Time = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
RobotId = table.Column<string>(type: "text", nullable: false),
MissionId = table.Column<string>(type: "text", nullable: true)
},
constraints: table =>
{
});

migrationBuilder.CreateTable(
name: "RobotPressureTimeseries",
columns: table => new
{
Pressure = table.Column<float>(type: "real", nullable: false),
Time = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
RobotId = table.Column<string>(type: "text", nullable: false),
MissionId = table.Column<string>(type: "text", nullable: true)
},
constraints: table =>
{
});

migrationBuilder.CreateTable(
name: "Sources",
columns: table => new
Expand Down
72 changes: 0 additions & 72 deletions backend/api/Migrations/FlotillaDbContextModelSnapshot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -521,24 +521,6 @@ protected override void BuildModel(ModelBuilder modelBuilder)
b.ToTable("Robots");
});

modelBuilder.Entity("Api.Database.Models.RobotBatteryTimeseries", b =>
{
b.Property<float>("BatteryLevel")
.HasColumnType("real");

b.Property<string>("MissionId")
.HasColumnType("text");

b.Property<string>("RobotId")
.IsRequired()
.HasColumnType("text");

b.Property<DateTime>("Time")
.HasColumnType("timestamp with time zone");

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

modelBuilder.Entity("Api.Database.Models.RobotModel", b =>
{
b.Property<string>("Id")
Expand Down Expand Up @@ -572,60 +554,6 @@ protected override void BuildModel(ModelBuilder modelBuilder)
b.ToTable("RobotModels");
});

modelBuilder.Entity("Api.Database.Models.RobotPoseTimeseries", b =>
{
b.Property<string>("MissionId")
.HasColumnType("text");

b.Property<float>("OrientationW")
.HasColumnType("real");

b.Property<float>("OrientationX")
.HasColumnType("real");

b.Property<float>("OrientationY")
.HasColumnType("real");

b.Property<float>("OrientationZ")
.HasColumnType("real");

b.Property<float>("PositionX")
.HasColumnType("real");

b.Property<float>("PositionY")
.HasColumnType("real");

b.Property<float>("PositionZ")
.HasColumnType("real");

b.Property<string>("RobotId")
.IsRequired()
.HasColumnType("text");

b.Property<DateTime>("Time")
.HasColumnType("timestamp with time zone");

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

modelBuilder.Entity("Api.Database.Models.RobotPressureTimeseries", b =>
{
b.Property<string>("MissionId")
.HasColumnType("text");

b.Property<float>("Pressure")
.HasColumnType("real");

b.Property<string>("RobotId")
.IsRequired()
.HasColumnType("text");

b.Property<DateTime>("Time")
.HasColumnType("timestamp with time zone");

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

modelBuilder.Entity("Api.Database.Models.Source", b =>
{
b.Property<string>("Id")
Expand Down
4 changes: 0 additions & 4 deletions backend/api/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,6 @@
.Configuration.GetSection("Database")
.GetValue<bool>("UseInMemoryDatabase");

if (useInMemoryDatabase)
builder.Services.AddScoped<ITimeseriesService, TimeseriesServiceSqlLite>();
else
builder.Services.AddScoped<ITimeseriesService, TimeseriesService>();
builder.Services.AddScoped<RobotController>();
builder.Services.AddScoped<EmergencyActionController>();
builder.Services.AddScoped<InspectionFindingService>();
Expand Down
Loading

0 comments on commit 28e3d31

Please sign in to comment.