Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update DB model to handle dim_publication.dim_publication_id #243

Merged
merged 1 commit into from
Sep 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions aspnetcore/src/api/Models/Ttv/DimPublication.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<DimLocallyReportedPubInfo> DimLocallyReportedPubInfos { get; set; } = new List<DimLocallyReportedPubInfo>();
Expand All @@ -129,6 +131,8 @@ public partial class DimPublication

public virtual DimPublicationChannel DimPublicationChannel { get; set; }

public virtual DimPublication DimPublicationNavigation { get; set; }

public virtual DimRegisteredDataSource DimRegisteredDataSource { get; set; }

public virtual ICollection<FactContribution> FactContributions { get; set; } = new List<FactContribution>();
Expand All @@ -137,6 +141,8 @@ public partial class DimPublication

public virtual ICollection<FactFieldValue> FactFieldValues { get; set; } = new List<FactFieldValue>();

public virtual ICollection<DimPublication> InverseDimPublicationNavigation { get; set; } = new List<DimPublication>();

public virtual DimReferencedatum JufoClassNavigation { get; set; }

public virtual DimReferencedatum LanguageCodeNavigation { get; set; }
Expand Down
5 changes: 5 additions & 0 deletions aspnetcore/src/api/Models/Ttv/TtvContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2453,6 +2453,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)
Expand Down Expand Up @@ -2560,6 +2561,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)
Expand Down
Loading