Fix the sql schema #6
@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user