add chat and users

This commit is contained in:
2026-09-10 19:09:36 +03:30
parent 91ad61bdee
commit 8eb465c0e7
40 changed files with 4888 additions and 148 deletions

View File

@@ -167,6 +167,10 @@ public sealed class GreenHomeDbContext : DbContext
b.ToTable("DeviceUsers");
b.HasKey(x => new { x.DeviceId, x.UserId });
b.Property(x => x.ReceiveAlerts).IsRequired().HasDefaultValue(true);
b.Property(x => x.Role).IsRequired().HasConversion<int>();
b.Property(x => x.Name).IsRequired().HasMaxLength(100);
b.Property(x => x.Family).IsRequired().HasMaxLength(100);
b.Property(x => x.AvatarPath).HasMaxLength(500);
b.HasOne(x => x.Device)
.WithMany(d => d.DeviceUsers)
.HasForeignKey(x => x.DeviceId)
@@ -383,6 +387,8 @@ public sealed class GreenHomeDbContext : DbContext
b.ToTable("DevicePosts");
b.HasKey(x => x.Id);
b.Property(x => x.Content).IsRequired().HasMaxLength(5000);
b.Property(x => x.PostType).IsRequired().HasConversion<int>();
b.Property(x => x.VoiceFilePath).HasMaxLength(500);
b.HasOne(x => x.Device)
.WithMany()
.HasForeignKey(x => x.DeviceId)