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 shoudl thus be removed. In addition,
it simplifies an upcoming implementation of postgreSQL database as part of
tests.
  • Loading branch information
aeshub committed Jan 17, 2025
1 parent 8c24d5d commit b0b9241
Show file tree
Hide file tree
Showing 13 changed files with 1,286 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
Loading

0 comments on commit b0b9241

Please sign in to comment.