Search code examples
c#entity-framework-coreentity-framework-core-migrations

How to set default table storage engine in MySQL using Entity Framework Core?


I'm using Pomelo.EntityFrameworkCore.MySql and would like to set InnoDB as the default storage engine for all my databases instead of the default MyISAM, but have no idea to do so in EFC code-first.


Solution

  • There is an opened issue in Pomelo.EntityFrameworkCore.MySql that an engine cannot be specified: link.

    And on that page there is a workaround posted as: to use migrations instead of EnsureDatabaseCreated, and manually to set default_storage_engine variable to InnoDBduring migration db session: link to the workaround.