using Heimdall.Domain.Entities; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata.Builders; namespace Heimdall.Infrastructure.Data.Configurations; public class CameraCredentialsConfiguration : IEntityTypeConfiguration { public void Configure(EntityTypeBuilder builder) { builder.ToTable("camera_credentials"); builder.HasKey(c => c.CameraId); builder.Property(c => c.OnvifUsername) .HasMaxLength(100) .HasDefaultValue("admin") .IsUnicode(false); builder.Property(c => c.OnvifPassword) .HasMaxLength(500) .IsRequired() .IsUnicode(false); builder.Property(c => c.RtspUsername) .HasMaxLength(100) .IsUnicode(false); builder.Property(c => c.RtspPassword) .HasMaxLength(500) .IsUnicode(false); builder.Property(c => c.CreatedAt) .HasDefaultValueSql("NOW()"); builder.Property(c => c.UpdatedAt) .HasDefaultValueSql("NOW()"); } }