Browse Source

feat(elsa): 添加对 SQL Server 的支持

pull/1048/head
feijie 1 year ago
parent
commit
3b876820e0
  1. 2
      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.SqlServer/FodyWeavers.xml
  6. 30
      aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.EntityFrameworkCore.SqlServer/FodyWeavers.xsd
  7. 27
      aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.EntityFrameworkCore.SqlServer/LINGYUN.Abp.Elsa.EntityFrameworkCore.SqlServer.csproj
  8. 29
      aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.EntityFrameworkCore.SqlServer/LINGYUN/Abp/Elsa/EntityFrameworkCore/SqlServer/AbpElsaEntityFrameworkCoreSqlServerModule.cs
  9. 15
      aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.EntityFrameworkCore.SqlServer/LINGYUN/Abp/Elsa/EntityFrameworkCore/SqlServer/PersistenceStartup.cs
  10. 17
      aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.EntityFrameworkCore.SqlServer/LINGYUN/Abp/Elsa/EntityFrameworkCore/SqlServer/WebhooksStartup.cs
  11. 17
      aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.EntityFrameworkCore.SqlServer/LINGYUN/Abp/Elsa/EntityFrameworkCore/SqlServer/WorkflowSettingsStartup.cs

2
Directory.Packages.props

@ -174,6 +174,8 @@
<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)" />
<PackageVersion Include="Elsa.Webhooks.Persistence.EntityFramework.SqlServer" Version="$(ElsaPackageVersion)" />
<PackageVersion Include="Elsa.WorkflowSettings.Persistence.EntityFramework.SqlServer" Version="$(ElsaPackageVersion)" />
</ItemGroup>
<!-- DotNetCore.CAP -->
<ItemGroup>

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

@ -768,6 +768,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.OssManagement.I
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
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.Elsa.EntityFrameworkCore.SqlServer", "modules\elsa\LINGYUN.Abp.Elsa.EntityFrameworkCore.SqlServer\LINGYUN.Abp.Elsa.EntityFrameworkCore.SqlServer.csproj", "{416C0C27-4E3C-4919-857F-14DA41D84CFA}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -1970,6 +1972,10 @@ Global
{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
{416C0C27-4E3C-4919-857F-14DA41D84CFA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{416C0C27-4E3C-4919-857F-14DA41D84CFA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{416C0C27-4E3C-4919-857F-14DA41D84CFA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{416C0C27-4E3C-4919-857F-14DA41D84CFA}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -2341,6 +2347,7 @@ Global
{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}
{416C0C27-4E3C-4919-857F-14DA41D84CFA} = {0A00FAF9-A96B-4BF5-8D42-15C8678F70F3}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {C95FDF91-16F2-4A8B-A4BE-0E62D1B66718}

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

@ -604,6 +604,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.OssManagement.I
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
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.Elsa.EntityFrameworkCore.SqlServer", "modules\elsa\LINGYUN.Abp.Elsa.EntityFrameworkCore.SqlServer\LINGYUN.Abp.Elsa.EntityFrameworkCore.SqlServer.csproj", "{AA742577-63B0-4188-AA36-AC6E0ED99BB6}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -1590,6 +1592,10 @@ Global
{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
{AA742577-63B0-4188-AA36-AC6E0ED99BB6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AA742577-63B0-4188-AA36-AC6E0ED99BB6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AA742577-63B0-4188-AA36-AC6E0ED99BB6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AA742577-63B0-4188-AA36-AC6E0ED99BB6}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -1883,6 +1889,7 @@ Global
{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}
{AA742577-63B0-4188-AA36-AC6E0ED99BB6} = {07DFEB1E-ED92-4E97-A801-FAB2D70F4F35}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {711A43C0-A2F8-4E5C-9B9F-F2551E4B3FF1}

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

@ -173,6 +173,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Identity.Sessio
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
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.Elsa.EntityFrameworkCore.SqlServer", "modules\elsa\LINGYUN.Abp.Elsa.EntityFrameworkCore.SqlServer\LINGYUN.Abp.Elsa.EntityFrameworkCore.SqlServer.csproj", "{22BB3760-8DA1-4714-ADB7-1585A4EB8496}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -463,6 +465,10 @@ Global
{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
{22BB3760-8DA1-4714-ADB7-1585A4EB8496}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{22BB3760-8DA1-4714-ADB7-1585A4EB8496}.Debug|Any CPU.Build.0 = Debug|Any CPU
{22BB3760-8DA1-4714-ADB7-1585A4EB8496}.Release|Any CPU.ActiveCfg = Release|Any CPU
{22BB3760-8DA1-4714-ADB7-1585A4EB8496}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -541,6 +547,7 @@ Global
{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}
{22BB3760-8DA1-4714-ADB7-1585A4EB8496} = {F1CCBEC7-ACAB-4DC5-909E-D8CC2E1B7EEC}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {6BB7A5DE-DA12-44DC-BC9B-0F6CA524346F}

3
aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.EntityFrameworkCore.SqlServer/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.SqlServer/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.SqlServer/LINGYUN.Abp.Elsa.EntityFrameworkCore.SqlServer.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.SqlServer</AssemblyName>
<PackageId>LINGYUN.Abp.Elsa.EntityFrameworkCore.SqlServer</PackageId>
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
<RootNamespace />
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Elsa.Webhooks.Persistence.EntityFramework.SqlServer" />
<PackageReference Include="Elsa.WorkflowSettings.Persistence.EntityFramework.SqlServer" />
<PackageReference Include="Volo.Abp.EntityFrameworkCore.SqlServer" />
</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.SqlServer/LINGYUN/Abp/Elsa/EntityFrameworkCore/SqlServer/AbpElsaEntityFrameworkCoreSqlServerModule.cs

@ -0,0 +1,29 @@
using Elsa;
using Elsa.Options;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.EntityFrameworkCore.SqlServer;
using Volo.Abp.Modularity;
namespace LINGYUN.Abp.Elsa.EntityFrameworkCore.SqlServer;
[DependsOn(
typeof(AbpElsaEntityFrameworkCoreModule),
typeof(AbpEntityFrameworkCoreSqlServerModule))]
public class AbpElsaEntityFrameworkCoreSqlServerModule : 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.SqlServer/LINGYUN/Abp/Elsa/EntityFrameworkCore/SqlServer/PersistenceStartup.cs

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

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

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

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

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