From 0839dffe7844bb1021346eeb85f4c7b68f46a7b2 Mon Sep 17 00:00:00 2001 From: SimpleStation14 Date: Mon, 22 Apr 2024 05:46:53 -0400 Subject: [PATCH] Cherry-picked commit fc76996dc55b19b313b621b2fb9025b9198e4b7d from space-wizards/space-station-14/master --- Content.Server.Database/SnakeCaseNaming.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Content.Server.Database/SnakeCaseNaming.cs b/Content.Server.Database/SnakeCaseNaming.cs index ca1a9665848..27ce392cd50 100644 --- a/Content.Server.Database/SnakeCaseNaming.cs +++ b/Content.Server.Database/SnakeCaseNaming.cs @@ -301,14 +301,14 @@ public void ProcessModelFinalizing(IConventionModelBuilder modelBuilder, IConven private static void RewriteColumnName(IConventionPropertyBuilder propertyBuilder) { var property = propertyBuilder.Metadata; - var entityType = property.DeclaringEntityType; + var entityType = (IConventionEntityType)property.DeclaringType; if (entityType.ClrType == typeof(Microsoft.EntityFrameworkCore.Migrations.HistoryRow)) return; property.Builder.HasNoAnnotation(RelationalAnnotationNames.ColumnName); - var baseColumnName = StoreObjectIdentifier.Create(property.DeclaringEntityType, StoreObjectType.Table) is { } tableIdentifier + var baseColumnName = StoreObjectIdentifier.Create(entityType, StoreObjectType.Table) is { } tableIdentifier ? property.GetDefaultColumnName(tableIdentifier) : property.GetDefaultColumnName();