EfCore.SchemaCompare
EfCore.SchemaCompare copied to clipboard
Columns that are extra in db cannot be excluded
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
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.
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!