Skip to content

Commit

Permalink
Cherry-picked commit fc76996 from space-wizards/space-station-14/master
Browse files Browse the repository at this point in the history
  • Loading branch information
SimpleStation14 authored and PJB3005 committed Mar 20, 2024
1 parent 3bf08c7 commit 0839dff
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Content.Server.Database/SnakeCaseNaming.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down

0 comments on commit 0839dff

Please sign in to comment.