JonPSmith / EfCore.SchemaCompare

Library to compare EF Core's Model of the database against a database's schema.
https://www.thereformedprogrammer.net/how-to-update-a-databases-schema-without-using-ef-cores-migrate-feature/
MIT License
133 stars 16 forks source link

Errors when using JSON columns #32

Open urielzen opened 11 months ago

urielzen commented 11 months ago

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
JonPSmith commented 2 weeks ago

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.