EfCore.SchemaCompare icon indicating copy to clipboard operation
EfCore.SchemaCompare copied to clipboard

Errors when using JSON columns

Open urielzen opened this issue 2 years ago • 1 comments

Hi, I am using SQL Server, and I have a table with a couple of JSON columns and I get the errors below.

I was wondering if the errors are due to the same limitations found in the README about Version 8 doesn't handle EF Core 8's Value objects

Thank u

builder.Entity<Question>(entity =>
{
    entity
        .ToTable(b => b.IsTemporal())
        .OwnsOne(e => e.QuestionLocked, ownedNavitationBuilder => ownedNavitationBuilder.ToJson())
        .OwnsOne(e => e.ConfigurationInterfaceLocked, ownedNavitationBuilder => ownedNavitationBuilder.ToJson());
});
DIFFERENT: QuestionInterfaceLocked->PrimaryKey '- no primary key -', constraint name. Expected = - no primary key -, found = PK_Questions
NOT IN DATABASE: QuestionInterfaceLocked->ForeignKey 'FK_Questions_Questions_QuestionId', constraint name. Expected = FK_Questions_Questions_QuestionId
DIFFERENT: Entity 'QuestionInterfaceLocked', constraint name. Expected = - no primary key -, found = PK_Questions
DIFFERENT: QuestionLocked->PrimaryKey '- no primary key -', constraint name. Expected = - no primary key -, found = PK_Questions
NOT IN DATABASE: QuestionLocked->ForeignKey 'FK_Questions_Questions_QuestionId', constraint name. Expected = FK_Questions_Questions_QuestionId
DIFFERENT: Entity 'QuestionLocked', constraint name. Expected = - no primary key -, found = PK_Questions
EXTRA IN DATABASE: Table 'Questions', column name. Found = QuestionLocked
EXTRA IN DATABASE: Table 'Questions', column name. Found = ConfigurationInterfaceLocked

urielzen avatar Nov 27 '23 00:11 urielzen

Hi,

I have just released version 8.1.0 which checks Json Mapping, but it has an limitation that the Json Mapping checking assumes you are using the default name for the column, which is the name of the property.

Let me know if this works for you.

JonPSmith avatar Oct 18 '24 08:10 JonPSmith