Browse Source

feat(elsa): 添加对 PostgreSql 的支持

pull/1048/head
feijie 1 year ago
parent
commit
b8d50e5383
  1. 3
      Directory.Packages.props
  2. 7
      aspnet-core/LINGYUN.MicroService.All.sln
  3. 7
      aspnet-core/LINGYUN.MicroService.SingleProject.sln
  4. 7
      aspnet-core/LINGYUN.MicroService.Workflow.sln
  5. 3
      aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.EntityFrameworkCore.PostgreSql/FodyWeavers.xml
  6. 30
      aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.EntityFrameworkCore.PostgreSql/FodyWeavers.xsd
  7. 27
      aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.EntityFrameworkCore.PostgreSql/LINGYUN.Abp.Elsa.EntityFrameworkCore.PostgreSql.csproj
  8. 29
      aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.EntityFrameworkCore.PostgreSql/LINGYUN/Abp/Elsa/EntityFrameworkCore/PostgreSql/AbpElsaEntityFrameworkCorePostgreSqlModule.cs
  9. 15
      aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.EntityFrameworkCore.PostgreSql/LINGYUN/Abp/Elsa/EntityFrameworkCore/PostgreSql/PersistenceStartup.cs
  10. 17
      aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.EntityFrameworkCore.PostgreSql/LINGYUN/Abp/Elsa/EntityFrameworkCore/PostgreSql/WebhooksStartup.cs
  11. 17
      aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.EntityFrameworkCore.PostgreSql/LINGYUN/Abp/Elsa/EntityFrameworkCore/PostgreSql/WorkflowSettingsStartup.cs

3
Directory.Packages.props

@ -60,6 +60,7 @@
<PackageVersion Include="Volo.Abp.EntityFrameworkCore" Version="$(VoloAbpPackageVersion)" />
<PackageVersion Include="Volo.Abp.EntityFrameworkCore.MySql" Version="$(VoloAbpPackageVersion)" />
<PackageVersion Include="Volo.Abp.EntityFrameworkCore.SqlServer" Version="$(VoloAbpPackageVersion)" />
<PackageVersion Include="Volo.Abp.EntityFrameworkCore.PostgreSql" Version="$(VoloAbpPackageVersion)" />
<PackageVersion Include="Volo.Abp.Features" Version="$(VoloAbpPackageVersion)" />
<PackageVersion Include="Volo.Abp.FeatureManagement.Application" Version="$(VoloAbpPackageVersion)" />
<PackageVersion Include="Volo.Abp.FeatureManagement.Application.Contracts" Version="$(VoloAbpPackageVersion)" />
@ -171,6 +172,8 @@
<PackageVersion Include="Elsa.WorkflowSettings.Persistence.EntityFramework.Core" Version="$(ElsaPackageVersion)" />
<PackageVersion Include="Elsa.Webhooks.Persistence.EntityFramework.MySql" Version="$(ElsaPackageVersion)" />
<PackageVersion Include="Elsa.WorkflowSettings.Persistence.EntityFramework.MySql" Version="$(ElsaPackageVersion)" />
<PackageVersion Include="Elsa.Webhooks.Persistence.EntityFramework.PostgreSql" Version="$(ElsaPackageVersion)" />
<PackageVersion Include="Elsa.WorkflowSettings.Persistence.EntityFramework.PostgreSql" Version="$(ElsaPackageVersion)" />
</ItemGroup>
<!-- DotNetCore.CAP -->
<ItemGroup>

7
aspnet-core/LINGYUN.MicroService.All.sln

