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

Columns that are extra in db cannot be excluded

Open pm7y opened this issue 1 year ago • 2 comments

It seems that columns that are extra in db are not excluded via the IgnoreTheseErrors method

e.g. EXTRA IN DATABASE: Table 'dbo.TheTable', column name. Found = Blah

pm7y avatar Apr 13 '23 06:04 pm7y

Again, I need your EF Core DbContext and entity classes, your SQL Server database structure and the failing EFCore.SchemaCompare output for me to look at this.

JonPSmith avatar Apr 14 '23 07:04 JonPSmith

I had the same problem as @pm7y because all ignore commands worked and removed the log messages except the one mentioned.
I observed that all log messages i got were "build" the same way (perspective by the user of library) except:
EXTRA IN DATABASE: Table '<yourTable>', column name. Found = <yourColumnName>.

It's not like all my other ignore commands where i could directly find the CompareType (with the others ... CompareState, CompareAttributes) value as string inside the log line.

Because of this I originally thought the following is correct:
config.AddIgnoreCompareLog(new CompareLog(CompareType.Table, CompareState.ExtraInDatabase, null, CompareAttributes.ColumnName)); Instead it has to look like this (worked for me): config.AddIgnoreCompareLog(new CompareLog(CompareType.Column, CompareState.ExtraInDatabase, null, CompareAttributes.ColumnName));

After finding this Issue and realizing my (in hindsight obvious) mistake i think the log message should be changed to be more inline with others (or the first ignore command with CompareType.Table valid).

Thanks for your time and effort creating and maintaining this library!

packone avatar Apr 30 '24 18:04 packone