Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Columns that are extra in db cannot be excluded #18

Open
pm7y opened this issue Apr 13, 2023 · 3 comments
Open

Columns that are extra in db cannot be excluded #18

pm7y opened this issue Apr 13, 2023 · 3 comments

Comments

@pm7y
Copy link

pm7y commented Apr 13, 2023

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

@JonPSmith
Copy link
Owner

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.

@packone
Copy link

packone commented Apr 30, 2024

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!

@JonPSmith
Copy link
Owner

I'm looking some things in EfCore.SchemaCompare and saw this issue. You might find the TablesToIgnoreCommaDelimited property useful.

See the Other configuration options section for more information on this configuration feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants