{"record":{"id":"fed4a1c1eaea0f83","repo":"dotnet/efcore","slug":"a-seed-entity-for-entity-type-entitytype-has-t-fed4a1","errorCode":null,"errorMessage":"A seed entity for entity type '{entityType}' has the same key value as another seed entity mapped to the same table '{table}', but have different values for the column '{column}'. Consider using 'DbContextOptionsBuilder.EnableSensitiveDataLogging' to see the conflicting values.","messagePattern":"A seed entity for entity type '(.+?)' has the same key value as another seed entity mapped to the same table '(.+?)', but have different values for the column '(.+?)'\\. Consider using 'DbContextOptionsBuilder\\.EnableSensitiveDataLogging' to see the conflicting values\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/EFCore.Relational/Migrations/Internal/MigrationsModelDiffer.cs","lineNumber":2020,"sourceCode":"\n                    var existingColumnModification = command.ColumnModifications.FirstOrDefault(c => c.ColumnName == column.Name);\n                    if (existingColumnModification != null)\n                    {\n                        if (!Equals(NormalizeSeedValue(existingColumnModification.Value), NormalizeSeedValue(value)))\n                        {\n                            if (sensitiveLoggingEnabled)\n                            {\n                                throw new InvalidOperationException(\n                                    RelationalStrings.ConflictingSeedValuesSensitive(\n                                        entityType.DisplayName(),\n                                        BuildValuesString(key),\n                                        table.SchemaQualifiedName,\n                                        existingColumnModification.ColumnName,\n                                        Convert.ToString(existingColumnModification.Value, CultureInfo.InvariantCulture),\n                                        Convert.ToString(value, CultureInfo.InvariantCulture)));\n                            }\n\n                            throw new InvalidOperationException(\n                                RelationalStrings.ConflictingSeedValues(\n                                    entityType.DisplayName(),\n                                    table.SchemaQualifiedName,\n                                    existingColumnModification.ColumnName));\n                        }\n\n                        continue;\n                    }\n\n                    writeValue = writeValue\n                        && initialState != EntityState.Deleted\n                        && property.GetBeforeSaveBehavior() == PropertySaveBehavior.Save;\n\n                    command.AddColumnModification(\n                        new ColumnModificationParameters(\n                            column, originalValue: value, value, property, columnMapping.TypeMapping,\n                            read: false, write: writeValue,\n                            key: property.IsPrimaryKey(), condition: false,","sourceCodeStart":2002,"sourceCodeEnd":2038,"githubUrl":"https://github.com/dotnet/efcore/blob/dbf9771522148d61a2467854921bd5dc6f6e6916/src/EFCore.Relational/Migrations/Internal/MigrationsModelDiffer.cs#L2002-L2038","documentation":"Non-sensitive variant of error 551: two seed entities share a key on a shared table but assign different values to the same column, and because sensitive logging is disabled the values are omitted and the message suggests enabling `EnableSensitiveDataLogging`.","triggerScenarios":"Same as 551 but with `EnableSensitiveDataLogging()` off: colliding seed rows with conflicting column values across shared-table entity types.","commonSituations":"Production logging config; inheritance hierarchies seeding shared columns inconsistently; merged seed data from multiple config sources.","solutions":["Enable `EnableSensitiveDataLogging()` in a dev/staging run to see the conflicting column and values (error 551 message).","Align the conflicting column values across the colliding seed entries.","Consolidate the seed entries or change keys so they no longer collide."],"exampleFix":"// before\noptionsBuilder.UseSqlServer(cs);\n// diagnose\noptionsBuilder.UseSqlServer(cs).EnableSensitiveDataLogging();\n// fix: align the conflicting column value across shared-key seed rows","handlingStrategy":"validation","validationCode":"// Enable sensitive logging in dev to see which column/value conflicts.\nif (env.IsDevelopment()) optionsBuilder.EnableSensitiveDataLogging();\n// Then align the conflicting column values (see 551 validation).","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Turn on `EnableSensitiveDataLogging` during development to expose the conflicting column and values.","Keep seed values consistent across entries sharing a key on a shared table."],"tags":["efcore","migrations","seed-data","model-differ","relational"],"analyzedSha":"dbf9771522148d61a2467854921bd5dc6f6e6916","analyzedAt":"2026-08-06T20:46:03.226Z","schemaVersion":2},"datasetVersion":"2026-08-07T03:17:09.362Z"}