Migrated portfolio to be linked to the organisation

This commit is contained in:
2026-09-05 10:57:10 +02:00
parent a218b19875
commit e274c33592
6 changed files with 2053 additions and 0 deletions
@@ -9,12 +9,19 @@ public sealed class Portfolio : IEntityTypeConfiguration<Domain.Entities.Portfol
builder.ToTable(nameof(Domain.Entities.Portfolio).Pluralize());
builder.HasKey(pk => pk.Id);
builder.Property(f => f.OrganisationId).IsRequired();
builder.Property(f => f.CreatedBy).IsRequired();
builder.Property(f => f.OwnedBy).IsRequired();
builder.Property(f => f.CreatedAt).IsRequired().HasDefaultValueSql("now()");
builder.Property(f => f.Name).IsRequired().HasMaxLength(LabelLength);
builder.Property(f => f.Description).IsRequired(false).HasMaxLength(TextLength);
builder.HasOne(f => f.Organisation)
.WithMany()
.HasForeignKey(fk => fk.OrganisationId)
.IsRequired()
.OnDelete(DeleteBehavior.Restrict);
builder.HasOne(f => f.Creator)
.WithMany()
.HasForeignKey(fk => fk.CreatedBy)