Skip to content

Commit c5ec7cc

Browse files
Another attempt.
1 parent 16f926b commit c5ec7cc

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

backend/src/Squidex.Data.EntityFramework/ServiceExtensions.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,15 @@ public static void AddSquidexEntityFramework(this IServiceCollection services, I
6363
{
6464
services.AddDbContextFactory<MySqlDbContext>(builder =>
6565
{
66+
var versionString = config.GetOptionalValue<string>("store:sql:version");
67+
68+
var version =
69+
!string.IsNullOrWhiteSpace(versionString) ?
70+
ServerVersion.Parse(versionString) :
71+
ServerVersion.AutoDetect(connectionString);
72+
6673
builder.ConfigureWarnings(w => w.Ignore(CoreEventId.CollectionWithoutComparer));
67-
builder.UseMySql(connectionString, ServerVersion.AutoDetect(connectionString), mysql =>
74+
builder.UseMySql(connectionString, version, mysql =>
6875
{
6976
mysql.UseMicrosoftJson(MySqlCommonJsonChangeTrackingOptions.FullHierarchyOptimizedSemantically);
7077
});

backend/src/Squidex/appsettings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -568,6 +568,9 @@
568568
// The connection string to your database.
569569
"connectionString": "",
570570

571+
// The version of the MySQL server.
572+
"version": "9.2.0-mysql",
573+
571574
// The database provider.
572575
//
573576
// SUPPORTED: MySql, Postgres, SqlServer,

tools/TestSuite/docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ services:
138138
- STORE__TYPE=Sql
139139
- STORE__SQL__CONNECTIONSTRING=Server=db_mysql;Port=3306;Database=squidex;User=admin;Password=secret;
140140
- STORE__SQL__PROVIDER=MySql
141+
- STORE__SQL__VERSION=9.2.0-mysql
141142
- MESSAGING__TYPE=Sql
142143
- URLS__BASEURL=http://localhost:8084
143144
depends_on:

0 commit comments

Comments
 (0)