@ -766,6 +766,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.OssManagement.I
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.OssManagement.Imaging", "modules\oss-management\LINGYUN.Abp.OssManagement.Imaging\LINGYUN.Abp.OssManagement.Imaging.csproj", "{267933BD-BFB8-4906-BA39-DF193B2FD558}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.Elsa.EntityFrameworkCore.PostgreSql", "modules\elsa\LINGYUN.Abp.Elsa.EntityFrameworkCore.PostgreSql\LINGYUN.Abp.Elsa.EntityFrameworkCore.PostgreSql.csproj", "{CD70B78F-C15B-49B6-B0EA-570A9D18D7C8}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -1964,6 +1966,10 @@ Global
{267933BD-BFB8-4906-BA39-DF193B2FD558}.Debug|Any CPU.Build.0 = Debug|Any CPU
{267933BD-BFB8-4906-BA39-DF193B2FD558}.Release|Any CPU.ActiveCfg = Release|Any CPU
{267933BD-BFB8-4906-BA39-DF193B2FD558}.Release|Any CPU.Build.0 = Release|Any CPU
{CD70B78F-C15B-49B6-B0EA-570A9D18D7C8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CD70B78F-C15B-49B6-B0EA-570A9D18D7C8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CD70B78F-C15B-49B6-B0EA-570A9D18D7C8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CD70B78F-C15B-49B6-B0EA-570A9D18D7C8}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -2334,6 +2340,7 @@ Global
{F2AD691B-71B9-4B86-95BC-E020DA6B1E4A} = {370D7CD5-1E17-4F3D-BBFA-03429F6D4F2F}
{76DDE71D-00BD-4BC8-AEA2-31209E2B7E05} = {B05CB08F-C088-4D6D-97EE-A94A5D1AE4A6}
{267933BD-BFB8-4906-BA39-DF193B2FD558} = {B05CB08F-C088-4D6D-97EE-A94A5D1AE4A6}
{CD70B78F-C15B-49B6-B0EA-570A9D18D7C8} = {0A00FAF9-A96B-4BF5-8D42-15C8678F70F3}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {C95FDF91-16F2-4A8B-A4BE-0E62D1B66718}

7
aspnet-core/LINGYUN.MicroService.SingleProject.sln

@ -602,6 +602,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.OssManagement.M
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.OssManagement.Imaging", "modules\oss-management\LINGYUN.Abp.OssManagement.Imaging\LINGYUN.Abp.OssManagement.Imaging.csproj", "{BC7A8662-4313-4F1D-B267-9B1B69444CD3}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.Elsa.EntityFrameworkCore.PostgreSql", "modules\elsa\LINGYUN.Abp.Elsa.EntityFrameworkCore.PostgreSql\LINGYUN.Abp.Elsa.EntityFrameworkCore.PostgreSql.csproj", "{8D0C8993-580A-4585-BE3B-87895C76FC89}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -1584,6 +1586,10 @@ Global
{BC7A8662-4313-4F1D-B267-9B1B69444CD3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BC7A8662-4313-4F1D-B267-9B1B69444CD3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BC7A8662-4313-4F1D-B267-9B1B69444CD3}.Release|Any CPU.Build.0 = Release|Any CPU
{8D0C8993-580A-4585-BE3B-87895C76FC89}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8D0C8993-580A-4585-BE3B-87895C76FC89}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8D0C8993-580A-4585-BE3B-87895C76FC89}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8D0C8993-580A-4585-BE3B-87895C76FC89}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -1876,6 +1882,7 @@ Global
{319428B9-CE7F-4027-92FA-6311C4CE95FB} = {4A2CF141-F32D-45A0-8665-B3705667A6D2}
{9AE3E97E-8846-4315-9546-FF97E97FD49F} = {3AD66E47-B667-40D1-AE61-F5EC186241F7}
{BC7A8662-4313-4F1D-B267-9B1B69444CD3} = {3AD66E47-B667-40D1-AE61-F5EC186241F7}
{8D0C8993-580A-4585-BE3B-87895C76FC89} = {07DFEB1E-ED92-4E97-A801-FAB2D70F4F35}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {711A43C0-A2F8-4E5C-9B9F-F2551E4B3FF1}

