Adding group profile to the group model
This commit is contained in:
@@ -74,6 +74,11 @@ public class LightlessDbContext : DbContext
|
||||
mb.Entity<Group>()
|
||||
.Property(g => g.CreatedDate)
|
||||
.HasDefaultValueSql("CURRENT_TIMESTAMP");
|
||||
mb.Entity<Group>()
|
||||
.HasOne(g => g.Profile)
|
||||
.WithOne(p => p.Group)
|
||||
.HasForeignKey<GroupProfile>(p => p.GroupGID)
|
||||
.IsRequired(false);
|
||||
mb.Entity<GroupPair>().ToTable("group_pairs");
|
||||
mb.Entity<GroupPair>().HasKey(u => new { u.GroupGID, u.GroupUserUID });
|
||||
mb.Entity<GroupPair>().HasIndex(c => c.GroupUserUID);
|
||||
@@ -85,11 +90,6 @@ public class LightlessDbContext : DbContext
|
||||
mb.Entity<GroupProfile>().ToTable("group_profiles");
|
||||
mb.Entity<GroupProfile>().HasKey(u => u.GroupGID);
|
||||
mb.Entity<GroupProfile>().HasIndex(c => c.GroupGID);
|
||||
mb.Entity<GroupProfile>()
|
||||
.HasOne(gp => gp.Group)
|
||||
.WithMany()
|
||||
.HasForeignKey(gp => gp.GroupGID)
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
mb.Entity<GroupTempInvite>().ToTable("group_temp_invites");
|
||||
mb.Entity<GroupTempInvite>().HasKey(u => new { u.GroupGID, u.Invite });
|
||||
mb.Entity<GroupTempInvite>().HasIndex(c => c.GroupGID);
|
||||
|
||||
Reference in New Issue
Block a user