24 changed files with 1254 additions and 2317 deletions
@ -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<TaskManagementDbMigrationService> 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<TaskManagementDbMigrationService>.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<string>(); |
||||
|
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<TaskManagementMigrationsDbContext>( |
||||
|
(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; |
||||
|
} |
||||
|
} |
||||
@ -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<TaskManagementMigrationsDbContext> |
||||
|
{ |
||||
|
public TaskManagementMigrationsDbContext(DbContextOptions<TaskManagementMigrationsDbContext> options) |
||||
|
: base(options) |
||||
|
{ |
||||
|
|
||||
|
} |
||||
|
|
||||
|
protected override void OnModelCreating(ModelBuilder modelBuilder) |
||||
|
{ |
||||
|
base.OnModelCreating(modelBuilder); |
||||
|
|
||||
|
modelBuilder.ConfigureTaskManagement(); |
||||
|
} |
||||
|
} |
||||
@ -1,21 +1,20 @@ |
|||||
using Microsoft.EntityFrameworkCore; |
using Microsoft.EntityFrameworkCore; |
||||
using Microsoft.EntityFrameworkCore.Design; |
using Microsoft.EntityFrameworkCore.Design; |
||||
using Microsoft.Extensions.Configuration; |
using Microsoft.Extensions.Configuration; |
||||
using System.IO; |
|
||||
|
|
||||
namespace LY.MicroService.WorkflowManagement.EntityFrameworkCore; |
namespace LY.MicroService.TaskManagement.DbMigrator.EntityFrameworkCore; |
||||
|
|
||||
public class WorkflowManagementMigrationsDbContextFactory : IDesignTimeDbContextFactory<WorkflowManagementMigrationsDbContext> |
public class TaskManagementMigrationsDbContextFactory : IDesignTimeDbContextFactory<TaskManagementMigrationsDbContext> |
||||
{ |
{ |
||||
public WorkflowManagementMigrationsDbContext CreateDbContext(string[] args) |
public TaskManagementMigrationsDbContext CreateDbContext(string[] args) |
||||
{ |
{ |
||||
var configuration = BuildConfiguration(); |
var configuration = BuildConfiguration(); |
||||
var connectionString = configuration.GetConnectionString("WorkflowManagement"); |
var connectionString = configuration.GetConnectionString("Default"); |
||||
|
|
||||
var builder = new DbContextOptionsBuilder<WorkflowManagementMigrationsDbContext>() |
var builder = new DbContextOptionsBuilder<TaskManagementMigrationsDbContext>() |
||||
.UseMySql(connectionString, ServerVersion.AutoDetect(connectionString)); |
.UseMySql(connectionString, ServerVersion.AutoDetect(connectionString)); |
||||
|
|
||||
return new WorkflowManagementMigrationsDbContext(builder.Options); |
return new TaskManagementMigrationsDbContext(builder!.Options); |
||||
} |
} |
||||
|
|
||||
private static IConfigurationRoot BuildConfiguration() |
private static IConfigurationRoot BuildConfiguration() |
||||
@ -0,0 +1,55 @@ |
|||||
|
<Project Sdk="Microsoft.NET.Sdk"> |
||||
|
|
||||
|
<PropertyGroup> |
||||
|
<OutputType>Exe</OutputType> |
||||
|
<TargetFramework>net7.0</TargetFramework> |
||||
|
<ImplicitUsings>enable</ImplicitUsings> |
||||
|
<Nullable>enable</Nullable> |
||||
|
</PropertyGroup> |
||||
|
|
||||
|
<ItemGroup> |
||||
|
<PackageReference Include="Serilog.Extensions.Logging" Version="$(SerilogExtensionsLoggingPackageVersion)" /> |
||||
|
<PackageReference Include="Serilog.Sinks.File" Version="$(SerilogSinksFilePackageVersion)" /> |
||||
|
<PackageReference Include="Serilog.Sinks.Console" Version="$(SerilogSinksConsolePackageVersion)" /> |
||||
|
<PackageReference Include="Microsoft.Extensions.Hosting" Version="$(MicrosoftPackageVersion)" /> |
||||
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="$(MicrosoftPackageVersion)"> |
||||
|
<PrivateAssets>all</PrivateAssets> |
||||
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> |
||||
|
</PackageReference> |
||||
|
<PackageReference Include="Volo.Abp.Autofac" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageReference Include="Volo.Abp.EntityFrameworkCore.MySql" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageReference Include="Volo.Abp.FeatureManagement.EntityFrameworkCore" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageReference Include="Volo.Abp.SettingManagement.EntityFrameworkCore" Version="$(VoloAbpPackageVersion)" /> |
||||
|
<PackageReference Include="Volo.Abp.PermissionManagement.EntityFrameworkCore" Version="$(VoloAbpPackageVersion)" /> |
||||
|
</ItemGroup> |
||||
|
|
||||
|
<ItemGroup> |
||||
|
<Compile Remove="Logs\**" /> |
||||
|
<Content Remove="Logs\**" /> |
||||
|
<EmbeddedResource Remove="Logs\**" /> |
||||
|
<None Remove="Logs\**" /> |
||||
|
</ItemGroup> |
||||
|
|
||||
|
<ItemGroup> |
||||
|
<None Remove="appsettings.json" /> |
||||
|
</ItemGroup> |
||||
|
|
||||
|
<ItemGroup> |
||||
|
<Content Include="appsettings.json"> |
||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> |
||||
|
<ExcludeFromSingleFile>true</ExcludeFromSingleFile> |
||||
|
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory> |
||||
|
</Content> |
||||
|
</ItemGroup> |
||||
|
|
||||
|
<ItemGroup> |
||||
|
<ProjectReference Include="..\..\modules\common\LINGYUN.Abp.Data.DbMigrator\LINGYUN.Abp.Data.DbMigrator.csproj" /> |
||||
|
<ProjectReference Include="..\..\modules\saas\LINGYUN.Abp.Saas.EntityFrameworkCore\LINGYUN.Abp.Saas.EntityFrameworkCore.csproj" /> |
||||
|
<ProjectReference Include="..\..\modules\task-management\LINGYUN.Abp.TaskManagement.EntityFrameworkCore\LINGYUN.Abp.TaskManagement.EntityFrameworkCore.csproj" /> |
||||
|
</ItemGroup> |
||||
|
|
||||
|
<ItemGroup> |
||||
|
<Folder Include="Migrations\" /> |
||||
|
</ItemGroup> |
||||
|
|
||||
|
</Project> |
||||
@ -0,0 +1,273 @@ |
|||||
|
// <auto-generated />
|
||||
|
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 |
||||
|
{ |
||||
|
/// <inheritdoc />
|
||||
|
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<Guid>("Id") |
||||
|
.ValueGeneratedOnAdd() |
||||
|
.HasColumnType("char(36)"); |
||||
|
|
||||
|
b.Property<string>("ConcurrencyStamp") |
||||
|
.IsConcurrencyToken() |
||||
|
.HasMaxLength(40) |
||||
|
.HasColumnType("varchar(40)") |
||||
|
.HasColumnName("ConcurrencyStamp"); |
||||
|
|
||||
|
b.Property<DateTime>("CreationTime") |
||||
|
.HasColumnType("datetime(6)") |
||||
|
.HasColumnName("CreationTime"); |
||||
|
|
||||
|
b.Property<Guid?>("CreatorId") |
||||
|
.HasColumnType("char(36)") |
||||
|
.HasColumnName("CreatorId"); |
||||
|
|
||||
|
b.Property<string>("ExtraProperties") |
||||
|
.HasColumnType("longtext") |
||||
|
.HasColumnName("ExtraProperties"); |
||||
|
|
||||
|
b.Property<bool>("IsEnabled") |
||||
|
.HasColumnType("tinyint(1)"); |
||||
|
|
||||
|
b.Property<string>("JobId") |
||||
|
.IsRequired() |
||||
|
.HasMaxLength(255) |
||||
|
.HasColumnType("varchar(255)") |
||||
|
.HasColumnName("JobId"); |
||||
|
|
||||
|
b.Property<DateTime?>("LastModificationTime") |
||||
|
.HasColumnType("datetime(6)") |
||||
|
.HasColumnName("LastModificationTime"); |
||||
|
|
||||
|
b.Property<Guid?>("LastModifierId") |
||||
|
.HasColumnType("char(36)") |
||||
|
.HasColumnName("LastModifierId"); |
||||
|
|
||||
|
b.Property<string>("Name") |
||||
|
.IsRequired() |
||||
|
.HasMaxLength(100) |
||||
|
.HasColumnType("varchar(100)") |
||||
|
.HasColumnName("Name"); |
||||
|
|
||||
|
b.Property<string>("Paramters") |
||||
|
.HasColumnType("longtext") |
||||
|
.HasColumnName("Paramters"); |
||||
|
|
||||
|
b.Property<Guid?>("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<string>("Id") |
||||
|
.HasColumnType("varchar(255)"); |
||||
|
|
||||
|
b.Property<string>("Args") |
||||
|
.HasColumnType("longtext") |
||||
|
.HasColumnName("Args"); |
||||
|
|
||||
|
b.Property<DateTime>("BeginTime") |
||||
|
.HasColumnType("datetime(6)"); |
||||
|
|
||||
|
b.Property<string>("ConcurrencyStamp") |
||||
|
.IsConcurrencyToken() |
||||
|
.HasMaxLength(40) |
||||
|
.HasColumnType("varchar(40)") |
||||
|
.HasColumnName("ConcurrencyStamp"); |
||||
|
|
||||
|
b.Property<DateTime>("CreationTime") |
||||
|
.HasColumnType("datetime(6)") |
||||
|
.HasColumnName("CreationTime"); |
||||
|
|
||||
|
b.Property<Guid?>("CreatorId") |
||||
|
.HasColumnType("char(36)") |
||||
|
.HasColumnName("CreatorId"); |
||||
|
|
||||
|
b.Property<string>("Cron") |
||||
|
.HasMaxLength(50) |
||||
|
.HasColumnType("varchar(50)") |
||||
|
.HasColumnName("Cron"); |
||||
|
|
||||
|
b.Property<string>("Description") |
||||
|
.HasMaxLength(255) |
||||
|
.HasColumnType("varchar(255)") |
||||
|
.HasColumnName("Description"); |
||||
|
|
||||
|
b.Property<DateTime?>("EndTime") |
||||
|
.HasColumnType("datetime(6)"); |
||||
|
|
||||
|
b.Property<string>("ExtraProperties") |
||||
|
.HasColumnType("longtext") |
||||
|
.HasColumnName("ExtraProperties"); |
||||
|
|
||||
|
b.Property<string>("Group") |
||||
|
.IsRequired() |
||||
|
.HasMaxLength(50) |
||||
|
.HasColumnType("varchar(50)") |
||||
|
.HasColumnName("Group"); |
||||
|
|
||||
|
b.Property<int>("Interval") |
||||
|
.HasColumnType("int"); |
||||
|
|
||||
|
b.Property<bool>("IsAbandoned") |
||||
|
.HasColumnType("tinyint(1)"); |
||||
|
|
||||
|
b.Property<bool>("IsEnabled") |
||||
|
.HasColumnType("tinyint(1)"); |
||||
|
|
||||
|
b.Property<int>("JobType") |
||||
|
.HasColumnType("int"); |
||||
|
|
||||
|
b.Property<DateTime?>("LastModificationTime") |
||||
|
.HasColumnType("datetime(6)") |
||||
|
.HasColumnName("LastModificationTime"); |
||||
|
|
||||
|
b.Property<Guid?>("LastModifierId") |
||||
|
.HasColumnType("char(36)") |
||||
|
.HasColumnName("LastModifierId"); |
||||
|
|
||||
|
b.Property<DateTime?>("LastRunTime") |
||||
|
.HasColumnType("datetime(6)"); |
||||
|
|
||||
|
b.Property<int>("LockTimeOut") |
||||
|
.HasColumnType("int"); |
||||
|
|
||||
|
b.Property<int>("MaxCount") |
||||
|
.HasColumnType("int"); |
||||
|
|
||||
|
b.Property<int>("MaxTryCount") |
||||
|
.HasColumnType("int"); |
||||
|
|
||||
|
b.Property<string>("Name") |
||||
|
.IsRequired() |
||||
|
.HasMaxLength(100) |
||||
|
.HasColumnType("varchar(100)") |
||||
|
.HasColumnName("Name"); |
||||
|
|
||||
|
b.Property<DateTime?>("NextRunTime") |
||||
|
.HasColumnType("datetime(6)"); |
||||
|
|
||||
|
b.Property<string>("NodeName") |
||||
|
.HasMaxLength(128) |
||||
|
.HasColumnType("varchar(128)") |
||||
|
.HasColumnName("NodeName"); |
||||
|
|
||||
|
b.Property<int>("Priority") |
||||
|
.HasColumnType("int"); |
||||
|
|
||||
|
b.Property<string>("Result") |
||||
|
.HasMaxLength(1000) |
||||
|
.HasColumnType("varchar(1000)") |
||||
|
.HasColumnName("Result"); |
||||
|
|
||||
|
b.Property<int>("Source") |
||||
|
.HasColumnType("int"); |
||||
|
|
||||
|
b.Property<int>("Status") |
||||
|
.HasColumnType("int"); |
||||
|
|
||||
|
b.Property<Guid?>("TenantId") |
||||
|
.HasColumnType("char(36)") |
||||
|
.HasColumnName("TenantId"); |
||||
|
|
||||
|
b.Property<int>("TriggerCount") |
||||
|
.HasColumnType("int"); |
||||
|
|
||||
|
b.Property<int>("TryCount") |
||||
|
.HasColumnType("int"); |
||||
|
|
||||
|
b.Property<string>("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<long>("Id") |
||||
|
.ValueGeneratedOnAdd() |
||||
|
.HasColumnType("bigint"); |
||||
|
|
||||
|
b.Property<string>("Exception") |
||||
|
.HasMaxLength(2000) |
||||
|
.HasColumnType("varchar(2000)") |
||||
|
.HasColumnName("Exception"); |
||||
|
|
||||
|
b.Property<string>("JobGroup") |
||||
|
.HasMaxLength(50) |
||||
|
.HasColumnType("varchar(50)") |
||||
|
.HasColumnName("JobGroup"); |
||||
|
|
||||
|
b.Property<string>("JobId") |
||||
|
.HasMaxLength(255) |
||||
|
.HasColumnType("varchar(255)") |
||||
|
.HasColumnName("JobId"); |
||||
|
|
||||
|
b.Property<string>("JobName") |
||||
|
.HasMaxLength(100) |
||||
|
.HasColumnType("varchar(100)") |
||||
|
.HasColumnName("JobName"); |
||||
|
|
||||
|
b.Property<string>("JobType") |
||||
|
.HasMaxLength(1000) |
||||
|
.HasColumnType("varchar(1000)") |
||||
|
.HasColumnName("JobType"); |
||||
|
|
||||
|
b.Property<string>("Message") |
||||
|
.HasMaxLength(1000) |
||||
|
.HasColumnType("varchar(1000)") |
||||
|
.HasColumnName("Message"); |
||||
|
|
||||
|
b.Property<DateTime>("RunTime") |
||||
|
.HasColumnType("datetime(6)"); |
||||
|
|
||||
|
b.Property<Guid?>("TenantId") |
||||
|
.HasColumnType("char(36)") |
||||
|
.HasColumnName("TenantId"); |
||||
|
|
||||
|
b.HasKey("Id"); |
||||
|
|
||||
|
b.HasIndex("JobGroup", "JobName"); |
||||
|
|
||||
|
b.ToTable("TK_BackgroundJobLogs", (string)null); |
||||
|
}); |
||||
|
#pragma warning restore 612, 618
|
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,156 @@ |
|||||
|
using System; |
||||
|
using Microsoft.EntityFrameworkCore.Metadata; |
||||
|
using Microsoft.EntityFrameworkCore.Migrations; |
||||
|
|
||||
|
#nullable disable |
||||
|
|
||||
|
namespace LY.MicroService.TaskManagement.DbMigrator.Migrations |
||||
|
{ |
||||
|
/// <inheritdoc />
|
||||
|
public partial class InitialTaskManagement : Migration |
||||
|
{ |
||||
|
/// <inheritdoc />
|
||||
|
protected override void Up(MigrationBuilder migrationBuilder) |
||||
|
{ |
||||
|
migrationBuilder.AlterDatabase() |
||||
|
.Annotation("MySql:CharSet", "utf8mb4"); |
||||
|
|
||||
|
migrationBuilder.CreateTable( |
||||
|
name: "TK_BackgroundJobActions", |
||||
|
columns: table => new |
||||
|
{ |
||||
|
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"), |
||||
|
TenantId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"), |
||||
|
JobId = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: false) |
||||
|
.Annotation("MySql:CharSet", "utf8mb4"), |
||||
|
Name = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: false) |
||||
|
.Annotation("MySql:CharSet", "utf8mb4"), |
||||
|
IsEnabled = table.Column<bool>(type: "tinyint(1)", nullable: false), |
||||
|
Paramters = table.Column<string>(type: "longtext", nullable: true) |
||||
|
.Annotation("MySql:CharSet", "utf8mb4"), |
||||
|
ExtraProperties = table.Column<string>(type: "longtext", nullable: true) |
||||
|
.Annotation("MySql:CharSet", "utf8mb4"), |
||||
|
ConcurrencyStamp = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: true) |
||||
|
.Annotation("MySql:CharSet", "utf8mb4"), |
||||
|
CreationTime = table.Column<DateTime>(type: "datetime(6)", nullable: false), |
||||
|
CreatorId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"), |
||||
|
LastModificationTime = table.Column<DateTime>(type: "datetime(6)", nullable: true), |
||||
|
LastModifierId = table.Column<Guid>(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<long>(type: "bigint", nullable: false) |
||||
|
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), |
||||
|
TenantId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"), |
||||
|
JobId = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: true) |
||||
|
.Annotation("MySql:CharSet", "utf8mb4"), |
||||
|
JobName = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: true) |
||||
|
.Annotation("MySql:CharSet", "utf8mb4"), |
||||
|
JobGroup = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true) |
||||
|
.Annotation("MySql:CharSet", "utf8mb4"), |
||||
|
JobType = table.Column<string>(type: "varchar(1000)", maxLength: 1000, nullable: true) |
||||
|
.Annotation("MySql:CharSet", "utf8mb4"), |
||||
|
Message = table.Column<string>(type: "varchar(1000)", maxLength: 1000, nullable: true) |
||||
|
.Annotation("MySql:CharSet", "utf8mb4"), |
||||
|
RunTime = table.Column<DateTime>(type: "datetime(6)", nullable: false), |
||||
|
Exception = table.Column<string>(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<string>(type: "varchar(255)", nullable: false) |
||||
|
.Annotation("MySql:CharSet", "utf8mb4"), |
||||
|
TenantId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"), |
||||
|
Name = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: false) |
||||
|
.Annotation("MySql:CharSet", "utf8mb4"), |
||||
|
Group = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false) |
||||
|
.Annotation("MySql:CharSet", "utf8mb4"), |
||||
|
Type = table.Column<string>(type: "varchar(1000)", maxLength: 1000, nullable: false) |
||||
|
.Annotation("MySql:CharSet", "utf8mb4"), |
||||
|
Result = table.Column<string>(type: "varchar(1000)", maxLength: 1000, nullable: true) |
||||
|
.Annotation("MySql:CharSet", "utf8mb4"), |
||||
|
Args = table.Column<string>(type: "longtext", nullable: true) |
||||
|
.Annotation("MySql:CharSet", "utf8mb4"), |
||||
|
Status = table.Column<int>(type: "int", nullable: false), |
||||
|
IsEnabled = table.Column<bool>(type: "tinyint(1)", nullable: false), |
||||
|
Description = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: true) |
||||
|
.Annotation("MySql:CharSet", "utf8mb4"), |
||||
|
LockTimeOut = table.Column<int>(type: "int", nullable: false), |
||||
|
BeginTime = table.Column<DateTime>(type: "datetime(6)", nullable: false), |
||||
|
EndTime = table.Column<DateTime>(type: "datetime(6)", nullable: true), |
||||
|
LastRunTime = table.Column<DateTime>(type: "datetime(6)", nullable: true), |
||||
|
NextRunTime = table.Column<DateTime>(type: "datetime(6)", nullable: true), |
||||
|
JobType = table.Column<int>(type: "int", nullable: false), |
||||
|
Cron = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true) |
||||
|
.Annotation("MySql:CharSet", "utf8mb4"), |
||||
|
Source = table.Column<int>(type: "int", nullable: false), |
||||
|
Priority = table.Column<int>(type: "int", nullable: false), |
||||
|
TriggerCount = table.Column<int>(type: "int", nullable: false), |
||||
|
TryCount = table.Column<int>(type: "int", nullable: false), |
||||
|
MaxTryCount = table.Column<int>(type: "int", nullable: false), |
||||
|
MaxCount = table.Column<int>(type: "int", nullable: false), |
||||
|
Interval = table.Column<int>(type: "int", nullable: false), |
||||
|
IsAbandoned = table.Column<bool>(type: "tinyint(1)", nullable: false), |
||||
|
NodeName = table.Column<string>(type: "varchar(128)", maxLength: 128, nullable: true) |
||||
|
.Annotation("MySql:CharSet", "utf8mb4"), |
||||
|
ExtraProperties = table.Column<string>(type: "longtext", nullable: true) |
||||
|
.Annotation("MySql:CharSet", "utf8mb4"), |
||||
|
ConcurrencyStamp = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: true) |
||||
|
.Annotation("MySql:CharSet", "utf8mb4"), |
||||
|
CreationTime = table.Column<DateTime>(type: "datetime(6)", nullable: false), |
||||
|
CreatorId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"), |
||||
|
LastModificationTime = table.Column<DateTime>(type: "datetime(6)", nullable: true), |
||||
|
LastModifierId = table.Column<Guid>(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" }); |
||||
|
} |
||||
|
|
||||
|
/// <inheritdoc />
|
||||
|
protected override void Down(MigrationBuilder migrationBuilder) |
||||
|
{ |
||||
|
migrationBuilder.DropTable( |
||||
|
name: "TK_BackgroundJobActions"); |
||||
|
|
||||
|
migrationBuilder.DropTable( |
||||
|
name: "TK_BackgroundJobLogs"); |
||||
|
|
||||
|
migrationBuilder.DropTable( |
||||
|
name: "TK_BackgroundJobs"); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,270 @@ |
|||||
|
// <auto-generated />
|
||||
|
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<Guid>("Id") |
||||
|
.ValueGeneratedOnAdd() |
||||
|
.HasColumnType("char(36)"); |
||||
|
|
||||
|
b.Property<string>("ConcurrencyStamp") |
||||
|
.IsConcurrencyToken() |
||||
|
.HasMaxLength(40) |
||||
|
.HasColumnType("varchar(40)") |
||||
|
.HasColumnName("ConcurrencyStamp"); |
||||
|
|
||||
|
b.Property<DateTime>("CreationTime") |
||||
|
.HasColumnType("datetime(6)") |
||||
|
.HasColumnName("CreationTime"); |
||||
|
|
||||
|
b.Property<Guid?>("CreatorId") |
||||
|
.HasColumnType("char(36)") |
||||
|
.HasColumnName("CreatorId"); |
||||
|
|
||||
|
b.Property<string>("ExtraProperties") |
||||
|
.HasColumnType("longtext") |
||||
|
.HasColumnName("ExtraProperties"); |
||||
|
|
||||
|
b.Property<bool>("IsEnabled") |
||||
|
.HasColumnType("tinyint(1)"); |
||||
|
|
||||
|
b.Property<string>("JobId") |
||||
|
.IsRequired() |
||||
|
.HasMaxLength(255) |
||||
|
.HasColumnType("varchar(255)") |
||||
|
.HasColumnName("JobId"); |
||||
|
|
||||
|
b.Property<DateTime?>("LastModificationTime") |
||||
|
.HasColumnType("datetime(6)") |
||||
|
.HasColumnName("LastModificationTime"); |
||||
|
|
||||
|
b.Property<Guid?>("LastModifierId") |
||||
|
.HasColumnType("char(36)") |
||||
|
.HasColumnName("LastModifierId"); |
||||
|
|
||||
|
b.Property<string>("Name") |
||||
|
.IsRequired() |
||||
|
.HasMaxLength(100) |
||||
|
.HasColumnType("varchar(100)") |
||||
|
.HasColumnName("Name"); |
||||
|
|
||||
|
b.Property<string>("Paramters") |
||||
|
.HasColumnType("longtext") |
||||
|
.HasColumnName("Paramters"); |
||||
|
|
||||
|
b.Property<Guid?>("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<string>("Id") |
||||
|
.HasColumnType("varchar(255)"); |
||||
|
|
||||
|
b.Property<string>("Args") |
||||
|
.HasColumnType("longtext") |
||||
|
.HasColumnName("Args"); |
||||
|
|
||||
|
b.Property<DateTime>("BeginTime") |
||||
|
.HasColumnType("datetime(6)"); |
||||
|
|
||||
|
b.Property<string>("ConcurrencyStamp") |
||||
|
.IsConcurrencyToken() |
||||
|
.HasMaxLength(40) |
||||
|
.HasColumnType("varchar(40)") |
||||
|
.HasColumnName("ConcurrencyStamp"); |
||||
|
|
||||
|
b.Property<DateTime>("CreationTime") |
||||
|
.HasColumnType("datetime(6)") |
||||
|
.HasColumnName("CreationTime"); |
||||
|
|
||||
|
b.Property<Guid?>("CreatorId") |
||||
|
.HasColumnType("char(36)") |
||||
|
.HasColumnName("CreatorId"); |
||||
|
|
||||
|
b.Property<string>("Cron") |
||||
|
.HasMaxLength(50) |
||||
|
.HasColumnType("varchar(50)") |
||||
|
.HasColumnName("Cron"); |
||||
|
|
||||
|
b.Property<string>("Description") |
||||
|
.HasMaxLength(255) |
||||
|
.HasColumnType("varchar(255)") |
||||
|
.HasColumnName("Description"); |
||||
|
|
||||
|
b.Property<DateTime?>("EndTime") |
||||
|
.HasColumnType("datetime(6)"); |
||||
|
|
||||
|
b.Property<string>("ExtraProperties") |
||||
|
.HasColumnType("longtext") |
||||
|
.HasColumnName("ExtraProperties"); |
||||
|
|
||||
|
b.Property<string>("Group") |
||||
|
.IsRequired() |
||||
|
.HasMaxLength(50) |
||||
|
.HasColumnType("varchar(50)") |
||||
|
.HasColumnName("Group"); |
||||
|
|
||||
|
b.Property<int>("Interval") |
||||
|
.HasColumnType("int"); |
||||
|
|
||||
|
b.Property<bool>("IsAbandoned") |
||||
|
.HasColumnType("tinyint(1)"); |
||||
|
|
||||
|
b.Property<bool>("IsEnabled") |
||||
|
.HasColumnType("tinyint(1)"); |
||||
|
|
||||
|
b.Property<int>("JobType") |
||||
|
.HasColumnType("int"); |
||||
|
|
||||
|
b.Property<DateTime?>("LastModificationTime") |
||||
|
.HasColumnType("datetime(6)") |
||||
|
.HasColumnName("LastModificationTime"); |
||||
|
|
||||
|
b.Property<Guid?>("LastModifierId") |
||||
|
.HasColumnType("char(36)") |
||||
|
.HasColumnName("LastModifierId"); |
||||
|
|
||||
|
b.Property<DateTime?>("LastRunTime") |
||||
|
.HasColumnType("datetime(6)"); |
||||
|
|
||||
|
b.Property<int>("LockTimeOut") |
||||
|
.HasColumnType("int"); |
||||
|
|
||||
|
b.Property<int>("MaxCount") |
||||
|
.HasColumnType("int"); |
||||
|
|
||||
|
b.Property<int>("MaxTryCount") |
||||
|
.HasColumnType("int"); |
||||
|
|
||||
|
b.Property<string>("Name") |
||||
|
.IsRequired() |
||||
|
.HasMaxLength(100) |
||||
|
.HasColumnType("varchar(100)") |
||||
|
.HasColumnName("Name"); |
||||
|
|
||||
|
b.Property<DateTime?>("NextRunTime") |
||||
|
.HasColumnType("datetime(6)"); |
||||
|
|
||||
|
b.Property<string>("NodeName") |
||||
|
.HasMaxLength(128) |
||||
|
.HasColumnType("varchar(128)") |
||||
|
.HasColumnName("NodeName"); |
||||
|
|
||||
|
b.Property<int>("Priority") |
||||
|
.HasColumnType("int"); |
||||
|
|
||||
|
b.Property<string>("Result") |
||||
|
.HasMaxLength(1000) |
||||
|
.HasColumnType("varchar(1000)") |
||||
|
.HasColumnName("Result"); |
||||
|
|
||||
|
b.Property<int>("Source") |
||||
|
.HasColumnType("int"); |
||||
|
|
||||
|
b.Property<int>("Status") |
||||
|
.HasColumnType("int"); |
||||
|
|
||||
|
b.Property<Guid?>("TenantId") |
||||
|
.HasColumnType("char(36)") |
||||
|
.HasColumnName("TenantId"); |
||||
|
|
||||
|
b.Property<int>("TriggerCount") |
||||
|
.HasColumnType("int"); |
||||
|
|
||||
|
b.Property<int>("TryCount") |
||||
|
.HasColumnType("int"); |
||||
|
|
||||
|
b.Property<string>("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<long>("Id") |
||||
|
.ValueGeneratedOnAdd() |
||||
|
.HasColumnType("bigint"); |
||||
|
|
||||
|
b.Property<string>("Exception") |
||||
|
.HasMaxLength(2000) |
||||
|
.HasColumnType("varchar(2000)") |
||||
|
.HasColumnName("Exception"); |
||||
|
|
||||
|
b.Property<string>("JobGroup") |
||||
|
.HasMaxLength(50) |
||||
|
.HasColumnType("varchar(50)") |
||||
|
.HasColumnName("JobGroup"); |
||||
|
|
||||
|
b.Property<string>("JobId") |
||||
|
.HasMaxLength(255) |
||||
|
.HasColumnType("varchar(255)") |
||||
|
.HasColumnName("JobId"); |
||||
|
|
||||
|
b.Property<string>("JobName") |
||||
|
.HasMaxLength(100) |
||||
|
.HasColumnType("varchar(100)") |
||||
|
.HasColumnName("JobName"); |
||||
|
|
||||
|
b.Property<string>("JobType") |
||||
|
.HasMaxLength(1000) |
||||
|
.HasColumnType("varchar(1000)") |
||||
|
.HasColumnName("JobType"); |
||||
|
|
||||
|
b.Property<string>("Message") |
||||
|
.HasMaxLength(1000) |
||||
|
.HasColumnType("varchar(1000)") |
||||
|
.HasColumnName("Message"); |
||||
|
|
||||
|
b.Property<DateTime>("RunTime") |
||||
|
.HasColumnType("datetime(6)"); |
||||
|
|
||||
|
b.Property<Guid?>("TenantId") |
||||
|
.HasColumnType("char(36)") |
||||
|
.HasColumnName("TenantId"); |
||||
|
|
||||
|
b.HasKey("Id"); |
||||
|
|
||||
|
b.HasIndex("JobGroup", "JobName"); |
||||
|
|
||||
|
b.ToTable("TK_BackgroundJobLogs", (string)null); |
||||
|
}); |
||||
|
#pragma warning restore 612, 618
|
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -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<TaskManagementDbMigratorHostedService>(); |
||||
|
}); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,11 @@ |
|||||
|
{ |
||||
|
"profiles": { |
||||
|
"LY.MicroService.TaskManagement.DbMigrator": { |
||||
|
"commandName": "Project", |
||||
|
"dotnetRunMessages": true, |
||||
|
"environmentVariables": { |
||||
|
"ASPNETCORE_ENVIRONMENT": "Development" |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -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<TaskManagementDbMigratorModule>(options => |
||||
|
{ |
||||
|
options.Services.ReplaceConfiguration(_configuration); |
||||
|
options.UseAutofac(); |
||||
|
options.Services.AddLogging(c => c.AddSerilog()); |
||||
|
options.AddDataMigrationEnvironment(); |
||||
|
}); |
||||
|
await application.InitializeAsync(); |
||||
|
|
||||
|
await application |
||||
|
.ServiceProvider |
||||
|
.GetRequiredService<TaskManagementDbMigrationService>() |
||||
|
.MigrateAsync(); |
||||
|
|
||||
|
await application.ShutdownAsync(); |
||||
|
|
||||
|
_hostApplicationLifetime.StopApplication(); |
||||
|
} |
||||
|
|
||||
|
public Task StopAsync(CancellationToken cancellationToken) |
||||
|
{ |
||||
|
return Task.CompletedTask; |
||||
|
} |
||||
|
} |
||||
|
|
||||
@ -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<TaskManagementMigrationsDbContext>(); |
||||
|
|
||||
|
// 配置Ef
|
||||
|
Configure<AbpDbContextOptions>(options => |
||||
|
{ |
||||
|
options.UseMySQL(); |
||||
|
}); |
||||
|
} |
||||
|
} |
||||
@ -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); |
||||
|
} |
||||
|
} |
||||
@ -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; |
||||
@ -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}" |
||||
|
} |
||||
|
} |
||||
|
] |
||||
|
} |
||||
|
} |
||||
@ -1,557 +0,0 @@ |
|||||
// <auto-generated />
|
|
||||
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<Guid>("Id") |
|
||||
.ValueGeneratedOnAdd() |
|
||||
.HasColumnType("char(36)"); |
|
||||
|
|
||||
b.Property<DateTime>("CreationTime") |
|
||||
.HasColumnType("datetime(6)") |
|
||||
.HasColumnName("CreationTime"); |
|
||||
|
|
||||
b.Property<string>("EventData") |
|
||||
.HasColumnType("longtext"); |
|
||||
|
|
||||
b.Property<string>("EventKey") |
|
||||
.HasMaxLength(200) |
|
||||
.HasColumnType("varchar(200)"); |
|
||||
|
|
||||
b.Property<string>("EventName") |
|
||||
.HasMaxLength(200) |
|
||||
.HasColumnType("varchar(200)"); |
|
||||
|
|
||||
b.Property<bool>("IsProcessed") |
|
||||
.HasColumnType("tinyint(1)"); |
|
||||
|
|
||||
b.Property<Guid?>("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<int>("Id") |
|
||||
.ValueGeneratedOnAdd() |
|
||||
.HasColumnType("int"); |
|
||||
|
|
||||
b.Property<DateTime>("ErrorTime") |
|
||||
.HasColumnType("datetime(6)"); |
|
||||
|
|
||||
b.Property<Guid>("ExecutionPointerId") |
|
||||
.HasMaxLength(50) |
|
||||
.HasColumnType("char(50)"); |
|
||||
|
|
||||
b.Property<string>("Message") |
|
||||
.HasColumnType("longtext"); |
|
||||
|
|
||||
b.Property<Guid?>("TenantId") |
|
||||
.HasColumnType("char(36)") |
|
||||
.HasColumnName("TenantId"); |
|
||||
|
|
||||
b.Property<Guid>("WorkflowId") |
|
||||
.HasColumnType("char(36)"); |
|
||||
|
|
||||
b.HasKey("Id"); |
|
||||
|
|
||||
b.ToTable("WF_ExecutionError", (string)null); |
|
||||
}); |
|
||||
|
|
||||
modelBuilder.Entity("LINGYUN.Abp.WorkflowCore.Persistence.PersistedExecutionPointer", b => |
|
||||
{ |
|
||||
b.Property<Guid>("Id") |
|
||||
.ValueGeneratedOnAdd() |
|
||||
.HasMaxLength(50) |
|
||||
.HasColumnType("char(50)"); |
|
||||
|
|
||||
b.Property<bool>("Active") |
|
||||
.HasColumnType("tinyint(1)"); |
|
||||
|
|
||||
b.Property<string>("Children") |
|
||||
.HasColumnType("longtext"); |
|
||||
|
|
||||
b.Property<string>("ContextItem") |
|
||||
.HasColumnType("longtext"); |
|
||||
|
|
||||
b.Property<DateTime?>("EndTime") |
|
||||
.HasColumnType("datetime(6)"); |
|
||||
|
|
||||
b.Property<string>("EventData") |
|
||||
.HasColumnType("longtext"); |
|
||||
|
|
||||
b.Property<string>("EventKey") |
|
||||
.HasMaxLength(200) |
|
||||
.HasColumnType("varchar(200)"); |
|
||||
|
|
||||
b.Property<string>("EventName") |
|
||||
.HasMaxLength(200) |
|
||||
.HasColumnType("varchar(200)"); |
|
||||
|
|
||||
b.Property<bool>("EventPublished") |
|
||||
.HasColumnType("tinyint(1)"); |
|
||||
|
|
||||
b.Property<string>("Outcome") |
|
||||
.HasColumnType("longtext"); |
|
||||
|
|
||||
b.Property<string>("PersistenceData") |
|
||||
.HasColumnType("longtext"); |
|
||||
|
|
||||
b.Property<string>("PredecessorId") |
|
||||
.HasMaxLength(100) |
|
||||
.HasColumnType("varchar(100)"); |
|
||||
|
|
||||
b.Property<int>("RetryCount") |
|
||||
.HasColumnType("int"); |
|
||||
|
|
||||
b.Property<string>("Scope") |
|
||||
.HasColumnType("longtext"); |
|
||||
|
|
||||
b.Property<DateTime?>("SleepUntil") |
|
||||
.HasColumnType("datetime(6)"); |
|
||||
|
|
||||
b.Property<DateTime?>("StartTime") |
|
||||
.HasColumnType("datetime(6)"); |
|
||||
|
|
||||
b.Property<int>("Status") |
|
||||
.HasColumnType("int"); |
|
||||
|
|
||||
b.Property<int>("StepId") |
|
||||
.HasColumnType("int"); |
|
||||
|
|
||||
b.Property<string>("StepName") |
|
||||
.HasMaxLength(100) |
|
||||
.HasColumnType("varchar(100)"); |
|
||||
|
|
||||
b.Property<Guid?>("TenantId") |
|
||||
.HasColumnType("char(36)") |
|
||||
.HasColumnName("TenantId"); |
|
||||
|
|
||||
b.Property<Guid>("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<long>("Id") |
|
||||
.ValueGeneratedOnAdd() |
|
||||
.HasColumnType("bigint"); |
|
||||
|
|
||||
b.Property<Guid>("ExecutionPointerId") |
|
||||
.HasMaxLength(50) |
|
||||
.HasColumnType("char(50)"); |
|
||||
|
|
||||
b.Property<string>("Key") |
|
||||
.HasMaxLength(100) |
|
||||
.HasColumnType("varchar(100)"); |
|
||||
|
|
||||
b.Property<Guid?>("TenantId") |
|
||||
.HasColumnType("char(36)") |
|
||||
.HasColumnName("TenantId"); |
|
||||
|
|
||||
b.Property<string>("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<long>("Id") |
|
||||
.ValueGeneratedOnAdd() |
|
||||
.HasColumnType("bigint"); |
|
||||
|
|
||||
b.Property<string>("CommandName") |
|
||||
.HasMaxLength(200) |
|
||||
.HasColumnType("varchar(200)"); |
|
||||
|
|
||||
b.Property<string>("Data") |
|
||||
.HasMaxLength(500) |
|
||||
.HasColumnType("varchar(500)"); |
|
||||
|
|
||||
b.Property<long>("ExecuteTime") |
|
||||
.HasColumnType("bigint"); |
|
||||
|
|
||||
b.Property<Guid?>("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<Guid>("Id") |
|
||||
.ValueGeneratedOnAdd() |
|
||||
.HasColumnType("char(36)"); |
|
||||
|
|
||||
b.Property<string>("EventKey") |
|
||||
.HasMaxLength(200) |
|
||||
.HasColumnType("varchar(200)"); |
|
||||
|
|
||||
b.Property<string>("EventName") |
|
||||
.HasMaxLength(200) |
|
||||
.HasColumnType("varchar(200)"); |
|
||||
|
|
||||
b.Property<Guid>("ExecutionPointerId") |
|
||||
.HasMaxLength(50) |
|
||||
.HasColumnType("char(50)"); |
|
||||
|
|
||||
b.Property<string>("ExternalToken") |
|
||||
.HasMaxLength(200) |
|
||||
.HasColumnType("varchar(200)"); |
|
||||
|
|
||||
b.Property<DateTime?>("ExternalTokenExpiry") |
|
||||
.HasColumnType("datetime(6)"); |
|
||||
|
|
||||
b.Property<string>("ExternalWorkerId") |
|
||||
.HasMaxLength(200) |
|
||||
.HasColumnType("varchar(200)"); |
|
||||
|
|
||||
b.Property<int>("StepId") |
|
||||
.HasColumnType("int"); |
|
||||
|
|
||||
b.Property<DateTime>("SubscribeAsOf") |
|
||||
.HasColumnType("datetime(6)"); |
|
||||
|
|
||||
b.Property<string>("SubscriptionData") |
|
||||
.HasColumnType("longtext"); |
|
||||
|
|
||||
b.Property<Guid?>("TenantId") |
|
||||
.HasColumnType("char(36)") |
|
||||
.HasColumnName("TenantId"); |
|
||||
|
|
||||
b.Property<Guid>("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<Guid>("Id") |
|
||||
.ValueGeneratedOnAdd() |
|
||||
.HasColumnType("char(36)"); |
|
||||
|
|
||||
b.Property<DateTime?>("CompleteTime") |
|
||||
.HasColumnType("datetime(6)"); |
|
||||
|
|
||||
b.Property<string>("ConcurrencyStamp") |
|
||||
.IsConcurrencyToken() |
|
||||
.HasMaxLength(40) |
|
||||
.HasColumnType("varchar(40)") |
|
||||
.HasColumnName("ConcurrencyStamp"); |
|
||||
|
|
||||
b.Property<DateTime>("CreationTime") |
|
||||
.HasColumnType("datetime(6)") |
|
||||
.HasColumnName("CreationTime"); |
|
||||
|
|
||||
b.Property<Guid?>("CreatorId") |
|
||||
.HasColumnType("char(36)") |
|
||||
.HasColumnName("CreatorId"); |
|
||||
|
|
||||
b.Property<string>("Data") |
|
||||
.HasColumnType("longtext"); |
|
||||
|
|
||||
b.Property<string>("Description") |
|
||||
.HasMaxLength(500) |
|
||||
.HasColumnType("varchar(500)"); |
|
||||
|
|
||||
b.Property<string>("ExtraProperties") |
|
||||
.HasColumnType("longtext") |
|
||||
.HasColumnName("ExtraProperties"); |
|
||||
|
|
||||
b.Property<DateTime?>("LastModificationTime") |
|
||||
.HasColumnType("datetime(6)") |
|
||||
.HasColumnName("LastModificationTime"); |
|
||||
|
|
||||
b.Property<Guid?>("LastModifierId") |
|
||||
.HasColumnType("char(36)") |
|
||||
.HasColumnName("LastModifierId"); |
|
||||
|
|
||||
b.Property<long?>("NextExecution") |
|
||||
.HasColumnType("bigint"); |
|
||||
|
|
||||
b.Property<string>("Reference") |
|
||||
.HasMaxLength(200) |
|
||||
.HasColumnType("varchar(200)"); |
|
||||
|
|
||||
b.Property<int>("Status") |
|
||||
.HasColumnType("int"); |
|
||||
|
|
||||
b.Property<Guid?>("TenantId") |
|
||||
.HasColumnType("char(36)") |
|
||||
.HasColumnName("TenantId"); |
|
||||
|
|
||||
b.Property<int>("Version") |
|
||||
.HasColumnType("int"); |
|
||||
|
|
||||
b.Property<string>("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<Guid>("Id") |
|
||||
.ValueGeneratedOnAdd() |
|
||||
.HasColumnType("char(36)"); |
|
||||
|
|
||||
b.Property<string>("CancelCondition") |
|
||||
.HasMaxLength(200) |
|
||||
.HasColumnType("varchar(200)"); |
|
||||
|
|
||||
b.Property<int?>("ErrorBehavior") |
|
||||
.HasColumnType("int"); |
|
||||
|
|
||||
b.Property<string>("Inputs") |
|
||||
.HasColumnType("longtext"); |
|
||||
|
|
||||
b.Property<string>("Name") |
|
||||
.HasMaxLength(100) |
|
||||
.HasColumnType("varchar(100)"); |
|
||||
|
|
||||
b.Property<string>("Outputs") |
|
||||
.HasColumnType("longtext"); |
|
||||
|
|
||||
b.Property<Guid?>("ParentId") |
|
||||
.HasColumnType("char(36)"); |
|
||||
|
|
||||
b.Property<TimeSpan?>("RetryInterval") |
|
||||
.HasColumnType("time(6)"); |
|
||||
|
|
||||
b.Property<bool>("Saga") |
|
||||
.HasColumnType("tinyint(1)"); |
|
||||
|
|
||||
b.Property<string>("SelectNextStep") |
|
||||
.HasColumnType("longtext"); |
|
||||
|
|
||||
b.Property<string>("StepType") |
|
||||
.HasMaxLength(100) |
|
||||
.HasColumnType("varchar(100)"); |
|
||||
|
|
||||
b.Property<Guid?>("TenantId") |
|
||||
.HasColumnType("char(36)") |
|
||||
.HasColumnName("TenantId"); |
|
||||
|
|
||||
b.Property<Guid>("WorkflowId") |
|
||||
.HasColumnType("char(36)"); |
|
||||
|
|
||||
b.HasKey("Id"); |
|
||||
|
|
||||
b.ToTable("WF_Compensate", (string)null); |
|
||||
}); |
|
||||
|
|
||||
modelBuilder.Entity("LINGYUN.Abp.WorkflowManagement.StepNode", b => |
|
||||
{ |
|
||||
b.Property<Guid>("Id") |
|
||||
.ValueGeneratedOnAdd() |
|
||||
.HasColumnType("char(36)"); |
|
||||
|
|
||||
b.Property<string>("CancelCondition") |
|
||||
.HasMaxLength(200) |
|
||||
.HasColumnType("varchar(200)"); |
|
||||
|
|
||||
b.Property<int?>("ErrorBehavior") |
|
||||
.HasColumnType("int"); |
|
||||
|
|
||||
b.Property<string>("Inputs") |
|
||||
.HasColumnType("longtext"); |
|
||||
|
|
||||
b.Property<string>("Name") |
|
||||
.HasMaxLength(100) |
|
||||
.HasColumnType("varchar(100)"); |
|
||||
|
|
||||
b.Property<string>("Outputs") |
|
||||
.HasColumnType("longtext"); |
|
||||
|
|
||||
b.Property<Guid?>("ParentId") |
|
||||
.HasColumnType("char(36)"); |
|
||||
|
|
||||
b.Property<TimeSpan?>("RetryInterval") |
|
||||
.HasColumnType("time(6)"); |
|
||||
|
|
||||
b.Property<bool>("Saga") |
|
||||
.HasColumnType("tinyint(1)"); |
|
||||
|
|
||||
b.Property<string>("SelectNextStep") |
|
||||
.HasColumnType("longtext"); |
|
||||
|
|
||||
b.Property<string>("StepType") |
|
||||
.HasMaxLength(100) |
|
||||
.HasColumnType("varchar(100)"); |
|
||||
|
|
||||
b.Property<Guid?>("TenantId") |
|
||||
.HasColumnType("char(36)") |
|
||||
.HasColumnName("TenantId"); |
|
||||
|
|
||||
b.Property<Guid>("WorkflowId") |
|
||||
.HasColumnType("char(36)"); |
|
||||
|
|
||||
b.HasKey("Id"); |
|
||||
|
|
||||
b.ToTable("WF_Step", (string)null); |
|
||||
}); |
|
||||
|
|
||||
modelBuilder.Entity("LINGYUN.Abp.WorkflowManagement.Workflow", b => |
|
||||
{ |
|
||||
b.Property<Guid>("Id") |
|
||||
.ValueGeneratedOnAdd() |
|
||||
.HasColumnType("char(36)"); |
|
||||
|
|
||||
b.Property<string>("ConcurrencyStamp") |
|
||||
.IsConcurrencyToken() |
|
||||
.HasMaxLength(40) |
|
||||
.HasColumnType("varchar(40)") |
|
||||
.HasColumnName("ConcurrencyStamp"); |
|
||||
|
|
||||
b.Property<DateTime>("CreationTime") |
|
||||
.HasColumnType("datetime(6)") |
|
||||
.HasColumnName("CreationTime"); |
|
||||
|
|
||||
b.Property<Guid?>("CreatorId") |
|
||||
.HasColumnType("char(36)") |
|
||||
.HasColumnName("CreatorId"); |
|
||||
|
|
||||
b.Property<string>("Description") |
|
||||
.HasMaxLength(200) |
|
||||
.HasColumnType("varchar(200)"); |
|
||||
|
|
||||
b.Property<string>("DisplayName") |
|
||||
.HasMaxLength(200) |
|
||||
.HasColumnType("varchar(200)"); |
|
||||
|
|
||||
b.Property<int>("ErrorBehavior") |
|
||||
.HasColumnType("int"); |
|
||||
|
|
||||
b.Property<TimeSpan?>("ErrorRetryInterval") |
|
||||
.HasColumnType("time(6)"); |
|
||||
|
|
||||
b.Property<string>("ExtraProperties") |
|
||||
.HasColumnType("longtext") |
|
||||
.HasColumnName("ExtraProperties"); |
|
||||
|
|
||||
b.Property<bool>("IsEnabled") |
|
||||
.HasColumnType("tinyint(1)"); |
|
||||
|
|
||||
b.Property<DateTime?>("LastModificationTime") |
|
||||
.HasColumnType("datetime(6)") |
|
||||
.HasColumnName("LastModificationTime"); |
|
||||
|
|
||||
b.Property<Guid?>("LastModifierId") |
|
||||
.HasColumnType("char(36)") |
|
||||
.HasColumnName("LastModifierId"); |
|
||||
|
|
||||
b.Property<string>("Name") |
|
||||
.IsRequired() |
|
||||
.HasMaxLength(100) |
|
||||
.HasColumnType("varchar(100)"); |
|
||||
|
|
||||
b.Property<Guid?>("TenantId") |
|
||||
.HasColumnType("char(36)") |
|
||||
.HasColumnName("TenantId"); |
|
||||
|
|
||||
b.Property<int>("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
|
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
@ -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<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"), |
|
||||
TenantId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"), |
|
||||
WorkflowId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"), |
|
||||
Name = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: true) |
|
||||
.Annotation("MySql:CharSet", "utf8mb4"), |
|
||||
StepType = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: true) |
|
||||
.Annotation("MySql:CharSet", "utf8mb4"), |
|
||||
CancelCondition = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: true) |
|
||||
.Annotation("MySql:CharSet", "utf8mb4"), |
|
||||
ErrorBehavior = table.Column<int>(type: "int", nullable: true), |
|
||||
RetryInterval = table.Column<TimeSpan>(type: "time(6)", nullable: true), |
|
||||
Saga = table.Column<bool>(type: "tinyint(1)", nullable: false), |
|
||||
ParentId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"), |
|
||||
Inputs = table.Column<string>(type: "longtext", nullable: true) |
|
||||
.Annotation("MySql:CharSet", "utf8mb4"), |
|
||||
Outputs = table.Column<string>(type: "longtext", nullable: true) |
|
||||
.Annotation("MySql:CharSet", "utf8mb4"), |
|
||||
SelectNextStep = table.Column<string>(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<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"), |
|
||||
TenantId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"), |
|
||||
IsEnabled = table.Column<bool>(type: "tinyint(1)", nullable: false), |
|
||||
Name = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: false) |
|
||||
.Annotation("MySql:CharSet", "utf8mb4"), |
|
||||
DisplayName = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: true) |
|
||||
.Annotation("MySql:CharSet", "utf8mb4"), |
|
||||
Description = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: true) |
|
||||
.Annotation("MySql:CharSet", "utf8mb4"), |
|
||||
Version = table.Column<int>(type: "int", nullable: false), |
|
||||
ErrorBehavior = table.Column<int>(type: "int", nullable: false), |
|
||||
ErrorRetryInterval = table.Column<TimeSpan>(type: "time(6)", nullable: true), |
|
||||
ExtraProperties = table.Column<string>(type: "longtext", nullable: true) |
|
||||
.Annotation("MySql:CharSet", "utf8mb4"), |
|
||||
ConcurrencyStamp = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: true) |
|
||||
.Annotation("MySql:CharSet", "utf8mb4"), |
|
||||
CreationTime = table.Column<DateTime>(type: "datetime(6)", nullable: false), |
|
||||
CreatorId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"), |
|
||||
LastModificationTime = table.Column<DateTime>(type: "datetime(6)", nullable: true), |
|
||||
LastModifierId = table.Column<Guid>(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<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"), |
|
||||
TenantId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"), |
|
||||
EventName = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: true) |
|
||||
.Annotation("MySql:CharSet", "utf8mb4"), |
|
||||
EventKey = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: true) |
|
||||
.Annotation("MySql:CharSet", "utf8mb4"), |
|
||||
EventData = table.Column<string>(type: "longtext", nullable: true) |
|
||||
.Annotation("MySql:CharSet", "utf8mb4"), |
|
||||
IsProcessed = table.Column<bool>(type: "tinyint(1)", nullable: false), |
|
||||
CreationTime = table.Column<DateTime>(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<int>(type: "int", nullable: false) |
|
||||
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), |
|
||||
TenantId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"), |
|
||||
WorkflowId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"), |
|
||||
ExecutionPointerId = table.Column<Guid>(type: "char(50)", maxLength: 50, nullable: false, collation: "ascii_general_ci"), |
|
||||
ErrorTime = table.Column<DateTime>(type: "datetime(6)", nullable: false), |
|
||||
Message = table.Column<string>(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<long>(type: "bigint", nullable: false) |
|
||||
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), |
|
||||
TenantId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"), |
|
||||
CommandName = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: true) |
|
||||
.Annotation("MySql:CharSet", "utf8mb4"), |
|
||||
Data = table.Column<string>(type: "varchar(500)", maxLength: 500, nullable: true) |
|
||||
.Annotation("MySql:CharSet", "utf8mb4"), |
|
||||
ExecuteTime = table.Column<long>(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<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"), |
|
||||
TenantId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"), |
|
||||
WorkflowId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"), |
|
||||
Name = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: true) |
|
||||
.Annotation("MySql:CharSet", "utf8mb4"), |
|
||||
StepType = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: true) |
|
||||
.Annotation("MySql:CharSet", "utf8mb4"), |
|
||||
CancelCondition = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: true) |
|
||||
.Annotation("MySql:CharSet", "utf8mb4"), |
|
||||
ErrorBehavior = table.Column<int>(type: "int", nullable: true), |
|
||||
RetryInterval = table.Column<TimeSpan>(type: "time(6)", nullable: true), |
|
||||
Saga = table.Column<bool>(type: "tinyint(1)", nullable: false), |
|
||||
ParentId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"), |
|
||||
Inputs = table.Column<string>(type: "longtext", nullable: true) |
|
||||
.Annotation("MySql:CharSet", "utf8mb4"), |
|
||||
Outputs = table.Column<string>(type: "longtext", nullable: true) |
|
||||
.Annotation("MySql:CharSet", "utf8mb4"), |
|
||||
SelectNextStep = table.Column<string>(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<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"), |
|
||||
TenantId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"), |
|
||||
WorkflowId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"), |
|
||||
StepId = table.Column<int>(type: "int", nullable: false), |
|
||||
ExecutionPointerId = table.Column<Guid>(type: "char(50)", maxLength: 50, nullable: false, collation: "ascii_general_ci"), |
|
||||
EventName = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: true) |
|
||||
.Annotation("MySql:CharSet", "utf8mb4"), |
|
||||
EventKey = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: true) |
|
||||
.Annotation("MySql:CharSet", "utf8mb4"), |
|
||||
SubscribeAsOf = table.Column<DateTime>(type: "datetime(6)", nullable: false), |
|
||||
SubscriptionData = table.Column<string>(type: "longtext", nullable: true) |
|
||||
.Annotation("MySql:CharSet", "utf8mb4"), |
|
||||
ExternalToken = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: true) |
|
||||
.Annotation("MySql:CharSet", "utf8mb4"), |
|
||||
ExternalWorkerId = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: true) |
|
||||
.Annotation("MySql:CharSet", "utf8mb4"), |
|
||||
ExternalTokenExpiry = table.Column<DateTime>(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<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"), |
|
||||
TenantId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"), |
|
||||
WorkflowDefinitionId = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: true) |
|
||||
.Annotation("MySql:CharSet", "utf8mb4"), |
|
||||
Version = table.Column<int>(type: "int", nullable: false), |
|
||||
Description = table.Column<string>(type: "varchar(500)", maxLength: 500, nullable: true) |
|
||||
.Annotation("MySql:CharSet", "utf8mb4"), |
|
||||
Reference = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: true) |
|
||||
.Annotation("MySql:CharSet", "utf8mb4"), |
|
||||
NextExecution = table.Column<long>(type: "bigint", nullable: true), |
|
||||
Status = table.Column<int>(type: "int", nullable: false), |
|
||||
Data = table.Column<string>(type: "longtext", nullable: true) |
|
||||
.Annotation("MySql:CharSet", "utf8mb4"), |
|
||||
CompleteTime = table.Column<DateTime>(type: "datetime(6)", nullable: true), |
|
||||
ExtraProperties = table.Column<string>(type: "longtext", nullable: true) |
|
||||
.Annotation("MySql:CharSet", "utf8mb4"), |
|
||||
ConcurrencyStamp = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: true) |
|
||||
.Annotation("MySql:CharSet", "utf8mb4"), |
|
||||
CreationTime = table.Column<DateTime>(type: "datetime(6)", nullable: false), |
|
||||
CreatorId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"), |
|
||||
LastModificationTime = table.Column<DateTime>(type: "datetime(6)", nullable: true), |
|
||||
LastModifierId = table.Column<Guid>(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<Guid>(type: "char(50)", maxLength: 50, nullable: false, collation: "ascii_general_ci"), |
|
||||
TenantId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"), |
|
||||
WorkflowId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"), |
|
||||
StepId = table.Column<int>(type: "int", nullable: false), |
|
||||
Active = table.Column<bool>(type: "tinyint(1)", nullable: false), |
|
||||
SleepUntil = table.Column<DateTime>(type: "datetime(6)", nullable: true), |
|
||||
PersistenceData = table.Column<string>(type: "longtext", nullable: true) |
|
||||
.Annotation("MySql:CharSet", "utf8mb4"), |
|
||||
StartTime = table.Column<DateTime>(type: "datetime(6)", nullable: true), |
|
||||
EndTime = table.Column<DateTime>(type: "datetime(6)", nullable: true), |
|
||||
EventName = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: true) |
|
||||
.Annotation("MySql:CharSet", "utf8mb4"), |
|
||||
EventKey = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: true) |
|
||||
.Annotation("MySql:CharSet", "utf8mb4"), |
|
||||
EventPublished = table.Column<bool>(type: "tinyint(1)", nullable: false), |
|
||||
EventData = table.Column<string>(type: "longtext", nullable: true) |
|
||||
.Annotation("MySql:CharSet", "utf8mb4"), |
|
||||
StepName = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: true) |
|
||||
.Annotation("MySql:CharSet", "utf8mb4"), |
|
||||
RetryCount = table.Column<int>(type: "int", nullable: false), |
|
||||
Children = table.Column<string>(type: "longtext", nullable: true) |
|
||||
.Annotation("MySql:CharSet", "utf8mb4"), |
|
||||
ContextItem = table.Column<string>(type: "longtext", nullable: true) |
|
||||
.Annotation("MySql:CharSet", "utf8mb4"), |
|
||||
PredecessorId = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: true) |
|
||||
.Annotation("MySql:CharSet", "utf8mb4"), |
|
||||
Outcome = table.Column<string>(type: "longtext", nullable: true) |
|
||||
.Annotation("MySql:CharSet", "utf8mb4"), |
|
||||
Status = table.Column<int>(type: "int", nullable: false), |
|
||||
Scope = table.Column<string>(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<long>(type: "bigint", nullable: false) |
|
||||
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), |
|
||||
TenantId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"), |
|
||||
ExecutionPointerId = table.Column<Guid>(type: "char(50)", maxLength: 50, nullable: false, collation: "ascii_general_ci"), |
|
||||
Key = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: true) |
|
||||
.Annotation("MySql:CharSet", "utf8mb4"), |
|
||||
Value = table.Column<string>(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"); |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
@ -1,610 +0,0 @@ |
|||||
// <auto-generated />
|
|
||||
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<Guid>("Id") |
|
||||
.ValueGeneratedOnAdd() |
|
||||
.HasColumnType("char(36)"); |
|
||||
|
|
||||
b.Property<DateTime>("CreationTime") |
|
||||
.HasColumnType("datetime(6)") |
|
||||
.HasColumnName("CreationTime"); |
|
||||
|
|
||||
b.Property<string>("EventData") |
|
||||
.HasColumnType("longtext"); |
|
||||
|
|
||||
b.Property<string>("EventKey") |
|
||||
.HasMaxLength(200) |
|
||||
.HasColumnType("varchar(200)"); |
|
||||
|
|
||||
b.Property<string>("EventName") |
|
||||
.HasMaxLength(200) |
|
||||
.HasColumnType("varchar(200)"); |
|
||||
|
|
||||
b.Property<bool>("IsProcessed") |
|
||||
.HasColumnType("tinyint(1)"); |
|
||||
|
|
||||
b.Property<Guid?>("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<int>("Id") |
|
||||
.ValueGeneratedOnAdd() |
|
||||
.HasColumnType("int"); |
|
||||
|
|
||||
b.Property<DateTime>("ErrorTime") |
|
||||
.HasColumnType("datetime(6)"); |
|
||||
|
|
||||
b.Property<Guid>("ExecutionPointerId") |
|
||||
.HasMaxLength(50) |
|
||||
.HasColumnType("char(50)"); |
|
||||
|
|
||||
b.Property<string>("Message") |
|
||||
.HasColumnType("longtext"); |
|
||||
|
|
||||
b.Property<Guid?>("TenantId") |
|
||||
.HasColumnType("char(36)") |
|
||||
.HasColumnName("TenantId"); |
|
||||
|
|
||||
b.Property<Guid>("WorkflowId") |
|
||||
.HasColumnType("char(36)"); |
|
||||
|
|
||||
b.HasKey("Id"); |
|
||||
|
|
||||
b.ToTable("WF_ExecutionError", (string)null); |
|
||||
}); |
|
||||
|
|
||||
modelBuilder.Entity("LINGYUN.Abp.WorkflowCore.Persistence.PersistedExecutionPointer", b => |
|
||||
{ |
|
||||
b.Property<Guid>("Id") |
|
||||
.ValueGeneratedOnAdd() |
|
||||
.HasMaxLength(50) |
|
||||
.HasColumnType("char(50)"); |
|
||||
|
|
||||
b.Property<bool>("Active") |
|
||||
.HasColumnType("tinyint(1)"); |
|
||||
|
|
||||
b.Property<string>("Children") |
|
||||
.HasColumnType("longtext"); |
|
||||
|
|
||||
b.Property<string>("ContextItem") |
|
||||
.HasColumnType("longtext"); |
|
||||
|
|
||||
b.Property<DateTime?>("EndTime") |
|
||||
.HasColumnType("datetime(6)"); |
|
||||
|
|
||||
b.Property<string>("EventData") |
|
||||
.HasColumnType("longtext"); |
|
||||
|
|
||||
b.Property<string>("EventKey") |
|
||||
.HasMaxLength(200) |
|
||||
.HasColumnType("varchar(200)"); |
|
||||
|
|
||||
b.Property<string>("EventName") |
|
||||
.HasMaxLength(200) |
|
||||
.HasColumnType("varchar(200)"); |
|
||||
|
|
||||
b.Property<bool>("EventPublished") |
|
||||
.HasColumnType("tinyint(1)"); |
|
||||
|
|
||||
b.Property<string>("Outcome") |
|
||||
.HasColumnType("longtext"); |
|
||||
|
|
||||
b.Property<string>("PersistenceData") |
|
||||
.HasColumnType("longtext"); |
|
||||
|
|
||||
b.Property<string>("PredecessorId") |
|
||||
.HasMaxLength(100) |
|
||||
.HasColumnType("varchar(100)"); |
|
||||
|
|
||||
b.Property<int>("RetryCount") |
|
||||
.HasColumnType("int"); |
|
||||
|
|
||||
b.Property<string>("Scope") |
|
||||
.HasColumnType("longtext"); |
|
||||
|
|
||||
b.Property<DateTime?>("SleepUntil") |
|
||||
.HasColumnType("datetime(6)"); |
|
||||
|
|
||||
b.Property<DateTime?>("StartTime") |
|
||||
.HasColumnType("datetime(6)"); |
|
||||
|
|
||||
b.Property<int>("Status") |
|
||||
.HasColumnType("int"); |
|
||||
|
|
||||
b.Property<int>("StepId") |
|
||||
.HasColumnType("int"); |
|
||||
|
|
||||
b.Property<string>("StepName") |
|
||||
.HasMaxLength(100) |
|
||||
.HasColumnType("varchar(100)"); |
|
||||
|
|
||||
b.Property<Guid?>("TenantId") |
|
||||
.HasColumnType("char(36)") |
|
||||
.HasColumnName("TenantId"); |
|
||||
|
|
||||
b.Property<Guid>("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<long>("Id") |
|
||||
.ValueGeneratedOnAdd() |
|
||||
.HasColumnType("bigint"); |
|
||||
|
|
||||
b.Property<Guid>("ExecutionPointerId") |
|
||||
.HasMaxLength(50) |
|
||||
.HasColumnType("char(50)"); |
|
||||
|
|
||||
b.Property<string>("Key") |
|
||||
.HasMaxLength(100) |
|
||||
.HasColumnType("varchar(100)"); |
|
||||
|
|
||||
b.Property<Guid?>("TenantId") |
|
||||
.HasColumnType("char(36)") |
|
||||
.HasColumnName("TenantId"); |
|
||||
|
|
||||
b.Property<string>("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<long>("Id") |
|
||||
.ValueGeneratedOnAdd() |
|
||||
.HasColumnType("bigint"); |
|
||||
|
|
||||
b.Property<string>("CommandName") |
|
||||
.HasMaxLength(200) |
|
||||
.HasColumnType("varchar(200)"); |
|
||||
|
|
||||
b.Property<string>("Data") |
|
||||
.HasMaxLength(500) |
|
||||
.HasColumnType("varchar(500)"); |
|
||||
|
|
||||
b.Property<long>("ExecuteTime") |
|
||||
.HasColumnType("bigint"); |
|
||||
|
|
||||
b.Property<Guid?>("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<Guid>("Id") |
|
||||
.ValueGeneratedOnAdd() |
|
||||
.HasColumnType("char(36)"); |
|
||||
|
|
||||
b.Property<string>("EventKey") |
|
||||
.HasMaxLength(200) |
|
||||
.HasColumnType("varchar(200)"); |
|
||||
|
|
||||
b.Property<string>("EventName") |
|
||||
.HasMaxLength(200) |
|
||||
.HasColumnType("varchar(200)"); |
|
||||
|
|
||||
b.Property<Guid>("ExecutionPointerId") |
|
||||
.HasMaxLength(50) |
|
||||
.HasColumnType("char(50)"); |
|
||||
|
|
||||
b.Property<string>("ExternalToken") |
|
||||
.HasMaxLength(200) |
|
||||
.HasColumnType("varchar(200)"); |
|
||||
|
|
||||
b.Property<DateTime?>("ExternalTokenExpiry") |
|
||||
.HasColumnType("datetime(6)"); |
|
||||
|
|
||||
b.Property<string>("ExternalWorkerId") |
|
||||
.HasMaxLength(200) |
|
||||
.HasColumnType("varchar(200)"); |
|
||||
|
|
||||
b.Property<int>("StepId") |
|
||||
.HasColumnType("int"); |
|
||||
|
|
||||
b.Property<DateTime>("SubscribeAsOf") |
|
||||
.HasColumnType("datetime(6)"); |
|
||||
|
|
||||
b.Property<string>("SubscriptionData") |
|
||||
.HasColumnType("longtext"); |
|
||||
|
|
||||
b.Property<Guid?>("TenantId") |
|
||||
.HasColumnType("char(36)") |
|
||||
.HasColumnName("TenantId"); |
|
||||
|
|
||||
b.Property<Guid>("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<Guid>("Id") |
|
||||
.ValueGeneratedOnAdd() |
|
||||
.HasColumnType("char(36)"); |
|
||||
|
|
||||
b.Property<DateTime?>("CompleteTime") |
|
||||
.HasColumnType("datetime(6)"); |
|
||||
|
|
||||
b.Property<string>("ConcurrencyStamp") |
|
||||
.IsConcurrencyToken() |
|
||||
.HasMaxLength(40) |
|
||||
.HasColumnType("varchar(40)") |
|
||||
.HasColumnName("ConcurrencyStamp"); |
|
||||
|
|
||||
b.Property<DateTime>("CreationTime") |
|
||||
.HasColumnType("datetime(6)") |
|
||||
.HasColumnName("CreationTime"); |
|
||||
|
|
||||
b.Property<Guid?>("CreatorId") |
|
||||
.HasColumnType("char(36)") |
|
||||
.HasColumnName("CreatorId"); |
|
||||
|
|
||||
b.Property<string>("Data") |
|
||||
.HasColumnType("longtext"); |
|
||||
|
|
||||
b.Property<string>("Description") |
|
||||
.HasMaxLength(500) |
|
||||
.HasColumnType("varchar(500)"); |
|
||||
|
|
||||
b.Property<string>("ExtraProperties") |
|
||||
.HasColumnType("longtext") |
|
||||
.HasColumnName("ExtraProperties"); |
|
||||
|
|
||||
b.Property<DateTime?>("LastModificationTime") |
|
||||
.HasColumnType("datetime(6)") |
|
||||
.HasColumnName("LastModificationTime"); |
|
||||
|
|
||||
b.Property<Guid?>("LastModifierId") |
|
||||
.HasColumnType("char(36)") |
|
||||
.HasColumnName("LastModifierId"); |
|
||||
|
|
||||
b.Property<long?>("NextExecution") |
|
||||
.HasColumnType("bigint"); |
|
||||
|
|
||||
b.Property<string>("Reference") |
|
||||
.HasMaxLength(200) |
|
||||
.HasColumnType("varchar(200)"); |
|
||||
|
|
||||
b.Property<int>("Status") |
|
||||
.HasColumnType("int"); |
|
||||
|
|
||||
b.Property<Guid?>("TenantId") |
|
||||
.HasColumnType("char(36)") |
|
||||
.HasColumnName("TenantId"); |
|
||||
|
|
||||
b.Property<int>("Version") |
|
||||
.HasColumnType("int"); |
|
||||
|
|
||||
b.Property<string>("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<Guid>("Id") |
|
||||
.ValueGeneratedOnAdd() |
|
||||
.HasColumnType("char(36)"); |
|
||||
|
|
||||
b.Property<string>("CancelCondition") |
|
||||
.HasMaxLength(200) |
|
||||
.HasColumnType("varchar(200)"); |
|
||||
|
|
||||
b.Property<int?>("ErrorBehavior") |
|
||||
.HasColumnType("int"); |
|
||||
|
|
||||
b.Property<string>("Inputs") |
|
||||
.HasColumnType("longtext"); |
|
||||
|
|
||||
b.Property<string>("Name") |
|
||||
.HasMaxLength(100) |
|
||||
.HasColumnType("varchar(100)"); |
|
||||
|
|
||||
b.Property<string>("Outputs") |
|
||||
.HasColumnType("longtext"); |
|
||||
|
|
||||
b.Property<Guid?>("ParentId") |
|
||||
.HasColumnType("char(36)"); |
|
||||
|
|
||||
b.Property<TimeSpan?>("RetryInterval") |
|
||||
.HasColumnType("time(6)"); |
|
||||
|
|
||||
b.Property<bool>("Saga") |
|
||||
.HasColumnType("tinyint(1)"); |
|
||||
|
|
||||
b.Property<string>("SelectNextStep") |
|
||||
.HasColumnType("longtext"); |
|
||||
|
|
||||
b.Property<string>("StepType") |
|
||||
.HasMaxLength(100) |
|
||||
.HasColumnType("varchar(100)"); |
|
||||
|
|
||||
b.Property<Guid?>("TenantId") |
|
||||
.HasColumnType("char(36)") |
|
||||
.HasColumnName("TenantId"); |
|
||||
|
|
||||
b.Property<Guid>("WorkflowId") |
|
||||
.HasColumnType("char(36)"); |
|
||||
|
|
||||
b.HasKey("Id"); |
|
||||
|
|
||||
b.ToTable("WF_Compensate", (string)null); |
|
||||
}); |
|
||||
|
|
||||
modelBuilder.Entity("LINGYUN.Abp.WorkflowManagement.StepNode", b => |
|
||||
{ |
|
||||
b.Property<Guid>("Id") |
|
||||
.ValueGeneratedOnAdd() |
|
||||
.HasColumnType("char(36)"); |
|
||||
|
|
||||
b.Property<string>("CancelCondition") |
|
||||
.HasMaxLength(200) |
|
||||
.HasColumnType("varchar(200)"); |
|
||||
|
|
||||
b.Property<int?>("ErrorBehavior") |
|
||||
.HasColumnType("int"); |
|
||||
|
|
||||
b.Property<string>("Inputs") |
|
||||
.HasColumnType("longtext"); |
|
||||
|
|
||||
b.Property<string>("Name") |
|
||||
.HasMaxLength(100) |
|
||||
.HasColumnType("varchar(100)"); |
|
||||
|
|
||||
b.Property<string>("Outputs") |
|
||||
.HasColumnType("longtext"); |
|
||||
|
|
||||
b.Property<Guid?>("ParentId") |
|
||||
.HasColumnType("char(36)"); |
|
||||
|
|
||||
b.Property<TimeSpan?>("RetryInterval") |
|
||||
.HasColumnType("time(6)"); |
|
||||
|
|
||||
b.Property<bool>("Saga") |
|
||||
.HasColumnType("tinyint(1)"); |
|
||||
|
|
||||
b.Property<string>("SelectNextStep") |
|
||||
.HasColumnType("longtext"); |
|
||||
|
|
||||
b.Property<string>("StepType") |
|
||||
.HasMaxLength(100) |
|
||||
.HasColumnType("varchar(100)"); |
|
||||
|
|
||||
b.Property<Guid?>("TenantId") |
|
||||
.HasColumnType("char(36)") |
|
||||
.HasColumnName("TenantId"); |
|
||||
|
|
||||
b.Property<Guid>("WorkflowId") |
|
||||
.HasColumnType("char(36)"); |
|
||||
|
|
||||
b.HasKey("Id"); |
|
||||
|
|
||||
b.ToTable("WF_Step", (string)null); |
|
||||
}); |
|
||||
|
|
||||
modelBuilder.Entity("LINGYUN.Abp.WorkflowManagement.Workflow", b => |
|
||||
{ |
|
||||
b.Property<Guid>("Id") |
|
||||
.ValueGeneratedOnAdd() |
|
||||
.HasColumnType("char(36)"); |
|
||||
|
|
||||
b.Property<string>("ConcurrencyStamp") |
|
||||
.IsConcurrencyToken() |
|
||||
.HasMaxLength(40) |
|
||||
.HasColumnType("varchar(40)") |
|
||||
.HasColumnName("ConcurrencyStamp"); |
|
||||
|
|
||||
b.Property<DateTime>("CreationTime") |
|
||||
.HasColumnType("datetime(6)") |
|
||||
.HasColumnName("CreationTime"); |
|
||||
|
|
||||
b.Property<Guid?>("CreatorId") |
|
||||
.HasColumnType("char(36)") |
|
||||
.HasColumnName("CreatorId"); |
|
||||
|
|
||||
b.Property<string>("Description") |
|
||||
.HasMaxLength(200) |
|
||||
.HasColumnType("varchar(200)"); |
|
||||
|
|
||||
b.Property<string>("DisplayName") |
|
||||
.HasMaxLength(200) |
|
||||
.HasColumnType("varchar(200)"); |
|
||||
|
|
||||
b.Property<int>("ErrorBehavior") |
|
||||
.HasColumnType("int"); |
|
||||
|
|
||||
b.Property<TimeSpan?>("ErrorRetryInterval") |
|
||||
.HasColumnType("time(6)"); |
|
||||
|
|
||||
b.Property<string>("ExtraProperties") |
|
||||
.HasColumnType("longtext") |
|
||||
.HasColumnName("ExtraProperties"); |
|
||||
|
|
||||
b.Property<bool>("IsEnabled") |
|
||||
.HasColumnType("tinyint(1)"); |
|
||||
|
|
||||
b.Property<DateTime?>("LastModificationTime") |
|
||||
.HasColumnType("datetime(6)") |
|
||||
.HasColumnName("LastModificationTime"); |
|
||||
|
|
||||
b.Property<Guid?>("LastModifierId") |
|
||||
.HasColumnType("char(36)") |
|
||||
.HasColumnName("LastModifierId"); |
|
||||
|
|
||||
b.Property<string>("Name") |
|
||||
.IsRequired() |
|
||||
.HasMaxLength(100) |
|
||||
.HasColumnType("varchar(100)"); |
|
||||
|
|
||||
b.Property<Guid?>("TenantId") |
|
||||
.HasColumnType("char(36)") |
|
||||
.HasColumnName("TenantId"); |
|
||||
|
|
||||
b.Property<int>("Version") |
|
||||
.HasColumnType("int"); |
|
||||
|
|
||||
b.HasKey("Id"); |
|
||||
|
|
||||
b.ToTable("WF_Definition", (string)null); |
|
||||
}); |
|
||||
|
|
||||
modelBuilder.Entity("LINGYUN.Abp.WorkflowManagement.WorkflowData", b => |
|
||||
{ |
|
||||
b.Property<Guid>("Id") |
|
||||
.ValueGeneratedOnAdd() |
|
||||
.HasColumnType("char(36)"); |
|
||||
|
|
||||
b.Property<int>("DataType") |
|
||||
.HasColumnType("int"); |
|
||||
|
|
||||
b.Property<string>("DisplayName") |
|
||||
.IsRequired() |
|
||||
.HasMaxLength(100) |
|
||||
.HasColumnType("varchar(100)"); |
|
||||
|
|
||||
b.Property<bool>("IsCaseSensitive") |
|
||||
.HasColumnType("tinyint(1)"); |
|
||||
|
|
||||
b.Property<bool>("IsRequired") |
|
||||
.HasColumnType("tinyint(1)"); |
|
||||
|
|
||||
b.Property<string>("Name") |
|
||||
.IsRequired() |
|
||||
.HasMaxLength(100) |
|
||||
.HasColumnType("varchar(100)"); |
|
||||
|
|
||||
b.Property<Guid?>("TenantId") |
|
||||
.HasColumnType("char(36)") |
|
||||
.HasColumnName("TenantId"); |
|
||||
|
|
||||
b.Property<Guid>("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
|
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
@ -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<Guid>( |
|
||||
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<Guid>( |
|
||||
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<Guid>( |
|
||||
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<Guid>( |
|
||||
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<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"), |
|
||||
TenantId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"), |
|
||||
WorkflowId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"), |
|
||||
Name = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: false) |
|
||||
.Annotation("MySql:CharSet", "utf8mb4"), |
|
||||
DisplayName = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: false) |
|
||||
.Annotation("MySql:CharSet", "utf8mb4"), |
|
||||
DataType = table.Column<int>(type: "int", nullable: false), |
|
||||
IsRequired = table.Column<bool>(type: "tinyint(1)", nullable: false), |
|
||||
IsCaseSensitive = table.Column<bool>(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<string>( |
|
||||
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<string>( |
|
||||
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<string>( |
|
||||
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<string>( |
|
||||
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"); |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
@ -1,608 +0,0 @@ |
|||||
// <auto-generated />
|
|
||||
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<Guid>("Id") |
|
||||
.ValueGeneratedOnAdd() |
|
||||
.HasColumnType("char(36)"); |
|
||||
|
|
||||
b.Property<DateTime>("CreationTime") |
|
||||
.HasColumnType("datetime(6)") |
|
||||
.HasColumnName("CreationTime"); |
|
||||
|
|
||||
b.Property<string>("EventData") |
|
||||
.HasColumnType("longtext"); |
|
||||
|
|
||||
b.Property<string>("EventKey") |
|
||||
.HasMaxLength(200) |
|
||||
.HasColumnType("varchar(200)"); |
|
||||
|
|
||||
b.Property<string>("EventName") |
|
||||
.HasMaxLength(200) |
|
||||
.HasColumnType("varchar(200)"); |
|
||||
|
|
||||
b.Property<bool>("IsProcessed") |
|
||||
.HasColumnType("tinyint(1)"); |
|
||||
|
|
||||
b.Property<Guid?>("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<int>("Id") |
|
||||
.ValueGeneratedOnAdd() |
|
||||
.HasColumnType("int"); |
|
||||
|
|
||||
b.Property<DateTime>("ErrorTime") |
|
||||
.HasColumnType("datetime(6)"); |
|
||||
|
|
||||
b.Property<Guid>("ExecutionPointerId") |
|
||||
.HasMaxLength(50) |
|
||||
.HasColumnType("char(50)"); |
|
||||
|
|
||||
b.Property<string>("Message") |
|
||||
.HasColumnType("longtext"); |
|
||||
|
|
||||
b.Property<Guid?>("TenantId") |
|
||||
.HasColumnType("char(36)") |
|
||||
.HasColumnName("TenantId"); |
|
||||
|
|
||||
b.Property<Guid>("WorkflowId") |
|
||||
.HasColumnType("char(36)"); |
|
||||
|
|
||||
b.HasKey("Id"); |
|
||||
|
|
||||
b.ToTable("WF_ExecutionError", (string)null); |
|
||||
}); |
|
||||
|
|
||||
modelBuilder.Entity("LINGYUN.Abp.WorkflowCore.Persistence.PersistedExecutionPointer", b => |
|
||||
{ |
|
||||
b.Property<Guid>("Id") |
|
||||
.ValueGeneratedOnAdd() |
|
||||
.HasMaxLength(50) |
|
||||
.HasColumnType("char(50)"); |
|
||||
|
|
||||
b.Property<bool>("Active") |
|
||||
.HasColumnType("tinyint(1)"); |
|
||||
|
|
||||
b.Property<string>("Children") |
|
||||
.HasColumnType("longtext"); |
|
||||
|
|
||||
b.Property<string>("ContextItem") |
|
||||
.HasColumnType("longtext"); |
|
||||
|
|
||||
b.Property<DateTime?>("EndTime") |
|
||||
.HasColumnType("datetime(6)"); |
|
||||
|
|
||||
b.Property<string>("EventData") |
|
||||
.HasColumnType("longtext"); |
|
||||
|
|
||||
b.Property<string>("EventKey") |
|
||||
.HasMaxLength(200) |
|
||||
.HasColumnType("varchar(200)"); |
|
||||
|
|
||||
b.Property<string>("EventName") |
|
||||
.HasMaxLength(200) |
|
||||
.HasColumnType("varchar(200)"); |
|
||||
|
|
||||
b.Property<bool>("EventPublished") |
|
||||
.HasColumnType("tinyint(1)"); |
|
||||
|
|
||||
b.Property<string>("Outcome") |
|
||||
.HasColumnType("longtext"); |
|
||||
|
|
||||
b.Property<string>("PersistenceData") |
|
||||
.HasColumnType("longtext"); |
|
||||
|
|
||||
b.Property<string>("PredecessorId") |
|
||||
.HasMaxLength(100) |
|
||||
.HasColumnType("varchar(100)"); |
|
||||
|
|
||||
b.Property<int>("RetryCount") |
|
||||
.HasColumnType("int"); |
|
||||
|
|
||||
b.Property<string>("Scope") |
|
||||
.HasColumnType("longtext"); |
|
||||
|
|
||||
b.Property<DateTime?>("SleepUntil") |
|
||||
.HasColumnType("datetime(6)"); |
|
||||
|
|
||||
b.Property<DateTime?>("StartTime") |
|
||||
.HasColumnType("datetime(6)"); |
|
||||
|
|
||||
b.Property<int>("Status") |
|
||||
.HasColumnType("int"); |
|
||||
|
|
||||
b.Property<int>("StepId") |
|
||||
.HasColumnType("int"); |
|
||||
|
|
||||
b.Property<string>("StepName") |
|
||||
.HasMaxLength(100) |
|
||||
.HasColumnType("varchar(100)"); |
|
||||
|
|
||||
b.Property<Guid?>("TenantId") |
|
||||
.HasColumnType("char(36)") |
|
||||
.HasColumnName("TenantId"); |
|
||||
|
|
||||
b.Property<Guid>("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<long>("Id") |
|
||||
.ValueGeneratedOnAdd() |
|
||||
.HasColumnType("bigint"); |
|
||||
|
|
||||
b.Property<Guid>("ExecutionPointerId") |
|
||||
.HasMaxLength(50) |
|
||||
.HasColumnType("char(50)"); |
|
||||
|
|
||||
b.Property<string>("Key") |
|
||||
.HasMaxLength(100) |
|
||||
.HasColumnType("varchar(100)"); |
|
||||
|
|
||||
b.Property<Guid?>("TenantId") |
|
||||
.HasColumnType("char(36)") |
|
||||
.HasColumnName("TenantId"); |
|
||||
|
|
||||
b.Property<string>("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<long>("Id") |
|
||||
.ValueGeneratedOnAdd() |
|
||||
.HasColumnType("bigint"); |
|
||||
|
|
||||
b.Property<string>("CommandName") |
|
||||
.HasMaxLength(200) |
|
||||
.HasColumnType("varchar(200)"); |
|
||||
|
|
||||
b.Property<string>("Data") |
|
||||
.HasMaxLength(500) |
|
||||
.HasColumnType("varchar(500)"); |
|
||||
|
|
||||
b.Property<long>("ExecuteTime") |
|
||||
.HasColumnType("bigint"); |
|
||||
|
|
||||
b.Property<Guid?>("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<Guid>("Id") |
|
||||
.ValueGeneratedOnAdd() |
|
||||
.HasColumnType("char(36)"); |
|
||||
|
|
||||
b.Property<string>("EventKey") |
|
||||
.HasMaxLength(200) |
|
||||
.HasColumnType("varchar(200)"); |
|
||||
|
|
||||
b.Property<string>("EventName") |
|
||||
.HasMaxLength(200) |
|
||||
.HasColumnType("varchar(200)"); |
|
||||
|
|
||||
b.Property<Guid>("ExecutionPointerId") |
|
||||
.HasMaxLength(50) |
|
||||
.HasColumnType("char(50)"); |
|
||||
|
|
||||
b.Property<string>("ExternalToken") |
|
||||
.HasMaxLength(200) |
|
||||
.HasColumnType("varchar(200)"); |
|
||||
|
|
||||
b.Property<DateTime?>("ExternalTokenExpiry") |
|
||||
.HasColumnType("datetime(6)"); |
|
||||
|
|
||||
b.Property<string>("ExternalWorkerId") |
|
||||
.HasMaxLength(200) |
|
||||
.HasColumnType("varchar(200)"); |
|
||||
|
|
||||
b.Property<int>("StepId") |
|
||||
.HasColumnType("int"); |
|
||||
|
|
||||
b.Property<DateTime>("SubscribeAsOf") |
|
||||
.HasColumnType("datetime(6)"); |
|
||||
|
|
||||
b.Property<string>("SubscriptionData") |
|
||||
.HasColumnType("longtext"); |
|
||||
|
|
||||
b.Property<Guid?>("TenantId") |
|
||||
.HasColumnType("char(36)") |
|
||||
.HasColumnName("TenantId"); |
|
||||
|
|
||||
b.Property<Guid>("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<Guid>("Id") |
|
||||
.ValueGeneratedOnAdd() |
|
||||
.HasColumnType("char(36)"); |
|
||||
|
|
||||
b.Property<DateTime?>("CompleteTime") |
|
||||
.HasColumnType("datetime(6)"); |
|
||||
|
|
||||
b.Property<string>("ConcurrencyStamp") |
|
||||
.IsConcurrencyToken() |
|
||||
.HasMaxLength(40) |
|
||||
.HasColumnType("varchar(40)") |
|
||||
.HasColumnName("ConcurrencyStamp"); |
|
||||
|
|
||||
b.Property<DateTime>("CreationTime") |
|
||||
.HasColumnType("datetime(6)") |
|
||||
.HasColumnName("CreationTime"); |
|
||||
|
|
||||
b.Property<Guid?>("CreatorId") |
|
||||
.HasColumnType("char(36)") |
|
||||
.HasColumnName("CreatorId"); |
|
||||
|
|
||||
b.Property<string>("Data") |
|
||||
.HasColumnType("longtext"); |
|
||||
|
|
||||
b.Property<string>("Description") |
|
||||
.HasMaxLength(500) |
|
||||
.HasColumnType("varchar(500)"); |
|
||||
|
|
||||
b.Property<string>("ExtraProperties") |
|
||||
.HasColumnType("longtext") |
|
||||
.HasColumnName("ExtraProperties"); |
|
||||
|
|
||||
b.Property<DateTime?>("LastModificationTime") |
|
||||
.HasColumnType("datetime(6)") |
|
||||
.HasColumnName("LastModificationTime"); |
|
||||
|
|
||||
b.Property<Guid?>("LastModifierId") |
|
||||
.HasColumnType("char(36)") |
|
||||
.HasColumnName("LastModifierId"); |
|
||||
|
|
||||
b.Property<long?>("NextExecution") |
|
||||
.HasColumnType("bigint"); |
|
||||
|
|
||||
b.Property<string>("Reference") |
|
||||
.HasMaxLength(200) |
|
||||
.HasColumnType("varchar(200)"); |
|
||||
|
|
||||
b.Property<int>("Status") |
|
||||
.HasColumnType("int"); |
|
||||
|
|
||||
b.Property<Guid?>("TenantId") |
|
||||
.HasColumnType("char(36)") |
|
||||
.HasColumnName("TenantId"); |
|
||||
|
|
||||
b.Property<int>("Version") |
|
||||
.HasColumnType("int"); |
|
||||
|
|
||||
b.Property<string>("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<Guid>("Id") |
|
||||
.ValueGeneratedOnAdd() |
|
||||
.HasColumnType("char(36)"); |
|
||||
|
|
||||
b.Property<string>("CancelCondition") |
|
||||
.HasMaxLength(200) |
|
||||
.HasColumnType("varchar(200)"); |
|
||||
|
|
||||
b.Property<int?>("ErrorBehavior") |
|
||||
.HasColumnType("int"); |
|
||||
|
|
||||
b.Property<string>("Inputs") |
|
||||
.HasColumnType("longtext"); |
|
||||
|
|
||||
b.Property<string>("Name") |
|
||||
.HasMaxLength(100) |
|
||||
.HasColumnType("varchar(100)"); |
|
||||
|
|
||||
b.Property<string>("Outputs") |
|
||||
.HasColumnType("longtext"); |
|
||||
|
|
||||
b.Property<Guid?>("ParentId") |
|
||||
.HasColumnType("char(36)"); |
|
||||
|
|
||||
b.Property<TimeSpan?>("RetryInterval") |
|
||||
.HasColumnType("time(6)"); |
|
||||
|
|
||||
b.Property<bool>("Saga") |
|
||||
.HasColumnType("tinyint(1)"); |
|
||||
|
|
||||
b.Property<string>("SelectNextStep") |
|
||||
.HasColumnType("longtext"); |
|
||||
|
|
||||
b.Property<string>("StepType") |
|
||||
.HasMaxLength(100) |
|
||||
.HasColumnType("varchar(100)"); |
|
||||
|
|
||||
b.Property<Guid?>("TenantId") |
|
||||
.HasColumnType("char(36)") |
|
||||
.HasColumnName("TenantId"); |
|
||||
|
|
||||
b.Property<Guid>("WorkflowId") |
|
||||
.HasColumnType("char(36)"); |
|
||||
|
|
||||
b.HasKey("Id"); |
|
||||
|
|
||||
b.ToTable("WF_Compensate", (string)null); |
|
||||
}); |
|
||||
|
|
||||
modelBuilder.Entity("LINGYUN.Abp.WorkflowManagement.StepNode", b => |
|
||||
{ |
|
||||
b.Property<Guid>("Id") |
|
||||
.ValueGeneratedOnAdd() |
|
||||
.HasColumnType("char(36)"); |
|
||||
|
|
||||
b.Property<string>("CancelCondition") |
|
||||
.HasMaxLength(200) |
|
||||
.HasColumnType("varchar(200)"); |
|
||||
|
|
||||
b.Property<int?>("ErrorBehavior") |
|
||||
.HasColumnType("int"); |
|
||||
|
|
||||
b.Property<string>("Inputs") |
|
||||
.HasColumnType("longtext"); |
|
||||
|
|
||||
b.Property<string>("Name") |
|
||||
.HasMaxLength(100) |
|
||||
.HasColumnType("varchar(100)"); |
|
||||
|
|
||||
b.Property<string>("Outputs") |
|
||||
.HasColumnType("longtext"); |
|
||||
|
|
||||
b.Property<Guid?>("ParentId") |
|
||||
.HasColumnType("char(36)"); |
|
||||
|
|
||||
b.Property<TimeSpan?>("RetryInterval") |
|
||||
.HasColumnType("time(6)"); |
|
||||
|
|
||||
b.Property<bool>("Saga") |
|
||||
.HasColumnType("tinyint(1)"); |
|
||||
|
|
||||
b.Property<string>("SelectNextStep") |
|
||||
.HasColumnType("longtext"); |
|
||||
|
|
||||
b.Property<string>("StepType") |
|
||||
.HasMaxLength(100) |
|
||||
.HasColumnType("varchar(100)"); |
|
||||
|
|
||||
b.Property<Guid?>("TenantId") |
|
||||
.HasColumnType("char(36)") |
|
||||
.HasColumnName("TenantId"); |
|
||||
|
|
||||
b.Property<Guid>("WorkflowId") |
|
||||
.HasColumnType("char(36)"); |
|
||||
|
|
||||
b.HasKey("Id"); |
|
||||
|
|
||||
b.ToTable("WF_Step", (string)null); |
|
||||
}); |
|
||||
|
|
||||
modelBuilder.Entity("LINGYUN.Abp.WorkflowManagement.Workflow", b => |
|
||||
{ |
|
||||
b.Property<Guid>("Id") |
|
||||
.ValueGeneratedOnAdd() |
|
||||
.HasColumnType("char(36)"); |
|
||||
|
|
||||
b.Property<string>("ConcurrencyStamp") |
|
||||
.IsConcurrencyToken() |
|
||||
.HasMaxLength(40) |
|
||||
.HasColumnType("varchar(40)") |
|
||||
.HasColumnName("ConcurrencyStamp"); |
|
||||
|
|
||||
b.Property<DateTime>("CreationTime") |
|
||||
.HasColumnType("datetime(6)") |
|
||||
.HasColumnName("CreationTime"); |
|
||||
|
|
||||
b.Property<Guid?>("CreatorId") |
|
||||
.HasColumnType("char(36)") |
|
||||
.HasColumnName("CreatorId"); |
|
||||
|
|
||||
b.Property<string>("Description") |
|
||||
.HasMaxLength(200) |
|
||||
.HasColumnType("varchar(200)"); |
|
||||
|
|
||||
b.Property<string>("DisplayName") |
|
||||
.HasMaxLength(200) |
|
||||
.HasColumnType("varchar(200)"); |
|
||||
|
|
||||
b.Property<int>("ErrorBehavior") |
|
||||
.HasColumnType("int"); |
|
||||
|
|
||||
b.Property<TimeSpan?>("ErrorRetryInterval") |
|
||||
.HasColumnType("time(6)"); |
|
||||
|
|
||||
b.Property<string>("ExtraProperties") |
|
||||
.HasColumnType("longtext") |
|
||||
.HasColumnName("ExtraProperties"); |
|
||||
|
|
||||
b.Property<bool>("IsEnabled") |
|
||||
.HasColumnType("tinyint(1)"); |
|
||||
|
|
||||
b.Property<DateTime?>("LastModificationTime") |
|
||||
.HasColumnType("datetime(6)") |
|
||||
.HasColumnName("LastModificationTime"); |
|
||||
|
|
||||
b.Property<Guid?>("LastModifierId") |
|
||||
.HasColumnType("char(36)") |
|
||||
.HasColumnName("LastModifierId"); |
|
||||
|
|
||||
b.Property<string>("Name") |
|
||||
.IsRequired() |
|
||||
.HasMaxLength(100) |
|
||||
.HasColumnType("varchar(100)"); |
|
||||
|
|
||||
b.Property<Guid?>("TenantId") |
|
||||
.HasColumnType("char(36)") |
|
||||
.HasColumnName("TenantId"); |
|
||||
|
|
||||
b.Property<int>("Version") |
|
||||
.HasColumnType("int"); |
|
||||
|
|
||||
b.HasKey("Id"); |
|
||||
|
|
||||
b.ToTable("WF_Definition", (string)null); |
|
||||
}); |
|
||||
|
|
||||
modelBuilder.Entity("LINGYUN.Abp.WorkflowManagement.WorkflowData", b => |
|
||||
{ |
|
||||
b.Property<Guid>("Id") |
|
||||
.ValueGeneratedOnAdd() |
|
||||
.HasColumnType("char(36)"); |
|
||||
|
|
||||
b.Property<int>("DataType") |
|
||||
.HasColumnType("int"); |
|
||||
|
|
||||
b.Property<string>("DisplayName") |
|
||||
.IsRequired() |
|
||||
.HasMaxLength(100) |
|
||||
.HasColumnType("varchar(100)"); |
|
||||
|
|
||||
b.Property<bool>("IsCaseSensitive") |
|
||||
.HasColumnType("tinyint(1)"); |
|
||||
|
|
||||
b.Property<bool>("IsRequired") |
|
||||
.HasColumnType("tinyint(1)"); |
|
||||
|
|
||||
b.Property<string>("Name") |
|
||||
.IsRequired() |
|
||||
.HasMaxLength(100) |
|
||||
.HasColumnType("varchar(100)"); |
|
||||
|
|
||||
b.Property<Guid?>("TenantId") |
|
||||
.HasColumnType("char(36)") |
|
||||
.HasColumnName("TenantId"); |
|
||||
|
|
||||
b.Property<Guid>("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
|
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
Loading…
Reference in new issue