Pomelo.EntityFrameworkCore.MySql icon indicating copy to clipboard operation
Pomelo.EntityFrameworkCore.MySql copied to clipboard

DbContext.Database.Migrate() change guid charset and Collation

Open renyanwei opened this issue 1 year ago • 0 comments

I am using Pomelo Efcore I encountered a situation while using MySQL and didn't know how to handle it. Our application needs to be deployed to different servers. Some servers use MySQL 8.0 for their databases, while others use Oceanbase 4.3(100% compatible with the MySQL protocol) for their databases. However, Oceanbase does not support the ascii character set, so you want to execute update database or use Dbcontext in Efcore Database When Migrate(), different character sets and sorting rules can be set for the Guid type based on the current database type. How should I handle this? Pomelo has a method called UseGuidCollation, but this is determined during add migration, and the effect I want to achieve is determined during Update database.

renyanwei avatar May 07 '24 11:05 renyanwei