diff --git a/aspnetcore/src/DatabaseContext/ApiDbContext.cs b/aspnetcore/src/DatabaseContext/ApiDbContext.cs index 111bee8..bd49014 100644 --- a/aspnetcore/src/DatabaseContext/ApiDbContext.cs +++ b/aspnetcore/src/DatabaseContext/ApiDbContext.cs @@ -2408,6 +2408,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) .HasColumnType("datetime") .HasColumnName("created"); entity.Property(e => e.DimPublicationChannelId).HasColumnName("dim_publication_channel_id"); + entity.Property(e => e.DimPublicationId).HasColumnName("dim_publication_id"); entity.Property(e => e.DimRegisteredDataSourceId).HasColumnName("dim_registered_data_source_id"); entity.Property(e => e.Doi) .HasMaxLength(4000) @@ -2511,6 +2512,10 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("publication_channel"); + entity.HasOne(d => d.DimPublicationNavigation).WithMany(p => p.InverseDimPublicationNavigation) + .HasForeignKey(d => d.DimPublicationId) + .HasConstraintName("parent_publication"); + entity.HasOne(d => d.DimRegisteredDataSource).WithMany(p => p.DimPublications) .HasForeignKey(d => d.DimRegisteredDataSourceId) .OnDelete(DeleteBehavior.ClientSetNull) diff --git a/aspnetcore/src/DatabaseContext/Entities/DimPublication.cs b/aspnetcore/src/DatabaseContext/Entities/DimPublication.cs index e722dea..8024f1c 100644 --- a/aspnetcore/src/DatabaseContext/Entities/DimPublication.cs +++ b/aspnetcore/src/DatabaseContext/Entities/DimPublication.cs @@ -121,6 +121,8 @@ public partial class DimPublication public int JufoClass { get; set; } + public int? DimPublicationId { get; set; } + public virtual DimReferencedatum? ArticleTypeCodeNavigation { get; set; } public virtual ICollection DimLocallyReportedPubInfos { get; set; } = new List(); @@ -129,6 +131,8 @@ public partial class DimPublication public virtual DimPublicationChannel DimPublicationChannel { get; set; } = null!; + public virtual DimPublication? DimPublicationNavigation { get; set; } + public virtual DimRegisteredDataSource DimRegisteredDataSource { get; set; } = null!; public virtual ICollection FactContributions { get; set; } = new List(); @@ -137,6 +141,8 @@ public partial class DimPublication public virtual ICollection FactFieldValues { get; set; } = new List(); + public virtual ICollection InverseDimPublicationNavigation { get; set; } = new List(); + public virtual DimReferencedatum JufoClassNavigation { get; set; } = null!; public virtual DimReferencedatum LanguageCodeNavigation { get; set; } = null!;