7
aspnet-core/LINGYUN.MicroService.Workflow.sln

@ -171,6 +171,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Identity.Sessio
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Identity.Session.AspNetCore", "modules\identity\LINGYUN.Abp.Identity.Session.AspNetCore\LINGYUN.Abp.Identity.Session.AspNetCore.csproj", "{9FB5E943-7F6F-4281-9C00-E76284B4F1F3}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.Elsa.EntityFrameworkCore.PostgreSql", "modules\elsa\LINGYUN.Abp.Elsa.EntityFrameworkCore.PostgreSql\LINGYUN.Abp.Elsa.EntityFrameworkCore.PostgreSql.csproj", "{D56851BB-557E-4CF9-B724-8E607EEE9D07}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -457,6 +459,10 @@ Global
{9FB5E943-7F6F-4281-9C00-E76284B4F1F3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9FB5E943-7F6F-4281-9C00-E76284B4F1F3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9FB5E943-7F6F-4281-9C00-E76284B4F1F3}.Release|Any CPU.Build.0 = Release|Any CPU
{D56851BB-557E-4CF9-B724-8E607EEE9D07}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D56851BB-557E-4CF9-B724-8E607EEE9D07}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D56851BB-557E-4CF9-B724-8E607EEE9D07}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D56851BB-557E-4CF9-B724-8E607EEE9D07}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -534,6 +540,7 @@ Global
{1859E205-88DC-4E08-A0BD-55A045DCC495} = {6DA78E72-BA55-4ECF-97DB-6258174D3E2A}
{6ECF678D-6F3A-4084-8538-A86C1D67C703} = {9C73D4E6-4408-4717-B51C-63C20321D4DA}
{9FB5E943-7F6F-4281-9C00-E76284B4F1F3} = {9C73D4E6-4408-4717-B51C-63C20321D4DA}
{D56851BB-557E-4CF9-B724-8E607EEE9D07} = {F1CCBEC7-ACAB-4DC5-909E-D8CC2E1B7EEC}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {6BB7A5DE-DA12-44DC-BC9B-0F6CA524346F}

3
aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.EntityFrameworkCore.PostgreSql/FodyWeavers.xml

@ -0,0 +1,3 @@
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
<ConfigureAwait ContinueOnCapturedContext="false" />
</Weavers>

30
aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.EntityFrameworkCore.PostgreSql/FodyWeavers.xsd

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<!-- This file was generated by Fody. Manual changes to this file will be lost when your project is rebuilt. -->
<xs:element name="Weavers">
<xs:complexType>
<xs:all>
<xs:element name="ConfigureAwait" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:attribute name="ContinueOnCapturedContext" type="xs:boolean" />
</xs:complexType>
</xs:element>
</xs:all>
<xs:attribute name="VerifyAssembly" type="xs:boolean">
<xs:annotation>
<xs:documentation>'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="VerifyIgnoreCodes" type="xs:string">
<xs:annotation>
<xs:documentation>A comma-separated list of error codes that can be safely ignored in assembly verification.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="GenerateXsd" type="xs:boolean">
<xs:annotation>
<xs:documentation>'false' to turn off automatic generation of the XML Schema file.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:schema>

27
aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.EntityFrameworkCore.PostgreSql/LINGYUN.Abp.Elsa.EntityFrameworkCore.PostgreSql.csproj

@ -0,0 +1,27 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\..\..\configureawait.props" />
<Import Project="..\..\..\..\common.props" />
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<AssemblyName>LINGYUN.Abp.Elsa.EntityFrameworkCore.PostgreSql</AssemblyName>
<PackageId>LINGYUN.Abp.Elsa.EntityFrameworkCore.PostgreSql</PackageId>
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
<RootNamespace />
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Elsa.Webhooks.Persistence.EntityFramework.PostgreSql" />
<PackageReference Include="Elsa.WorkflowSettings.Persistence.EntityFramework.PostgreSql" />
<PackageReference Include="Volo.Abp.EntityFrameworkCore.PostgreSql" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\LINGYUN.Abp.Elsa.EntityFrameworkCore\LINGYUN.Abp.Elsa.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\LINGYUN.Abp.Elsa\LINGYUN.Abp.Elsa.csproj" />
</ItemGroup>
</Project>

