diff --git a/Persistence/EntityTypeConfigurations/Schedule/GroupConfiguration.cs b/Persistence/EntityTypeConfigurations/Schedule/GroupConfiguration.cs index 0035390..5938bb3 100644 --- a/Persistence/EntityTypeConfigurations/Schedule/GroupConfiguration.cs +++ b/Persistence/EntityTypeConfigurations/Schedule/GroupConfiguration.cs @@ -13,13 +13,13 @@ public class GroupConfiguration : IEntityTypeConfiguration builder.HasIndex(g => g.Id).IsUnique(); builder.Property(g => g.Id).HasColumnType("INTEGER").IsRequired().ValueGeneratedOnAdd(); - builder.Property(g => g.FacultyId).HasColumnType("INTEGER").IsRequired(); + builder.Property(g => g.FacultyId).HasColumnType("INTEGER"); builder.Property(g => g.Name).HasColumnType("TEXT").IsRequired().HasMaxLength(64); builder .HasOne(g => g.Faculty) .WithMany(u => u.Groups) .HasForeignKey(d => d.FacultyId) - .OnDelete(DeleteBehavior.Restrict); + .OnDelete(DeleteBehavior.SetNull); } } \ No newline at end of file