diff --git a/aspnetcore/src/api.Tests/Services_Tests/UserProfileServiceTest.cs b/aspnetcore/src/api.Tests/Services_Tests/UserProfileServiceTest.cs index 0cf69a1..9ba13f6 100644 --- a/aspnetcore/src/api.Tests/Services_Tests/UserProfileServiceTest.cs +++ b/aspnetcore/src/api.Tests/Services_Tests/UserProfileServiceTest.cs @@ -281,7 +281,9 @@ public void getEmptyDimPid_01() Assert.Equal(-1, actualDimPid.DimInfrastructureId); Assert.Equal(-1, actualDimPid.DimPublicationChannelId); Assert.Equal(-1, actualDimPid.DimResearchDatasetId); - Assert.Equal(-1, actualDimPid.DimFundingDecisionId); + Assert.Equal(-1, (int)actualDimPid.DimFundingDecisionId); + Assert.Equal(-1, (int)actualDimPid.DimResearchProjectId); + Assert.Equal(-1, (int)actualDimPid.DimResearchCommunityId); Assert.Equal(-1, actualDimPid.DimResearchDataCatalogId); Assert.Equal(-1, actualDimPid.DimResearchActivityId); Assert.Equal(-1, actualDimPid.DimEventId); diff --git a/aspnetcore/src/api/Models/Ttv/DimCallDecision.cs b/aspnetcore/src/api/Models/Ttv/DimCallDecision.cs new file mode 100644 index 0000000..55481e3 --- /dev/null +++ b/aspnetcore/src/api/Models/Ttv/DimCallDecision.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; + +namespace api.Models.Ttv; + +/// +/// Rahoituspäätöspaneeli +/// +public partial class DimCallDecision +{ + public int Id { get; set; } + + public int DecisionMaker { get; set; } + + public int DimDateIdApproval { get; set; } + + public int DimCallProgrammeId { get; set; } + + /// + /// Rahoituspäätöspaneeli - Haun vaihe + /// + public string CallProcessingPhase { get; set; } + + public string SourceId { get; set; } + + public string SourceDescription { get; set; } + + public virtual DimReferencedatum DecisionMakerNavigation { get; set; } + + public virtual DimCallProgramme DimCallProgramme { get; set; } + + public virtual DimDate DimDateIdApprovalNavigation { get; set; } + + public virtual ICollection DimFundingDecisions { get; set; } = new List(); +} diff --git a/aspnetcore/src/api/Models/Ttv/DimCallProgramme.cs b/aspnetcore/src/api/Models/Ttv/DimCallProgramme.cs index e4d076c..69a26fa 100644 --- a/aspnetcore/src/api/Models/Ttv/DimCallProgramme.cs +++ b/aspnetcore/src/api/Models/Ttv/DimCallProgramme.cs @@ -63,6 +63,14 @@ public partial class DimCallProgramme public string CallNameDetailsSv { get; set; } + public string LocalIdentifier { get; set; } + + public int? TypeOfFunding { get; set; } + + public virtual ICollection DimCallDecisions { get; set; } = new List(); + + public virtual DimCallProgramme DimCallProgrammeNavigation { get; set; } + public virtual DimDate DimDateIdDueNavigation { get; set; } public virtual DimDate DimDateIdOpenNavigation { get; set; } @@ -75,6 +83,10 @@ public partial class DimCallProgramme public virtual ICollection DimWebLinks { get; set; } = new List(); + public virtual ICollection InverseDimCallProgrammeNavigation { get; set; } = new List(); + + public virtual DimReferencedatum TypeOfFundingNavigation { get; set; } + public virtual ICollection DimCallProgrammeId2s { get; set; } = new List(); public virtual ICollection DimCallProgrammes { get; set; } = new List(); diff --git a/aspnetcore/src/api/Models/Ttv/DimDate.cs b/aspnetcore/src/api/Models/Ttv/DimDate.cs index fb21d14..3f69d98 100644 --- a/aspnetcore/src/api/Models/Ttv/DimDate.cs +++ b/aspnetcore/src/api/Models/Ttv/DimDate.cs @@ -25,6 +25,8 @@ public partial class DimDate public virtual ICollection DimAffiliationStartDateNavigations { get; set; } = new List(); + public virtual ICollection DimCallDecisions { get; set; } = new List(); + public virtual ICollection DimCallProgrammeDimDateIdDueNavigations { get; set; } = new List(); public virtual ICollection DimCallProgrammeDimDateIdOpenNavigations { get; set; } = new List(); @@ -57,6 +59,10 @@ public partial class DimDate public virtual ICollection DimResearchActivityDimStartDateNavigations { get; set; } = new List(); + public virtual ICollection DimResearchProjectEndDateNavigations { get; set; } = new List(); + + public virtual ICollection DimResearchProjectStartDateNavigations { get; set; } = new List(); + public virtual ICollection DimResearcherToResearchCommunityEndDateNavigations { get; set; } = new List(); public virtual ICollection DimResearcherToResearchCommunityStartDateNavigations { get; set; } = new List(); diff --git a/aspnetcore/src/api/Models/Ttv/DimFundingDecision.cs b/aspnetcore/src/api/Models/Ttv/DimFundingDecision.cs index 5cf259b..46dfdf5 100644 --- a/aspnetcore/src/api/Models/Ttv/DimFundingDecision.cs +++ b/aspnetcore/src/api/Models/Ttv/DimFundingDecision.cs @@ -27,6 +27,9 @@ public partial class DimFundingDecision public int DimFundingDecisionIdParentDecision { get; set; } + /// + /// Päätöksen paikallinen tunniste (tiedon toimittajan) + /// public string FunderProjectNumber { get; set; } public string Acronym { get; set; } @@ -65,12 +68,19 @@ public partial class DimFundingDecision public int DimRegisteredDataSourceId { get; set; } + /// + /// Rahoituspäätös - Päätöspaneeli + /// + public int? DimCallDecisionsId { get; set; } + public virtual ICollection BrFundingConsortiumParticipations { get; set; } = new List(); public virtual ICollection BrParticipatesInFundingGroups { get; set; } = new List(); public virtual ICollection BrWordClusterDimFundingDecisions { get; set; } = new List(); + public virtual DimCallDecision DimCallDecisions { get; set; } + public virtual DimCallProgramme DimCallProgramme { get; set; } public virtual DimDate DimDateIdApprovalNavigation { get; set; } @@ -87,11 +97,9 @@ public partial class DimFundingDecision public virtual DimOrganization DimOrganizationIdFunderNavigation { get; set; } - public virtual ICollection DimPids { get; set; } = new List(); - public virtual DimRegisteredDataSource DimRegisteredDataSource { get; set; } - public virtual DimTypeOfFunding DimTypeOfFunding { get; set; } + public virtual DimReferencedatum DimTypeOfFunding { get; set; } public virtual ICollection DimWebLinks { get; set; } = new List(); @@ -105,11 +113,7 @@ public partial class DimFundingDecision public virtual ICollection DimFundingDecisionFroms { get; set; } = new List(); - public virtual ICollection DimFundingDecisionFromsNavigation { get; set; } = new List(); - public virtual ICollection DimFundingDecisionTos { get; set; } = new List(); - public virtual ICollection DimFundingDecisionTosNavigation { get; set; } = new List(); - public virtual ICollection DimKeywords { get; set; } = new List(); } diff --git a/aspnetcore/src/api/Models/Ttv/DimName.cs b/aspnetcore/src/api/Models/Ttv/DimName.cs index 7575ed0..f711d20 100644 --- a/aspnetcore/src/api/Models/Ttv/DimName.cs +++ b/aspnetcore/src/api/Models/Ttv/DimName.cs @@ -35,6 +35,8 @@ public partial class DimName public virtual DimRegisteredDataSource DimRegisteredDataSource { get; set; } + public virtual ICollection DimResearchProjects { get; set; } = new List(); + public virtual ICollection FactContributions { get; set; } = new List(); public virtual ICollection FactFieldValues { get; set; } = new List(); diff --git a/aspnetcore/src/api/Models/Ttv/DimOrganization.cs b/aspnetcore/src/api/Models/Ttv/DimOrganization.cs index eace6dd..a81e2eb 100644 --- a/aspnetcore/src/api/Models/Ttv/DimOrganization.cs +++ b/aspnetcore/src/api/Models/Ttv/DimOrganization.cs @@ -87,6 +87,8 @@ public partial class DimOrganization public virtual ICollection DimResearchActivities { get; set; } = new List(); + public virtual ICollection DimResearchProjects { get; set; } = new List(); + public virtual DimSector DimSector { get; set; } public virtual ICollection DimWebLinks { get; set; } = new List(); diff --git a/aspnetcore/src/api/Models/Ttv/DimPid.cs b/aspnetcore/src/api/Models/Ttv/DimPid.cs index 1abaa97..3880b8a 100644 --- a/aspnetcore/src/api/Models/Ttv/DimPid.cs +++ b/aspnetcore/src/api/Models/Ttv/DimPid.cs @@ -25,8 +25,6 @@ public partial class DimPid public int DimResearchDatasetId { get; set; } - public int DimFundingDecisionId { get; set; } - public int DimResearchDataCatalogId { get; set; } public int DimResearchActivityId { get; set; } @@ -47,9 +45,13 @@ public partial class DimPid public int? DimProfileOnlyFundingDecisionId { get; set; } - public virtual DimEvent DimEvent { get; set; } + public int? DimFundingDecisionId { get; set; } + + public int? DimResearchProjectId { get; set; } - public virtual DimFundingDecision DimFundingDecision { get; set; } + public int? DimResearchCommunityId { get; set; } + + public virtual DimEvent DimEvent { get; set; } public virtual DimInfrastructure DimInfrastructure { get; set; } @@ -69,6 +71,8 @@ public partial class DimPid public virtual DimResearchActivity DimResearchActivity { get; set; } + public virtual DimResearchCommunity DimResearchCommunity { get; set; } + public virtual DimResearchDataCatalog DimResearchDataCatalog { get; set; } public virtual DimResearchDataset DimResearchDataset { get; set; } diff --git a/aspnetcore/src/api/Models/Ttv/DimReferencedatum.cs b/aspnetcore/src/api/Models/Ttv/DimReferencedatum.cs index e6e7750..f826153 100644 --- a/aspnetcore/src/api/Models/Ttv/DimReferencedatum.cs +++ b/aspnetcore/src/api/Models/Ttv/DimReferencedatum.cs @@ -35,8 +35,14 @@ public partial class DimReferencedatum public virtual ICollection DimAffiliations { get; set; } = new List(); + public virtual ICollection DimCallDecisions { get; set; } = new List(); + + public virtual ICollection DimCallProgrammesNavigation { get; set; } = new List(); + public virtual ICollection DimEducations { get; set; } = new List(); + public virtual ICollection DimFundingDecisions { get; set; } = new List(); + public virtual ICollection DimLocallyReportedPubInfoSelfArchivedLicenseCodeNavigations { get; set; } = new List(); public virtual ICollection DimLocallyReportedPubInfoSelfArchivedVersionCodeNavigations { get; set; } = new List(); diff --git a/aspnetcore/src/api/Models/Ttv/DimRegisteredDataSource.cs b/aspnetcore/src/api/Models/Ttv/DimRegisteredDataSource.cs index 0219d04..7384513 100644 --- a/aspnetcore/src/api/Models/Ttv/DimRegisteredDataSource.cs +++ b/aspnetcore/src/api/Models/Ttv/DimRegisteredDataSource.cs @@ -59,6 +59,8 @@ public partial class DimRegisteredDataSource public virtual ICollection DimResearchDatasets { get; set; } = new List(); + public virtual ICollection DimResearchProjects { get; set; } = new List(); + public virtual ICollection DimResearcherDescriptions { get; set; } = new List(); public virtual ICollection DimResearcherToResearchCommunities { get; set; } = new List(); diff --git a/aspnetcore/src/api/Models/Ttv/DimResearchCommunity.cs b/aspnetcore/src/api/Models/Ttv/DimResearchCommunity.cs index 0e267b9..a99bcf0 100644 --- a/aspnetcore/src/api/Models/Ttv/DimResearchCommunity.cs +++ b/aspnetcore/src/api/Models/Ttv/DimResearchCommunity.cs @@ -33,6 +33,8 @@ public partial class DimResearchCommunity public int DimRegisteredDataSourceId { get; set; } + public virtual ICollection DimPids { get; set; } = new List(); + public virtual DimRegisteredDataSource DimRegisteredDataSource { get; set; } public virtual ICollection DimResearcherToResearchCommunities { get; set; } = new List(); diff --git a/aspnetcore/src/api/Models/Ttv/DimResearchProject.cs b/aspnetcore/src/api/Models/Ttv/DimResearchProject.cs new file mode 100644 index 0000000..0d41765 --- /dev/null +++ b/aspnetcore/src/api/Models/Ttv/DimResearchProject.cs @@ -0,0 +1,94 @@ +using System; +using System.Collections.Generic; + +namespace api.Models.Ttv; + +public partial class DimResearchProject +{ + public int Id { get; set; } + + /// + /// Hanke - vastuuorganisaatio + /// + public int ResponsibleOrganization { get; set; } + + /// + /// Hanke - nimi + /// + public string NameFi { get; set; } + + public string NameEn { get; set; } + + public string NameSv { get; set; } + + /// + /// Hanke - lyhenne + /// + public string AbbrevationFi { get; set; } + + public string AbbrevationEn { get; set; } + + public string AbbrevationSv { get; set; } + + /// + /// Hanke - tiivistelmä + /// + public string SummaryFi { get; set; } + + public string SummaryEn { get; set; } + + public string SummarySv { get; set; } + + /// + /// Hanke - lisätieto + /// + public string AdditionalInfromationFi { get; set; } + + public string AdditionalInformationEn { get; set; } + + public string AddtitionalInformationSv { get; set; } + + /// + /// Hanke - alkamispäivämäärä + /// + public int? StartDate { get; set; } + + /// + /// Hanke - päättymispäivämäärä + /// + public int? EndDate { get; set; } + + public string SourceId { get; set; } + + public string SourceDescription { get; set; } + + public DateTime? Created { get; set; } + + public DateTime? Modified { get; set; } + + public int DimRegisteredDataSourceId { get; set; } + + public int? ResponsiblePerson { get; set; } + + public string GoalsFi { get; set; } + + public string GoalsEn { get; set; } + + public string GoalsSv { get; set; } + + public string OutcomeEffectFi { get; set; } + + public string OutcomeEffectEn { get; set; } + + public string OutcomeEffectSv { get; set; } + + public virtual DimRegisteredDataSource DimRegisteredDataSource { get; set; } + + public virtual DimDate EndDateNavigation { get; set; } + + public virtual DimOrganization ResponsibleOrganizationNavigation { get; set; } + + public virtual DimName ResponsiblePersonNavigation { get; set; } + + public virtual DimDate StartDateNavigation { get; set; } +} diff --git a/aspnetcore/src/api/Models/Ttv/DimTypeOfFunding.cs b/aspnetcore/src/api/Models/Ttv/DimTypeOfFunding.cs index f25f090..6ddd436 100644 --- a/aspnetcore/src/api/Models/Ttv/DimTypeOfFunding.cs +++ b/aspnetcore/src/api/Models/Ttv/DimTypeOfFunding.cs @@ -25,8 +25,6 @@ public partial class DimTypeOfFunding public int DimTypeOfFundingId { get; set; } - public virtual ICollection DimFundingDecisions { get; set; } = new List(); - public virtual ICollection DimProfileOnlyFundingDecisions { get; set; } = new List(); public virtual DimTypeOfFunding DimTypeOfFundingNavigation { get; set; } diff --git a/aspnetcore/src/api/Models/Ttv/DimUserProfile.cs b/aspnetcore/src/api/Models/Ttv/DimUserProfile.cs index e116512..e28dc3e 100644 --- a/aspnetcore/src/api/Models/Ttv/DimUserProfile.cs +++ b/aspnetcore/src/api/Models/Ttv/DimUserProfile.cs @@ -33,6 +33,8 @@ public partial class DimUserProfile public bool Hidden { get; set; } + public bool PublishNewOrcidData { get; set; } + public virtual ICollection BrGrantedPermissions { get; set; } = new List(); public virtual ICollection DimFieldDisplaySettings { get; set; } = new List(); diff --git a/aspnetcore/src/api/Models/Ttv/DimWebLink.cs b/aspnetcore/src/api/Models/Ttv/DimWebLink.cs index bbe8b7f..5de6e4d 100644 --- a/aspnetcore/src/api/Models/Ttv/DimWebLink.cs +++ b/aspnetcore/src/api/Models/Ttv/DimWebLink.cs @@ -47,6 +47,8 @@ public partial class DimWebLink public int? DimProfileOnlyFundingDecisionId { get; set; } + public int? DimResearchProjectId { get; set; } + public virtual DimCallProgramme DimCallProgramme { get; set; } public virtual DimFundingDecision DimFundingDecision { get; set; } diff --git a/aspnetcore/src/api/Models/Ttv/FactContribution.cs b/aspnetcore/src/api/Models/Ttv/FactContribution.cs index 1b46973..e54cecd 100644 --- a/aspnetcore/src/api/Models/Ttv/FactContribution.cs +++ b/aspnetcore/src/api/Models/Ttv/FactContribution.cs @@ -43,6 +43,8 @@ public partial class FactContribution public DateTime? Modified { get; set; } + public int DimResearchProjectId { get; set; } + public virtual DimDate DimDate { get; set; } public virtual DimFundingDecision DimFundingDecision { get; set; } diff --git a/aspnetcore/src/api/Models/Ttv/TtvContext.cs b/aspnetcore/src/api/Models/Ttv/TtvContext.cs index 646f349..a664ece 100644 --- a/aspnetcore/src/api/Models/Ttv/TtvContext.cs +++ b/aspnetcore/src/api/Models/Ttv/TtvContext.cs @@ -31,6 +31,8 @@ public TtvContext(DbContextOptions options) public virtual DbSet DimAffiliations { get; set; } + public virtual DbSet DimCallDecisions { get; set; } + public virtual DbSet DimCallProgrammes { get; set; } public virtual DbSet DimCompetences { get; set; } @@ -107,6 +109,8 @@ public TtvContext(DbContextOptions options) public virtual DbSet DimResearchDatasets { get; set; } + public virtual DbSet DimResearchProjects { get; set; } + public virtual DbSet DimResearcherDescriptions { get; set; } public virtual DbSet DimResearcherToResearchCommunities { get; set; } @@ -146,7 +150,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) { modelBuilder.Entity(entity => { - entity.HasKey(e => new { e.DimResearchDatasetId, e.DimResearchDatasetId2 }).HasName("PK__br_datas__9FEA685A8D199EEE"); + entity.HasKey(e => new { e.DimResearchDatasetId, e.DimResearchDatasetId2 }).HasName("PK__br_datas__9FEA685AE4E99901"); entity.ToTable("br_dataset_dataset_relationship"); @@ -170,7 +174,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) modelBuilder.Entity(entity => { - entity.HasKey(e => new { e.DimFundingDecisionId, e.DimOrganizationid }).HasName("PK__br_fundi__3DB567F8ABF72B46"); + entity.HasKey(e => new { e.DimFundingDecisionId, e.DimOrganizationid }).HasName("PK__br_fundi__3DB567F8381567B0"); entity.ToTable("br_funding_consortium_participation"); @@ -197,7 +201,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) modelBuilder.Entity(entity => { - entity.HasKey(e => new { e.DimUserProfileId, e.DimExternalServiceId, e.DimPermittedFieldGroup }).HasName("PK__br_grant__F51F7BCBD90F1E17"); + entity.HasKey(e => new { e.DimUserProfileId, e.DimExternalServiceId, e.DimPermittedFieldGroup }).HasName("PK__br_grant__F51F7BCB758FD9D2"); entity.ToTable("br_granted_permissions"); @@ -223,7 +227,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) modelBuilder.Entity(entity => { - entity.HasKey(e => new { e.DimFundingDecisionid, e.DimNameId }).HasName("PK__br_parti__5EC9BC6425248D7B"); + entity.HasKey(e => new { e.DimFundingDecisionid, e.DimNameId }).HasName("PK_br_participates_in_funding_group_1"); entity.ToTable("br_participates_in_funding_group"); @@ -279,7 +283,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) modelBuilder.Entity(entity => { - entity.HasKey(e => new { e.DimWordClusterId, e.DimFundingDecisionId }).HasName("PK__br_word___7D640B5A043D2C38"); + entity.HasKey(e => new { e.DimWordClusterId, e.DimFundingDecisionId }).HasName("PK__br_word___7D640B5A5E62B00A"); entity.ToTable("br_word_cluster_dim_funding_decision"); @@ -312,7 +316,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) modelBuilder.Entity(entity => { - entity.HasKey(e => new { e.DimMinedWordsId, e.DimWordClusterId }).HasName("PK__br_words__0602FA37415A3F94"); + entity.HasKey(e => new { e.DimMinedWordsId, e.DimWordClusterId }).HasName("PK__br_words__0602FA3764B3A969"); entity.ToTable("br_words_define_a_cluster"); @@ -345,7 +349,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) modelBuilder.Entity(entity => { - entity.HasKey(e => e.Id).HasName("PK__dim_affi__3213E83F9011D88A"); + entity.HasKey(e => e.Id).HasName("PK__dim_affi__3213E83F7DEB115E"); entity.ToTable("dim_affiliation"); @@ -420,6 +424,44 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) .HasConstraintName("FKdim_affili706343"); }); + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.Id).HasName("PK__dim_call__3213E83FB16D620B"); + + entity.ToTable("dim_call_decisions", tb => tb.HasComment("Rahoituspäätöspaneeli")); + + entity.Property(e => e.Id).HasColumnName("id"); + entity.Property(e => e.CallProcessingPhase) + .IsRequired() + .HasMaxLength(255) + .HasComment("Rahoituspäätöspaneeli - Haun vaihe") + .HasColumnName("call_processing_phase"); + entity.Property(e => e.DecisionMaker).HasColumnName("decision_maker"); + entity.Property(e => e.DimCallProgrammeId).HasColumnName("dim_call_programme_id"); + entity.Property(e => e.DimDateIdApproval).HasColumnName("dim_date_id_approval"); + entity.Property(e => e.SourceDescription) + .HasMaxLength(255) + .HasColumnName("source_description"); + entity.Property(e => e.SourceId) + .HasMaxLength(255) + .HasColumnName("source_id"); + + entity.HasOne(d => d.DecisionMakerNavigation).WithMany(p => p.DimCallDecisions) + .HasForeignKey(d => d.DecisionMaker) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("decision_maker"); + + entity.HasOne(d => d.DimCallProgramme).WithMany(p => p.DimCallDecisions) + .HasForeignKey(d => d.DimCallProgrammeId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FKdim_call_d831756"); + + entity.HasOne(d => d.DimDateIdApprovalNavigation).WithMany(p => p.DimCallDecisions) + .HasForeignKey(d => d.DimDateIdApproval) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FKdim_call_d543999"); + }); + modelBuilder.Entity(entity => { entity.HasKey(e => e.Id).HasName("PK__dim_call__3213E83FDE9183B2"); @@ -461,6 +503,9 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) .HasMaxLength(511) .HasColumnName("eu_call_id"); entity.Property(e => e.IsOpenCall).HasColumnName("is_open_call"); + entity.Property(e => e.LocalIdentifier) + .HasMaxLength(255) + .HasColumnName("local_identifier"); entity.Property(e => e.Modified) .HasColumnType("datetime") .HasColumnName("modified"); @@ -486,6 +531,11 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) entity.Property(e => e.SourceProgrammeId) .HasMaxLength(55) .HasColumnName("source_programme_id"); + entity.Property(e => e.TypeOfFunding).HasColumnName("type_of_funding"); + + entity.HasOne(d => d.DimCallProgrammeNavigation).WithMany(p => p.InverseDimCallProgrammeNavigation) + .HasForeignKey(d => d.DimCallProgrammeId) + .HasConstraintName("parent_programme"); entity.HasOne(d => d.DimDateIdDueNavigation).WithMany(p => p.DimCallProgrammeDimDateIdDueNavigations) .HasForeignKey(d => d.DimDateIdDue) @@ -502,6 +552,10 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FKdim_call_p102028"); + entity.HasOne(d => d.TypeOfFundingNavigation).WithMany(p => p.DimCallProgrammesNavigation) + .HasForeignKey(d => d.TypeOfFunding) + .HasConstraintName("type_of_funding"); + entity.HasMany(d => d.DimCallProgrammeId2s).WithMany(p => p.DimCallProgrammes) .UsingEntity>( "BrCallProgrammeDimCallProgramme", @@ -515,7 +569,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) .HasConstraintName("belongs to / a part of "), j => { - j.HasKey("DimCallProgrammeId", "DimCallProgrammeId2").HasName("PK__br_call___6F0CEDFBC6832712"); + j.HasKey("DimCallProgrammeId", "DimCallProgrammeId2").HasName("PK__br_call___6F0CEDFB5015157E"); j.ToTable("br_call_programme_dim_call_programme"); j.IndexerProperty("DimCallProgrammeId").HasColumnName("dim_call_programme_id"); j.IndexerProperty("DimCallProgrammeId2").HasColumnName("dim_call_programme_id2"); @@ -534,7 +588,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) .HasConstraintName("FKbr_call_pr785575"), j => { - j.HasKey("DimCallProgrammeId", "DimCallProgrammeId2").HasName("PK__br_call___6F0CEDFBC6832712"); + j.HasKey("DimCallProgrammeId", "DimCallProgrammeId2").HasName("PK__br_call___6F0CEDFB5015157E"); j.ToTable("br_call_programme_dim_call_programme"); j.IndexerProperty("DimCallProgrammeId").HasColumnName("dim_call_programme_id"); j.IndexerProperty("DimCallProgrammeId2").HasColumnName("dim_call_programme_id2"); @@ -553,7 +607,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) .HasConstraintName("has disciplines"), j => { - j.HasKey("DimCallProgrammeId", "DimReferencedataId").HasName("PK__br_dim_r__0A5B885D68D6B6BA"); + j.HasKey("DimCallProgrammeId", "DimReferencedataId").HasName("PK__br_dim_r__0A5B885D83666CD7"); j.ToTable("br_dim_referencedata_dim_call_programme"); j.IndexerProperty("DimCallProgrammeId").HasColumnName("dim_call_programme_id"); j.IndexerProperty("DimReferencedataId").HasColumnName("dim_referencedata_id"); @@ -562,7 +616,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) modelBuilder.Entity(entity => { - entity.HasKey(e => e.Id).HasName("PK__dim_comp__3213E83F85F9CED1"); + entity.HasKey(e => e.Id).HasName("PK__dim_comp__3213E83FEA6521F9"); entity.ToTable("dim_competence"); @@ -616,7 +670,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) modelBuilder.Entity(entity => { - entity.HasKey(e => e.Id).HasName("PK__dim_date__3213E83F0F9EEE9B"); + entity.HasKey(e => e.Id).HasName("PK__dim_date__3213E83FF7758659"); entity.ToTable("dim_date"); @@ -641,7 +695,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) modelBuilder.Entity(entity => { - entity.HasKey(e => e.Id).HasName("PK__dim_educ__3213E83F3BD34AC9"); + entity.HasKey(e => e.Id).HasName("PK__dim_educ__3213E83FFA11058E"); entity.ToTable("dim_education"); @@ -724,7 +778,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) modelBuilder.Entity(entity => { - entity.HasKey(e => e.Id).HasName("PK__dim_emai__3213E83FDC54F493"); + entity.HasKey(e => e.Id).HasName("PK__dim_emai__3213E83F5BD32CCC"); entity.ToTable("dim_email_addrress"); @@ -761,7 +815,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) modelBuilder.Entity(entity => { - entity.HasKey(e => e.Id).HasName("PK__dim_esfr__3213E83F8D84F8F3"); + entity.HasKey(e => e.Id).HasName("PK__dim_esfr__3213E83F964D9FB3"); entity.ToTable("dim_esfri"); @@ -805,7 +859,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) .HasConstraintName("FKbr_esfri_d559740"), j => { - j.HasKey("DimEsfriId", "DimInfrastructureId").HasName("PK__br_esfri__A4A0FE10AD4EF08B"); + j.HasKey("DimEsfriId", "DimInfrastructureId").HasName("PK__br_esfri__A4A0FE10126205BF"); j.ToTable("br_esfri_dim_infrastructure"); j.IndexerProperty("DimEsfriId").HasColumnName("dim_esfri_id"); j.IndexerProperty("DimInfrastructureId").HasColumnName("dim_infrastructure_id"); @@ -814,7 +868,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) modelBuilder.Entity(entity => { - entity.HasKey(e => e.Id).HasName("PK__dim_even__3213E83FC39C8614"); + entity.HasKey(e => e.Id).HasName("PK__dim_even__3213E83FD6AB45F1"); entity.ToTable("dim_event"); @@ -872,7 +926,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) modelBuilder.Entity(entity => { - entity.HasKey(e => e.Id).HasName("PK__dim_exte__3213E83F97A37F9B"); + entity.HasKey(e => e.Id).HasName("PK__dim_exte__3213E83FA5F19939"); entity.ToTable("dim_external_service"); @@ -907,7 +961,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) modelBuilder.Entity(entity => { - entity.HasKey(e => e.Id).HasName("PK__dim_fiel__3213E83F5AE2342B"); + entity.HasKey(e => e.Id).HasName("PK__dim_fiel__3213E83F1CBB809F"); entity.ToTable("dim_field_display_settings"); @@ -947,7 +1001,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) .HasConstraintName("FKbr_field_d783303"), j => { - j.HasKey("DimFieldDisplaySettingsId", "DimRegisteredDataSourceId").HasName("PK__br_field__6148A772D0543F96"); + j.HasKey("DimFieldDisplaySettingsId", "DimRegisteredDataSourceId").HasName("PK__br_field__6148A772218EDB43"); j.ToTable("br_field_display_settings_dim_registered_data_source"); j.IndexerProperty("DimFieldDisplaySettingsId").HasColumnName("dim_field_display_settings_id"); j.IndexerProperty("DimRegisteredDataSourceId").HasColumnName("dim_registered_data_source_id"); @@ -956,7 +1010,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) modelBuilder.Entity(entity => { - entity.HasKey(e => e.Id).HasName("PK__dim_fund__3213E83FC754B6DF"); + entity.HasKey(e => e.Id).HasName("PK__dim_fund__3213E83F596BB2A4"); entity.ToTable("dim_funding_decision"); @@ -977,6 +1031,9 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) entity.Property(e => e.DescriptionEn).HasColumnName("description_en"); entity.Property(e => e.DescriptionFi).HasColumnName("description_fi"); entity.Property(e => e.DescriptionSv).HasColumnName("description_sv"); + entity.Property(e => e.DimCallDecisionsId) + .HasComment("Rahoituspäätös - Päätöspaneeli") + .HasColumnName("dim_call_decisions_id"); entity.Property(e => e.DimCallProgrammeId).HasColumnName("dim_call_programme_id"); entity.Property(e => e.DimDateIdApproval).HasColumnName("dim_date_id_approval"); entity.Property(e => e.DimDateIdEnd).HasColumnName("dim_date_id_end"); @@ -992,6 +1049,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) entity.Property(e => e.DimTypeOfFundingId).HasColumnName("dim_type_of_funding_id"); entity.Property(e => e.FunderProjectNumber) .HasMaxLength(255) + .HasComment("Päätöksen paikallinen tunniste (tiedon toimittajan)") .HasColumnName("funder_project_number"); entity.Property(e => e.FundingDecisionCurrencyAbbreviation) .HasMaxLength(255) @@ -1013,6 +1071,10 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) .HasMaxLength(255) .HasColumnName("source_id"); + entity.HasOne(d => d.DimCallDecisions).WithMany(p => p.DimFundingDecisions) + .HasForeignKey(d => d.DimCallDecisionsId) + .HasConstraintName("FKdim_fundin257658"); + entity.HasOne(d => d.DimCallProgramme).WithMany(p => p.DimFundingDecisions) .HasForeignKey(d => d.DimCallProgrammeId) .OnDelete(DeleteBehavior.ClientSetNull) @@ -1063,25 +1125,6 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) .HasConstraintName("FKdim_fundin974924"); entity.HasMany(d => d.DimFundingDecisionFroms).WithMany(p => p.DimFundingDecisionTos) - .UsingEntity>( - "BrPreviousFundingDecision", - r => r.HasOne().WithMany() - .HasForeignKey("DimFundingDecisionFromId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FKbr_previou481541"), - l => l.HasOne().WithMany() - .HasForeignKey("DimFundingDecisionToId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FKbr_previou440746"), - j => - { - j.HasKey("DimFundingDecisionFromId", "DimFundingDecisionToId").HasName("PK__br_previ__90966491D900CFFE"); - j.ToTable("br_previous_funding_decision"); - j.IndexerProperty("DimFundingDecisionFromId").HasColumnName("dim_funding_decision_from_id"); - j.IndexerProperty("DimFundingDecisionToId").HasColumnName("dim_funding_decision_to_id"); - }); - - entity.HasMany(d => d.DimFundingDecisionFromsNavigation).WithMany(p => p.DimFundingDecisionTosNavigation) .UsingEntity>( "BrRelatedFundingDecision", r => r.HasOne().WithMany() @@ -1094,32 +1137,13 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) .HasConstraintName("FKbr_related689923"), j => { - j.HasKey("DimFundingDecisionFromId", "DimFundingDecisionToId").HasName("PK__br_relat__90966491B1C830A1"); + j.HasKey("DimFundingDecisionFromId", "DimFundingDecisionToId").HasName("PK__br_relat__9096649104D73DC8"); j.ToTable("br_related_funding_decision"); j.IndexerProperty("DimFundingDecisionFromId").HasColumnName("dim_funding_decision_from_id"); j.IndexerProperty("DimFundingDecisionToId").HasColumnName("dim_funding_decision_to_id"); }); entity.HasMany(d => d.DimFundingDecisionTos).WithMany(p => p.DimFundingDecisionFroms) - .UsingEntity>( - "BrPreviousFundingDecision", - r => r.HasOne().WithMany() - .HasForeignKey("DimFundingDecisionToId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FKbr_previou440746"), - l => l.HasOne().WithMany() - .HasForeignKey("DimFundingDecisionFromId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FKbr_previou481541"), - j => - { - j.HasKey("DimFundingDecisionFromId", "DimFundingDecisionToId").HasName("PK__br_previ__90966491D900CFFE"); - j.ToTable("br_previous_funding_decision"); - j.IndexerProperty("DimFundingDecisionFromId").HasColumnName("dim_funding_decision_from_id"); - j.IndexerProperty("DimFundingDecisionToId").HasColumnName("dim_funding_decision_to_id"); - }); - - entity.HasMany(d => d.DimFundingDecisionTosNavigation).WithMany(p => p.DimFundingDecisionFromsNavigation) .UsingEntity>( "BrRelatedFundingDecision", r => r.HasOne().WithMany() @@ -1132,7 +1156,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) .HasConstraintName("FKbr_related232364"), j => { - j.HasKey("DimFundingDecisionFromId", "DimFundingDecisionToId").HasName("PK__br_relat__90966491B1C830A1"); + j.HasKey("DimFundingDecisionFromId", "DimFundingDecisionToId").HasName("PK__br_relat__9096649104D73DC8"); j.ToTable("br_related_funding_decision"); j.IndexerProperty("DimFundingDecisionFromId").HasColumnName("dim_funding_decision_from_id"); j.IndexerProperty("DimFundingDecisionToId").HasColumnName("dim_funding_decision_to_id"); @@ -1141,7 +1165,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) modelBuilder.Entity(entity => { - entity.HasKey(e => e.Id).HasName("PK__dim_geo__3213E83F9D80A8EC"); + entity.HasKey(e => e.Id).HasName("PK__dim_geo__3213E83FFDC67874"); entity.ToTable("dim_geo"); @@ -1198,7 +1222,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) modelBuilder.Entity(entity => { - entity.HasKey(e => e.Id).HasName("PK__dim_iden__3213E83FF2F29E53"); + entity.HasKey(e => e.Id).HasName("PK__dim_iden__3213E83FF0204B2F"); entity.ToTable("dim_identifierless_data"); @@ -1241,7 +1265,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) modelBuilder.Entity(entity => { - entity.HasKey(e => e.Id).HasName("PK__dim_infr__3213E83F38361AD9"); + entity.HasKey(e => e.Id).HasName("PK__dim_infr__3213E83F84EC5805"); entity.ToTable("dim_infrastructure"); @@ -1316,7 +1340,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) modelBuilder.Entity(entity => { - entity.HasKey(e => e.Id).HasName("PK__dim_keyw__3213E83F905274A0"); + entity.HasKey(e => e.Id).HasName("PK__dim_keyw__3213E83F3CAEC1CE"); entity.ToTable("dim_keyword"); @@ -1385,7 +1409,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) .HasConstraintName("FKbr_keyword224605"), j => { - j.HasKey("DimKeywordId", "DimFundingDecisionId").HasName("PK__br_keywo__8C7B929BDDE68A36"); + j.HasKey("DimKeywordId", "DimFundingDecisionId").HasName("PK__br_keywo__8C7B929B401EFE92"); j.ToTable("br_keyword_dim_funding_decision"); j.IndexerProperty("DimKeywordId").HasColumnName("dim_keyword_id"); j.IndexerProperty("DimFundingDecisionId").HasColumnName("dim_funding_decision_id"); @@ -1404,7 +1428,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) .HasConstraintName("FKbr_keyword944303"), j => { - j.HasKey("DimKeywordId", "DimPublicationId").HasName("PK__br_keywo__C6E31F1AB85BCEDC"); + j.HasKey("DimKeywordId", "DimPublicationId").HasName("PK__br_keywo__C6E31F1AE2618054"); j.ToTable("br_keyword_dim_publication"); j.IndexerProperty("DimKeywordId").HasColumnName("dim_keyword_id"); j.IndexerProperty("DimPublicationId").HasColumnName("dim_publication_id"); @@ -1413,7 +1437,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) modelBuilder.Entity(entity => { - entity.HasKey(e => e.Id).HasName("PK__dim_know__3213E83F26294537"); + entity.HasKey(e => e.Id).HasName("PK__dim_know__3213E83FCE1400D0"); entity.ToTable("dim_known_person"); @@ -1443,7 +1467,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) modelBuilder.Entity(entity => { - entity.HasKey(e => e.Id).HasName("PK__dim_loca__3213E83FDE0D8522"); + entity.HasKey(e => e.Id).HasName("PK__dim_loca__3213E83F124B025F"); entity.ToTable("dim_locally_reported_pub_info"); @@ -1491,7 +1515,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) modelBuilder.Entity(entity => { - entity.HasKey(e => e.Id).HasName("PK__dim_meri__3213E83F92CBC137"); + entity.HasKey(e => e.Id).HasName("PK__dim_meri__3213E83FC68A7B75"); entity.ToTable("dim_meril"); @@ -1535,7 +1559,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) .HasConstraintName("FKbr_meril_d209645"), j => { - j.HasKey("DimMerilId", "DimInfrastructureId").HasName("PK__br_meril__A30C54DA7B91A1D5"); + j.HasKey("DimMerilId", "DimInfrastructureId").HasName("PK__br_meril__A30C54DA34550CD7"); j.ToTable("br_meril_dim_infrastructure"); j.IndexerProperty("DimMerilId").HasColumnName("dim_meril_id"); j.IndexerProperty("DimInfrastructureId").HasColumnName("dim_infrastructure_id"); @@ -1544,7 +1568,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) modelBuilder.Entity(entity => { - entity.HasKey(e => e.Id).HasName("PK__dim_mine__3213E83F8491DEAF"); + entity.HasKey(e => e.Id).HasName("PK__dim_mine__3213E83F539A3F76"); entity.ToTable("dim_mined_words"); @@ -1570,7 +1594,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) modelBuilder.Entity(entity => { - entity.HasKey(e => e.Id).HasName("PK__dim_name__3213E83FC80A36F5"); + entity.HasKey(e => e.Id).HasName("PK__dim_name__3213E83F6AE06464"); entity.ToTable("dim_name"); @@ -1616,7 +1640,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) modelBuilder.Entity(entity => { - entity.HasKey(e => e.Id).HasName("PK__dim_news__3213E83F6D1EDCA0"); + entity.HasKey(e => e.Id).HasName("PK__dim_news__3213E83F17453C72"); entity.ToTable("dim_news_feed"); @@ -1644,7 +1668,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) modelBuilder.Entity(entity => { - entity.HasKey(e => new { e.Id, e.DimNewsFeedid }).HasName("PK__dim_news__B87E67033A02175D"); + entity.HasKey(e => new { e.Id, e.DimNewsFeedid }).HasName("PK__dim_news__B87E6703F694E230"); entity.ToTable("dim_news_item"); @@ -1715,7 +1739,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) modelBuilder.Entity(entity => { - entity.HasKey(e => e.Id).HasName("PK__dim_orga__3213E83F0A5DC644"); + entity.HasKey(e => e.Id).HasName("PK__dim_orga__3213E83FABBF66DF"); entity.ToTable("dim_organization"); @@ -1812,7 +1836,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) .HasConstraintName("FKbr_organiz621686"), j => { - j.HasKey("DimOrganizationid", "DimCallProgrammeid").HasName("PK__br_organ__10F219BC2EED0BF5"); + j.HasKey("DimOrganizationid", "DimCallProgrammeid").HasName("PK__br_organ__10F219BC30DDBF4A"); j.ToTable("br_organizations_fund_call_programmes"); j.IndexerProperty("DimOrganizationid").HasColumnName("dim_organizationid"); j.IndexerProperty("DimCallProgrammeid").HasColumnName("dim_call_programmeid"); @@ -1831,7 +1855,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) .HasConstraintName("FKbr_predece849307"), j => { - j.HasKey("DimOrganizationid", "DimOrganizationid2").HasName("PK__br_prede__A7CAD2F4A2C83C5C"); + j.HasKey("DimOrganizationid", "DimOrganizationid2").HasName("PK__br_prede__A7CAD2F4EA84B358"); j.ToTable("br_predecessor_organization"); j.IndexerProperty("DimOrganizationid").HasColumnName("dim_organizationid"); j.IndexerProperty("DimOrganizationid2").HasColumnName("dim_organizationid2"); @@ -1850,7 +1874,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) .HasConstraintName("FKbr_success452227"), j => { - j.HasKey("DimOrganizationid", "DimOrganizationid2").HasName("PK__br_succe__A7CAD2F4250F4028"); + j.HasKey("DimOrganizationid", "DimOrganizationid2").HasName("PK__br_succe__A7CAD2F4F6AAE1F2"); j.ToTable("br_successor organization"); j.IndexerProperty("DimOrganizationid").HasColumnName("dim_organizationid"); j.IndexerProperty("DimOrganizationid2").HasColumnName("dim_organizationid2"); @@ -1869,7 +1893,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) .HasConstraintName("FKbr_predece505451"), j => { - j.HasKey("DimOrganizationid", "DimOrganizationid2").HasName("PK__br_prede__A7CAD2F4A2C83C5C"); + j.HasKey("DimOrganizationid", "DimOrganizationid2").HasName("PK__br_prede__A7CAD2F4EA84B358"); j.ToTable("br_predecessor_organization"); j.IndexerProperty("DimOrganizationid").HasColumnName("dim_organizationid"); j.IndexerProperty("DimOrganizationid2").HasColumnName("dim_organizationid2"); @@ -1888,7 +1912,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) .HasConstraintName("FKbr_success902531"), j => { - j.HasKey("DimOrganizationid", "DimOrganizationid2").HasName("PK__br_succe__A7CAD2F4250F4028"); + j.HasKey("DimOrganizationid", "DimOrganizationid2").HasName("PK__br_succe__A7CAD2F4F6AAE1F2"); j.ToTable("br_successor organization"); j.IndexerProperty("DimOrganizationid").HasColumnName("dim_organizationid"); j.IndexerProperty("DimOrganizationid2").HasColumnName("dim_organizationid2"); @@ -1897,7 +1921,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) modelBuilder.Entity(entity => { - entity.HasKey(e => e.Id).HasName("PK__dim_pid__3213E83F48C4B8B9"); + entity.HasKey(e => e.Id).HasName("PK__dim_pid__3213E83F97EDB624"); entity.ToTable("dim_pid"); @@ -1916,8 +1940,10 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) entity.Property(e => e.DimPublicationChannelId).HasColumnName("dim_publication_channel_id"); entity.Property(e => e.DimPublicationId).HasColumnName("dim_publication_id"); entity.Property(e => e.DimResearchActivityId).HasColumnName("dim_research_activity_id"); + entity.Property(e => e.DimResearchCommunityId).HasColumnName("dim_research_community_id"); entity.Property(e => e.DimResearchDataCatalogId).HasColumnName("dim_research_data_catalog_id"); entity.Property(e => e.DimResearchDatasetId).HasColumnName("dim_research_dataset_id"); + entity.Property(e => e.DimResearchProjectId).HasColumnName("dim_research_project_id"); entity.Property(e => e.DimServiceId).HasColumnName("dim_service_id"); entity.Property(e => e.Modified) .HasColumnType("datetime") @@ -1943,11 +1969,6 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("event_identifier"); - entity.HasOne(d => d.DimFundingDecision).WithMany(p => p.DimPids) - .HasForeignKey(d => d.DimFundingDecisionId) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("ROI/RAID"); - entity.HasOne(d => d.DimInfrastructure).WithMany(p => p.DimPids) .HasForeignKey(d => d.DimInfrastructureId) .OnDelete(DeleteBehavior.ClientSetNull) @@ -1991,6 +2012,10 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FKdim_pid725718"); + entity.HasOne(d => d.DimResearchCommunity).WithMany(p => p.DimPids) + .HasForeignKey(d => d.DimResearchCommunityId) + .HasConstraintName("FKdim_pid146045"); + entity.HasOne(d => d.DimResearchDataCatalog).WithMany(p => p.DimPids) .HasForeignKey(d => d.DimResearchDataCatalogId) .OnDelete(DeleteBehavior.ClientSetNull) @@ -2009,7 +2034,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) modelBuilder.Entity(entity => { - entity.HasKey(e => e.Id).HasName("PK__dim_prof__3213E83F6EC868AD"); + entity.HasKey(e => e.Id).HasName("PK__dim_prof__3213E83F1F016EB8"); entity.ToTable("dim_profile_only_dataset"); @@ -2070,7 +2095,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) modelBuilder.Entity(entity => { - entity.HasKey(e => e.Id).HasName("PK__dim_prof__3213E83F4D563766"); + entity.HasKey(e => e.Id).HasName("PK__dim_prof__3213E83F3081C35E"); entity.ToTable("dim_profile_only_funding_decision"); @@ -2167,7 +2192,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) modelBuilder.Entity(entity => { - entity.HasKey(e => e.Id).HasName("PK__dim_prof__3213E83F5E2E5959"); + entity.HasKey(e => e.Id).HasName("PK__dim_prof__3213E83F6ECFF3A0"); entity.ToTable("dim_profile_only_publication"); @@ -2323,7 +2348,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) modelBuilder.Entity(entity => { - entity.HasKey(e => e.Id).HasName("PK__dim_prof__3213E83F1D126489"); + entity.HasKey(e => e.Id).HasName("PK__dim_prof__3213E83F5985ACF9"); entity.ToTable("dim_profile_only_research_activity"); @@ -2404,7 +2429,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) modelBuilder.Entity(entity => { - entity.HasKey(e => e.Id).HasName("PK__dim_publ__3213E83F6F582014"); + entity.HasKey(e => e.Id).HasName("PK__dim_publ__3213E83F309A7322"); entity.ToTable("dim_publication"); @@ -2606,7 +2631,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) .HasConstraintName("FKbr_artpubl464312"), j => { - j.HasKey("DimPublicationId", "DimReferencedataid").HasName("PK__br_artpu__879F18F32779168B"); + j.HasKey("DimPublicationId", "DimReferencedataid").HasName("PK__br_artpu__879F18F3F0415DE8"); j.ToTable("br_artpublication_typecategory"); j.IndexerProperty("DimPublicationId").HasColumnName("dim_publication_id"); j.IndexerProperty("DimReferencedataid").HasColumnName("dim_referencedataid"); @@ -2615,7 +2640,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) modelBuilder.Entity(entity => { - entity.HasKey(e => e.Id).HasName("PK__dim_publ__3213E83F83D56CBF"); + entity.HasKey(e => e.Id).HasName("PK__dim_publ__3213E83F7A766D9E"); entity.ToTable("dim_publication_channel"); @@ -2646,7 +2671,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) modelBuilder.Entity(entity => { - entity.HasKey(e => e.Id).HasName("PK__dim_purp__3213E83F6812F925"); + entity.HasKey(e => e.Id).HasName("PK__dim_purp__3213E83F6740EBE5"); entity.ToTable("dim_purpose"); @@ -2689,7 +2714,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) modelBuilder.Entity(entity => { - entity.HasKey(e => e.Id).HasName("PK__dim_refe__3213E83FF73B4B9A"); + entity.HasKey(e => e.Id).HasName("PK__dim_refe__3213E83F0BE1626E"); entity.ToTable("dim_referencedata"); @@ -2751,7 +2776,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) .HasConstraintName("FKfact_dim_r130466"), j => { - j.HasKey("DimReferencedataId", "DimPublicationId").HasName("PK__fact_dim__FD761943629A8020"); + j.HasKey("DimReferencedataId", "DimPublicationId").HasName("PK__fact_dim__62A1BBCB5E218756"); j.ToTable("fact_dim_referencedata_field_of_art"); j.IndexerProperty("DimReferencedataId").HasColumnName("dim_referencedata_id"); j.IndexerProperty("DimPublicationId").HasColumnName("dim_publication_id"); @@ -2760,7 +2785,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) modelBuilder.Entity(entity => { - entity.HasKey(e => e.Id).HasName("PK__dim_regi__3213E83F93AC9CC7"); + entity.HasKey(e => e.Id).HasName("PK__dim_regi__3213E83F38A3B74C"); entity.ToTable("dim_registered_data_source"); @@ -2792,7 +2817,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) modelBuilder.Entity(entity => { - entity.HasKey(e => e.Id).HasName("PK__dim_rese__3213E83F2B377137"); + entity.HasKey(e => e.Id).HasName("PK__dim_rese__3213E83F6B3D21A8"); entity.ToTable("dim_research_activity"); @@ -2876,7 +2901,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) modelBuilder.Entity(entity => { - entity.HasKey(e => new { e.DimResearchActivityId, e.DimKeywordId }).HasName("PK__dim_rese__F7B536BCFC302E4A"); + entity.HasKey(e => new { e.DimResearchActivityId, e.DimKeywordId }).HasName("PK__dim_rese__F7B536BC01C0FBC8"); entity.ToTable("dim_research_activity_dim_keyword"); @@ -2891,7 +2916,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) modelBuilder.Entity(entity => { - entity.HasKey(e => e.Id).HasName("PK__dim_rese__3213E83F359DF386"); + entity.HasKey(e => e.Id).HasName("PK__dim_rese__3213E83FB23F2789"); entity.ToTable("dim_research_community"); @@ -2938,7 +2963,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) modelBuilder.Entity(entity => { - entity.HasKey(e => e.Id).HasName("PK__dim_rese__3213E83F050D7511"); + entity.HasKey(e => e.Id).HasName("PK__dim_rese__3213E83F94279D68"); entity.ToTable("dim_research_data_catalog"); @@ -2978,7 +3003,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) modelBuilder.Entity(entity => { - entity.HasKey(e => e.Id).HasName("PK__dim_rese__3213E83F16C07662"); + entity.HasKey(e => e.Id).HasName("PK__dim_rese__3213E83FC3A6A760"); entity.ToTable("dim_research_dataset"); @@ -3069,7 +3094,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) .HasConstraintName("dataset-keywords"), j => { - j.HasKey("DimResearchDatasetId", "DimKeywordId").HasName("PK__br_resea__4D226DF251ADDB75"); + j.HasKey("DimResearchDatasetId", "DimKeywordId").HasName("PK__br_resea__4D226DF2C0F4BDF4"); j.ToTable("br_research_dataset_dim_keyword"); j.IndexerProperty("DimResearchDatasetId").HasColumnName("dim_research_dataset_id"); j.IndexerProperty("DimKeywordId").HasColumnName("dim_keyword_id"); @@ -3088,16 +3113,107 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) .HasConstraintName("FKbr_languag34243"), j => { - j.HasKey("DimResearchDatasetId", "DimReferencedataId").HasName("PK__br_langu__576647BF5ACF45EF"); + j.HasKey("DimResearchDatasetId", "DimReferencedataId").HasName("PK__br_langu__576647BF545F7D83"); j.ToTable("br_language_codes_for_datasets"); j.IndexerProperty("DimResearchDatasetId").HasColumnName("dim_research_dataset_id"); j.IndexerProperty("DimReferencedataId").HasColumnName("dim_referencedata_id"); }); }); + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.Id).HasName("PK__dim_rese__3213E83F5C6DA9A0"); + + entity.ToTable("dim_research_project"); + + entity.Property(e => e.Id).HasColumnName("id"); + entity.Property(e => e.AbbrevationEn) + .HasMaxLength(4000) + .HasColumnName("abbrevation_en"); + entity.Property(e => e.AbbrevationFi) + .HasMaxLength(4000) + .HasComment("Hanke - lyhenne") + .HasColumnName("abbrevation_fi"); + entity.Property(e => e.AbbrevationSv) + .HasMaxLength(4000) + .HasColumnName("abbrevation_sv"); + entity.Property(e => e.AdditionalInformationEn).HasColumnName("additional_information_en"); + entity.Property(e => e.AdditionalInfromationFi) + .HasComment("Hanke - lisätieto") + .HasColumnName("additional_infromation_fi"); + entity.Property(e => e.AddtitionalInformationSv).HasColumnName("addtitional_information_sv"); + entity.Property(e => e.Created) + .HasColumnType("datetime") + .HasColumnName("created"); + entity.Property(e => e.DimRegisteredDataSourceId).HasColumnName("dim_registered_data_source_id"); + entity.Property(e => e.EndDate) + .HasComment("Hanke - päättymispäivämäärä") + .HasColumnName("end_date"); + entity.Property(e => e.GoalsEn).HasColumnName("goals_en"); + entity.Property(e => e.GoalsFi).HasColumnName("goals_fi"); + entity.Property(e => e.GoalsSv).HasColumnName("goals_sv"); + entity.Property(e => e.Modified) + .HasColumnType("datetime") + .HasColumnName("modified"); + entity.Property(e => e.NameEn) + .HasMaxLength(4000) + .HasColumnName("name_en"); + entity.Property(e => e.NameFi) + .HasMaxLength(4000) + .HasComment("Hanke - nimi") + .HasColumnName("name_fi"); + entity.Property(e => e.NameSv) + .HasMaxLength(4000) + .HasColumnName("name_sv"); + entity.Property(e => e.OutcomeEffectEn).HasColumnName("outcome_effect_en"); + entity.Property(e => e.OutcomeEffectFi).HasColumnName("outcome_effect_fi"); + entity.Property(e => e.OutcomeEffectSv).HasColumnName("outcome_effect_sv"); + entity.Property(e => e.ResponsibleOrganization) + .HasComment("Hanke - vastuuorganisaatio") + .HasColumnName("responsible_organization"); + entity.Property(e => e.ResponsiblePerson).HasColumnName("responsible_person"); + entity.Property(e => e.SourceDescription) + .HasMaxLength(255) + .HasColumnName("source_description"); + entity.Property(e => e.SourceId) + .IsRequired() + .HasMaxLength(255) + .HasColumnName("source_id"); + entity.Property(e => e.StartDate) + .HasComment("Hanke - alkamispäivämäärä") + .HasColumnName("start_date"); + entity.Property(e => e.SummaryEn).HasColumnName("summary_en"); + entity.Property(e => e.SummaryFi) + .HasComment("Hanke - tiivistelmä") + .HasColumnName("summary_fi"); + entity.Property(e => e.SummarySv).HasColumnName("summary_sv"); + + entity.HasOne(d => d.DimRegisteredDataSource).WithMany(p => p.DimResearchProjects) + .HasForeignKey(d => d.DimRegisteredDataSourceId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FKdim_resear450820"); + + entity.HasOne(d => d.EndDateNavigation).WithMany(p => p.DimResearchProjectEndDateNavigations) + .HasForeignKey(d => d.EndDate) + .HasConstraintName("FKdim_resear517343"); + + entity.HasOne(d => d.ResponsibleOrganizationNavigation).WithMany(p => p.DimResearchProjects) + .HasForeignKey(d => d.ResponsibleOrganization) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FKdim_resear741036"); + + entity.HasOne(d => d.ResponsiblePersonNavigation).WithMany(p => p.DimResearchProjects) + .HasForeignKey(d => d.ResponsiblePerson) + .HasConstraintName("FKdim_resear684392"); + + entity.HasOne(d => d.StartDateNavigation).WithMany(p => p.DimResearchProjectStartDateNavigations) + .HasForeignKey(d => d.StartDate) + .HasConstraintName("FKdim_resear246050"); + }); + modelBuilder.Entity(entity => { - entity.HasKey(e => e.Id).HasName("PK__dim_rese__3213E83FDF70033E"); + entity.HasKey(e => e.Id).HasName("PK__dim_rese__3213E83FAC3BF504"); entity.ToTable("dim_researcher_description"); @@ -3135,7 +3251,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) modelBuilder.Entity(entity => { - entity.HasKey(e => e.Id).HasName("PK__dim_rese__3213E83FD058DBCD"); + entity.HasKey(e => e.Id).HasName("PK__dim_rese__3213E83FBE7413B7"); entity.ToTable("dim_researcher_to_research_community"); @@ -3195,7 +3311,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) modelBuilder.Entity(entity => { - entity.HasKey(e => e.Id).HasName("PK__dim_sect__3213E83FDB797418"); + entity.HasKey(e => e.Id).HasName("PK__dim_sect__3213E83F3DEA99C5"); entity.ToTable("dim_sector"); @@ -3231,7 +3347,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) modelBuilder.Entity(entity => { - entity.HasKey(e => e.Id).HasName("PK__dim_serv__3213E83FB0408291"); + entity.HasKey(e => e.Id).HasName("PK__dim_serv__3213E83F62BD4E06"); entity.ToTable("dim_service"); @@ -3294,7 +3410,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) modelBuilder.Entity(entity => { - entity.HasKey(e => e.Id).HasName("PK__dim_serv__3213E83F11F1C725"); + entity.HasKey(e => e.Id).HasName("PK__dim_serv__3213E83FC1E4BB03"); entity.ToTable("dim_service_point"); @@ -3372,7 +3488,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) modelBuilder.Entity(entity => { - entity.HasKey(e => e.Id).HasName("PK__dim_tele__3213E83F3B6C982D"); + entity.HasKey(e => e.Id).HasName("PK__dim_tele__3213E83F3AF4E25C"); entity.ToTable("dim_telephone_number"); @@ -3409,11 +3525,11 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) modelBuilder.Entity(entity => { - entity.HasKey(e => e.Id).HasName("PK__dim_type__3213E83FA83602FC"); + entity.HasKey(e => e.Id).HasName("PK__dim_type__3213E83FE915777D"); entity.ToTable("dim_type_of_funding"); - entity.HasIndex(e => e.TypeId, "UQ__dim_type__2C00059939053CB5").IsUnique(); + entity.HasIndex(e => e.TypeId, "UQ__dim_type__2C0005995F896FA4").IsUnique(); entity.Property(e => e.Id).HasColumnName("id"); entity.Property(e => e.Created) @@ -3453,7 +3569,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) modelBuilder.Entity(entity => { - entity.HasKey(e => e.Id).HasName("PK__dim_user__3213E83FA023C452"); + entity.HasKey(e => e.Id).HasName("PK__dim_user__3213E83F58B49D9F"); entity.ToTable("dim_user_choices"); @@ -3488,7 +3604,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) modelBuilder.Entity(entity => { - entity.HasKey(e => e.Id).HasName("PK__dim_user__3213E83F53AE6B60"); + entity.HasKey(e => e.Id).HasName("PK__dim_user__3213E83FBA6C8F18"); entity.ToTable("dim_user_profile"); @@ -3517,6 +3633,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) entity.Property(e => e.OrcidTokenScope) .HasMaxLength(255) .HasColumnName("orcid_token_scope"); + entity.Property(e => e.PublishNewOrcidData).HasColumnName("publish_new_orcid_data"); entity.Property(e => e.SourceDescription) .HasMaxLength(255) .HasColumnName("source_description"); @@ -3554,6 +3671,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) entity.Property(e => e.DimResearchCommunityId).HasColumnName("dim_research_community_id"); entity.Property(e => e.DimResearchDataCatalogId).HasColumnName("dim_research_data_catalog_id"); entity.Property(e => e.DimResearchDatasetId).HasColumnName("dim_research_dataset_id"); + entity.Property(e => e.DimResearchProjectId).HasColumnName("dim_research_project_id"); entity.Property(e => e.LanguageVariant) .HasMaxLength(255) .HasColumnName("language_variant"); @@ -3628,7 +3746,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) modelBuilder.Entity(entity => { - entity.HasKey(e => e.Id).HasName("PK__dim_word__3213E83FF69EDF9D"); + entity.HasKey(e => e.Id).HasName("PK__dim_word__3213E83F066D10AA"); entity.ToTable("dim_word_cluster"); @@ -3652,7 +3770,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) modelBuilder.Entity(entity => { - entity.HasKey(e => new { e.DimFundingDecisionId, e.DimOrganizationId, e.DimDateId, e.DimNameId, e.DimPublicationId, e.DimGeoId, e.DimInfrastructureId, e.DimNewsFeedId, e.DimResearchDatasetId, e.DimResearchDataCatalogId, e.DimIdentifierlessDataId, e.DimResearchActivityId, e.DimResearchCommunityId, e.DimReferencedataActorRoleId }).HasName("PK__fact_con__B7D7E1B56B3DE77D"); + entity.HasKey(e => new { e.DimFundingDecisionId, e.DimOrganizationId, e.DimDateId, e.DimNameId, e.DimPublicationId, e.DimGeoId, e.DimInfrastructureId, e.DimNewsFeedId, e.DimResearchDatasetId, e.DimResearchDataCatalogId, e.DimIdentifierlessDataId, e.DimResearchActivityId, e.DimResearchCommunityId, e.DimReferencedataActorRoleId, e.DimResearchProjectId }).HasName("PK__fact_con__7D48570541D92D48"); entity.ToTable("fact_contribution"); @@ -3670,6 +3788,9 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) entity.Property(e => e.DimResearchActivityId).HasColumnName("dim_research_activity_id"); entity.Property(e => e.DimResearchCommunityId).HasColumnName("dim_research_community_id"); entity.Property(e => e.DimReferencedataActorRoleId).HasColumnName("dim_referencedata_actor_role_id"); + entity.Property(e => e.DimResearchProjectId) + .HasDefaultValueSql("('-1')") + .HasColumnName("dim_research_project_id"); entity.Property(e => e.ContributionType) .IsRequired() .HasMaxLength(50) @@ -3761,7 +3882,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) modelBuilder.Entity(entity => { - entity.HasKey(e => new { e.DimReferencedataId, e.DimResearchDatasetId, e.DimKnownPersonId, e.DimPublicationId, e.DimResearchActivityId, e.DimFundingDecisionId, e.DimInfrastructureId }).HasName("PK__fact_dim__3CB15DD3757270A4"); + entity.HasKey(e => new { e.DimReferencedataId, e.DimResearchDatasetId, e.DimKnownPersonId, e.DimPublicationId, e.DimResearchActivityId, e.DimFundingDecisionId, e.DimInfrastructureId }).HasName("PK__fact_dim__3CB15DD3666527D1"); entity.ToTable("fact_dim_referencedata_field_of_science"); @@ -3997,7 +4118,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) modelBuilder.Entity(entity => { - entity.HasKey(e => new { e.DimKeywordId, e.DimServiceId, e.DimServicePointId, e.DimInfrastructureId }).HasName("PK__fact_inf__3C29B6806CAFC072"); + entity.HasKey(e => new { e.DimKeywordId, e.DimServiceId, e.DimServicePointId, e.DimInfrastructureId }).HasName("PK__fact_inf__3C29B68067DAE981"); entity.ToTable("fact_infra_keywords"); @@ -4042,7 +4163,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) modelBuilder.Entity(entity => { - entity.HasKey(e => new { e.DimOrganizationId, e.DimGeoId, e.DimInfrastructureId, e.DimServiceId, e.DimServicePointId, e.DimDateIdStart, e.DimDateIdEnd }).HasName("PK__fact_upk__850A8E30119C2EB4"); + entity.HasKey(e => new { e.DimOrganizationId, e.DimGeoId, e.DimInfrastructureId, e.DimServiceId, e.DimServicePointId, e.DimDateIdStart, e.DimDateIdEnd }).HasName("PK__fact_upk__850A8E300973BCEF"); entity.ToTable("fact_upkeep"); diff --git a/aspnetcore/src/api/Services/UserProfileService.cs b/aspnetcore/src/api/Services/UserProfileService.cs index 0a2ba60..f80b4b9 100644 --- a/aspnetcore/src/api/Services/UserProfileService.cs +++ b/aspnetcore/src/api/Services/UserProfileService.cs @@ -503,6 +503,9 @@ public DimPid GetEmptyDimPid() DimProfileOnlyDatasetId = -1, DimProfileOnlyFundingDecisionId = -1, DimProfileOnlyPublicationId = -1, + DimResearchCommunityId = -1, + DimResearchProjectId = -1, + SourceId = Constants.SourceIdentifiers.PROFILE_API, SourceDescription = Constants.SourceDescriptions.PROFILE_API, Created = _utilityService.GetCurrentDateTime(),