mirror of
https://github.com/collinbarrett/FilterLists.git
synced 2026-03-11 09:04:27 +00:00
extract ServerVersion to constant
This commit is contained in:
parent
50cece12fc
commit
d4db6cf11f
4 changed files with 14 additions and 6 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
|
|||
11
server/src/FilterLists.Data/Constants.cs
Normal file
11
server/src/FilterLists.Data/Constants.cs
Normal file
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
@ -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<FilterListsDbContext>(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<FilterListService>();
|
||||
services.TryAddScoped<LanguageService>();
|
||||
services.TryAddScoped<LicenseService>();
|
||||
|
|
|
|||
Loading…
Reference in a new issue