Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

Collation Setting MySQL Using Pomona #8884


User avatar
0
maharatha created

We use Pomona for MySQl.We have a requirement to keep the collation to utf8mb4_unicode_ci. So we went ahead and used the dataannotation to make sure all columns have the same unicode.

Here are the issues :

  1. We are altering the database to make utf8mb4_unicode_ci in our initial migration : migrationBuilder.Sql("alter database character set utf8mb4 collate utf8mb4_unicode_ci"); This only makes the non varchar column to automatically use the collation as utf8mb4_unicode_cikai_ci. So in order to change the collation of these tables either i have to change the initial migration which i am not a big fan of it or go and change the entity with override.

Can you suggest what would be a good approach to solve this issue ?


1 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @maharatha,

    I don't know MySql very well, but maybe you can handle this with a single SQL query. If you can do that, you can add running this scirpt to your deployment pipeline (not to migrations).