From 434d26c498e94db2ec32808b6e141fcb7c1a3c54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20Sa=CC=88rkikoski?= Date: Fri, 17 Nov 2023 14:37:03 +0200 Subject: [PATCH 1/3] TTV model update, publication jufo class --- .../src/DatabaseContext/ApiDbContext.cs | 40 +++++++++---------- .../Entities/DimPublication.cs | 8 ++-- .../Entities/DimPublicationChannel.cs | 2 + .../Entities/DimReferencedatum.cs | 2 + .../FactJufoClassCodesForPubChannel.cs | 4 +- .../Repositories/Maps/PublicationProfile.cs | 6 +-- .../Maps/PublicationProfileTest.cs | 33 +++++++++++++-- 7 files changed, 62 insertions(+), 33 deletions(-) diff --git a/aspnetcore/src/DatabaseContext/ApiDbContext.cs b/aspnetcore/src/DatabaseContext/ApiDbContext.cs index bca4c85..6f20d87 100644 --- a/aspnetcore/src/DatabaseContext/ApiDbContext.cs +++ b/aspnetcore/src/DatabaseContext/ApiDbContext.cs @@ -2808,6 +2808,8 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) .HasColumnType("datetime") .HasColumnName("created"); + entity.Property(e => e.DimPublicationChannelId).HasColumnName("dim_publication_channel_id"); + entity.Property(e => e.DimRegisteredDataSourceId).HasColumnName("dim_registered_data_source_id"); entity.Property(e => e.Doi) @@ -2850,14 +2852,6 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) .HasMaxLength(4000) .HasColumnName("journal_name"); - entity.Property(e => e.JufoClassCode) - .HasMaxLength(255) - .HasColumnName("jufo_class_code"); - - entity.Property(e => e.JufoCode) - .HasMaxLength(255) - .HasColumnName("jufo_code"); - entity.Property(e => e.JuuliAddress) .HasMaxLength(4000) .HasColumnName("juuli_address"); @@ -2876,10 +2870,6 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) .HasMaxLength(255) .HasColumnName("open_access"); - entity.Property(e => e.OpenAccessCode) - .HasMaxLength(255) - .HasColumnName("open_access_code"); - entity.Property(e => e.OriginalPublicationId) .HasMaxLength(255) .HasColumnName("original_publication_id"); @@ -2934,9 +2924,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) .HasMaxLength(4000) .HasColumnName("publisher_name"); - entity.Property(e => e.PublisherOpenAccessCode) - .HasMaxLength(255) - .HasColumnName("publisher_open_access_code"); + entity.Property(e => e.PublisherOpenAccessCode).HasColumnName("publisher_open_access_code"); entity.Property(e => e.Report).HasColumnName("report"); @@ -2967,6 +2955,12 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) .HasForeignKey(d => d.ArticleTypeCode) .HasConstraintName("article_type_code"); + entity.HasOne(d => d.DimPublicationChannel) + .WithMany(p => p.DimPublications) + .HasForeignKey(d => d.DimPublicationChannelId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("publication_channel"); + entity.HasOne(d => d.DimRegisteredDataSource) .WithMany(p => p.DimPublications) .HasForeignKey(d => d.DimRegisteredDataSourceId) @@ -3007,6 +3001,12 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) .HasForeignKey(d => d.PublicationTypeCode2) .HasConstraintName("publication_type_code2"); + entity.HasOne(d => d.PublisherOpenAccessCodeNavigation) + .WithMany(p => p.DimPublicationPublisherOpenAccessCodeNavigations) + .HasForeignKey(d => d.PublisherOpenAccessCode) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("publisher_open_access"); + entity.HasOne(d => d.TargetAudienceCodeNavigation) .WithMany(p => p.DimPublicationTargetAudienceCodeNavigations) .HasForeignKey(d => d.TargetAudienceCode) @@ -4767,14 +4767,14 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) modelBuilder.Entity(entity => { - entity.HasKey(e => new { e.DimPublicationChannelId, e.DimReferencedataId, e.Year }) + entity.HasKey(e => new { e.DimPublicationChannelId, e.JufoClasses, e.Year }) .HasName("PK__fact_juf__0E099E4B39813744"); entity.ToTable("fact_jufo_class_codes_for_pub_channels"); entity.Property(e => e.DimPublicationChannelId).HasColumnName("dim_publication_channel_id"); - entity.Property(e => e.DimReferencedataId).HasColumnName("dim_referencedata_id"); + entity.Property(e => e.JufoClasses).HasColumnName("jufo_classes"); entity.Property(e => e.Year).HasColumnName("year"); @@ -4784,11 +4784,11 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("jufo_classes"); - entity.HasOne(d => d.DimReferencedata) + entity.HasOne(d => d.JufoClassesNavigation) .WithMany(p => p.FactJufoClassCodesForPubChannels) - .HasForeignKey(d => d.DimReferencedataId) + .HasForeignKey(d => d.JufoClasses) .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FKfact_jufo_876058"); + .HasConstraintName("FKfact_jufo_216849"); }); modelBuilder.Entity(entity => diff --git a/aspnetcore/src/DatabaseContext/Entities/DimPublication.cs b/aspnetcore/src/DatabaseContext/Entities/DimPublication.cs index 1fbff40..fdd9e05 100644 --- a/aspnetcore/src/DatabaseContext/Entities/DimPublication.cs +++ b/aspnetcore/src/DatabaseContext/Entities/DimPublication.cs @@ -29,8 +29,6 @@ public DimPublication() public string? ArticleNumberText { get; set; } public string? Isbn { get; set; } public string? Isbn2 { get; set; } - public string? JufoCode { get; set; } - public string? JufoClassCode { get; set; } public int PublicationCountryCode { get; set; } public string? JournalName { get; set; } public string? Issn { get; set; } @@ -49,7 +47,6 @@ public DimPublication() public bool GovermentCollaboration { get; set; } public bool OtherCollaboration { get; set; } public int LanguageCode { get; set; } - public string? OpenAccessCode { get; set; } public bool SpecialStateSubsidy { get; set; } public bool? BusinessCollaboration { get; set; } public string? DoiHandle { get; set; } @@ -74,10 +71,12 @@ public DimPublication() public DateTime? Modified { get; set; } public int DimRegisteredDataSourceId { get; set; } public string? OpenAccess { get; set; } - public string? PublisherOpenAccessCode { get; set; } + public int PublisherOpenAccessCode { get; set; } public string? Abstract { get; set; } + public int DimPublicationChannelId { get; set; } public virtual DimReferencedatum? ArticleTypeCodeNavigation { get; set; } + public virtual DimPublicationChannel DimPublicationChannel { get; set; } = null!; public virtual DimRegisteredDataSource DimRegisteredDataSource { get; set; } = null!; public virtual DimReferencedatum LanguageCodeNavigation { get; set; } = null!; public virtual DimReferencedatum LicenseCodeNavigation { get; set; } = null!; @@ -85,6 +84,7 @@ public DimPublication() public virtual DimReferencedatum PublicationCountryCodeNavigation { get; set; } = null!; public virtual DimReferencedatum? PublicationTypeCode2Navigation { get; set; } public virtual DimReferencedatum PublicationTypeCodeNavigation { get; set; } = null!; + public virtual DimReferencedatum PublisherOpenAccessCodeNavigation { get; set; } = null!; public virtual DimReferencedatum? TargetAudienceCodeNavigation { get; set; } public virtual DimReferencedatum ThesisTypeCodeNavigation { get; set; } = null!; public virtual ICollection DimLocallyReportedPubInfos { get; set; } diff --git a/aspnetcore/src/DatabaseContext/Entities/DimPublicationChannel.cs b/aspnetcore/src/DatabaseContext/Entities/DimPublicationChannel.cs index 280f19b..c530128 100644 --- a/aspnetcore/src/DatabaseContext/Entities/DimPublicationChannel.cs +++ b/aspnetcore/src/DatabaseContext/Entities/DimPublicationChannel.cs @@ -8,6 +8,7 @@ public partial class DimPublicationChannel public DimPublicationChannel() { DimPids = new HashSet(); + DimPublications = new HashSet(); DimResearchActivities = new HashSet(); FactJufoClassCodesForPubChannels = new HashSet(); } @@ -18,6 +19,7 @@ public DimPublicationChannel() public string? PublisherNameText { get; set; } public virtual ICollection DimPids { get; set; } + public virtual ICollection DimPublications { get; set; } public virtual ICollection DimResearchActivities { get; set; } public virtual ICollection FactJufoClassCodesForPubChannels { get; set; } } diff --git a/aspnetcore/src/DatabaseContext/Entities/DimReferencedatum.cs b/aspnetcore/src/DatabaseContext/Entities/DimReferencedatum.cs index 214ebba..c2d3464 100644 --- a/aspnetcore/src/DatabaseContext/Entities/DimReferencedatum.cs +++ b/aspnetcore/src/DatabaseContext/Entities/DimReferencedatum.cs @@ -29,6 +29,7 @@ public DimReferencedatum() DimPublicationPublicationCountryCodeNavigations = new HashSet(); DimPublicationPublicationTypeCode2Navigations = new HashSet(); DimPublicationPublicationTypeCodeNavigations = new HashSet(); + DimPublicationPublisherOpenAccessCodeNavigations = new HashSet(); DimPublicationTargetAudienceCodeNavigations = new HashSet(); DimPublicationThesisTypeCodeNavigations = new HashSet(); DimResearchDatasetDimReferencedataAvailabilityNavigations = new HashSet(); @@ -83,6 +84,7 @@ public DimReferencedatum() public virtual ICollection DimPublicationPublicationCountryCodeNavigations { get; set; } public virtual ICollection DimPublicationPublicationTypeCode2Navigations { get; set; } public virtual ICollection DimPublicationPublicationTypeCodeNavigations { get; set; } + public virtual ICollection DimPublicationPublisherOpenAccessCodeNavigations { get; set; } public virtual ICollection DimPublicationTargetAudienceCodeNavigations { get; set; } public virtual ICollection DimPublicationThesisTypeCodeNavigations { get; set; } public virtual ICollection DimResearchDatasetDimReferencedataAvailabilityNavigations { get; set; } diff --git a/aspnetcore/src/DatabaseContext/Entities/FactJufoClassCodesForPubChannel.cs b/aspnetcore/src/DatabaseContext/Entities/FactJufoClassCodesForPubChannel.cs index 5ab8017..465bff5 100644 --- a/aspnetcore/src/DatabaseContext/Entities/FactJufoClassCodesForPubChannel.cs +++ b/aspnetcore/src/DatabaseContext/Entities/FactJufoClassCodesForPubChannel.cs @@ -6,10 +6,10 @@ namespace CSC.PublicApi.DatabaseContext.Entities public partial class FactJufoClassCodesForPubChannel { public int DimPublicationChannelId { get; set; } - public int DimReferencedataId { get; set; } + public int JufoClasses { get; set; } public int Year { get; set; } public virtual DimPublicationChannel DimPublicationChannel { get; set; } = null!; - public virtual DimReferencedatum DimReferencedata { get; set; } = null!; + public virtual DimReferencedatum JufoClassesNavigation { get; set; } = null!; } } diff --git a/aspnetcore/src/Repositories/Maps/PublicationProfile.cs b/aspnetcore/src/Repositories/Maps/PublicationProfile.cs index 8ef5259..d4b03f8 100644 --- a/aspnetcore/src/Repositories/Maps/PublicationProfile.cs +++ b/aspnetcore/src/Repositories/Maps/PublicationProfile.cs @@ -45,13 +45,13 @@ public PublicationProfile() .ForMember(dst => dst.ParentPublicationName, opt => opt.MapFrom(src => src.ParentPublicationName)) .ForMember(dst => dst.ParentPublicationPublisher, opt => opt.MapFrom(src => src.ParentPublicationPublisher)) .ForMember(dst => dst.OpenAccess, opt => opt.MapFrom(src => src.OpenAccess != "9" ? src.OpenAccess : null)) - .ForMember(dst => dst.PublisherOpenAccess, opt => opt.MapFrom(src => src.PublisherOpenAccessCode != "9" ? src.PublisherOpenAccessCode : null)) + .ForMember(dst => dst.PublisherOpenAccess, opt => opt.MapFrom(src => src.PublicationCountryCodeNavigation.CodeValue != "9" ? src.PublicationCountryCodeNavigation.CodeValue : null)) .ForMember(dst => dst.Isbn1, opt => opt.MapFrom(src => src.Isbn)) .ForMember(dst => dst.Isbn2, opt => opt.MapFrom(src => src.Isbn2)) .ForMember(dst => dst.PublisherName, opt => opt.MapFrom(src => src.PublisherName)) .ForMember(dst => dst.PublisherLocation, opt => opt.MapFrom(src => src.PublisherLocation)) - .ForMember(dst => dst.JufoCode, opt => opt.MapFrom(src => src.JufoCode)) - .ForMember(dst => dst.JufoClass, opt => opt.MapFrom(src => src.JufoClassCode)) + .ForMember(dst => dst.JufoCode, opt => opt.MapFrom(src => src.DimPublicationChannel.JufoCode)) + .ForMember(dst => dst.JufoClass, opt => opt.MapFrom(src => src.DimPublicationChannel.FactJufoClassCodesForPubChannels.First().JufoClassesNavigation)) .ForMember(dst => dst.Doi, opt => opt.MapFrom(src => src.Doi)) .ForMember(dst => dst.DoiHandle, opt => opt.MapFrom(src => src.DoiHandle)) .ForMember(dst => dst.FieldsOfScience, opt => opt.MapFrom(src => src.FactDimReferencedataFieldOfSciences.Select(f => f.DimReferencedata))) diff --git a/aspnetcore/test/Indexer.Tests/Maps/PublicationProfileTest.cs b/aspnetcore/test/Indexer.Tests/Maps/PublicationProfileTest.cs index 4d727b0..2e411a0 100644 --- a/aspnetcore/test/Indexer.Tests/Maps/PublicationProfileTest.cs +++ b/aspnetcore/test/Indexer.Tests/Maps/PublicationProfileTest.cs @@ -53,7 +53,7 @@ private Publication Act_Map(DimPublication dbEntity) private static DimPublication GetEntity() { - return new DimPublication + DimPublication dimPublication = new() { Id = 1, PublicationId = "publicationId", @@ -106,8 +106,13 @@ private static DimPublication GetEntity() Isbn2 = "isbn2", PublisherName = "publisherName", PublisherLocation = "publisherLocation", - JufoCode = "jufoCode", - JufoClassCode = "jufoClassCode", + DimPublicationChannel = new DimPublicationChannel + { + JufoCode = "jufoCode", + ChannelNameAnylang = "channelNameAnylang", + PublisherNameText = "publisherNameText", + FactJufoClassCodesForPubChannels = new List() + }, Doi = "doi", DoiHandle = "doiHandle", DimKeywords = new List @@ -262,6 +267,23 @@ private static DimPublication GetEntity() Created = new DateTime(2023, 3, 10, 10, 43, 00), Modified = new DateTime(2023, 3, 10, 10, 44, 00) }; + + FactJufoClassCodesForPubChannel factJufoClassCodesForPubChannel = new() + { + DimPublicationChannel = dimPublication.DimPublicationChannel, + JufoClassesNavigation = new DimReferencedatum + { + CodeValue = "jufoClassCode2", + NameFi = "jufoClassNameFi2", + NameEn = "jufoClassNameEn2", + NameSv = "jufoClassNameSv2" + }, + Year = 2023 + }; + + dimPublication.DimPublicationChannel.FactJufoClassCodesForPubChannels.Add(factJufoClassCodesForPubChannel); + + return dimPublication; } private Publication GetModel() @@ -320,7 +342,10 @@ private Publication GetModel() JufoCode = "jufoCode", JufoClass = new ReferenceData { - Code = "jufoClassCode" + Code = "jufoClassCode", + NameFi = "jufoClassNameFi", + NameEn = "jufoClassNameEn", + NameSv = "jufoClassNameSv" }, Doi = "doi", DoiHandle = "doiHandle", From eecbda0cb15214fa69a5903b0cc05db6d37dca01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20Sa=CC=88rkikoski?= Date: Wed, 22 Nov 2023 15:24:19 +0200 Subject: [PATCH 2/3] Fix bug in Publication mapping profile. Fix unit test. --- .../Repositories/Maps/PublicationProfile.cs | 3 +- .../Maps/PublicationProfileTest.cs | 60 ++++++++++++------- 2 files changed, 38 insertions(+), 25 deletions(-) diff --git a/aspnetcore/src/Repositories/Maps/PublicationProfile.cs b/aspnetcore/src/Repositories/Maps/PublicationProfile.cs index d4b03f8..a182fb6 100644 --- a/aspnetcore/src/Repositories/Maps/PublicationProfile.cs +++ b/aspnetcore/src/Repositories/Maps/PublicationProfile.cs @@ -1,7 +1,6 @@ using CSC.PublicApi.DatabaseContext.Entities; using CSC.PublicApi.Service.Models; using CSC.PublicApi.Service.Models.Publication; -using Microsoft.Data.SqlClient; using FactContribution = CSC.PublicApi.Service.Models.Publication.FactContribution; using Name = CSC.PublicApi.Service.Models.Publication.Name; using Profile = AutoMapper.Profile; @@ -45,7 +44,7 @@ public PublicationProfile() .ForMember(dst => dst.ParentPublicationName, opt => opt.MapFrom(src => src.ParentPublicationName)) .ForMember(dst => dst.ParentPublicationPublisher, opt => opt.MapFrom(src => src.ParentPublicationPublisher)) .ForMember(dst => dst.OpenAccess, opt => opt.MapFrom(src => src.OpenAccess != "9" ? src.OpenAccess : null)) - .ForMember(dst => dst.PublisherOpenAccess, opt => opt.MapFrom(src => src.PublicationCountryCodeNavigation.CodeValue != "9" ? src.PublicationCountryCodeNavigation.CodeValue : null)) + .ForMember(dst => dst.PublisherOpenAccess, opt => opt.MapFrom(src => src.PublisherOpenAccessCodeNavigation.CodeValue != "9" ? src.PublisherOpenAccessCodeNavigation : null)) .ForMember(dst => dst.Isbn1, opt => opt.MapFrom(src => src.Isbn)) .ForMember(dst => dst.Isbn2, opt => opt.MapFrom(src => src.Isbn2)) .ForMember(dst => dst.PublisherName, opt => opt.MapFrom(src => src.PublisherName)) diff --git a/aspnetcore/test/Indexer.Tests/Maps/PublicationProfileTest.cs b/aspnetcore/test/Indexer.Tests/Maps/PublicationProfileTest.cs index 2e411a0..404db8f 100644 --- a/aspnetcore/test/Indexer.Tests/Maps/PublicationProfileTest.cs +++ b/aspnetcore/test/Indexer.Tests/Maps/PublicationProfileTest.cs @@ -53,6 +53,27 @@ private Publication Act_Map(DimPublication dbEntity) private static DimPublication GetEntity() { + DimPublicationChannel dimPublicationChannel = new() + { + JufoCode = "jufoCode", + ChannelNameAnylang = "channelNameAnylang", + PublisherNameText = "publisherNameText", + }; + + FactJufoClassCodesForPubChannel factJufoClassCodesForPubChannel = new() + { + DimPublicationChannel = dimPublicationChannel, + JufoClassesNavigation = new DimReferencedatum + { + CodeValue = "jufoClassCode", + NameFi = "jufoClassNameFi", + NameEn = "jufoClassNameEn", + NameSv = "jufoClassNameSv" + }, + Year = 2023 + }; + dimPublicationChannel.FactJufoClassCodesForPubChannels.Add(factJufoClassCodesForPubChannel); + DimPublication dimPublication = new() { Id = 1, @@ -84,7 +105,6 @@ private static DimPublication GetEntity() NameSv = "targetAudienceNameSv", NameEn = "targetAudienceNameEn" }, - //PublicationTypeCode = "publicationTypeCode", PublicationTypeCodeNavigation = new DimReferencedatum { CodeValue = "publicationTypeCode", @@ -106,12 +126,13 @@ private static DimPublication GetEntity() Isbn2 = "isbn2", PublisherName = "publisherName", PublisherLocation = "publisherLocation", - DimPublicationChannel = new DimPublicationChannel + DimPublicationChannel = dimPublicationChannel, + PublisherOpenAccessCodeNavigation = new DimReferencedatum { - JufoCode = "jufoCode", - ChannelNameAnylang = "channelNameAnylang", - PublisherNameText = "publisherNameText", - FactJufoClassCodesForPubChannels = new List() + CodeValue = "publisherOpenAccessCode", + NameFi = "publisherOpenAccessCodeFi", + NameSv = "publisherOpenAccessCodeSv", + NameEn = "publisherOpenAccessCodeEn" }, Doi = "doi", DoiHandle = "doiHandle", @@ -192,6 +213,7 @@ private static DimPublication GetEntity() NameSv = "languageCodeSv", NameEn = "languageCodeEn" }, + InternationalPublication = 1, InternationalCollaboration = true, BusinessCollaboration = true, ApcFeeEur = 123.4m, @@ -267,22 +289,7 @@ private static DimPublication GetEntity() Created = new DateTime(2023, 3, 10, 10, 43, 00), Modified = new DateTime(2023, 3, 10, 10, 44, 00) }; - - FactJufoClassCodesForPubChannel factJufoClassCodesForPubChannel = new() - { - DimPublicationChannel = dimPublication.DimPublicationChannel, - JufoClassesNavigation = new DimReferencedatum - { - CodeValue = "jufoClassCode2", - NameFi = "jufoClassNameFi2", - NameEn = "jufoClassNameEn2", - NameSv = "jufoClassNameSv2" - }, - Year = 2023 - }; - - dimPublication.DimPublicationChannel.FactJufoClassCodesForPubChannels.Add(factJufoClassCodesForPubChannel); - + return dimPublication; } @@ -412,7 +419,7 @@ private Publication GetModel() NameSv = "languageCodeSv", NameEn = "languageCodeEn" }, - InternationalPublication = false, + InternationalPublication = true, InternationalCollaboration = true, BusinessCollaboration = true, ApcFeeEur = 123.4m, @@ -489,6 +496,13 @@ private Publication GetModel() NameEn = "artPublicationTypeNameEn" } }, + PublisherOpenAccess = new ReferenceData + { + Code = "publisherOpenAccessCode", + NameFi = "publisherOpenAccessCodeFi", + NameSv = "publisherOpenAccessCodeSv", + NameEn = "publisherOpenAccessCodeEn" + }, Created = new DateTime(2023, 3, 10, 10, 43, 00), Modified = new DateTime(2023, 3, 10, 10, 44, 00) }; From 73439700e6c0b73542a1b7af566608ae05b6a660 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20Sa=CC=88rkikoski?= Date: Thu, 23 Nov 2023 11:27:58 +0200 Subject: [PATCH 3/3] Modify TTV models DimPublicationChannel and FactJufoClassCodesForPubChannel --- .../src/DatabaseContext/ApiDbContext.cs | 34 ++++++++++++++++++- .../Entities/DimPublicationChannel.cs | 4 +++ .../FactJufoClassCodesForPubChannel.cs | 4 +++ 3 files changed, 41 insertions(+), 1 deletion(-) diff --git a/aspnetcore/src/DatabaseContext/ApiDbContext.cs b/aspnetcore/src/DatabaseContext/ApiDbContext.cs index 6f20d87..c6ab405 100644 --- a/aspnetcore/src/DatabaseContext/ApiDbContext.cs +++ b/aspnetcore/src/DatabaseContext/ApiDbContext.cs @@ -3046,13 +3046,29 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) .HasMaxLength(4000) .HasColumnName("channel_name_anylang"); + entity.Property(e => e.Created) + .HasColumnType("datetime") + .HasColumnName("created"); + entity.Property(e => e.JufoCode) .HasMaxLength(255) .HasColumnName("jufo_code"); + entity.Property(e => e.Modified) + .HasColumnType("datetime") + .HasColumnName("modified"); + entity.Property(e => e.PublisherNameText) .HasMaxLength(4000) .HasColumnName("publisher_name_text"); + + entity.Property(e => e.SourceDescription) + .HasMaxLength(255) + .HasColumnName("source_description"); + + entity.Property(e => e.SourceId) + .HasMaxLength(255) + .HasColumnName("source_id"); }); modelBuilder.Entity(entity => @@ -4768,7 +4784,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) modelBuilder.Entity(entity => { entity.HasKey(e => new { e.DimPublicationChannelId, e.JufoClasses, e.Year }) - .HasName("PK__fact_juf__0E099E4B39813744"); + .HasName("PK__fact_juf__5280C574D130FC62"); entity.ToTable("fact_jufo_class_codes_for_pub_channels"); @@ -4778,6 +4794,22 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) entity.Property(e => e.Year).HasColumnName("year"); + entity.Property(e => e.Created) + .HasColumnType("datetime") + .HasColumnName("created"); + + entity.Property(e => e.Modified) + .HasColumnType("datetime") + .HasColumnName("modified"); + + entity.Property(e => e.SourceDescription) + .HasMaxLength(255) + .HasColumnName("source_description"); + + entity.Property(e => e.SourceId) + .HasMaxLength(255) + .HasColumnName("source_id"); + entity.HasOne(d => d.DimPublicationChannel) .WithMany(p => p.FactJufoClassCodesForPubChannels) .HasForeignKey(d => d.DimPublicationChannelId) diff --git a/aspnetcore/src/DatabaseContext/Entities/DimPublicationChannel.cs b/aspnetcore/src/DatabaseContext/Entities/DimPublicationChannel.cs index c530128..5a845d5 100644 --- a/aspnetcore/src/DatabaseContext/Entities/DimPublicationChannel.cs +++ b/aspnetcore/src/DatabaseContext/Entities/DimPublicationChannel.cs @@ -17,6 +17,10 @@ public DimPublicationChannel() public string? JufoCode { get; set; } public string? ChannelNameAnylang { get; set; } public string? PublisherNameText { get; set; } + public string SourceId { get; set; } = null!; + public string? SourceDescription { get; set; } + public DateTime? Created { get; set; } + public DateTime? Modified { get; set; } public virtual ICollection DimPids { get; set; } public virtual ICollection DimPublications { get; set; } diff --git a/aspnetcore/src/DatabaseContext/Entities/FactJufoClassCodesForPubChannel.cs b/aspnetcore/src/DatabaseContext/Entities/FactJufoClassCodesForPubChannel.cs index 465bff5..5f179c2 100644 --- a/aspnetcore/src/DatabaseContext/Entities/FactJufoClassCodesForPubChannel.cs +++ b/aspnetcore/src/DatabaseContext/Entities/FactJufoClassCodesForPubChannel.cs @@ -8,6 +8,10 @@ public partial class FactJufoClassCodesForPubChannel public int DimPublicationChannelId { get; set; } public int JufoClasses { get; set; } public int Year { get; set; } + public string SourceId { get; set; } = null!; + public string? SourceDescription { get; set; } + public DateTime? Created { get; set; } + public DateTime? Modified { get; set; } public virtual DimPublicationChannel DimPublicationChannel { get; set; } = null!; public virtual DimReferencedatum JufoClassesNavigation { get; set; } = null!;