diff --git a/docker-compose.data.tests.yml b/docker-compose.data.tests.yml index 84e9743f1..ae092d302 100644 --- a/docker-compose.data.tests.yml +++ b/docker-compose.data.tests.yml @@ -15,7 +15,7 @@ services: - mariadb mariadb: - # on update, also update ServerVersion in FilterLists.Services.DependencyInjection.Extensions.ConfigureServicesCollection + # on update, also update ServerVersion in FilterLists.Data.Constants.ServerVersion image: mariadb:10.4.12 networks: - test-data diff --git a/docker-compose.yml b/docker-compose.yml index 641bdd75e..5fd268720 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -37,7 +37,7 @@ services: ConnectionStrings__FilterListsConnection: ${API_CONNECTION_STRING} mariadb: - # on update, also update ServerVersion in FilterLists.Services.DependencyInjection.Extensions.ConfigureServicesCollection + # on update, also update ServerVersion in FilterLists.Data.Constants.ServerVersion image: mariadb:10.4.12 restart: always networks: diff --git a/server/src/FilterLists.Data/Constants.cs b/server/src/FilterLists.Data/Constants.cs new file mode 100644 index 000000000..24c46409f --- /dev/null +++ b/server/src/FilterLists.Data/Constants.cs @@ -0,0 +1,11 @@ +using Pomelo.EntityFrameworkCore.MySql.Infrastructure; +using Pomelo.EntityFrameworkCore.MySql.Storage; +using System; + +namespace FilterLists.Data +{ + public static class Constants + { + public static readonly ServerVersion ServerVersion = new ServerVersion(new Version(10, 4, 12), ServerType.MariaDb); + } +} \ No newline at end of file diff --git a/server/src/FilterLists.Services/DependencyInjection/Extensions/ConfigureServicesCollection.cs b/server/src/FilterLists.Services/DependencyInjection/Extensions/ConfigureServicesCollection.cs index d12ada973..7f7e511fa 100644 --- a/server/src/FilterLists.Services/DependencyInjection/Extensions/ConfigureServicesCollection.cs +++ b/server/src/FilterLists.Services/DependencyInjection/Extensions/ConfigureServicesCollection.cs @@ -12,9 +12,6 @@ using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection.Extensions; -using Pomelo.EntityFrameworkCore.MySql.Infrastructure; -using Pomelo.EntityFrameworkCore.MySql.Storage; -using System; namespace FilterLists.Services.DependencyInjection.Extensions { @@ -26,7 +23,7 @@ public static void AddFilterListsApiServices(this IServiceCollection services, I services.AddDbContextPool(o => o.UseMySql(config.GetConnectionString("FilterListsConnection"), m => m.MigrationsAssembly("FilterLists.Data") - .ServerVersion(new ServerVersion(new Version(10, 4, 12), ServerType.MariaDb)))); + .ServerVersion(Constants.ServerVersion))); services.TryAddScoped(); services.TryAddScoped(); services.TryAddScoped();