From b13d9929658c9288acd5390ae6ae52a6002a145c Mon Sep 17 00:00:00 2001 From: cKey <35512826+colinin@users.noreply.github.com> Date: Thu, 12 Jan 2023 10:27:43 +0800 Subject: [PATCH] add task management migrations --- .../LINGYUN.MicroService.TaskManagement.sln | 9 + .../TaskManagementDbMigrationService.cs | 216 +++++++ .../TaskManagementMigrationsDbContext.cs | 23 + ...skManagementMigrationsDbContextFactory.cs} | 13 +- ...roService.TaskManagement.DbMigrator.csproj | 55 ++ ...021621_Initial-Task-Management.Designer.cs | 273 ++++++++ .../20230112021621_Initial-Task-Management.cs | 156 +++++ ...agementMigrationsDbContextModelSnapshot.cs | 270 ++++++++ .../Program.cs | 40 ++ .../Properties/launchSettings.json | 11 + .../TaskManagementDbMigratorHostedService.cs | 51 ++ ...askManagementDbMigratorModule.Configure.cs | 18 + .../TaskManagementDbMigratorModule.cs | 29 + .../Usings.cs | 7 + .../appsettings.json | 81 +++ .../Queryable/AbpDynamicQueryableOptions.cs | 2 + .../LINGYUN.Abp.Notifications.Domain.csproj | 4 + .../appsettings.Development.json | 2 +- .../Properties/launchSettings.json | 4 +- ...Add-Module-Workflow-Management.Designer.cs | 557 ---------------- ...12074420_Add-Module-Workflow-Management.cs | 385 ----------- ...rkflow-Data-With-WF-Management.Designer.cs | 610 ------------------ ...Entity-Workflow-Data-With-WF-Management.cs | 147 ----- ...agementMigrationsDbContextModelSnapshot.cs | 608 ----------------- 24 files changed, 1254 insertions(+), 2317 deletions(-) create mode 100644 aspnet-core/migrations/LY.MicroService.TaskManagement.DbMigrator/EntityFrameworkCore/TaskManagementDbMigrationService.cs create mode 100644 aspnet-core/migrations/LY.MicroService.TaskManagement.DbMigrator/EntityFrameworkCore/TaskManagementMigrationsDbContext.cs rename aspnet-core/{services/LY.MicroService.WorkflowManagement.HttpApi.Host/EntityFrameworkCore/WorkflowManagementMigrationsDbContextFactory.cs => migrations/LY.MicroService.TaskManagement.DbMigrator/EntityFrameworkCore/TaskManagementMigrationsDbContextFactory.cs} (57%) create mode 100644 aspnet-core/migrations/LY.MicroService.TaskManagement.DbMigrator/LY.MicroService.TaskManagement.DbMigrator.csproj create mode 100644 aspnet-core/migrations/LY.MicroService.TaskManagement.DbMigrator/Migrations/20230112021621_Initial-Task-Management.Designer.cs create mode 100644 aspnet-core/migrations/LY.MicroService.TaskManagement.DbMigrator/Migrations/20230112021621_Initial-Task-Management.cs create mode 100644 aspnet-core/migrations/LY.MicroService.TaskManagement.DbMigrator/Migrations/TaskManagementMigrationsDbContextModelSnapshot.cs create mode 100644 aspnet-core/migrations/LY.MicroService.TaskManagement.DbMigrator/Program.cs create mode 100644 aspnet-core/migrations/LY.MicroService.TaskManagement.DbMigrator/Properties/launchSettings.json create mode 100644 aspnet-core/migrations/LY.MicroService.TaskManagement.DbMigrator/TaskManagementDbMigratorHostedService.cs create mode 100644 aspnet-core/migrations/LY.MicroService.TaskManagement.DbMigrator/TaskManagementDbMigratorModule.Configure.cs create mode 100644 aspnet-core/migrations/LY.MicroService.TaskManagement.DbMigrator/TaskManagementDbMigratorModule.cs create mode 100644 aspnet-core/migrations/LY.MicroService.TaskManagement.DbMigrator/Usings.cs create mode 100644 aspnet-core/migrations/LY.MicroService.TaskManagement.DbMigrator/appsettings.json delete mode 100644 aspnet-core/services/LY.MicroService.WorkflowManagement.HttpApi.Host/Migrations/20211212074420_Add-Module-Workflow-Management.Designer.cs delete mode 100644 aspnet-core/services/LY.MicroService.WorkflowManagement.HttpApi.Host/Migrations/20211212074420_Add-Module-Workflow-Management.cs delete mode 100644 aspnet-core/services/LY.MicroService.WorkflowManagement.HttpApi.Host/Migrations/20211214085456_Add-Entity-Workflow-Data-With-WF-Management.Designer.cs delete mode 100644 aspnet-core/services/LY.MicroService.WorkflowManagement.HttpApi.Host/Migrations/20211214085456_Add-Entity-Workflow-Data-With-WF-Management.cs delete mode 100644 aspnet-core/services/LY.MicroService.WorkflowManagement.HttpApi.Host/Migrations/WorkflowManagementMigrationsDbContextModelSnapshot.cs diff --git a/aspnet-core/LINGYUN.MicroService.TaskManagement.sln b/aspnet-core/LINGYUN.MicroService.TaskManagement.sln index bbf134dbd..d46cf64f1 100644 --- a/aspnet-core/LINGYUN.MicroService.TaskManagement.sln +++ b/aspnet-core/LINGYUN.MicroService.TaskManagement.sln @@ -80,6 +80,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Dynamic.Queryab EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Dynamic.Queryable.HttpApi", "modules\dynamic-queryable\LINGYUN.Abp.Dynamic.Queryable.HttpApi\LINGYUN.Abp.Dynamic.Queryable.HttpApi.csproj", "{DF963ABB-E713-49E9-A03C-DEB431E369DF}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "migrations", "migrations", "{820A8FA4-17C4-44DF-8C31-9F211D00F790}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LY.MicroService.TaskManagement.DbMigrator", "migrations\LY.MicroService.TaskManagement.DbMigrator\LY.MicroService.TaskManagement.DbMigrator.csproj", "{52FD8F39-0AB6-4C51-A584-187C219AC8B5}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -198,6 +202,10 @@ Global {DF963ABB-E713-49E9-A03C-DEB431E369DF}.Debug|Any CPU.Build.0 = Debug|Any CPU {DF963ABB-E713-49E9-A03C-DEB431E369DF}.Release|Any CPU.ActiveCfg = Release|Any CPU {DF963ABB-E713-49E9-A03C-DEB431E369DF}.Release|Any CPU.Build.0 = Release|Any CPU + {52FD8F39-0AB6-4C51-A584-187C219AC8B5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {52FD8F39-0AB6-4C51-A584-187C219AC8B5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {52FD8F39-0AB6-4C51-A584-187C219AC8B5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {52FD8F39-0AB6-4C51-A584-187C219AC8B5}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -231,6 +239,7 @@ Global {B54F200C-D648-477B-BE39-B40A1D956F13} = {B38D2141-AC0F-4F4A-9315-4292E3856C15} {FEC5FD25-9B26-4245-88D8-7621B26C7C3A} = {B38D2141-AC0F-4F4A-9315-4292E3856C15} {DF963ABB-E713-49E9-A03C-DEB431E369DF} = {B38D2141-AC0F-4F4A-9315-4292E3856C15} + {52FD8F39-0AB6-4C51-A584-187C219AC8B5} = {820A8FA4-17C4-44DF-8C31-9F211D00F790} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {E1FD1F4C-D344-408B-97CF-B6F1F6D7D293} diff --git a/aspnet-core/migrations/LY.MicroService.TaskManagement.DbMigrator/EntityFrameworkCore/TaskManagementDbMigrationService.cs b/aspnet-core/migrations/LY.MicroService.TaskManagement.DbMigrator/EntityFrameworkCore/TaskManagementDbMigrationService.cs new file mode 100644 index 000000000..60d21acb2 --- /dev/null +++ b/aspnet-core/migrations/LY.MicroService.TaskManagement.DbMigrator/EntityFrameworkCore/TaskManagementDbMigrationService.cs @@ -0,0 +1,216 @@ +using LINGYUN.Abp.Data.DbMigrator; +using LINGYUN.Abp.Saas.Tenants; +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.Logging; +using Microsoft.Extensions.Logging.Abstractions; +using System.Diagnostics; +using System.Runtime.InteropServices; +using Volo.Abp.Data; +using Volo.Abp.DependencyInjection; +using Volo.Abp.MultiTenancy; + +namespace LY.MicroService.TaskManagement.DbMigrator.EntityFrameworkCore; + +public class TaskManagementDbMigrationService : ITransientDependency +{ + public ILogger Logger { get; set; } + + private readonly IDataSeeder _dataSeeder; + private readonly IDbSchemaMigrator _dbSchemaMigrator; + private readonly ITenantRepository _tenantRepository; + private readonly ICurrentTenant _currentTenant; + + public TaskManagementDbMigrationService( + IDataSeeder dataSeeder, + IDbSchemaMigrator dbSchemaMigrator, + ITenantRepository tenantRepository, + ICurrentTenant currentTenant) + { + _dataSeeder = dataSeeder; + _dbSchemaMigrator = dbSchemaMigrator; + _tenantRepository = tenantRepository; + _currentTenant = currentTenant; + + Logger = NullLogger.Instance; + } + + public async Task MigrateAsync() + { + var initialMigrationAdded = AddInitialMigrationIfNotExist(); + + if (initialMigrationAdded) + { + return; + } + + Logger.LogInformation("Started database migrations..."); + + await MigrateDatabaseSchemaAsync(); + await SeedDataAsync(); + + Logger.LogInformation($"Successfully completed host database migrations."); + + var tenants = await _tenantRepository.GetListAsync(includeDetails: true); + + var migratedDatabaseSchemas = new HashSet(); + foreach (var tenant in tenants) + { + using (_currentTenant.Change(tenant.Id)) + { + if (tenant.ConnectionStrings.Any()) + { + var tenantConnectionStrings = tenant.ConnectionStrings + .Select(x => x.Value) + .ToList(); + + if (!migratedDatabaseSchemas.IsSupersetOf(tenantConnectionStrings)) + { + await MigrateDatabaseSchemaAsync(tenant); + + migratedDatabaseSchemas.AddIfNotContains(tenantConnectionStrings); + } + } + + await SeedDataAsync(tenant); + } + + Logger.LogInformation($"Successfully completed {tenant.Name} tenant database migrations."); + } + + Logger.LogInformation("Successfully completed all database migrations."); + Logger.LogInformation("You can safely end this process..."); + } + + private async Task MigrateDatabaseSchemaAsync(Tenant? tenant = null) + { + Logger.LogInformation($"Migrating schema for {(tenant == null ? "host" : tenant.Name + " tenant")} database..."); + // 迁移租户数据 + await _dbSchemaMigrator.MigrateAsync( + (connectionString, builder) => + { + builder.UseMySql(connectionString, ServerVersion.AutoDetect(connectionString)); + + return new TaskManagementMigrationsDbContext(builder.Options); + }); + } + + private async Task SeedDataAsync(Tenant? tenant = null) + { + Logger.LogInformation($"Executing {(tenant == null ? "host" : tenant.Name + " tenant")} database seed..."); + + await _dataSeeder.SeedAsync(tenant?.Id); + } + + private bool AddInitialMigrationIfNotExist() + { + try + { + if (!DbMigrationsProjectExists()) + { + return false; + } + } + catch (Exception) + { + return false; + } + + try + { + if (!MigrationsFolderExists()) + { + AddInitialMigration(); + return true; + } + else + { + return false; + } + } + catch (Exception e) + { + Logger.LogWarning("Couldn't determinate if any migrations exist : " + e.Message); + return false; + } + } + + private bool DbMigrationsProjectExists() + { + return Directory.Exists(GetEntityFrameworkCoreProjectFolderPath()); + } + + private bool MigrationsFolderExists() + { + var dbMigrationsProjectFolder = GetEntityFrameworkCoreProjectFolderPath(); + + return Directory.Exists(Path.Combine(dbMigrationsProjectFolder, "Migrations")); + } + + private void AddInitialMigration() + { + Logger.LogInformation("Creating initial migration..."); + + string argumentPrefix; + string fileName; + + if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX) || RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) + { + argumentPrefix = "-c"; + fileName = "/bin/bash"; + } + else + { + argumentPrefix = "/C"; + fileName = "cmd.exe"; + } + + var procStartInfo = new ProcessStartInfo(fileName, + $"{argumentPrefix} \"abp create-migration-and-run-migrator \"{GetEntityFrameworkCoreProjectFolderPath()}\" --nolayers\"" + ); + + try + { + Process.Start(procStartInfo); + } + catch (Exception) + { + throw new Exception("Couldn't run ABP CLI..."); + } + } + + private string GetEntityFrameworkCoreProjectFolderPath() + { + var slnDirectoryPath = GetSolutionDirectoryPath(); + + if (slnDirectoryPath == null) + { + throw new Exception("Solution folder not found!"); + } + + return Path.Combine(slnDirectoryPath, "LY.MicroService.TaskManagement.DbMigrator"); + } + + private string? GetSolutionDirectoryPath() + { + var currentDirectory = new DirectoryInfo(Directory.GetCurrentDirectory()); + + while (Directory.GetParent(currentDirectory.FullName) != null) + { + currentDirectory = Directory.GetParent(currentDirectory.FullName); + + if (Directory.GetFiles(currentDirectory!.FullName).FirstOrDefault(f => f.EndsWith(".sln")) != null) + { + return currentDirectory.FullName; + } + + // parent host + currentDirectory = Directory.GetParent(currentDirectory.FullName); + if (Directory.GetFiles(currentDirectory!.FullName).FirstOrDefault(f => f.EndsWith(".sln")) != null) + { + return currentDirectory.FullName; + } + } + + return null; + } +} \ No newline at end of file diff --git a/aspnet-core/migrations/LY.MicroService.TaskManagement.DbMigrator/EntityFrameworkCore/TaskManagementMigrationsDbContext.cs b/aspnet-core/migrations/LY.MicroService.TaskManagement.DbMigrator/EntityFrameworkCore/TaskManagementMigrationsDbContext.cs new file mode 100644 index 000000000..edd68ae13 --- /dev/null +++ b/aspnet-core/migrations/LY.MicroService.TaskManagement.DbMigrator/EntityFrameworkCore/TaskManagementMigrationsDbContext.cs @@ -0,0 +1,23 @@ +using LINGYUN.Abp.TaskManagement.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore; +using Volo.Abp.Data; +using Volo.Abp.EntityFrameworkCore; + +namespace LY.MicroService.TaskManagement.DbMigrator.EntityFrameworkCore; + +[ConnectionStringName("TaskManagementDbMigrator")] +public class TaskManagementMigrationsDbContext : AbpDbContext +{ + public TaskManagementMigrationsDbContext(DbContextOptions options) + : base(options) + { + + } + + protected override void OnModelCreating(ModelBuilder modelBuilder) + { + base.OnModelCreating(modelBuilder); + + modelBuilder.ConfigureTaskManagement(); + } +} diff --git a/aspnet-core/services/LY.MicroService.WorkflowManagement.HttpApi.Host/EntityFrameworkCore/WorkflowManagementMigrationsDbContextFactory.cs b/aspnet-core/migrations/LY.MicroService.TaskManagement.DbMigrator/EntityFrameworkCore/TaskManagementMigrationsDbContextFactory.cs similarity index 57% rename from aspnet-core/services/LY.MicroService.WorkflowManagement.HttpApi.Host/EntityFrameworkCore/WorkflowManagementMigrationsDbContextFactory.cs rename to aspnet-core/migrations/LY.MicroService.TaskManagement.DbMigrator/EntityFrameworkCore/TaskManagementMigrationsDbContextFactory.cs index fbb81a49c..bc48317d7 100644 --- a/aspnet-core/services/LY.MicroService.WorkflowManagement.HttpApi.Host/EntityFrameworkCore/WorkflowManagementMigrationsDbContextFactory.cs +++ b/aspnet-core/migrations/LY.MicroService.TaskManagement.DbMigrator/EntityFrameworkCore/TaskManagementMigrationsDbContextFactory.cs @@ -1,21 +1,20 @@ using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Design; using Microsoft.Extensions.Configuration; -using System.IO; -namespace LY.MicroService.WorkflowManagement.EntityFrameworkCore; +namespace LY.MicroService.TaskManagement.DbMigrator.EntityFrameworkCore; -public class WorkflowManagementMigrationsDbContextFactory : IDesignTimeDbContextFactory +public class TaskManagementMigrationsDbContextFactory : IDesignTimeDbContextFactory { - public WorkflowManagementMigrationsDbContext CreateDbContext(string[] args) + public TaskManagementMigrationsDbContext CreateDbContext(string[] args) { var configuration = BuildConfiguration(); - var connectionString = configuration.GetConnectionString("WorkflowManagement"); + var connectionString = configuration.GetConnectionString("Default"); - var builder = new DbContextOptionsBuilder() + var builder = new DbContextOptionsBuilder() .UseMySql(connectionString, ServerVersion.AutoDetect(connectionString)); - return new WorkflowManagementMigrationsDbContext(builder.Options); + return new TaskManagementMigrationsDbContext(builder!.Options); } private static IConfigurationRoot BuildConfiguration() diff --git a/aspnet-core/migrations/LY.MicroService.TaskManagement.DbMigrator/LY.MicroService.TaskManagement.DbMigrator.csproj b/aspnet-core/migrations/LY.MicroService.TaskManagement.DbMigrator/LY.MicroService.TaskManagement.DbMigrator.csproj new file mode 100644 index 000000000..1ad4a5f12 --- /dev/null +++ b/aspnet-core/migrations/LY.MicroService.TaskManagement.DbMigrator/LY.MicroService.TaskManagement.DbMigrator.csproj @@ -0,0 +1,55 @@ + + + + Exe + net7.0 + enable + enable + + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + + + + + + + + + + + + + PreserveNewest + true + PreserveNewest + + + + + + + + + + + + + + diff --git a/aspnet-core/migrations/LY.MicroService.TaskManagement.DbMigrator/Migrations/20230112021621_Initial-Task-Management.Designer.cs b/aspnet-core/migrations/LY.MicroService.TaskManagement.DbMigrator/Migrations/20230112021621_Initial-Task-Management.Designer.cs new file mode 100644 index 000000000..88dfad48b --- /dev/null +++ b/aspnet-core/migrations/LY.MicroService.TaskManagement.DbMigrator/Migrations/20230112021621_Initial-Task-Management.Designer.cs @@ -0,0 +1,273 @@ +// +using System; +using LY.MicroService.TaskManagement.DbMigrator.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Volo.Abp.EntityFrameworkCore; + +#nullable disable + +namespace LY.MicroService.TaskManagement.DbMigrator.Migrations +{ + [DbContext(typeof(TaskManagementMigrationsDbContext))] + [Migration("20230112021621_Initial-Task-Management")] + partial class InitialTaskManagement + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.MySql) + .HasAnnotation("ProductVersion", "7.0.2") + .HasAnnotation("Relational:MaxIdentifierLength", 64); + + modelBuilder.Entity("LINGYUN.Abp.TaskManagement.BackgroundJobAction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsEnabled") + .HasColumnType("tinyint(1)"); + + b.Property("JobId") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .HasColumnName("JobId"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasColumnName("Name"); + + b.Property("Paramters") + .HasColumnType("longtext") + .HasColumnName("Paramters"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("Name"); + + b.ToTable("TK_BackgroundJobActions", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.TaskManagement.BackgroundJobInfo", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("Args") + .HasColumnType("longtext") + .HasColumnName("Args"); + + b.Property("BeginTime") + .HasColumnType("datetime(6)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("Cron") + .HasMaxLength(50) + .HasColumnType("varchar(50)") + .HasColumnName("Cron"); + + b.Property("Description") + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .HasColumnName("Description"); + + b.Property("EndTime") + .HasColumnType("datetime(6)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("Group") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)") + .HasColumnName("Group"); + + b.Property("Interval") + .HasColumnType("int"); + + b.Property("IsAbandoned") + .HasColumnType("tinyint(1)"); + + b.Property("IsEnabled") + .HasColumnType("tinyint(1)"); + + b.Property("JobType") + .HasColumnType("int"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("LastRunTime") + .HasColumnType("datetime(6)"); + + b.Property("LockTimeOut") + .HasColumnType("int"); + + b.Property("MaxCount") + .HasColumnType("int"); + + b.Property("MaxTryCount") + .HasColumnType("int"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasColumnName("Name"); + + b.Property("NextRunTime") + .HasColumnType("datetime(6)"); + + b.Property("NodeName") + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("NodeName"); + + b.Property("Priority") + .HasColumnType("int"); + + b.Property("Result") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)") + .HasColumnName("Result"); + + b.Property("Source") + .HasColumnType("int"); + + b.Property("Status") + .HasColumnType("int"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("TriggerCount") + .HasColumnType("int"); + + b.Property("TryCount") + .HasColumnType("int"); + + b.Property("Type") + .IsRequired() + .HasMaxLength(1000) + .HasColumnType("varchar(1000)") + .HasColumnName("Type"); + + b.HasKey("Id"); + + b.HasIndex("Name", "Group"); + + b.ToTable("TK_BackgroundJobs", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.TaskManagement.BackgroundJobLog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + b.Property("Exception") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)") + .HasColumnName("Exception"); + + b.Property("JobGroup") + .HasMaxLength(50) + .HasColumnType("varchar(50)") + .HasColumnName("JobGroup"); + + b.Property("JobId") + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .HasColumnName("JobId"); + + b.Property("JobName") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasColumnName("JobName"); + + b.Property("JobType") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)") + .HasColumnName("JobType"); + + b.Property("Message") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)") + .HasColumnName("Message"); + + b.Property("RunTime") + .HasColumnType("datetime(6)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("JobGroup", "JobName"); + + b.ToTable("TK_BackgroundJobLogs", (string)null); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/aspnet-core/migrations/LY.MicroService.TaskManagement.DbMigrator/Migrations/20230112021621_Initial-Task-Management.cs b/aspnet-core/migrations/LY.MicroService.TaskManagement.DbMigrator/Migrations/20230112021621_Initial-Task-Management.cs new file mode 100644 index 000000000..3d8081aee --- /dev/null +++ b/aspnet-core/migrations/LY.MicroService.TaskManagement.DbMigrator/Migrations/20230112021621_Initial-Task-Management.cs @@ -0,0 +1,156 @@ +using System; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace LY.MicroService.TaskManagement.DbMigrator.Migrations +{ + /// + public partial class InitialTaskManagement : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AlterDatabase() + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "TK_BackgroundJobActions", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + TenantId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + JobId = table.Column(type: "varchar(255)", maxLength: 255, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + Name = table.Column(type: "varchar(100)", maxLength: 100, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + IsEnabled = table.Column(type: "tinyint(1)", nullable: false), + Paramters = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + ExtraProperties = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + ConcurrencyStamp = table.Column(type: "varchar(40)", maxLength: 40, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + CreationTime = table.Column(type: "datetime(6)", nullable: false), + CreatorId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + LastModificationTime = table.Column(type: "datetime(6)", nullable: true), + LastModifierId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci") + }, + constraints: table => + { + table.PrimaryKey("PK_TK_BackgroundJobActions", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "TK_BackgroundJobLogs", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + TenantId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + JobId = table.Column(type: "varchar(255)", maxLength: 255, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + JobName = table.Column(type: "varchar(100)", maxLength: 100, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + JobGroup = table.Column(type: "varchar(50)", maxLength: 50, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + JobType = table.Column(type: "varchar(1000)", maxLength: 1000, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Message = table.Column(type: "varchar(1000)", maxLength: 1000, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + RunTime = table.Column(type: "datetime(6)", nullable: false), + Exception = table.Column(type: "varchar(2000)", maxLength: 2000, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_TK_BackgroundJobLogs", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "TK_BackgroundJobs", + columns: table => new + { + Id = table.Column(type: "varchar(255)", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + TenantId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + Name = table.Column(type: "varchar(100)", maxLength: 100, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + Group = table.Column(type: "varchar(50)", maxLength: 50, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + Type = table.Column(type: "varchar(1000)", maxLength: 1000, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + Result = table.Column(type: "varchar(1000)", maxLength: 1000, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Args = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Status = table.Column(type: "int", nullable: false), + IsEnabled = table.Column(type: "tinyint(1)", nullable: false), + Description = table.Column(type: "varchar(255)", maxLength: 255, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + LockTimeOut = table.Column(type: "int", nullable: false), + BeginTime = table.Column(type: "datetime(6)", nullable: false), + EndTime = table.Column(type: "datetime(6)", nullable: true), + LastRunTime = table.Column(type: "datetime(6)", nullable: true), + NextRunTime = table.Column(type: "datetime(6)", nullable: true), + JobType = table.Column(type: "int", nullable: false), + Cron = table.Column(type: "varchar(50)", maxLength: 50, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Source = table.Column(type: "int", nullable: false), + Priority = table.Column(type: "int", nullable: false), + TriggerCount = table.Column(type: "int", nullable: false), + TryCount = table.Column(type: "int", nullable: false), + MaxTryCount = table.Column(type: "int", nullable: false), + MaxCount = table.Column(type: "int", nullable: false), + Interval = table.Column(type: "int", nullable: false), + IsAbandoned = table.Column(type: "tinyint(1)", nullable: false), + NodeName = table.Column(type: "varchar(128)", maxLength: 128, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + ExtraProperties = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + ConcurrencyStamp = table.Column(type: "varchar(40)", maxLength: 40, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + CreationTime = table.Column(type: "datetime(6)", nullable: false), + CreatorId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + LastModificationTime = table.Column(type: "datetime(6)", nullable: true), + LastModifierId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci") + }, + constraints: table => + { + table.PrimaryKey("PK_TK_BackgroundJobs", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateIndex( + name: "IX_TK_BackgroundJobActions_Name", + table: "TK_BackgroundJobActions", + column: "Name"); + + migrationBuilder.CreateIndex( + name: "IX_TK_BackgroundJobLogs_JobGroup_JobName", + table: "TK_BackgroundJobLogs", + columns: new[] { "JobGroup", "JobName" }); + + migrationBuilder.CreateIndex( + name: "IX_TK_BackgroundJobs_Name_Group", + table: "TK_BackgroundJobs", + columns: new[] { "Name", "Group" }); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "TK_BackgroundJobActions"); + + migrationBuilder.DropTable( + name: "TK_BackgroundJobLogs"); + + migrationBuilder.DropTable( + name: "TK_BackgroundJobs"); + } + } +} diff --git a/aspnet-core/migrations/LY.MicroService.TaskManagement.DbMigrator/Migrations/TaskManagementMigrationsDbContextModelSnapshot.cs b/aspnet-core/migrations/LY.MicroService.TaskManagement.DbMigrator/Migrations/TaskManagementMigrationsDbContextModelSnapshot.cs new file mode 100644 index 000000000..c32dad0f1 --- /dev/null +++ b/aspnet-core/migrations/LY.MicroService.TaskManagement.DbMigrator/Migrations/TaskManagementMigrationsDbContextModelSnapshot.cs @@ -0,0 +1,270 @@ +// +using System; +using LY.MicroService.TaskManagement.DbMigrator.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Volo.Abp.EntityFrameworkCore; + +#nullable disable + +namespace LY.MicroService.TaskManagement.DbMigrator.Migrations +{ + [DbContext(typeof(TaskManagementMigrationsDbContext))] + partial class TaskManagementMigrationsDbContextModelSnapshot : ModelSnapshot + { + protected override void BuildModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.MySql) + .HasAnnotation("ProductVersion", "7.0.2") + .HasAnnotation("Relational:MaxIdentifierLength", 64); + + modelBuilder.Entity("LINGYUN.Abp.TaskManagement.BackgroundJobAction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsEnabled") + .HasColumnType("tinyint(1)"); + + b.Property("JobId") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .HasColumnName("JobId"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasColumnName("Name"); + + b.Property("Paramters") + .HasColumnType("longtext") + .HasColumnName("Paramters"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("Name"); + + b.ToTable("TK_BackgroundJobActions", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.TaskManagement.BackgroundJobInfo", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("Args") + .HasColumnType("longtext") + .HasColumnName("Args"); + + b.Property("BeginTime") + .HasColumnType("datetime(6)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("Cron") + .HasMaxLength(50) + .HasColumnType("varchar(50)") + .HasColumnName("Cron"); + + b.Property("Description") + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .HasColumnName("Description"); + + b.Property("EndTime") + .HasColumnType("datetime(6)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("Group") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)") + .HasColumnName("Group"); + + b.Property("Interval") + .HasColumnType("int"); + + b.Property("IsAbandoned") + .HasColumnType("tinyint(1)"); + + b.Property("IsEnabled") + .HasColumnType("tinyint(1)"); + + b.Property("JobType") + .HasColumnType("int"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("LastRunTime") + .HasColumnType("datetime(6)"); + + b.Property("LockTimeOut") + .HasColumnType("int"); + + b.Property("MaxCount") + .HasColumnType("int"); + + b.Property("MaxTryCount") + .HasColumnType("int"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasColumnName("Name"); + + b.Property("NextRunTime") + .HasColumnType("datetime(6)"); + + b.Property("NodeName") + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("NodeName"); + + b.Property("Priority") + .HasColumnType("int"); + + b.Property("Result") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)") + .HasColumnName("Result"); + + b.Property("Source") + .HasColumnType("int"); + + b.Property("Status") + .HasColumnType("int"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("TriggerCount") + .HasColumnType("int"); + + b.Property("TryCount") + .HasColumnType("int"); + + b.Property("Type") + .IsRequired() + .HasMaxLength(1000) + .HasColumnType("varchar(1000)") + .HasColumnName("Type"); + + b.HasKey("Id"); + + b.HasIndex("Name", "Group"); + + b.ToTable("TK_BackgroundJobs", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.TaskManagement.BackgroundJobLog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + b.Property("Exception") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)") + .HasColumnName("Exception"); + + b.Property("JobGroup") + .HasMaxLength(50) + .HasColumnType("varchar(50)") + .HasColumnName("JobGroup"); + + b.Property("JobId") + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .HasColumnName("JobId"); + + b.Property("JobName") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasColumnName("JobName"); + + b.Property("JobType") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)") + .HasColumnName("JobType"); + + b.Property("Message") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)") + .HasColumnName("Message"); + + b.Property("RunTime") + .HasColumnType("datetime(6)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("JobGroup", "JobName"); + + b.ToTable("TK_BackgroundJobLogs", (string)null); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/aspnet-core/migrations/LY.MicroService.TaskManagement.DbMigrator/Program.cs b/aspnet-core/migrations/LY.MicroService.TaskManagement.DbMigrator/Program.cs new file mode 100644 index 000000000..185fb7e53 --- /dev/null +++ b/aspnet-core/migrations/LY.MicroService.TaskManagement.DbMigrator/Program.cs @@ -0,0 +1,40 @@ +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using Microsoft.Extensions.Logging; +using Serilog; +using Serilog.Events; + +namespace LY.MicroService.TaskManagement.DbMigrator; + +public class Program +{ + public async static Task Main(string[] args) + { + Log.Logger = new LoggerConfiguration() + .MinimumLevel.Information() + .MinimumLevel.Override("Microsoft", LogEventLevel.Warning) + .MinimumLevel.Override("Volo.Abp", LogEventLevel.Warning) +#if DEBUG + .MinimumLevel.Override("LY.MicroService.TaskManagement.DbMigrator", LogEventLevel.Debug) +#else + .MinimumLevel.Override("LY.MicroService.TaskManagement.DbMigrator", LogEventLevel.Information) +#endif + .Enrich.FromLogContext() + .WriteTo.Console() + .WriteTo.File("Logs/migrations.txt") + .CreateLogger(); + + await CreateHostBuilder(args).RunConsoleAsync(); + } + + public static IHostBuilder CreateHostBuilder(string[] args) + { + return Host.CreateDefaultBuilder(args) + .AddAppSettingsSecretsJson() + .ConfigureLogging((context, logging) => logging.ClearProviders()) + .ConfigureServices((hostContext, services) => + { + services.AddHostedService(); + }); + } +} diff --git a/aspnet-core/migrations/LY.MicroService.TaskManagement.DbMigrator/Properties/launchSettings.json b/aspnet-core/migrations/LY.MicroService.TaskManagement.DbMigrator/Properties/launchSettings.json new file mode 100644 index 000000000..3000e4aba --- /dev/null +++ b/aspnet-core/migrations/LY.MicroService.TaskManagement.DbMigrator/Properties/launchSettings.json @@ -0,0 +1,11 @@ +{ + "profiles": { + "LY.MicroService.TaskManagement.DbMigrator": { + "commandName": "Project", + "dotnetRunMessages": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } +} \ No newline at end of file diff --git a/aspnet-core/migrations/LY.MicroService.TaskManagement.DbMigrator/TaskManagementDbMigratorHostedService.cs b/aspnet-core/migrations/LY.MicroService.TaskManagement.DbMigrator/TaskManagementDbMigratorHostedService.cs new file mode 100644 index 000000000..5eba27666 --- /dev/null +++ b/aspnet-core/migrations/LY.MicroService.TaskManagement.DbMigrator/TaskManagementDbMigratorHostedService.cs @@ -0,0 +1,51 @@ +using LY.MicroService.TaskManagement.DbMigrator.EntityFrameworkCore; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using Serilog; +using Volo.Abp; +using Volo.Abp.Data; + +namespace LY.MicroService.TaskManagement.DbMigrator; + +public class TaskManagementDbMigratorHostedService : IHostedService +{ + private readonly IHostApplicationLifetime _hostApplicationLifetime; + private readonly IConfiguration _configuration; + + public TaskManagementDbMigratorHostedService( + 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() + .MigrateAsync(); + + await application.ShutdownAsync(); + + _hostApplicationLifetime.StopApplication(); + } + + public Task StopAsync(CancellationToken cancellationToken) + { + return Task.CompletedTask; + } +} + diff --git a/aspnet-core/migrations/LY.MicroService.TaskManagement.DbMigrator/TaskManagementDbMigratorModule.Configure.cs b/aspnet-core/migrations/LY.MicroService.TaskManagement.DbMigrator/TaskManagementDbMigratorModule.Configure.cs new file mode 100644 index 000000000..6fd7f7551 --- /dev/null +++ b/aspnet-core/migrations/LY.MicroService.TaskManagement.DbMigrator/TaskManagementDbMigratorModule.Configure.cs @@ -0,0 +1,18 @@ +using LY.MicroService.TaskManagement.DbMigrator.EntityFrameworkCore; +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp.EntityFrameworkCore; + +namespace LY.MicroService.TaskManagement.DbMigrator; +public partial class TaskManagementDbMigratorModule +{ + private void ConfigureDbContext(IServiceCollection services) + { + services.AddAbpDbContext(); + + // 配置Ef + Configure(options => + { + options.UseMySQL(); + }); + } +} diff --git a/aspnet-core/migrations/LY.MicroService.TaskManagement.DbMigrator/TaskManagementDbMigratorModule.cs b/aspnet-core/migrations/LY.MicroService.TaskManagement.DbMigrator/TaskManagementDbMigratorModule.cs new file mode 100644 index 000000000..a10892b76 --- /dev/null +++ b/aspnet-core/migrations/LY.MicroService.TaskManagement.DbMigrator/TaskManagementDbMigratorModule.cs @@ -0,0 +1,29 @@ +using LINGYUN.Abp.Data.DbMigrator; +using LINGYUN.Abp.Saas.EntityFrameworkCore; +using LINGYUN.Abp.TaskManagement.EntityFrameworkCore; +using Volo.Abp.Autofac; +using Volo.Abp.EntityFrameworkCore.MySQL; +using Volo.Abp.FeatureManagement.EntityFrameworkCore; +using Volo.Abp.Modularity; +using Volo.Abp.PermissionManagement.EntityFrameworkCore; +using Volo.Abp.SettingManagement.EntityFrameworkCore; + +namespace LY.MicroService.TaskManagement.DbMigrator; + +[DependsOn( + typeof(AbpSaasEntityFrameworkCoreModule), + typeof(AbpSettingManagementEntityFrameworkCoreModule), + typeof(AbpPermissionManagementEntityFrameworkCoreModule), + typeof(AbpFeatureManagementEntityFrameworkCoreModule), + typeof(TaskManagementEntityFrameworkCoreModule), + typeof(AbpEntityFrameworkCoreMySQLModule), + typeof(AbpDataDbMigratorModule), + typeof(AbpAutofacModule) + )] +public partial class TaskManagementDbMigratorModule : AbpModule +{ + public override void ConfigureServices(ServiceConfigurationContext context) + { + ConfigureDbContext(context.Services); + } +} diff --git a/aspnet-core/migrations/LY.MicroService.TaskManagement.DbMigrator/Usings.cs b/aspnet-core/migrations/LY.MicroService.TaskManagement.DbMigrator/Usings.cs new file mode 100644 index 000000000..8d1695408 --- /dev/null +++ b/aspnet-core/migrations/LY.MicroService.TaskManagement.DbMigrator/Usings.cs @@ -0,0 +1,7 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Volo.Abp; +using LINGYUN.Abp; diff --git a/aspnet-core/migrations/LY.MicroService.TaskManagement.DbMigrator/appsettings.json b/aspnet-core/migrations/LY.MicroService.TaskManagement.DbMigrator/appsettings.json new file mode 100644 index 000000000..355c02f19 --- /dev/null +++ b/aspnet-core/migrations/LY.MicroService.TaskManagement.DbMigrator/appsettings.json @@ -0,0 +1,81 @@ +{ + "ConnectionStrings": { + "Default": "Server=127.0.0.1;Database=Platform-v70;User Id=root;Password=123456", + "AbpSaas": "Server=127.0.0.1;Database=Platform-v70;User Id=root;Password=123456", + "AbpSettingManagement": "Server=127.0.0.1;Database=Platform-v70;User Id=root;Password=123456", + "AbpFeatureManagement": "Server=127.0.0.1;Database=Platform-v70;User Id=root;Password=123456", + "AbpPermissionManagement": "Server=127.0.0.1;Database=Platform-v70;User Id=root;Password=123456", + "AbpLocalizationManagement": "Server=127.0.0.1;Database=Platform-v70;User Id=root;Password=123456", + "TaskManagement": "Server=127.0.0.1;Database=Platform-v70;User Id=root;Password=123456" + }, + "StringEncryption": { + "DefaultPassPhrase": "s46c5q55nxpeS8Ra", + "InitVectorBytes": "s83ng0abvd02js84", + "DefaultSalt": "sf&5)s3#" + }, + "Serilog": { + "MinimumLevel": { + "Default": "Information", + "Override": { + "System": "Warning", + "Microsoft": "Warning", + "DotNetCore": "Information" + } + }, + "Enrich": [ "FromLogContext", "WithProcessId", "WithThreadId", "WithEnvironmentName", "WithMachineName", "WithApplicationName", "WithUniqueId" ], + "WriteTo": [ + { + "Name": "Console", + "Args": { + "restrictedToMinimumLevel": "Debug", + "outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss} [{Level:u3}] [{SourceContext}] [{ProcessId}] [{ThreadId}] - {Message:lj}{NewLine}{Exception}" + } + }, + { + "Name": "File", + "Args": { + "path": "Logs/Debug-.log", + "restrictedToMinimumLevel": "Debug", + "rollingInterval": "Day", + "outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss} [{Level:u3}] [{SourceContext}] [{ProcessId}] [{ThreadId}] - {Message:lj}{NewLine}{Exception}" + } + }, + { + "Name": "File", + "Args": { + "path": "Logs/Info-.log", + "restrictedToMinimumLevel": "Information", + "rollingInterval": "Day", + "outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss} [{Level:u3}] [{SourceContext}] [{ProcessId}] [{ThreadId}] - {Message:lj}{NewLine}{Exception}" + } + }, + { + "Name": "File", + "Args": { + "path": "Logs/Warn-.log", + "restrictedToMinimumLevel": "Warning", + "rollingInterval": "Day", + "outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss} [{Level:u3}] [{SourceContext}] [{ProcessId}] [{ThreadId}] - {Message:lj}{NewLine}{Exception}" + } + }, + { + "Name": "File", + "Args": { + "path": "Logs/Error-.log", + "restrictedToMinimumLevel": "Error", + "rollingInterval": "Day", + "outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss} [{Level:u3}] [{SourceContext}] [{ProcessId}] [{ThreadId}] - {Message:lj}{NewLine}{Exception}" + } + }, + { + "Name": "File", + "Args": { + "path": "Logs/Fatal-.log", + "restrictedToMinimumLevel": "Fatal", + "rollingInterval": "Day", + "outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss} [{Level:u3}] [{SourceContext}] [{ProcessId}] [{ThreadId}] - {Message:lj}{NewLine}{Exception}" + } + } + ] + } +} diff --git a/aspnet-core/modules/dynamic-queryable/LINGYUN.Abp.Dynamic.Queryable.Application/LINGYUN/Abp/Dynamic/Queryable/AbpDynamicQueryableOptions.cs b/aspnet-core/modules/dynamic-queryable/LINGYUN.Abp.Dynamic.Queryable.Application/LINGYUN/Abp/Dynamic/Queryable/AbpDynamicQueryableOptions.cs index 9450db7d9..687d7b40d 100644 --- a/aspnet-core/modules/dynamic-queryable/LINGYUN.Abp.Dynamic.Queryable.Application/LINGYUN/Abp/Dynamic/Queryable/AbpDynamicQueryableOptions.cs +++ b/aspnet-core/modules/dynamic-queryable/LINGYUN.Abp.Dynamic.Queryable.Application/LINGYUN/Abp/Dynamic/Queryable/AbpDynamicQueryableOptions.cs @@ -1,5 +1,6 @@ using System.Collections.Generic; using Volo.Abp.Auditing; +using Volo.Abp.Domain.Entities; using Volo.Abp.MultiTenancy; namespace LINGYUN.Abp.Dynamic.Queryable; @@ -12,6 +13,7 @@ public class AbpDynamicQueryableOptions { IgnoreFields = new List { + nameof(IEntity.Id), nameof(IMultiTenant.TenantId), nameof(IDeletionAuditedObject.IsDeleted), nameof(IDeletionAuditedObject.DeleterId), diff --git a/aspnet-core/modules/notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN.Abp.Notifications.Domain.csproj b/aspnet-core/modules/notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN.Abp.Notifications.Domain.csproj index d957d22ac..33f71325d 100644 --- a/aspnet-core/modules/notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN.Abp.Notifications.Domain.csproj +++ b/aspnet-core/modules/notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN.Abp.Notifications.Domain.csproj @@ -8,6 +8,10 @@ + + + + diff --git a/aspnet-core/services/LY.MicroService.TaskManagement.HttpApi.Host/appsettings.Development.json b/aspnet-core/services/LY.MicroService.TaskManagement.HttpApi.Host/appsettings.Development.json index 57d86bdca..c03b0e207 100644 --- a/aspnet-core/services/LY.MicroService.TaskManagement.HttpApi.Host/appsettings.Development.json +++ b/aspnet-core/services/LY.MicroService.TaskManagement.HttpApi.Host/appsettings.Development.json @@ -1,6 +1,6 @@ { "AgileConfig": { - "IsEnabled": true, + "IsEnabled": false, "env": "DEV", "appId": "LINGYUN.Abp.TaskManagement", "secret": "1q2w3E*", diff --git a/aspnet-core/services/LY.MicroService.WebhooksManagement.HttpApi.Host/Properties/launchSettings.json b/aspnet-core/services/LY.MicroService.WebhooksManagement.HttpApi.Host/Properties/launchSettings.json index 7e93c505e..5678ad837 100644 --- a/aspnet-core/services/LY.MicroService.WebhooksManagement.HttpApi.Host/Properties/launchSettings.json +++ b/aspnet-core/services/LY.MicroService.WebhooksManagement.HttpApi.Host/Properties/launchSettings.json @@ -11,11 +11,11 @@ "LY.MicroService.WebhooksManagement.HttpApi.Host": { "commandName": "Project", "launchBrowser": false, + "dotnetRunMessages": true, "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" }, - "applicationUrl": "http://127.0.0.1:30045", - "dotnetRunMessages": "true" + "applicationUrl": "http://127.0.0.1:30045" } } } \ No newline at end of file diff --git a/aspnet-core/services/LY.MicroService.WorkflowManagement.HttpApi.Host/Migrations/20211212074420_Add-Module-Workflow-Management.Designer.cs b/aspnet-core/services/LY.MicroService.WorkflowManagement.HttpApi.Host/Migrations/20211212074420_Add-Module-Workflow-Management.Designer.cs deleted file mode 100644 index 464735504..000000000 --- a/aspnet-core/services/LY.MicroService.WorkflowManagement.HttpApi.Host/Migrations/20211212074420_Add-Module-Workflow-Management.Designer.cs +++ /dev/null @@ -1,557 +0,0 @@ -// -using System; -using LY.MicroService.WorkflowManagement.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Volo.Abp.EntityFrameworkCore; - -#nullable disable - -namespace LY.MicroService.WorkflowManagement.Migrations -{ - [DbContext(typeof(WorkflowManagementMigrationsDbContext))] - [Migration("20211212074420_Add-Module-Workflow-Management")] - partial class AddModuleWorkflowManagement - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.MySql) - .HasAnnotation("ProductVersion", "6.0.0") - .HasAnnotation("Relational:MaxIdentifierLength", 64); - - modelBuilder.Entity("LINGYUN.Abp.WorkflowCore.Persistence.PersistedEvent", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("CreationTime") - .HasColumnType("datetime(6)") - .HasColumnName("CreationTime"); - - b.Property("EventData") - .HasColumnType("longtext"); - - b.Property("EventKey") - .HasMaxLength(200) - .HasColumnType("varchar(200)"); - - b.Property("EventName") - .HasMaxLength(200) - .HasColumnType("varchar(200)"); - - b.Property("IsProcessed") - .HasColumnType("tinyint(1)"); - - b.Property("TenantId") - .HasColumnType("char(36)") - .HasColumnName("TenantId"); - - b.HasKey("Id"); - - b.HasIndex("CreationTime"); - - b.HasIndex("IsProcessed"); - - b.HasIndex("EventName", "EventKey"); - - b.ToTable("WF_Event", (string)null); - }); - - modelBuilder.Entity("LINGYUN.Abp.WorkflowCore.Persistence.PersistedExecutionError", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("ErrorTime") - .HasColumnType("datetime(6)"); - - b.Property("ExecutionPointerId") - .HasMaxLength(50) - .HasColumnType("char(50)"); - - b.Property("Message") - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("char(36)") - .HasColumnName("TenantId"); - - b.Property("WorkflowId") - .HasColumnType("char(36)"); - - b.HasKey("Id"); - - b.ToTable("WF_ExecutionError", (string)null); - }); - - modelBuilder.Entity("LINGYUN.Abp.WorkflowCore.Persistence.PersistedExecutionPointer", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasMaxLength(50) - .HasColumnType("char(50)"); - - b.Property("Active") - .HasColumnType("tinyint(1)"); - - b.Property("Children") - .HasColumnType("longtext"); - - b.Property("ContextItem") - .HasColumnType("longtext"); - - b.Property("EndTime") - .HasColumnType("datetime(6)"); - - b.Property("EventData") - .HasColumnType("longtext"); - - b.Property("EventKey") - .HasMaxLength(200) - .HasColumnType("varchar(200)"); - - b.Property("EventName") - .HasMaxLength(200) - .HasColumnType("varchar(200)"); - - b.Property("EventPublished") - .HasColumnType("tinyint(1)"); - - b.Property("Outcome") - .HasColumnType("longtext"); - - b.Property("PersistenceData") - .HasColumnType("longtext"); - - b.Property("PredecessorId") - .HasMaxLength(100) - .HasColumnType("varchar(100)"); - - b.Property("RetryCount") - .HasColumnType("int"); - - b.Property("Scope") - .HasColumnType("longtext"); - - b.Property("SleepUntil") - .HasColumnType("datetime(6)"); - - b.Property("StartTime") - .HasColumnType("datetime(6)"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("StepId") - .HasColumnType("int"); - - b.Property("StepName") - .HasMaxLength(100) - .HasColumnType("varchar(100)"); - - b.Property("TenantId") - .HasColumnType("char(36)") - .HasColumnName("TenantId"); - - b.Property("WorkflowId") - .HasColumnType("char(36)"); - - b.HasKey("Id"); - - b.HasIndex("WorkflowId"); - - b.ToTable("WF_ExecutionPointer", (string)null); - }); - - modelBuilder.Entity("LINGYUN.Abp.WorkflowCore.Persistence.PersistedExtensionAttribute", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - b.Property("ExecutionPointerId") - .HasMaxLength(50) - .HasColumnType("char(50)"); - - b.Property("Key") - .HasMaxLength(100) - .HasColumnType("varchar(100)"); - - b.Property("TenantId") - .HasColumnType("char(36)") - .HasColumnName("TenantId"); - - b.Property("Value") - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.HasIndex("ExecutionPointerId"); - - b.ToTable("WF_ExtensionAttribute", (string)null); - }); - - modelBuilder.Entity("LINGYUN.Abp.WorkflowCore.Persistence.PersistedScheduledCommand", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - b.Property("CommandName") - .HasMaxLength(200) - .HasColumnType("varchar(200)"); - - b.Property("Data") - .HasMaxLength(500) - .HasColumnType("varchar(500)"); - - b.Property("ExecuteTime") - .HasColumnType("bigint"); - - b.Property("TenantId") - .HasColumnType("char(36)") - .HasColumnName("TenantId"); - - b.HasKey("Id"); - - b.HasIndex("ExecuteTime"); - - b.HasIndex("CommandName", "Data") - .IsUnique(); - - b.ToTable("WF_ScheduledCommand", (string)null); - }); - - modelBuilder.Entity("LINGYUN.Abp.WorkflowCore.Persistence.PersistedSubscription", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("EventKey") - .HasMaxLength(200) - .HasColumnType("varchar(200)"); - - b.Property("EventName") - .HasMaxLength(200) - .HasColumnType("varchar(200)"); - - b.Property("ExecutionPointerId") - .HasMaxLength(50) - .HasColumnType("char(50)"); - - b.Property("ExternalToken") - .HasMaxLength(200) - .HasColumnType("varchar(200)"); - - b.Property("ExternalTokenExpiry") - .HasColumnType("datetime(6)"); - - b.Property("ExternalWorkerId") - .HasMaxLength(200) - .HasColumnType("varchar(200)"); - - b.Property("StepId") - .HasColumnType("int"); - - b.Property("SubscribeAsOf") - .HasColumnType("datetime(6)"); - - b.Property("SubscriptionData") - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("char(36)") - .HasColumnName("TenantId"); - - b.Property("WorkflowId") - .HasColumnType("char(36)"); - - b.HasKey("Id"); - - b.HasIndex("EventKey"); - - b.HasIndex("EventName"); - - b.ToTable("WF_Subscription", (string)null); - }); - - modelBuilder.Entity("LINGYUN.Abp.WorkflowCore.Persistence.PersistedWorkflow", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("CompleteTime") - .HasColumnType("datetime(6)"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnName("ConcurrencyStamp"); - - b.Property("CreationTime") - .HasColumnType("datetime(6)") - .HasColumnName("CreationTime"); - - b.Property("CreatorId") - .HasColumnType("char(36)") - .HasColumnName("CreatorId"); - - b.Property("Data") - .HasColumnType("longtext"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("varchar(500)"); - - b.Property("ExtraProperties") - .HasColumnType("longtext") - .HasColumnName("ExtraProperties"); - - b.Property("LastModificationTime") - .HasColumnType("datetime(6)") - .HasColumnName("LastModificationTime"); - - b.Property("LastModifierId") - .HasColumnType("char(36)") - .HasColumnName("LastModifierId"); - - b.Property("NextExecution") - .HasColumnType("bigint"); - - b.Property("Reference") - .HasMaxLength(200) - .HasColumnType("varchar(200)"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("TenantId") - .HasColumnType("char(36)") - .HasColumnName("TenantId"); - - b.Property("Version") - .HasColumnType("int"); - - b.Property("WorkflowDefinitionId") - .HasMaxLength(200) - .HasColumnType("varchar(200)"); - - b.HasKey("Id"); - - b.HasIndex("NextExecution"); - - b.ToTable("WF_Workflow", (string)null); - }); - - modelBuilder.Entity("LINGYUN.Abp.WorkflowManagement.CompensateNode", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("CancelCondition") - .HasMaxLength(200) - .HasColumnType("varchar(200)"); - - b.Property("ErrorBehavior") - .HasColumnType("int"); - - b.Property("Inputs") - .HasColumnType("longtext"); - - b.Property("Name") - .HasMaxLength(100) - .HasColumnType("varchar(100)"); - - b.Property("Outputs") - .HasColumnType("longtext"); - - b.Property("ParentId") - .HasColumnType("char(36)"); - - b.Property("RetryInterval") - .HasColumnType("time(6)"); - - b.Property("Saga") - .HasColumnType("tinyint(1)"); - - b.Property("SelectNextStep") - .HasColumnType("longtext"); - - b.Property("StepType") - .HasMaxLength(100) - .HasColumnType("varchar(100)"); - - b.Property("TenantId") - .HasColumnType("char(36)") - .HasColumnName("TenantId"); - - b.Property("WorkflowId") - .HasColumnType("char(36)"); - - b.HasKey("Id"); - - b.ToTable("WF_Compensate", (string)null); - }); - - modelBuilder.Entity("LINGYUN.Abp.WorkflowManagement.StepNode", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("CancelCondition") - .HasMaxLength(200) - .HasColumnType("varchar(200)"); - - b.Property("ErrorBehavior") - .HasColumnType("int"); - - b.Property("Inputs") - .HasColumnType("longtext"); - - b.Property("Name") - .HasMaxLength(100) - .HasColumnType("varchar(100)"); - - b.Property("Outputs") - .HasColumnType("longtext"); - - b.Property("ParentId") - .HasColumnType("char(36)"); - - b.Property("RetryInterval") - .HasColumnType("time(6)"); - - b.Property("Saga") - .HasColumnType("tinyint(1)"); - - b.Property("SelectNextStep") - .HasColumnType("longtext"); - - b.Property("StepType") - .HasMaxLength(100) - .HasColumnType("varchar(100)"); - - b.Property("TenantId") - .HasColumnType("char(36)") - .HasColumnName("TenantId"); - - b.Property("WorkflowId") - .HasColumnType("char(36)"); - - b.HasKey("Id"); - - b.ToTable("WF_Step", (string)null); - }); - - modelBuilder.Entity("LINGYUN.Abp.WorkflowManagement.Workflow", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnName("ConcurrencyStamp"); - - b.Property("CreationTime") - .HasColumnType("datetime(6)") - .HasColumnName("CreationTime"); - - b.Property("CreatorId") - .HasColumnType("char(36)") - .HasColumnName("CreatorId"); - - b.Property("Description") - .HasMaxLength(200) - .HasColumnType("varchar(200)"); - - b.Property("DisplayName") - .HasMaxLength(200) - .HasColumnType("varchar(200)"); - - b.Property("ErrorBehavior") - .HasColumnType("int"); - - b.Property("ErrorRetryInterval") - .HasColumnType("time(6)"); - - b.Property("ExtraProperties") - .HasColumnType("longtext") - .HasColumnName("ExtraProperties"); - - b.Property("IsEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("LastModificationTime") - .HasColumnType("datetime(6)") - .HasColumnName("LastModificationTime"); - - b.Property("LastModifierId") - .HasColumnType("char(36)") - .HasColumnName("LastModifierId"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("varchar(100)"); - - b.Property("TenantId") - .HasColumnType("char(36)") - .HasColumnName("TenantId"); - - b.Property("Version") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.ToTable("WF_Definition", (string)null); - }); - - modelBuilder.Entity("LINGYUN.Abp.WorkflowCore.Persistence.PersistedExecutionPointer", b => - { - b.HasOne("LINGYUN.Abp.WorkflowCore.Persistence.PersistedWorkflow", "Workflow") - .WithMany("ExecutionPointers") - .HasForeignKey("WorkflowId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Workflow"); - }); - - modelBuilder.Entity("LINGYUN.Abp.WorkflowCore.Persistence.PersistedExtensionAttribute", b => - { - b.HasOne("LINGYUN.Abp.WorkflowCore.Persistence.PersistedExecutionPointer", "ExecutionPointer") - .WithMany("ExtensionAttributes") - .HasForeignKey("ExecutionPointerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ExecutionPointer"); - }); - - modelBuilder.Entity("LINGYUN.Abp.WorkflowCore.Persistence.PersistedExecutionPointer", b => - { - b.Navigation("ExtensionAttributes"); - }); - - modelBuilder.Entity("LINGYUN.Abp.WorkflowCore.Persistence.PersistedWorkflow", b => - { - b.Navigation("ExecutionPointers"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/aspnet-core/services/LY.MicroService.WorkflowManagement.HttpApi.Host/Migrations/20211212074420_Add-Module-Workflow-Management.cs b/aspnet-core/services/LY.MicroService.WorkflowManagement.HttpApi.Host/Migrations/20211212074420_Add-Module-Workflow-Management.cs deleted file mode 100644 index e6abb6314..000000000 --- a/aspnet-core/services/LY.MicroService.WorkflowManagement.HttpApi.Host/Migrations/20211212074420_Add-Module-Workflow-Management.cs +++ /dev/null @@ -1,385 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace LY.MicroService.WorkflowManagement.Migrations -{ - public partial class AddModuleWorkflowManagement : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AlterDatabase() - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateTable( - name: "WF_Compensate", - columns: table => new - { - Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - TenantId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), - WorkflowId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - Name = table.Column(type: "varchar(100)", maxLength: 100, nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - StepType = table.Column(type: "varchar(100)", maxLength: 100, nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - CancelCondition = table.Column(type: "varchar(200)", maxLength: 200, nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - ErrorBehavior = table.Column(type: "int", nullable: true), - RetryInterval = table.Column(type: "time(6)", nullable: true), - Saga = table.Column(type: "tinyint(1)", nullable: false), - ParentId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), - Inputs = table.Column(type: "longtext", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - Outputs = table.Column(type: "longtext", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - SelectNextStep = table.Column(type: "longtext", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4") - }, - constraints: table => - { - table.PrimaryKey("PK_WF_Compensate", x => x.Id); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateTable( - name: "WF_Definition", - columns: table => new - { - Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - TenantId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), - IsEnabled = table.Column(type: "tinyint(1)", nullable: false), - Name = table.Column(type: "varchar(100)", maxLength: 100, nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - DisplayName = table.Column(type: "varchar(200)", maxLength: 200, nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - Description = table.Column(type: "varchar(200)", maxLength: 200, nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - Version = table.Column(type: "int", nullable: false), - ErrorBehavior = table.Column(type: "int", nullable: false), - ErrorRetryInterval = table.Column(type: "time(6)", nullable: true), - ExtraProperties = table.Column(type: "longtext", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - ConcurrencyStamp = table.Column(type: "varchar(40)", maxLength: 40, nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - CreationTime = table.Column(type: "datetime(6)", nullable: false), - CreatorId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), - LastModificationTime = table.Column(type: "datetime(6)", nullable: true), - LastModifierId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci") - }, - constraints: table => - { - table.PrimaryKey("PK_WF_Definition", x => x.Id); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateTable( - name: "WF_Event", - columns: table => new - { - Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - TenantId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), - EventName = table.Column(type: "varchar(200)", maxLength: 200, nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - EventKey = table.Column(type: "varchar(200)", maxLength: 200, nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - EventData = table.Column(type: "longtext", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - IsProcessed = table.Column(type: "tinyint(1)", nullable: false), - CreationTime = table.Column(type: "datetime(6)", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_WF_Event", x => x.Id); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateTable( - name: "WF_ExecutionError", - columns: table => new - { - Id = table.Column(type: "int", nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - TenantId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), - WorkflowId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - ExecutionPointerId = table.Column(type: "char(50)", maxLength: 50, nullable: false, collation: "ascii_general_ci"), - ErrorTime = table.Column(type: "datetime(6)", nullable: false), - Message = table.Column(type: "longtext", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4") - }, - constraints: table => - { - table.PrimaryKey("PK_WF_ExecutionError", x => x.Id); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateTable( - name: "WF_ScheduledCommand", - columns: table => new - { - Id = table.Column(type: "bigint", nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - TenantId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), - CommandName = table.Column(type: "varchar(200)", maxLength: 200, nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - Data = table.Column(type: "varchar(500)", maxLength: 500, nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - ExecuteTime = table.Column(type: "bigint", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_WF_ScheduledCommand", x => x.Id); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateTable( - name: "WF_Step", - columns: table => new - { - Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - TenantId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), - WorkflowId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - Name = table.Column(type: "varchar(100)", maxLength: 100, nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - StepType = table.Column(type: "varchar(100)", maxLength: 100, nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - CancelCondition = table.Column(type: "varchar(200)", maxLength: 200, nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - ErrorBehavior = table.Column(type: "int", nullable: true), - RetryInterval = table.Column(type: "time(6)", nullable: true), - Saga = table.Column(type: "tinyint(1)", nullable: false), - ParentId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), - Inputs = table.Column(type: "longtext", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - Outputs = table.Column(type: "longtext", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - SelectNextStep = table.Column(type: "longtext", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4") - }, - constraints: table => - { - table.PrimaryKey("PK_WF_Step", x => x.Id); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateTable( - name: "WF_Subscription", - columns: table => new - { - Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - TenantId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), - WorkflowId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - StepId = table.Column(type: "int", nullable: false), - ExecutionPointerId = table.Column(type: "char(50)", maxLength: 50, nullable: false, collation: "ascii_general_ci"), - EventName = table.Column(type: "varchar(200)", maxLength: 200, nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - EventKey = table.Column(type: "varchar(200)", maxLength: 200, nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - SubscribeAsOf = table.Column(type: "datetime(6)", nullable: false), - SubscriptionData = table.Column(type: "longtext", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - ExternalToken = table.Column(type: "varchar(200)", maxLength: 200, nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - ExternalWorkerId = table.Column(type: "varchar(200)", maxLength: 200, nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - ExternalTokenExpiry = table.Column(type: "datetime(6)", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_WF_Subscription", x => x.Id); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateTable( - name: "WF_Workflow", - columns: table => new - { - Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - TenantId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), - WorkflowDefinitionId = table.Column(type: "varchar(200)", maxLength: 200, nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - Version = table.Column(type: "int", nullable: false), - Description = table.Column(type: "varchar(500)", maxLength: 500, nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - Reference = table.Column(type: "varchar(200)", maxLength: 200, nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - NextExecution = table.Column(type: "bigint", nullable: true), - Status = table.Column(type: "int", nullable: false), - Data = table.Column(type: "longtext", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - CompleteTime = table.Column(type: "datetime(6)", nullable: true), - ExtraProperties = table.Column(type: "longtext", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - ConcurrencyStamp = table.Column(type: "varchar(40)", maxLength: 40, nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - CreationTime = table.Column(type: "datetime(6)", nullable: false), - CreatorId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), - LastModificationTime = table.Column(type: "datetime(6)", nullable: true), - LastModifierId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci") - }, - constraints: table => - { - table.PrimaryKey("PK_WF_Workflow", x => x.Id); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateTable( - name: "WF_ExecutionPointer", - columns: table => new - { - Id = table.Column(type: "char(50)", maxLength: 50, nullable: false, collation: "ascii_general_ci"), - TenantId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), - WorkflowId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - StepId = table.Column(type: "int", nullable: false), - Active = table.Column(type: "tinyint(1)", nullable: false), - SleepUntil = table.Column(type: "datetime(6)", nullable: true), - PersistenceData = table.Column(type: "longtext", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - StartTime = table.Column(type: "datetime(6)", nullable: true), - EndTime = table.Column(type: "datetime(6)", nullable: true), - EventName = table.Column(type: "varchar(200)", maxLength: 200, nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - EventKey = table.Column(type: "varchar(200)", maxLength: 200, nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - EventPublished = table.Column(type: "tinyint(1)", nullable: false), - EventData = table.Column(type: "longtext", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - StepName = table.Column(type: "varchar(100)", maxLength: 100, nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - RetryCount = table.Column(type: "int", nullable: false), - Children = table.Column(type: "longtext", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - ContextItem = table.Column(type: "longtext", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - PredecessorId = table.Column(type: "varchar(100)", maxLength: 100, nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - Outcome = table.Column(type: "longtext", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - Status = table.Column(type: "int", nullable: false), - Scope = table.Column(type: "longtext", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4") - }, - constraints: table => - { - table.PrimaryKey("PK_WF_ExecutionPointer", x => x.Id); - table.ForeignKey( - name: "FK_WF_ExecutionPointer_WF_Workflow_WorkflowId", - column: x => x.WorkflowId, - principalTable: "WF_Workflow", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateTable( - name: "WF_ExtensionAttribute", - columns: table => new - { - Id = table.Column(type: "bigint", nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - TenantId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), - ExecutionPointerId = table.Column(type: "char(50)", maxLength: 50, nullable: false, collation: "ascii_general_ci"), - Key = table.Column(type: "varchar(100)", maxLength: 100, nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - Value = table.Column(type: "longtext", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4") - }, - constraints: table => - { - table.PrimaryKey("PK_WF_ExtensionAttribute", x => x.Id); - table.ForeignKey( - name: "FK_WF_ExtensionAttribute_WF_ExecutionPointer_ExecutionPointerId", - column: x => x.ExecutionPointerId, - principalTable: "WF_ExecutionPointer", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateIndex( - name: "IX_WF_Event_CreationTime", - table: "WF_Event", - column: "CreationTime"); - - migrationBuilder.CreateIndex( - name: "IX_WF_Event_EventName_EventKey", - table: "WF_Event", - columns: new[] { "EventName", "EventKey" }); - - migrationBuilder.CreateIndex( - name: "IX_WF_Event_IsProcessed", - table: "WF_Event", - column: "IsProcessed"); - - migrationBuilder.CreateIndex( - name: "IX_WF_ExecutionPointer_WorkflowId", - table: "WF_ExecutionPointer", - column: "WorkflowId"); - - migrationBuilder.CreateIndex( - name: "IX_WF_ExtensionAttribute_ExecutionPointerId", - table: "WF_ExtensionAttribute", - column: "ExecutionPointerId"); - - migrationBuilder.CreateIndex( - name: "IX_WF_ScheduledCommand_CommandName_Data", - table: "WF_ScheduledCommand", - columns: new[] { "CommandName", "Data" }, - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_WF_ScheduledCommand_ExecuteTime", - table: "WF_ScheduledCommand", - column: "ExecuteTime"); - - migrationBuilder.CreateIndex( - name: "IX_WF_Subscription_EventKey", - table: "WF_Subscription", - column: "EventKey"); - - migrationBuilder.CreateIndex( - name: "IX_WF_Subscription_EventName", - table: "WF_Subscription", - column: "EventName"); - - migrationBuilder.CreateIndex( - name: "IX_WF_Workflow_NextExecution", - table: "WF_Workflow", - column: "NextExecution"); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "WF_Compensate"); - - migrationBuilder.DropTable( - name: "WF_Definition"); - - migrationBuilder.DropTable( - name: "WF_Event"); - - migrationBuilder.DropTable( - name: "WF_ExecutionError"); - - migrationBuilder.DropTable( - name: "WF_ExtensionAttribute"); - - migrationBuilder.DropTable( - name: "WF_ScheduledCommand"); - - migrationBuilder.DropTable( - name: "WF_Step"); - - migrationBuilder.DropTable( - name: "WF_Subscription"); - - migrationBuilder.DropTable( - name: "WF_ExecutionPointer"); - - migrationBuilder.DropTable( - name: "WF_Workflow"); - } - } -} diff --git a/aspnet-core/services/LY.MicroService.WorkflowManagement.HttpApi.Host/Migrations/20211214085456_Add-Entity-Workflow-Data-With-WF-Management.Designer.cs b/aspnet-core/services/LY.MicroService.WorkflowManagement.HttpApi.Host/Migrations/20211214085456_Add-Entity-Workflow-Data-With-WF-Management.Designer.cs deleted file mode 100644 index 5214e38aa..000000000 --- a/aspnet-core/services/LY.MicroService.WorkflowManagement.HttpApi.Host/Migrations/20211214085456_Add-Entity-Workflow-Data-With-WF-Management.Designer.cs +++ /dev/null @@ -1,610 +0,0 @@ -// -using System; -using LY.MicroService.WorkflowManagement.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Volo.Abp.EntityFrameworkCore; - -#nullable disable - -namespace LY.MicroService.WorkflowManagement.Migrations -{ - [DbContext(typeof(WorkflowManagementMigrationsDbContext))] - [Migration("20211214085456_Add-Entity-Workflow-Data-With-WF-Management")] - partial class AddEntityWorkflowDataWithWFManagement - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.MySql) - .HasAnnotation("ProductVersion", "6.0.0") - .HasAnnotation("Relational:MaxIdentifierLength", 64); - - modelBuilder.Entity("LINGYUN.Abp.WorkflowCore.Persistence.PersistedEvent", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("CreationTime") - .HasColumnType("datetime(6)") - .HasColumnName("CreationTime"); - - b.Property("EventData") - .HasColumnType("longtext"); - - b.Property("EventKey") - .HasMaxLength(200) - .HasColumnType("varchar(200)"); - - b.Property("EventName") - .HasMaxLength(200) - .HasColumnType("varchar(200)"); - - b.Property("IsProcessed") - .HasColumnType("tinyint(1)"); - - b.Property("TenantId") - .HasColumnType("char(36)") - .HasColumnName("TenantId"); - - b.HasKey("Id"); - - b.HasIndex("CreationTime"); - - b.HasIndex("IsProcessed"); - - b.HasIndex("EventName", "EventKey"); - - b.ToTable("WF_Event", (string)null); - }); - - modelBuilder.Entity("LINGYUN.Abp.WorkflowCore.Persistence.PersistedExecutionError", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("ErrorTime") - .HasColumnType("datetime(6)"); - - b.Property("ExecutionPointerId") - .HasMaxLength(50) - .HasColumnType("char(50)"); - - b.Property("Message") - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("char(36)") - .HasColumnName("TenantId"); - - b.Property("WorkflowId") - .HasColumnType("char(36)"); - - b.HasKey("Id"); - - b.ToTable("WF_ExecutionError", (string)null); - }); - - modelBuilder.Entity("LINGYUN.Abp.WorkflowCore.Persistence.PersistedExecutionPointer", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasMaxLength(50) - .HasColumnType("char(50)"); - - b.Property("Active") - .HasColumnType("tinyint(1)"); - - b.Property("Children") - .HasColumnType("longtext"); - - b.Property("ContextItem") - .HasColumnType("longtext"); - - b.Property("EndTime") - .HasColumnType("datetime(6)"); - - b.Property("EventData") - .HasColumnType("longtext"); - - b.Property("EventKey") - .HasMaxLength(200) - .HasColumnType("varchar(200)"); - - b.Property("EventName") - .HasMaxLength(200) - .HasColumnType("varchar(200)"); - - b.Property("EventPublished") - .HasColumnType("tinyint(1)"); - - b.Property("Outcome") - .HasColumnType("longtext"); - - b.Property("PersistenceData") - .HasColumnType("longtext"); - - b.Property("PredecessorId") - .HasMaxLength(100) - .HasColumnType("varchar(100)"); - - b.Property("RetryCount") - .HasColumnType("int"); - - b.Property("Scope") - .HasColumnType("longtext"); - - b.Property("SleepUntil") - .HasColumnType("datetime(6)"); - - b.Property("StartTime") - .HasColumnType("datetime(6)"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("StepId") - .HasColumnType("int"); - - b.Property("StepName") - .HasMaxLength(100) - .HasColumnType("varchar(100)"); - - b.Property("TenantId") - .HasColumnType("char(36)") - .HasColumnName("TenantId"); - - b.Property("WorkflowId") - .HasColumnType("char(36)"); - - b.HasKey("Id"); - - b.HasIndex("WorkflowId"); - - b.ToTable("WF_ExecutionPointer", (string)null); - }); - - modelBuilder.Entity("LINGYUN.Abp.WorkflowCore.Persistence.PersistedExtensionAttribute", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - b.Property("ExecutionPointerId") - .HasMaxLength(50) - .HasColumnType("char(50)"); - - b.Property("Key") - .HasMaxLength(100) - .HasColumnType("varchar(100)"); - - b.Property("TenantId") - .HasColumnType("char(36)") - .HasColumnName("TenantId"); - - b.Property("Value") - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.HasIndex("ExecutionPointerId"); - - b.ToTable("WF_ExtensionAttribute", (string)null); - }); - - modelBuilder.Entity("LINGYUN.Abp.WorkflowCore.Persistence.PersistedScheduledCommand", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - b.Property("CommandName") - .HasMaxLength(200) - .HasColumnType("varchar(200)"); - - b.Property("Data") - .HasMaxLength(500) - .HasColumnType("varchar(500)"); - - b.Property("ExecuteTime") - .HasColumnType("bigint"); - - b.Property("TenantId") - .HasColumnType("char(36)") - .HasColumnName("TenantId"); - - b.HasKey("Id"); - - b.HasIndex("ExecuteTime"); - - b.HasIndex("CommandName", "Data") - .IsUnique(); - - b.ToTable("WF_ScheduledCommand", (string)null); - }); - - modelBuilder.Entity("LINGYUN.Abp.WorkflowCore.Persistence.PersistedSubscription", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("EventKey") - .HasMaxLength(200) - .HasColumnType("varchar(200)"); - - b.Property("EventName") - .HasMaxLength(200) - .HasColumnType("varchar(200)"); - - b.Property("ExecutionPointerId") - .HasMaxLength(50) - .HasColumnType("char(50)"); - - b.Property("ExternalToken") - .HasMaxLength(200) - .HasColumnType("varchar(200)"); - - b.Property("ExternalTokenExpiry") - .HasColumnType("datetime(6)"); - - b.Property("ExternalWorkerId") - .HasMaxLength(200) - .HasColumnType("varchar(200)"); - - b.Property("StepId") - .HasColumnType("int"); - - b.Property("SubscribeAsOf") - .HasColumnType("datetime(6)"); - - b.Property("SubscriptionData") - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("char(36)") - .HasColumnName("TenantId"); - - b.Property("WorkflowId") - .HasColumnType("char(36)"); - - b.HasKey("Id"); - - b.HasIndex("EventKey"); - - b.HasIndex("EventName"); - - b.ToTable("WF_Subscription", (string)null); - }); - - modelBuilder.Entity("LINGYUN.Abp.WorkflowCore.Persistence.PersistedWorkflow", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("CompleteTime") - .HasColumnType("datetime(6)"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnName("ConcurrencyStamp"); - - b.Property("CreationTime") - .HasColumnType("datetime(6)") - .HasColumnName("CreationTime"); - - b.Property("CreatorId") - .HasColumnType("char(36)") - .HasColumnName("CreatorId"); - - b.Property("Data") - .HasColumnType("longtext"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("varchar(500)"); - - b.Property("ExtraProperties") - .HasColumnType("longtext") - .HasColumnName("ExtraProperties"); - - b.Property("LastModificationTime") - .HasColumnType("datetime(6)") - .HasColumnName("LastModificationTime"); - - b.Property("LastModifierId") - .HasColumnType("char(36)") - .HasColumnName("LastModifierId"); - - b.Property("NextExecution") - .HasColumnType("bigint"); - - b.Property("Reference") - .HasMaxLength(200) - .HasColumnType("varchar(200)"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("TenantId") - .HasColumnType("char(36)") - .HasColumnName("TenantId"); - - b.Property("Version") - .HasColumnType("int"); - - b.Property("WorkflowDefinitionId") - .HasMaxLength(200) - .HasColumnType("varchar(200)"); - - b.HasKey("Id"); - - b.HasIndex("NextExecution"); - - b.ToTable("WF_Workflow", (string)null); - }); - - modelBuilder.Entity("LINGYUN.Abp.WorkflowManagement.CompensateNode", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("CancelCondition") - .HasMaxLength(200) - .HasColumnType("varchar(200)"); - - b.Property("ErrorBehavior") - .HasColumnType("int"); - - b.Property("Inputs") - .HasColumnType("longtext"); - - b.Property("Name") - .HasMaxLength(100) - .HasColumnType("varchar(100)"); - - b.Property("Outputs") - .HasColumnType("longtext"); - - b.Property("ParentId") - .HasColumnType("char(36)"); - - b.Property("RetryInterval") - .HasColumnType("time(6)"); - - b.Property("Saga") - .HasColumnType("tinyint(1)"); - - b.Property("SelectNextStep") - .HasColumnType("longtext"); - - b.Property("StepType") - .HasMaxLength(100) - .HasColumnType("varchar(100)"); - - b.Property("TenantId") - .HasColumnType("char(36)") - .HasColumnName("TenantId"); - - b.Property("WorkflowId") - .HasColumnType("char(36)"); - - b.HasKey("Id"); - - b.ToTable("WF_Compensate", (string)null); - }); - - modelBuilder.Entity("LINGYUN.Abp.WorkflowManagement.StepNode", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("CancelCondition") - .HasMaxLength(200) - .HasColumnType("varchar(200)"); - - b.Property("ErrorBehavior") - .HasColumnType("int"); - - b.Property("Inputs") - .HasColumnType("longtext"); - - b.Property("Name") - .HasMaxLength(100) - .HasColumnType("varchar(100)"); - - b.Property("Outputs") - .HasColumnType("longtext"); - - b.Property("ParentId") - .HasColumnType("char(36)"); - - b.Property("RetryInterval") - .HasColumnType("time(6)"); - - b.Property("Saga") - .HasColumnType("tinyint(1)"); - - b.Property("SelectNextStep") - .HasColumnType("longtext"); - - b.Property("StepType") - .HasMaxLength(100) - .HasColumnType("varchar(100)"); - - b.Property("TenantId") - .HasColumnType("char(36)") - .HasColumnName("TenantId"); - - b.Property("WorkflowId") - .HasColumnType("char(36)"); - - b.HasKey("Id"); - - b.ToTable("WF_Step", (string)null); - }); - - modelBuilder.Entity("LINGYUN.Abp.WorkflowManagement.Workflow", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnName("ConcurrencyStamp"); - - b.Property("CreationTime") - .HasColumnType("datetime(6)") - .HasColumnName("CreationTime"); - - b.Property("CreatorId") - .HasColumnType("char(36)") - .HasColumnName("CreatorId"); - - b.Property("Description") - .HasMaxLength(200) - .HasColumnType("varchar(200)"); - - b.Property("DisplayName") - .HasMaxLength(200) - .HasColumnType("varchar(200)"); - - b.Property("ErrorBehavior") - .HasColumnType("int"); - - b.Property("ErrorRetryInterval") - .HasColumnType("time(6)"); - - b.Property("ExtraProperties") - .HasColumnType("longtext") - .HasColumnName("ExtraProperties"); - - b.Property("IsEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("LastModificationTime") - .HasColumnType("datetime(6)") - .HasColumnName("LastModificationTime"); - - b.Property("LastModifierId") - .HasColumnType("char(36)") - .HasColumnName("LastModifierId"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("varchar(100)"); - - b.Property("TenantId") - .HasColumnType("char(36)") - .HasColumnName("TenantId"); - - b.Property("Version") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.ToTable("WF_Definition", (string)null); - }); - - modelBuilder.Entity("LINGYUN.Abp.WorkflowManagement.WorkflowData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("DataType") - .HasColumnType("int"); - - b.Property("DisplayName") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("varchar(100)"); - - b.Property("IsCaseSensitive") - .HasColumnType("tinyint(1)"); - - b.Property("IsRequired") - .HasColumnType("tinyint(1)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("varchar(100)"); - - b.Property("TenantId") - .HasColumnType("char(36)") - .HasColumnName("TenantId"); - - b.Property("WorkflowId") - .HasColumnType("char(36)"); - - b.HasKey("Id"); - - b.HasIndex("WorkflowId"); - - b.ToTable("WF_DefinitionData", (string)null); - }); - - modelBuilder.Entity("LINGYUN.Abp.WorkflowCore.Persistence.PersistedExecutionPointer", b => - { - b.HasOne("LINGYUN.Abp.WorkflowCore.Persistence.PersistedWorkflow", "Workflow") - .WithMany("ExecutionPointers") - .HasForeignKey("WorkflowId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Workflow"); - }); - - modelBuilder.Entity("LINGYUN.Abp.WorkflowCore.Persistence.PersistedExtensionAttribute", b => - { - b.HasOne("LINGYUN.Abp.WorkflowCore.Persistence.PersistedExecutionPointer", "ExecutionPointer") - .WithMany("ExtensionAttributes") - .HasForeignKey("ExecutionPointerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ExecutionPointer"); - }); - - modelBuilder.Entity("LINGYUN.Abp.WorkflowManagement.WorkflowData", b => - { - b.HasOne("LINGYUN.Abp.WorkflowManagement.Workflow", null) - .WithMany("Datas") - .HasForeignKey("WorkflowId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("LINGYUN.Abp.WorkflowCore.Persistence.PersistedExecutionPointer", b => - { - b.Navigation("ExtensionAttributes"); - }); - - modelBuilder.Entity("LINGYUN.Abp.WorkflowCore.Persistence.PersistedWorkflow", b => - { - b.Navigation("ExecutionPointers"); - }); - - modelBuilder.Entity("LINGYUN.Abp.WorkflowManagement.Workflow", b => - { - b.Navigation("Datas"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/aspnet-core/services/LY.MicroService.WorkflowManagement.HttpApi.Host/Migrations/20211214085456_Add-Entity-Workflow-Data-With-WF-Management.cs b/aspnet-core/services/LY.MicroService.WorkflowManagement.HttpApi.Host/Migrations/20211214085456_Add-Entity-Workflow-Data-With-WF-Management.cs deleted file mode 100644 index 07ee32061..000000000 --- a/aspnet-core/services/LY.MicroService.WorkflowManagement.HttpApi.Host/Migrations/20211214085456_Add-Entity-Workflow-Data-With-WF-Management.cs +++ /dev/null @@ -1,147 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace LY.MicroService.WorkflowManagement.Migrations -{ - public partial class AddEntityWorkflowDataWithWFManagement : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AlterColumn( - name: "ExecutionPointerId", - table: "WF_Subscription", - type: "char(50)", - maxLength: 50, - nullable: false, - collation: "ascii_general_ci", - oldClrType: typeof(string), - oldType: "char(50)", - oldMaxLength: 50) - .OldAnnotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.AlterColumn( - name: "ExecutionPointerId", - table: "WF_ExtensionAttribute", - type: "char(50)", - maxLength: 50, - nullable: false, - collation: "ascii_general_ci", - oldClrType: typeof(string), - oldType: "char(50)", - oldMaxLength: 50) - .OldAnnotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.AlterColumn( - name: "Id", - table: "WF_ExecutionPointer", - type: "char(50)", - maxLength: 50, - nullable: false, - collation: "ascii_general_ci", - oldClrType: typeof(string), - oldType: "char(50)", - oldMaxLength: 50) - .OldAnnotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.AlterColumn( - name: "ExecutionPointerId", - table: "WF_ExecutionError", - type: "char(50)", - maxLength: 50, - nullable: false, - collation: "ascii_general_ci", - oldClrType: typeof(string), - oldType: "char(50)", - oldMaxLength: 50) - .OldAnnotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateTable( - name: "WF_DefinitionData", - columns: table => new - { - Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - TenantId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), - WorkflowId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - Name = table.Column(type: "varchar(100)", maxLength: 100, nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - DisplayName = table.Column(type: "varchar(100)", maxLength: 100, nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - DataType = table.Column(type: "int", nullable: false), - IsRequired = table.Column(type: "tinyint(1)", nullable: false), - IsCaseSensitive = table.Column(type: "tinyint(1)", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_WF_DefinitionData", x => x.Id); - table.ForeignKey( - name: "FK_WF_DefinitionData_WF_Definition_WorkflowId", - column: x => x.WorkflowId, - principalTable: "WF_Definition", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateIndex( - name: "IX_WF_DefinitionData_WorkflowId", - table: "WF_DefinitionData", - column: "WorkflowId"); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "WF_DefinitionData"); - - migrationBuilder.AlterColumn( - name: "ExecutionPointerId", - table: "WF_Subscription", - type: "char(50)", - maxLength: 50, - nullable: false, - oldClrType: typeof(Guid), - oldType: "char(50)", - oldMaxLength: 50) - .Annotation("MySql:CharSet", "utf8mb4") - .OldAnnotation("Relational:Collation", "ascii_general_ci"); - - migrationBuilder.AlterColumn( - name: "ExecutionPointerId", - table: "WF_ExtensionAttribute", - type: "char(50)", - maxLength: 50, - nullable: false, - oldClrType: typeof(Guid), - oldType: "char(50)", - oldMaxLength: 50) - .Annotation("MySql:CharSet", "utf8mb4") - .OldAnnotation("Relational:Collation", "ascii_general_ci"); - - migrationBuilder.AlterColumn( - name: "Id", - table: "WF_ExecutionPointer", - type: "char(50)", - maxLength: 50, - nullable: false, - oldClrType: typeof(Guid), - oldType: "char(50)", - oldMaxLength: 50) - .Annotation("MySql:CharSet", "utf8mb4") - .OldAnnotation("Relational:Collation", "ascii_general_ci"); - - migrationBuilder.AlterColumn( - name: "ExecutionPointerId", - table: "WF_ExecutionError", - type: "char(50)", - maxLength: 50, - nullable: false, - oldClrType: typeof(Guid), - oldType: "char(50)", - oldMaxLength: 50) - .Annotation("MySql:CharSet", "utf8mb4") - .OldAnnotation("Relational:Collation", "ascii_general_ci"); - } - } -} diff --git a/aspnet-core/services/LY.MicroService.WorkflowManagement.HttpApi.Host/Migrations/WorkflowManagementMigrationsDbContextModelSnapshot.cs b/aspnet-core/services/LY.MicroService.WorkflowManagement.HttpApi.Host/Migrations/WorkflowManagementMigrationsDbContextModelSnapshot.cs deleted file mode 100644 index f39be2376..000000000 --- a/aspnet-core/services/LY.MicroService.WorkflowManagement.HttpApi.Host/Migrations/WorkflowManagementMigrationsDbContextModelSnapshot.cs +++ /dev/null @@ -1,608 +0,0 @@ -// -using System; -using LY.MicroService.WorkflowManagement.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Volo.Abp.EntityFrameworkCore; - -#nullable disable - -namespace LY.MicroService.WorkflowManagement.Migrations -{ - [DbContext(typeof(WorkflowManagementMigrationsDbContext))] - partial class WorkflowManagementMigrationsDbContextModelSnapshot : ModelSnapshot - { - protected override void BuildModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.MySql) - .HasAnnotation("ProductVersion", "6.0.0") - .HasAnnotation("Relational:MaxIdentifierLength", 64); - - modelBuilder.Entity("LINGYUN.Abp.WorkflowCore.Persistence.PersistedEvent", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("CreationTime") - .HasColumnType("datetime(6)") - .HasColumnName("CreationTime"); - - b.Property("EventData") - .HasColumnType("longtext"); - - b.Property("EventKey") - .HasMaxLength(200) - .HasColumnType("varchar(200)"); - - b.Property("EventName") - .HasMaxLength(200) - .HasColumnType("varchar(200)"); - - b.Property("IsProcessed") - .HasColumnType("tinyint(1)"); - - b.Property("TenantId") - .HasColumnType("char(36)") - .HasColumnName("TenantId"); - - b.HasKey("Id"); - - b.HasIndex("CreationTime"); - - b.HasIndex("IsProcessed"); - - b.HasIndex("EventName", "EventKey"); - - b.ToTable("WF_Event", (string)null); - }); - - modelBuilder.Entity("LINGYUN.Abp.WorkflowCore.Persistence.PersistedExecutionError", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("ErrorTime") - .HasColumnType("datetime(6)"); - - b.Property("ExecutionPointerId") - .HasMaxLength(50) - .HasColumnType("char(50)"); - - b.Property("Message") - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("char(36)") - .HasColumnName("TenantId"); - - b.Property("WorkflowId") - .HasColumnType("char(36)"); - - b.HasKey("Id"); - - b.ToTable("WF_ExecutionError", (string)null); - }); - - modelBuilder.Entity("LINGYUN.Abp.WorkflowCore.Persistence.PersistedExecutionPointer", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasMaxLength(50) - .HasColumnType("char(50)"); - - b.Property("Active") - .HasColumnType("tinyint(1)"); - - b.Property("Children") - .HasColumnType("longtext"); - - b.Property("ContextItem") - .HasColumnType("longtext"); - - b.Property("EndTime") - .HasColumnType("datetime(6)"); - - b.Property("EventData") - .HasColumnType("longtext"); - - b.Property("EventKey") - .HasMaxLength(200) - .HasColumnType("varchar(200)"); - - b.Property("EventName") - .HasMaxLength(200) - .HasColumnType("varchar(200)"); - - b.Property("EventPublished") - .HasColumnType("tinyint(1)"); - - b.Property("Outcome") - .HasColumnType("longtext"); - - b.Property("PersistenceData") - .HasColumnType("longtext"); - - b.Property("PredecessorId") - .HasMaxLength(100) - .HasColumnType("varchar(100)"); - - b.Property("RetryCount") - .HasColumnType("int"); - - b.Property("Scope") - .HasColumnType("longtext"); - - b.Property("SleepUntil") - .HasColumnType("datetime(6)"); - - b.Property("StartTime") - .HasColumnType("datetime(6)"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("StepId") - .HasColumnType("int"); - - b.Property("StepName") - .HasMaxLength(100) - .HasColumnType("varchar(100)"); - - b.Property("TenantId") - .HasColumnType("char(36)") - .HasColumnName("TenantId"); - - b.Property("WorkflowId") - .HasColumnType("char(36)"); - - b.HasKey("Id"); - - b.HasIndex("WorkflowId"); - - b.ToTable("WF_ExecutionPointer", (string)null); - }); - - modelBuilder.Entity("LINGYUN.Abp.WorkflowCore.Persistence.PersistedExtensionAttribute", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - b.Property("ExecutionPointerId") - .HasMaxLength(50) - .HasColumnType("char(50)"); - - b.Property("Key") - .HasMaxLength(100) - .HasColumnType("varchar(100)"); - - b.Property("TenantId") - .HasColumnType("char(36)") - .HasColumnName("TenantId"); - - b.Property("Value") - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.HasIndex("ExecutionPointerId"); - - b.ToTable("WF_ExtensionAttribute", (string)null); - }); - - modelBuilder.Entity("LINGYUN.Abp.WorkflowCore.Persistence.PersistedScheduledCommand", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - b.Property("CommandName") - .HasMaxLength(200) - .HasColumnType("varchar(200)"); - - b.Property("Data") - .HasMaxLength(500) - .HasColumnType("varchar(500)"); - - b.Property("ExecuteTime") - .HasColumnType("bigint"); - - b.Property("TenantId") - .HasColumnType("char(36)") - .HasColumnName("TenantId"); - - b.HasKey("Id"); - - b.HasIndex("ExecuteTime"); - - b.HasIndex("CommandName", "Data") - .IsUnique(); - - b.ToTable("WF_ScheduledCommand", (string)null); - }); - - modelBuilder.Entity("LINGYUN.Abp.WorkflowCore.Persistence.PersistedSubscription", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("EventKey") - .HasMaxLength(200) - .HasColumnType("varchar(200)"); - - b.Property("EventName") - .HasMaxLength(200) - .HasColumnType("varchar(200)"); - - b.Property("ExecutionPointerId") - .HasMaxLength(50) - .HasColumnType("char(50)"); - - b.Property("ExternalToken") - .HasMaxLength(200) - .HasColumnType("varchar(200)"); - - b.Property("ExternalTokenExpiry") - .HasColumnType("datetime(6)"); - - b.Property("ExternalWorkerId") - .HasMaxLength(200) - .HasColumnType("varchar(200)"); - - b.Property("StepId") - .HasColumnType("int"); - - b.Property("SubscribeAsOf") - .HasColumnType("datetime(6)"); - - b.Property("SubscriptionData") - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("char(36)") - .HasColumnName("TenantId"); - - b.Property("WorkflowId") - .HasColumnType("char(36)"); - - b.HasKey("Id"); - - b.HasIndex("EventKey"); - - b.HasIndex("EventName"); - - b.ToTable("WF_Subscription", (string)null); - }); - - modelBuilder.Entity("LINGYUN.Abp.WorkflowCore.Persistence.PersistedWorkflow", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("CompleteTime") - .HasColumnType("datetime(6)"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnName("ConcurrencyStamp"); - - b.Property("CreationTime") - .HasColumnType("datetime(6)") - .HasColumnName("CreationTime"); - - b.Property("CreatorId") - .HasColumnType("char(36)") - .HasColumnName("CreatorId"); - - b.Property("Data") - .HasColumnType("longtext"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("varchar(500)"); - - b.Property("ExtraProperties") - .HasColumnType("longtext") - .HasColumnName("ExtraProperties"); - - b.Property("LastModificationTime") - .HasColumnType("datetime(6)") - .HasColumnName("LastModificationTime"); - - b.Property("LastModifierId") - .HasColumnType("char(36)") - .HasColumnName("LastModifierId"); - - b.Property("NextExecution") - .HasColumnType("bigint"); - - b.Property("Reference") - .HasMaxLength(200) - .HasColumnType("varchar(200)"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("TenantId") - .HasColumnType("char(36)") - .HasColumnName("TenantId"); - - b.Property("Version") - .HasColumnType("int"); - - b.Property("WorkflowDefinitionId") - .HasMaxLength(200) - .HasColumnType("varchar(200)"); - - b.HasKey("Id"); - - b.HasIndex("NextExecution"); - - b.ToTable("WF_Workflow", (string)null); - }); - - modelBuilder.Entity("LINGYUN.Abp.WorkflowManagement.CompensateNode", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("CancelCondition") - .HasMaxLength(200) - .HasColumnType("varchar(200)"); - - b.Property("ErrorBehavior") - .HasColumnType("int"); - - b.Property("Inputs") - .HasColumnType("longtext"); - - b.Property("Name") - .HasMaxLength(100) - .HasColumnType("varchar(100)"); - - b.Property("Outputs") - .HasColumnType("longtext"); - - b.Property("ParentId") - .HasColumnType("char(36)"); - - b.Property("RetryInterval") - .HasColumnType("time(6)"); - - b.Property("Saga") - .HasColumnType("tinyint(1)"); - - b.Property("SelectNextStep") - .HasColumnType("longtext"); - - b.Property("StepType") - .HasMaxLength(100) - .HasColumnType("varchar(100)"); - - b.Property("TenantId") - .HasColumnType("char(36)") - .HasColumnName("TenantId"); - - b.Property("WorkflowId") - .HasColumnType("char(36)"); - - b.HasKey("Id"); - - b.ToTable("WF_Compensate", (string)null); - }); - - modelBuilder.Entity("LINGYUN.Abp.WorkflowManagement.StepNode", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("CancelCondition") - .HasMaxLength(200) - .HasColumnType("varchar(200)"); - - b.Property("ErrorBehavior") - .HasColumnType("int"); - - b.Property("Inputs") - .HasColumnType("longtext"); - - b.Property("Name") - .HasMaxLength(100) - .HasColumnType("varchar(100)"); - - b.Property("Outputs") - .HasColumnType("longtext"); - - b.Property("ParentId") - .HasColumnType("char(36)"); - - b.Property("RetryInterval") - .HasColumnType("time(6)"); - - b.Property("Saga") - .HasColumnType("tinyint(1)"); - - b.Property("SelectNextStep") - .HasColumnType("longtext"); - - b.Property("StepType") - .HasMaxLength(100) - .HasColumnType("varchar(100)"); - - b.Property("TenantId") - .HasColumnType("char(36)") - .HasColumnName("TenantId"); - - b.Property("WorkflowId") - .HasColumnType("char(36)"); - - b.HasKey("Id"); - - b.ToTable("WF_Step", (string)null); - }); - - modelBuilder.Entity("LINGYUN.Abp.WorkflowManagement.Workflow", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnName("ConcurrencyStamp"); - - b.Property("CreationTime") - .HasColumnType("datetime(6)") - .HasColumnName("CreationTime"); - - b.Property("CreatorId") - .HasColumnType("char(36)") - .HasColumnName("CreatorId"); - - b.Property("Description") - .HasMaxLength(200) - .HasColumnType("varchar(200)"); - - b.Property("DisplayName") - .HasMaxLength(200) - .HasColumnType("varchar(200)"); - - b.Property("ErrorBehavior") - .HasColumnType("int"); - - b.Property("ErrorRetryInterval") - .HasColumnType("time(6)"); - - b.Property("ExtraProperties") - .HasColumnType("longtext") - .HasColumnName("ExtraProperties"); - - b.Property("IsEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("LastModificationTime") - .HasColumnType("datetime(6)") - .HasColumnName("LastModificationTime"); - - b.Property("LastModifierId") - .HasColumnType("char(36)") - .HasColumnName("LastModifierId"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("varchar(100)"); - - b.Property("TenantId") - .HasColumnType("char(36)") - .HasColumnName("TenantId"); - - b.Property("Version") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.ToTable("WF_Definition", (string)null); - }); - - modelBuilder.Entity("LINGYUN.Abp.WorkflowManagement.WorkflowData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("DataType") - .HasColumnType("int"); - - b.Property("DisplayName") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("varchar(100)"); - - b.Property("IsCaseSensitive") - .HasColumnType("tinyint(1)"); - - b.Property("IsRequired") - .HasColumnType("tinyint(1)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("varchar(100)"); - - b.Property("TenantId") - .HasColumnType("char(36)") - .HasColumnName("TenantId"); - - b.Property("WorkflowId") - .HasColumnType("char(36)"); - - b.HasKey("Id"); - - b.HasIndex("WorkflowId"); - - b.ToTable("WF_DefinitionData", (string)null); - }); - - modelBuilder.Entity("LINGYUN.Abp.WorkflowCore.Persistence.PersistedExecutionPointer", b => - { - b.HasOne("LINGYUN.Abp.WorkflowCore.Persistence.PersistedWorkflow", "Workflow") - .WithMany("ExecutionPointers") - .HasForeignKey("WorkflowId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Workflow"); - }); - - modelBuilder.Entity("LINGYUN.Abp.WorkflowCore.Persistence.PersistedExtensionAttribute", b => - { - b.HasOne("LINGYUN.Abp.WorkflowCore.Persistence.PersistedExecutionPointer", "ExecutionPointer") - .WithMany("ExtensionAttributes") - .HasForeignKey("ExecutionPointerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ExecutionPointer"); - }); - - modelBuilder.Entity("LINGYUN.Abp.WorkflowManagement.WorkflowData", b => - { - b.HasOne("LINGYUN.Abp.WorkflowManagement.Workflow", null) - .WithMany("Datas") - .HasForeignKey("WorkflowId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("LINGYUN.Abp.WorkflowCore.Persistence.PersistedExecutionPointer", b => - { - b.Navigation("ExtensionAttributes"); - }); - - modelBuilder.Entity("LINGYUN.Abp.WorkflowCore.Persistence.PersistedWorkflow", b => - { - b.Navigation("ExecutionPointers"); - }); - - modelBuilder.Entity("LINGYUN.Abp.WorkflowManagement.Workflow", b => - { - b.Navigation("Datas"); - }); -#pragma warning restore 612, 618 - } - } -}