From a35047f2da31457d5b26da0ff82a5d58903b3af7 Mon Sep 17 00:00:00 2001 From: "Collin M. Barrett" Date: Thu, 18 Nov 2021 12:41:48 -0600 Subject: [PATCH] =?UTF-8?q?fix(dir):=20=F0=9F=90=9B=20convention-generated?= =?UTF-8?q?=20constraint=20names?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Persistence/Queries/Entities/Dependent.cs | 6 ++++-- .../Persistence/Queries/Entities/Fork.cs | 6 ++++-- .../Persistence/Queries/Entities/Merge.cs | 6 ++++-- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/Dependent.cs b/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/Dependent.cs index ade15ea57..5954dc79d 100644 --- a/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/Dependent.cs +++ b/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/Dependent.cs @@ -24,10 +24,12 @@ public virtual void Configure(EntityTypeBuilder builder) builder.HasKey(d => new { d.DependencyFilterListId, d.DependentFilterListId }); builder.HasOne(d => d.DependencyFilterList) .WithMany(fl => fl.DependentFilterLists) - .HasForeignKey(d => d.DependencyFilterListId); + .HasForeignKey(d => d.DependencyFilterListId) + .HasConstraintName("fk_dependents_filter_lists_dependency_filter_list_id"); builder.HasOne(d => d.DependentFilterList) .WithMany(fl => fl.DependencyFilterLists) - .HasForeignKey(d => d.DependentFilterListId); + .HasForeignKey(d => d.DependentFilterListId) + .HasConstraintName("fk_dependents_filter_lists_dependent_filter_list_id"); builder.HasDataJsonFile(); } } diff --git a/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/Fork.cs b/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/Fork.cs index 911146162..5ac0181e7 100644 --- a/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/Fork.cs +++ b/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/Fork.cs @@ -24,10 +24,12 @@ public virtual void Configure(EntityTypeBuilder builder) builder.HasKey(f => new { f.UpstreamFilterListId, f.ForkFilterListId }); builder.HasOne(f => f.UpstreamFilterList) .WithMany(fl => fl.ForkFilterLists) - .HasForeignKey(f => f.UpstreamFilterListId); + .HasForeignKey(f => f.UpstreamFilterListId) + .HasConstraintName("fk_forks_filter_lists_upstream_filter_list_id"); builder.HasOne(f => f.ForkFilterList) .WithMany(fl => fl.UpstreamFilterLists) - .HasForeignKey(f => f.ForkFilterListId); + .HasForeignKey(f => f.ForkFilterListId) + .HasConstraintName("fk_forks_filter_lists_fork_filter_list_id"); builder.HasDataJsonFile(); } } diff --git a/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/Merge.cs b/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/Merge.cs index 7bf1491cd..b9af0b802 100644 --- a/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/Merge.cs +++ b/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/Merge.cs @@ -24,10 +24,12 @@ public virtual void Configure(EntityTypeBuilder builder) builder.HasKey(m => new { m.IncludedInFilterListId, m.IncludesFilterListId }); builder.HasOne(m => m.IncludedInFilterList) .WithMany(fl => fl.IncludesFilterLists) - .HasForeignKey(m => m.IncludedInFilterListId); + .HasForeignKey(m => m.IncludedInFilterListId) + .HasConstraintName("fk_merges_filter_lists_included_in_filter_list_id"); builder.HasOne(m => m.IncludesFilterList) .WithMany(fl => fl.IncludedInFilterLists) - .HasForeignKey(m => m.IncludesFilterListId); + .HasForeignKey(m => m.IncludesFilterListId) + .HasConstraintName("fk_merges_filter_lists_includes_filter_list_id"); builder.HasDataJsonFile(); } }