mirror of
https://github.com/collinbarrett/FilterLists.git
synced 2026-03-11 09:04:27 +00:00
mv migrations to separate lib
This commit is contained in:
parent
979632b48d
commit
faca8b98ea
74 changed files with 34 additions and 2 deletions
|
|
@ -11,6 +11,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FilterLists.Agent", "src\Fi
|
|||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FilterLists.Data", "src\FilterLists.Data\FilterLists.Data.csproj", "{E604D351-D471-41FD-BA82-BAE12B342B4D}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FilterLists.Data.Migrations", "src\FilterLists.Data.Migrations\FilterLists.Data.Migrations.csproj", "{312A8819-5CAB-4F43-B182-50CAD5D8FEF9}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FilterLists.Services", "src\FilterLists.Services\FilterLists.Services.csproj", "{51186C58-1627-4743-B86D-4B355D8A152B}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FilterLists.Api", "src\FilterLists.Api\FilterLists.Api.csproj", "{1B8105E2-0721-4DC0-8243-02932A05D98B}"
|
||||
|
|
@ -45,6 +47,10 @@ Global
|
|||
{1B8105E2-0721-4DC0-8243-02932A05D98B}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{1B8105E2-0721-4DC0-8243-02932A05D98B}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{1B8105E2-0721-4DC0-8243-02932A05D98B}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{312A8819-5CAB-4F43-B182-50CAD5D8FEF9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{312A8819-5CAB-4F43-B182-50CAD5D8FEF9}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{312A8819-5CAB-4F43-B182-50CAD5D8FEF9}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{312A8819-5CAB-4F43-B182-50CAD5D8FEF9}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{668D27A9-FD28-4F2A-BA4C-37BBAED95617}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{668D27A9-FD28-4F2A-BA4C-37BBAED95617}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{668D27A9-FD28-4F2A-BA4C-37BBAED95617}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
|
|
@ -70,6 +76,7 @@ Global
|
|||
{E604D351-D471-41FD-BA82-BAE12B342B4D} = {00CBD1AF-455E-4DF5-AB24-A5C2C18EEB6F}
|
||||
{51186C58-1627-4743-B86D-4B355D8A152B} = {00CBD1AF-455E-4DF5-AB24-A5C2C18EEB6F}
|
||||
{1B8105E2-0721-4DC0-8243-02932A05D98B} = {00CBD1AF-455E-4DF5-AB24-A5C2C18EEB6F}
|
||||
{312A8819-5CAB-4F43-B182-50CAD5D8FEF9} = {00CBD1AF-455E-4DF5-AB24-A5C2C18EEB6F}
|
||||
{668D27A9-FD28-4F2A-BA4C-37BBAED95617} = {EA11453B-FB14-4F0E-A19B-B8089498F677}
|
||||
{EB65E67D-3C29-4555-8D9B-C90801880F51} = {EA11453B-FB14-4F0E-A19B-B8089498F677}
|
||||
{0F419F45-EC3F-409B-95A2-F6AEE21E4041} = {EA11453B-FB14-4F0E-A19B-B8089498F677}
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ FROM mcr.microsoft.com/dotnet/core/sdk:3.1-alpine AS build
|
|||
# restore
|
||||
WORKDIR /app/src
|
||||
COPY server/src/FilterLists.Data/FilterLists.Data.csproj FilterLists.Data/
|
||||
COPY server/src/FilterLists.Data.Migrations/FilterLists.Data.Migrations.csproj FilterLists.Data.Migrations/
|
||||
COPY server/src/FilterLists.Services/FilterLists.Services.csproj FilterLists.Services/
|
||||
WORKDIR /app/src/FilterLists.Api
|
||||
COPY server/src/FilterLists.Api/FilterLists.Api.csproj .
|
||||
|
|
@ -28,6 +29,7 @@ RUN dotnet restore
|
|||
# build
|
||||
WORKDIR /app/src
|
||||
COPY server/src/FilterLists.Data/. FilterLists.Data/
|
||||
COPY server/src/FilterLists.Data.Migrations/. FilterLists.Data.Migrations/
|
||||
COPY server/src/FilterLists.Services/. FilterLists.Services/
|
||||
WORKDIR /app/src/FilterLists.Api
|
||||
COPY server/src/FilterLists.Api/. .
|
||||
|
|
|
|||
|
|
@ -0,0 +1,21 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netstandard2.1</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<Authors>Collin M. Barrett</Authors>
|
||||
<Company>Collin M. Barrett</Company>
|
||||
<Product>FilterLists</Product>
|
||||
<Description>The independent, comprehensive directory of filter and host lists for advertisements, trackers, malware, and annoyances.</Description>
|
||||
<Copyright>Copyright (c) 2020 Collin M. Barrett</Copyright>
|
||||
<RepositoryUrl>https://github.com/collinbarrett/FilterLists</RepositoryUrl>
|
||||
<RepositoryType>git</RepositoryType>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\FilterLists.Data\FilterLists.Data.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
|
@ -7,5 +7,7 @@ namespace FilterLists.Data
|
|||
public static class Constants
|
||||
{
|
||||
public static readonly ServerVersion ServerVersion = new ServerVersion(new Version(10, 4, 12), ServerType.MariaDb);
|
||||
|
||||
public const string MigrationsAssembly = "FilterLists.Data.Migrations";
|
||||
}
|
||||
}
|
||||
|
|
@ -22,7 +22,7 @@ public static void AddFilterListsApiServices(this IServiceCollection services, I
|
|||
services.AddSingleton(c => config);
|
||||
services.AddDbContextPool<FilterListsDbContext>(o =>
|
||||
o.UseMySql(config.GetConnectionString("FilterListsConnection"),
|
||||
m => m.MigrationsAssembly("FilterLists.Data")
|
||||
m => m.MigrationsAssembly(Constants.MigrationsAssembly)
|
||||
.ServerVersion(Constants.ServerVersion)));
|
||||
services.TryAddScoped<FilterListService>();
|
||||
services.TryAddScoped<LanguageService>();
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ public void Migrate_DoesNotThrowException()
|
|||
|
||||
const string connString = "Server=mariadb;Database=filterlists;Uid=filterlists;Pwd=filterlists;";
|
||||
var options = new DbContextOptionsBuilder<FilterListsDbContext>()
|
||||
.UseMySql(connString, m => m.MigrationsAssembly("FilterLists.Data")
|
||||
.UseMySql(connString, m => m.MigrationsAssembly(Constants.MigrationsAssembly)
|
||||
.ServerVersion(Constants.ServerVersion))
|
||||
.Options;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue