Fix MySql does not support the EF Core concept of schemas

This commit is contained in:
liu 2021-06-09 11:51:05 +08:00 committed by Sipke Schoorstra
parent 5ff1ce7efe
commit 34556e9670

View file

@ -1,5 +1,6 @@
using Elsa.Persistence.EntityFramework.Core;
using Microsoft.EntityFrameworkCore;
using Pomelo.EntityFrameworkCore.MySql.Infrastructure;
namespace Elsa.Persistence.EntityFramework.MySql
{
@ -11,6 +12,7 @@ namespace Elsa.Persistence.EntityFramework.MySql
public static DbContextOptionsBuilder UseMySql(this DbContextOptionsBuilder builder, string connectionString) =>
builder.UseMySql(connectionString, ServerVersion.AutoDetect(connectionString), db => db
.MigrationsAssembly(typeof(MySqlElsaContextFactory).Assembly.GetName().Name)
.MigrationsHistoryTable(ElsaContext.MigrationsHistoryTable, ElsaContext.ElsaSchema));
.MigrationsHistoryTable(ElsaContext.MigrationsHistoryTable, ElsaContext.ElsaSchema)
.SchemaBehavior(MySqlSchemaBehavior.Ignore));
}
}