Skip to content
This repository was archived by the owner on Aug 1, 2021. It is now read-only.

Commit c402c4c

Browse files
committed
Changed architecture to better support multiple databases
Added Postgree
1 parent 4b99082 commit c402c4c

File tree

51 files changed

+3237
-198
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+3237
-198
lines changed

src/Backend/Jp.Application/Services/UserAppService.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
using Jp.Domain.Commands.User;
66
using Jp.Domain.Core.Bus;
77
using Jp.Domain.Interfaces;
8-
using Jp.Domain.Models;
98
using System;
109
using System.Threading.Tasks;
1110

src/Backend/Jp.Infra.CrossCutting.Identity/Jp.Infra.CrossCutting.Identity.csproj

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,6 @@
1313
<ItemGroup>
1414
<PackageReference Include="Microsoft.AspNetCore.Http.Abstractions" Version="2.2.0" />
1515
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="2.2.0" />
16-
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="2.2.3">
17-
<PrivateAssets>all</PrivateAssets>
18-
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
19-
</PackageReference>
2016
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="2.2.0" />
2117
<PackageReference Include="Microsoft.AspNetCore.Authorization" Version="2.2.0" />
2218

src/Backend/Jp.Infra.Migrations.MySql/Configuration/IdentityConfig.cs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,18 @@
1-
using IdentityServer4.EntityFramework.Options;
1+
using System.Reflection;
2+
using IdentityServer4.EntityFramework.Options;
23
using Jp.Infra.CrossCutting.Identity.Context;
34
using Jp.Infra.CrossCutting.Identity.Entities.Identity;
45
using Jp.Infra.Data.Context;
56
using Microsoft.AspNetCore.Identity;
67
using Microsoft.EntityFrameworkCore;
7-
using Microsoft.Extensions.Configuration;
88
using Microsoft.Extensions.DependencyInjection;
9-
using System.Reflection;
109

11-
namespace Jp.Infra.Migrations.MySql.Configuration
10+
namespace Jp.Infra.Data.MySql.Configuration
1211
{
1312
public static class IdentityConfig
1413
{
15-
public static IServiceCollection AddIdentityMySql(this IServiceCollection services, IConfiguration configuration)
14+
public static IServiceCollection AddIdentityMySql(this IServiceCollection services, string connectionString)
1615
{
17-
var connectionString = configuration.GetConnectionString("SSOConnection");
1816
var migrationsAssembly = typeof(IdentityConfig).GetTypeInfo().Assembly.GetName().Name;
1917

2018
var operationalStoreOptions = new OperationalStoreOptions();

src/Backend/Jp.Infra.CrossCutting.IdentityServer/Configuration/MySqlConfig.cs renamed to src/Backend/Jp.Infra.Migrations.MySql/Configuration/IdentityServerConfig.cs

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
11
using Microsoft.EntityFrameworkCore;
2-
using Microsoft.Extensions.Configuration;
32
using Microsoft.Extensions.DependencyInjection;
4-
using Microsoft.Extensions.Logging;
5-
using System;
3+
using System.Reflection;
64

7-
namespace Jp.Infra.CrossCutting.IdentityServer.Configuration
5+
namespace Jp.Infra.Data.MySql.Configuration
86
{
9-
public static class MySqlConfig
7+
public static class IdentityServerConfig
108
{
11-
public static IIdentityServerBuilder UseIdentityServerMySqlDatabase(this IIdentityServerBuilder builder,
12-
IServiceCollection services, IConfiguration configuration, ILogger logger)
9+
public static IIdentityServerBuilder UseIdentityServerMySqlDatabase(
10+
this IIdentityServerBuilder builder,
11+
string connectionString)
1312
{
14-
var connectionString = configuration.GetConnectionString("SSOConnection");
15-
var migrationsAssembly = "Jp.Infra.Migrations.MySql.Identity";
13+
var migrationsAssembly = typeof(IdentityConfig).GetTypeInfo().Assembly.GetName().Name;
1614

1715
// this adds the config data from DB (clients, resources)
1816
builder.AddConfigurationStore(options =>
@@ -32,7 +30,6 @@ public static IIdentityServerBuilder UseIdentityServerMySqlDatabase(this IIdenti
3230
});
3331

3432

35-
3633
return builder;
3734
}
3835

src/Backend/Jp.Infra.Migrations.MySql/Jp.Infra.Migrations.MySql.csproj renamed to src/Backend/Jp.Infra.Migrations.MySql/Jp.Infra.Data.MySql.csproj

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
</PropertyGroup>
66

77
<ItemGroup>
8-
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="2.2.3" />
9-
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="2.2.3" />
108
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="2.2.0" />
119
</ItemGroup>
1210

src/Backend/Jp.Infra.Migrations.MySql/Migrations/EventStore/20190302144817_Initial.Designer.cs

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Backend/Jp.Infra.Migrations.MySql/Migrations/EventStore/20190302144817_Initial.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
using System;
22
using Microsoft.EntityFrameworkCore.Migrations;
33

4-
namespace Jp.Infra.Migrations.MySql.Migrations.EventStore
4+
namespace Jp.Infra.Data.MySql.Migrations.EventStore
55
{
66
public partial class Initial : Migration
77
{

src/Backend/Jp.Infra.Migrations.MySql/Migrations/EventStore/EventStoreContextModelSnapshot.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
// <auto-generated />
2+
23
using System;
34
using Jp.Infra.Data.Context;
45
using Microsoft.EntityFrameworkCore;
56
using Microsoft.EntityFrameworkCore.Infrastructure;
6-
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
77

8-
namespace Jp.Infra.Migrations.MySql.Migrations.EventStore
8+
namespace Jp.Infra.Data.MySql.Migrations.EventStore
99
{
1010
[DbContext(typeof(EventStoreContext))]
1111
partial class EventStoreContextModelSnapshot : ModelSnapshot

src/Backend/Jp.Infra.Migrations.MySql/Migrations/Identity/20190302144650_Initial.Designer.cs

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Backend/Jp.Infra.Migrations.MySql/Migrations/Identity/20190302144650_Initial.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
using Microsoft.EntityFrameworkCore.Metadata;
33
using Microsoft.EntityFrameworkCore.Migrations;
44

5-
namespace Jp.Infra.Migrations.MySql.Migrations.Identity
5+
namespace Jp.Infra.Data.MySql.Migrations.Identity
66
{
77
public partial class Initial : Migration
88
{

0 commit comments

Comments
 (0)