From 70befbe8036d09570edeca27ae7fde8667bb3ca1 Mon Sep 17 00:00:00 2001 From: colin Date: Fri, 23 Oct 2026 15:16:27 +0800 Subject: [PATCH] feat(elsa): migrate workflow runtime to Elsa 3 Upgrade the workflow hosts and ElsaNext modules to Elsa 3, add the WorkflowService EF Core/DbMigrator projects, and align studio, localization and runtime configuration. --- Directory.Packages.props | 9 +- aspnet-core/LINGYUN.MicroService.Aspire.slnx | 15 + .../AppHost.cs | 22 +- .../LINGYUN.Abp.MicroService.AppHost.csproj | 1 + .../wwwroot/css/global-styles.css | 9 - ...oService.WorkflowService.DbMigrator.csproj | 42 + .../Program.cs | 42 + .../WorkflowServiceDbMigratorHostedService.cs | 49 + .../WorkflowServiceDbMigratorModule.cs | 12 + .../appsettings.json | 5 + .../FodyWeavers.xml | 3 + .../FodyWeavers.xsd | 30 + ...WorkflowService.EntityFrameworkCore.csproj | 30 + .../20261021033203_Initial.Designer.cs | 945 ++++++++++++++++++ .../Migrations/20261021033203_Initial.cs | 462 +++++++++ ...anizationUnitsIntoApprovalFlow.Designer.cs | 945 ++++++++++++++++++ ..._MergeOrganizationUnitsIntoApprovalFlow.cs | 474 +++++++++ ...ServiceMigrationsDbContextModelSnapshot.cs | 942 +++++++++++++++++ .../WorkflowServiceDbMigrationService.cs | 27 + .../WorkflowServiceMigrationsDbContext.cs | 52 + ...rkflowServiceMigrationsDbContextFactory.cs | 28 + ...viceMigrationsEntityFrameworkCoreModule.cs | 37 + .../ElsaShellPermissionPolicyProvider.cs | 5 +- .../ElsaStudioServiceCollectionExtensions.cs | 2 +- ...UN.Abp.MicroService.WorkflowService.csproj | 15 +- .../Navigation/UserMenuContributor.cs | 2 +- .../Program.cs | 4 +- .../SwaggerGen/EnumDescriptionSchemaFilter.cs | 2 +- .../SwaggerGen/TenantHeaderParamter.cs | 2 +- .../WorkflowServiceModule.Configure.cs | 2 +- .../WorkflowServiceModule.cs | 31 +- .../appsettings.Development.json | 12 +- .../LINGYUN.Abp.Elsa.Activities/README.md | 56 +- .../Widgets/ExecutionTrendWidget.razor | 2 +- .../Widgets/RecentActivityWidget.razor | 2 +- ...asksEntityFrameworkCorePostgreSqlModule.cs | 11 +- 36 files changed, 4245 insertions(+), 84 deletions(-) delete mode 100644 aspnet-core/aspire/LINGYUN.Abp.MicroService.AuthServer/wwwroot/css/global-styles.css create mode 100644 aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService.DbMigrator/LINGYUN.Abp.MicroService.WorkflowService.DbMigrator.csproj create mode 100644 aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService.DbMigrator/Program.cs create mode 100644 aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService.DbMigrator/WorkflowServiceDbMigratorHostedService.cs create mode 100644 aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService.DbMigrator/WorkflowServiceDbMigratorModule.cs create mode 100644 aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService.DbMigrator/appsettings.json create mode 100644 aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService.EntityFrameworkCore/FodyWeavers.xml create mode 100644 aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService.EntityFrameworkCore/FodyWeavers.xsd create mode 100644 aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService.EntityFrameworkCore/LINGYUN.Abp.MicroService.WorkflowService.EntityFrameworkCore.csproj create mode 100644 aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService.EntityFrameworkCore/Migrations/20261021033203_Initial.Designer.cs create mode 100644 aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService.EntityFrameworkCore/Migrations/20261021033203_Initial.cs create mode 100644 aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService.EntityFrameworkCore/Migrations/20261022114808_MergeOrganizationUnitsIntoApprovalFlow.Designer.cs create mode 100644 aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService.EntityFrameworkCore/Migrations/20261022114808_MergeOrganizationUnitsIntoApprovalFlow.cs create mode 100644 aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService.EntityFrameworkCore/Migrations/WorkflowServiceMigrationsDbContextModelSnapshot.cs create mode 100644 aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService.EntityFrameworkCore/WorkflowServiceDbMigrationService.cs create mode 100644 aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService.EntityFrameworkCore/WorkflowServiceMigrationsDbContext.cs create mode 100644 aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService.EntityFrameworkCore/WorkflowServiceMigrationsDbContextFactory.cs create mode 100644 aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService.EntityFrameworkCore/WorkflowServiceMigrationsEntityFrameworkCoreModule.cs diff --git a/Directory.Packages.props b/Directory.Packages.props index 3dfa28512..75a076d13 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -1,4 +1,4 @@ - + 10.0.0 2.17.0 @@ -267,14 +267,17 @@ + + + @@ -339,6 +342,8 @@ + + @@ -483,7 +488,7 @@ - + diff --git a/aspnet-core/LINGYUN.MicroService.Aspire.slnx b/aspnet-core/LINGYUN.MicroService.Aspire.slnx index 4b401d166..e1e58cb0e 100644 --- a/aspnet-core/LINGYUN.MicroService.Aspire.slnx +++ b/aspnet-core/LINGYUN.MicroService.Aspire.slnx @@ -73,6 +73,8 @@ + + @@ -573,6 +575,19 @@ + + + + + + + + + + + + + diff --git a/aspnet-core/aspire/LINGYUN.Abp.MicroService.AppHost/AppHost.cs b/aspnet-core/aspire/LINGYUN.Abp.MicroService.AppHost/AppHost.cs index 66ae8f36b..353a6a843 100644 --- a/aspnet-core/aspire/LINGYUN.Abp.MicroService.AppHost/AppHost.cs +++ b/aspnet-core/aspire/LINGYUN.Abp.MicroService.AppHost/AppHost.cs @@ -232,18 +232,16 @@ builder.AddProject("WeChatServi .WaitFor(localizationService); // WorkflowService -builder.AddProject("WorkflowService") - .WithHttpEndpoint(port: 30050, name: "workflow") - .WithExternalHttpEndpoints() - .WithReference(abpDb, "Default") - .WithReference(redis, "Redis") - .WithReference(rabbitmq, "Rabbitmq") - .WithReference(elasticsearch, "Elasticsearch") - .WaitFor(elasticsearch) - .WaitFor(redis) - .WaitFor(abpDb) - .WaitFor(rabbitmq) - .WaitFor(taskService); +AddDotNetProject< + Projects.LINGYUN_Abp_MicroService_WorkflowService_DbMigrator, + Projects.LINGYUN_Abp_MicroService_WorkflowService>( + builder: builder, + servicePrefix: "Workflow", + serviceSuffix: "Service", + migratorSuffix: "Migrator", + port: 30050, + portName: "workflow", + waitProjects: taskService); // AIService AddDotNetProject< diff --git a/aspnet-core/aspire/LINGYUN.Abp.MicroService.AppHost/LINGYUN.Abp.MicroService.AppHost.csproj b/aspnet-core/aspire/LINGYUN.Abp.MicroService.AppHost/LINGYUN.Abp.MicroService.AppHost.csproj index 807b9b7a0..4390b86f0 100644 --- a/aspnet-core/aspire/LINGYUN.Abp.MicroService.AppHost/LINGYUN.Abp.MicroService.AppHost.csproj +++ b/aspnet-core/aspire/LINGYUN.Abp.MicroService.AppHost/LINGYUN.Abp.MicroService.AppHost.csproj @@ -35,6 +35,7 @@ + diff --git a/aspnet-core/aspire/LINGYUN.Abp.MicroService.AuthServer/wwwroot/css/global-styles.css b/aspnet-core/aspire/LINGYUN.Abp.MicroService.AuthServer/wwwroot/css/global-styles.css deleted file mode 100644 index 10d251425..000000000 --- a/aspnet-core/aspire/LINGYUN.Abp.MicroService.AuthServer/wwwroot/css/global-styles.css +++ /dev/null @@ -1,9 +0,0 @@ -.account-module-form { - padding: 24px; - border: 0; - background: #fff; - color: #000; - box-shadow: 0 0 30px rgba(8, 20, 73, .1); - border-radius: 4px; - margin-top: 0.75rem !important; -} diff --git a/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService.DbMigrator/LINGYUN.Abp.MicroService.WorkflowService.DbMigrator.csproj b/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService.DbMigrator/LINGYUN.Abp.MicroService.WorkflowService.DbMigrator.csproj new file mode 100644 index 000000000..5e57652ac --- /dev/null +++ b/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService.DbMigrator/LINGYUN.Abp.MicroService.WorkflowService.DbMigrator.csproj @@ -0,0 +1,42 @@ + + + + + + Exe + net10.0 + enable + enable + false + LINGYUN.Abp.MicroService.WorkflowService + + + + + + + + + + + + + + + + + + + + + + + + + + PreserveNewest + Always + + + + diff --git a/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService.DbMigrator/Program.cs b/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService.DbMigrator/Program.cs new file mode 100644 index 000000000..afa1ab5a8 --- /dev/null +++ b/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService.DbMigrator/Program.cs @@ -0,0 +1,42 @@ +using LINGYUN.Abp.MicroService.WorkflowService; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using Microsoft.Extensions.Logging; +using Serilog; +using Serilog.Events; + +var defaultOutputTemplate = "{Timestamp:yyyy-MM-dd HH:mm:ss} [{Level:u3}] [{SourceContext}] [{ProcessId}] [{ThreadId}] - {Message:lj}{NewLine}{Exception}"; + +Log.Logger = new LoggerConfiguration() + .MinimumLevel.Information() + .MinimumLevel.Override("Microsoft", LogEventLevel.Warning) + .MinimumLevel.Override("Volo.Abp", LogEventLevel.Warning) +#if DEBUG + .MinimumLevel.Override("LINGYUN.Abp.MicroService.WorkflowService", LogEventLevel.Debug) +#else + .MinimumLevel.Override("LINGYUN.Abp.MicroService.WorkflowService", LogEventLevel.Information) +#endif + .Enrich.FromLogContext() + .WriteTo.Async(x => x.Console(outputTemplate: defaultOutputTemplate)) + .WriteTo.Async(x => x.File("Logs/migrations.txt", outputTemplate: defaultOutputTemplate)) + .CreateLogger(); + +try +{ + var builder = Host.CreateDefaultBuilder(args) + .AddAppSettingsSecretsJson() + .ConfigureLogging((context, logging) => logging.ClearProviders()) + .ConfigureServices((hostContext, services) => + { + services.AddHostedService(); + }); + await builder.RunConsoleAsync(); +} +catch (Exception ex) +{ + Log.Fatal(ex, "Host terminated unexpectedly!"); +} +finally +{ + await Log.CloseAndFlushAsync(); +} diff --git a/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService.DbMigrator/WorkflowServiceDbMigratorHostedService.cs b/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService.DbMigrator/WorkflowServiceDbMigratorHostedService.cs new file mode 100644 index 000000000..b45dd5f24 --- /dev/null +++ b/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService.DbMigrator/WorkflowServiceDbMigratorHostedService.cs @@ -0,0 +1,49 @@ +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using Serilog; +using Volo.Abp; +using Volo.Abp.Data; + +namespace LINGYUN.Abp.MicroService.WorkflowService; + +public class WorkflowServiceDbMigratorHostedService : IHostedService +{ + private readonly IHostApplicationLifetime _hostApplicationLifetime; + private readonly IConfiguration _configuration; + + public WorkflowServiceDbMigratorHostedService( + IHostApplicationLifetime hostApplicationLifetime, + IConfiguration configuration) + { + _hostApplicationLifetime = hostApplicationLifetime; + _configuration = configuration; + } + + public async Task StartAsync(CancellationToken cancellationToken) + { + using var application = await AbpApplicationFactory + .CreateAsync(options => + { + options.Services.ReplaceConfiguration(_configuration); + options.UseAutofac(); + options.Services.AddLogging(c => c.AddSerilog()); + options.AddDataMigrationEnvironment(); + }); + await application.InitializeAsync(); + + await application + .ServiceProvider + .GetRequiredService() + .CheckAndApplyDatabaseMigrationsAsync(); + + await application.ShutdownAsync(); + + _hostApplicationLifetime.StopApplication(); + } + + public Task StopAsync(CancellationToken cancellationToken) + { + return Task.CompletedTask; + } +} diff --git a/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService.DbMigrator/WorkflowServiceDbMigratorModule.cs b/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService.DbMigrator/WorkflowServiceDbMigratorModule.cs new file mode 100644 index 000000000..91c7c0702 --- /dev/null +++ b/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService.DbMigrator/WorkflowServiceDbMigratorModule.cs @@ -0,0 +1,12 @@ +using Volo.Abp.Autofac; +using Volo.Abp.Modularity; + +namespace LINGYUN.Abp.MicroService.WorkflowService; + +[DependsOn( + typeof(AbpAutofacModule), + typeof(WorkflowServiceMigrationsEntityFrameworkCoreModule) + )] +public class WorkflowServiceDbMigratorModule : AbpModule +{ +} diff --git a/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService.DbMigrator/appsettings.json b/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService.DbMigrator/appsettings.json new file mode 100644 index 000000000..38212c579 --- /dev/null +++ b/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService.DbMigrator/appsettings.json @@ -0,0 +1,5 @@ +{ + "ConnectionStrings": { + "Default": "Host=127.0.0.1;Database=abp;Username=postgres;Password=123456" + } +} diff --git a/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService.EntityFrameworkCore/FodyWeavers.xml b/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService.EntityFrameworkCore/FodyWeavers.xml new file mode 100644 index 000000000..51cfc9903 --- /dev/null +++ b/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService.EntityFrameworkCore/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + diff --git a/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService.EntityFrameworkCore/FodyWeavers.xsd b/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService.EntityFrameworkCore/FodyWeavers.xsd new file mode 100644 index 000000000..3f3946e28 --- /dev/null +++ b/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService.EntityFrameworkCore/FodyWeavers.xsd @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService.EntityFrameworkCore/LINGYUN.Abp.MicroService.WorkflowService.EntityFrameworkCore.csproj b/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService.EntityFrameworkCore/LINGYUN.Abp.MicroService.WorkflowService.EntityFrameworkCore.csproj new file mode 100644 index 000000000..055df6124 --- /dev/null +++ b/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService.EntityFrameworkCore/LINGYUN.Abp.MicroService.WorkflowService.EntityFrameworkCore.csproj @@ -0,0 +1,30 @@ + + + + + + + net10.0 + LINGYUN.Abp.MicroService.WorkflowService + + + + + all + runtime; build; native; contentfiles; analyzers + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + + + diff --git a/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService.EntityFrameworkCore/Migrations/20261021033203_Initial.Designer.cs b/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService.EntityFrameworkCore/Migrations/20261021033203_Initial.Designer.cs new file mode 100644 index 000000000..68949ecc2 --- /dev/null +++ b/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService.EntityFrameworkCore/Migrations/20261021033203_Initial.Designer.cs @@ -0,0 +1,945 @@ +// +using System; +using LINGYUN.Abp.MicroService.WorkflowService; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; +using Volo.Abp.EntityFrameworkCore; + +#nullable disable + +namespace LINGYUN.Abp.MicroService.WorkflowService.Migrations +{ + [DbContext(typeof(WorkflowServiceMigrationsDbContext))] + [Migration("20261021033203_Initial")] + partial class Initial + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.PostgreSql) + .HasAnnotation("ProductVersion", "10.0.11") + .HasAnnotation("Relational:MaxIdentifierLength", 63); + + NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); + + modelBuilder.Entity("LINGYUN.Abp.ElsaNext.ApprovalFlow.CarbonCopies.ApprovalCc", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("CreationTime") + .HasColumnType("timestamp with time zone") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uuid") + .HasColumnName("CreatorId"); + + b.Property("DataJson") + .HasColumnType("text"); + + b.Property("InstanceId") + .HasColumnType("uuid"); + + b.Property("InstanceReference") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("IsRead") + .HasColumnType("boolean"); + + b.Property("NodeId") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("NodeInstanceId") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("NotifiedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("ReadAt") + .HasColumnType("timestamp with time zone"); + + b.Property("RecipientDisplayName") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("RecipientId") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("RecipientProvider") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("RecipientType") + .HasMaxLength(32) + .HasColumnType("character varying(32)"); + + b.Property("SenderDisplayName") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("SenderId") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("SenderProvider") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("SenderType") + .HasMaxLength(32) + .HasColumnType("character varying(32)"); + + b.Property("Summary") + .HasMaxLength(2000) + .HasColumnType("character varying(2000)"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.Property("Title") + .IsRequired() + .HasMaxLength(512) + .HasColumnType("character varying(512)"); + + b.HasKey("Id"); + + b.HasIndex("InstanceId"); + + b.HasIndex("TenantId", "RecipientId", "IsRead"); + + b.ToTable("EX_ApprovalFlowCarbonCopies", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.ElsaNext.ApprovalFlow.Delegations.ApprovalDelegation", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("timestamp with time zone") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uuid") + .HasColumnName("CreatorId"); + + b.Property("DelegateDisplayName") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("DelegateId") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("DelegateProvider") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("DelegateType") + .HasMaxLength(32) + .HasColumnType("character varying(32)"); + + b.Property("DelegatorDisplayName") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("DelegatorId") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("DelegatorProvider") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("DelegatorType") + .HasMaxLength(32) + .HasColumnType("character varying(32)"); + + b.Property("DeleterId") + .HasColumnType("uuid") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("timestamp with time zone") + .HasColumnName("DeletionTime"); + + b.Property("EffectiveFrom") + .HasColumnType("timestamp with time zone"); + + b.Property("EffectiveTo") + .HasColumnType("timestamp with time zone"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IsEnabled") + .HasColumnType("boolean"); + + b.Property("LastModificationTime") + .HasColumnType("timestamp with time zone") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uuid") + .HasColumnName("LastModifierId"); + + b.Property("Remark") + .HasMaxLength(1024) + .HasColumnType("character varying(1024)"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "DelegateId", "IsEnabled"); + + b.HasIndex("TenantId", "DelegatorId", "IsEnabled"); + + b.ToTable("EX_ApprovalFlowDelegations", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.ElsaNext.ApprovalFlow.Instances.ApprovalInstance", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("BusinessKey") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("timestamp with time zone") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uuid") + .HasColumnName("CreatorId"); + + b.Property("CurrentNodeId") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("CurrentNodeName") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("DeleterId") + .HasColumnType("uuid") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("timestamp with time zone") + .HasColumnName("DeletionTime"); + + b.Property("ElsaWorkflowInstanceId") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("FinishedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("FormDataJson") + .HasColumnType("text"); + + b.Property("InitiatorDisplayName") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("InitiatorId") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("InitiatorProvider") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("InitiatorType") + .HasMaxLength(32) + .HasColumnType("character varying(32)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("timestamp with time zone") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uuid") + .HasColumnName("LastModifierId"); + + b.Property("Outcome") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("StartedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(32) + .HasColumnType("character varying(32)"); + + b.Property("TemplateCategory") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("TemplateId") + .HasColumnType("uuid"); + + b.Property("TemplateName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.Property("Title") + .IsRequired() + .HasMaxLength(512) + .HasColumnType("character varying(512)"); + + b.HasKey("Id"); + + b.HasIndex("ElsaWorkflowInstanceId"); + + b.HasIndex("TenantId", "InitiatorId"); + + b.HasIndex("TenantId", "Status"); + + b.HasIndex("TenantId", "TemplateId"); + + b.ToTable("EX_ApprovalFlowInstances", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.ElsaNext.ApprovalFlow.Nodes.ApprovalNodeTask", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("ApproverDisplayName") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("ApproverId") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("ApproverProvider") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("ApproverType") + .HasMaxLength(32) + .HasColumnType("character varying(32)"); + + b.Property("CreationTime") + .HasColumnType("timestamp with time zone") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uuid") + .HasColumnName("CreatorId"); + + b.Property("InstanceId") + .HasColumnType("uuid"); + + b.Property("NodeId") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("NodeInstanceId") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("NodeName") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("Origin") + .IsRequired() + .HasMaxLength(32) + .HasColumnType("character varying(32)"); + + b.Property("SignMode") + .IsRequired() + .HasMaxLength(32) + .HasColumnType("character varying(32)"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(32) + .HasColumnType("character varying(32)"); + + b.Property("TaskId") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("InstanceId"); + + b.HasIndex("TaskId") + .IsUnique(); + + b.HasIndex("NodeInstanceId", "Status"); + + b.ToTable("EX_ApprovalFlowNodeTasks", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.ElsaNext.ApprovalFlow.Records.ApprovalRecord", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("ActionKey") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("ActionLabel") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("ActorDisplayName") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("ActorId") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("ActorProvider") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("ActorType") + .HasMaxLength(32) + .HasColumnType("character varying(32)"); + + b.Property("Comment") + .HasMaxLength(2000) + .HasColumnType("character varying(2000)"); + + b.Property("CreationTime") + .HasColumnType("timestamp with time zone") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uuid") + .HasColumnName("CreatorId"); + + b.Property("DataJson") + .HasColumnType("text"); + + b.Property("Effect") + .IsRequired() + .HasMaxLength(32) + .HasColumnType("character varying(32)"); + + b.Property("InstanceId") + .HasColumnType("uuid"); + + b.Property("NodeId") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("NodeInstanceId") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("NodeName") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("OccurredAt") + .HasColumnType("timestamp with time zone"); + + b.Property("TaskId") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("InstanceId", "OccurredAt"); + + b.ToTable("EX_ApprovalFlowRecords", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.ElsaNext.ApprovalFlow.Templates.ApprovalTemplate", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("BusinessKeyHint") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("Category") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("timestamp with time zone") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uuid") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uuid") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("timestamp with time zone") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(1024) + .HasColumnType("character varying(1024)"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("ElsaDefinitionId") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("ElsaDefinitionKey") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("ElsaDefinitionVersion") + .HasColumnType("integer"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("FlowDefinitionJson") + .HasColumnType("text"); + + b.Property("FormDefinitionId") + .HasColumnType("uuid"); + + b.Property("Icon") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IsEnabled") + .HasColumnType("boolean"); + + b.Property("IsPublished") + .HasColumnType("boolean"); + + b.Property("LastModificationTime") + .HasColumnType("timestamp with time zone") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uuid") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "Name") + .IsUnique(); + + b.HasIndex("TenantId", "IsPublished", "IsEnabled"); + + b.ToTable("EX_ApprovalFlowTemplates", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.ElsaNext.ApprovalFlow.FormDatas.FormData", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("timestamp with time zone") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uuid") + .HasColumnName("CreatorId"); + + b.Property("DataJson") + .IsRequired() + .HasColumnType("text"); + + b.Property("DeleterId") + .HasColumnType("uuid") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("timestamp with time zone") + .HasColumnName("DeletionTime"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("FormCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("FormDefinitionId") + .HasColumnType("uuid"); + + b.Property("FormVersion") + .HasColumnType("integer"); + + b.Property("InstanceId") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("timestamp with time zone") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uuid") + .HasColumnName("LastModifierId"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("FormDefinitionId", "InstanceId") + .IsUnique(); + + b.HasIndex("TenantId", "FormCode"); + + b.ToTable("EX_FormDefinitionData", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.ElsaNext.ApprovalFlow.FormDefinitions.FormDefinition", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("Code") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("timestamp with time zone") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uuid") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uuid") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("timestamp with time zone") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(512) + .HasColumnType("character varying(512)"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IsPublished") + .HasColumnType("boolean"); + + b.Property("LastModificationTime") + .HasColumnType("timestamp with time zone") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uuid") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("PublishedTime") + .HasColumnType("timestamp with time zone"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.Property("Version") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "IsPublished"); + + b.HasIndex("TenantId", "Code", "Version") + .IsUnique(); + + b.ToTable("EX_FormDefinitionDefinitions", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.ElsaNext.ApprovalFlow.FormDefinitions.FormFieldDefinition", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("FormDefinitionId") + .HasColumnType("uuid"); + + b.Property("Hint") + .HasMaxLength(512) + .HasColumnType("character varying(512)"); + + b.Property("IsRequired") + .HasColumnType("boolean"); + + b.Property("Key") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("Label") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("OptionsJson") + .HasMaxLength(4096) + .HasColumnType("character varying(4096)"); + + b.Property("Order") + .HasColumnType("integer"); + + b.Property("Permission") + .IsRequired() + .HasMaxLength(1) + .HasColumnType("character varying(1)"); + + b.Property("Type") + .IsRequired() + .HasMaxLength(32) + .HasColumnType("character varying(32)"); + + b.HasKey("Id"); + + b.HasIndex("FormDefinitionId", "Key") + .IsUnique(); + + b.ToTable("EX_FormDefinitionDefinitionFields", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.ElsaNext.OrganizationUnits.OrganizationUnitManagers.OrganizationUnitManagerAssignment", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("timestamp with time zone") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uuid") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uuid") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("timestamp with time zone") + .HasColumnName("DeletionTime"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IsPrimary") + .HasColumnType("boolean"); + + b.Property("LastModificationTime") + .HasColumnType("timestamp with time zone") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uuid") + .HasColumnName("LastModifierId"); + + b.Property("Order") + .HasColumnType("integer"); + + b.Property("OrganizationUnitId") + .HasColumnType("uuid"); + + b.Property("Remark") + .HasMaxLength(512) + .HasColumnType("character varying(512)"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "UserId"); + + b.HasIndex("TenantId", "OrganizationUnitId", "UserId") + .IsUnique(); + + b.HasIndex("TenantId", "OrganizationUnitId", "IsPrimary", "Order") + .HasDatabaseName("IX_EX_OrganizationUnitManagerAssignments_TenantId_Organizatio~1"); + + b.ToTable("EX_OrganizationUnitManagerAssignments", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.ElsaNext.ApprovalFlow.FormDefinitions.FormFieldDefinition", b => + { + b.HasOne("LINGYUN.Abp.ElsaNext.ApprovalFlow.FormDefinitions.FormDefinition", null) + .WithMany("Fields") + .HasForeignKey("FormDefinitionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("LINGYUN.Abp.ElsaNext.ApprovalFlow.FormDefinitions.FormDefinition", b => + { + b.Navigation("Fields"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService.EntityFrameworkCore/Migrations/20261021033203_Initial.cs b/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService.EntityFrameworkCore/Migrations/20261021033203_Initial.cs new file mode 100644 index 000000000..535a706e3 --- /dev/null +++ b/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService.EntityFrameworkCore/Migrations/20261021033203_Initial.cs @@ -0,0 +1,462 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace LINGYUN.Abp.MicroService.WorkflowService.Migrations +{ + /// + public partial class Initial : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "EX_ApprovalFlowCarbonCopies", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + TenantId = table.Column(type: "uuid", nullable: true), + InstanceId = table.Column(type: "uuid", nullable: true), + InstanceReference = table.Column(type: "character varying(128)", maxLength: 128, nullable: true), + NodeId = table.Column(type: "character varying(128)", maxLength: 128, nullable: true), + NodeInstanceId = table.Column(type: "character varying(128)", maxLength: 128, nullable: true), + Title = table.Column(type: "character varying(512)", maxLength: 512, nullable: false), + Summary = table.Column(type: "character varying(2000)", maxLength: 2000, nullable: true), + RecipientProvider = table.Column(type: "character varying(128)", maxLength: 128, nullable: true), + RecipientType = table.Column(type: "character varying(32)", maxLength: 32, nullable: true), + RecipientId = table.Column(type: "character varying(128)", maxLength: 128, nullable: true), + RecipientDisplayName = table.Column(type: "character varying(256)", maxLength: 256, nullable: true), + SenderProvider = table.Column(type: "character varying(128)", maxLength: 128, nullable: true), + SenderType = table.Column(type: "character varying(32)", maxLength: 32, nullable: true), + SenderId = table.Column(type: "character varying(128)", maxLength: 128, nullable: true), + SenderDisplayName = table.Column(type: "character varying(256)", maxLength: 256, nullable: true), + DataJson = table.Column(type: "text", nullable: true), + NotifiedAt = table.Column(type: "timestamp with time zone", nullable: false), + IsRead = table.Column(type: "boolean", nullable: false), + ReadAt = table.Column(type: "timestamp with time zone", nullable: true), + CreationTime = table.Column(type: "timestamp with time zone", nullable: false), + CreatorId = table.Column(type: "uuid", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_EX_ApprovalFlowCarbonCopies", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "EX_ApprovalFlowDelegations", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + TenantId = table.Column(type: "uuid", nullable: true), + DelegatorProvider = table.Column(type: "character varying(128)", maxLength: 128, nullable: true), + DelegatorType = table.Column(type: "character varying(32)", maxLength: 32, nullable: true), + DelegatorId = table.Column(type: "character varying(128)", maxLength: 128, nullable: true), + DelegatorDisplayName = table.Column(type: "character varying(256)", maxLength: 256, nullable: true), + DelegateProvider = table.Column(type: "character varying(128)", maxLength: 128, nullable: true), + DelegateType = table.Column(type: "character varying(32)", maxLength: 32, nullable: true), + DelegateId = table.Column(type: "character varying(128)", maxLength: 128, nullable: true), + DelegateDisplayName = table.Column(type: "character varying(256)", maxLength: 256, nullable: true), + EffectiveFrom = table.Column(type: "timestamp with time zone", nullable: false), + EffectiveTo = table.Column(type: "timestamp with time zone", nullable: true), + IsEnabled = table.Column(type: "boolean", nullable: false), + Remark = table.Column(type: "character varying(1024)", maxLength: 1024, nullable: true), + ExtraProperties = table.Column(type: "text", nullable: false), + ConcurrencyStamp = table.Column(type: "character varying(40)", maxLength: 40, nullable: false), + CreationTime = table.Column(type: "timestamp with time zone", nullable: false), + CreatorId = table.Column(type: "uuid", nullable: true), + LastModificationTime = table.Column(type: "timestamp with time zone", nullable: true), + LastModifierId = table.Column(type: "uuid", nullable: true), + IsDeleted = table.Column(type: "boolean", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uuid", nullable: true), + DeletionTime = table.Column(type: "timestamp with time zone", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_EX_ApprovalFlowDelegations", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "EX_ApprovalFlowInstances", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + TenantId = table.Column(type: "uuid", nullable: true), + TemplateId = table.Column(type: "uuid", nullable: false), + TemplateName = table.Column(type: "character varying(256)", maxLength: 256, nullable: false), + TemplateCategory = table.Column(type: "character varying(128)", maxLength: 128, nullable: true), + BusinessKey = table.Column(type: "character varying(256)", maxLength: 256, nullable: true), + Title = table.Column(type: "character varying(512)", maxLength: 512, nullable: false), + InitiatorProvider = table.Column(type: "character varying(128)", maxLength: 128, nullable: true), + InitiatorType = table.Column(type: "character varying(32)", maxLength: 32, nullable: true), + InitiatorId = table.Column(type: "character varying(128)", maxLength: 128, nullable: true), + InitiatorDisplayName = table.Column(type: "character varying(256)", maxLength: 256, nullable: true), + ElsaWorkflowInstanceId = table.Column(type: "character varying(128)", maxLength: 128, nullable: true), + Status = table.Column(type: "character varying(32)", maxLength: 32, nullable: false), + CurrentNodeId = table.Column(type: "character varying(128)", maxLength: 128, nullable: true), + CurrentNodeName = table.Column(type: "character varying(256)", maxLength: 256, nullable: true), + FormDataJson = table.Column(type: "text", nullable: true), + StartedAt = table.Column(type: "timestamp with time zone", nullable: false), + FinishedAt = table.Column(type: "timestamp with time zone", nullable: true), + Outcome = table.Column(type: "character varying(64)", maxLength: 64, nullable: true), + ExtraProperties = table.Column(type: "text", nullable: false), + ConcurrencyStamp = table.Column(type: "character varying(40)", maxLength: 40, nullable: false), + CreationTime = table.Column(type: "timestamp with time zone", nullable: false), + CreatorId = table.Column(type: "uuid", nullable: true), + LastModificationTime = table.Column(type: "timestamp with time zone", nullable: true), + LastModifierId = table.Column(type: "uuid", nullable: true), + IsDeleted = table.Column(type: "boolean", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uuid", nullable: true), + DeletionTime = table.Column(type: "timestamp with time zone", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_EX_ApprovalFlowInstances", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "EX_ApprovalFlowNodeTasks", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + TenantId = table.Column(type: "uuid", nullable: true), + InstanceId = table.Column(type: "uuid", nullable: false), + NodeInstanceId = table.Column(type: "character varying(128)", maxLength: 128, nullable: false), + NodeId = table.Column(type: "character varying(128)", maxLength: 128, nullable: true), + NodeName = table.Column(type: "character varying(256)", maxLength: 256, nullable: true), + TaskId = table.Column(type: "character varying(128)", maxLength: 128, nullable: false), + ApproverProvider = table.Column(type: "character varying(128)", maxLength: 128, nullable: true), + ApproverType = table.Column(type: "character varying(32)", maxLength: 32, nullable: true), + ApproverId = table.Column(type: "character varying(128)", maxLength: 128, nullable: true), + ApproverDisplayName = table.Column(type: "character varying(256)", maxLength: 256, nullable: true), + SignMode = table.Column(type: "character varying(32)", maxLength: 32, nullable: false), + Status = table.Column(type: "character varying(32)", maxLength: 32, nullable: false), + Origin = table.Column(type: "character varying(32)", maxLength: 32, nullable: false), + CreationTime = table.Column(type: "timestamp with time zone", nullable: false), + CreatorId = table.Column(type: "uuid", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_EX_ApprovalFlowNodeTasks", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "EX_ApprovalFlowRecords", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + TenantId = table.Column(type: "uuid", nullable: true), + InstanceId = table.Column(type: "uuid", nullable: false), + NodeId = table.Column(type: "character varying(128)", maxLength: 128, nullable: true), + NodeName = table.Column(type: "character varying(256)", maxLength: 256, nullable: true), + NodeInstanceId = table.Column(type: "character varying(128)", maxLength: 128, nullable: true), + TaskId = table.Column(type: "character varying(128)", maxLength: 128, nullable: true), + ActorProvider = table.Column(type: "character varying(128)", maxLength: 128, nullable: true), + ActorType = table.Column(type: "character varying(32)", maxLength: 32, nullable: true), + ActorId = table.Column(type: "character varying(128)", maxLength: 128, nullable: true), + ActorDisplayName = table.Column(type: "character varying(256)", maxLength: 256, nullable: true), + ActionKey = table.Column(type: "character varying(64)", maxLength: 64, nullable: false), + ActionLabel = table.Column(type: "character varying(256)", maxLength: 256, nullable: true), + Effect = table.Column(type: "character varying(32)", maxLength: 32, nullable: false), + Comment = table.Column(type: "character varying(2000)", maxLength: 2000, nullable: true), + DataJson = table.Column(type: "text", nullable: true), + OccurredAt = table.Column(type: "timestamp with time zone", nullable: false), + CreationTime = table.Column(type: "timestamp with time zone", nullable: false), + CreatorId = table.Column(type: "uuid", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_EX_ApprovalFlowRecords", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "EX_ApprovalFlowTemplates", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + TenantId = table.Column(type: "uuid", nullable: true), + Name = table.Column(type: "character varying(128)", maxLength: 128, nullable: false), + DisplayName = table.Column(type: "character varying(256)", maxLength: 256, nullable: false), + Description = table.Column(type: "character varying(1024)", maxLength: 1024, nullable: true), + Category = table.Column(type: "character varying(128)", maxLength: 128, nullable: true), + Icon = table.Column(type: "character varying(256)", maxLength: 256, nullable: true), + IsPublished = table.Column(type: "boolean", nullable: false), + IsEnabled = table.Column(type: "boolean", nullable: false), + ElsaDefinitionId = table.Column(type: "character varying(128)", maxLength: 128, nullable: true), + ElsaDefinitionKey = table.Column(type: "character varying(256)", maxLength: 256, nullable: true), + ElsaDefinitionVersion = table.Column(type: "integer", nullable: true), + FormDefinitionId = table.Column(type: "uuid", nullable: true), + BusinessKeyHint = table.Column(type: "character varying(256)", maxLength: 256, nullable: true), + FlowDefinitionJson = table.Column(type: "text", nullable: true), + ExtraProperties = table.Column(type: "text", nullable: false), + ConcurrencyStamp = table.Column(type: "character varying(40)", maxLength: 40, nullable: false), + CreationTime = table.Column(type: "timestamp with time zone", nullable: false), + CreatorId = table.Column(type: "uuid", nullable: true), + LastModificationTime = table.Column(type: "timestamp with time zone", nullable: true), + LastModifierId = table.Column(type: "uuid", nullable: true), + IsDeleted = table.Column(type: "boolean", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uuid", nullable: true), + DeletionTime = table.Column(type: "timestamp with time zone", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_EX_ApprovalFlowTemplates", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "EX_FormDefinitionData", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + TenantId = table.Column(type: "uuid", nullable: true), + FormDefinitionId = table.Column(type: "uuid", nullable: false), + FormCode = table.Column(type: "character varying(64)", maxLength: 64, nullable: false), + FormVersion = table.Column(type: "integer", nullable: false), + InstanceId = table.Column(type: "character varying(128)", maxLength: 128, nullable: false), + DataJson = table.Column(type: "text", nullable: false), + ExtraProperties = table.Column(type: "text", nullable: false), + ConcurrencyStamp = table.Column(type: "character varying(40)", maxLength: 40, nullable: false), + CreationTime = table.Column(type: "timestamp with time zone", nullable: false), + CreatorId = table.Column(type: "uuid", nullable: true), + LastModificationTime = table.Column(type: "timestamp with time zone", nullable: true), + LastModifierId = table.Column(type: "uuid", nullable: true), + IsDeleted = table.Column(type: "boolean", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uuid", nullable: true), + DeletionTime = table.Column(type: "timestamp with time zone", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_EX_FormDefinitionData", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "EX_FormDefinitionDefinitions", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + TenantId = table.Column(type: "uuid", nullable: true), + Name = table.Column(type: "character varying(128)", maxLength: 128, nullable: false), + Code = table.Column(type: "character varying(64)", maxLength: 64, nullable: false), + Version = table.Column(type: "integer", nullable: false), + Description = table.Column(type: "character varying(512)", maxLength: 512, nullable: true), + IsPublished = table.Column(type: "boolean", nullable: false), + PublishedTime = table.Column(type: "timestamp with time zone", nullable: true), + ExtraProperties = table.Column(type: "text", nullable: false), + ConcurrencyStamp = table.Column(type: "character varying(40)", maxLength: 40, nullable: false), + CreationTime = table.Column(type: "timestamp with time zone", nullable: false), + CreatorId = table.Column(type: "uuid", nullable: true), + LastModificationTime = table.Column(type: "timestamp with time zone", nullable: true), + LastModifierId = table.Column(type: "uuid", nullable: true), + IsDeleted = table.Column(type: "boolean", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uuid", nullable: true), + DeletionTime = table.Column(type: "timestamp with time zone", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_EX_FormDefinitionDefinitions", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "EX_OrganizationUnitManagerAssignments", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + TenantId = table.Column(type: "uuid", nullable: true), + OrganizationUnitId = table.Column(type: "uuid", nullable: false), + UserId = table.Column(type: "uuid", nullable: false), + IsPrimary = table.Column(type: "boolean", nullable: false), + Order = table.Column(type: "integer", nullable: false), + Remark = table.Column(type: "character varying(512)", maxLength: 512, nullable: true), + ExtraProperties = table.Column(type: "text", nullable: false), + ConcurrencyStamp = table.Column(type: "character varying(40)", maxLength: 40, nullable: false), + CreationTime = table.Column(type: "timestamp with time zone", nullable: false), + CreatorId = table.Column(type: "uuid", nullable: true), + LastModificationTime = table.Column(type: "timestamp with time zone", nullable: true), + LastModifierId = table.Column(type: "uuid", nullable: true), + IsDeleted = table.Column(type: "boolean", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uuid", nullable: true), + DeletionTime = table.Column(type: "timestamp with time zone", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_EX_OrganizationUnitManagerAssignments", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "EX_FormDefinitionDefinitionFields", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + FormDefinitionId = table.Column(type: "uuid", nullable: false), + Key = table.Column(type: "character varying(64)", maxLength: 64, nullable: false), + Label = table.Column(type: "character varying(128)", maxLength: 128, nullable: false), + Type = table.Column(type: "character varying(32)", maxLength: 32, nullable: false), + Permission = table.Column(type: "character varying(1)", maxLength: 1, nullable: false), + Order = table.Column(type: "integer", nullable: false), + IsRequired = table.Column(type: "boolean", nullable: false), + Hint = table.Column(type: "character varying(512)", maxLength: 512, nullable: true), + OptionsJson = table.Column(type: "character varying(4096)", maxLength: 4096, nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_EX_FormDefinitionDefinitionFields", x => x.Id); + table.ForeignKey( + name: "FK_EX_FormDefinitionDefinitionFields_EX_FormDefinitionDefiniti~", + column: x => x.FormDefinitionId, + principalTable: "EX_FormDefinitionDefinitions", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateIndex( + name: "IX_EX_ApprovalFlowCarbonCopies_InstanceId", + table: "EX_ApprovalFlowCarbonCopies", + column: "InstanceId"); + + migrationBuilder.CreateIndex( + name: "IX_EX_ApprovalFlowCarbonCopies_TenantId_RecipientId_IsRead", + table: "EX_ApprovalFlowCarbonCopies", + columns: new[] { "TenantId", "RecipientId", "IsRead" }); + + migrationBuilder.CreateIndex( + name: "IX_EX_ApprovalFlowDelegations_TenantId_DelegateId_IsEnabled", + table: "EX_ApprovalFlowDelegations", + columns: new[] { "TenantId", "DelegateId", "IsEnabled" }); + + migrationBuilder.CreateIndex( + name: "IX_EX_ApprovalFlowDelegations_TenantId_DelegatorId_IsEnabled", + table: "EX_ApprovalFlowDelegations", + columns: new[] { "TenantId", "DelegatorId", "IsEnabled" }); + + migrationBuilder.CreateIndex( + name: "IX_EX_ApprovalFlowInstances_ElsaWorkflowInstanceId", + table: "EX_ApprovalFlowInstances", + column: "ElsaWorkflowInstanceId"); + + migrationBuilder.CreateIndex( + name: "IX_EX_ApprovalFlowInstances_TenantId_InitiatorId", + table: "EX_ApprovalFlowInstances", + columns: new[] { "TenantId", "InitiatorId" }); + + migrationBuilder.CreateIndex( + name: "IX_EX_ApprovalFlowInstances_TenantId_Status", + table: "EX_ApprovalFlowInstances", + columns: new[] { "TenantId", "Status" }); + + migrationBuilder.CreateIndex( + name: "IX_EX_ApprovalFlowInstances_TenantId_TemplateId", + table: "EX_ApprovalFlowInstances", + columns: new[] { "TenantId", "TemplateId" }); + + migrationBuilder.CreateIndex( + name: "IX_EX_ApprovalFlowNodeTasks_InstanceId", + table: "EX_ApprovalFlowNodeTasks", + column: "InstanceId"); + + migrationBuilder.CreateIndex( + name: "IX_EX_ApprovalFlowNodeTasks_NodeInstanceId_Status", + table: "EX_ApprovalFlowNodeTasks", + columns: new[] { "NodeInstanceId", "Status" }); + + migrationBuilder.CreateIndex( + name: "IX_EX_ApprovalFlowNodeTasks_TaskId", + table: "EX_ApprovalFlowNodeTasks", + column: "TaskId", + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_EX_ApprovalFlowRecords_InstanceId_OccurredAt", + table: "EX_ApprovalFlowRecords", + columns: new[] { "InstanceId", "OccurredAt" }); + + migrationBuilder.CreateIndex( + name: "IX_EX_ApprovalFlowTemplates_TenantId_IsPublished_IsEnabled", + table: "EX_ApprovalFlowTemplates", + columns: new[] { "TenantId", "IsPublished", "IsEnabled" }); + + migrationBuilder.CreateIndex( + name: "IX_EX_ApprovalFlowTemplates_TenantId_Name", + table: "EX_ApprovalFlowTemplates", + columns: new[] { "TenantId", "Name" }, + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_EX_FormDefinitionData_FormDefinitionId_InstanceId", + table: "EX_FormDefinitionData", + columns: new[] { "FormDefinitionId", "InstanceId" }, + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_EX_FormDefinitionData_TenantId_FormCode", + table: "EX_FormDefinitionData", + columns: new[] { "TenantId", "FormCode" }); + + migrationBuilder.CreateIndex( + name: "IX_EX_FormDefinitionDefinitionFields_FormDefinitionId_Key", + table: "EX_FormDefinitionDefinitionFields", + columns: new[] { "FormDefinitionId", "Key" }, + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_EX_FormDefinitionDefinitions_TenantId_Code_Version", + table: "EX_FormDefinitionDefinitions", + columns: new[] { "TenantId", "Code", "Version" }, + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_EX_FormDefinitionDefinitions_TenantId_IsPublished", + table: "EX_FormDefinitionDefinitions", + columns: new[] { "TenantId", "IsPublished" }); + + migrationBuilder.CreateIndex( + name: "IX_EX_OrganizationUnitManagerAssignments_TenantId_Organizatio~1", + table: "EX_OrganizationUnitManagerAssignments", + columns: new[] { "TenantId", "OrganizationUnitId", "IsPrimary", "Order" }); + + migrationBuilder.CreateIndex( + name: "IX_EX_OrganizationUnitManagerAssignments_TenantId_Organization~", + table: "EX_OrganizationUnitManagerAssignments", + columns: new[] { "TenantId", "OrganizationUnitId", "UserId" }, + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_EX_OrganizationUnitManagerAssignments_TenantId_UserId", + table: "EX_OrganizationUnitManagerAssignments", + columns: new[] { "TenantId", "UserId" }); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "EX_ApprovalFlowCarbonCopies"); + + migrationBuilder.DropTable( + name: "EX_ApprovalFlowDelegations"); + + migrationBuilder.DropTable( + name: "EX_ApprovalFlowInstances"); + + migrationBuilder.DropTable( + name: "EX_ApprovalFlowNodeTasks"); + + migrationBuilder.DropTable( + name: "EX_ApprovalFlowRecords"); + + migrationBuilder.DropTable( + name: "EX_ApprovalFlowTemplates"); + + migrationBuilder.DropTable( + name: "EX_FormDefinitionData"); + + migrationBuilder.DropTable( + name: "EX_FormDefinitionDefinitionFields"); + + migrationBuilder.DropTable( + name: "EX_OrganizationUnitManagerAssignments"); + + migrationBuilder.DropTable( + name: "EX_FormDefinitionDefinitions"); + } + } +} diff --git a/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService.EntityFrameworkCore/Migrations/20261022114808_MergeOrganizationUnitsIntoApprovalFlow.Designer.cs b/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService.EntityFrameworkCore/Migrations/20261022114808_MergeOrganizationUnitsIntoApprovalFlow.Designer.cs new file mode 100644 index 000000000..ffc99488e --- /dev/null +++ b/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService.EntityFrameworkCore/Migrations/20261022114808_MergeOrganizationUnitsIntoApprovalFlow.Designer.cs @@ -0,0 +1,945 @@ +// +using System; +using LINGYUN.Abp.MicroService.WorkflowService; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; +using Volo.Abp.EntityFrameworkCore; + +#nullable disable + +namespace LINGYUN.Abp.MicroService.WorkflowService.Migrations +{ + [DbContext(typeof(WorkflowServiceMigrationsDbContext))] + [Migration("20261022114808_MergeOrganizationUnitsIntoApprovalFlow")] + partial class MergeOrganizationUnitsIntoApprovalFlow + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.PostgreSql) + .HasAnnotation("ProductVersion", "10.0.11") + .HasAnnotation("Relational:MaxIdentifierLength", 63); + + NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); + + modelBuilder.Entity("LINGYUN.Abp.ElsaNext.ApprovalFlow.CarbonCopies.ApprovalCc", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("CreationTime") + .HasColumnType("timestamp with time zone") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uuid") + .HasColumnName("CreatorId"); + + b.Property("DataJson") + .HasColumnType("text"); + + b.Property("InstanceId") + .HasColumnType("uuid"); + + b.Property("InstanceReference") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("IsRead") + .HasColumnType("boolean"); + + b.Property("NodeId") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("NodeInstanceId") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("NotifiedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("ReadAt") + .HasColumnType("timestamp with time zone"); + + b.Property("RecipientDisplayName") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("RecipientId") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("RecipientProvider") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("RecipientType") + .HasMaxLength(32) + .HasColumnType("character varying(32)"); + + b.Property("SenderDisplayName") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("SenderId") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("SenderProvider") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("SenderType") + .HasMaxLength(32) + .HasColumnType("character varying(32)"); + + b.Property("Summary") + .HasMaxLength(2000) + .HasColumnType("character varying(2000)"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.Property("Title") + .IsRequired() + .HasMaxLength(512) + .HasColumnType("character varying(512)"); + + b.HasKey("Id"); + + b.HasIndex("InstanceId"); + + b.HasIndex("TenantId", "RecipientId", "IsRead"); + + b.ToTable("EX_ApprovalCcs", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.ElsaNext.ApprovalFlow.Delegations.ApprovalDelegation", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("timestamp with time zone") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uuid") + .HasColumnName("CreatorId"); + + b.Property("DelegateDisplayName") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("DelegateId") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("DelegateProvider") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("DelegateType") + .HasMaxLength(32) + .HasColumnType("character varying(32)"); + + b.Property("DelegatorDisplayName") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("DelegatorId") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("DelegatorProvider") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("DelegatorType") + .HasMaxLength(32) + .HasColumnType("character varying(32)"); + + b.Property("DeleterId") + .HasColumnType("uuid") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("timestamp with time zone") + .HasColumnName("DeletionTime"); + + b.Property("EffectiveFrom") + .HasColumnType("timestamp with time zone"); + + b.Property("EffectiveTo") + .HasColumnType("timestamp with time zone"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IsEnabled") + .HasColumnType("boolean"); + + b.Property("LastModificationTime") + .HasColumnType("timestamp with time zone") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uuid") + .HasColumnName("LastModifierId"); + + b.Property("Remark") + .HasMaxLength(1024) + .HasColumnType("character varying(1024)"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "DelegateId", "IsEnabled"); + + b.HasIndex("TenantId", "DelegatorId", "IsEnabled"); + + b.ToTable("EX_ApprovalDelegations", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.ElsaNext.ApprovalFlow.FormDatas.FormData", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("timestamp with time zone") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uuid") + .HasColumnName("CreatorId"); + + b.Property("DataJson") + .IsRequired() + .HasColumnType("text"); + + b.Property("DeleterId") + .HasColumnType("uuid") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("timestamp with time zone") + .HasColumnName("DeletionTime"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("FormCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("FormDefinitionId") + .HasColumnType("uuid"); + + b.Property("FormVersion") + .HasColumnType("integer"); + + b.Property("InstanceId") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("timestamp with time zone") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uuid") + .HasColumnName("LastModifierId"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("FormDefinitionId", "InstanceId") + .IsUnique(); + + b.HasIndex("TenantId", "FormCode"); + + b.ToTable("EX_FormDatas", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.ElsaNext.ApprovalFlow.FormDefinitions.FormDefinition", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("Code") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("timestamp with time zone") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uuid") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uuid") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("timestamp with time zone") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(512) + .HasColumnType("character varying(512)"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IsPublished") + .HasColumnType("boolean"); + + b.Property("LastModificationTime") + .HasColumnType("timestamp with time zone") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uuid") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("PublishedTime") + .HasColumnType("timestamp with time zone"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.Property("Version") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "IsPublished"); + + b.HasIndex("TenantId", "Code", "Version") + .IsUnique(); + + b.ToTable("EX_FormDefinitions", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.ElsaNext.ApprovalFlow.FormDefinitions.FormFieldDefinition", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("FormDefinitionId") + .HasColumnType("uuid"); + + b.Property("Hint") + .HasMaxLength(512) + .HasColumnType("character varying(512)"); + + b.Property("IsRequired") + .HasColumnType("boolean"); + + b.Property("Key") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("Label") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("OptionsJson") + .HasMaxLength(4096) + .HasColumnType("character varying(4096)"); + + b.Property("Order") + .HasColumnType("integer"); + + b.Property("Permission") + .IsRequired() + .HasMaxLength(1) + .HasColumnType("character varying(1)"); + + b.Property("Type") + .IsRequired() + .HasMaxLength(32) + .HasColumnType("character varying(32)"); + + b.HasKey("Id"); + + b.HasIndex("FormDefinitionId", "Key") + .IsUnique(); + + b.ToTable("EX_FormFieldDefinitions", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.ElsaNext.ApprovalFlow.Instances.ApprovalInstance", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("BusinessKey") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("timestamp with time zone") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uuid") + .HasColumnName("CreatorId"); + + b.Property("CurrentNodeId") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("CurrentNodeName") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("DeleterId") + .HasColumnType("uuid") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("timestamp with time zone") + .HasColumnName("DeletionTime"); + + b.Property("ElsaWorkflowInstanceId") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("FinishedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("FormDataJson") + .HasColumnType("text"); + + b.Property("InitiatorDisplayName") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("InitiatorId") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("InitiatorProvider") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("InitiatorType") + .HasMaxLength(32) + .HasColumnType("character varying(32)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("timestamp with time zone") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uuid") + .HasColumnName("LastModifierId"); + + b.Property("Outcome") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("StartedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(32) + .HasColumnType("character varying(32)"); + + b.Property("TemplateCategory") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("TemplateId") + .HasColumnType("uuid"); + + b.Property("TemplateName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.Property("Title") + .IsRequired() + .HasMaxLength(512) + .HasColumnType("character varying(512)"); + + b.HasKey("Id"); + + b.HasIndex("ElsaWorkflowInstanceId"); + + b.HasIndex("TenantId", "InitiatorId"); + + b.HasIndex("TenantId", "Status"); + + b.HasIndex("TenantId", "TemplateId"); + + b.ToTable("EX_ApprovalInstances", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.ElsaNext.ApprovalFlow.Nodes.ApprovalNodeTask", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("ApproverDisplayName") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("ApproverId") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("ApproverProvider") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("ApproverType") + .HasMaxLength(32) + .HasColumnType("character varying(32)"); + + b.Property("CreationTime") + .HasColumnType("timestamp with time zone") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uuid") + .HasColumnName("CreatorId"); + + b.Property("InstanceId") + .HasColumnType("uuid"); + + b.Property("NodeId") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("NodeInstanceId") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("NodeName") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("Origin") + .IsRequired() + .HasMaxLength(32) + .HasColumnType("character varying(32)"); + + b.Property("SignMode") + .IsRequired() + .HasMaxLength(32) + .HasColumnType("character varying(32)"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(32) + .HasColumnType("character varying(32)"); + + b.Property("TaskId") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("InstanceId"); + + b.HasIndex("TaskId") + .IsUnique(); + + b.HasIndex("NodeInstanceId", "Status"); + + b.ToTable("EX_ApprovalNodeTasks", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.ElsaNext.ApprovalFlow.OrganizationUnitManagers.OrganizationUnitManagerAssignment", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("timestamp with time zone") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uuid") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uuid") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("timestamp with time zone") + .HasColumnName("DeletionTime"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IsPrimary") + .HasColumnType("boolean"); + + b.Property("LastModificationTime") + .HasColumnType("timestamp with time zone") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uuid") + .HasColumnName("LastModifierId"); + + b.Property("Order") + .HasColumnType("integer"); + + b.Property("OrganizationUnitId") + .HasColumnType("uuid"); + + b.Property("Remark") + .HasMaxLength(512) + .HasColumnType("character varying(512)"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "UserId"); + + b.HasIndex("TenantId", "OrganizationUnitId", "UserId") + .IsUnique(); + + b.HasIndex("TenantId", "OrganizationUnitId", "IsPrimary", "Order") + .HasDatabaseName("IX_EX_OrganizationUnitManagerAssignments_TenantId_Organizatio~1"); + + b.ToTable("EX_OrganizationUnitManagerAssignments", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.ElsaNext.ApprovalFlow.Records.ApprovalRecord", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("ActionKey") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("ActionLabel") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("ActorDisplayName") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("ActorId") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("ActorProvider") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("ActorType") + .HasMaxLength(32) + .HasColumnType("character varying(32)"); + + b.Property("Comment") + .HasMaxLength(2000) + .HasColumnType("character varying(2000)"); + + b.Property("CreationTime") + .HasColumnType("timestamp with time zone") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uuid") + .HasColumnName("CreatorId"); + + b.Property("DataJson") + .HasColumnType("text"); + + b.Property("Effect") + .IsRequired() + .HasMaxLength(32) + .HasColumnType("character varying(32)"); + + b.Property("InstanceId") + .HasColumnType("uuid"); + + b.Property("NodeId") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("NodeInstanceId") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("NodeName") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("OccurredAt") + .HasColumnType("timestamp with time zone"); + + b.Property("TaskId") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("InstanceId", "OccurredAt"); + + b.ToTable("EX_ApprovalRecords", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.ElsaNext.ApprovalFlow.Templates.ApprovalTemplate", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("BusinessKeyHint") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("Category") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("timestamp with time zone") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uuid") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uuid") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("timestamp with time zone") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(1024) + .HasColumnType("character varying(1024)"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("ElsaDefinitionId") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("ElsaDefinitionKey") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("ElsaDefinitionVersion") + .HasColumnType("integer"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("FlowDefinitionJson") + .HasColumnType("text"); + + b.Property("FormDefinitionId") + .HasColumnType("uuid"); + + b.Property("Icon") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IsEnabled") + .HasColumnType("boolean"); + + b.Property("IsPublished") + .HasColumnType("boolean"); + + b.Property("LastModificationTime") + .HasColumnType("timestamp with time zone") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uuid") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "Name") + .IsUnique(); + + b.HasIndex("TenantId", "IsPublished", "IsEnabled"); + + b.ToTable("EX_ApprovalTemplates", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.ElsaNext.ApprovalFlow.FormDefinitions.FormFieldDefinition", b => + { + b.HasOne("LINGYUN.Abp.ElsaNext.ApprovalFlow.FormDefinitions.FormDefinition", null) + .WithMany("Fields") + .HasForeignKey("FormDefinitionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("LINGYUN.Abp.ElsaNext.ApprovalFlow.FormDefinitions.FormDefinition", b => + { + b.Navigation("Fields"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService.EntityFrameworkCore/Migrations/20261022114808_MergeOrganizationUnitsIntoApprovalFlow.cs b/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService.EntityFrameworkCore/Migrations/20261022114808_MergeOrganizationUnitsIntoApprovalFlow.cs new file mode 100644 index 000000000..a36363c19 --- /dev/null +++ b/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService.EntityFrameworkCore/Migrations/20261022114808_MergeOrganizationUnitsIntoApprovalFlow.cs @@ -0,0 +1,474 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace LINGYUN.Abp.MicroService.WorkflowService.Migrations +{ + /// + /// + /// 将独立的 OrganizationUnits 模块合并到审批流模块,并让本迁移项目的模型快照与审批流模块保持一致。 + /// + /// + /// 本迁移项目此前未同步表单定义合并带来的表重命名(EX_FormDefinition* → EX_Form* / EX_Approval*), + /// 因此这里包含这些重命名;OrganizationUnitManagerAssignment 实体合并后表名仍为 + /// EX_OrganizationUnitManagerAssignments,列与索引均未变化,不产生额外架构变更。 + /// + public partial class MergeOrganizationUnitsIntoApprovalFlow : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropForeignKey( + name: "FK_EX_FormDefinitionDefinitionFields_EX_FormDefinitionDefiniti~", + table: "EX_FormDefinitionDefinitionFields"); + + migrationBuilder.DropPrimaryKey( + name: "PK_EX_FormDefinitionDefinitions", + table: "EX_FormDefinitionDefinitions"); + + migrationBuilder.DropPrimaryKey( + name: "PK_EX_FormDefinitionDefinitionFields", + table: "EX_FormDefinitionDefinitionFields"); + + migrationBuilder.DropPrimaryKey( + name: "PK_EX_FormDefinitionData", + table: "EX_FormDefinitionData"); + + migrationBuilder.DropPrimaryKey( + name: "PK_EX_ApprovalFlowTemplates", + table: "EX_ApprovalFlowTemplates"); + + migrationBuilder.DropPrimaryKey( + name: "PK_EX_ApprovalFlowRecords", + table: "EX_ApprovalFlowRecords"); + + migrationBuilder.DropPrimaryKey( + name: "PK_EX_ApprovalFlowNodeTasks", + table: "EX_ApprovalFlowNodeTasks"); + + migrationBuilder.DropPrimaryKey( + name: "PK_EX_ApprovalFlowInstances", + table: "EX_ApprovalFlowInstances"); + + migrationBuilder.DropPrimaryKey( + name: "PK_EX_ApprovalFlowDelegations", + table: "EX_ApprovalFlowDelegations"); + + migrationBuilder.DropPrimaryKey( + name: "PK_EX_ApprovalFlowCarbonCopies", + table: "EX_ApprovalFlowCarbonCopies"); + + migrationBuilder.RenameTable( + name: "EX_FormDefinitionDefinitions", + newName: "EX_FormDefinitions"); + + migrationBuilder.RenameTable( + name: "EX_FormDefinitionDefinitionFields", + newName: "EX_FormFieldDefinitions"); + + migrationBuilder.RenameTable( + name: "EX_FormDefinitionData", + newName: "EX_FormDatas"); + + migrationBuilder.RenameTable( + name: "EX_ApprovalFlowTemplates", + newName: "EX_ApprovalTemplates"); + + migrationBuilder.RenameTable( + name: "EX_ApprovalFlowRecords", + newName: "EX_ApprovalRecords"); + + migrationBuilder.RenameTable( + name: "EX_ApprovalFlowNodeTasks", + newName: "EX_ApprovalNodeTasks"); + + migrationBuilder.RenameTable( + name: "EX_ApprovalFlowInstances", + newName: "EX_ApprovalInstances"); + + migrationBuilder.RenameTable( + name: "EX_ApprovalFlowDelegations", + newName: "EX_ApprovalDelegations"); + + migrationBuilder.RenameTable( + name: "EX_ApprovalFlowCarbonCopies", + newName: "EX_ApprovalCcs"); + + migrationBuilder.RenameIndex( + name: "IX_EX_FormDefinitionDefinitions_TenantId_IsPublished", + table: "EX_FormDefinitions", + newName: "IX_EX_FormDefinitions_TenantId_IsPublished"); + + migrationBuilder.RenameIndex( + name: "IX_EX_FormDefinitionDefinitions_TenantId_Code_Version", + table: "EX_FormDefinitions", + newName: "IX_EX_FormDefinitions_TenantId_Code_Version"); + + migrationBuilder.RenameIndex( + name: "IX_EX_FormDefinitionDefinitionFields_FormDefinitionId_Key", + table: "EX_FormFieldDefinitions", + newName: "IX_EX_FormFieldDefinitions_FormDefinitionId_Key"); + + migrationBuilder.RenameIndex( + name: "IX_EX_FormDefinitionData_TenantId_FormCode", + table: "EX_FormDatas", + newName: "IX_EX_FormDatas_TenantId_FormCode"); + + migrationBuilder.RenameIndex( + name: "IX_EX_FormDefinitionData_FormDefinitionId_InstanceId", + table: "EX_FormDatas", + newName: "IX_EX_FormDatas_FormDefinitionId_InstanceId"); + + migrationBuilder.RenameIndex( + name: "IX_EX_ApprovalFlowTemplates_TenantId_Name", + table: "EX_ApprovalTemplates", + newName: "IX_EX_ApprovalTemplates_TenantId_Name"); + + migrationBuilder.RenameIndex( + name: "IX_EX_ApprovalFlowTemplates_TenantId_IsPublished_IsEnabled", + table: "EX_ApprovalTemplates", + newName: "IX_EX_ApprovalTemplates_TenantId_IsPublished_IsEnabled"); + + migrationBuilder.RenameIndex( + name: "IX_EX_ApprovalFlowRecords_InstanceId_OccurredAt", + table: "EX_ApprovalRecords", + newName: "IX_EX_ApprovalRecords_InstanceId_OccurredAt"); + + migrationBuilder.RenameIndex( + name: "IX_EX_ApprovalFlowNodeTasks_TaskId", + table: "EX_ApprovalNodeTasks", + newName: "IX_EX_ApprovalNodeTasks_TaskId"); + + migrationBuilder.RenameIndex( + name: "IX_EX_ApprovalFlowNodeTasks_NodeInstanceId_Status", + table: "EX_ApprovalNodeTasks", + newName: "IX_EX_ApprovalNodeTasks_NodeInstanceId_Status"); + + migrationBuilder.RenameIndex( + name: "IX_EX_ApprovalFlowNodeTasks_InstanceId", + table: "EX_ApprovalNodeTasks", + newName: "IX_EX_ApprovalNodeTasks_InstanceId"); + + migrationBuilder.RenameIndex( + name: "IX_EX_ApprovalFlowInstances_TenantId_TemplateId", + table: "EX_ApprovalInstances", + newName: "IX_EX_ApprovalInstances_TenantId_TemplateId"); + + migrationBuilder.RenameIndex( + name: "IX_EX_ApprovalFlowInstances_TenantId_Status", + table: "EX_ApprovalInstances", + newName: "IX_EX_ApprovalInstances_TenantId_Status"); + + migrationBuilder.RenameIndex( + name: "IX_EX_ApprovalFlowInstances_TenantId_InitiatorId", + table: "EX_ApprovalInstances", + newName: "IX_EX_ApprovalInstances_TenantId_InitiatorId"); + + migrationBuilder.RenameIndex( + name: "IX_EX_ApprovalFlowInstances_ElsaWorkflowInstanceId", + table: "EX_ApprovalInstances", + newName: "IX_EX_ApprovalInstances_ElsaWorkflowInstanceId"); + + migrationBuilder.RenameIndex( + name: "IX_EX_ApprovalFlowDelegations_TenantId_DelegatorId_IsEnabled", + table: "EX_ApprovalDelegations", + newName: "IX_EX_ApprovalDelegations_TenantId_DelegatorId_IsEnabled"); + + migrationBuilder.RenameIndex( + name: "IX_EX_ApprovalFlowDelegations_TenantId_DelegateId_IsEnabled", + table: "EX_ApprovalDelegations", + newName: "IX_EX_ApprovalDelegations_TenantId_DelegateId_IsEnabled"); + + migrationBuilder.RenameIndex( + name: "IX_EX_ApprovalFlowCarbonCopies_TenantId_RecipientId_IsRead", + table: "EX_ApprovalCcs", + newName: "IX_EX_ApprovalCcs_TenantId_RecipientId_IsRead"); + + migrationBuilder.RenameIndex( + name: "IX_EX_ApprovalFlowCarbonCopies_InstanceId", + table: "EX_ApprovalCcs", + newName: "IX_EX_ApprovalCcs_InstanceId"); + + migrationBuilder.AddPrimaryKey( + name: "PK_EX_FormDefinitions", + table: "EX_FormDefinitions", + column: "Id"); + + migrationBuilder.AddPrimaryKey( + name: "PK_EX_FormFieldDefinitions", + table: "EX_FormFieldDefinitions", + column: "Id"); + + migrationBuilder.AddPrimaryKey( + name: "PK_EX_FormDatas", + table: "EX_FormDatas", + column: "Id"); + + migrationBuilder.AddPrimaryKey( + name: "PK_EX_ApprovalTemplates", + table: "EX_ApprovalTemplates", + column: "Id"); + + migrationBuilder.AddPrimaryKey( + name: "PK_EX_ApprovalRecords", + table: "EX_ApprovalRecords", + column: "Id"); + + migrationBuilder.AddPrimaryKey( + name: "PK_EX_ApprovalNodeTasks", + table: "EX_ApprovalNodeTasks", + column: "Id"); + + migrationBuilder.AddPrimaryKey( + name: "PK_EX_ApprovalInstances", + table: "EX_ApprovalInstances", + column: "Id"); + + migrationBuilder.AddPrimaryKey( + name: "PK_EX_ApprovalDelegations", + table: "EX_ApprovalDelegations", + column: "Id"); + + migrationBuilder.AddPrimaryKey( + name: "PK_EX_ApprovalCcs", + table: "EX_ApprovalCcs", + column: "Id"); + + migrationBuilder.AddForeignKey( + name: "FK_EX_FormFieldDefinitions_EX_FormDefinitions_FormDefinitionId", + table: "EX_FormFieldDefinitions", + column: "FormDefinitionId", + principalTable: "EX_FormDefinitions", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropForeignKey( + name: "FK_EX_FormFieldDefinitions_EX_FormDefinitions_FormDefinitionId", + table: "EX_FormFieldDefinitions"); + + migrationBuilder.DropPrimaryKey( + name: "PK_EX_FormFieldDefinitions", + table: "EX_FormFieldDefinitions"); + + migrationBuilder.DropPrimaryKey( + name: "PK_EX_FormDefinitions", + table: "EX_FormDefinitions"); + + migrationBuilder.DropPrimaryKey( + name: "PK_EX_FormDatas", + table: "EX_FormDatas"); + + migrationBuilder.DropPrimaryKey( + name: "PK_EX_ApprovalTemplates", + table: "EX_ApprovalTemplates"); + + migrationBuilder.DropPrimaryKey( + name: "PK_EX_ApprovalRecords", + table: "EX_ApprovalRecords"); + + migrationBuilder.DropPrimaryKey( + name: "PK_EX_ApprovalNodeTasks", + table: "EX_ApprovalNodeTasks"); + + migrationBuilder.DropPrimaryKey( + name: "PK_EX_ApprovalInstances", + table: "EX_ApprovalInstances"); + + migrationBuilder.DropPrimaryKey( + name: "PK_EX_ApprovalDelegations", + table: "EX_ApprovalDelegations"); + + migrationBuilder.DropPrimaryKey( + name: "PK_EX_ApprovalCcs", + table: "EX_ApprovalCcs"); + + migrationBuilder.RenameTable( + name: "EX_FormFieldDefinitions", + newName: "EX_FormDefinitionDefinitionFields"); + + migrationBuilder.RenameTable( + name: "EX_FormDefinitions", + newName: "EX_FormDefinitionDefinitions"); + + migrationBuilder.RenameTable( + name: "EX_FormDatas", + newName: "EX_FormDefinitionData"); + + migrationBuilder.RenameTable( + name: "EX_ApprovalTemplates", + newName: "EX_ApprovalFlowTemplates"); + + migrationBuilder.RenameTable( + name: "EX_ApprovalRecords", + newName: "EX_ApprovalFlowRecords"); + + migrationBuilder.RenameTable( + name: "EX_ApprovalNodeTasks", + newName: "EX_ApprovalFlowNodeTasks"); + + migrationBuilder.RenameTable( + name: "EX_ApprovalInstances", + newName: "EX_ApprovalFlowInstances"); + + migrationBuilder.RenameTable( + name: "EX_ApprovalDelegations", + newName: "EX_ApprovalFlowDelegations"); + + migrationBuilder.RenameTable( + name: "EX_ApprovalCcs", + newName: "EX_ApprovalFlowCarbonCopies"); + + migrationBuilder.RenameIndex( + name: "IX_EX_FormFieldDefinitions_FormDefinitionId_Key", + table: "EX_FormDefinitionDefinitionFields", + newName: "IX_EX_FormDefinitionDefinitionFields_FormDefinitionId_Key"); + + migrationBuilder.RenameIndex( + name: "IX_EX_FormDefinitions_TenantId_IsPublished", + table: "EX_FormDefinitionDefinitions", + newName: "IX_EX_FormDefinitionDefinitions_TenantId_IsPublished"); + + migrationBuilder.RenameIndex( + name: "IX_EX_FormDefinitions_TenantId_Code_Version", + table: "EX_FormDefinitionDefinitions", + newName: "IX_EX_FormDefinitionDefinitions_TenantId_Code_Version"); + + migrationBuilder.RenameIndex( + name: "IX_EX_FormDatas_TenantId_FormCode", + table: "EX_FormDefinitionData", + newName: "IX_EX_FormDefinitionData_TenantId_FormCode"); + + migrationBuilder.RenameIndex( + name: "IX_EX_FormDatas_FormDefinitionId_InstanceId", + table: "EX_FormDefinitionData", + newName: "IX_EX_FormDefinitionData_FormDefinitionId_InstanceId"); + + migrationBuilder.RenameIndex( + name: "IX_EX_ApprovalTemplates_TenantId_Name", + table: "EX_ApprovalFlowTemplates", + newName: "IX_EX_ApprovalFlowTemplates_TenantId_Name"); + + migrationBuilder.RenameIndex( + name: "IX_EX_ApprovalTemplates_TenantId_IsPublished_IsEnabled", + table: "EX_ApprovalFlowTemplates", + newName: "IX_EX_ApprovalFlowTemplates_TenantId_IsPublished_IsEnabled"); + + migrationBuilder.RenameIndex( + name: "IX_EX_ApprovalRecords_InstanceId_OccurredAt", + table: "EX_ApprovalFlowRecords", + newName: "IX_EX_ApprovalFlowRecords_InstanceId_OccurredAt"); + + migrationBuilder.RenameIndex( + name: "IX_EX_ApprovalNodeTasks_TaskId", + table: "EX_ApprovalFlowNodeTasks", + newName: "IX_EX_ApprovalFlowNodeTasks_TaskId"); + + migrationBuilder.RenameIndex( + name: "IX_EX_ApprovalNodeTasks_NodeInstanceId_Status", + table: "EX_ApprovalFlowNodeTasks", + newName: "IX_EX_ApprovalFlowNodeTasks_NodeInstanceId_Status"); + + migrationBuilder.RenameIndex( + name: "IX_EX_ApprovalNodeTasks_InstanceId", + table: "EX_ApprovalFlowNodeTasks", + newName: "IX_EX_ApprovalFlowNodeTasks_InstanceId"); + + migrationBuilder.RenameIndex( + name: "IX_EX_ApprovalInstances_TenantId_TemplateId", + table: "EX_ApprovalFlowInstances", + newName: "IX_EX_ApprovalFlowInstances_TenantId_TemplateId"); + + migrationBuilder.RenameIndex( + name: "IX_EX_ApprovalInstances_TenantId_Status", + table: "EX_ApprovalFlowInstances", + newName: "IX_EX_ApprovalFlowInstances_TenantId_Status"); + + migrationBuilder.RenameIndex( + name: "IX_EX_ApprovalInstances_TenantId_InitiatorId", + table: "EX_ApprovalFlowInstances", + newName: "IX_EX_ApprovalFlowInstances_TenantId_InitiatorId"); + + migrationBuilder.RenameIndex( + name: "IX_EX_ApprovalInstances_ElsaWorkflowInstanceId", + table: "EX_ApprovalFlowInstances", + newName: "IX_EX_ApprovalFlowInstances_ElsaWorkflowInstanceId"); + + migrationBuilder.RenameIndex( + name: "IX_EX_ApprovalDelegations_TenantId_DelegatorId_IsEnabled", + table: "EX_ApprovalFlowDelegations", + newName: "IX_EX_ApprovalFlowDelegations_TenantId_DelegatorId_IsEnabled"); + + migrationBuilder.RenameIndex( + name: "IX_EX_ApprovalDelegations_TenantId_DelegateId_IsEnabled", + table: "EX_ApprovalFlowDelegations", + newName: "IX_EX_ApprovalFlowDelegations_TenantId_DelegateId_IsEnabled"); + + migrationBuilder.RenameIndex( + name: "IX_EX_ApprovalCcs_TenantId_RecipientId_IsRead", + table: "EX_ApprovalFlowCarbonCopies", + newName: "IX_EX_ApprovalFlowCarbonCopies_TenantId_RecipientId_IsRead"); + + migrationBuilder.RenameIndex( + name: "IX_EX_ApprovalCcs_InstanceId", + table: "EX_ApprovalFlowCarbonCopies", + newName: "IX_EX_ApprovalFlowCarbonCopies_InstanceId"); + + migrationBuilder.AddPrimaryKey( + name: "PK_EX_FormDefinitionDefinitionFields", + table: "EX_FormDefinitionDefinitionFields", + column: "Id"); + + migrationBuilder.AddPrimaryKey( + name: "PK_EX_FormDefinitionDefinitions", + table: "EX_FormDefinitionDefinitions", + column: "Id"); + + migrationBuilder.AddPrimaryKey( + name: "PK_EX_FormDefinitionData", + table: "EX_FormDefinitionData", + column: "Id"); + + migrationBuilder.AddPrimaryKey( + name: "PK_EX_ApprovalFlowTemplates", + table: "EX_ApprovalFlowTemplates", + column: "Id"); + + migrationBuilder.AddPrimaryKey( + name: "PK_EX_ApprovalFlowRecords", + table: "EX_ApprovalFlowRecords", + column: "Id"); + + migrationBuilder.AddPrimaryKey( + name: "PK_EX_ApprovalFlowNodeTasks", + table: "EX_ApprovalFlowNodeTasks", + column: "Id"); + + migrationBuilder.AddPrimaryKey( + name: "PK_EX_ApprovalFlowInstances", + table: "EX_ApprovalFlowInstances", + column: "Id"); + + migrationBuilder.AddPrimaryKey( + name: "PK_EX_ApprovalFlowDelegations", + table: "EX_ApprovalFlowDelegations", + column: "Id"); + + migrationBuilder.AddPrimaryKey( + name: "PK_EX_ApprovalFlowCarbonCopies", + table: "EX_ApprovalFlowCarbonCopies", + column: "Id"); + + migrationBuilder.AddForeignKey( + name: "FK_EX_FormDefinitionDefinitionFields_EX_FormDefinitionDefiniti~", + table: "EX_FormDefinitionDefinitionFields", + column: "FormDefinitionId", + principalTable: "EX_FormDefinitionDefinitions", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + } + } +} diff --git a/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService.EntityFrameworkCore/Migrations/WorkflowServiceMigrationsDbContextModelSnapshot.cs b/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService.EntityFrameworkCore/Migrations/WorkflowServiceMigrationsDbContextModelSnapshot.cs new file mode 100644 index 000000000..b2914bb20 --- /dev/null +++ b/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService.EntityFrameworkCore/Migrations/WorkflowServiceMigrationsDbContextModelSnapshot.cs @@ -0,0 +1,942 @@ +// +using System; +using LINGYUN.Abp.MicroService.WorkflowService; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; +using Volo.Abp.EntityFrameworkCore; + +#nullable disable + +namespace LINGYUN.Abp.MicroService.WorkflowService.Migrations +{ + [DbContext(typeof(WorkflowServiceMigrationsDbContext))] + partial class WorkflowServiceMigrationsDbContextModelSnapshot : ModelSnapshot + { + protected override void BuildModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.PostgreSql) + .HasAnnotation("ProductVersion", "10.0.11") + .HasAnnotation("Relational:MaxIdentifierLength", 63); + + NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); + + modelBuilder.Entity("LINGYUN.Abp.ElsaNext.ApprovalFlow.CarbonCopies.ApprovalCc", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("CreationTime") + .HasColumnType("timestamp with time zone") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uuid") + .HasColumnName("CreatorId"); + + b.Property("DataJson") + .HasColumnType("text"); + + b.Property("InstanceId") + .HasColumnType("uuid"); + + b.Property("InstanceReference") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("IsRead") + .HasColumnType("boolean"); + + b.Property("NodeId") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("NodeInstanceId") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("NotifiedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("ReadAt") + .HasColumnType("timestamp with time zone"); + + b.Property("RecipientDisplayName") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("RecipientId") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("RecipientProvider") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("RecipientType") + .HasMaxLength(32) + .HasColumnType("character varying(32)"); + + b.Property("SenderDisplayName") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("SenderId") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("SenderProvider") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("SenderType") + .HasMaxLength(32) + .HasColumnType("character varying(32)"); + + b.Property("Summary") + .HasMaxLength(2000) + .HasColumnType("character varying(2000)"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.Property("Title") + .IsRequired() + .HasMaxLength(512) + .HasColumnType("character varying(512)"); + + b.HasKey("Id"); + + b.HasIndex("InstanceId"); + + b.HasIndex("TenantId", "RecipientId", "IsRead"); + + b.ToTable("EX_ApprovalCcs", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.ElsaNext.ApprovalFlow.Delegations.ApprovalDelegation", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("timestamp with time zone") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uuid") + .HasColumnName("CreatorId"); + + b.Property("DelegateDisplayName") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("DelegateId") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("DelegateProvider") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("DelegateType") + .HasMaxLength(32) + .HasColumnType("character varying(32)"); + + b.Property("DelegatorDisplayName") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("DelegatorId") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("DelegatorProvider") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("DelegatorType") + .HasMaxLength(32) + .HasColumnType("character varying(32)"); + + b.Property("DeleterId") + .HasColumnType("uuid") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("timestamp with time zone") + .HasColumnName("DeletionTime"); + + b.Property("EffectiveFrom") + .HasColumnType("timestamp with time zone"); + + b.Property("EffectiveTo") + .HasColumnType("timestamp with time zone"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IsEnabled") + .HasColumnType("boolean"); + + b.Property("LastModificationTime") + .HasColumnType("timestamp with time zone") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uuid") + .HasColumnName("LastModifierId"); + + b.Property("Remark") + .HasMaxLength(1024) + .HasColumnType("character varying(1024)"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "DelegateId", "IsEnabled"); + + b.HasIndex("TenantId", "DelegatorId", "IsEnabled"); + + b.ToTable("EX_ApprovalDelegations", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.ElsaNext.ApprovalFlow.FormDatas.FormData", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("timestamp with time zone") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uuid") + .HasColumnName("CreatorId"); + + b.Property("DataJson") + .IsRequired() + .HasColumnType("text"); + + b.Property("DeleterId") + .HasColumnType("uuid") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("timestamp with time zone") + .HasColumnName("DeletionTime"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("FormCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("FormDefinitionId") + .HasColumnType("uuid"); + + b.Property("FormVersion") + .HasColumnType("integer"); + + b.Property("InstanceId") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("timestamp with time zone") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uuid") + .HasColumnName("LastModifierId"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("FormDefinitionId", "InstanceId") + .IsUnique(); + + b.HasIndex("TenantId", "FormCode"); + + b.ToTable("EX_FormDatas", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.ElsaNext.ApprovalFlow.FormDefinitions.FormDefinition", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("Code") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("timestamp with time zone") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uuid") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uuid") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("timestamp with time zone") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(512) + .HasColumnType("character varying(512)"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IsPublished") + .HasColumnType("boolean"); + + b.Property("LastModificationTime") + .HasColumnType("timestamp with time zone") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uuid") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("PublishedTime") + .HasColumnType("timestamp with time zone"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.Property("Version") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "IsPublished"); + + b.HasIndex("TenantId", "Code", "Version") + .IsUnique(); + + b.ToTable("EX_FormDefinitions", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.ElsaNext.ApprovalFlow.FormDefinitions.FormFieldDefinition", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("FormDefinitionId") + .HasColumnType("uuid"); + + b.Property("Hint") + .HasMaxLength(512) + .HasColumnType("character varying(512)"); + + b.Property("IsRequired") + .HasColumnType("boolean"); + + b.Property("Key") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("Label") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("OptionsJson") + .HasMaxLength(4096) + .HasColumnType("character varying(4096)"); + + b.Property("Order") + .HasColumnType("integer"); + + b.Property("Permission") + .IsRequired() + .HasMaxLength(1) + .HasColumnType("character varying(1)"); + + b.Property("Type") + .IsRequired() + .HasMaxLength(32) + .HasColumnType("character varying(32)"); + + b.HasKey("Id"); + + b.HasIndex("FormDefinitionId", "Key") + .IsUnique(); + + b.ToTable("EX_FormFieldDefinitions", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.ElsaNext.ApprovalFlow.Instances.ApprovalInstance", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("BusinessKey") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("timestamp with time zone") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uuid") + .HasColumnName("CreatorId"); + + b.Property("CurrentNodeId") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("CurrentNodeName") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("DeleterId") + .HasColumnType("uuid") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("timestamp with time zone") + .HasColumnName("DeletionTime"); + + b.Property("ElsaWorkflowInstanceId") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("FinishedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("FormDataJson") + .HasColumnType("text"); + + b.Property("InitiatorDisplayName") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("InitiatorId") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("InitiatorProvider") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("InitiatorType") + .HasMaxLength(32) + .HasColumnType("character varying(32)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("timestamp with time zone") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uuid") + .HasColumnName("LastModifierId"); + + b.Property("Outcome") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("StartedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(32) + .HasColumnType("character varying(32)"); + + b.Property("TemplateCategory") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("TemplateId") + .HasColumnType("uuid"); + + b.Property("TemplateName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.Property("Title") + .IsRequired() + .HasMaxLength(512) + .HasColumnType("character varying(512)"); + + b.HasKey("Id"); + + b.HasIndex("ElsaWorkflowInstanceId"); + + b.HasIndex("TenantId", "InitiatorId"); + + b.HasIndex("TenantId", "Status"); + + b.HasIndex("TenantId", "TemplateId"); + + b.ToTable("EX_ApprovalInstances", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.ElsaNext.ApprovalFlow.Nodes.ApprovalNodeTask", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("ApproverDisplayName") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("ApproverId") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("ApproverProvider") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("ApproverType") + .HasMaxLength(32) + .HasColumnType("character varying(32)"); + + b.Property("CreationTime") + .HasColumnType("timestamp with time zone") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uuid") + .HasColumnName("CreatorId"); + + b.Property("InstanceId") + .HasColumnType("uuid"); + + b.Property("NodeId") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("NodeInstanceId") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("NodeName") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("Origin") + .IsRequired() + .HasMaxLength(32) + .HasColumnType("character varying(32)"); + + b.Property("SignMode") + .IsRequired() + .HasMaxLength(32) + .HasColumnType("character varying(32)"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(32) + .HasColumnType("character varying(32)"); + + b.Property("TaskId") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("InstanceId"); + + b.HasIndex("TaskId") + .IsUnique(); + + b.HasIndex("NodeInstanceId", "Status"); + + b.ToTable("EX_ApprovalNodeTasks", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.ElsaNext.ApprovalFlow.OrganizationUnitManagers.OrganizationUnitManagerAssignment", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("timestamp with time zone") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uuid") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uuid") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("timestamp with time zone") + .HasColumnName("DeletionTime"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IsPrimary") + .HasColumnType("boolean"); + + b.Property("LastModificationTime") + .HasColumnType("timestamp with time zone") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uuid") + .HasColumnName("LastModifierId"); + + b.Property("Order") + .HasColumnType("integer"); + + b.Property("OrganizationUnitId") + .HasColumnType("uuid"); + + b.Property("Remark") + .HasMaxLength(512) + .HasColumnType("character varying(512)"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "UserId"); + + b.HasIndex("TenantId", "OrganizationUnitId", "UserId") + .IsUnique(); + + b.HasIndex("TenantId", "OrganizationUnitId", "IsPrimary", "Order") + .HasDatabaseName("IX_EX_OrganizationUnitManagerAssignments_TenantId_Organizatio~1"); + + b.ToTable("EX_OrganizationUnitManagerAssignments", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.ElsaNext.ApprovalFlow.Records.ApprovalRecord", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("ActionKey") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("ActionLabel") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("ActorDisplayName") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("ActorId") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("ActorProvider") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("ActorType") + .HasMaxLength(32) + .HasColumnType("character varying(32)"); + + b.Property("Comment") + .HasMaxLength(2000) + .HasColumnType("character varying(2000)"); + + b.Property("CreationTime") + .HasColumnType("timestamp with time zone") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uuid") + .HasColumnName("CreatorId"); + + b.Property("DataJson") + .HasColumnType("text"); + + b.Property("Effect") + .IsRequired() + .HasMaxLength(32) + .HasColumnType("character varying(32)"); + + b.Property("InstanceId") + .HasColumnType("uuid"); + + b.Property("NodeId") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("NodeInstanceId") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("NodeName") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("OccurredAt") + .HasColumnType("timestamp with time zone"); + + b.Property("TaskId") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("InstanceId", "OccurredAt"); + + b.ToTable("EX_ApprovalRecords", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.ElsaNext.ApprovalFlow.Templates.ApprovalTemplate", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("BusinessKeyHint") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("Category") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("timestamp with time zone") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uuid") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uuid") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("timestamp with time zone") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(1024) + .HasColumnType("character varying(1024)"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("ElsaDefinitionId") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("ElsaDefinitionKey") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("ElsaDefinitionVersion") + .HasColumnType("integer"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("FlowDefinitionJson") + .HasColumnType("text"); + + b.Property("FormDefinitionId") + .HasColumnType("uuid"); + + b.Property("Icon") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IsEnabled") + .HasColumnType("boolean"); + + b.Property("IsPublished") + .HasColumnType("boolean"); + + b.Property("LastModificationTime") + .HasColumnType("timestamp with time zone") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uuid") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "Name") + .IsUnique(); + + b.HasIndex("TenantId", "IsPublished", "IsEnabled"); + + b.ToTable("EX_ApprovalTemplates", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.ElsaNext.ApprovalFlow.FormDefinitions.FormFieldDefinition", b => + { + b.HasOne("LINGYUN.Abp.ElsaNext.ApprovalFlow.FormDefinitions.FormDefinition", null) + .WithMany("Fields") + .HasForeignKey("FormDefinitionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("LINGYUN.Abp.ElsaNext.ApprovalFlow.FormDefinitions.FormDefinition", b => + { + b.Navigation("Fields"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService.EntityFrameworkCore/WorkflowServiceDbMigrationService.cs b/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService.EntityFrameworkCore/WorkflowServiceDbMigrationService.cs new file mode 100644 index 000000000..b3eabe64e --- /dev/null +++ b/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService.EntityFrameworkCore/WorkflowServiceDbMigrationService.cs @@ -0,0 +1,27 @@ +using LINGYUN.Abp.Data.DbMigrator; +using Microsoft.Extensions.Logging; +using System; +using Volo.Abp.Data; +using Volo.Abp.DependencyInjection; +using Volo.Abp.DistributedLocking; +using Volo.Abp.EventBus.Distributed; +using Volo.Abp.MultiTenancy; +using Volo.Abp.Uow; + +namespace LINGYUN.Abp.MicroService.WorkflowService; + +public class WorkflowServiceDbMigrationService : EfCoreRuntimeDbMigratorBase, ITransientDependency +{ + public WorkflowServiceDbMigrationService( + ICurrentTenant currentTenant, + IUnitOfWorkManager unitOfWorkManager, + IServiceProvider serviceProvider, + IAbpDistributedLock abpDistributedLock, + IDistributedEventBus distributedEventBus, + ILoggerFactory loggerFactory) + : base( + ConnectionStringNameAttribute.GetConnStringName(), + unitOfWorkManager, serviceProvider, currentTenant, abpDistributedLock, distributedEventBus, loggerFactory) + { + } +} diff --git a/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService.EntityFrameworkCore/WorkflowServiceMigrationsDbContext.cs b/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService.EntityFrameworkCore/WorkflowServiceMigrationsDbContext.cs new file mode 100644 index 000000000..0ddc4c7d5 --- /dev/null +++ b/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService.EntityFrameworkCore/WorkflowServiceMigrationsDbContext.cs @@ -0,0 +1,52 @@ +using LINGYUN.Abp.ElsaNext.ApprovalFlow.CarbonCopies; +using LINGYUN.Abp.ElsaNext.ApprovalFlow.Delegations; +using LINGYUN.Abp.ElsaNext.ApprovalFlow.EntityFrameworkCore; +using LINGYUN.Abp.ElsaNext.ApprovalFlow.Instances; +using LINGYUN.Abp.ElsaNext.ApprovalFlow.Nodes; +using LINGYUN.Abp.ElsaNext.ApprovalFlow.Records; +using LINGYUN.Abp.ElsaNext.ApprovalFlow.Templates; +using LINGYUN.Abp.ElsaNext.ApprovalFlow.FormDatas; +using LINGYUN.Abp.ElsaNext.ApprovalFlow.FormDefinitions; +using LINGYUN.Abp.ElsaNext.ApprovalFlow.OrganizationUnitManagers; +using Microsoft.EntityFrameworkCore; +using Volo.Abp.Data; +using Volo.Abp.EntityFrameworkCore; + +namespace LINGYUN.Abp.MicroService.WorkflowService; + +/// +/// 承载服务审批流相关模块的迁移 DbContext。 +/// +/// +/// 这里只配置本服务新增模块的表。Elsa 自身的表由 Elsa 的启动迁移器写入 Elsa schema, +/// 已被迁移过的其他模块若在此重复配置,会生成针对既有表的 CreateTable 而直接失败。 +/// +[ConnectionStringName("Default")] +public class WorkflowServiceMigrationsDbContext : + AbpDbContext, + IElsaNextApprovalFlowDbContext +{ + public DbSet OrganizationUnitManagerAssignments { get; set; } + + public DbSet ApprovalTemplates { get; set; } + public DbSet ApprovalInstances { get; set; } + public DbSet ApprovalRecords { get; set; } + public DbSet ApprovalCcs { get; set; } + public DbSet ApprovalNodeTasks { get; set; } + public DbSet ApprovalDelegations { get; set; } + + public DbSet FormDefinitions { get; set; } + public DbSet FormDatas { get; set; } + + public WorkflowServiceMigrationsDbContext(DbContextOptions options) + : base(options) + { + } + + protected override void OnModelCreating(ModelBuilder modelBuilder) + { + base.OnModelCreating(modelBuilder); + + modelBuilder.ConfigureElsaNextApprovalFlow(); + } +} diff --git a/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService.EntityFrameworkCore/WorkflowServiceMigrationsDbContextFactory.cs b/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService.EntityFrameworkCore/WorkflowServiceMigrationsDbContextFactory.cs new file mode 100644 index 000000000..f3286ad93 --- /dev/null +++ b/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService.EntityFrameworkCore/WorkflowServiceMigrationsDbContextFactory.cs @@ -0,0 +1,28 @@ +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Design; + +namespace LINGYUN.Abp.MicroService.WorkflowService; + +/// +/// EF 设计时上下文工厂。 +/// +/// +/// 连接串优先取环境变量 ConnectionStrings__Default,以便 CI / 本地执行 dotnet ef 时覆盖; +/// 未设置时使用与宿主开发环境一致的默认连接串。 +/// +public class WorkflowServiceMigrationsDbContextFactory : IDesignTimeDbContextFactory +{ + private const string DefaultConnectionString = "Host=127.0.0.1;Database=abp;Username=postgres;Password=123456"; + + public WorkflowServiceMigrationsDbContext CreateDbContext(string[] args) + { + var connectionString = Environment.GetEnvironmentVariable("ConnectionStrings__Default") + ?? DefaultConnectionString; + + var builder = new DbContextOptionsBuilder() + .UseNpgsql(connectionString); + + return new WorkflowServiceMigrationsDbContext(builder.Options); + } +} diff --git a/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService.EntityFrameworkCore/WorkflowServiceMigrationsEntityFrameworkCoreModule.cs b/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService.EntityFrameworkCore/WorkflowServiceMigrationsEntityFrameworkCoreModule.cs new file mode 100644 index 000000000..7471c4868 --- /dev/null +++ b/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService.EntityFrameworkCore/WorkflowServiceMigrationsEntityFrameworkCoreModule.cs @@ -0,0 +1,37 @@ +using LINGYUN.Abp.Data.DbMigrator; +using LINGYUN.Abp.ElsaNext.ApprovalFlow.EntityFrameworkCore; +using LINGYUN.Abp.ElsaNext.EntityFrameworkCore.PostgreSql; +using LINGYUN.Abp.ElsaNext.UserTasks.EntityFrameworkCore.PostgreSql; +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.DependencyInjection; +using System; +using Volo.Abp.EntityFrameworkCore; +using Volo.Abp.EntityFrameworkCore.PostgreSql; +using Volo.Abp.Modularity; + +namespace LINGYUN.Abp.MicroService.WorkflowService; + +[DependsOn( + typeof(AbpElsaNextApprovalFlowEntityFrameworkCoreModule), + typeof(AbpElsaNextUserTasksEntityFrameworkCorePostgreSqlModule), + typeof(AbpElsaNextEntityFrameworkCorePostgreSqlModule), + typeof(AbpEntityFrameworkCorePostgreSqlModule), + typeof(AbpDataDbMigratorModule))] +public class WorkflowServiceMigrationsEntityFrameworkCoreModule : AbpModule +{ + public override void PreConfigureServices(ServiceConfigurationContext context) + { + // https://www.npgsql.org/efcore/release-notes/6.0.html#opting-out-of-the-new-timestamp-mapping-logic + AppContext.SetSwitch("Npgsql.EnableLegacyTimestampBehavior", true); + } + + public override void ConfigureServices(ServiceConfigurationContext context) + { + context.Services.AddAbpDbContext(); + + Configure(options => + { + options.UseNpgsql(); + }); + } +} diff --git a/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/ElsaShellPermissionPolicyProvider.cs b/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/ElsaShellPermissionPolicyProvider.cs index b02b46750..90cb0b2be 100644 --- a/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/ElsaShellPermissionPolicyProvider.cs +++ b/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/ElsaShellPermissionPolicyProvider.cs @@ -1,4 +1,5 @@ -using Microsoft.AspNetCore.Authorization; +#nullable enable +using Microsoft.AspNetCore.Authorization; using Microsoft.Extensions.Options; using System; using System.Threading.Tasks; @@ -35,7 +36,7 @@ public sealed class ElsaShellPermissionPolicyProvider : IAuthorizationPolicyProv } /// - public Task GetDefaultPolicyAsync() => Task.FromResult(AllowAll); + public Task GetDefaultPolicyAsync() => Task.FromResult(AllowAll); /// public Task GetFallbackPolicyAsync() => Task.FromResult(AllowAll); diff --git a/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/Extensions/ElsaStudioServiceCollectionExtensions.cs b/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/Extensions/ElsaStudioServiceCollectionExtensions.cs index 81fd5c37f..43504c868 100644 --- a/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/Extensions/ElsaStudioServiceCollectionExtensions.cs +++ b/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/Extensions/ElsaStudioServiceCollectionExtensions.cs @@ -1,4 +1,4 @@ -using Consul; +using Consul; using Elsa.Studio.Authentication.Abstractions.ComponentProviders; using Elsa.Studio.Authentication.Abstractions.Contracts; using Elsa.Studio.Authentication.Abstractions.Models; diff --git a/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/LINGYUN.Abp.MicroService.WorkflowService.csproj b/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/LINGYUN.Abp.MicroService.WorkflowService.csproj index ba2d1d8f3..02249c1be 100644 --- a/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/LINGYUN.Abp.MicroService.WorkflowService.csproj +++ b/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/LINGYUN.Abp.MicroService.WorkflowService.csproj @@ -44,11 +44,9 @@ - - @@ -73,10 +71,9 @@ - - + @@ -90,12 +87,13 @@ + + + + + - - - - @@ -116,6 +114,7 @@ + diff --git a/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/Navigation/UserMenuContributor.cs b/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/Navigation/UserMenuContributor.cs index 7aee5f4ae..8e5a4d6c4 100644 --- a/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/Navigation/UserMenuContributor.cs +++ b/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/Navigation/UserMenuContributor.cs @@ -1,4 +1,4 @@ -using Localization.Resources.AbpUi; +using Localization.Resources.AbpUi; using System.Threading.Tasks; using Volo.Abp.UI.Navigation; diff --git a/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/Program.cs b/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/Program.cs index 8729af87d..6dde51e8b 100644 --- a/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/Program.cs +++ b/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/Program.cs @@ -1,4 +1,6 @@ -using LINGYUN.Abp.MicroService.WorkflowService; +using Elsa.Extensions; +using Elsa.Http; +using LINGYUN.Abp.MicroService.WorkflowService; using LINGYUN.Abp.MicroService.WorkflowService.Components; using LINGYUN.Abp.Serilog.Enrichers.Application; using Microsoft.AspNetCore.Builder; diff --git a/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/Swashbuckle/AspNetCore/SwaggerGen/EnumDescriptionSchemaFilter.cs b/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/Swashbuckle/AspNetCore/SwaggerGen/EnumDescriptionSchemaFilter.cs index f7adfe64f..3adff43f7 100644 --- a/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/Swashbuckle/AspNetCore/SwaggerGen/EnumDescriptionSchemaFilter.cs +++ b/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/Swashbuckle/AspNetCore/SwaggerGen/EnumDescriptionSchemaFilter.cs @@ -1,4 +1,4 @@ -using Microsoft.OpenApi; +using Microsoft.OpenApi; using System; using System.ComponentModel; using System.Reflection; diff --git a/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/Swashbuckle/AspNetCore/SwaggerGen/TenantHeaderParamter.cs b/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/Swashbuckle/AspNetCore/SwaggerGen/TenantHeaderParamter.cs index 25809383e..0b0dcb94a 100644 --- a/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/Swashbuckle/AspNetCore/SwaggerGen/TenantHeaderParamter.cs +++ b/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/Swashbuckle/AspNetCore/SwaggerGen/TenantHeaderParamter.cs @@ -1,4 +1,4 @@ -using Microsoft.Extensions.Options; +using Microsoft.Extensions.Options; using Microsoft.OpenApi; using System.Collections.Generic; using Volo.Abp.AspNetCore.MultiTenancy; diff --git a/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/WorkflowServiceModule.Configure.cs b/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/WorkflowServiceModule.Configure.cs index e20a562b4..9c609fe28 100644 --- a/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/WorkflowServiceModule.Configure.cs +++ b/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/WorkflowServiceModule.Configure.cs @@ -1,4 +1,4 @@ -using DotNetCore.CAP; +using DotNetCore.CAP; using Elsa.Extensions; using Elsa.Persistence.EFCore.Extensions; using Elsa.Studio.Authentication.OpenIdConnect.HttpMessageHandlers; diff --git a/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/WorkflowServiceModule.cs b/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/WorkflowServiceModule.cs index 7b61ce517..ef682fb55 100644 --- a/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/WorkflowServiceModule.cs +++ b/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/WorkflowServiceModule.cs @@ -1,21 +1,20 @@ -using LINGYUN.Abp.AspNetCore.HttpOverrides; +using LINGYUN.Abp.AspNetCore.Authentication; +using LINGYUN.Abp.AspNetCore.HttpOverrides; using LINGYUN.Abp.AspNetCore.Mvc.Wrapper; using LINGYUN.Abp.AspNetCore.Session; using LINGYUN.Abp.AuditLogging.Elasticsearch; using LINGYUN.Abp.AuditLogging.IP.Location; using LINGYUN.Abp.Authorization.OrganizationUnits; using LINGYUN.Abp.BlobStoring.BlobManagement; -using LINGYUN.Abp.AspNetCore.Authentication; using LINGYUN.Abp.Data.DbMigrator; using LINGYUN.Abp.Dynamic.Definitions; using LINGYUN.Abp.ElsaNext.Agents.Blazor; +using LINGYUN.Abp.ElsaNext.ApprovalFlow; +using LINGYUN.Abp.ElsaNext.ApprovalFlow.Activities; +using LINGYUN.Abp.ElsaNext.ApprovalFlow.EntityFrameworkCore; using LINGYUN.Abp.ElsaNext.BlobStoring; using LINGYUN.Abp.ElsaNext.Email; -using LINGYUN.Abp.ElsaNext.EntityFrameworkCore; -using LINGYUN.Abp.ElsaNext.EntityFrameworkCore.MySQL; -using LINGYUN.Abp.ElsaNext.EntityFrameworkCore.PostgreSql; -using LINGYUN.Abp.ElsaNext.EntityFrameworkCore.Sqlite; -using LINGYUN.Abp.ElsaNext.EntityFrameworkCore.SqlServer; +using LINGYUN.Abp.ElsaNext.ApprovalFlow.FormDefinitions; using LINGYUN.Abp.ElsaNext.Labels; using LINGYUN.Abp.ElsaNext.Notifications; using LINGYUN.Abp.ElsaNext.Secrets.Blazor; @@ -31,11 +30,14 @@ using LINGYUN.Abp.ElsaNext.Studio.Labels.Blazor; using LINGYUN.Abp.ElsaNext.Studio.Notifications.Blazor; using LINGYUN.Abp.ElsaNext.Studio.Saas.Blazor; using LINGYUN.Abp.ElsaNext.Studio.Webhooks.Blazor; +using LINGYUN.Abp.ElsaNext.UserTasks; +using LINGYUN.Abp.ElsaNext.UserTasks.EntityFrameworkCore; using LINGYUN.Abp.ElsaNext.Webhooks; using LINGYUN.Abp.Emailing.Platform; using LINGYUN.Abp.EventBus.CAP; using LINGYUN.Abp.ExceptionHandling.Emailing; using LINGYUN.Abp.Http.Client.Wrapper; +using LINGYUN.Abp.Identity.EntityFrameworkCore; using LINGYUN.Abp.IP2Region; using LINGYUN.Abp.Localization.CultureMap; using LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore; @@ -59,7 +61,6 @@ using Volo.Abp.Autofac; using Volo.Abp.Caching.StackExchangeRedis; using Volo.Abp.FeatureManagement.EntityFrameworkCore; using Volo.Abp.Http.Client.IdentityModel.Web; -using Volo.Abp.Identity.EntityFrameworkCore; using Volo.Abp.Modularity; using Volo.Abp.PermissionManagement.EntityFrameworkCore; using Volo.Abp.SettingManagement.EntityFrameworkCore; @@ -78,10 +79,19 @@ namespace LINGYUN.Abp.MicroService.WorkflowService; typeof(AbpBlobStoringBlobManagementModule), typeof(AbpElsaNextBlobStoringModule), + typeof(AbpElsaNextApprovalFlowActivitiesModule), + typeof(AbpElsaNextApprovalFlowEntityFrameworkCoreModule), + typeof(WorkflowServiceMigrationsEntityFrameworkCoreModule), + typeof(AbpElsaNextApprovalFlowHttpApiModule), typeof(AbpElsaNextEmailModule), typeof(AbpElsaNextLabelsModule), typeof(AbpElsaNextNotificationsModule), typeof(AbpElsaNextWebhooksModule), + + + typeof(AbpElsaNextApprovalFlowDomainIdentityModule), + typeof(AbpElsaNextUserTasksModule), + typeof(AbpElsaNextUserTasksEntityFrameworkCoreModule), typeof(AbpElsaNextServerModule), typeof(AbpElsaNextStudioBlazorModule), typeof(AbpElsaNextAgentsBlazorModule), @@ -96,10 +106,6 @@ namespace LINGYUN.Abp.MicroService.WorkflowService; typeof(AbpElsaNextStudioNotificationsBlazorModule), typeof(AbpElsaNextStudioSaasBlazorModule), typeof(AbpElsaNextStudioWebhooksBlazorModule), - typeof(AbpElsaNextEntityFrameworkCoreMySQLModule), - typeof(AbpElsaNextEntityFrameworkCorePostgreSqlModule), - typeof(AbpElsaNextEntityFrameworkCoreSqliteModule), - typeof(AbpElsaNextEntityFrameworkCoreSqlServerModule), typeof(AbpEmailingExceptionHandlingModule), typeof(AbpHttpClientIdentityModelWebModule), typeof(AbpAspNetCoreMultiTenancyModule), @@ -132,7 +138,6 @@ namespace LINGYUN.Abp.MicroService.WorkflowService; typeof(AbpEmailingPlatformModule), typeof(AbpAspNetCoreAuthenticationModule), typeof(AbpAspNetCoreSessionModule), - typeof(AbpAspNetCoreMvcNewtonsoftModule), typeof(AbpAspNetCoreHttpOverridesModule), typeof(AbpDynamicDefinitionsModule), typeof(AbpAutofacModule) diff --git a/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/appsettings.Development.json b/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/appsettings.Development.json index 374605d80..42e0fedf1 100644 --- a/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/appsettings.Development.json +++ b/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/appsettings.Development.json @@ -1,4 +1,9 @@ -{ +{ + "WorkflowService": { + "EfCore": { + "AutoMigrate": true + } + }, "IPLocation": { "RemoveCountry": [ "中国" ] }, @@ -129,6 +134,11 @@ } } }, + "ApprovalFlow": { + "MaxApproversPerNode": 200, + "RequireCommentOnReject": true, + "DiscloseApprovers": true + }, "Server": { "EnableRealTimeWorkflows": true }, diff --git a/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Activities/README.md b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Activities/README.md index 2c88a76c7..a13f992f6 100644 --- a/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Activities/README.md +++ b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Activities/README.md @@ -1,30 +1,30 @@ -# LINGYUN.Abp.Elsa.Activities - -常用Activity集成 - -## 配置使用 - -```csharp - - [DependsOn( - typeof(AbpElsaActivitiesModule) - )] - public class YouProjectModule : AbpModule - { - } -``` - -## appsettings.json -```json - { - "Elsa": { - "BlobStoring": true, - "Emailing": true, - "Notification": true, - "Sms": true, - "IM": true, - "PublishWebhook": true +# LINGYUN.Abp.Elsa.Activities + +常用Activity集成 + +## 配置使用 + +```csharp + + [DependsOn( + typeof(AbpElsaActivitiesModule) + )] + public class YouProjectModule : AbpModule + { + } +``` + +## appsettings.json +```json + { + "Elsa": { + "BlobStoring": true, + "Emailing": true, + "Notification": true, + "Sms": true, + "IM": true, + "PublishWebhook": true } - } - + } + ``` \ No newline at end of file diff --git a/aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Studio.Dashboard.Blazor/Widgets/ExecutionTrendWidget.razor b/aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Studio.Dashboard.Blazor/Widgets/ExecutionTrendWidget.razor index 42e19cb6f..0bf0a8c38 100644 --- a/aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Studio.Dashboard.Blazor/Widgets/ExecutionTrendWidget.razor +++ b/aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Studio.Dashboard.Blazor/Widgets/ExecutionTrendWidget.razor @@ -4,7 +4,7 @@ @if (Context.Snapshot != null) { - var response = Context.Snapshot.Trend; + var response = Context.Snapshot.Trend!; diff --git a/aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Studio.Dashboard.Blazor/Widgets/RecentActivityWidget.razor b/aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Studio.Dashboard.Blazor/Widgets/RecentActivityWidget.razor index 28e90ad2d..bf2347940 100644 --- a/aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Studio.Dashboard.Blazor/Widgets/RecentActivityWidget.razor +++ b/aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Studio.Dashboard.Blazor/Widgets/RecentActivityWidget.razor @@ -4,7 +4,7 @@ @if (Context.Snapshot != null) { - var items = Context.Snapshot.RecentActivity.Items; + var items = Context.Snapshot.RecentActivity!.Items; diff --git a/aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.UserTasks.EntityFrameworkCore.PostgreSql/LINGYUN/Abp/ElsaNext/UserTasks/EntityFrameworkCore/PostgreSql/AbpElsaNextUserTasksEntityFrameworkCorePostgreSqlModule.cs b/aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.UserTasks.EntityFrameworkCore.PostgreSql/LINGYUN/Abp/ElsaNext/UserTasks/EntityFrameworkCore/PostgreSql/AbpElsaNextUserTasksEntityFrameworkCorePostgreSqlModule.cs index 97ae5a03c..5a1ffaca3 100644 --- a/aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.UserTasks.EntityFrameworkCore.PostgreSql/LINGYUN/Abp/ElsaNext/UserTasks/EntityFrameworkCore/PostgreSql/AbpElsaNextUserTasksEntityFrameworkCorePostgreSqlModule.cs +++ b/aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.UserTasks.EntityFrameworkCore.PostgreSql/LINGYUN/Abp/ElsaNext/UserTasks/EntityFrameworkCore/PostgreSql/AbpElsaNextUserTasksEntityFrameworkCorePostgreSqlModule.cs @@ -1,4 +1,5 @@ -using Elsa.UserTasks.Persistence.EFCore.Features; +using Elsa.Persistence.EFCore; +using Elsa.UserTasks.Persistence.EFCore.Features; using Elsa.UserTasks.Persistence.EFCore.PostgreSql.Extensions; using LINGYUN.Abp.ElsaNext.EntityFrameworkCore.Extensions; using Microsoft.Extensions.Configuration; @@ -28,4 +29,12 @@ public class AbpElsaNextUserTasksEntityFrameworkCorePostgreSqlModule : AbpModule }); } } + + public override void ConfigureServices(ServiceConfigurationContext context) + { + if (context.IsElsaFeatureEnabled("UserTasks:EfCore:PostgreSql")) + { + context.Services.AddScoped(); + } + } }