Closed kjkrum closed 9 months ago
Hi @kjkrum,
I haven't heard from anyone using MYSQL before. Version 8 is the first version of this library and I am glad it worked for you. You even fixed your own problem using exactly the way I would suggested.
I hope EfCore.SchemaCompare helps you in your project.
For the benefit of any other MySQL users who come across this, I narrowed the ignore filters slightly:
compareConfig.AddIgnoreCompareLog(new CompareLog(CompareType.Entity, CompareState.Different, null, CompareAttributes.ConstraintName, null, "PRIMARY"));
compareConfig.AddIgnoreCompareLog(new CompareLog(CompareType.PrimaryKey, CompareState.Different, null, CompareAttributes.ConstraintName, null, "PRIMARY"));
Thanks @kjkrum. That's very useful. I have also updated the issue name so others will find it more easily.
I'm trying EfCore.SchemaCompare for the first time, so this could be me misunderstanding something. But your README.md does suggest you're aware of the potential for this kind of issue.
EfCore.SchemaCompare and all my EF Core packages are version 8.0.1. I'm using Pomelo.EntityFrameworkCore.MySql 8.0.0-beta.2 and MySQL 8.0.34.
Here's a snippet of my migration. Note the name of the primary key constraint.
After updating the database, here's what HeidiSQL displays as the create code for the Users table. Note the name (or lack thereof) for the primary key constraint.
CompareEfWithDb()
returns true andGetAllErrors
includes this.Edit: I found a workaround. It requires two ignore log patterns.