Track manual snapshots and apply versioned camera config
This commit is contained in:
1 parent
f4a8f4a668
commit
8f00f69a5f
30 files changed
+645
-63
No files matched your search
@@ -50,6 +50,7 @@ public class AppDbContext : IdentityDbContext<AppUser, AppRole, Guid>, IApplicat
|
||||
|
||||
// Event entities
|
||||
public DbSet<CameraEvent> CameraEvents => Set<CameraEvent>();
|
||||
public DbSet<ManualSnapshotRequest> ManualSnapshotRequests => Set<ManualSnapshotRequest>();
|
||||
|
||||
// Notification entities
|
||||
public DbSet<Notification> Notifications => Set<Notification>();
|
||||
|
||||
@@ -44,6 +44,10 @@ public class AgentConfiguration : IEntityTypeConfiguration<Agent>
|
||||
.HasMaxLength(8)
|
||||
.IsUnicode(false);
|
||||
|
||||
builder.Property(a => a.LastAppliedCameraConfigVersion)
|
||||
.HasMaxLength(64)
|
||||
.IsUnicode(false);
|
||||
|
||||
builder.Property(a => a.GpuType)
|
||||
.HasConversion<string>()
|
||||
.HasMaxLength(20)
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
using Heimdall.Domain.Entities;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
|
||||
namespace Heimdall.Infrastructure.Data.Configurations;
|
||||
|
||||
public sealed class ManualSnapshotRequestConfiguration : IEntityTypeConfiguration<ManualSnapshotRequest>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<ManualSnapshotRequest> builder)
|
||||
{
|
||||
builder.ToTable("manual_snapshot_requests");
|
||||
builder.HasKey(x => x.Id);
|
||||
builder.Property(x => x.Status).HasConversion<string>().HasMaxLength(20).IsRequired();
|
||||
builder.Property(x => x.FailureReason).HasMaxLength(200);
|
||||
builder.Property(x => x.CreatedAt).IsRequired();
|
||||
builder.Property(x => x.UpdatedAt).IsRequired();
|
||||
builder.Property(x => x.ExpiresAt).IsRequired();
|
||||
builder.HasIndex(x => new { x.CameraId, x.CreatedAt });
|
||||
builder.HasIndex(x => x.ExpiresAt);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user