29
aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.EntityFrameworkCore.PostgreSql/LINGYUN/Abp/Elsa/EntityFrameworkCore/PostgreSql/AbpElsaEntityFrameworkCorePostgreSqlModule.cs

@ -0,0 +1,29 @@
using Elsa;
using Elsa.Options;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.EntityFrameworkCore.PostgreSql;
using Volo.Abp.Modularity;
namespace LINGYUN.Abp.Elsa.EntityFrameworkCore.PostgreSql;
[DependsOn(
typeof(AbpElsaEntityFrameworkCoreModule),
typeof(AbpEntityFrameworkCorePostgreSqlModule))]
public class AbpElsaEntityFrameworkCorePostgreSqlModule : AbpModule
{
public override void PreConfigureServices(ServiceConfigurationContext context)
{
var configuration = context.Services.GetConfiguration();
var startups = new[]
{
typeof(PersistenceStartup),
typeof(WebhooksStartup),
typeof(WorkflowSettingsStartup),
};
PreConfigure<ElsaOptionsBuilder>(elsa =>
{
elsa.AddFeatures(startups, configuration);
});
}
}

15
aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.EntityFrameworkCore.PostgreSql/LINGYUN/Abp/Elsa/EntityFrameworkCore/PostgreSql/PersistenceStartup.cs

@ -0,0 +1,15 @@
using Elsa.Attributes;
using Microsoft.EntityFrameworkCore;
namespace LINGYUN.Abp.Elsa.EntityFrameworkCore.PostgreSql;
[Feature("DefaultPersistence:EntityFrameworkCore:PostgreSql")]
public class PersistenceStartup : PersistenceStartupBase
{
protected override string ProviderName => "PostgreSql";
protected override void Configure(DbContextOptionsBuilder options, string connectionString)
{
options.UseNpgsql(connectionString);
}
}

17
aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.EntityFrameworkCore.PostgreSql/LINGYUN/Abp/Elsa/EntityFrameworkCore/PostgreSql/WebhooksStartup.cs

@ -0,0 +1,17 @@
using Elsa.Attributes;
using Microsoft.EntityFrameworkCore;
namespace LINGYUN.Abp.Elsa.EntityFrameworkCore.PostgreSql;
[Feature("Webhooks:EntityFrameworkCore:PostgreSql")]
public class WebhooksStartup : WebhooksStartupBase
{
protected override string ProviderName => "PostgreSql";
protected override void Configure(DbContextOptionsBuilder options, string connectionString)
{
options.UseNpgsql(
connectionString,
x => x.MigrationsHistoryTable("__EFMigrationsHistory_Webhooks"));
}
}

17
aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.EntityFrameworkCore.PostgreSql/LINGYUN/Abp/Elsa/EntityFrameworkCore/PostgreSql/WorkflowSettingsStartup.cs

@ -0,0 +1,17 @@
using Elsa.Attributes;
using Microsoft.EntityFrameworkCore;
namespace LINGYUN.Abp.Elsa.EntityFrameworkCore.PostgreSql;
[Feature("WorkflowSettings:EntityFrameworkCore:PostgreSql")]
public class WorkflowSettingsStartup : WorkflowSettingsStartupBase
{
protected override string ProviderName => "PostgreSql";
protected override void Configure(DbContextOptionsBuilder options, string connectionString)
{
options.UseNpgsql(
connectionString,
x => x.MigrationsHistoryTable("__EFMigrationsHistory_WorkflowSettings"));
}
}
Loading…
Cancel
Save