mirror of
https://github.com/collinbarrett/FilterLists.git
synced 2026-03-11 09:04:27 +00:00
specify MariaDB version to differentiate CHANGE/RENAME COLUMN syntax w/MySQL
This commit is contained in:
parent
e1aeb0d427
commit
9db47f05e8
2 changed files with 7 additions and 2 deletions
|
|
@ -37,7 +37,8 @@ services:
|
|||
ConnectionStrings__FilterListsConnection: ${API_CONNECTION_STRING}
|
||||
|
||||
mariadb:
|
||||
image: mariadb:latest
|
||||
# on update, also update ServerVersion in FilterLists.Services.DependencyInjection.Extensions.ConfigureServicesCollection
|
||||
image: mariadb:10.4.12
|
||||
restart: always
|
||||
networks:
|
||||
- api
|
||||
|
|
|
|||
|
|
@ -12,6 +12,9 @@
|
|||
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
|
||||
{
|
||||
|
|
@ -23,7 +26,8 @@ public static void AddFilterListsApiServices(this IServiceCollection services, I
|
|||
services.AddEntityFrameworkMySql()
|
||||
.AddDbContextPool<FilterListsDbContext>(o =>
|
||||
o.UseMySql(config.GetConnectionString("FilterListsConnection"),
|
||||
m => m.MigrationsAssembly("FilterLists.Api")));
|
||||
m => m.MigrationsAssembly("FilterLists.Api")
|
||||
.ServerVersion(new ServerVersion(new Version(10, 4, 12), ServerType.MariaDb))));
|
||||
services.TryAddScoped<FilterListService>();
|
||||
services.TryAddScoped<LanguageService>();
|
||||
services.TryAddScoped<LicenseService>();
|
||||
|
|
|
|||
Loading…
Reference in a new issue