Files
Heimdall/src/Heimdall.Infrastructure/Migrations/AppDbContextModelSnapshot.cs
T

2306 lines
84 KiB
C#
Raw Normal View History

// <auto-generated />
using System;
using Heimdall.Infrastructure.Data;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
namespace Heimdall.Infrastructure.Migrations
{
[DbContext(typeof(AppDbContext))]
partial class AppDbContextModelSnapshot : ModelSnapshot
{
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "10.0.11")
.HasAnnotation("Relational:MaxIdentifierLength", 63);
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
modelBuilder.Entity("Heimdall.Domain.Entities.Agent", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<string>("ApiKeyHash")
.HasMaxLength(128)
.IsUnicode(false)
.HasColumnType("character varying(128)");
b.Property<string>("ApiKeyPrefix")
.HasMaxLength(8)
.IsUnicode(false)
.HasColumnType("character varying(8)");
b.Property<string>("Arch")
.HasColumnType("text");
b.Property<long?>("ContainerCpuLimit")
.HasColumnType("bigint");
b.Property<string>("ContainerId")
.HasColumnType("text");
b.Property<string>("ContainerImage")
.HasColumnType("text");
b.Property<long?>("ContainerMemoryLimitBytes")
.HasColumnType("bigint");
b.Property<string>("CpuArchitecture")
.HasColumnType("text");
b.Property<long?>("CpuCacheBytes")
.HasColumnType("bigint");
b.Property<int>("CpuCores")
.HasColumnType("integer");
b.Property<string>("CpuFlags")
.HasColumnType("text");
b.Property<double?>("CpuFrequencyMhz")
.HasColumnType("double precision");
b.Property<string>("CpuModel")
.HasColumnType("text");
b.Property<double?>("CpuUsagePercent")
.HasColumnType("double precision");
b.Property<string>("CpuVendor")
.HasColumnType("text");
b.Property<DateTime>("CreatedAt")
.ValueGeneratedOnAdd()
.HasColumnType("timestamp with time zone")
.HasDefaultValueSql("NOW()");
b.Property<DateTime?>("DeletedAt")
.HasColumnType("timestamp with time zone");
b.Property<string>("DiskInventoryJson")
.HasColumnType("text");
b.Property<double?>("DiskUsagePercent")
.HasColumnType("double precision");
b.Property<string>("GpuInventoryJson")
.HasColumnType("text");
b.Property<double?>("GpuLoadPercent")
.HasColumnType("double precision");
b.Property<string>("GpuName")
.HasMaxLength(200)
.IsUnicode(false)
.HasColumnType("character varying(200)");
b.Property<string>("GpuType")
.IsRequired()
.HasMaxLength(20)
.IsUnicode(false)
.HasColumnType("character varying(20)");
b.Property<bool>("HasGpu")
.HasColumnType("boolean");
b.Property<string>("Hostname")
.IsRequired()
.HasMaxLength(255)
.IsUnicode(false)
.HasColumnType("character varying(255)");
b.Property<bool>("IsDeleted")
.HasColumnType("boolean");
b.Property<string>("KernelVersion")
.HasColumnType("text");
b.Property<DateTime?>("LastHeartbeat")
.HasColumnType("timestamp with time zone");
b.Property<int?>("LogicalCores")
.HasColumnType("integer");
b.Property<long?>("MemAvailableBytes")
.HasColumnType("bigint");
b.Property<long?>("MemTotalBytes")
.HasColumnType("bigint");
b.Property<long>("MemoryMb")
.HasColumnType("bigint");
b.Property<long?>("MemoryUsageBytes")
.HasColumnType("bigint");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(200)
.IsUnicode(false)
.HasColumnType("character varying(200)");
b.Property<string>("NetworkInterfacesJson")
.HasColumnType("text");
b.Property<string>("OsName")
.HasColumnType("text");
b.Property<int?>("PhysicalCores")
.HasColumnType("integer");
b.Property<string>("PublicIp")
.HasMaxLength(45)
.IsUnicode(false)
.HasColumnType("character varying(45)");
b.Property<Guid>("SiteId")
.HasColumnType("uuid");
b.Property<string>("Status")
.IsRequired()
.HasMaxLength(20)
.IsUnicode(false)
.HasColumnType("character varying(20)");
b.Property<long?>("SwapFreeBytes")
.HasColumnType("bigint");
b.Property<long?>("SwapTotalBytes")
.HasColumnType("bigint");
b.Property<string>("TemperatureJson")
.HasColumnType("text");
b.Property<int?>("ThreadsPerCore")
.HasColumnType("integer");
b.Property<DateTime>("UpdatedAt")
.ValueGeneratedOnAdd()
.HasColumnType("timestamp with time zone")
.HasDefaultValueSql("NOW()");
b.Property<long?>("UptimeMachineSeconds")
.HasColumnType("bigint");
b.Property<long?>("UptimeSeconds")
.HasColumnType("bigint");
b.Property<string>("Version")
.IsRequired()
.HasMaxLength(50)
.IsUnicode(false)
.HasColumnType("character varying(50)");
b.Property<long?>("VramMb")
.HasColumnType("bigint");
b.Property<long?>("VramUsageBytes")
.HasColumnType("bigint");
b.HasKey("Id");
b.HasIndex("LastHeartbeat")
.HasFilter("\"Status\" = 'Online'");
b.HasIndex("SiteId");
b.ToTable("agents", (string)null);
});
modelBuilder.Entity("Heimdall.Domain.Entities.AgentLogEntry", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<Guid>("AgentId")
.HasColumnType("uuid");
b.Property<string>("Exception")
.HasMaxLength(4000)
.HasColumnType("character varying(4000)");
b.Property<string>("Level")
.IsRequired()
.HasMaxLength(20)
.IsUnicode(false)
.HasColumnType("character varying(20)");
b.Property<string>("Message")
.IsRequired()
.HasMaxLength(2000)
.HasColumnType("character varying(2000)");
b.Property<string>("Source")
.HasMaxLength(200)
.IsUnicode(false)
.HasColumnType("character varying(200)");
b.Property<DateTime>("TimestampUtc")
.HasColumnType("timestamp with time zone");
b.HasKey("Id");
b.HasIndex("AgentId", "TimestampUtc");
b.ToTable("agent_log_entries", (string)null);
});
modelBuilder.Entity("Heimdall.Domain.Entities.AgentSetting", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<Guid>("AgentId")
.HasColumnType("uuid")
.HasColumnName("agent_id");
b.Property<DateTime>("CreatedAt")
.HasColumnType("timestamp with time zone")
.HasColumnName("created_at");
b.Property<string>("Key")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("character varying(200)")
.HasColumnName("key");
b.Property<DateTime>("UpdatedAt")
.HasColumnType("timestamp with time zone")
.HasColumnName("updated_at");
b.Property<string>("Value")
.IsRequired()
.HasColumnType("text")
.HasColumnName("value");
b.HasKey("Id");
b.HasIndex("AgentId", "Key")
.IsUnique();
b.ToTable("agent_settings", (string)null);
});
modelBuilder.Entity("Heimdall.Domain.Entities.ApiKey", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<DateTime>("CreatedAt")
.ValueGeneratedOnAdd()
.HasColumnType("timestamp with time zone")
.HasDefaultValueSql("NOW()");
b.Property<Guid?>("CreatedByUserId")
.HasColumnType("uuid");
b.Property<bool>("Enabled")
.HasColumnType("boolean");
b.Property<DateTime?>("ExpiresAt")
.HasColumnType("timestamp with time zone");
b.Property<string>("KeyHash")
.IsRequired()
.HasMaxLength(128)
.IsUnicode(false)
.HasColumnType("character varying(128)");
b.Property<string>("KeyPrefix")
.IsRequired()
.HasMaxLength(8)
.IsUnicode(false)
.HasColumnType("character varying(8)");
b.Property<DateTime?>("LastUsedAt")
.HasColumnType("timestamp with time zone");
b.Property<Guid?>("SiteId")
.HasColumnType("uuid");
b.HasKey("Id");
b.HasIndex("KeyHash");
b.HasIndex("KeyPrefix");
b.HasIndex("SiteId");
b.ToTable("api_keys", (string)null);
});
modelBuilder.Entity("Heimdall.Domain.Entities.AppRole", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnType("text");
b.Property<string>("Name")
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.Property<string>("NormalizedName")
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.HasKey("Id");
b.HasIndex("NormalizedName")
.IsUnique()
.HasDatabaseName("RoleNameIndex");
b.ToTable("roles", (string)null);
});
modelBuilder.Entity("Heimdall.Domain.Entities.AppSetting", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<bool>("AgentScoped")
.HasColumnType("boolean");
b.Property<string>("AllowedValues")
.HasMaxLength(2000)
.HasColumnType("character varying(2000)")
.HasColumnName("allowed_values");
b.Property<string>("Category")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("character varying(100)")
.HasColumnName("category");
b.Property<DateTime>("CreatedAt")
.HasColumnType("timestamp with time zone")
.HasColumnName("created_at");
b.Property<string>("Description")
.HasMaxLength(500)
.HasColumnType("character varying(500)")
.HasColumnName("description");
b.Property<string>("Key")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("character varying(200)")
.HasColumnName("key");
b.Property<DateTime>("UpdatedAt")
.HasColumnType("timestamp with time zone")
.HasColumnName("updated_at");
b.Property<string>("Value")
.IsRequired()
.HasColumnType("text")
.HasColumnName("value");
b.Property<string>("ValueType")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("character varying(50)")
.HasColumnName("value_type");
b.HasKey("Id");
b.HasIndex("Key")
.IsUnique();
b.ToTable("app_settings", (string)null);
});
modelBuilder.Entity("Heimdall.Domain.Entities.AppUser", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<int>("AccessFailedCount")
.HasColumnType("integer");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnType("text");
b.Property<DateTime>("CreatedAt")
.ValueGeneratedOnAdd()
.HasColumnType("timestamp with time zone")
.HasDefaultValueSql("NOW()");
b.Property<string>("DisplayName")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("character varying(200)");
b.Property<string>("Email")
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.Property<bool>("EmailConfirmed")
.HasColumnType("boolean");
b.Property<string>("Language")
.IsRequired()
.ValueGeneratedOnAdd()
.HasMaxLength(10)
.IsUnicode(false)
.HasColumnType("character varying(10)")
.HasDefaultValue("fr");
b.Property<bool>("LockoutEnabled")
.HasColumnType("boolean");
b.Property<DateTimeOffset?>("LockoutEnd")
.HasColumnType("timestamp with time zone");
b.Property<bool>("MustChangePassword")
.ValueGeneratedOnAdd()
.HasColumnType("boolean")
.HasDefaultValue(false);
b.Property<string>("NormalizedEmail")
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.Property<string>("NormalizedUserName")
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.Property<string>("PasswordHash")
.HasColumnType("text");
b.Property<string>("PhoneNumber")
.HasColumnType("text");
b.Property<bool>("PhoneNumberConfirmed")
.HasColumnType("boolean");
b.Property<string>("SecurityStamp")
.HasColumnType("text");
b.Property<string>("Theme")
.ValueGeneratedOnAdd()
.HasMaxLength(20)
.IsUnicode(false)
.HasColumnType("character varying(20)")
.HasDefaultValue("Auto");
b.Property<bool>("TwoFactorEnabled")
.HasColumnType("boolean");
b.Property<string>("UserName")
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.HasKey("Id");
b.HasIndex("NormalizedEmail")
.HasDatabaseName("EmailIndex");
b.HasIndex("NormalizedUserName")
.IsUnique()
.HasDatabaseName("UserNameIndex");
b.ToTable("users", (string)null);
});
modelBuilder.Entity("Heimdall.Domain.Entities.AuditLog", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<string>("Action")
.IsRequired()
.HasMaxLength(100)
.IsUnicode(false)
.HasColumnType("character varying(100)");
b.Property<string>("IpAddress")
.HasMaxLength(45)
.IsUnicode(false)
.HasColumnType("character varying(45)");
b.Property<string>("NewValue")
.HasColumnType("text");
b.Property<string>("OldValue")
.HasColumnType("text");
b.Property<string>("ResourceId")
.HasMaxLength(100)
.IsUnicode(false)
.HasColumnType("character varying(100)");
b.Property<string>("ResourceType")
.IsRequired()
.HasMaxLength(100)
.IsUnicode(false)
.HasColumnType("character varying(100)");
b.Property<DateTime>("Timestamp")
.ValueGeneratedOnAdd()
.HasColumnType("timestamp with time zone")
.HasDefaultValueSql("NOW()");
b.Property<Guid?>("UserId")
.HasColumnType("uuid");
b.HasKey("Id");
b.HasIndex("Timestamp")
.IsDescending();
b.HasIndex("UserId");
b.HasIndex("ResourceType", "ResourceId", "Timestamp")
.IsDescending(false, false, true);
b.ToTable("audit_logs", (string)null);
});
modelBuilder.Entity("Heimdall.Domain.Entities.Camera", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<Guid?>("AgentId")
.HasColumnType("uuid");
b.Property<string>("Capabilities")
.IsRequired()
.HasMaxLength(64)
.IsUnicode(false)
.HasColumnType("character varying(64)");
b.Property<DateTime>("CreatedAt")
.ValueGeneratedOnAdd()
.HasColumnType("timestamp with time zone")
.HasDefaultValueSql("NOW()");
b.Property<DateTime?>("DeletedAt")
.HasColumnType("timestamp with time zone");
b.Property<string>("DetectedType")
.IsRequired()
.HasMaxLength(20)
.IsUnicode(false)
.HasColumnType("character varying(20)");
b.Property<string>("DiscoveryMethod")
.IsRequired()
.HasMaxLength(20)
.IsUnicode(false)
.HasColumnType("character varying(20)");
b.Property<bool>("HasAudio")
.HasColumnType("boolean");
b.Property<bool>("HasMotionDetection")
.HasColumnType("boolean");
b.Property<bool>("HasPtz")
.HasColumnType("boolean");
b.Property<int?>("HttpPort")
.HasColumnType("integer");
b.Property<string>("IpAddress")
.HasMaxLength(45)
.HasColumnType("character varying(45)");
b.Property<bool>("IsDeleted")
.HasColumnType("boolean");
b.Property<DateTime?>("LastDiscoveredAt")
.HasColumnType("timestamp with time zone");
b.Property<DateTime?>("LastStreamTestAt")
.HasColumnType("timestamp with time zone");
b.Property<string>("LastTestedCodecs")
.HasMaxLength(200)
.IsUnicode(false)
.HasColumnType("character varying(200)");
b.Property<int?>("LastTestedHeight")
.HasColumnType("integer");
b.Property<long?>("LastTestedLatencyMs")
.HasColumnType("bigint");
b.Property<int?>("LastTestedWidth")
.HasColumnType("integer");
b.Property<string>("MacAddress")
.HasMaxLength(17)
.HasColumnType("character varying(17)");
b.Property<string>("Manufacturer")
.HasMaxLength(100)
.HasColumnType("character varying(100)");
b.Property<string>("Model")
.HasMaxLength(100)
.HasColumnType("character varying(100)");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(200)
.IsUnicode(false)
.HasColumnType("character varying(200)");
b.Property<int?>("OnvifPort")
.HasColumnType("integer");
b.Property<int?>("RtspPort")
.HasColumnType("integer");
b.Property<string>("RtspUrl")
.HasMaxLength(1000)
.IsUnicode(false)
.HasColumnType("character varying(1000)");
b.Property<Guid>("SiteId")
.HasColumnType("uuid");
b.Property<string>("Status")
.IsRequired()
.HasMaxLength(20)
.IsUnicode(false)
.HasColumnType("character varying(20)");
b.Property<Guid?>("StoragePolicyId")
.HasColumnType("uuid");
b.Property<string>("SubRtspUrl")
.HasMaxLength(1000)
.IsUnicode(false)
.HasColumnType("character varying(1000)");
b.Property<DateTime>("UpdatedAt")
.ValueGeneratedOnAdd()
.HasColumnType("timestamp with time zone")
.HasDefaultValueSql("NOW()");
b.HasKey("Id");
b.HasIndex("AgentId");
b.HasIndex("IpAddress");
b.HasIndex("MacAddress");
b.HasIndex("SiteId");
b.HasIndex("StoragePolicyId");
b.ToTable("cameras", (string)null);
});
modelBuilder.Entity("Heimdall.Domain.Entities.CameraAssignment", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<Guid>("AgentId")
.HasColumnType("uuid");
b.Property<DateTime>("AssignedAt")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("CameraId")
.HasColumnType("uuid");
b.Property<string>("Reason")
.IsRequired()
.HasMaxLength(50)
.IsUnicode(false)
.HasColumnType("character varying(50)");
b.Property<DateTime?>("ReleasedAt")
.HasColumnType("timestamp with time zone");
b.HasKey("Id");
b.HasIndex("AssignedAt");
b.HasIndex("AgentId", "ReleasedAt")
.HasFilter("\"ReleasedAt\" IS NULL");
b.HasIndex("CameraId", "ReleasedAt")
.IsUnique()
.HasFilter("\"ReleasedAt\" IS NULL");
b.ToTable("camera_assignments", (string)null);
});
modelBuilder.Entity("Heimdall.Domain.Entities.CameraCredentials", b =>
{
b.Property<Guid>("CameraId")
.HasColumnType("uuid");
b.Property<DateTime>("CreatedAt")
.ValueGeneratedOnAdd()
.HasColumnType("timestamp with time zone")
.HasDefaultValueSql("NOW()");
b.Property<string>("OnvifPassword")
.IsRequired()
.HasMaxLength(500)
.IsUnicode(false)
.HasColumnType("character varying(500)");
b.Property<string>("OnvifUsername")
.IsRequired()
.ValueGeneratedOnAdd()
.HasMaxLength(100)
.IsUnicode(false)
.HasColumnType("character varying(100)")
.HasDefaultValue("admin");
b.Property<string>("RtspPassword")
.IsRequired()
.HasMaxLength(500)
.IsUnicode(false)
.HasColumnType("character varying(500)");
b.Property<string>("RtspUsername")
.IsRequired()
.HasMaxLength(100)
.IsUnicode(false)
.HasColumnType("character varying(100)");
b.Property<DateTime>("UpdatedAt")
.ValueGeneratedOnAdd()
.HasColumnType("timestamp with time zone")
.HasDefaultValueSql("NOW()");
b.HasKey("CameraId");
b.ToTable("camera_credentials", (string)null);
});
modelBuilder.Entity("Heimdall.Domain.Entities.CameraDetectionProfile", b =>
{
b.Property<Guid>("CameraId")
.HasColumnType("uuid");
b.Property<int>("ActiveIntervalMs")
.HasColumnType("integer");
b.Property<int>("AnimalCooldownSec")
.HasColumnType("integer");
b.Property<bool>("DetectAnimal")
.HasColumnType("boolean");
b.Property<bool>("DetectMotion")
.HasColumnType("boolean");
b.Property<bool>("DetectPackage")
.HasColumnType("boolean");
b.Property<bool>("DetectPerson")
.HasColumnType("boolean");
b.Property<bool>("DetectVehicle")
.HasColumnType("boolean");
b.Property<bool>("FaceRecognition")
.HasColumnType("boolean");
b.Property<int>("IdleIntervalMs")
.HasColumnType("integer");
b.Property<double>("IoUThreshold")
.HasColumnType("double precision");
b.Property<bool>("LicensePlateRecognition")
.HasColumnType("boolean");
b.Property<int>("MaxEventsPerMinute")
.HasColumnType("integer");
b.Property<double>("MinConfidence")
.ValueGeneratedOnAdd()
.HasColumnType("double precision")
.HasDefaultValue(0.40000000000000002);
b.Property<int>("MotionIntervalMs")
.HasColumnType("integer");
b.Property<double>("MotionThreshold")
.HasColumnType("double precision");
b.Property<int>("PersonCooldownSec")
.HasColumnType("integer");
b.Property<bool>("RequireMotionForAI")
.HasColumnType("boolean");
b.Property<int>("VehicleCooldownSec")
.HasColumnType("integer");
b.Property<string>("YoloModel")
.IsRequired()
.ValueGeneratedOnAdd()
.HasMaxLength(50)
.IsUnicode(false)
.HasColumnType("character varying(50)")
.HasDefaultValue("yolov8n");
b.HasKey("CameraId");
b.ToTable("camera_detection_profiles", (string)null);
});
modelBuilder.Entity("Heimdall.Domain.Entities.CameraDiscoveryResult", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<string>("DetectedType")
.IsRequired()
.HasMaxLength(20)
.IsUnicode(false)
.HasColumnType("character varying(20)");
b.Property<string>("DiscoveryMethod")
.IsRequired()
.HasMaxLength(20)
.IsUnicode(false)
.HasColumnType("character varying(20)");
b.Property<string>("HomeKitDeviceId")
.HasMaxLength(50)
.IsUnicode(false)
.HasColumnType("character varying(50)");
b.Property<string>("HomeKitModel")
.HasMaxLength(200)
.IsUnicode(false)
.HasColumnType("character varying(200)");
b.Property<string>("HomeKitName")
.HasMaxLength(200)
.IsUnicode(false)
.HasColumnType("character varying(200)");
b.Property<string>("Hostname")
.HasMaxLength(255)
.IsUnicode(false)
.HasColumnType("character varying(255)");
b.Property<int?>("HttpPort")
.HasColumnType("integer");
b.Property<string>("HttpServerHeader")
.HasMaxLength(200)
.IsUnicode(false)
.HasColumnType("character varying(200)");
b.Property<int?>("HttpStatusCode")
.HasColumnType("integer");
b.Property<string>("IpAddress")
.IsRequired()
.HasMaxLength(45)
.IsUnicode(false)
.HasColumnType("character varying(45)");
b.Property<bool?>("IsHomeKitCamera")
.HasColumnType("boolean");
b.Property<bool>("IsProcessed")
.HasColumnType("boolean");
b.Property<bool>("IsReachable")
.HasColumnType("boolean");
b.Property<string>("MacAddress")
.HasMaxLength(17)
.IsUnicode(false)
.HasColumnType("character varying(17)");
b.Property<string>("OnvifDeviceServiceUrl")
.HasMaxLength(500)
.IsUnicode(false)
.HasColumnType("character varying(500)");
b.Property<string>("OnvifHardware")
.HasMaxLength(200)
.IsUnicode(false)
.HasColumnType("character varying(200)");
b.Property<string>("OnvifName")
.HasMaxLength(200)
.IsUnicode(false)
.HasColumnType("character varying(200)");
b.Property<int?>("OnvifPort")
.HasColumnType("integer");
b.PrimitiveCollection<int[]>("OpenPorts")
.IsRequired()
.IsUnicode(false)
.HasColumnType("integer[]");
b.Property<DateTime>("ProbedAt")
.ValueGeneratedOnAdd()
.HasColumnType("timestamp with time zone")
.HasDefaultValueSql("NOW()");
b.Property<Guid>("SiteId")
.HasColumnType("uuid");
b.Property<string>("Vendor")
.HasMaxLength(100)
.IsUnicode(false)
.HasColumnType("character varying(100)");
b.HasKey("Id");
b.HasIndex("IpAddress");
b.HasIndex("IsProcessed");
b.HasIndex("SiteId");
b.ToTable("camera_discovery_results", (string)null);
});
modelBuilder.Entity("Heimdall.Domain.Entities.CameraEvent", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<Guid?>("AgentId")
.HasColumnType("uuid");
b.Property<Guid>("CameraId")
.HasColumnType("uuid");
b.Property<double>("Confidence")
.ValueGeneratedOnAdd()
.HasColumnType("double precision")
.HasDefaultValue(0.0);
b.Property<DateTime>("CreatedAt")
.ValueGeneratedOnAdd()
.HasColumnType("timestamp with time zone")
.HasDefaultValueSql("NOW()");
b.Property<string>("DetectionHash")
.HasMaxLength(128)
.IsUnicode(false)
.HasColumnType("character varying(128)");
b.Property<bool>("IsSuppressed")
.ValueGeneratedOnAdd()
.HasColumnType("boolean")
.HasDefaultValue(false);
b.Property<string>("Label")
.HasMaxLength(200)
.IsUnicode(false)
.HasColumnType("character varying(200)");
b.Property<string>("MetadataJson")
.HasColumnType("jsonb");
b.Property<DateTime>("OccurredAt")
.HasColumnType("timestamp with time zone");
b.Property<Guid?>("ParentEventId")
.HasColumnType("uuid");
b.Property<Guid?>("RecordingId")
.HasColumnType("uuid");
b.Property<string>("SnapshotThumbUrl")
.HasMaxLength(2000)
.IsUnicode(false)
.HasColumnType("character varying(2000)");
b.Property<string>("SnapshotUrl")
.HasMaxLength(2000)
.IsUnicode(false)
.HasColumnType("character varying(2000)");
b.Property<string>("TrackId")
.HasMaxLength(100)
.IsUnicode(false)
.HasColumnType("character varying(100)");
b.Property<int>("Type")
.HasColumnType("integer");
b.Property<DateTime>("UpdatedAt")
.ValueGeneratedOnAdd()
.HasColumnType("timestamp with time zone")
.HasDefaultValueSql("NOW()");
b.Property<Guid?>("VehicleId")
.HasColumnType("uuid");
b.HasKey("Id");
b.HasIndex("DetectionHash");
b.HasIndex("OccurredAt");
b.HasIndex("ParentEventId");
b.HasIndex("RecordingId");
b.HasIndex("TrackId");
b.HasIndex("VehicleId");
b.HasIndex("CameraId", "OccurredAt")
.IsDescending(false, true);
b.HasIndex("CameraId", "Type");
b.ToTable("camera_events", (string)null);
});
modelBuilder.Entity("Heimdall.Domain.Entities.DiscoveredStreamUrl", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.PrimitiveCollection<string[]>("Codecs")
.IsRequired()
.IsUnicode(false)
.HasColumnType("text[]");
b.Property<Guid>("DiscoveryResultId")
.HasColumnType("uuid");
b.Property<int>("Height")
.HasColumnType("integer");
b.Property<bool>("IsAlive")
.HasColumnType("boolean");
b.Property<bool>("IsMainStream")
.HasColumnType("boolean");
b.Property<long>("LatencyMs")
.HasColumnType("bigint");
b.Property<string>("Protocol")
.IsRequired()
.HasMaxLength(20)
.IsUnicode(false)
.HasColumnType("character varying(20)");
b.Property<string>("Url")
.IsRequired()
.HasMaxLength(2000)
.IsUnicode(false)
.HasColumnType("character varying(2000)");
b.Property<int>("Width")
.HasColumnType("integer");
b.HasKey("Id");
b.HasIndex("DiscoveryResultId");
b.HasIndex("IsAlive");
b.HasIndex("IsMainStream");
b.ToTable("discovered_streams", (string)null);
});
modelBuilder.Entity("Heimdall.Domain.Entities.Group", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<DateTime>("CreatedAt")
.ValueGeneratedOnAdd()
.HasColumnType("timestamp with time zone")
.HasDefaultValueSql("NOW()");
b.Property<DateTime?>("DeletedAt")
.HasColumnType("timestamp with time zone");
b.Property<string>("Description")
.HasMaxLength(1000)
.HasColumnType("character varying(1000)");
b.Property<bool>("IsDeleted")
.HasColumnType("boolean");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("character varying(200)");
b.Property<DateTime>("UpdatedAt")
.ValueGeneratedOnAdd()
.HasColumnType("timestamp with time zone")
.HasDefaultValueSql("NOW()");
b.HasKey("Id");
b.HasIndex("IsDeleted")
.HasFilter("\"IsDeleted\" = false");
b.HasIndex("Name");
b.ToTable("groups", (string)null);
});
modelBuilder.Entity("Heimdall.Domain.Entities.KnownFace", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<string>("Embedding")
.IsRequired()
.HasColumnType("jsonb");
b.Property<Guid>("PersonId")
.HasColumnType("uuid");
b.Property<string>("SourceEventId")
.HasMaxLength(100)
.IsUnicode(false)
.HasColumnType("character varying(100)");
b.Property<string>("ThumbnailUrl")
.HasMaxLength(2000)
.IsUnicode(false)
.HasColumnType("character varying(2000)");
b.HasKey("Id");
b.HasIndex("PersonId");
b.ToTable("known_faces", (string)null);
});
modelBuilder.Entity("Heimdall.Domain.Entities.LicensePlate", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<double>("Confidence")
.ValueGeneratedOnAdd()
.HasColumnType("double precision")
.HasDefaultValue(0.0);
b.Property<DateTime>("CreatedAt")
.ValueGeneratedOnAdd()
.HasColumnType("timestamp with time zone")
.HasDefaultValueSql("NOW()");
b.Property<Guid?>("PersonId")
.HasColumnType("uuid");
b.Property<string>("PlateText")
.IsRequired()
.HasMaxLength(20)
.IsUnicode(false)
.HasColumnType("character varying(20)");
b.Property<DateTime>("UpdatedAt")
.ValueGeneratedOnAdd()
.HasColumnType("timestamp with time zone")
.HasDefaultValueSql("NOW()");
b.Property<Guid?>("VehicleId")
.HasColumnType("uuid");
b.HasKey("Id");
b.HasIndex("PersonId");
b.HasIndex("PlateText");
NpgsqlIndexBuilderExtensions.HasMethod(b.HasIndex("PlateText"), "gin");
NpgsqlIndexBuilderExtensions.HasOperators(b.HasIndex("PlateText"), new[] { "gin_trgm_ops" });
b.HasIndex("VehicleId");
b.ToTable("license_plates", (string)null);
});
modelBuilder.Entity("Heimdall.Domain.Entities.Notification", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<Guid?>("CameraId")
.HasColumnType("uuid");
b.Property<DateTime>("CreatedAt")
.ValueGeneratedOnAdd()
.HasColumnType("timestamp with time zone")
.HasDefaultValueSql("NOW()");
b.Property<string>("EventType")
.HasMaxLength(50)
.HasColumnType("character varying(50)");
b.Property<bool>("IsRead")
.HasColumnType("boolean");
b.Property<string>("Link")
.HasMaxLength(500)
.HasColumnType("character varying(500)");
b.Property<string>("Message")
.IsRequired()
.HasMaxLength(2000)
.HasColumnType("character varying(2000)");
b.Property<DateTime?>("ReadAt")
.HasColumnType("timestamp with time zone");
b.Property<Guid?>("SiteId")
.HasColumnType("uuid");
b.Property<string>("SnapshotUrl")
.HasMaxLength(500)
.HasColumnType("character varying(500)");
b.Property<string>("Title")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("character varying(200)");
b.Property<string>("Type")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("character varying(50)");
b.Property<DateTime>("UpdatedAt")
.ValueGeneratedOnAdd()
.HasColumnType("timestamp with time zone")
.HasDefaultValueSql("NOW()");
b.Property<Guid>("UserId")
.HasColumnType("uuid");
b.HasKey("Id");
b.HasIndex("CreatedAt");
b.HasIndex("UserId");
b.HasIndex("UserId", "IsRead");
b.ToTable("notifications", (string)null);
});
modelBuilder.Entity("Heimdall.Domain.Entities.NotificationTemplate", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<string>("BodyMarkdown")
.IsRequired()
.HasColumnType("text");
b.Property<string>("Channel")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("character varying(50)");
b.Property<DateTime>("CreatedAt")
.ValueGeneratedOnAdd()
.HasColumnType("timestamp with time zone")
.HasDefaultValueSql("NOW()");
b.Property<string>("EventType")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("character varying(50)");
b.Property<bool>("IsDefault")
.HasColumnType("boolean");
b.Property<string>("Language")
.IsRequired()
.ValueGeneratedOnAdd()
.HasMaxLength(10)
.HasColumnType("character varying(10)")
.HasDefaultValue("fr");
b.Property<string>("Subject")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("character varying(200)");
b.Property<DateTime>("UpdatedAt")
.ValueGeneratedOnAdd()
.HasColumnType("timestamp with time zone")
.HasDefaultValueSql("NOW()");
b.HasKey("Id");
b.HasIndex("EventType", "Channel", "Language")
.IsUnique();
b.ToTable("notification_templates", (string)null);
});
modelBuilder.Entity("Heimdall.Domain.Entities.Person", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<string>("Category")
.HasMaxLength(50)
.IsUnicode(false)
.HasColumnType("character varying(50)");
b.Property<DateTime>("CreatedAt")
.HasColumnType("timestamp with time zone");
b.Property<string>("DisplayName")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("character varying(200)");
b.Property<bool>("IsWatchlisted")
.HasColumnType("boolean");
b.Property<string>("Notes")
.HasMaxLength(2000)
.HasColumnType("character varying(2000)");
b.Property<string>("PhotoUrl")
.HasMaxLength(2000)
.IsUnicode(false)
.HasColumnType("character varying(2000)");
b.Property<DateTime>("UpdatedAt")
.HasColumnType("timestamp with time zone");
b.HasKey("Id");
b.HasIndex("Category");
b.HasIndex("DisplayName");
b.HasIndex("IsWatchlisted");
b.ToTable("persons", (string)null);
});
modelBuilder.Entity("Heimdall.Domain.Entities.Recording", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<Guid>("CameraId")
.HasColumnType("uuid");
b.Property<DateTime>("CreatedAt")
.ValueGeneratedOnAdd()
.HasColumnType("timestamp with time zone")
.HasDefaultValueSql("NOW()");
b.Property<double>("DurationSeconds")
.ValueGeneratedOnAdd()
.HasColumnType("double precision")
.HasDefaultValue(0.0);
b.Property<long>("SizeBytes")
.HasColumnType("bigint");
b.Property<string>("StoragePath")
.IsRequired()
.HasMaxLength(2000)
.IsUnicode(false)
.HasColumnType("character varying(2000)");
b.Property<Guid?>("StoragePolicyId")
.HasColumnType("uuid");
b.Property<string>("StorageProvider")
.IsRequired()
.HasMaxLength(20)
.IsUnicode(false)
.HasColumnType("character varying(20)");
b.Property<DateTime>("Timestamp")
.HasColumnType("timestamp with time zone");
b.Property<DateTime>("UpdatedAt")
.ValueGeneratedOnAdd()
.HasColumnType("timestamp with time zone")
.HasDefaultValueSql("NOW()");
b.HasKey("Id");
b.HasIndex("StoragePath")
.IsUnique();
b.HasIndex("StoragePolicyId");
b.HasIndex("CameraId", "Timestamp");
b.ToTable("recordings", (string)null);
});
modelBuilder.Entity("Heimdall.Domain.Entities.RevokedRefreshToken", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<DateTime>("ExpiresAt")
.HasColumnType("timestamp with time zone");
b.Property<DateTime>("RevokedAt")
.ValueGeneratedOnAdd()
.HasColumnType("timestamp with time zone")
.HasDefaultValueSql("NOW()");
b.Property<string>("TokenHash")
.IsRequired()
.HasMaxLength(128)
.IsUnicode(false)
.HasColumnType("character varying(128)");
b.Property<Guid>("UserId")
.HasColumnType("uuid");
b.HasKey("Id");
b.HasIndex("ExpiresAt");
b.HasIndex("TokenHash")
.IsUnique();
b.ToTable("revoked_refresh_tokens", (string)null);
});
modelBuilder.Entity("Heimdall.Domain.Entities.Site", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<string>("Address")
.HasMaxLength(500)
.HasColumnType("character varying(500)");
b.Property<DateTime>("CreatedAt")
.ValueGeneratedOnAdd()
.HasColumnType("timestamp with time zone")
.HasDefaultValueSql("NOW()");
b.Property<DateTime?>("DeletedAt")
.HasColumnType("timestamp with time zone");
b.Property<bool>("Enabled")
.HasColumnType("boolean");
b.Property<bool>("IsDeleted")
.HasColumnType("boolean");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("character varying(200)");
b.Property<string>("NtfyTopic")
.HasColumnType("text");
b.Property<string>("RegistrationTokenHash")
.HasMaxLength(128)
.IsUnicode(false)
.HasColumnType("character varying(128)");
b.Property<string>("Timezone")
.IsRequired()
.ValueGeneratedOnAdd()
.HasMaxLength(100)
.IsUnicode(false)
.HasColumnType("character varying(100)")
.HasDefaultValue("UTC");
b.Property<DateTime?>("TokenExpiresAt")
.HasColumnType("timestamp with time zone");
b.Property<DateTime>("UpdatedAt")
.ValueGeneratedOnAdd()
.HasColumnType("timestamp with time zone")
.HasDefaultValueSql("NOW()");
b.HasKey("Id");
b.HasIndex("IsDeleted")
.HasFilter("\"IsDeleted\" = false");
b.HasIndex("Name");
b.ToTable("sites", (string)null);
});
modelBuilder.Entity("Heimdall.Domain.Entities.SiteCredential", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<DateTime>("CreatedAt")
.ValueGeneratedOnAdd()
.HasColumnType("timestamp with time zone")
.HasDefaultValueSql("NOW()");
b.Property<string>("Label")
.IsRequired()
.HasMaxLength(100)
.IsUnicode(false)
.HasColumnType("character varying(100)");
b.Property<DateTime?>("LastUsedAt")
.HasColumnType("timestamp with time zone");
b.Property<string>("Password")
.IsRequired()
.HasMaxLength(2000)
.IsUnicode(false)
.HasColumnType("character varying(2000)");
b.Property<Guid>("SiteId")
.HasColumnType("uuid");
b.Property<string>("Username")
.IsRequired()
.HasMaxLength(200)
.IsUnicode(false)
.HasColumnType("character varying(200)");
b.HasKey("Id");
b.HasIndex("SiteId");
b.ToTable("site_credentials", (string)null);
});
modelBuilder.Entity("Heimdall.Domain.Entities.StoragePolicy", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<DateTime>("CreatedAt")
.ValueGeneratedOnAdd()
.HasColumnType("timestamp with time zone")
.HasDefaultValueSql("NOW()");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(100)
.IsUnicode(false)
.HasColumnType("character varying(100)");
b.Property<int>("RetentionDays")
.HasColumnType("integer");
b.Property<string>("StorageProvider")
.IsRequired()
.HasMaxLength(20)
.IsUnicode(false)
.HasColumnType("character varying(20)");
b.Property<DateTime>("UpdatedAt")
.ValueGeneratedOnAdd()
.HasColumnType("timestamp with time zone")
.HasDefaultValueSql("NOW()");
b.HasKey("Id");
b.ToTable("storage_policies", (string)null);
});
modelBuilder.Entity("Heimdall.Domain.Entities.UserGroup", b =>
{
b.Property<Guid>("UserId")
.HasColumnType("uuid");
b.Property<Guid>("GroupId")
.HasColumnType("uuid");
b.HasKey("UserId", "GroupId");
b.HasIndex("GroupId");
b.ToTable("user_groups", (string)null);
});
modelBuilder.Entity("Heimdall.Domain.Entities.UserNotificationConfig", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<DateTime>("CreatedAt")
.ValueGeneratedOnAdd()
.HasColumnType("timestamp with time zone")
.HasDefaultValueSql("NOW()");
b.Property<bool>("DailyDigest")
.HasColumnType("boolean");
b.Property<string>("EmailAddress")
.HasMaxLength(200)
.HasColumnType("character varying(200)");
b.Property<bool>("EmailEnabled")
.HasColumnType("boolean");
b.Property<string>("Language")
.IsRequired()
.ValueGeneratedOnAdd()
.HasMaxLength(10)
.HasColumnType("character varying(10)")
.HasDefaultValue("fr");
b.Property<bool>("NtfyEnabled")
.HasColumnType("boolean");
b.Property<string>("NtfyTopic")
.HasColumnType("text");
b.Property<string>("NtfyUrl")
.HasMaxLength(500)
.HasColumnType("character varying(500)");
b.Property<string>("SubscribedEventsJson")
.HasColumnType("jsonb")
.HasColumnName("subscribed_events");
b.Property<DateTime>("UpdatedAt")
.ValueGeneratedOnAdd()
.HasColumnType("timestamp with time zone")
.HasDefaultValueSql("NOW()");
b.Property<Guid>("UserId")
.HasColumnType("uuid");
b.Property<bool>("WeeklyDigest")
.HasColumnType("boolean");
b.HasKey("Id");
b.HasIndex("UserId")
.IsUnique();
b.ToTable("user_notification_configs", (string)null);
});
modelBuilder.Entity("Heimdall.Domain.Entities.UserRecoveryCode", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<string>("CodeHash")
.IsRequired()
.HasMaxLength(64)
.IsUnicode(false)
.HasColumnType("character varying(64)");
b.Property<DateTime>("CreatedAt")
.ValueGeneratedOnAdd()
.HasColumnType("timestamp with time zone")
.HasDefaultValueSql("NOW()");
b.Property<DateTime?>("UsedAt")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("UserId")
.HasColumnType("uuid");
b.HasKey("Id");
b.HasIndex("UserId");
b.HasIndex("UserId", "CodeHash")
.IsUnique();
b.ToTable("user_recovery_codes", (string)null);
});
modelBuilder.Entity("Heimdall.Domain.Entities.UserSite", b =>
{
b.Property<Guid>("UserId")
.HasColumnType("uuid");
b.Property<Guid>("SiteId")
.HasColumnType("uuid");
b.HasKey("UserId", "SiteId");
b.HasIndex("SiteId");
b.ToTable("user_sites", (string)null);
});
modelBuilder.Entity("Heimdall.Domain.Entities.Vehicle", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<string>("Color")
.HasMaxLength(50)
.IsUnicode(false)
.HasColumnType("character varying(50)");
b.Property<DateTime>("CreatedAt")
.ValueGeneratedOnAdd()
.HasColumnType("timestamp with time zone")
.HasDefaultValueSql("NOW()");
b.Property<string>("LicensePlate")
.HasMaxLength(20)
.IsUnicode(false)
.HasColumnType("character varying(20)");
b.Property<string>("Make")
.HasMaxLength(100)
.IsUnicode(false)
.HasColumnType("character varying(100)");
b.Property<string>("Model")
.HasMaxLength(100)
.IsUnicode(false)
.HasColumnType("character varying(100)");
b.Property<Guid?>("PersonId")
.HasColumnType("uuid");
b.Property<DateTime>("UpdatedAt")
.ValueGeneratedOnAdd()
.HasColumnType("timestamp with time zone")
.HasDefaultValueSql("NOW()");
b.HasKey("Id");
b.HasIndex("LicensePlate");
b.HasIndex("PersonId");
b.ToTable("vehicles", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<System.Guid>", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<string>("ClaimType")
.HasColumnType("text");
b.Property<string>("ClaimValue")
.HasColumnType("text");
b.Property<Guid>("RoleId")
.HasColumnType("uuid");
b.HasKey("Id");
b.HasIndex("RoleId");
b.ToTable("role_claims", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<System.Guid>", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<string>("ClaimType")
.HasColumnType("text");
b.Property<string>("ClaimValue")
.HasColumnType("text");
b.Property<Guid>("UserId")
.HasColumnType("uuid");
b.HasKey("Id");
b.HasIndex("UserId");
b.ToTable("user_claims", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<System.Guid>", b =>
{
b.Property<string>("LoginProvider")
.HasColumnType("text");
b.Property<string>("ProviderKey")
.HasColumnType("text");
b.Property<string>("ProviderDisplayName")
.HasColumnType("text");
b.Property<Guid>("UserId")
.HasColumnType("uuid");
b.HasKey("LoginProvider", "ProviderKey");
b.HasIndex("UserId");
b.ToTable("user_logins", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<System.Guid>", b =>
{
b.Property<Guid>("UserId")
.HasColumnType("uuid");
b.Property<Guid>("RoleId")
.HasColumnType("uuid");
b.HasKey("UserId", "RoleId");
b.HasIndex("RoleId");
b.ToTable("user_roles", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<System.Guid>", b =>
{
b.Property<Guid>("UserId")
.HasColumnType("uuid");
b.Property<string>("LoginProvider")
.HasColumnType("text");
b.Property<string>("Name")
.HasColumnType("text");
b.Property<string>("Value")
.HasColumnType("text");
b.HasKey("UserId", "LoginProvider", "Name");
b.ToTable("user_tokens", (string)null);
});
modelBuilder.Entity("Heimdall.Domain.Entities.Agent", b =>
{
b.HasOne("Heimdall.Domain.Entities.Site", "Site")
.WithMany("Agents")
.HasForeignKey("SiteId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.Navigation("Site");
});
modelBuilder.Entity("Heimdall.Domain.Entities.AgentLogEntry", b =>
{
b.HasOne("Heimdall.Domain.Entities.Agent", "Agent")
.WithMany()
.HasForeignKey("AgentId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Agent");
});
modelBuilder.Entity("Heimdall.Domain.Entities.AgentSetting", b =>
{
b.HasOne("Heimdall.Domain.Entities.Agent", "Agent")
.WithMany()
.HasForeignKey("AgentId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Agent");
});
modelBuilder.Entity("Heimdall.Domain.Entities.ApiKey", b =>
{
b.HasOne("Heimdall.Domain.Entities.Site", "Site")
.WithMany()
.HasForeignKey("SiteId")
.OnDelete(DeleteBehavior.Restrict);
b.Navigation("Site");
});
modelBuilder.Entity("Heimdall.Domain.Entities.AuditLog", b =>
{
b.HasOne("Heimdall.Domain.Entities.AppUser", "User")
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.SetNull);
b.Navigation("User");
});
modelBuilder.Entity("Heimdall.Domain.Entities.Camera", b =>
{
b.HasOne("Heimdall.Domain.Entities.Agent", "Agent")
.WithMany("Cameras")
.HasForeignKey("AgentId")
.OnDelete(DeleteBehavior.SetNull);
b.HasOne("Heimdall.Domain.Entities.Site", "Site")
.WithMany("Cameras")
.HasForeignKey("SiteId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.HasOne("Heimdall.Domain.Entities.StoragePolicy", "StoragePolicy")
.WithMany()
.HasForeignKey("StoragePolicyId")
.OnDelete(DeleteBehavior.SetNull);
b.Navigation("Agent");
b.Navigation("Site");
b.Navigation("StoragePolicy");
});
modelBuilder.Entity("Heimdall.Domain.Entities.CameraAssignment", b =>
{
b.HasOne("Heimdall.Domain.Entities.Agent", "Agent")
.WithMany()
.HasForeignKey("AgentId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.HasOne("Heimdall.Domain.Entities.Camera", "Camera")
.WithMany()
.HasForeignKey("CameraId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.Navigation("Agent");
b.Navigation("Camera");
});
modelBuilder.Entity("Heimdall.Domain.Entities.CameraCredentials", b =>
{
b.HasOne("Heimdall.Domain.Entities.Camera", "Camera")
.WithOne("Credentials")
.HasForeignKey("Heimdall.Domain.Entities.CameraCredentials", "CameraId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Camera");
});
modelBuilder.Entity("Heimdall.Domain.Entities.CameraDetectionProfile", b =>
{
b.HasOne("Heimdall.Domain.Entities.Camera", "Camera")
.WithOne("DetectionProfile")
.HasForeignKey("Heimdall.Domain.Entities.CameraDetectionProfile", "CameraId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Camera");
});
modelBuilder.Entity("Heimdall.Domain.Entities.CameraDiscoveryResult", b =>
{
b.HasOne("Heimdall.Domain.Entities.Site", "Site")
.WithMany()
.HasForeignKey("SiteId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Site");
});
modelBuilder.Entity("Heimdall.Domain.Entities.CameraEvent", b =>
{
b.HasOne("Heimdall.Domain.Entities.Camera", "Camera")
.WithMany()
.HasForeignKey("CameraId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Heimdall.Domain.Entities.CameraEvent", "ParentEvent")
.WithMany()
.HasForeignKey("ParentEventId")
.OnDelete(DeleteBehavior.SetNull);
b.HasOne("Heimdall.Domain.Entities.Recording", "Recording")
.WithMany()
.HasForeignKey("RecordingId")
.OnDelete(DeleteBehavior.SetNull);
b.HasOne("Heimdall.Domain.Entities.Vehicle", "Vehicle")
.WithMany()
.HasForeignKey("VehicleId")
.OnDelete(DeleteBehavior.SetNull);
b.Navigation("Camera");
b.Navigation("ParentEvent");
b.Navigation("Recording");
b.Navigation("Vehicle");
});
modelBuilder.Entity("Heimdall.Domain.Entities.DiscoveredStreamUrl", b =>
{
b.HasOne("Heimdall.Domain.Entities.CameraDiscoveryResult", "DiscoveryResult")
.WithMany("DiscoveredStreams")
.HasForeignKey("DiscoveryResultId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("DiscoveryResult");
});
modelBuilder.Entity("Heimdall.Domain.Entities.KnownFace", b =>
{
b.HasOne("Heimdall.Domain.Entities.Person", "Person")
.WithMany("Faces")
.HasForeignKey("PersonId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Person");
});
modelBuilder.Entity("Heimdall.Domain.Entities.LicensePlate", b =>
{
b.HasOne("Heimdall.Domain.Entities.Person", "Person")
.WithMany()
.HasForeignKey("PersonId")
.OnDelete(DeleteBehavior.SetNull);
b.HasOne("Heimdall.Domain.Entities.Vehicle", "Vehicle")
.WithMany()
.HasForeignKey("VehicleId")
.OnDelete(DeleteBehavior.SetNull);
b.Navigation("Person");
b.Navigation("Vehicle");
});
modelBuilder.Entity("Heimdall.Domain.Entities.Recording", b =>
{
b.HasOne("Heimdall.Domain.Entities.Camera", "Camera")
.WithMany()
.HasForeignKey("CameraId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Heimdall.Domain.Entities.StoragePolicy", "StoragePolicy")
.WithMany()
.HasForeignKey("StoragePolicyId")
.OnDelete(DeleteBehavior.SetNull);
b.Navigation("Camera");
b.Navigation("StoragePolicy");
});
modelBuilder.Entity("Heimdall.Domain.Entities.SiteCredential", b =>
{
b.HasOne("Heimdall.Domain.Entities.Site", "Site")
.WithMany("Credentials")
.HasForeignKey("SiteId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Site");
});
modelBuilder.Entity("Heimdall.Domain.Entities.UserGroup", b =>
{
b.HasOne("Heimdall.Domain.Entities.Group", "Group")
.WithMany("UserGroups")
.HasForeignKey("GroupId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Heimdall.Domain.Entities.AppUser", "User")
.WithMany("UserGroups")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Group");
b.Navigation("User");
});
modelBuilder.Entity("Heimdall.Domain.Entities.UserSite", b =>
{
b.HasOne("Heimdall.Domain.Entities.Site", "Site")
.WithMany()
.HasForeignKey("SiteId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.HasOne("Heimdall.Domain.Entities.AppUser", "User")
.WithMany("UserSites")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Site");
b.Navigation("User");
});
modelBuilder.Entity("Heimdall.Domain.Entities.Vehicle", b =>
{
b.HasOne("Heimdall.Domain.Entities.Person", "Person")
.WithMany()
.HasForeignKey("PersonId")
.OnDelete(DeleteBehavior.SetNull);
b.Navigation("Person");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<System.Guid>", b =>
{
b.HasOne("Heimdall.Domain.Entities.AppRole", null)
.WithMany()
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<System.Guid>", b =>
{
b.HasOne("Heimdall.Domain.Entities.AppUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<System.Guid>", b =>
{
b.HasOne("Heimdall.Domain.Entities.AppUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<System.Guid>", b =>
{
b.HasOne("Heimdall.Domain.Entities.AppRole", null)
.WithMany()
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Heimdall.Domain.Entities.AppUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<System.Guid>", b =>
{
b.HasOne("Heimdall.Domain.Entities.AppUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Heimdall.Domain.Entities.Agent", b =>
{
b.Navigation("Cameras");
});
modelBuilder.Entity("Heimdall.Domain.Entities.AppUser", b =>
{
b.Navigation("UserGroups");
b.Navigation("UserSites");
});
modelBuilder.Entity("Heimdall.Domain.Entities.Camera", b =>
{
b.Navigation("Credentials");
b.Navigation("DetectionProfile");
});
modelBuilder.Entity("Heimdall.Domain.Entities.CameraDiscoveryResult", b =>
{
b.Navigation("DiscoveredStreams");
});
modelBuilder.Entity("Heimdall.Domain.Entities.Group", b =>
{
b.Navigation("UserGroups");
});
modelBuilder.Entity("Heimdall.Domain.Entities.Person", b =>
{
b.Navigation("Faces");
});
modelBuilder.Entity("Heimdall.Domain.Entities.Site", b =>
{
b.Navigation("Agents");
b.Navigation("Cameras");
b.Navigation("Credentials");
});
#pragma warning restore 612, 618
}
}
}