Fix the sql schema #6

Merged
Wesser merged 9 commits from refactor/domain into release/v1.0.0 2024-01-26 07:48:14 +03:00
Showing only changes of commit 194dd1b729 - Show all commits

View File

@ -13,13 +13,13 @@ public class GroupConfiguration : IEntityTypeConfiguration<Group>
builder.HasIndex(g => g.Id).IsUnique(); builder.HasIndex(g => g.Id).IsUnique();
builder.Property(g => g.Id).HasColumnType("INTEGER").IsRequired().ValueGeneratedOnAdd(); 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.Property(g => g.Name).HasColumnType("TEXT").IsRequired().HasMaxLength(64);
builder builder
.HasOne(g => g.Faculty) .HasOne(g => g.Faculty)
.WithMany(u => u.Groups) .WithMany(u => u.Groups)
.HasForeignKey(d => d.FacultyId) .HasForeignKey(d => d.FacultyId)
.OnDelete(DeleteBehavior.Restrict); .OnDelete(DeleteBehavior.SetNull);
} }
} }