committed by
GitHub
1409 changed files with 82719 additions and 78285 deletions
@ -0,0 +1,6 @@ |
|||
**/.git |
|||
**/.vs |
|||
**/bin |
|||
**/obj |
|||
**/node_modules |
|||
*.user |
|||
@ -1,13 +0,0 @@ |
|||
@echo off |
|||
cls |
|||
|
|||
call .\migrate-db-cmd.bat LY.MicroService.Platform.EntityFrameworkCore platform --ef-u |
|||
call .\migrate-db-cmd.bat LY.MicroService.BackendAdmin.EntityFrameworkCore admin --ef-u |
|||
call .\migrate-db-cmd.bat LY.MicroService.AuthServer.EntityFrameworkCore auth-server --ef-u |
|||
call .\migrate-db-cmd.bat LY.MicroService.IdentityServer.EntityFrameworkCore identityserver4-admin --ef-u |
|||
call .\migrate-db-cmd.bat LY.MicroService.LocalizationManagement.EntityFrameworkCore localization --ef-u |
|||
call .\migrate-db-cmd.bat LY.MicroService.RealtimeMessage.EntityFrameworkCore messages --ef-u |
|||
call .\migrate-db-cmd.bat LY.MicroService.TaskManagement.EntityFrameworkCore task-management --ef-u |
|||
call .\migrate-db-cmd.bat LY.MicroService.WebhooksManagement.EntityFrameworkCore webhooks-management --ef-u |
|||
|
|||
taskkill /IM dotnet.exe /F |
|||
@ -0,0 +1,18 @@ |
|||
@echo off |
|||
setlocal enabledelayedexpansion |
|||
|
|||
cls |
|||
echo Deleting all BIN and OBJ folders... |
|||
|
|||
for /f "delims=" %%D in ('dir /s /b /ad bin obj 2^>nul') do ( |
|||
echo %%D | findstr /i "\\node_modules\\" >nul |
|||
if errorlevel 1 ( |
|||
echo Deleting: %%D |
|||
rd /s /q "%%D" |
|||
) else ( |
|||
echo Skipping: %%D |
|||
) |
|||
) |
|||
|
|||
echo BIN and OBJ folders have been successfully deleted. |
|||
endlocal |
|||
@ -1,20 +0,0 @@ |
|||
Set-Location ".\migrations\LY.MicroService.BackendAdmin.EntityFrameworkCore" |
|||
dotnet ef database update |
|||
|
|||
Set-Location "..\LY.MicroService.Platform.EntityFrameworkCore" |
|||
dotnet ef database update |
|||
|
|||
Set-Location "..\LY.MicroService.LocalizationManagement.EntityFrameworkCore" |
|||
dotnet ef database update |
|||
|
|||
Set-Location "..\LY.MicroService.RealtimeMessage.EntityFrameworkCore" |
|||
dotnet ef database update |
|||
|
|||
Set-Location "..\LY.MicroService.IdentityServer.EntityFrameworkCore" |
|||
dotnet ef database update |
|||
|
|||
Set-Location "..\LY.MicroService.TaskManagement.EntityFrameworkCore" |
|||
dotnet ef database update |
|||
|
|||
Set-Location "..\LY.MicroService.AuthServer.EntityFrameworkCore" |
|||
dotnet ef database update |
|||
@ -0,0 +1,25 @@ |
|||
using System; |
|||
|
|||
namespace Volo.Abp.Settings; |
|||
|
|||
[Serializable] |
|||
public class LocalizableValue<TValue> |
|||
{ |
|||
public string ResourceName { get; set; } = default!; |
|||
|
|||
public string Name { get; set; } = default!; |
|||
|
|||
public TValue Value { get; set; } = default!; |
|||
|
|||
public LocalizableValue() |
|||
{ |
|||
|
|||
} |
|||
|
|||
public LocalizableValue(string resourceName, string name, TValue value) |
|||
{ |
|||
ResourceName = resourceName; |
|||
Name = name; |
|||
Value = value; |
|||
} |
|||
} |
|||
@ -1,12 +0,0 @@ |
|||
@echo off |
|||
cls |
|||
|
|||
call .\migrate-db-cmd.bat LY.MicroService.AuthServer.DbMigrator auth-server --run |
|||
call .\migrate-db-cmd.bat LY.MicroService.Platform.DbMigrator platform --run |
|||
call .\migrate-db-cmd.bat LY.MicroService.LocalizationManagement.DbMigrator localization --run |
|||
call .\migrate-db-cmd.bat LY.MicroService.RealtimeMessage.DbMigrator messages --run |
|||
call .\migrate-db-cmd.bat LY.MicroService.TaskManagement.DbMigrator task-management --run |
|||
call .\migrate-db-cmd.bat LY.MicroService.WebhooksManagement.DbMigrator webhooks-management --run |
|||
call .\migrate-db-cmd.bat LY.MicroService.BackendAdmin.DbMigrator admin --run |
|||
|
|||
taskkill /IM dotnet.exe /F |
|||
@ -1,31 +0,0 @@ |
|||
@echo off |
|||
chcp 65001 |
|||
|
|||
title %2 |
|||
|
|||
@echo %2 migrating |
|||
|
|||
cd .\migrations\%1 |
|||
|
|||
if '%3' equ '--run' goto run |
|||
if '%3' equ '--restore' goto restore |
|||
if '%3' equ '--ef-u' goto efu |
|||
if '%3' equ '' goto run |
|||
exit |
|||
|
|||
:run |
|||
start cmd.exe /c dotnet run --no-build |
|||
goto end |
|||
|
|||
:restore |
|||
dotnet restore |
|||
goto end |
|||
|
|||
:efu |
|||
dotnet ef database update |
|||
goto end |
|||
|
|||
:end |
|||
cd ..\..\ |
|||
@echo %2 migrated |
|||
@echo -------- |
|||
@ -0,0 +1,54 @@ |
|||
using LINGYUN.Abp.MicroService.AIService.EntityFrameworkCore; |
|||
using Microsoft.Extensions.Configuration; |
|||
using Microsoft.Extensions.DependencyInjection; |
|||
using Microsoft.Extensions.Hosting; |
|||
using Serilog; |
|||
using System.Threading; |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp; |
|||
using Volo.Abp.Data; |
|||
|
|||
namespace LINGYUN.Abp.MicroService.AIService.DbMigrator; |
|||
|
|||
public class AIServiceDbMigratorHostedService : IHostedService |
|||
{ |
|||
private readonly IHostApplicationLifetime _hostApplicationLifetime; |
|||
private readonly IConfiguration _configuration; |
|||
|
|||
public AIServiceDbMigratorHostedService( |
|||
IHostApplicationLifetime hostApplicationLifetime, |
|||
IConfiguration configuration) |
|||
{ |
|||
_hostApplicationLifetime = hostApplicationLifetime; |
|||
_configuration = configuration; |
|||
} |
|||
|
|||
public async Task StartAsync(CancellationToken cancellationToken) |
|||
{ |
|||
using var application = await AbpApplicationFactory |
|||
.CreateAsync<AIServiceDbMigratorModule>(options => |
|||
{ |
|||
options.Services.ReplaceConfiguration(_configuration); |
|||
options.UseAutofac(); |
|||
options.Services.AddLogging(c => c.AddSerilog()); |
|||
options.AddDataMigrationEnvironment(); |
|||
}); |
|||
|
|||
await application.InitializeAsync(); |
|||
|
|||
await application |
|||
.ServiceProvider |
|||
.GetRequiredService<AIServiceDbMigrationService>() |
|||
.CheckAndApplyDatabaseMigrationsAsync(); |
|||
|
|||
await application.ShutdownAsync(); |
|||
|
|||
_hostApplicationLifetime.StopApplication(); |
|||
} |
|||
|
|||
public Task StopAsync(CancellationToken cancellationToken) |
|||
{ |
|||
return Task.CompletedTask; |
|||
} |
|||
} |
|||
|
|||
@ -0,0 +1,14 @@ |
|||
using LINGYUN.Abp.MicroService.AIService.EntityFrameworkCore; |
|||
using Volo.Abp.Autofac; |
|||
using Volo.Abp.Modularity; |
|||
|
|||
namespace LINGYUN.Abp.MicroService.AIService.DbMigrator; |
|||
|
|||
[DependsOn( |
|||
typeof(AbpAutofacModule), |
|||
typeof(AIServiceMigrationsEntityFrameworkCoreModule) |
|||
)] |
|||
public class AIServiceDbMigratorModule : AbpModule |
|||
{ |
|||
|
|||
} |
|||
@ -0,0 +1,32 @@ |
|||
<Project Sdk="Microsoft.NET.Sdk"> |
|||
|
|||
<Import Project="..\..\..\common.secrets.props" /> |
|||
|
|||
<PropertyGroup> |
|||
<OutputType>Exe</OutputType> |
|||
<TargetFramework>net10.0</TargetFramework> |
|||
<Nullable>enable</Nullable> |
|||
<IsPackable>false</IsPackable> |
|||
</PropertyGroup> |
|||
|
|||
<ItemGroup> |
|||
<PackageReference Include="Serilog.Extensions.Logging" /> |
|||
<PackageReference Include="Serilog.Sinks.Async" /> |
|||
<PackageReference Include="Serilog.Sinks.File" /> |
|||
<PackageReference Include="Serilog.Sinks.Console" /> |
|||
<PackageReference Include="Microsoft.Extensions.Hosting" /> |
|||
<PackageReference Include="Volo.Abp.Autofac" /> |
|||
</ItemGroup> |
|||
|
|||
<ItemGroup> |
|||
<Compile Remove="Logs\**" /> |
|||
<Content Remove="Logs\**" /> |
|||
<EmbeddedResource Remove="Logs\**" /> |
|||
<None Remove="Logs\**" /> |
|||
</ItemGroup> |
|||
|
|||
<ItemGroup> |
|||
<ProjectReference Include="..\LINGYUN.Abp.MicroService.AIService.EntityFrameworkCore\LINGYUN.Abp.MicroService.AIService.EntityFrameworkCore.csproj" /> |
|||
</ItemGroup> |
|||
|
|||
</Project> |
|||
@ -0,0 +1,43 @@ |
|||
using LINGYUN.Abp.MicroService.AIService.DbMigrator; |
|||
using Microsoft.Extensions.DependencyInjection; |
|||
using Microsoft.Extensions.Hosting; |
|||
using Microsoft.Extensions.Logging; |
|||
using Serilog; |
|||
using Serilog.Events; |
|||
using System; |
|||
|
|||
var defaultOutputTemplate = "{Timestamp:yyyy-MM-dd HH:mm:ss} [{Level:u3}] [{SourceContext}] [{ProcessId}] [{ThreadId}] - {Message:lj}{NewLine}{Exception}"; |
|||
|
|||
Log.Logger = new LoggerConfiguration() |
|||
.MinimumLevel.Information() |
|||
.MinimumLevel.Override("Microsoft", LogEventLevel.Warning) |
|||
.MinimumLevel.Override("Volo.Abp", LogEventLevel.Warning) |
|||
#if DEBUG
|
|||
.MinimumLevel.Override("LINGYUN.Abp.MicroService.AIService", LogEventLevel.Debug) |
|||
#else
|
|||
.MinimumLevel.Override("LINGYUN.Abp.MicroService.AIService", LogEventLevel.Information) |
|||
#endif
|
|||
.Enrich.FromLogContext() |
|||
.WriteTo.Async(x => x.Console(outputTemplate: defaultOutputTemplate)) |
|||
.WriteTo.Async(x => x.File("Logs/migrations.txt", outputTemplate: defaultOutputTemplate)) |
|||
.CreateLogger(); |
|||
|
|||
try |
|||
{ |
|||
var builder = Host.CreateDefaultBuilder(args) |
|||
.AddAppSettingsSecretsJson() |
|||
.ConfigureLogging((context, logging) => logging.ClearProviders()) |
|||
.ConfigureServices((hostContext, services) => |
|||
{ |
|||
services.AddHostedService<AIServiceDbMigratorHostedService>(); |
|||
}); |
|||
await builder.RunConsoleAsync(); |
|||
} |
|||
catch (Exception ex) |
|||
{ |
|||
Log.Fatal(ex, "Host terminated unexpectedly!"); |
|||
} |
|||
finally |
|||
{ |
|||
await Log.CloseAndFlushAsync(); |
|||
} |
|||
@ -0,0 +1,75 @@ |
|||
{ |
|||
"ConnectionStrings": { |
|||
"Default": "Server=localhost;Database=abp;User Id=root;Password=123456;SslMode=None" |
|||
}, |
|||
"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}" |
|||
} |
|||
} |
|||
] |
|||
} |
|||
} |
|||
@ -0,0 +1,27 @@ |
|||
using Microsoft.Extensions.Logging; |
|||
using Microsoft.Extensions.Logging.Abstractions; |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp.Data; |
|||
using Volo.Abp.DependencyInjection; |
|||
using Volo.Abp.MultiTenancy; |
|||
|
|||
namespace LINGYUN.Abp.MicroService.AIService.EntityFrameworkCore; |
|||
|
|||
public class AIServiceDataSeeder : ITransientDependency |
|||
{ |
|||
protected ILogger<AIServiceDataSeeder> Logger { get; } |
|||
protected ICurrentTenant CurrentTenant { get; } |
|||
|
|||
public AIServiceDataSeeder( |
|||
ICurrentTenant currentTenant) |
|||
{ |
|||
CurrentTenant = currentTenant; |
|||
|
|||
Logger = NullLogger<AIServiceDataSeeder>.Instance; |
|||
} |
|||
|
|||
public virtual Task SeedAsync(DataSeedContext context) |
|||
{ |
|||
return Task.CompletedTask; |
|||
} |
|||
} |
|||
@ -0,0 +1,45 @@ |
|||
using Microsoft.Extensions.Logging; |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp.Data; |
|||
using Volo.Abp.DistributedLocking; |
|||
using Volo.Abp.EntityFrameworkCore.Migrations; |
|||
using Volo.Abp.EventBus.Distributed; |
|||
using Volo.Abp.MultiTenancy; |
|||
using Volo.Abp.Uow; |
|||
|
|||
namespace LINGYUN.Abp.MicroService.AIService.EntityFrameworkCore; |
|||
|
|||
public class AIServiceDbMigrationEventHandler : EfCoreDatabaseMigrationEventHandlerBase<AIServiceMigrationsDbContext> |
|||
{ |
|||
protected AIServiceDataSeeder DataSeeder { get; } |
|||
|
|||
public AIServiceDbMigrationEventHandler( |
|||
ICurrentTenant currentTenant, |
|||
IUnitOfWorkManager unitOfWorkManager, |
|||
ITenantStore tenantStore, |
|||
IAbpDistributedLock abpDistributedLock, |
|||
IDistributedEventBus distributedEventBus, |
|||
ILoggerFactory loggerFactory, |
|||
AIServiceDataSeeder dataSeeder) |
|||
: base( |
|||
ConnectionStringNameAttribute.GetConnStringName<AIServiceMigrationsDbContext>(), |
|||
currentTenant, unitOfWorkManager, tenantStore, abpDistributedLock, distributedEventBus, loggerFactory) |
|||
{ |
|||
DataSeeder = dataSeeder; |
|||
} |
|||
|
|||
protected async override Task AfterTenantCreated(TenantCreatedEto eventData, bool schemaMigrated) |
|||
{ |
|||
// 新租户数据种子
|
|||
var context = new DataSeedContext(eventData.Id); |
|||
if (eventData.Properties != null) |
|||
{ |
|||
foreach (var property in eventData.Properties) |
|||
{ |
|||
context.WithProperty(property.Key, property.Value); |
|||
} |
|||
} |
|||
|
|||
await DataSeeder.SeedAsync(context); |
|||
} |
|||
} |
|||
@ -0,0 +1,37 @@ |
|||
using LINGYUN.Abp.Data.DbMigrator; |
|||
using Microsoft.Extensions.Logging; |
|||
using System; |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp.Data; |
|||
using Volo.Abp.DependencyInjection; |
|||
using Volo.Abp.DistributedLocking; |
|||
using Volo.Abp.EventBus.Distributed; |
|||
using Volo.Abp.MultiTenancy; |
|||
using Volo.Abp.Uow; |
|||
|
|||
namespace LINGYUN.Abp.MicroService.AIService.EntityFrameworkCore; |
|||
|
|||
public class AIServiceDbMigrationService : EfCoreRuntimeDbMigratorBase<AIServiceMigrationsDbContext>, ITransientDependency |
|||
{ |
|||
protected AIServiceDataSeeder DataSeeder { get; } |
|||
public AIServiceDbMigrationService( |
|||
ICurrentTenant currentTenant, |
|||
IUnitOfWorkManager unitOfWorkManager, |
|||
IServiceProvider serviceProvider, |
|||
IAbpDistributedLock abpDistributedLock, |
|||
IDistributedEventBus distributedEventBus, |
|||
ILoggerFactory loggerFactory, |
|||
AIServiceDataSeeder dataSeeder) |
|||
: base( |
|||
ConnectionStringNameAttribute.GetConnStringName<AIServiceMigrationsDbContext>(), |
|||
unitOfWorkManager, serviceProvider, currentTenant, abpDistributedLock, distributedEventBus, loggerFactory) |
|||
{ |
|||
DataSeeder = dataSeeder; |
|||
} |
|||
|
|||
protected async override Task SeedAsync() |
|||
{ |
|||
// DbMigrator迁移数据种子
|
|||
await DataSeeder.SeedAsync(new DataSeedContext()); |
|||
} |
|||
} |
|||
@ -0,0 +1,35 @@ |
|||
using LINGYUN.Abp.AIManagement.Chats; |
|||
using LINGYUN.Abp.AIManagement.EntityFrameworkCore; |
|||
using LINGYUN.Abp.AIManagement.Tokens; |
|||
using LINGYUN.Abp.AIManagement.Tools; |
|||
using LINGYUN.Abp.AIManagement.Workspaces; |
|||
using Microsoft.EntityFrameworkCore; |
|||
using Volo.Abp.Data; |
|||
using Volo.Abp.EntityFrameworkCore; |
|||
|
|||
namespace LINGYUN.Abp.MicroService.AIService.EntityFrameworkCore; |
|||
|
|||
[ConnectionStringName("AIServiceDbMigrator")] |
|||
public class AIServiceMigrationsDbContext : |
|||
AbpDbContext<AIServiceMigrationsDbContext>, |
|||
IAIManagementDbContext |
|||
{ |
|||
public DbSet<WorkspaceDefinitionRecord> WorkspaceDefinitions { get; set; } |
|||
public DbSet<AIToolDefinitionRecord> AIToolDefinitions { get; set; } |
|||
public DbSet<TextChatMessageRecord> TextChatMessageRecords { get; set; } |
|||
public DbSet<ConversationRecord> ConversationRecords { get; set; } |
|||
public DbSet<TokenUsageRecord> TokenUsageRecords { get; set; } |
|||
|
|||
public AIServiceMigrationsDbContext( |
|||
DbContextOptions<AIServiceMigrationsDbContext> options) : base(options) |
|||
{ |
|||
} |
|||
|
|||
protected override void OnModelCreating(ModelBuilder builder) |
|||
{ |
|||
base.OnModelCreating(builder); |
|||
|
|||
builder.ConfigureAIManagement(); |
|||
} |
|||
} |
|||
|
|||
@ -0,0 +1,29 @@ |
|||
using Microsoft.EntityFrameworkCore; |
|||
using Microsoft.EntityFrameworkCore.Design; |
|||
using Microsoft.Extensions.Configuration; |
|||
using System.IO; |
|||
|
|||
namespace LINGYUN.Abp.MicroService.AIService.EntityFrameworkCore; |
|||
|
|||
public class AIServiceMigrationsDbContextFactory : IDesignTimeDbContextFactory<AIServiceMigrationsDbContext> |
|||
{ |
|||
public AIServiceMigrationsDbContext CreateDbContext(string[] args) |
|||
{ |
|||
var configuration = BuildConfiguration(); |
|||
var connectionString = configuration.GetConnectionString("Default"); |
|||
|
|||
var builder = new DbContextOptionsBuilder<AIServiceMigrationsDbContext>() |
|||
.UseMySql(connectionString, ServerVersion.AutoDetect(connectionString)); |
|||
|
|||
return new AIServiceMigrationsDbContext(builder!.Options); |
|||
} |
|||
|
|||
private static IConfigurationRoot BuildConfiguration() |
|||
{ |
|||
var builder = new ConfigurationBuilder() |
|||
.SetBasePath(Path.Combine(Directory.GetCurrentDirectory(), "../LINGYUN.Abp.MicroService.AIService.DbMigrator/")) |
|||
.AddJsonFile("appsettings.json", optional: false); |
|||
|
|||
return builder.Build(); |
|||
} |
|||
} |
|||
@ -0,0 +1,44 @@ |
|||
using LINGYUN.Abp.AIManagement.EntityFrameworkCore; |
|||
using LINGYUN.Abp.Data.DbMigrator; |
|||
using LINGYUN.Abp.EntityFrameworkCore.MySQL; |
|||
using LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore; |
|||
using LINGYUN.Abp.Saas.EntityFrameworkCore; |
|||
using LINGYUN.Abp.TextTemplating.EntityFrameworkCore; |
|||
using Microsoft.EntityFrameworkCore; |
|||
using Microsoft.Extensions.DependencyInjection; |
|||
using Volo.Abp.EntityFrameworkCore; |
|||
using Volo.Abp.FeatureManagement.EntityFrameworkCore; |
|||
using Volo.Abp.Modularity; |
|||
using Volo.Abp.PermissionManagement.EntityFrameworkCore; |
|||
using Volo.Abp.SettingManagement.EntityFrameworkCore; |
|||
|
|||
namespace LINGYUN.Abp.MicroService.AIService.EntityFrameworkCore; |
|||
|
|||
[DependsOn( |
|||
typeof(AbpAIManagementEntityFrameworkCoreModule), |
|||
typeof(AbpSaasEntityFrameworkCoreModule), |
|||
typeof(AbpSettingManagementEntityFrameworkCoreModule), |
|||
typeof(AbpPermissionManagementEntityFrameworkCoreModule), |
|||
typeof(AbpFeatureManagementEntityFrameworkCoreModule), |
|||
typeof(AbpLocalizationManagementEntityFrameworkCoreModule), |
|||
typeof(AbpTextTemplatingEntityFrameworkCoreModule), |
|||
typeof(AbpEntityFrameworkCoreMySQLMicrotingModule), |
|||
typeof(AbpDataDbMigratorModule) |
|||
)] |
|||
public class AIServiceMigrationsEntityFrameworkCoreModule : AbpModule |
|||
{ |
|||
public override void ConfigureServices(ServiceConfigurationContext context) |
|||
{ |
|||
context.Services.AddAbpDbContext<AIServiceMigrationsDbContext>(); |
|||
|
|||
Configure<AbpDbContextOptions>(options => |
|||
{ |
|||
options.UseMySQL( |
|||
mysql => |
|||
{ |
|||
// see: https://github.com/PomeloFoundation/Pomelo.EntityFrameworkCore.MySql/issues/1960
|
|||
mysql.UseParameterizedCollectionMode(ParameterTranslationMode.Constant); |
|||
}); |
|||
}); |
|||
} |
|||
} |
|||
@ -0,0 +1,30 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> |
|||
<!-- This file was generated by Fody. Manual changes to this file will be lost when your project is rebuilt. --> |
|||
<xs:element name="Weavers"> |
|||
<xs:complexType> |
|||
<xs:all> |
|||
<xs:element name="ConfigureAwait" minOccurs="0" maxOccurs="1"> |
|||
<xs:complexType> |
|||
<xs:attribute name="ContinueOnCapturedContext" type="xs:boolean" /> |
|||
</xs:complexType> |
|||
</xs:element> |
|||
</xs:all> |
|||
<xs:attribute name="VerifyAssembly" type="xs:boolean"> |
|||
<xs:annotation> |
|||
<xs:documentation>'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed.</xs:documentation> |
|||
</xs:annotation> |
|||
</xs:attribute> |
|||
<xs:attribute name="VerifyIgnoreCodes" type="xs:string"> |
|||
<xs:annotation> |
|||
<xs:documentation>A comma-separated list of error codes that can be safely ignored in assembly verification.</xs:documentation> |
|||
</xs:annotation> |
|||
</xs:attribute> |
|||
<xs:attribute name="GenerateXsd" type="xs:boolean"> |
|||
<xs:annotation> |
|||
<xs:documentation>'false' to turn off automatic generation of the XML Schema file.</xs:documentation> |
|||
</xs:annotation> |
|||
</xs:attribute> |
|||
</xs:complexType> |
|||
</xs:element> |
|||
</xs:schema> |
|||
@ -0,0 +1,34 @@ |
|||
<Project Sdk="Microsoft.NET.Sdk"> |
|||
|
|||
<Import Project="..\..\..\configureawait.props" /> |
|||
<Import Project="..\..\..\common.props" /> |
|||
|
|||
<PropertyGroup> |
|||
<IsPackable>false</IsPackable> |
|||
<TargetFramework>net10.0</TargetFramework> |
|||
<RootNamespace>LINGYUN.Abp.MicroService.AIService.EntityFrameworkCore</RootNamespace> |
|||
</PropertyGroup> |
|||
|
|||
<ItemGroup> |
|||
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools"> |
|||
<PrivateAssets>all</PrivateAssets> |
|||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> |
|||
</PackageReference> |
|||
<PackageReference Include="Volo.Abp.FeatureManagement.EntityFrameworkCore" /> |
|||
<PackageReference Include="Volo.Abp.SettingManagement.EntityFrameworkCore" /> |
|||
<PackageReference Include="Volo.Abp.PermissionManagement.EntityFrameworkCore" /> |
|||
</ItemGroup> |
|||
|
|||
<ItemGroup> |
|||
<ProjectReference Include="..\..\modules\ai\LINGYUN.Abp.AIManagement.EntityFrameworkCore\LINGYUN.Abp.AIManagement.EntityFrameworkCore.csproj" /> |
|||
</ItemGroup> |
|||
|
|||
<ItemGroup> |
|||
<ProjectReference Include="..\..\framework\common\LINGYUN.Abp.Data.DbMigrator\LINGYUN.Abp.Data.DbMigrator.csproj" /> |
|||
<ProjectReference Include="..\..\framework\efcore\LINGYUN.Abp.EntityFrameworkCore.MySQL.Microting\LINGYUN.Abp.EntityFrameworkCore.MySQL.Microting.csproj" /> |
|||
<ProjectReference Include="..\..\modules\saas\LINGYUN.Abp.Saas.EntityFrameworkCore\LINGYUN.Abp.Saas.EntityFrameworkCore.csproj" /> |
|||
<ProjectReference Include="..\..\modules\localization-management\LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore\LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore.csproj" /> |
|||
<ProjectReference Include="..\..\modules\text-templating\LINGYUN.Abp.TextTemplating.EntityFrameworkCore\LINGYUN.Abp.TextTemplating.EntityFrameworkCore.csproj" /> |
|||
</ItemGroup> |
|||
|
|||
</Project> |
|||
@ -0,0 +1,383 @@ |
|||
// <auto-generated />
|
|||
using System; |
|||
using LINGYUN.Abp.MicroService.AIService.EntityFrameworkCore; |
|||
using Microsoft.EntityFrameworkCore; |
|||
using Microsoft.EntityFrameworkCore.Infrastructure; |
|||
using Microsoft.EntityFrameworkCore.Metadata; |
|||
using Microsoft.EntityFrameworkCore.Migrations; |
|||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion; |
|||
using Volo.Abp.EntityFrameworkCore; |
|||
|
|||
#nullable disable |
|||
|
|||
namespace LINGYUN.Abp.MicroService.AIService.EntityFrameworkCore.Migrations |
|||
{ |
|||
[DbContext(typeof(AIServiceMigrationsDbContext))] |
|||
[Migration("20261007004411_Initial-AI-Service")] |
|||
partial class InitialAIService |
|||
{ |
|||
/// <inheritdoc />
|
|||
protected override void BuildTargetModel(ModelBuilder modelBuilder) |
|||
{ |
|||
#pragma warning disable 612, 618
|
|||
modelBuilder |
|||
.HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.MySql) |
|||
.HasAnnotation("ProductVersion", "10.0.9") |
|||
.HasAnnotation("Relational:MaxIdentifierLength", 64); |
|||
|
|||
MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.AIManagement.Chats.ConversationRecord", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<DateTime>("CreatedAt") |
|||
.HasColumnType("datetime(6)"); |
|||
|
|||
b.Property<DateTime>("CreationTime") |
|||
.HasColumnType("datetime(6)") |
|||
.HasColumnName("CreationTime"); |
|||
|
|||
b.Property<Guid?>("CreatorId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("CreatorId"); |
|||
|
|||
b.Property<DateTime>("ExpiredAt") |
|||
.HasColumnType("datetime(6)"); |
|||
|
|||
b.Property<DateTime?>("LastModificationTime") |
|||
.HasColumnType("datetime(6)") |
|||
.HasColumnName("LastModificationTime"); |
|||
|
|||
b.Property<Guid?>("LastModifierId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("LastModifierId"); |
|||
|
|||
b.Property<string>("Name") |
|||
.IsRequired() |
|||
.HasMaxLength(50) |
|||
.HasColumnType("varchar(50)"); |
|||
|
|||
b.Property<Guid?>("TenantId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("TenantId"); |
|||
|
|||
b.Property<DateTime?>("UpdateAt") |
|||
.HasColumnType("datetime(6)"); |
|||
|
|||
b.Property<string>("Workspace") |
|||
.IsRequired() |
|||
.HasMaxLength(64) |
|||
.HasColumnType("varchar(64)"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.ToTable("AbpAIConversations", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.AIManagement.Chats.TextChatMessageRecord", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("ConcurrencyStamp") |
|||
.IsConcurrencyToken() |
|||
.IsRequired() |
|||
.HasMaxLength(40) |
|||
.HasColumnType("varchar(40)") |
|||
.HasColumnName("ConcurrencyStamp"); |
|||
|
|||
b.Property<string>("Content") |
|||
.IsRequired() |
|||
.HasMaxLength(1024) |
|||
.HasColumnType("varchar(1024)"); |
|||
|
|||
b.Property<Guid?>("ConversationId") |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<DateTime>("CreatedAt") |
|||
.HasColumnType("datetime(6)"); |
|||
|
|||
b.Property<DateTime>("CreationTime") |
|||
.HasColumnType("datetime(6)") |
|||
.HasColumnName("CreationTime"); |
|||
|
|||
b.Property<Guid?>("CreatorId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("CreatorId"); |
|||
|
|||
b.Property<string>("ExtraProperties") |
|||
.IsRequired() |
|||
.HasColumnType("longtext") |
|||
.HasColumnName("ExtraProperties"); |
|||
|
|||
b.Property<DateTime?>("LastModificationTime") |
|||
.HasColumnType("datetime(6)") |
|||
.HasColumnName("LastModificationTime"); |
|||
|
|||
b.Property<Guid?>("LastModifierId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("LastModifierId"); |
|||
|
|||
b.Property<DateTime?>("ReplyAt") |
|||
.HasColumnType("datetime(6)"); |
|||
|
|||
b.Property<string>("ReplyMessage") |
|||
.HasColumnType("longtext"); |
|||
|
|||
b.Property<string>("Role") |
|||
.IsRequired() |
|||
.HasMaxLength(20) |
|||
.HasColumnType("varchar(20)"); |
|||
|
|||
b.Property<Guid?>("TenantId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("TenantId"); |
|||
|
|||
b.Property<Guid?>("UserId") |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("Workspace") |
|||
.IsRequired() |
|||
.HasMaxLength(64) |
|||
.HasColumnType("varchar(64)"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("TenantId", "ConversationId"); |
|||
|
|||
b.ToTable("AbpAITextChatMessages", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.AIManagement.Tokens.TokenUsageRecord", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<long?>("CachedInputTokenCount") |
|||
.HasColumnType("bigint"); |
|||
|
|||
b.Property<Guid?>("ConversationId") |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<DateTime>("CreationTime") |
|||
.HasColumnType("datetime(6)") |
|||
.HasColumnName("CreationTime"); |
|||
|
|||
b.Property<Guid?>("CreatorId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("CreatorId"); |
|||
|
|||
b.Property<long?>("InputTokenCount") |
|||
.HasColumnType("bigint"); |
|||
|
|||
b.Property<DateTime?>("LastModificationTime") |
|||
.HasColumnType("datetime(6)") |
|||
.HasColumnName("LastModificationTime"); |
|||
|
|||
b.Property<Guid?>("LastModifierId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("LastModifierId"); |
|||
|
|||
b.Property<Guid?>("MessageId") |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<long?>("OutputTokenCount") |
|||
.HasColumnType("bigint"); |
|||
|
|||
b.Property<long?>("ReasoningTokenCount") |
|||
.HasColumnType("bigint"); |
|||
|
|||
b.Property<Guid?>("TenantId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("TenantId"); |
|||
|
|||
b.Property<long?>("TotalTokenCount") |
|||
.HasColumnType("bigint"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("TenantId", "ConversationId"); |
|||
|
|||
b.ToTable("AbpAITokenUsages", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.AIManagement.Tools.AIToolDefinitionRecord", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("ConcurrencyStamp") |
|||
.IsConcurrencyToken() |
|||
.IsRequired() |
|||
.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(1024) |
|||
.HasColumnType("varchar(1024)"); |
|||
|
|||
b.Property<string>("ExtraProperties") |
|||
.IsRequired() |
|||
.HasColumnType("longtext") |
|||
.HasColumnName("ExtraProperties"); |
|||
|
|||
b.Property<bool>("IsEnabled") |
|||
.HasColumnType("tinyint(1)"); |
|||
|
|||
b.Property<bool>("IsGlobal") |
|||
.HasColumnType("tinyint(1)"); |
|||
|
|||
b.Property<bool>("IsSystem") |
|||
.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(64) |
|||
.HasColumnType("varchar(64)"); |
|||
|
|||
b.Property<string>("Provider") |
|||
.IsRequired() |
|||
.HasMaxLength(20) |
|||
.HasColumnType("varchar(20)"); |
|||
|
|||
b.Property<string>("StateCheckers") |
|||
.HasMaxLength(256) |
|||
.HasColumnType("varchar(256)"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("Name") |
|||
.IsUnique(); |
|||
|
|||
b.ToTable("AbpAIAIToolDefinitionRecords", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.AIManagement.Workspaces.WorkspaceDefinitionRecord", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("ApiBaseUrl") |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.Property<string>("ApiKey") |
|||
.HasMaxLength(64) |
|||
.HasColumnType("varchar(64)"); |
|||
|
|||
b.Property<string>("ConcurrencyStamp") |
|||
.IsConcurrencyToken() |
|||
.IsRequired() |
|||
.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(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.Property<string>("DisplayName") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.Property<string>("ExtraProperties") |
|||
.IsRequired() |
|||
.HasColumnType("longtext") |
|||
.HasColumnName("ExtraProperties"); |
|||
|
|||
b.Property<float?>("FrequencyPenalty") |
|||
.HasColumnType("float"); |
|||
|
|||
b.Property<string>("Instructions") |
|||
.HasMaxLength(512) |
|||
.HasColumnType("varchar(512)"); |
|||
|
|||
b.Property<bool>("IsEnabled") |
|||
.HasColumnType("tinyint(1)"); |
|||
|
|||
b.Property<bool>("IsSystem") |
|||
.HasColumnType("tinyint(1)"); |
|||
|
|||
b.Property<DateTime?>("LastModificationTime") |
|||
.HasColumnType("datetime(6)") |
|||
.HasColumnName("LastModificationTime"); |
|||
|
|||
b.Property<Guid?>("LastModifierId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("LastModifierId"); |
|||
|
|||
b.Property<int?>("MaxOutputTokens") |
|||
.HasColumnType("int"); |
|||
|
|||
b.Property<string>("ModelName") |
|||
.IsRequired() |
|||
.HasMaxLength(64) |
|||
.HasColumnType("varchar(64)"); |
|||
|
|||
b.Property<string>("Name") |
|||
.IsRequired() |
|||
.HasMaxLength(64) |
|||
.HasColumnType("varchar(64)"); |
|||
|
|||
b.Property<float?>("PresencePenalty") |
|||
.HasColumnType("float"); |
|||
|
|||
b.Property<string>("Provider") |
|||
.IsRequired() |
|||
.HasMaxLength(20) |
|||
.HasColumnType("varchar(20)"); |
|||
|
|||
b.Property<string>("StateCheckers") |
|||
.HasMaxLength(256) |
|||
.HasColumnType("varchar(256)"); |
|||
|
|||
b.Property<string>("SystemPrompt") |
|||
.HasMaxLength(512) |
|||
.HasColumnType("varchar(512)"); |
|||
|
|||
b.Property<float?>("Temperature") |
|||
.HasColumnType("float"); |
|||
|
|||
b.Property<string>("Tools") |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("Name") |
|||
.IsUnique(); |
|||
|
|||
b.ToTable("AbpAIWorkspaceDefinitions", (string)null); |
|||
}); |
|||
#pragma warning restore 612, 618
|
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,219 @@ |
|||
using System; |
|||
using Microsoft.EntityFrameworkCore.Migrations; |
|||
|
|||
#nullable disable |
|||
|
|||
namespace LINGYUN.Abp.MicroService.AIService.EntityFrameworkCore.Migrations |
|||
{ |
|||
/// <inheritdoc />
|
|||
public partial class InitialAIService : Migration |
|||
{ |
|||
/// <inheritdoc />
|
|||
protected override void Up(MigrationBuilder migrationBuilder) |
|||
{ |
|||
migrationBuilder.AlterDatabase() |
|||
.Annotation("MySql:CharSet", "utf8mb4"); |
|||
|
|||
migrationBuilder.CreateTable( |
|||
name: "AbpAIAIToolDefinitionRecords", |
|||
columns: table => new |
|||
{ |
|||
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"), |
|||
Name = table.Column<string>(type: "varchar(64)", maxLength: 64, nullable: false) |
|||
.Annotation("MySql:CharSet", "utf8mb4"), |
|||
Provider = table.Column<string>(type: "varchar(20)", maxLength: 20, nullable: false) |
|||
.Annotation("MySql:CharSet", "utf8mb4"), |
|||
Description = table.Column<string>(type: "varchar(1024)", maxLength: 1024, nullable: true) |
|||
.Annotation("MySql:CharSet", "utf8mb4"), |
|||
IsEnabled = table.Column<bool>(type: "tinyint(1)", nullable: false), |
|||
IsSystem = table.Column<bool>(type: "tinyint(1)", nullable: false), |
|||
IsGlobal = table.Column<bool>(type: "tinyint(1)", nullable: false), |
|||
StateCheckers = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: true) |
|||
.Annotation("MySql:CharSet", "utf8mb4"), |
|||
ExtraProperties = table.Column<string>(type: "longtext", nullable: false) |
|||
.Annotation("MySql:CharSet", "utf8mb4"), |
|||
ConcurrencyStamp = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: false) |
|||
.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_AbpAIAIToolDefinitionRecords", x => x.Id); |
|||
}) |
|||
.Annotation("MySql:CharSet", "utf8mb4"); |
|||
|
|||
migrationBuilder.CreateTable( |
|||
name: "AbpAIConversations", |
|||
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"), |
|||
Name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false) |
|||
.Annotation("MySql:CharSet", "utf8mb4"), |
|||
Workspace = table.Column<string>(type: "varchar(64)", maxLength: 64, nullable: false) |
|||
.Annotation("MySql:CharSet", "utf8mb4"), |
|||
CreatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false), |
|||
ExpiredAt = table.Column<DateTime>(type: "datetime(6)", nullable: false), |
|||
UpdateAt = table.Column<DateTime>(type: "datetime(6)", nullable: true), |
|||
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_AbpAIConversations", x => x.Id); |
|||
}) |
|||
.Annotation("MySql:CharSet", "utf8mb4"); |
|||
|
|||
migrationBuilder.CreateTable( |
|||
name: "AbpAITextChatMessages", |
|||
columns: table => new |
|||
{ |
|||
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"), |
|||
Content = table.Column<string>(type: "varchar(1024)", maxLength: 1024, nullable: false) |
|||
.Annotation("MySql:CharSet", "utf8mb4"), |
|||
ExtraProperties = table.Column<string>(type: "longtext", nullable: false) |
|||
.Annotation("MySql:CharSet", "utf8mb4"), |
|||
ConcurrencyStamp = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: false) |
|||
.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"), |
|||
TenantId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"), |
|||
Workspace = table.Column<string>(type: "varchar(64)", maxLength: 64, nullable: false) |
|||
.Annotation("MySql:CharSet", "utf8mb4"), |
|||
Role = table.Column<string>(type: "varchar(20)", maxLength: 20, nullable: false) |
|||
.Annotation("MySql:CharSet", "utf8mb4"), |
|||
CreatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false), |
|||
UserId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"), |
|||
ConversationId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"), |
|||
ReplyMessage = table.Column<string>(type: "longtext", nullable: true) |
|||
.Annotation("MySql:CharSet", "utf8mb4"), |
|||
ReplyAt = table.Column<DateTime>(type: "datetime(6)", nullable: true) |
|||
}, |
|||
constraints: table => |
|||
{ |
|||
table.PrimaryKey("PK_AbpAITextChatMessages", x => x.Id); |
|||
}) |
|||
.Annotation("MySql:CharSet", "utf8mb4"); |
|||
|
|||
migrationBuilder.CreateTable( |
|||
name: "AbpAITokenUsages", |
|||
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"), |
|||
MessageId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"), |
|||
ConversationId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"), |
|||
InputTokenCount = table.Column<long>(type: "bigint", nullable: true), |
|||
OutputTokenCount = table.Column<long>(type: "bigint", nullable: true), |
|||
TotalTokenCount = table.Column<long>(type: "bigint", nullable: true), |
|||
CachedInputTokenCount = table.Column<long>(type: "bigint", nullable: true), |
|||
ReasoningTokenCount = table.Column<long>(type: "bigint", nullable: true), |
|||
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_AbpAITokenUsages", x => x.Id); |
|||
}) |
|||
.Annotation("MySql:CharSet", "utf8mb4"); |
|||
|
|||
migrationBuilder.CreateTable( |
|||
name: "AbpAIWorkspaceDefinitions", |
|||
columns: table => new |
|||
{ |
|||
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"), |
|||
Name = table.Column<string>(type: "varchar(64)", maxLength: 64, nullable: false) |
|||
.Annotation("MySql:CharSet", "utf8mb4"), |
|||
Provider = table.Column<string>(type: "varchar(20)", maxLength: 20, nullable: false) |
|||
.Annotation("MySql:CharSet", "utf8mb4"), |
|||
ModelName = table.Column<string>(type: "varchar(64)", maxLength: 64, nullable: false) |
|||
.Annotation("MySql:CharSet", "utf8mb4"), |
|||
DisplayName = table.Column<string>(type: "varchar(128)", maxLength: 128, nullable: false) |
|||
.Annotation("MySql:CharSet", "utf8mb4"), |
|||
Description = table.Column<string>(type: "varchar(128)", maxLength: 128, nullable: true) |
|||
.Annotation("MySql:CharSet", "utf8mb4"), |
|||
ApiKey = table.Column<string>(type: "varchar(64)", maxLength: 64, nullable: true) |
|||
.Annotation("MySql:CharSet", "utf8mb4"), |
|||
ApiBaseUrl = table.Column<string>(type: "varchar(128)", maxLength: 128, nullable: true) |
|||
.Annotation("MySql:CharSet", "utf8mb4"), |
|||
SystemPrompt = table.Column<string>(type: "varchar(512)", maxLength: 512, nullable: true) |
|||
.Annotation("MySql:CharSet", "utf8mb4"), |
|||
Instructions = table.Column<string>(type: "varchar(512)", maxLength: 512, nullable: true) |
|||
.Annotation("MySql:CharSet", "utf8mb4"), |
|||
Temperature = table.Column<float>(type: "float", nullable: true), |
|||
MaxOutputTokens = table.Column<int>(type: "int", nullable: true), |
|||
FrequencyPenalty = table.Column<float>(type: "float", nullable: true), |
|||
PresencePenalty = table.Column<float>(type: "float", nullable: true), |
|||
IsEnabled = table.Column<bool>(type: "tinyint(1)", nullable: false), |
|||
IsSystem = table.Column<bool>(type: "tinyint(1)", nullable: false), |
|||
Tools = table.Column<string>(type: "varchar(128)", maxLength: 128, nullable: true) |
|||
.Annotation("MySql:CharSet", "utf8mb4"), |
|||
StateCheckers = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: true) |
|||
.Annotation("MySql:CharSet", "utf8mb4"), |
|||
ExtraProperties = table.Column<string>(type: "longtext", nullable: false) |
|||
.Annotation("MySql:CharSet", "utf8mb4"), |
|||
ConcurrencyStamp = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: false) |
|||
.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_AbpAIWorkspaceDefinitions", x => x.Id); |
|||
}) |
|||
.Annotation("MySql:CharSet", "utf8mb4"); |
|||
|
|||
migrationBuilder.CreateIndex( |
|||
name: "IX_AbpAIAIToolDefinitionRecords_Name", |
|||
table: "AbpAIAIToolDefinitionRecords", |
|||
column: "Name", |
|||
unique: true); |
|||
|
|||
migrationBuilder.CreateIndex( |
|||
name: "IX_AbpAITextChatMessages_TenantId_ConversationId", |
|||
table: "AbpAITextChatMessages", |
|||
columns: new[] { "TenantId", "ConversationId" }); |
|||
|
|||
migrationBuilder.CreateIndex( |
|||
name: "IX_AbpAITokenUsages_TenantId_ConversationId", |
|||
table: "AbpAITokenUsages", |
|||
columns: new[] { "TenantId", "ConversationId" }); |
|||
|
|||
migrationBuilder.CreateIndex( |
|||
name: "IX_AbpAIWorkspaceDefinitions_Name", |
|||
table: "AbpAIWorkspaceDefinitions", |
|||
column: "Name", |
|||
unique: true); |
|||
} |
|||
|
|||
/// <inheritdoc />
|
|||
protected override void Down(MigrationBuilder migrationBuilder) |
|||
{ |
|||
migrationBuilder.DropTable( |
|||
name: "AbpAIAIToolDefinitionRecords"); |
|||
|
|||
migrationBuilder.DropTable( |
|||
name: "AbpAIConversations"); |
|||
|
|||
migrationBuilder.DropTable( |
|||
name: "AbpAITextChatMessages"); |
|||
|
|||
migrationBuilder.DropTable( |
|||
name: "AbpAITokenUsages"); |
|||
|
|||
migrationBuilder.DropTable( |
|||
name: "AbpAIWorkspaceDefinitions"); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,380 @@ |
|||
// <auto-generated />
|
|||
using System; |
|||
using LINGYUN.Abp.MicroService.AIService.EntityFrameworkCore; |
|||
using Microsoft.EntityFrameworkCore; |
|||
using Microsoft.EntityFrameworkCore.Infrastructure; |
|||
using Microsoft.EntityFrameworkCore.Metadata; |
|||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion; |
|||
using Volo.Abp.EntityFrameworkCore; |
|||
|
|||
#nullable disable |
|||
|
|||
namespace LINGYUN.Abp.MicroService.AIService.EntityFrameworkCore.Migrations |
|||
{ |
|||
[DbContext(typeof(AIServiceMigrationsDbContext))] |
|||
partial class AIServiceMigrationsDbContextModelSnapshot : ModelSnapshot |
|||
{ |
|||
protected override void BuildModel(ModelBuilder modelBuilder) |
|||
{ |
|||
#pragma warning disable 612, 618
|
|||
modelBuilder |
|||
.HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.MySql) |
|||
.HasAnnotation("ProductVersion", "10.0.9") |
|||
.HasAnnotation("Relational:MaxIdentifierLength", 64); |
|||
|
|||
MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.AIManagement.Chats.ConversationRecord", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<DateTime>("CreatedAt") |
|||
.HasColumnType("datetime(6)"); |
|||
|
|||
b.Property<DateTime>("CreationTime") |
|||
.HasColumnType("datetime(6)") |
|||
.HasColumnName("CreationTime"); |
|||
|
|||
b.Property<Guid?>("CreatorId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("CreatorId"); |
|||
|
|||
b.Property<DateTime>("ExpiredAt") |
|||
.HasColumnType("datetime(6)"); |
|||
|
|||
b.Property<DateTime?>("LastModificationTime") |
|||
.HasColumnType("datetime(6)") |
|||
.HasColumnName("LastModificationTime"); |
|||
|
|||
b.Property<Guid?>("LastModifierId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("LastModifierId"); |
|||
|
|||
b.Property<string>("Name") |
|||
.IsRequired() |
|||
.HasMaxLength(50) |
|||
.HasColumnType("varchar(50)"); |
|||
|
|||
b.Property<Guid?>("TenantId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("TenantId"); |
|||
|
|||
b.Property<DateTime?>("UpdateAt") |
|||
.HasColumnType("datetime(6)"); |
|||
|
|||
b.Property<string>("Workspace") |
|||
.IsRequired() |
|||
.HasMaxLength(64) |
|||
.HasColumnType("varchar(64)"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.ToTable("AbpAIConversations", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.AIManagement.Chats.TextChatMessageRecord", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("ConcurrencyStamp") |
|||
.IsConcurrencyToken() |
|||
.IsRequired() |
|||
.HasMaxLength(40) |
|||
.HasColumnType("varchar(40)") |
|||
.HasColumnName("ConcurrencyStamp"); |
|||
|
|||
b.Property<string>("Content") |
|||
.IsRequired() |
|||
.HasMaxLength(1024) |
|||
.HasColumnType("varchar(1024)"); |
|||
|
|||
b.Property<Guid?>("ConversationId") |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<DateTime>("CreatedAt") |
|||
.HasColumnType("datetime(6)"); |
|||
|
|||
b.Property<DateTime>("CreationTime") |
|||
.HasColumnType("datetime(6)") |
|||
.HasColumnName("CreationTime"); |
|||
|
|||
b.Property<Guid?>("CreatorId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("CreatorId"); |
|||
|
|||
b.Property<string>("ExtraProperties") |
|||
.IsRequired() |
|||
.HasColumnType("longtext") |
|||
.HasColumnName("ExtraProperties"); |
|||
|
|||
b.Property<DateTime?>("LastModificationTime") |
|||
.HasColumnType("datetime(6)") |
|||
.HasColumnName("LastModificationTime"); |
|||
|
|||
b.Property<Guid?>("LastModifierId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("LastModifierId"); |
|||
|
|||
b.Property<DateTime?>("ReplyAt") |
|||
.HasColumnType("datetime(6)"); |
|||
|
|||
b.Property<string>("ReplyMessage") |
|||
.HasColumnType("longtext"); |
|||
|
|||
b.Property<string>("Role") |
|||
.IsRequired() |
|||
.HasMaxLength(20) |
|||
.HasColumnType("varchar(20)"); |
|||
|
|||
b.Property<Guid?>("TenantId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("TenantId"); |
|||
|
|||
b.Property<Guid?>("UserId") |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("Workspace") |
|||
.IsRequired() |
|||
.HasMaxLength(64) |
|||
.HasColumnType("varchar(64)"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("TenantId", "ConversationId"); |
|||
|
|||
b.ToTable("AbpAITextChatMessages", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.AIManagement.Tokens.TokenUsageRecord", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<long?>("CachedInputTokenCount") |
|||
.HasColumnType("bigint"); |
|||
|
|||
b.Property<Guid?>("ConversationId") |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<DateTime>("CreationTime") |
|||
.HasColumnType("datetime(6)") |
|||
.HasColumnName("CreationTime"); |
|||
|
|||
b.Property<Guid?>("CreatorId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("CreatorId"); |
|||
|
|||
b.Property<long?>("InputTokenCount") |
|||
.HasColumnType("bigint"); |
|||
|
|||
b.Property<DateTime?>("LastModificationTime") |
|||
.HasColumnType("datetime(6)") |
|||
.HasColumnName("LastModificationTime"); |
|||
|
|||
b.Property<Guid?>("LastModifierId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("LastModifierId"); |
|||
|
|||
b.Property<Guid?>("MessageId") |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<long?>("OutputTokenCount") |
|||
.HasColumnType("bigint"); |
|||
|
|||
b.Property<long?>("ReasoningTokenCount") |
|||
.HasColumnType("bigint"); |
|||
|
|||
b.Property<Guid?>("TenantId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("TenantId"); |
|||
|
|||
b.Property<long?>("TotalTokenCount") |
|||
.HasColumnType("bigint"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("TenantId", "ConversationId"); |
|||
|
|||
b.ToTable("AbpAITokenUsages", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.AIManagement.Tools.AIToolDefinitionRecord", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("ConcurrencyStamp") |
|||
.IsConcurrencyToken() |
|||
.IsRequired() |
|||
.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(1024) |
|||
.HasColumnType("varchar(1024)"); |
|||
|
|||
b.Property<string>("ExtraProperties") |
|||
.IsRequired() |
|||
.HasColumnType("longtext") |
|||
.HasColumnName("ExtraProperties"); |
|||
|
|||
b.Property<bool>("IsEnabled") |
|||
.HasColumnType("tinyint(1)"); |
|||
|
|||
b.Property<bool>("IsGlobal") |
|||
.HasColumnType("tinyint(1)"); |
|||
|
|||
b.Property<bool>("IsSystem") |
|||
.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(64) |
|||
.HasColumnType("varchar(64)"); |
|||
|
|||
b.Property<string>("Provider") |
|||
.IsRequired() |
|||
.HasMaxLength(20) |
|||
.HasColumnType("varchar(20)"); |
|||
|
|||
b.Property<string>("StateCheckers") |
|||
.HasMaxLength(256) |
|||
.HasColumnType("varchar(256)"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("Name") |
|||
.IsUnique(); |
|||
|
|||
b.ToTable("AbpAIAIToolDefinitionRecords", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.AIManagement.Workspaces.WorkspaceDefinitionRecord", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("ApiBaseUrl") |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.Property<string>("ApiKey") |
|||
.HasMaxLength(64) |
|||
.HasColumnType("varchar(64)"); |
|||
|
|||
b.Property<string>("ConcurrencyStamp") |
|||
.IsConcurrencyToken() |
|||
.IsRequired() |
|||
.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(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.Property<string>("DisplayName") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.Property<string>("ExtraProperties") |
|||
.IsRequired() |
|||
.HasColumnType("longtext") |
|||
.HasColumnName("ExtraProperties"); |
|||
|
|||
b.Property<float?>("FrequencyPenalty") |
|||
.HasColumnType("float"); |
|||
|
|||
b.Property<string>("Instructions") |
|||
.HasMaxLength(512) |
|||
.HasColumnType("varchar(512)"); |
|||
|
|||
b.Property<bool>("IsEnabled") |
|||
.HasColumnType("tinyint(1)"); |
|||
|
|||
b.Property<bool>("IsSystem") |
|||
.HasColumnType("tinyint(1)"); |
|||
|
|||
b.Property<DateTime?>("LastModificationTime") |
|||
.HasColumnType("datetime(6)") |
|||
.HasColumnName("LastModificationTime"); |
|||
|
|||
b.Property<Guid?>("LastModifierId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("LastModifierId"); |
|||
|
|||
b.Property<int?>("MaxOutputTokens") |
|||
.HasColumnType("int"); |
|||
|
|||
b.Property<string>("ModelName") |
|||
.IsRequired() |
|||
.HasMaxLength(64) |
|||
.HasColumnType("varchar(64)"); |
|||
|
|||
b.Property<string>("Name") |
|||
.IsRequired() |
|||
.HasMaxLength(64) |
|||
.HasColumnType("varchar(64)"); |
|||
|
|||
b.Property<float?>("PresencePenalty") |
|||
.HasColumnType("float"); |
|||
|
|||
b.Property<string>("Provider") |
|||
.IsRequired() |
|||
.HasMaxLength(20) |
|||
.HasColumnType("varchar(20)"); |
|||
|
|||
b.Property<string>("StateCheckers") |
|||
.HasMaxLength(256) |
|||
.HasColumnType("varchar(256)"); |
|||
|
|||
b.Property<string>("SystemPrompt") |
|||
.HasMaxLength(512) |
|||
.HasColumnType("varchar(512)"); |
|||
|
|||
b.Property<float?>("Temperature") |
|||
.HasColumnType("float"); |
|||
|
|||
b.Property<string>("Tools") |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("Name") |
|||
.IsUnique(); |
|||
|
|||
b.ToTable("AbpAIWorkspaceDefinitions", (string)null); |
|||
}); |
|||
#pragma warning restore 612, 618
|
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,55 @@ |
|||
using LINGYUN.Abp.MicroService.AdminService.EntityFrameworkCore; |
|||
using Microsoft.Extensions.Configuration; |
|||
using Microsoft.Extensions.DependencyInjection; |
|||
using Microsoft.Extensions.Hosting; |
|||
using Serilog; |
|||
using Volo.Abp; |
|||
using Volo.Abp.Data; |
|||
|
|||
namespace LINGYUN.Abp.MicroService.AdminService.DbMigrator; |
|||
|
|||
public class AdminServiceDbMigratorHostedService : IHostedService |
|||
{ |
|||
private readonly IHostApplicationLifetime _hostApplicationLifetime; |
|||
private readonly IConfiguration _configuration; |
|||
|
|||
public AdminServiceDbMigratorHostedService( |
|||
IHostApplicationLifetime hostApplicationLifetime, |
|||
IConfiguration configuration) |
|||
{ |
|||
_hostApplicationLifetime = hostApplicationLifetime; |
|||
_configuration = configuration; |
|||
} |
|||
|
|||
public async Task StartAsync(CancellationToken cancellationToken) |
|||
{ |
|||
using var application = await AbpApplicationFactory |
|||
.CreateAsync<AdminServiceDbMigratorModule>(options => |
|||
{ |
|||
// 从环境变量取用户机密配置, 适用于容器测试
|
|||
options.Configuration.UserSecretsId = Environment.GetEnvironmentVariable("APPLICATION_USER_SECRETS_ID"); |
|||
// 如果容器没有指定用户机密, 从项目读取
|
|||
options.Configuration.UserSecretsAssembly = typeof(AdminServiceDbMigratorHostedService).Assembly; |
|||
options.Services.ReplaceConfiguration(_configuration); |
|||
options.UseAutofac(); |
|||
options.Services.AddLogging(c => c.AddSerilog()); |
|||
options.AddDataMigrationEnvironment(); |
|||
}); |
|||
await application.InitializeAsync(); |
|||
|
|||
await application |
|||
.ServiceProvider |
|||
.GetRequiredService<AdminServiceDbMigrationService>() |
|||
.CheckAndApplyDatabaseMigrationsAsync(); |
|||
|
|||
await application.ShutdownAsync(); |
|||
|
|||
_hostApplicationLifetime.StopApplication(); |
|||
} |
|||
|
|||
public Task StopAsync(CancellationToken cancellationToken) |
|||
{ |
|||
return Task.CompletedTask; |
|||
} |
|||
} |
|||
|
|||
@ -0,0 +1,4 @@ |
|||
namespace LINGYUN.Abp.MicroService.AdminService.DbMigrator; |
|||
public partial class AdminServiceDbMigratorModule |
|||
{ |
|||
} |
|||
@ -0,0 +1,57 @@ |
|||
using LINGYUN.Abp.Account; |
|||
using LINGYUN.Abp.Auditing; |
|||
using LINGYUN.Abp.BlobManagement; |
|||
using LINGYUN.Abp.CachingManagement; |
|||
using LINGYUN.Abp.DataProtectionManagement; |
|||
using LINGYUN.Abp.FeatureManagement; |
|||
using LINGYUN.Abp.Gdpr; |
|||
using LINGYUN.Abp.Identity; |
|||
using LINGYUN.Abp.LocalizationManagement; |
|||
using LINGYUN.Abp.MessageService; |
|||
using LINGYUN.Abp.MicroService.AdminService.EntityFrameworkCore; |
|||
using LINGYUN.Abp.Notifications; |
|||
using LINGYUN.Abp.OpenIddict; |
|||
using LINGYUN.Abp.PermissionManagement; |
|||
using LINGYUN.Abp.ProjectManagement; |
|||
using LINGYUN.Abp.RulesEngineManagement; |
|||
using LINGYUN.Abp.Saas; |
|||
using LINGYUN.Abp.SettingManagement; |
|||
using LINGYUN.Abp.TaskManagement; |
|||
using LINGYUN.Abp.TextTemplating; |
|||
using LINGYUN.Abp.WebhooksManagement; |
|||
using LINGYUN.Platform; |
|||
using Volo.Abp.Autofac; |
|||
using Volo.Abp.Modularity; |
|||
|
|||
namespace LINGYUN.Abp.MicroService.AdminService.DbMigrator; |
|||
|
|||
[DependsOn( |
|||
typeof(AbpSettingManagementApplicationContractsModule), |
|||
typeof(AbpAccountApplicationContractsModule), |
|||
typeof(AbpAuditingApplicationContractsModule), |
|||
typeof(AbpCachingManagementApplicationContractsModule), |
|||
typeof(AbpDataProtectionManagementApplicationContractsModule), |
|||
typeof(AbpFeatureManagementApplicationContractsModule), |
|||
typeof(AbpGdprApplicationContractsModule), |
|||
typeof(AbpIdentityApplicationContractsModule), |
|||
typeof(AbpLocalizationManagementApplicationContractsModule), |
|||
typeof(AbpOpenIddictApplicationContractsModule), |
|||
typeof(AbpBlobManagementApplicationContractsModule), |
|||
typeof(AbpPermissionManagementApplicationContractsModule), |
|||
typeof(PlatformApplicationContractModule), |
|||
typeof(AbpProjectManagementApplicationContractsModule), |
|||
typeof(AbpMessageServiceApplicationContractsModule), |
|||
typeof(AbpNotificationsApplicationContractsModule), |
|||
typeof(RulesEngineManagementApplicationContractsModule), |
|||
typeof(AbpSaasApplicationContractsModule), |
|||
typeof(TaskManagementApplicationContractsModule), |
|||
typeof(AbpTextTemplatingApplicationContractsModule), |
|||
typeof(WebhooksManagementApplicationContractsModule))] |
|||
|
|||
[DependsOn( |
|||
typeof(AdminServiceMigrationsEntityFrameworkCoreModule), |
|||
typeof(AbpAutofacModule) |
|||
)] |
|||
public partial class AdminServiceDbMigratorModule : AbpModule |
|||
{ |
|||
} |
|||
@ -0,0 +1,72 @@ |
|||
<Project Sdk="Microsoft.NET.Sdk"> |
|||
|
|||
<Import Project="..\..\..\common.secrets.props" /> |
|||
|
|||
<PropertyGroup> |
|||
<OutputType>Exe</OutputType> |
|||
<TargetFramework>net10.0</TargetFramework> |
|||
<ImplicitUsings>enable</ImplicitUsings> |
|||
<Nullable>enable</Nullable> |
|||
<Configurations>Debug;Release</Configurations> |
|||
<Platforms>AnyCPU</Platforms> |
|||
<IsPackable>false</IsPackable> |
|||
</PropertyGroup> |
|||
|
|||
<ItemGroup> |
|||
<PackageReference Include="Serilog.Extensions.Logging" /> |
|||
<PackageReference Include="Serilog.Sinks.File" /> |
|||
<PackageReference Include="Serilog.Sinks.Console" /> |
|||
<PackageReference Include="Microsoft.Extensions.Hosting" /> |
|||
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools"> |
|||
<PrivateAssets>all</PrivateAssets> |
|||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> |
|||
</PackageReference> |
|||
<PackageReference Include="Volo.Abp.Autofac" /> |
|||
<PackageReference Include="Volo.Abp.PermissionManagement.Application.Contracts" /> |
|||
</ItemGroup> |
|||
|
|||
<ItemGroup> |
|||
<Compile Remove="Logs\**" /> |
|||
<Content Remove="Logs\**" /> |
|||
<EmbeddedResource Remove="Logs\**" /> |
|||
<None Remove="Logs\**" /> |
|||
</ItemGroup> |
|||
|
|||
<ItemGroup> |
|||
<ProjectReference Include="..\..\framework\settings\LINGYUN.Abp.SettingManagement.Application.Contracts\LINGYUN.Abp.SettingManagement.Application.Contracts.csproj" /> |
|||
</ItemGroup> |
|||
|
|||
<ItemGroup> |
|||
<ProjectReference Include="..\..\modules\account\LINGYUN.Abp.Account.Application.Contracts\LINGYUN.Abp.Account.Application.Contracts.csproj" /> |
|||
<ProjectReference Include="..\..\modules\auditing\LINGYUN.Abp.Auditing.Application.Contracts\LINGYUN.Abp.Auditing.Application.Contracts.csproj" /> |
|||
<ProjectReference Include="..\..\modules\caching-management\LINGYUN.Abp.CachingManagement.Application.Contracts\LINGYUN.Abp.CachingManagement.Application.Contracts.csproj" /> |
|||
<ProjectReference Include="..\..\modules\data-protection\LINGYUN.Abp.DataProtectionManagement.Application.Contracts\LINGYUN.Abp.DataProtectionManagement.Application.Contracts.csproj" /> |
|||
<ProjectReference Include="..\..\modules\feature-management\LINGYUN.Abp.FeatureManagement.Application.Contracts\LINGYUN.Abp.FeatureManagement.Application.Contracts.csproj" /> |
|||
<ProjectReference Include="..\..\modules\gdpr\LINGYUN.Abp.Gdpr.Application.Contracts\LINGYUN.Abp.Gdpr.Application.Contracts.csproj" /> |
|||
<ProjectReference Include="..\..\modules\identity\LINGYUN.Abp.Identity.Application.Contracts\LINGYUN.Abp.Identity.Application.Contracts.csproj" /> |
|||
<ProjectReference Include="..\..\modules\localization-management\LINGYUN.Abp.LocalizationManagement.Application.Contracts\LINGYUN.Abp.LocalizationManagement.Application.Contracts.csproj" /> |
|||
<ProjectReference Include="..\..\modules\openIddict\LINGYUN.Abp.OpenIddict.Application.Contracts\LINGYUN.Abp.OpenIddict.Application.Contracts.csproj" /> |
|||
<ProjectReference Include="..\..\modules\blob-management\LINGYUN.Abp.BlobManagement.Application.Contracts\LINGYUN.Abp.BlobManagement.Application.Contracts.csproj" /> |
|||
<ProjectReference Include="..\..\modules\permissions-management\LINGYUN.Abp.PermissionManagement.Application.Contracts\LINGYUN.Abp.PermissionManagement.Application.Contracts.csproj" /> |
|||
<ProjectReference Include="..\..\modules\platform\LINGYUN.Platform.Application.Contracts\LINGYUN.Platform.Application.Contracts.csproj" /> |
|||
<ProjectReference Include="..\..\modules\project\LINGYUN.Abp.ProjectManagement.Application.Contracts\LINGYUN.Abp.ProjectManagement.Application.Contracts.csproj" /> |
|||
<ProjectReference Include="..\..\modules\realtime-message\LINGYUN.Abp.MessageService.Application.Contracts\LINGYUN.Abp.MessageService.Application.Contracts.csproj" /> |
|||
<ProjectReference Include="..\..\modules\realtime-notifications\LINGYUN.Abp.Notifications.Application.Contracts\LINGYUN.Abp.Notifications.Application.Contracts.csproj" /> |
|||
<ProjectReference Include="..\..\modules\rules-management\rules-engine\LINGYUN.Abp.RulesEngineManagement.Application.Contracts\LINGYUN.Abp.RulesEngineManagement.Application.Contracts.csproj" /> |
|||
<ProjectReference Include="..\..\modules\saas\LINGYUN.Abp.Saas.Application.Contracts\LINGYUN.Abp.Saas.Application.Contracts.csproj" /> |
|||
<ProjectReference Include="..\..\modules\task-management\LINGYUN.Abp.TaskManagement.Application.Contracts\LINGYUN.Abp.TaskManagement.Application.Contracts.csproj" /> |
|||
<ProjectReference Include="..\..\modules\text-templating\LINGYUN.Abp.TextTemplating.Application.Contracts\LINGYUN.Abp.TextTemplating.Application.Contracts.csproj" /> |
|||
<ProjectReference Include="..\..\modules\webhooks\LINGYUN.Abp.WebhooksManagement.Application.Contracts\LINGYUN.Abp.WebhooksManagement.Application.Contracts.csproj" /> |
|||
</ItemGroup> |
|||
|
|||
<ItemGroup> |
|||
<ProjectReference Include="..\LINGYUN.Abp.MicroService.AdminService.EntityFrameworkCore\LINGYUN.Abp.MicroService.AdminService.EntityFrameworkCore.csproj" /> |
|||
</ItemGroup> |
|||
|
|||
<ItemGroup> |
|||
<None Update="appsettings.json"> |
|||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> |
|||
</None> |
|||
</ItemGroup> |
|||
|
|||
</Project> |
|||
@ -0,0 +1,40 @@ |
|||
using Microsoft.Extensions.DependencyInjection; |
|||
using Microsoft.Extensions.Hosting; |
|||
using Microsoft.Extensions.Logging; |
|||
using Serilog; |
|||
using Serilog.Events; |
|||
|
|||
namespace LINGYUN.Abp.MicroService.AdminService.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("LINGYUN.Abp.MicroService.AdminService.DbMigrator", LogEventLevel.Debug) |
|||
#else
|
|||
.MinimumLevel.Override("LINGYUN.Abp.MicroService.AdminService.DbMigrator", LogEventLevel.Information) |
|||
#endif
|
|||
.Enrich.FromLogContext() |
|||
.WriteTo.Console(outputTemplate: "{Timestamp:yyyy-MM-dd HH:mm:ss} [{Level:u3}] [{SourceContext}] [{ProcessId}] [{ThreadId}] - {Message:lj}{NewLine}{Exception}") |
|||
.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<AdminServiceDbMigratorHostedService>(); |
|||
}); |
|||
} |
|||
} |
|||
@ -0,0 +1,11 @@ |
|||
{ |
|||
"profiles": { |
|||
"LINGYUN.Abp.MicroService.AdminService.DbMigrator": { |
|||
"commandName": "Project", |
|||
"dotnetRunMessages": true, |
|||
"environmentVariables": { |
|||
"ASPNETCORE_ENVIRONMENT": "Development" |
|||
} |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,98 @@ |
|||
# LINGYUN.Abp.MicroService.AdminService.DbMigrator |
|||
|
|||
Backend Administration System Database Migration Console Application, used for executing database migrations and initializing seed data for the backend administration system. |
|||
|
|||
[简体中文](./README.md) |
|||
|
|||
## Features |
|||
|
|||
* Automatic database migration execution |
|||
* Initialize necessary system seed data |
|||
* Support command line parameter configuration |
|||
* Integrated Autofac dependency injection container |
|||
* Integrated Feature Management |
|||
* Integrated Setting Management |
|||
* Integrated Permission Management |
|||
* Integrated Localization Management |
|||
* Integrated Cache Management |
|||
* Integrated Auditing |
|||
* Integrated Text Templating |
|||
* Integrated Identity Authentication |
|||
* Integrated IdentityServer |
|||
* Integrated OpenIddict |
|||
* Integrated Platform Management |
|||
* Integrated Object Storage Management |
|||
* Integrated Notification System |
|||
* Integrated Message Service |
|||
* Integrated Task Management |
|||
* Integrated Webhooks Management |
|||
|
|||
## Module Dependencies |
|||
|
|||
```csharp |
|||
[DependsOn( |
|||
typeof(BackendAdminMigrationsEntityFrameworkCoreModule), |
|||
typeof(AbpFeatureManagementApplicationContractsModule), |
|||
typeof(AbpSettingManagementApplicationContractsModule), |
|||
typeof(AbpPermissionManagementApplicationContractsModule), |
|||
typeof(AbpLocalizationManagementApplicationContractsModule), |
|||
typeof(AbpCachingManagementApplicationContractsModule), |
|||
typeof(AbpAuditingApplicationContractsModule), |
|||
typeof(AbpTextTemplatingApplicationContractsModule), |
|||
typeof(AbpIdentityApplicationContractsModule), |
|||
typeof(AbpIdentityServerApplicationContractsModule), |
|||
typeof(AbpOpenIddictApplicationContractsModule), |
|||
typeof(PlatformApplicationContractModule), |
|||
typeof(AbpOssManagementApplicationContractsModule), |
|||
typeof(AbpNotificationsApplicationContractsModule), |
|||
typeof(AbpMessageServiceApplicationContractsModule), |
|||
typeof(TaskManagementApplicationContractsModule), |
|||
typeof(WebhooksManagementApplicationContractsModule), |
|||
typeof(AbpAutofacModule) |
|||
)] |
|||
``` |
|||
|
|||
## Configuration |
|||
|
|||
```json |
|||
{ |
|||
"ConnectionStrings": { |
|||
"BackendAdminDbMigrator": "Your database connection string" |
|||
}, |
|||
"IdentityServer": { |
|||
"Clients": { |
|||
"BackendAdmin_App": { |
|||
"ClientId": "BackendAdmin_App" |
|||
} |
|||
} |
|||
} |
|||
} |
|||
``` |
|||
|
|||
## Basic Usage |
|||
|
|||
1. Configure Database Connection String |
|||
* Configure BackendAdminDbMigrator connection string in appsettings.json |
|||
|
|||
2. Run Migration Program |
|||
```bash |
|||
dotnet run |
|||
``` |
|||
|
|||
## Command Line Arguments |
|||
|
|||
* --database-provider |
|||
* Specify database provider (default: MySQL) |
|||
* --connection-string |
|||
* Specify database connection string |
|||
* --skip-db-migrations |
|||
* Skip database migrations |
|||
* --skip-seed-data |
|||
* Skip seed data initialization |
|||
|
|||
## More Information |
|||
|
|||
* [ABP Documentation](https://docs.abp.io) |
|||
* [EF Core Migrations Documentation](https://docs.microsoft.com/en-us/ef/core/managing-schemas/migrations/) |
|||
* [IdentityServer4 Documentation](https://identityserver4.readthedocs.io) |
|||
* [OpenIddict Documentation](https://documentation.openiddict.com) |
|||
@ -0,0 +1,98 @@ |
|||
# LINGYUN.Abp.MicroService.AdminService.DbMigrator |
|||
|
|||
后台管理系统数据库迁移控制台应用程序,用于执行后台管理系统的数据库迁移和初始化种子数据。 |
|||
|
|||
[English](./README.EN.md) |
|||
|
|||
## 功能特性 |
|||
|
|||
* 自动执行数据库迁移 |
|||
* 初始化系统必要的种子数据 |
|||
* 支持命令行参数配置 |
|||
* 集成Autofac依赖注入容器 |
|||
* 集成特性管理功能 |
|||
* 集成设置管理功能 |
|||
* 集成权限管理功能 |
|||
* 集成本地化管理功能 |
|||
* 集成缓存管理功能 |
|||
* 集成审计日志功能 |
|||
* 集成文本模板功能 |
|||
* 集成身份认证功能 |
|||
* 集成IdentityServer功能 |
|||
* 集成OpenIddict功能 |
|||
* 集成平台管理功能 |
|||
* 集成对象存储功能 |
|||
* 集成通知系统功能 |
|||
* 集成消息服务功能 |
|||
* 集成任务管理功能 |
|||
* 集成Webhooks管理功能 |
|||
|
|||
## 模块依赖 |
|||
|
|||
```csharp |
|||
[DependsOn( |
|||
typeof(BackendAdminMigrationsEntityFrameworkCoreModule), |
|||
typeof(AbpFeatureManagementApplicationContractsModule), |
|||
typeof(AbpSettingManagementApplicationContractsModule), |
|||
typeof(AbpPermissionManagementApplicationContractsModule), |
|||
typeof(AbpLocalizationManagementApplicationContractsModule), |
|||
typeof(AbpCachingManagementApplicationContractsModule), |
|||
typeof(AbpAuditingApplicationContractsModule), |
|||
typeof(AbpTextTemplatingApplicationContractsModule), |
|||
typeof(AbpIdentityApplicationContractsModule), |
|||
typeof(AbpIdentityServerApplicationContractsModule), |
|||
typeof(AbpOpenIddictApplicationContractsModule), |
|||
typeof(PlatformApplicationContractModule), |
|||
typeof(AbpOssManagementApplicationContractsModule), |
|||
typeof(AbpNotificationsApplicationContractsModule), |
|||
typeof(AbpMessageServiceApplicationContractsModule), |
|||
typeof(TaskManagementApplicationContractsModule), |
|||
typeof(WebhooksManagementApplicationContractsModule), |
|||
typeof(AbpAutofacModule) |
|||
)] |
|||
``` |
|||
|
|||
## 配置项 |
|||
|
|||
```json |
|||
{ |
|||
"ConnectionStrings": { |
|||
"BackendAdminDbMigrator": "你的数据库连接字符串" |
|||
}, |
|||
"IdentityServer": { |
|||
"Clients": { |
|||
"BackendAdmin_App": { |
|||
"ClientId": "BackendAdmin_App" |
|||
} |
|||
} |
|||
} |
|||
} |
|||
``` |
|||
|
|||
## 基本用法 |
|||
|
|||
1. 配置数据库连接字符串 |
|||
* 在appsettings.json中配置BackendAdminDbMigrator连接字符串 |
|||
|
|||
2. 运行迁移程序 |
|||
```bash |
|||
dotnet run |
|||
``` |
|||
|
|||
## 命令行参数 |
|||
|
|||
* --database-provider |
|||
* 指定数据库提供程序 (默认: MySQL) |
|||
* --connection-string |
|||
* 指定数据库连接字符串 |
|||
* --skip-db-migrations |
|||
* 跳过数据库迁移 |
|||
* --skip-seed-data |
|||
* 跳过种子数据初始化 |
|||
|
|||
## 更多信息 |
|||
|
|||
* [ABP文档](https://docs.abp.io) |
|||
* [EF Core迁移文档](https://docs.microsoft.com/zh-cn/ef/core/managing-schemas/migrations/) |
|||
* [IdentityServer4文档](https://identityserver4.readthedocs.io) |
|||
* [OpenIddict文档](https://documentation.openiddict.com) |
|||
@ -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,75 @@ |
|||
{ |
|||
"ConnectionStrings": { |
|||
"Default": "Server=localhost;Database=abp;User Id=root;Password=123456;SslMode=None" |
|||
}, |
|||
"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}" |
|||
} |
|||
} |
|||
] |
|||
} |
|||
} |
|||
@ -0,0 +1,61 @@ |
|||
using Microsoft.Extensions.Logging; |
|||
using Microsoft.Extensions.Logging.Abstractions; |
|||
using System.Linq; |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp.Authorization.Permissions; |
|||
using Volo.Abp.Data; |
|||
using Volo.Abp.DependencyInjection; |
|||
using Volo.Abp.MultiTenancy; |
|||
using Volo.Abp.PermissionManagement; |
|||
|
|||
namespace LINGYUN.Abp.MicroService.AdminService.EntityFrameworkCore; |
|||
|
|||
public class AdminServiceDataSeeder : ITransientDependency |
|||
{ |
|||
protected ILogger<AdminServiceDataSeeder> Logger { get; } |
|||
protected ICurrentTenant CurrentTenant { get; } |
|||
protected IPermissionDefinitionManager PermissionDefinitionManager { get; } |
|||
protected IPermissionDataSeeder PermissionDataSeeder { get; } |
|||
|
|||
public AdminServiceDataSeeder( |
|||
IPermissionDefinitionManager permissionDefinitionManager, |
|||
IPermissionDataSeeder permissionDataSeeder, |
|||
ICurrentTenant currentTenant) |
|||
{ |
|||
PermissionDefinitionManager = permissionDefinitionManager; |
|||
PermissionDataSeeder = permissionDataSeeder; |
|||
CurrentTenant = currentTenant; |
|||
|
|||
Logger = NullLogger<AdminServiceDataSeeder>.Instance; |
|||
} |
|||
|
|||
public virtual async Task SeedAsync(DataSeedContext context) |
|||
{ |
|||
using (CurrentTenant.Change(context.TenantId)) |
|||
{ |
|||
await SeedAdminRolePermissionsAsync(context); |
|||
} |
|||
} |
|||
|
|||
private async Task SeedAdminRolePermissionsAsync(DataSeedContext context) |
|||
{ |
|||
Logger.LogInformation("Seeding the default role permissions..."); |
|||
|
|||
var multiTenancySide = CurrentTenant.GetMultiTenancySide(); |
|||
var permissionNames = (await PermissionDefinitionManager.GetPermissionsAsync()) |
|||
.Where(p => p.MultiTenancySide.HasFlag(multiTenancySide)) |
|||
.Where(p => !p.Providers.Any() || p.Providers.Contains(RolePermissionValueProvider.ProviderName)) |
|||
.Select(p => p.Name) |
|||
.ToArray(); |
|||
|
|||
await PermissionDataSeeder.SeedAsync( |
|||
RolePermissionValueProvider.ProviderName, |
|||
"admin", |
|||
permissionNames, |
|||
context?.TenantId |
|||
); |
|||
|
|||
Logger.LogInformation("Seed default role permissions completed."); |
|||
} |
|||
} |
|||
|
|||
@ -0,0 +1,45 @@ |
|||
using Microsoft.Extensions.Logging; |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp.Data; |
|||
using Volo.Abp.DistributedLocking; |
|||
using Volo.Abp.EntityFrameworkCore.Migrations; |
|||
using Volo.Abp.EventBus.Distributed; |
|||
using Volo.Abp.MultiTenancy; |
|||
using Volo.Abp.Uow; |
|||
|
|||
namespace LINGYUN.Abp.MicroService.AdminService.EntityFrameworkCore; |
|||
|
|||
public class AdminServiceDbMigrationEventHandler : EfCoreDatabaseMigrationEventHandlerBase<AdminServiceMigrationsDbContext> |
|||
{ |
|||
protected AdminServiceDataSeeder DataSeeder { get; } |
|||
|
|||
public AdminServiceDbMigrationEventHandler( |
|||
ICurrentTenant currentTenant, |
|||
IUnitOfWorkManager unitOfWorkManager, |
|||
ITenantStore tenantStore, |
|||
IAbpDistributedLock abpDistributedLock, |
|||
IDistributedEventBus distributedEventBus, |
|||
ILoggerFactory loggerFactory, |
|||
AdminServiceDataSeeder dataSeeder) |
|||
: base( |
|||
ConnectionStringNameAttribute.GetConnStringName<AdminServiceMigrationsDbContext>(), |
|||
currentTenant, unitOfWorkManager, tenantStore, abpDistributedLock, distributedEventBus, loggerFactory) |
|||
{ |
|||
DataSeeder = dataSeeder; |
|||
} |
|||
|
|||
protected async override Task AfterTenantCreated(TenantCreatedEto eventData, bool schemaMigrated) |
|||
{ |
|||
// 新租户数据种子
|
|||
var context = new DataSeedContext(eventData.Id); |
|||
if (eventData.Properties != null) |
|||
{ |
|||
foreach (var property in eventData.Properties) |
|||
{ |
|||
context.WithProperty(property.Key, property.Value); |
|||
} |
|||
} |
|||
|
|||
await DataSeeder.SeedAsync(context); |
|||
} |
|||
} |
|||
@ -0,0 +1,38 @@ |
|||
using LINGYUN.Abp.Data.DbMigrator; |
|||
using Microsoft.Extensions.Logging; |
|||
using System; |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp.Data; |
|||
using Volo.Abp.DependencyInjection; |
|||
using Volo.Abp.DistributedLocking; |
|||
using Volo.Abp.EventBus.Distributed; |
|||
using Volo.Abp.MultiTenancy; |
|||
using Volo.Abp.Uow; |
|||
|
|||
namespace LINGYUN.Abp.MicroService.AdminService.EntityFrameworkCore; |
|||
|
|||
public class AdminServiceDbMigrationService : EfCoreRuntimeDbMigratorBase<AdminServiceMigrationsDbContext>, ITransientDependency |
|||
{ |
|||
protected AdminServiceDataSeeder DataSeeder { get; } |
|||
|
|||
public AdminServiceDbMigrationService( |
|||
AdminServiceDataSeeder dataSeeder, |
|||
ICurrentTenant currentTenant, |
|||
IUnitOfWorkManager unitOfWorkManager, |
|||
IServiceProvider serviceProvider, |
|||
IAbpDistributedLock abpDistributedLock, |
|||
IDistributedEventBus distributedEventBus, |
|||
ILoggerFactory loggerFactory) |
|||
: base( |
|||
ConnectionStringNameAttribute.GetConnStringName<AdminServiceMigrationsDbContext>(), |
|||
unitOfWorkManager, serviceProvider, currentTenant, abpDistributedLock, distributedEventBus, loggerFactory) |
|||
{ |
|||
DataSeeder = dataSeeder; |
|||
} |
|||
|
|||
protected async override Task SeedAsync() |
|||
{ |
|||
// DbMigrator迁移数据种子
|
|||
await DataSeeder.SeedAsync(new DataSeedContext()); |
|||
} |
|||
} |
|||
@ -0,0 +1,43 @@ |
|||
using LINGYUN.Abp.DataProtectionManagement.EntityFrameworkCore; |
|||
using LINGYUN.Abp.Saas.EntityFrameworkCore; |
|||
using LINGYUN.Abp.TextTemplating.EntityFrameworkCore; |
|||
using Microsoft.EntityFrameworkCore; |
|||
using Volo.Abp.Data; |
|||
using Volo.Abp.EntityFrameworkCore; |
|||
using Volo.Abp.FeatureManagement.EntityFrameworkCore; |
|||
using Volo.Abp.PermissionManagement; |
|||
using Volo.Abp.PermissionManagement.EntityFrameworkCore; |
|||
using Volo.Abp.SettingManagement.EntityFrameworkCore; |
|||
|
|||
namespace LINGYUN.Abp.MicroService.AdminService.EntityFrameworkCore; |
|||
|
|||
[ConnectionStringName("BackendAdminDbMigrator")] |
|||
public class AdminServiceMigrationsDbContext : AbpDbContext<AdminServiceMigrationsDbContext> |
|||
{ |
|||
public AdminServiceMigrationsDbContext(DbContextOptions<AdminServiceMigrationsDbContext> options) |
|||
: base(options) |
|||
{ |
|||
|
|||
} |
|||
|
|||
protected override void OnModelCreating(ModelBuilder modelBuilder) |
|||
{ |
|||
base.OnModelCreating(modelBuilder); |
|||
|
|||
modelBuilder.ConfigureSaas(); |
|||
modelBuilder.ConfigureTextTemplating(); |
|||
modelBuilder.ConfigureFeatureManagement(); |
|||
modelBuilder.ConfigureSettingManagement(); |
|||
modelBuilder.ConfigurePermissionManagement(); |
|||
modelBuilder.ConfigureDataProtectionManagement(); |
|||
|
|||
modelBuilder.Entity<ResourcePermissionGrant>(b => |
|||
{ |
|||
var maxResourceNameLength = modelBuilder.IsUsingMySQL() ? 128 : PermissionGrantConsts.MaxResourceNameLength; |
|||
var maxResourceKeyLength = modelBuilder.IsUsingMySQL() ? 128 : PermissionGrantConsts.MaxResourceKeyLength; |
|||
|
|||
b.Property(x => x.ResourceName).HasMaxLength(maxResourceNameLength).IsRequired(); |
|||
b.Property(x => x.ResourceKey).HasMaxLength(maxResourceKeyLength).IsRequired(); |
|||
}); |
|||
} |
|||
} |
|||
@ -0,0 +1,29 @@ |
|||
using Microsoft.EntityFrameworkCore; |
|||
using Microsoft.EntityFrameworkCore.Design; |
|||
using Microsoft.Extensions.Configuration; |
|||
using System.IO; |
|||
|
|||
namespace LINGYUN.Abp.MicroService.AdminService.EntityFrameworkCore; |
|||
|
|||
public class AdminServiceMigrationsDbContextFactory : IDesignTimeDbContextFactory<AdminServiceMigrationsDbContext> |
|||
{ |
|||
public AdminServiceMigrationsDbContext CreateDbContext(string[] args) |
|||
{ |
|||
var configuration = BuildConfiguration(); |
|||
var connectionString = configuration.GetConnectionString("Default"); |
|||
|
|||
var builder = new DbContextOptionsBuilder<AdminServiceMigrationsDbContext>() |
|||
.UseMySql(connectionString, ServerVersion.AutoDetect(connectionString)); |
|||
|
|||
return new AdminServiceMigrationsDbContext(builder!.Options); |
|||
} |
|||
|
|||
private static IConfigurationRoot BuildConfiguration() |
|||
{ |
|||
var builder = new ConfigurationBuilder() |
|||
.SetBasePath(Path.Combine(Directory.GetCurrentDirectory(), "../LINGYUN.Abp.MicroService.AdminService.DbMigrator/")) |
|||
.AddJsonFile("appsettings.json", optional: false); |
|||
|
|||
return builder.Build(); |
|||
} |
|||
} |
|||
@ -0,0 +1,42 @@ |
|||
using LINGYUN.Abp.Data.DbMigrator; |
|||
using LINGYUN.Abp.DataProtectionManagement.EntityFrameworkCore; |
|||
using LINGYUN.Abp.EntityFrameworkCore.MySQL; |
|||
using LINGYUN.Abp.PermissionManagement.EntityFrameworkCore; |
|||
using LINGYUN.Abp.Saas.EntityFrameworkCore; |
|||
using LINGYUN.Abp.TextTemplating.EntityFrameworkCore; |
|||
using Microsoft.EntityFrameworkCore; |
|||
using Microsoft.Extensions.DependencyInjection; |
|||
using Volo.Abp.EntityFrameworkCore; |
|||
using Volo.Abp.FeatureManagement.EntityFrameworkCore; |
|||
using Volo.Abp.Modularity; |
|||
using Volo.Abp.SettingManagement.EntityFrameworkCore; |
|||
|
|||
namespace LINGYUN.Abp.MicroService.AdminService.EntityFrameworkCore; |
|||
|
|||
[DependsOn( |
|||
typeof(AbpSaasEntityFrameworkCoreModule), |
|||
typeof(AbpSettingManagementEntityFrameworkCoreModule), |
|||
typeof(AbpDataProtectionManagementEntityFrameworkCoreModule), |
|||
typeof(AbpPermissionManagementEntityFrameworkCoreModule), |
|||
typeof(AbpFeatureManagementEntityFrameworkCoreModule), |
|||
typeof(AbpTextTemplatingEntityFrameworkCoreModule), |
|||
typeof(AbpEntityFrameworkCoreMySQLMicrotingModule), |
|||
typeof(AbpDataDbMigratorModule) |
|||
)] |
|||
public class AdminServiceMigrationsEntityFrameworkCoreModule : AbpModule |
|||
{ |
|||
public override void ConfigureServices(ServiceConfigurationContext context) |
|||
{ |
|||
context.Services.AddAbpDbContext<AdminServiceMigrationsDbContext>(); |
|||
|
|||
Configure<AbpDbContextOptions>(options => |
|||
{ |
|||
options.UseMySQL( |
|||
mysql => |
|||
{ |
|||
// see: https://github.com/PomeloFoundation/Pomelo.EntityFrameworkCore.MySql/issues/1960
|
|||
mysql.UseParameterizedCollectionMode(ParameterTranslationMode.Constant); |
|||
}); |
|||
}); |
|||
} |
|||
} |
|||
@ -0,0 +1,30 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> |
|||
<!-- This file was generated by Fody. Manual changes to this file will be lost when your project is rebuilt. --> |
|||
<xs:element name="Weavers"> |
|||
<xs:complexType> |
|||
<xs:all> |
|||
<xs:element name="ConfigureAwait" minOccurs="0" maxOccurs="1"> |
|||
<xs:complexType> |
|||
<xs:attribute name="ContinueOnCapturedContext" type="xs:boolean" /> |
|||
</xs:complexType> |
|||
</xs:element> |
|||
</xs:all> |
|||
<xs:attribute name="VerifyAssembly" type="xs:boolean"> |
|||
<xs:annotation> |
|||
<xs:documentation>'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed.</xs:documentation> |
|||
</xs:annotation> |
|||
</xs:attribute> |
|||
<xs:attribute name="VerifyIgnoreCodes" type="xs:string"> |
|||
<xs:annotation> |
|||
<xs:documentation>A comma-separated list of error codes that can be safely ignored in assembly verification.</xs:documentation> |
|||
</xs:annotation> |
|||
</xs:attribute> |
|||
<xs:attribute name="GenerateXsd" type="xs:boolean"> |
|||
<xs:annotation> |
|||
<xs:documentation>'false' to turn off automatic generation of the XML Schema file.</xs:documentation> |
|||
</xs:annotation> |
|||
</xs:attribute> |
|||
</xs:complexType> |
|||
</xs:element> |
|||
</xs:schema> |
|||
@ -0,0 +1,34 @@ |
|||
<Project Sdk="Microsoft.NET.Sdk"> |
|||
|
|||
<Import Project="..\..\..\configureawait.props" /> |
|||
<Import Project="..\..\..\common.props" /> |
|||
|
|||
<PropertyGroup> |
|||
<IsPackable>false</IsPackable> |
|||
<TargetFramework>net10.0</TargetFramework> |
|||
<RootNamespace>LINGYUN.Abp.MicroService.AdminService.EntityFrameworkCore</RootNamespace> |
|||
</PropertyGroup> |
|||
|
|||
<ItemGroup> |
|||
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools"> |
|||
<PrivateAssets>all</PrivateAssets> |
|||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> |
|||
</PackageReference> |
|||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design"> |
|||
<PrivateAssets>all</PrivateAssets> |
|||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> |
|||
</PackageReference> |
|||
<PackageReference Include="Volo.Abp.FeatureManagement.EntityFrameworkCore" /> |
|||
<PackageReference Include="Volo.Abp.SettingManagement.EntityFrameworkCore" /> |
|||
</ItemGroup> |
|||
|
|||
<ItemGroup> |
|||
<ProjectReference Include="..\..\framework\common\LINGYUN.Abp.Data.DbMigrator\LINGYUN.Abp.Data.DbMigrator.csproj" /> |
|||
<ProjectReference Include="..\..\framework\efcore\LINGYUN.Abp.EntityFrameworkCore.MySQL.Microting\LINGYUN.Abp.EntityFrameworkCore.MySQL.Microting.csproj" /> |
|||
<ProjectReference Include="..\..\modules\data-protection\LINGYUN.Abp.DataProtectionManagement.EntityFrameworkCore\LINGYUN.Abp.DataProtectionManagement.EntityFrameworkCore.csproj" /> |
|||
<ProjectReference Include="..\..\modules\permissions-management\LINGYUN.Abp.PermissionManagement.EntityFrameworkCore\LINGYUN.Abp.PermissionManagement.EntityFrameworkCore.csproj" /> |
|||
<ProjectReference Include="..\..\modules\saas\LINGYUN.Abp.Saas.EntityFrameworkCore\LINGYUN.Abp.Saas.EntityFrameworkCore.csproj" /> |
|||
<ProjectReference Include="..\..\modules\text-templating\LINGYUN.Abp.TextTemplating.EntityFrameworkCore\LINGYUN.Abp.TextTemplating.EntityFrameworkCore.csproj" /> |
|||
</ItemGroup> |
|||
|
|||
</Project> |
|||
@ -0,0 +1,523 @@ |
|||
// <auto-generated />
|
|||
using System; |
|||
using Microsoft.EntityFrameworkCore; |
|||
using Microsoft.EntityFrameworkCore.Infrastructure; |
|||
using Microsoft.EntityFrameworkCore.Migrations; |
|||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion; |
|||
using Volo.Abp.EntityFrameworkCore; |
|||
|
|||
#nullable disable |
|||
|
|||
namespace LINGYUN.Abp.MicroService.AdminService.EntityFrameworkCore.Migrations |
|||
{ |
|||
[DbContext(typeof(AdminServiceMigrationsDbContext))] |
|||
[Migration("20230109083613_Initial-Backend-Admin")] |
|||
partial class InitialBackendAdmin |
|||
{ |
|||
/// <inheritdoc />
|
|||
protected override void BuildTargetModel(ModelBuilder modelBuilder) |
|||
{ |
|||
#pragma warning disable 612, 618
|
|||
modelBuilder |
|||
.HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.MySql) |
|||
.HasAnnotation("ProductVersion", "7.0.1") |
|||
.HasAnnotation("Relational:MaxIdentifierLength", 64); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.Saas.Editions.Edition", 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<Guid?>("DeleterId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("DeleterId"); |
|||
|
|||
b.Property<DateTime?>("DeletionTime") |
|||
.HasColumnType("datetime(6)") |
|||
.HasColumnName("DeletionTime"); |
|||
|
|||
b.Property<string>("DisplayName") |
|||
.IsRequired() |
|||
.HasMaxLength(64) |
|||
.HasColumnType("varchar(64)"); |
|||
|
|||
b.Property<string>("ExtraProperties") |
|||
.HasColumnType("longtext") |
|||
.HasColumnName("ExtraProperties"); |
|||
|
|||
b.Property<bool>("IsDeleted") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("tinyint(1)") |
|||
.HasDefaultValue(false) |
|||
.HasColumnName("IsDeleted"); |
|||
|
|||
b.Property<DateTime?>("LastModificationTime") |
|||
.HasColumnType("datetime(6)") |
|||
.HasColumnName("LastModificationTime"); |
|||
|
|||
b.Property<Guid?>("LastModifierId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("LastModifierId"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("DisplayName"); |
|||
|
|||
b.ToTable("AbpEditions", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.Saas.Tenants.Tenant", 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<Guid?>("DeleterId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("DeleterId"); |
|||
|
|||
b.Property<DateTime?>("DeletionTime") |
|||
.HasColumnType("datetime(6)") |
|||
.HasColumnName("DeletionTime"); |
|||
|
|||
b.Property<DateTime?>("DisableTime") |
|||
.HasColumnType("datetime(6)"); |
|||
|
|||
b.Property<Guid?>("EditionId") |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<DateTime?>("EnableTime") |
|||
.HasColumnType("datetime(6)"); |
|||
|
|||
b.Property<string>("ExtraProperties") |
|||
.HasColumnType("longtext") |
|||
.HasColumnName("ExtraProperties"); |
|||
|
|||
b.Property<bool>("IsActive") |
|||
.HasColumnType("tinyint(1)"); |
|||
|
|||
b.Property<bool>("IsDeleted") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("tinyint(1)") |
|||
.HasDefaultValue(false) |
|||
.HasColumnName("IsDeleted"); |
|||
|
|||
b.Property<DateTime?>("LastModificationTime") |
|||
.HasColumnType("datetime(6)") |
|||
.HasColumnName("LastModificationTime"); |
|||
|
|||
b.Property<Guid?>("LastModifierId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("LastModifierId"); |
|||
|
|||
b.Property<string>("Name") |
|||
.IsRequired() |
|||
.HasMaxLength(64) |
|||
.HasColumnType("varchar(64)"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("EditionId"); |
|||
|
|||
b.HasIndex("Name"); |
|||
|
|||
b.ToTable("AbpTenants", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.Saas.Tenants.TenantConnectionString", b => |
|||
{ |
|||
b.Property<Guid>("TenantId") |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("Name") |
|||
.HasMaxLength(64) |
|||
.HasColumnType("varchar(64)"); |
|||
|
|||
b.Property<string>("Value") |
|||
.IsRequired() |
|||
.HasMaxLength(1024) |
|||
.HasColumnType("varchar(1024)"); |
|||
|
|||
b.HasKey("TenantId", "Name"); |
|||
|
|||
b.ToTable("AbpTenantConnectionStrings", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.TextTemplating.TextTemplate", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("Content") |
|||
.HasMaxLength(1048576) |
|||
.HasColumnType("longtext") |
|||
.HasColumnName("Content"); |
|||
|
|||
b.Property<DateTime>("CreationTime") |
|||
.HasColumnType("datetime(6)") |
|||
.HasColumnName("CreationTime"); |
|||
|
|||
b.Property<Guid?>("CreatorId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("CreatorId"); |
|||
|
|||
b.Property<string>("Culture") |
|||
.HasMaxLength(30) |
|||
.HasColumnType("varchar(30)") |
|||
.HasColumnName("Culture"); |
|||
|
|||
b.Property<string>("DisplayName") |
|||
.IsRequired() |
|||
.HasMaxLength(100) |
|||
.HasColumnType("varchar(100)") |
|||
.HasColumnName("DisplayName"); |
|||
|
|||
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<Guid?>("TenantId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("TenantId"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("TenantId", "Name") |
|||
.HasDatabaseName("IX_Tenant_Text_Template_Name"); |
|||
|
|||
b.ToTable("AbpTextTemplates", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureDefinitionRecord", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("AllowedProviders") |
|||
.HasMaxLength(256) |
|||
.HasColumnType("varchar(256)"); |
|||
|
|||
b.Property<string>("DefaultValue") |
|||
.HasMaxLength(256) |
|||
.HasColumnType("varchar(256)"); |
|||
|
|||
b.Property<string>("Description") |
|||
.HasMaxLength(256) |
|||
.HasColumnType("varchar(256)"); |
|||
|
|||
b.Property<string>("DisplayName") |
|||
.IsRequired() |
|||
.HasMaxLength(256) |
|||
.HasColumnType("varchar(256)"); |
|||
|
|||
b.Property<string>("ExtraProperties") |
|||
.HasColumnType("longtext") |
|||
.HasColumnName("ExtraProperties"); |
|||
|
|||
b.Property<string>("GroupName") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.Property<bool>("IsAvailableToHost") |
|||
.HasColumnType("tinyint(1)"); |
|||
|
|||
b.Property<bool>("IsVisibleToClients") |
|||
.HasColumnType("tinyint(1)"); |
|||
|
|||
b.Property<string>("Name") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.Property<string>("ParentName") |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.Property<string>("ValueType") |
|||
.HasMaxLength(2048) |
|||
.HasColumnType("varchar(2048)"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("GroupName"); |
|||
|
|||
b.HasIndex("Name") |
|||
.IsUnique(); |
|||
|
|||
b.ToTable("AbpFeatures", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureGroupDefinitionRecord", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("DisplayName") |
|||
.IsRequired() |
|||
.HasMaxLength(256) |
|||
.HasColumnType("varchar(256)"); |
|||
|
|||
b.Property<string>("ExtraProperties") |
|||
.HasColumnType("longtext") |
|||
.HasColumnName("ExtraProperties"); |
|||
|
|||
b.Property<string>("Name") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("Name") |
|||
.IsUnique(); |
|||
|
|||
b.ToTable("AbpFeatureGroups", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureValue", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("Name") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.Property<string>("ProviderKey") |
|||
.HasMaxLength(64) |
|||
.HasColumnType("varchar(64)"); |
|||
|
|||
b.Property<string>("ProviderName") |
|||
.HasMaxLength(64) |
|||
.HasColumnType("varchar(64)"); |
|||
|
|||
b.Property<string>("Value") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("Name", "ProviderName", "ProviderKey") |
|||
.IsUnique(); |
|||
|
|||
b.ToTable("AbpFeatureValues", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionDefinitionRecord", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("DisplayName") |
|||
.IsRequired() |
|||
.HasMaxLength(256) |
|||
.HasColumnType("varchar(256)"); |
|||
|
|||
b.Property<string>("ExtraProperties") |
|||
.HasColumnType("longtext") |
|||
.HasColumnName("ExtraProperties"); |
|||
|
|||
b.Property<string>("GroupName") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.Property<bool>("IsEnabled") |
|||
.HasColumnType("tinyint(1)"); |
|||
|
|||
b.Property<byte>("MultiTenancySide") |
|||
.HasColumnType("tinyint unsigned"); |
|||
|
|||
b.Property<string>("Name") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.Property<string>("ParentName") |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.Property<string>("Providers") |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.Property<string>("StateCheckers") |
|||
.HasMaxLength(256) |
|||
.HasColumnType("varchar(256)"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("GroupName"); |
|||
|
|||
b.HasIndex("Name") |
|||
.IsUnique(); |
|||
|
|||
b.ToTable("AbpPermissions", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGrant", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("Name") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.Property<string>("ProviderKey") |
|||
.IsRequired() |
|||
.HasMaxLength(64) |
|||
.HasColumnType("varchar(64)"); |
|||
|
|||
b.Property<string>("ProviderName") |
|||
.IsRequired() |
|||
.HasMaxLength(64) |
|||
.HasColumnType("varchar(64)"); |
|||
|
|||
b.Property<Guid?>("TenantId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("TenantId"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("TenantId", "Name", "ProviderName", "ProviderKey") |
|||
.IsUnique(); |
|||
|
|||
b.ToTable("AbpPermissionGrants", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGroupDefinitionRecord", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("DisplayName") |
|||
.IsRequired() |
|||
.HasMaxLength(256) |
|||
.HasColumnType("varchar(256)"); |
|||
|
|||
b.Property<string>("ExtraProperties") |
|||
.HasColumnType("longtext") |
|||
.HasColumnName("ExtraProperties"); |
|||
|
|||
b.Property<string>("Name") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("Name") |
|||
.IsUnique(); |
|||
|
|||
b.ToTable("AbpPermissionGroups", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("Volo.Abp.SettingManagement.Setting", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("Name") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.Property<string>("ProviderKey") |
|||
.HasMaxLength(64) |
|||
.HasColumnType("varchar(64)"); |
|||
|
|||
b.Property<string>("ProviderName") |
|||
.HasMaxLength(64) |
|||
.HasColumnType("varchar(64)"); |
|||
|
|||
b.Property<string>("Value") |
|||
.IsRequired() |
|||
.HasMaxLength(2048) |
|||
.HasColumnType("varchar(2048)"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("Name", "ProviderName", "ProviderKey") |
|||
.IsUnique(); |
|||
|
|||
b.ToTable("AbpSettings", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.Saas.Tenants.Tenant", b => |
|||
{ |
|||
b.HasOne("LINGYUN.Abp.Saas.Editions.Edition", "Edition") |
|||
.WithMany() |
|||
.HasForeignKey("EditionId"); |
|||
|
|||
b.Navigation("Edition"); |
|||
}); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.Saas.Tenants.TenantConnectionString", b => |
|||
{ |
|||
b.HasOne("LINGYUN.Abp.Saas.Tenants.Tenant", null) |
|||
.WithMany("ConnectionStrings") |
|||
.HasForeignKey("TenantId") |
|||
.OnDelete(DeleteBehavior.Cascade) |
|||
.IsRequired(); |
|||
}); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.Saas.Tenants.Tenant", b => |
|||
{ |
|||
b.Navigation("ConnectionStrings"); |
|||
}); |
|||
#pragma warning restore 612, 618
|
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,388 @@ |
|||
using System; |
|||
using Microsoft.EntityFrameworkCore.Migrations; |
|||
|
|||
#nullable disable |
|||
|
|||
namespace LINGYUN.Abp.MicroService.AdminService.EntityFrameworkCore.Migrations |
|||
{ |
|||
/// <inheritdoc />
|
|||
public partial class InitialBackendAdmin : Migration |
|||
{ |
|||
/// <inheritdoc />
|
|||
protected override void Up(MigrationBuilder migrationBuilder) |
|||
{ |
|||
migrationBuilder.AlterDatabase() |
|||
.Annotation("MySql:CharSet", "utf8mb4"); |
|||
|
|||
migrationBuilder.CreateTable( |
|||
name: "AbpEditions", |
|||
columns: table => new |
|||
{ |
|||
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"), |
|||
DisplayName = table.Column<string>(type: "varchar(64)", maxLength: 64, nullable: false) |
|||
.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"), |
|||
IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false), |
|||
DeleterId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"), |
|||
DeletionTime = table.Column<DateTime>(type: "datetime(6)", nullable: true) |
|||
}, |
|||
constraints: table => |
|||
{ |
|||
table.PrimaryKey("PK_AbpEditions", x => x.Id); |
|||
}) |
|||
.Annotation("MySql:CharSet", "utf8mb4"); |
|||
|
|||
migrationBuilder.CreateTable( |
|||
name: "AbpFeatureGroups", |
|||
columns: table => new |
|||
{ |
|||
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"), |
|||
Name = table.Column<string>(type: "varchar(128)", maxLength: 128, nullable: false) |
|||
.Annotation("MySql:CharSet", "utf8mb4"), |
|||
DisplayName = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: false) |
|||
.Annotation("MySql:CharSet", "utf8mb4"), |
|||
ExtraProperties = table.Column<string>(type: "longtext", nullable: true) |
|||
.Annotation("MySql:CharSet", "utf8mb4") |
|||
}, |
|||
constraints: table => |
|||
{ |
|||
table.PrimaryKey("PK_AbpFeatureGroups", x => x.Id); |
|||
}) |
|||
.Annotation("MySql:CharSet", "utf8mb4"); |
|||
|
|||
migrationBuilder.CreateTable( |
|||
name: "AbpFeatures", |
|||
columns: table => new |
|||
{ |
|||
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"), |
|||
GroupName = table.Column<string>(type: "varchar(128)", maxLength: 128, nullable: false) |
|||
.Annotation("MySql:CharSet", "utf8mb4"), |
|||
Name = table.Column<string>(type: "varchar(128)", maxLength: 128, nullable: false) |
|||
.Annotation("MySql:CharSet", "utf8mb4"), |
|||
ParentName = table.Column<string>(type: "varchar(128)", maxLength: 128, nullable: true) |
|||
.Annotation("MySql:CharSet", "utf8mb4"), |
|||
DisplayName = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: false) |
|||
.Annotation("MySql:CharSet", "utf8mb4"), |
|||
Description = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: true) |
|||
.Annotation("MySql:CharSet", "utf8mb4"), |
|||
DefaultValue = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: true) |
|||
.Annotation("MySql:CharSet", "utf8mb4"), |
|||
IsVisibleToClients = table.Column<bool>(type: "tinyint(1)", nullable: false), |
|||
IsAvailableToHost = table.Column<bool>(type: "tinyint(1)", nullable: false), |
|||
AllowedProviders = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: true) |
|||
.Annotation("MySql:CharSet", "utf8mb4"), |
|||
ValueType = table.Column<string>(type: "varchar(2048)", maxLength: 2048, nullable: true) |
|||
.Annotation("MySql:CharSet", "utf8mb4"), |
|||
ExtraProperties = table.Column<string>(type: "longtext", nullable: true) |
|||
.Annotation("MySql:CharSet", "utf8mb4") |
|||
}, |
|||
constraints: table => |
|||
{ |
|||
table.PrimaryKey("PK_AbpFeatures", x => x.Id); |
|||
}) |
|||
.Annotation("MySql:CharSet", "utf8mb4"); |
|||
|
|||
migrationBuilder.CreateTable( |
|||
name: "AbpFeatureValues", |
|||
columns: table => new |
|||
{ |
|||
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"), |
|||
Name = table.Column<string>(type: "varchar(128)", maxLength: 128, nullable: false) |
|||
.Annotation("MySql:CharSet", "utf8mb4"), |
|||
Value = table.Column<string>(type: "varchar(128)", maxLength: 128, nullable: false) |
|||
.Annotation("MySql:CharSet", "utf8mb4"), |
|||
ProviderName = table.Column<string>(type: "varchar(64)", maxLength: 64, nullable: true) |
|||
.Annotation("MySql:CharSet", "utf8mb4"), |
|||
ProviderKey = table.Column<string>(type: "varchar(64)", maxLength: 64, nullable: true) |
|||
.Annotation("MySql:CharSet", "utf8mb4") |
|||
}, |
|||
constraints: table => |
|||
{ |
|||
table.PrimaryKey("PK_AbpFeatureValues", x => x.Id); |
|||
}) |
|||
.Annotation("MySql:CharSet", "utf8mb4"); |
|||
|
|||
migrationBuilder.CreateTable( |
|||
name: "AbpPermissionGrants", |
|||
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"), |
|||
Name = table.Column<string>(type: "varchar(128)", maxLength: 128, nullable: false) |
|||
.Annotation("MySql:CharSet", "utf8mb4"), |
|||
ProviderName = table.Column<string>(type: "varchar(64)", maxLength: 64, nullable: false) |
|||
.Annotation("MySql:CharSet", "utf8mb4"), |
|||
ProviderKey = table.Column<string>(type: "varchar(64)", maxLength: 64, nullable: false) |
|||
.Annotation("MySql:CharSet", "utf8mb4") |
|||
}, |
|||
constraints: table => |
|||
{ |
|||
table.PrimaryKey("PK_AbpPermissionGrants", x => x.Id); |
|||
}) |
|||
.Annotation("MySql:CharSet", "utf8mb4"); |
|||
|
|||
migrationBuilder.CreateTable( |
|||
name: "AbpPermissionGroups", |
|||
columns: table => new |
|||
{ |
|||
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"), |
|||
Name = table.Column<string>(type: "varchar(128)", maxLength: 128, nullable: false) |
|||
.Annotation("MySql:CharSet", "utf8mb4"), |
|||
DisplayName = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: false) |
|||
.Annotation("MySql:CharSet", "utf8mb4"), |
|||
ExtraProperties = table.Column<string>(type: "longtext", nullable: true) |
|||
.Annotation("MySql:CharSet", "utf8mb4") |
|||
}, |
|||
constraints: table => |
|||
{ |
|||
table.PrimaryKey("PK_AbpPermissionGroups", x => x.Id); |
|||
}) |
|||
.Annotation("MySql:CharSet", "utf8mb4"); |
|||
|
|||
migrationBuilder.CreateTable( |
|||
name: "AbpPermissions", |
|||
columns: table => new |
|||
{ |
|||
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"), |
|||
GroupName = table.Column<string>(type: "varchar(128)", maxLength: 128, nullable: false) |
|||
.Annotation("MySql:CharSet", "utf8mb4"), |
|||
Name = table.Column<string>(type: "varchar(128)", maxLength: 128, nullable: false) |
|||
.Annotation("MySql:CharSet", "utf8mb4"), |
|||
ParentName = table.Column<string>(type: "varchar(128)", maxLength: 128, nullable: true) |
|||
.Annotation("MySql:CharSet", "utf8mb4"), |
|||
DisplayName = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: false) |
|||
.Annotation("MySql:CharSet", "utf8mb4"), |
|||
IsEnabled = table.Column<bool>(type: "tinyint(1)", nullable: false), |
|||
MultiTenancySide = table.Column<byte>(type: "tinyint unsigned", nullable: false), |
|||
Providers = table.Column<string>(type: "varchar(128)", maxLength: 128, nullable: true) |
|||
.Annotation("MySql:CharSet", "utf8mb4"), |
|||
StateCheckers = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: true) |
|||
.Annotation("MySql:CharSet", "utf8mb4"), |
|||
ExtraProperties = table.Column<string>(type: "longtext", nullable: true) |
|||
.Annotation("MySql:CharSet", "utf8mb4") |
|||
}, |
|||
constraints: table => |
|||
{ |
|||
table.PrimaryKey("PK_AbpPermissions", x => x.Id); |
|||
}) |
|||
.Annotation("MySql:CharSet", "utf8mb4"); |
|||
|
|||
migrationBuilder.CreateTable( |
|||
name: "AbpSettings", |
|||
columns: table => new |
|||
{ |
|||
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"), |
|||
Name = table.Column<string>(type: "varchar(128)", maxLength: 128, nullable: false) |
|||
.Annotation("MySql:CharSet", "utf8mb4"), |
|||
Value = table.Column<string>(type: "varchar(2048)", maxLength: 2048, nullable: false) |
|||
.Annotation("MySql:CharSet", "utf8mb4"), |
|||
ProviderName = table.Column<string>(type: "varchar(64)", maxLength: 64, nullable: true) |
|||
.Annotation("MySql:CharSet", "utf8mb4"), |
|||
ProviderKey = table.Column<string>(type: "varchar(64)", maxLength: 64, nullable: true) |
|||
.Annotation("MySql:CharSet", "utf8mb4") |
|||
}, |
|||
constraints: table => |
|||
{ |
|||
table.PrimaryKey("PK_AbpSettings", x => x.Id); |
|||
}) |
|||
.Annotation("MySql:CharSet", "utf8mb4"); |
|||
|
|||
migrationBuilder.CreateTable( |
|||
name: "AbpTextTemplates", |
|||
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"), |
|||
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"), |
|||
Content = table.Column<string>(type: "longtext", maxLength: 1048576, nullable: true) |
|||
.Annotation("MySql:CharSet", "utf8mb4"), |
|||
Culture = table.Column<string>(type: "varchar(30)", maxLength: 30, 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_AbpTextTemplates", x => x.Id); |
|||
}) |
|||
.Annotation("MySql:CharSet", "utf8mb4"); |
|||
|
|||
migrationBuilder.CreateTable( |
|||
name: "AbpTenants", |
|||
columns: table => new |
|||
{ |
|||
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"), |
|||
Name = table.Column<string>(type: "varchar(64)", maxLength: 64, nullable: false) |
|||
.Annotation("MySql:CharSet", "utf8mb4"), |
|||
IsActive = table.Column<bool>(type: "tinyint(1)", nullable: false), |
|||
EnableTime = table.Column<DateTime>(type: "datetime(6)", nullable: true), |
|||
DisableTime = table.Column<DateTime>(type: "datetime(6)", nullable: true), |
|||
EditionId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"), |
|||
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"), |
|||
IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false), |
|||
DeleterId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"), |
|||
DeletionTime = table.Column<DateTime>(type: "datetime(6)", nullable: true) |
|||
}, |
|||
constraints: table => |
|||
{ |
|||
table.PrimaryKey("PK_AbpTenants", x => x.Id); |
|||
table.ForeignKey( |
|||
name: "FK_AbpTenants_AbpEditions_EditionId", |
|||
column: x => x.EditionId, |
|||
principalTable: "AbpEditions", |
|||
principalColumn: "Id"); |
|||
}) |
|||
.Annotation("MySql:CharSet", "utf8mb4"); |
|||
|
|||
migrationBuilder.CreateTable( |
|||
name: "AbpTenantConnectionStrings", |
|||
columns: table => new |
|||
{ |
|||
TenantId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"), |
|||
Name = table.Column<string>(type: "varchar(64)", maxLength: 64, nullable: false) |
|||
.Annotation("MySql:CharSet", "utf8mb4"), |
|||
Value = table.Column<string>(type: "varchar(1024)", maxLength: 1024, nullable: false) |
|||
.Annotation("MySql:CharSet", "utf8mb4") |
|||
}, |
|||
constraints: table => |
|||
{ |
|||
table.PrimaryKey("PK_AbpTenantConnectionStrings", x => new { x.TenantId, x.Name }); |
|||
table.ForeignKey( |
|||
name: "FK_AbpTenantConnectionStrings_AbpTenants_TenantId", |
|||
column: x => x.TenantId, |
|||
principalTable: "AbpTenants", |
|||
principalColumn: "Id", |
|||
onDelete: ReferentialAction.Cascade); |
|||
}) |
|||
.Annotation("MySql:CharSet", "utf8mb4"); |
|||
|
|||
migrationBuilder.CreateIndex( |
|||
name: "IX_AbpEditions_DisplayName", |
|||
table: "AbpEditions", |
|||
column: "DisplayName"); |
|||
|
|||
migrationBuilder.CreateIndex( |
|||
name: "IX_AbpFeatureGroups_Name", |
|||
table: "AbpFeatureGroups", |
|||
column: "Name", |
|||
unique: true); |
|||
|
|||
migrationBuilder.CreateIndex( |
|||
name: "IX_AbpFeatures_GroupName", |
|||
table: "AbpFeatures", |
|||
column: "GroupName"); |
|||
|
|||
migrationBuilder.CreateIndex( |
|||
name: "IX_AbpFeatures_Name", |
|||
table: "AbpFeatures", |
|||
column: "Name", |
|||
unique: true); |
|||
|
|||
migrationBuilder.CreateIndex( |
|||
name: "IX_AbpFeatureValues_Name_ProviderName_ProviderKey", |
|||
table: "AbpFeatureValues", |
|||
columns: new[] { "Name", "ProviderName", "ProviderKey" }, |
|||
unique: true); |
|||
|
|||
migrationBuilder.CreateIndex( |
|||
name: "IX_AbpPermissionGrants_TenantId_Name_ProviderName_ProviderKey", |
|||
table: "AbpPermissionGrants", |
|||
columns: new[] { "TenantId", "Name", "ProviderName", "ProviderKey" }, |
|||
unique: true); |
|||
|
|||
migrationBuilder.CreateIndex( |
|||
name: "IX_AbpPermissionGroups_Name", |
|||
table: "AbpPermissionGroups", |
|||
column: "Name", |
|||
unique: true); |
|||
|
|||
migrationBuilder.CreateIndex( |
|||
name: "IX_AbpPermissions_GroupName", |
|||
table: "AbpPermissions", |
|||
column: "GroupName"); |
|||
|
|||
migrationBuilder.CreateIndex( |
|||
name: "IX_AbpPermissions_Name", |
|||
table: "AbpPermissions", |
|||
column: "Name", |
|||
unique: true); |
|||
|
|||
migrationBuilder.CreateIndex( |
|||
name: "IX_AbpSettings_Name_ProviderName_ProviderKey", |
|||
table: "AbpSettings", |
|||
columns: new[] { "Name", "ProviderName", "ProviderKey" }, |
|||
unique: true); |
|||
|
|||
migrationBuilder.CreateIndex( |
|||
name: "IX_AbpTenants_EditionId", |
|||
table: "AbpTenants", |
|||
column: "EditionId"); |
|||
|
|||
migrationBuilder.CreateIndex( |
|||
name: "IX_AbpTenants_Name", |
|||
table: "AbpTenants", |
|||
column: "Name"); |
|||
|
|||
migrationBuilder.CreateIndex( |
|||
name: "IX_Tenant_Text_Template_Name", |
|||
table: "AbpTextTemplates", |
|||
columns: new[] { "TenantId", "Name" }); |
|||
} |
|||
|
|||
/// <inheritdoc />
|
|||
protected override void Down(MigrationBuilder migrationBuilder) |
|||
{ |
|||
migrationBuilder.DropTable( |
|||
name: "AbpFeatureGroups"); |
|||
|
|||
migrationBuilder.DropTable( |
|||
name: "AbpFeatures"); |
|||
|
|||
migrationBuilder.DropTable( |
|||
name: "AbpFeatureValues"); |
|||
|
|||
migrationBuilder.DropTable( |
|||
name: "AbpPermissionGrants"); |
|||
|
|||
migrationBuilder.DropTable( |
|||
name: "AbpPermissionGroups"); |
|||
|
|||
migrationBuilder.DropTable( |
|||
name: "AbpPermissions"); |
|||
|
|||
migrationBuilder.DropTable( |
|||
name: "AbpSettings"); |
|||
|
|||
migrationBuilder.DropTable( |
|||
name: "AbpTenantConnectionStrings"); |
|||
|
|||
migrationBuilder.DropTable( |
|||
name: "AbpTextTemplates"); |
|||
|
|||
migrationBuilder.DropTable( |
|||
name: "AbpTenants"); |
|||
|
|||
migrationBuilder.DropTable( |
|||
name: "AbpEditions"); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,577 @@ |
|||
// <auto-generated />
|
|||
using System; |
|||
using Microsoft.EntityFrameworkCore; |
|||
using Microsoft.EntityFrameworkCore.Infrastructure; |
|||
using Microsoft.EntityFrameworkCore.Migrations; |
|||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion; |
|||
using Volo.Abp.EntityFrameworkCore; |
|||
|
|||
#nullable disable |
|||
|
|||
namespace LINGYUN.Abp.MicroService.AdminService.EntityFrameworkCore.Migrations |
|||
{ |
|||
[DbContext(typeof(AdminServiceMigrationsDbContext))] |
|||
[Migration("20230304062910_Add-Text-Template-Definition")] |
|||
partial class AddTextTemplateDefinition |
|||
{ |
|||
/// <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.Saas.Editions.Edition", 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<Guid?>("DeleterId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("DeleterId"); |
|||
|
|||
b.Property<DateTime?>("DeletionTime") |
|||
.HasColumnType("datetime(6)") |
|||
.HasColumnName("DeletionTime"); |
|||
|
|||
b.Property<string>("DisplayName") |
|||
.IsRequired() |
|||
.HasMaxLength(64) |
|||
.HasColumnType("varchar(64)"); |
|||
|
|||
b.Property<string>("ExtraProperties") |
|||
.HasColumnType("longtext") |
|||
.HasColumnName("ExtraProperties"); |
|||
|
|||
b.Property<bool>("IsDeleted") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("tinyint(1)") |
|||
.HasDefaultValue(false) |
|||
.HasColumnName("IsDeleted"); |
|||
|
|||
b.Property<DateTime?>("LastModificationTime") |
|||
.HasColumnType("datetime(6)") |
|||
.HasColumnName("LastModificationTime"); |
|||
|
|||
b.Property<Guid?>("LastModifierId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("LastModifierId"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("DisplayName"); |
|||
|
|||
b.ToTable("AbpEditions", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.Saas.Tenants.Tenant", 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<Guid?>("DeleterId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("DeleterId"); |
|||
|
|||
b.Property<DateTime?>("DeletionTime") |
|||
.HasColumnType("datetime(6)") |
|||
.HasColumnName("DeletionTime"); |
|||
|
|||
b.Property<DateTime?>("DisableTime") |
|||
.HasColumnType("datetime(6)"); |
|||
|
|||
b.Property<Guid?>("EditionId") |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<DateTime?>("EnableTime") |
|||
.HasColumnType("datetime(6)"); |
|||
|
|||
b.Property<string>("ExtraProperties") |
|||
.HasColumnType("longtext") |
|||
.HasColumnName("ExtraProperties"); |
|||
|
|||
b.Property<bool>("IsActive") |
|||
.HasColumnType("tinyint(1)"); |
|||
|
|||
b.Property<bool>("IsDeleted") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("tinyint(1)") |
|||
.HasDefaultValue(false) |
|||
.HasColumnName("IsDeleted"); |
|||
|
|||
b.Property<DateTime?>("LastModificationTime") |
|||
.HasColumnType("datetime(6)") |
|||
.HasColumnName("LastModificationTime"); |
|||
|
|||
b.Property<Guid?>("LastModifierId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("LastModifierId"); |
|||
|
|||
b.Property<string>("Name") |
|||
.IsRequired() |
|||
.HasMaxLength(64) |
|||
.HasColumnType("varchar(64)"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("EditionId"); |
|||
|
|||
b.HasIndex("Name"); |
|||
|
|||
b.ToTable("AbpTenants", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.Saas.Tenants.TenantConnectionString", b => |
|||
{ |
|||
b.Property<Guid>("TenantId") |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("Name") |
|||
.HasMaxLength(64) |
|||
.HasColumnType("varchar(64)"); |
|||
|
|||
b.Property<string>("Value") |
|||
.IsRequired() |
|||
.HasMaxLength(1024) |
|||
.HasColumnType("varchar(1024)"); |
|||
|
|||
b.HasKey("TenantId", "Name"); |
|||
|
|||
b.ToTable("AbpTenantConnectionStrings", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.TextTemplating.TextTemplate", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("Content") |
|||
.HasMaxLength(1048576) |
|||
.HasColumnType("longtext") |
|||
.HasColumnName("Content"); |
|||
|
|||
b.Property<DateTime>("CreationTime") |
|||
.HasColumnType("datetime(6)") |
|||
.HasColumnName("CreationTime"); |
|||
|
|||
b.Property<Guid?>("CreatorId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("CreatorId"); |
|||
|
|||
b.Property<string>("Culture") |
|||
.HasMaxLength(30) |
|||
.HasColumnType("varchar(30)") |
|||
.HasColumnName("Culture"); |
|||
|
|||
b.Property<string>("DisplayName") |
|||
.IsRequired() |
|||
.HasMaxLength(100) |
|||
.HasColumnType("varchar(100)") |
|||
.HasColumnName("DisplayName"); |
|||
|
|||
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<Guid?>("TenantId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("TenantId"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("TenantId", "Name") |
|||
.HasDatabaseName("IX_Tenant_Text_Template_Name"); |
|||
|
|||
b.ToTable("AbpTextTemplates", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.TextTemplating.TextTemplateDefinition", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("ConcurrencyStamp") |
|||
.IsConcurrencyToken() |
|||
.HasMaxLength(40) |
|||
.HasColumnType("varchar(40)") |
|||
.HasColumnName("ConcurrencyStamp"); |
|||
|
|||
b.Property<string>("DefaultCultureName") |
|||
.HasMaxLength(30) |
|||
.HasColumnType("varchar(30)") |
|||
.HasColumnName("DefaultCultureName"); |
|||
|
|||
b.Property<string>("DisplayName") |
|||
.IsRequired() |
|||
.HasMaxLength(512) |
|||
.HasColumnType("varchar(512)") |
|||
.HasColumnName("DisplayName"); |
|||
|
|||
b.Property<string>("ExtraProperties") |
|||
.HasColumnType("longtext") |
|||
.HasColumnName("ExtraProperties"); |
|||
|
|||
b.Property<bool>("IsInlineLocalized") |
|||
.HasColumnType("tinyint(1)"); |
|||
|
|||
b.Property<bool>("IsLayout") |
|||
.HasColumnType("tinyint(1)"); |
|||
|
|||
b.Property<string>("Layout") |
|||
.HasMaxLength(60) |
|||
.HasColumnType("varchar(60)") |
|||
.HasColumnName("Layout"); |
|||
|
|||
b.Property<string>("Name") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)") |
|||
.HasColumnName("Name"); |
|||
|
|||
b.Property<string>("RenderEngine") |
|||
.HasMaxLength(30) |
|||
.HasColumnType("varchar(30)") |
|||
.HasColumnName("RenderEngine"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.ToTable("AbpTextTemplateDefinitions", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureDefinitionRecord", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("AllowedProviders") |
|||
.HasMaxLength(256) |
|||
.HasColumnType("varchar(256)"); |
|||
|
|||
b.Property<string>("DefaultValue") |
|||
.HasMaxLength(256) |
|||
.HasColumnType("varchar(256)"); |
|||
|
|||
b.Property<string>("Description") |
|||
.HasMaxLength(256) |
|||
.HasColumnType("varchar(256)"); |
|||
|
|||
b.Property<string>("DisplayName") |
|||
.IsRequired() |
|||
.HasMaxLength(256) |
|||
.HasColumnType("varchar(256)"); |
|||
|
|||
b.Property<string>("ExtraProperties") |
|||
.HasColumnType("longtext") |
|||
.HasColumnName("ExtraProperties"); |
|||
|
|||
b.Property<string>("GroupName") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.Property<bool>("IsAvailableToHost") |
|||
.HasColumnType("tinyint(1)"); |
|||
|
|||
b.Property<bool>("IsVisibleToClients") |
|||
.HasColumnType("tinyint(1)"); |
|||
|
|||
b.Property<string>("Name") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.Property<string>("ParentName") |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.Property<string>("ValueType") |
|||
.HasMaxLength(2048) |
|||
.HasColumnType("varchar(2048)"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("GroupName"); |
|||
|
|||
b.HasIndex("Name") |
|||
.IsUnique(); |
|||
|
|||
b.ToTable("AbpFeatures", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureGroupDefinitionRecord", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("DisplayName") |
|||
.IsRequired() |
|||
.HasMaxLength(256) |
|||
.HasColumnType("varchar(256)"); |
|||
|
|||
b.Property<string>("ExtraProperties") |
|||
.HasColumnType("longtext") |
|||
.HasColumnName("ExtraProperties"); |
|||
|
|||
b.Property<string>("Name") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("Name") |
|||
.IsUnique(); |
|||
|
|||
b.ToTable("AbpFeatureGroups", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureValue", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("Name") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.Property<string>("ProviderKey") |
|||
.HasMaxLength(64) |
|||
.HasColumnType("varchar(64)"); |
|||
|
|||
b.Property<string>("ProviderName") |
|||
.HasMaxLength(64) |
|||
.HasColumnType("varchar(64)"); |
|||
|
|||
b.Property<string>("Value") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("Name", "ProviderName", "ProviderKey") |
|||
.IsUnique(); |
|||
|
|||
b.ToTable("AbpFeatureValues", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionDefinitionRecord", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("DisplayName") |
|||
.IsRequired() |
|||
.HasMaxLength(256) |
|||
.HasColumnType("varchar(256)"); |
|||
|
|||
b.Property<string>("ExtraProperties") |
|||
.HasColumnType("longtext") |
|||
.HasColumnName("ExtraProperties"); |
|||
|
|||
b.Property<string>("GroupName") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.Property<bool>("IsEnabled") |
|||
.HasColumnType("tinyint(1)"); |
|||
|
|||
b.Property<byte>("MultiTenancySide") |
|||
.HasColumnType("tinyint unsigned"); |
|||
|
|||
b.Property<string>("Name") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.Property<string>("ParentName") |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.Property<string>("Providers") |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.Property<string>("StateCheckers") |
|||
.HasMaxLength(256) |
|||
.HasColumnType("varchar(256)"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("GroupName"); |
|||
|
|||
b.HasIndex("Name") |
|||
.IsUnique(); |
|||
|
|||
b.ToTable("AbpPermissions", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGrant", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("Name") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.Property<string>("ProviderKey") |
|||
.IsRequired() |
|||
.HasMaxLength(64) |
|||
.HasColumnType("varchar(64)"); |
|||
|
|||
b.Property<string>("ProviderName") |
|||
.IsRequired() |
|||
.HasMaxLength(64) |
|||
.HasColumnType("varchar(64)"); |
|||
|
|||
b.Property<Guid?>("TenantId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("TenantId"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("TenantId", "Name", "ProviderName", "ProviderKey") |
|||
.IsUnique(); |
|||
|
|||
b.ToTable("AbpPermissionGrants", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGroupDefinitionRecord", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("DisplayName") |
|||
.IsRequired() |
|||
.HasMaxLength(256) |
|||
.HasColumnType("varchar(256)"); |
|||
|
|||
b.Property<string>("ExtraProperties") |
|||
.HasColumnType("longtext") |
|||
.HasColumnName("ExtraProperties"); |
|||
|
|||
b.Property<string>("Name") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("Name") |
|||
.IsUnique(); |
|||
|
|||
b.ToTable("AbpPermissionGroups", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("Volo.Abp.SettingManagement.Setting", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("Name") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.Property<string>("ProviderKey") |
|||
.HasMaxLength(64) |
|||
.HasColumnType("varchar(64)"); |
|||
|
|||
b.Property<string>("ProviderName") |
|||
.HasMaxLength(64) |
|||
.HasColumnType("varchar(64)"); |
|||
|
|||
b.Property<string>("Value") |
|||
.IsRequired() |
|||
.HasMaxLength(2048) |
|||
.HasColumnType("varchar(2048)"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("Name", "ProviderName", "ProviderKey") |
|||
.IsUnique(); |
|||
|
|||
b.ToTable("AbpSettings", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.Saas.Tenants.Tenant", b => |
|||
{ |
|||
b.HasOne("LINGYUN.Abp.Saas.Editions.Edition", "Edition") |
|||
.WithMany() |
|||
.HasForeignKey("EditionId"); |
|||
|
|||
b.Navigation("Edition"); |
|||
}); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.Saas.Tenants.TenantConnectionString", b => |
|||
{ |
|||
b.HasOne("LINGYUN.Abp.Saas.Tenants.Tenant", null) |
|||
.WithMany("ConnectionStrings") |
|||
.HasForeignKey("TenantId") |
|||
.OnDelete(DeleteBehavior.Cascade) |
|||
.IsRequired(); |
|||
}); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.Saas.Tenants.Tenant", b => |
|||
{ |
|||
b.Navigation("ConnectionStrings"); |
|||
}); |
|||
#pragma warning restore 612, 618
|
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,50 @@ |
|||
using System; |
|||
using Microsoft.EntityFrameworkCore.Migrations; |
|||
|
|||
#nullable disable |
|||
|
|||
namespace LINGYUN.Abp.MicroService.AdminService.EntityFrameworkCore.Migrations |
|||
{ |
|||
/// <inheritdoc />
|
|||
public partial class AddTextTemplateDefinition : Migration |
|||
{ |
|||
/// <inheritdoc />
|
|||
protected override void Up(MigrationBuilder migrationBuilder) |
|||
{ |
|||
migrationBuilder.CreateTable( |
|||
name: "AbpTextTemplateDefinitions", |
|||
columns: table => new |
|||
{ |
|||
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"), |
|||
Name = table.Column<string>(type: "varchar(128)", maxLength: 128, nullable: false) |
|||
.Annotation("MySql:CharSet", "utf8mb4"), |
|||
DisplayName = table.Column<string>(type: "varchar(512)", maxLength: 512, nullable: false) |
|||
.Annotation("MySql:CharSet", "utf8mb4"), |
|||
IsLayout = table.Column<bool>(type: "tinyint(1)", nullable: false), |
|||
Layout = table.Column<string>(type: "varchar(60)", maxLength: 60, nullable: true) |
|||
.Annotation("MySql:CharSet", "utf8mb4"), |
|||
IsInlineLocalized = table.Column<bool>(type: "tinyint(1)", nullable: false), |
|||
DefaultCultureName = table.Column<string>(type: "varchar(30)", maxLength: 30, nullable: true) |
|||
.Annotation("MySql:CharSet", "utf8mb4"), |
|||
RenderEngine = table.Column<string>(type: "varchar(30)", maxLength: 30, 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") |
|||
}, |
|||
constraints: table => |
|||
{ |
|||
table.PrimaryKey("PK_AbpTextTemplateDefinitions", x => x.Id); |
|||
}) |
|||
.Annotation("MySql:CharSet", "utf8mb4"); |
|||
} |
|||
|
|||
/// <inheritdoc />
|
|||
protected override void Down(MigrationBuilder migrationBuilder) |
|||
{ |
|||
migrationBuilder.DropTable( |
|||
name: "AbpTextTemplateDefinitions"); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,581 @@ |
|||
// <auto-generated />
|
|||
using System; |
|||
using LINGYUN.Abp.MicroService.AdminService.EntityFrameworkCore; |
|||
using Microsoft.EntityFrameworkCore; |
|||
using Microsoft.EntityFrameworkCore.Infrastructure; |
|||
using Microsoft.EntityFrameworkCore.Migrations; |
|||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion; |
|||
using Volo.Abp.EntityFrameworkCore; |
|||
|
|||
#nullable disable |
|||
|
|||
namespace LINGYUN.Abp.MicroService.AdminService.EntityFrameworkCore.Migrations |
|||
{ |
|||
[DbContext(typeof(AdminServiceMigrationsDbContext))] |
|||
[Migration("20230304083526_Add-IsStatic-Field")] |
|||
partial class AddIsStaticField |
|||
{ |
|||
/// <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.Saas.Editions.Edition", 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<Guid?>("DeleterId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("DeleterId"); |
|||
|
|||
b.Property<DateTime?>("DeletionTime") |
|||
.HasColumnType("datetime(6)") |
|||
.HasColumnName("DeletionTime"); |
|||
|
|||
b.Property<string>("DisplayName") |
|||
.IsRequired() |
|||
.HasMaxLength(64) |
|||
.HasColumnType("varchar(64)"); |
|||
|
|||
b.Property<string>("ExtraProperties") |
|||
.HasColumnType("longtext") |
|||
.HasColumnName("ExtraProperties"); |
|||
|
|||
b.Property<bool>("IsDeleted") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("tinyint(1)") |
|||
.HasDefaultValue(false) |
|||
.HasColumnName("IsDeleted"); |
|||
|
|||
b.Property<DateTime?>("LastModificationTime") |
|||
.HasColumnType("datetime(6)") |
|||
.HasColumnName("LastModificationTime"); |
|||
|
|||
b.Property<Guid?>("LastModifierId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("LastModifierId"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("DisplayName"); |
|||
|
|||
b.ToTable("AbpEditions", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.Saas.Tenants.Tenant", 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<Guid?>("DeleterId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("DeleterId"); |
|||
|
|||
b.Property<DateTime?>("DeletionTime") |
|||
.HasColumnType("datetime(6)") |
|||
.HasColumnName("DeletionTime"); |
|||
|
|||
b.Property<DateTime?>("DisableTime") |
|||
.HasColumnType("datetime(6)"); |
|||
|
|||
b.Property<Guid?>("EditionId") |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<DateTime?>("EnableTime") |
|||
.HasColumnType("datetime(6)"); |
|||
|
|||
b.Property<string>("ExtraProperties") |
|||
.HasColumnType("longtext") |
|||
.HasColumnName("ExtraProperties"); |
|||
|
|||
b.Property<bool>("IsActive") |
|||
.HasColumnType("tinyint(1)"); |
|||
|
|||
b.Property<bool>("IsDeleted") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("tinyint(1)") |
|||
.HasDefaultValue(false) |
|||
.HasColumnName("IsDeleted"); |
|||
|
|||
b.Property<DateTime?>("LastModificationTime") |
|||
.HasColumnType("datetime(6)") |
|||
.HasColumnName("LastModificationTime"); |
|||
|
|||
b.Property<Guid?>("LastModifierId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("LastModifierId"); |
|||
|
|||
b.Property<string>("Name") |
|||
.IsRequired() |
|||
.HasMaxLength(64) |
|||
.HasColumnType("varchar(64)"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("EditionId"); |
|||
|
|||
b.HasIndex("Name"); |
|||
|
|||
b.ToTable("AbpTenants", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.Saas.Tenants.TenantConnectionString", b => |
|||
{ |
|||
b.Property<Guid>("TenantId") |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("Name") |
|||
.HasMaxLength(64) |
|||
.HasColumnType("varchar(64)"); |
|||
|
|||
b.Property<string>("Value") |
|||
.IsRequired() |
|||
.HasMaxLength(1024) |
|||
.HasColumnType("varchar(1024)"); |
|||
|
|||
b.HasKey("TenantId", "Name"); |
|||
|
|||
b.ToTable("AbpTenantConnectionStrings", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.TextTemplating.TextTemplate", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("Content") |
|||
.HasMaxLength(1048576) |
|||
.HasColumnType("longtext") |
|||
.HasColumnName("Content"); |
|||
|
|||
b.Property<DateTime>("CreationTime") |
|||
.HasColumnType("datetime(6)") |
|||
.HasColumnName("CreationTime"); |
|||
|
|||
b.Property<Guid?>("CreatorId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("CreatorId"); |
|||
|
|||
b.Property<string>("Culture") |
|||
.HasMaxLength(30) |
|||
.HasColumnType("varchar(30)") |
|||
.HasColumnName("Culture"); |
|||
|
|||
b.Property<string>("DisplayName") |
|||
.IsRequired() |
|||
.HasMaxLength(100) |
|||
.HasColumnType("varchar(100)") |
|||
.HasColumnName("DisplayName"); |
|||
|
|||
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<Guid?>("TenantId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("TenantId"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("TenantId", "Name") |
|||
.HasDatabaseName("IX_Tenant_Text_Template_Name"); |
|||
|
|||
b.ToTable("AbpTextTemplates", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.TextTemplating.TextTemplateDefinition", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("ConcurrencyStamp") |
|||
.IsConcurrencyToken() |
|||
.HasMaxLength(40) |
|||
.HasColumnType("varchar(40)") |
|||
.HasColumnName("ConcurrencyStamp"); |
|||
|
|||
b.Property<string>("DefaultCultureName") |
|||
.HasMaxLength(30) |
|||
.HasColumnType("varchar(30)") |
|||
.HasColumnName("DefaultCultureName"); |
|||
|
|||
b.Property<string>("DisplayName") |
|||
.IsRequired() |
|||
.HasMaxLength(512) |
|||
.HasColumnType("varchar(512)") |
|||
.HasColumnName("DisplayName"); |
|||
|
|||
b.Property<string>("ExtraProperties") |
|||
.HasColumnType("longtext") |
|||
.HasColumnName("ExtraProperties"); |
|||
|
|||
b.Property<bool>("IsInlineLocalized") |
|||
.HasColumnType("tinyint(1)"); |
|||
|
|||
b.Property<bool>("IsLayout") |
|||
.HasColumnType("tinyint(1)"); |
|||
|
|||
b.Property<bool>("IsStatic") |
|||
.HasColumnType("tinyint(1)"); |
|||
|
|||
b.Property<string>("Layout") |
|||
.HasMaxLength(60) |
|||
.HasColumnType("varchar(60)") |
|||
.HasColumnName("Layout"); |
|||
|
|||
b.Property<string>("Name") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)") |
|||
.HasColumnName("Name"); |
|||
|
|||
b.Property<string>("RenderEngine") |
|||
.HasMaxLength(30) |
|||
.HasColumnType("varchar(30)") |
|||
.HasColumnName("RenderEngine"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.ToTable("AbpTextTemplateDefinitions", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureDefinitionRecord", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("AllowedProviders") |
|||
.HasMaxLength(256) |
|||
.HasColumnType("varchar(256)"); |
|||
|
|||
b.Property<string>("DefaultValue") |
|||
.HasMaxLength(256) |
|||
.HasColumnType("varchar(256)"); |
|||
|
|||
b.Property<string>("Description") |
|||
.HasMaxLength(256) |
|||
.HasColumnType("varchar(256)"); |
|||
|
|||
b.Property<string>("DisplayName") |
|||
.IsRequired() |
|||
.HasMaxLength(256) |
|||
.HasColumnType("varchar(256)"); |
|||
|
|||
b.Property<string>("ExtraProperties") |
|||
.HasColumnType("longtext") |
|||
.HasColumnName("ExtraProperties"); |
|||
|
|||
b.Property<string>("GroupName") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.Property<bool>("IsAvailableToHost") |
|||
.HasColumnType("tinyint(1)"); |
|||
|
|||
b.Property<bool>("IsVisibleToClients") |
|||
.HasColumnType("tinyint(1)"); |
|||
|
|||
b.Property<string>("Name") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.Property<string>("ParentName") |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.Property<string>("ValueType") |
|||
.HasMaxLength(2048) |
|||
.HasColumnType("varchar(2048)"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("GroupName"); |
|||
|
|||
b.HasIndex("Name") |
|||
.IsUnique(); |
|||
|
|||
b.ToTable("AbpFeatures", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureGroupDefinitionRecord", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("DisplayName") |
|||
.IsRequired() |
|||
.HasMaxLength(256) |
|||
.HasColumnType("varchar(256)"); |
|||
|
|||
b.Property<string>("ExtraProperties") |
|||
.HasColumnType("longtext") |
|||
.HasColumnName("ExtraProperties"); |
|||
|
|||
b.Property<string>("Name") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("Name") |
|||
.IsUnique(); |
|||
|
|||
b.ToTable("AbpFeatureGroups", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureValue", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("Name") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.Property<string>("ProviderKey") |
|||
.HasMaxLength(64) |
|||
.HasColumnType("varchar(64)"); |
|||
|
|||
b.Property<string>("ProviderName") |
|||
.HasMaxLength(64) |
|||
.HasColumnType("varchar(64)"); |
|||
|
|||
b.Property<string>("Value") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("Name", "ProviderName", "ProviderKey") |
|||
.IsUnique(); |
|||
|
|||
b.ToTable("AbpFeatureValues", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionDefinitionRecord", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("DisplayName") |
|||
.IsRequired() |
|||
.HasMaxLength(256) |
|||
.HasColumnType("varchar(256)"); |
|||
|
|||
b.Property<string>("ExtraProperties") |
|||
.HasColumnType("longtext") |
|||
.HasColumnName("ExtraProperties"); |
|||
|
|||
b.Property<string>("GroupName") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.Property<bool>("IsEnabled") |
|||
.HasColumnType("tinyint(1)"); |
|||
|
|||
b.Property<byte>("MultiTenancySide") |
|||
.HasColumnType("tinyint unsigned"); |
|||
|
|||
b.Property<string>("Name") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.Property<string>("ParentName") |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.Property<string>("Providers") |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.Property<string>("StateCheckers") |
|||
.HasMaxLength(256) |
|||
.HasColumnType("varchar(256)"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("GroupName"); |
|||
|
|||
b.HasIndex("Name") |
|||
.IsUnique(); |
|||
|
|||
b.ToTable("AbpPermissions", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGrant", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("Name") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.Property<string>("ProviderKey") |
|||
.IsRequired() |
|||
.HasMaxLength(64) |
|||
.HasColumnType("varchar(64)"); |
|||
|
|||
b.Property<string>("ProviderName") |
|||
.IsRequired() |
|||
.HasMaxLength(64) |
|||
.HasColumnType("varchar(64)"); |
|||
|
|||
b.Property<Guid?>("TenantId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("TenantId"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("TenantId", "Name", "ProviderName", "ProviderKey") |
|||
.IsUnique(); |
|||
|
|||
b.ToTable("AbpPermissionGrants", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGroupDefinitionRecord", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("DisplayName") |
|||
.IsRequired() |
|||
.HasMaxLength(256) |
|||
.HasColumnType("varchar(256)"); |
|||
|
|||
b.Property<string>("ExtraProperties") |
|||
.HasColumnType("longtext") |
|||
.HasColumnName("ExtraProperties"); |
|||
|
|||
b.Property<string>("Name") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("Name") |
|||
.IsUnique(); |
|||
|
|||
b.ToTable("AbpPermissionGroups", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("Volo.Abp.SettingManagement.Setting", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("Name") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.Property<string>("ProviderKey") |
|||
.HasMaxLength(64) |
|||
.HasColumnType("varchar(64)"); |
|||
|
|||
b.Property<string>("ProviderName") |
|||
.HasMaxLength(64) |
|||
.HasColumnType("varchar(64)"); |
|||
|
|||
b.Property<string>("Value") |
|||
.IsRequired() |
|||
.HasMaxLength(2048) |
|||
.HasColumnType("varchar(2048)"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("Name", "ProviderName", "ProviderKey") |
|||
.IsUnique(); |
|||
|
|||
b.ToTable("AbpSettings", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.Saas.Tenants.Tenant", b => |
|||
{ |
|||
b.HasOne("LINGYUN.Abp.Saas.Editions.Edition", "Edition") |
|||
.WithMany() |
|||
.HasForeignKey("EditionId"); |
|||
|
|||
b.Navigation("Edition"); |
|||
}); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.Saas.Tenants.TenantConnectionString", b => |
|||
{ |
|||
b.HasOne("LINGYUN.Abp.Saas.Tenants.Tenant", null) |
|||
.WithMany("ConnectionStrings") |
|||
.HasForeignKey("TenantId") |
|||
.OnDelete(DeleteBehavior.Cascade) |
|||
.IsRequired(); |
|||
}); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.Saas.Tenants.Tenant", b => |
|||
{ |
|||
b.Navigation("ConnectionStrings"); |
|||
}); |
|||
#pragma warning restore 612, 618
|
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,29 @@ |
|||
using Microsoft.EntityFrameworkCore.Migrations; |
|||
|
|||
#nullable disable |
|||
|
|||
namespace LINGYUN.Abp.MicroService.AdminService.EntityFrameworkCore.Migrations |
|||
{ |
|||
/// <inheritdoc />
|
|||
public partial class AddIsStaticField : Migration |
|||
{ |
|||
/// <inheritdoc />
|
|||
protected override void Up(MigrationBuilder migrationBuilder) |
|||
{ |
|||
migrationBuilder.AddColumn<bool>( |
|||
name: "IsStatic", |
|||
table: "AbpTextTemplateDefinitions", |
|||
type: "tinyint(1)", |
|||
nullable: false, |
|||
defaultValue: false); |
|||
} |
|||
|
|||
/// <inheritdoc />
|
|||
protected override void Down(MigrationBuilder migrationBuilder) |
|||
{ |
|||
migrationBuilder.DropColumn( |
|||
name: "IsStatic", |
|||
table: "AbpTextTemplateDefinitions"); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,586 @@ |
|||
// <auto-generated />
|
|||
using System; |
|||
using Microsoft.EntityFrameworkCore; |
|||
using Microsoft.EntityFrameworkCore.Infrastructure; |
|||
using Microsoft.EntityFrameworkCore.Migrations; |
|||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion; |
|||
using Volo.Abp.EntityFrameworkCore; |
|||
|
|||
#nullable disable |
|||
|
|||
namespace LINGYUN.Abp.MicroService.AdminService.EntityFrameworkCore.Migrations |
|||
{ |
|||
[DbContext(typeof(AdminServiceMigrationsDbContext))] |
|||
[Migration("20230323070528_Upgrade-Abp-Framework-To-7.1.0")] |
|||
partial class UpgradeAbpFrameworkTo710 |
|||
{ |
|||
/// <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.Saas.Editions.Edition", 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<Guid?>("DeleterId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("DeleterId"); |
|||
|
|||
b.Property<DateTime?>("DeletionTime") |
|||
.HasColumnType("datetime(6)") |
|||
.HasColumnName("DeletionTime"); |
|||
|
|||
b.Property<string>("DisplayName") |
|||
.IsRequired() |
|||
.HasMaxLength(64) |
|||
.HasColumnType("varchar(64)"); |
|||
|
|||
b.Property<int>("EntityVersion") |
|||
.HasColumnType("int"); |
|||
|
|||
b.Property<string>("ExtraProperties") |
|||
.HasColumnType("longtext") |
|||
.HasColumnName("ExtraProperties"); |
|||
|
|||
b.Property<bool>("IsDeleted") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("tinyint(1)") |
|||
.HasDefaultValue(false) |
|||
.HasColumnName("IsDeleted"); |
|||
|
|||
b.Property<DateTime?>("LastModificationTime") |
|||
.HasColumnType("datetime(6)") |
|||
.HasColumnName("LastModificationTime"); |
|||
|
|||
b.Property<Guid?>("LastModifierId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("LastModifierId"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("DisplayName"); |
|||
|
|||
b.ToTable("AbpEditions", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.Saas.Tenants.Tenant", 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<Guid?>("DeleterId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("DeleterId"); |
|||
|
|||
b.Property<DateTime?>("DeletionTime") |
|||
.HasColumnType("datetime(6)") |
|||
.HasColumnName("DeletionTime"); |
|||
|
|||
b.Property<DateTime?>("DisableTime") |
|||
.HasColumnType("datetime(6)"); |
|||
|
|||
b.Property<Guid?>("EditionId") |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<DateTime?>("EnableTime") |
|||
.HasColumnType("datetime(6)"); |
|||
|
|||
b.Property<int>("EntityVersion") |
|||
.HasColumnType("int"); |
|||
|
|||
b.Property<string>("ExtraProperties") |
|||
.HasColumnType("longtext") |
|||
.HasColumnName("ExtraProperties"); |
|||
|
|||
b.Property<bool>("IsActive") |
|||
.HasColumnType("tinyint(1)"); |
|||
|
|||
b.Property<bool>("IsDeleted") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("tinyint(1)") |
|||
.HasDefaultValue(false) |
|||
.HasColumnName("IsDeleted"); |
|||
|
|||
b.Property<DateTime?>("LastModificationTime") |
|||
.HasColumnType("datetime(6)") |
|||
.HasColumnName("LastModificationTime"); |
|||
|
|||
b.Property<Guid?>("LastModifierId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("LastModifierId"); |
|||
|
|||
b.Property<string>("Name") |
|||
.IsRequired() |
|||
.HasMaxLength(64) |
|||
.HasColumnType("varchar(64)"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("EditionId"); |
|||
|
|||
b.HasIndex("Name"); |
|||
|
|||
b.ToTable("AbpTenants", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.Saas.Tenants.TenantConnectionString", b => |
|||
{ |
|||
b.Property<Guid>("TenantId") |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("Name") |
|||
.HasMaxLength(64) |
|||
.HasColumnType("varchar(64)"); |
|||
|
|||
b.Property<string>("Value") |
|||
.IsRequired() |
|||
.HasMaxLength(1024) |
|||
.HasColumnType("varchar(1024)"); |
|||
|
|||
b.HasKey("TenantId", "Name"); |
|||
|
|||
b.ToTable("AbpTenantConnectionStrings", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.TextTemplating.TextTemplate", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("Content") |
|||
.HasMaxLength(1048576) |
|||
.HasColumnType("longtext") |
|||
.HasColumnName("Content"); |
|||
|
|||
b.Property<DateTime>("CreationTime") |
|||
.HasColumnType("datetime(6)") |
|||
.HasColumnName("CreationTime"); |
|||
|
|||
b.Property<Guid?>("CreatorId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("CreatorId"); |
|||
|
|||
b.Property<string>("Culture") |
|||
.HasMaxLength(30) |
|||
.HasColumnType("varchar(30)") |
|||
.HasColumnName("Culture"); |
|||
|
|||
b.Property<string>("DisplayName") |
|||
.IsRequired() |
|||
.HasMaxLength(100) |
|||
.HasColumnType("varchar(100)") |
|||
.HasColumnName("DisplayName"); |
|||
|
|||
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<Guid?>("TenantId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("TenantId"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("TenantId", "Name") |
|||
.HasDatabaseName("IX_Tenant_Text_Template_Name"); |
|||
|
|||
b.ToTable("AbpTextTemplates", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.TextTemplating.TextTemplateDefinition", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("ConcurrencyStamp") |
|||
.IsConcurrencyToken() |
|||
.HasMaxLength(40) |
|||
.HasColumnType("varchar(40)") |
|||
.HasColumnName("ConcurrencyStamp"); |
|||
|
|||
b.Property<string>("DefaultCultureName") |
|||
.HasMaxLength(30) |
|||
.HasColumnType("varchar(30)") |
|||
.HasColumnName("DefaultCultureName"); |
|||
|
|||
b.Property<string>("DisplayName") |
|||
.IsRequired() |
|||
.HasMaxLength(512) |
|||
.HasColumnType("varchar(512)") |
|||
.HasColumnName("DisplayName"); |
|||
|
|||
b.Property<string>("ExtraProperties") |
|||
.HasColumnType("longtext") |
|||
.HasColumnName("ExtraProperties"); |
|||
|
|||
b.Property<bool>("IsInlineLocalized") |
|||
.HasColumnType("tinyint(1)"); |
|||
|
|||
b.Property<bool>("IsLayout") |
|||
.HasColumnType("tinyint(1)"); |
|||
|
|||
b.Property<bool>("IsStatic") |
|||
.HasColumnType("tinyint(1)"); |
|||
|
|||
b.Property<string>("Layout") |
|||
.HasMaxLength(60) |
|||
.HasColumnType("varchar(60)") |
|||
.HasColumnName("Layout"); |
|||
|
|||
b.Property<string>("Name") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)") |
|||
.HasColumnName("Name"); |
|||
|
|||
b.Property<string>("RenderEngine") |
|||
.HasMaxLength(30) |
|||
.HasColumnType("varchar(30)") |
|||
.HasColumnName("RenderEngine"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.ToTable("AbpTextTemplateDefinitions", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureDefinitionRecord", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("AllowedProviders") |
|||
.HasMaxLength(256) |
|||
.HasColumnType("varchar(256)"); |
|||
|
|||
b.Property<string>("DefaultValue") |
|||
.HasMaxLength(256) |
|||
.HasColumnType("varchar(256)"); |
|||
|
|||
b.Property<string>("Description") |
|||
.HasMaxLength(256) |
|||
.HasColumnType("varchar(256)"); |
|||
|
|||
b.Property<string>("DisplayName") |
|||
.IsRequired() |
|||
.HasMaxLength(256) |
|||
.HasColumnType("varchar(256)"); |
|||
|
|||
b.Property<string>("ExtraProperties") |
|||
.HasColumnType("longtext") |
|||
.HasColumnName("ExtraProperties"); |
|||
|
|||
b.Property<string>("GroupName") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.Property<bool>("IsAvailableToHost") |
|||
.HasColumnType("tinyint(1)"); |
|||
|
|||
b.Property<bool>("IsVisibleToClients") |
|||
.HasColumnType("tinyint(1)"); |
|||
|
|||
b.Property<string>("Name") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.Property<string>("ParentName") |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.Property<string>("ValueType") |
|||
.HasMaxLength(2048) |
|||
.HasColumnType("varchar(2048)"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("GroupName"); |
|||
|
|||
b.HasIndex("Name") |
|||
.IsUnique(); |
|||
|
|||
b.ToTable("AbpFeatures", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureGroupDefinitionRecord", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("DisplayName") |
|||
.IsRequired() |
|||
.HasMaxLength(256) |
|||
.HasColumnType("varchar(256)"); |
|||
|
|||
b.Property<string>("ExtraProperties") |
|||
.HasColumnType("longtext") |
|||
.HasColumnName("ExtraProperties"); |
|||
|
|||
b.Property<string>("Name") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("Name") |
|||
.IsUnique(); |
|||
|
|||
b.ToTable("AbpFeatureGroups", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureValue", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("Name") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.Property<string>("ProviderKey") |
|||
.HasMaxLength(64) |
|||
.HasColumnType("varchar(64)"); |
|||
|
|||
b.Property<string>("ProviderName") |
|||
.HasMaxLength(64) |
|||
.HasColumnType("varchar(64)"); |
|||
|
|||
b.Property<string>("Value") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("Name", "ProviderName", "ProviderKey") |
|||
.IsUnique(); |
|||
|
|||
b.ToTable("AbpFeatureValues", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionDefinitionRecord", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("DisplayName") |
|||
.IsRequired() |
|||
.HasMaxLength(256) |
|||
.HasColumnType("varchar(256)"); |
|||
|
|||
b.Property<string>("ExtraProperties") |
|||
.HasColumnType("longtext") |
|||
.HasColumnName("ExtraProperties"); |
|||
|
|||
b.Property<string>("GroupName") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.Property<bool>("IsEnabled") |
|||
.HasColumnType("tinyint(1)"); |
|||
|
|||
b.Property<byte>("MultiTenancySide") |
|||
.HasColumnType("tinyint unsigned"); |
|||
|
|||
b.Property<string>("Name") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.Property<string>("ParentName") |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.Property<string>("Providers") |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.Property<string>("StateCheckers") |
|||
.HasMaxLength(256) |
|||
.HasColumnType("varchar(256)"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("GroupName"); |
|||
|
|||
b.HasIndex("Name") |
|||
.IsUnique(); |
|||
|
|||
b.ToTable("AbpPermissions", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGrant", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("Name") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.Property<string>("ProviderKey") |
|||
.IsRequired() |
|||
.HasMaxLength(64) |
|||
.HasColumnType("varchar(64)"); |
|||
|
|||
b.Property<string>("ProviderName") |
|||
.IsRequired() |
|||
.HasMaxLength(64) |
|||
.HasColumnType("varchar(64)"); |
|||
|
|||
b.Property<Guid?>("TenantId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("TenantId"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("TenantId", "Name", "ProviderName", "ProviderKey") |
|||
.IsUnique(); |
|||
|
|||
b.ToTable("AbpPermissionGrants", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGroupDefinitionRecord", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("DisplayName") |
|||
.IsRequired() |
|||
.HasMaxLength(256) |
|||
.HasColumnType("varchar(256)"); |
|||
|
|||
b.Property<string>("ExtraProperties") |
|||
.HasColumnType("longtext") |
|||
.HasColumnName("ExtraProperties"); |
|||
|
|||
b.Property<string>("Name") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("Name") |
|||
.IsUnique(); |
|||
|
|||
b.ToTable("AbpPermissionGroups", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("Volo.Abp.SettingManagement.Setting", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("Name") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.Property<string>("ProviderKey") |
|||
.HasMaxLength(64) |
|||
.HasColumnType("varchar(64)"); |
|||
|
|||
b.Property<string>("ProviderName") |
|||
.HasMaxLength(64) |
|||
.HasColumnType("varchar(64)"); |
|||
|
|||
b.Property<string>("Value") |
|||
.IsRequired() |
|||
.HasMaxLength(2048) |
|||
.HasColumnType("varchar(2048)"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("Name", "ProviderName", "ProviderKey") |
|||
.IsUnique(); |
|||
|
|||
b.ToTable("AbpSettings", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.Saas.Tenants.Tenant", b => |
|||
{ |
|||
b.HasOne("LINGYUN.Abp.Saas.Editions.Edition", "Edition") |
|||
.WithMany() |
|||
.HasForeignKey("EditionId"); |
|||
|
|||
b.Navigation("Edition"); |
|||
}); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.Saas.Tenants.TenantConnectionString", b => |
|||
{ |
|||
b.HasOne("LINGYUN.Abp.Saas.Tenants.Tenant", null) |
|||
.WithMany("ConnectionStrings") |
|||
.HasForeignKey("TenantId") |
|||
.OnDelete(DeleteBehavior.Cascade) |
|||
.IsRequired(); |
|||
}); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.Saas.Tenants.Tenant", b => |
|||
{ |
|||
b.Navigation("ConnectionStrings"); |
|||
}); |
|||
#pragma warning restore 612, 618
|
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,40 @@ |
|||
using Microsoft.EntityFrameworkCore.Migrations; |
|||
|
|||
#nullable disable |
|||
|
|||
namespace LINGYUN.Abp.MicroService.AdminService.EntityFrameworkCore.Migrations |
|||
{ |
|||
/// <inheritdoc />
|
|||
public partial class UpgradeAbpFrameworkTo710 : Migration |
|||
{ |
|||
/// <inheritdoc />
|
|||
protected override void Up(MigrationBuilder migrationBuilder) |
|||
{ |
|||
migrationBuilder.AddColumn<int>( |
|||
name: "EntityVersion", |
|||
table: "AbpTenants", |
|||
type: "int", |
|||
nullable: false, |
|||
defaultValue: 0); |
|||
|
|||
migrationBuilder.AddColumn<int>( |
|||
name: "EntityVersion", |
|||
table: "AbpEditions", |
|||
type: "int", |
|||
nullable: false, |
|||
defaultValue: 0); |
|||
} |
|||
|
|||
/// <inheritdoc />
|
|||
protected override void Down(MigrationBuilder migrationBuilder) |
|||
{ |
|||
migrationBuilder.DropColumn( |
|||
name: "EntityVersion", |
|||
table: "AbpTenants"); |
|||
|
|||
migrationBuilder.DropColumn( |
|||
name: "EntityVersion", |
|||
table: "AbpEditions"); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,646 @@ |
|||
// <auto-generated />
|
|||
using System; |
|||
using Microsoft.EntityFrameworkCore; |
|||
using Microsoft.EntityFrameworkCore.Infrastructure; |
|||
using Microsoft.EntityFrameworkCore.Migrations; |
|||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion; |
|||
using Volo.Abp.EntityFrameworkCore; |
|||
|
|||
#nullable disable |
|||
|
|||
namespace LINGYUN.Abp.MicroService.AdminService.EntityFrameworkCore.Migrations |
|||
{ |
|||
[DbContext(typeof(AdminServiceMigrationsDbContext))] |
|||
[Migration("20231028084002_Upgrade-Abp-Framework-To-7.4.0")] |
|||
partial class UpgradeAbpFrameworkTo740 |
|||
{ |
|||
/// <inheritdoc />
|
|||
protected override void BuildTargetModel(ModelBuilder modelBuilder) |
|||
{ |
|||
#pragma warning disable 612, 618
|
|||
modelBuilder |
|||
.HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.MySql) |
|||
.HasAnnotation("ProductVersion", "7.0.10") |
|||
.HasAnnotation("Relational:MaxIdentifierLength", 64); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.Saas.Editions.Edition", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("ConcurrencyStamp") |
|||
.IsConcurrencyToken() |
|||
.IsRequired() |
|||
.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<Guid?>("DeleterId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("DeleterId"); |
|||
|
|||
b.Property<DateTime?>("DeletionTime") |
|||
.HasColumnType("datetime(6)") |
|||
.HasColumnName("DeletionTime"); |
|||
|
|||
b.Property<string>("DisplayName") |
|||
.IsRequired() |
|||
.HasMaxLength(64) |
|||
.HasColumnType("varchar(64)"); |
|||
|
|||
b.Property<int>("EntityVersion") |
|||
.HasColumnType("int"); |
|||
|
|||
b.Property<string>("ExtraProperties") |
|||
.IsRequired() |
|||
.HasColumnType("longtext") |
|||
.HasColumnName("ExtraProperties"); |
|||
|
|||
b.Property<bool>("IsDeleted") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("tinyint(1)") |
|||
.HasDefaultValue(false) |
|||
.HasColumnName("IsDeleted"); |
|||
|
|||
b.Property<DateTime?>("LastModificationTime") |
|||
.HasColumnType("datetime(6)") |
|||
.HasColumnName("LastModificationTime"); |
|||
|
|||
b.Property<Guid?>("LastModifierId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("LastModifierId"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("DisplayName"); |
|||
|
|||
b.ToTable("AbpEditions", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.Saas.Tenants.Tenant", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("ConcurrencyStamp") |
|||
.IsConcurrencyToken() |
|||
.IsRequired() |
|||
.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<Guid?>("DeleterId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("DeleterId"); |
|||
|
|||
b.Property<DateTime?>("DeletionTime") |
|||
.HasColumnType("datetime(6)") |
|||
.HasColumnName("DeletionTime"); |
|||
|
|||
b.Property<DateTime?>("DisableTime") |
|||
.HasColumnType("datetime(6)"); |
|||
|
|||
b.Property<Guid?>("EditionId") |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<DateTime?>("EnableTime") |
|||
.HasColumnType("datetime(6)"); |
|||
|
|||
b.Property<int>("EntityVersion") |
|||
.HasColumnType("int"); |
|||
|
|||
b.Property<string>("ExtraProperties") |
|||
.IsRequired() |
|||
.HasColumnType("longtext") |
|||
.HasColumnName("ExtraProperties"); |
|||
|
|||
b.Property<bool>("IsActive") |
|||
.HasColumnType("tinyint(1)"); |
|||
|
|||
b.Property<bool>("IsDeleted") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("tinyint(1)") |
|||
.HasDefaultValue(false) |
|||
.HasColumnName("IsDeleted"); |
|||
|
|||
b.Property<DateTime?>("LastModificationTime") |
|||
.HasColumnType("datetime(6)") |
|||
.HasColumnName("LastModificationTime"); |
|||
|
|||
b.Property<Guid?>("LastModifierId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("LastModifierId"); |
|||
|
|||
b.Property<string>("Name") |
|||
.IsRequired() |
|||
.HasMaxLength(64) |
|||
.HasColumnType("varchar(64)"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("EditionId"); |
|||
|
|||
b.HasIndex("Name"); |
|||
|
|||
b.ToTable("AbpTenants", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.Saas.Tenants.TenantConnectionString", b => |
|||
{ |
|||
b.Property<Guid>("TenantId") |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("Name") |
|||
.HasMaxLength(64) |
|||
.HasColumnType("varchar(64)"); |
|||
|
|||
b.Property<string>("Value") |
|||
.IsRequired() |
|||
.HasMaxLength(1024) |
|||
.HasColumnType("varchar(1024)"); |
|||
|
|||
b.HasKey("TenantId", "Name"); |
|||
|
|||
b.ToTable("AbpTenantConnectionStrings", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.TextTemplating.TextTemplate", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("Content") |
|||
.HasMaxLength(1048576) |
|||
.HasColumnType("longtext") |
|||
.HasColumnName("Content"); |
|||
|
|||
b.Property<DateTime>("CreationTime") |
|||
.HasColumnType("datetime(6)") |
|||
.HasColumnName("CreationTime"); |
|||
|
|||
b.Property<Guid?>("CreatorId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("CreatorId"); |
|||
|
|||
b.Property<string>("Culture") |
|||
.HasMaxLength(30) |
|||
.HasColumnType("varchar(30)") |
|||
.HasColumnName("Culture"); |
|||
|
|||
b.Property<string>("DisplayName") |
|||
.IsRequired() |
|||
.HasMaxLength(100) |
|||
.HasColumnType("varchar(100)") |
|||
.HasColumnName("DisplayName"); |
|||
|
|||
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<Guid?>("TenantId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("TenantId"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("TenantId", "Name") |
|||
.HasDatabaseName("IX_Tenant_Text_Template_Name"); |
|||
|
|||
b.ToTable("AbpTextTemplates", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.TextTemplating.TextTemplateDefinition", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("ConcurrencyStamp") |
|||
.IsConcurrencyToken() |
|||
.IsRequired() |
|||
.HasMaxLength(40) |
|||
.HasColumnType("varchar(40)") |
|||
.HasColumnName("ConcurrencyStamp"); |
|||
|
|||
b.Property<string>("DefaultCultureName") |
|||
.HasMaxLength(30) |
|||
.HasColumnType("varchar(30)") |
|||
.HasColumnName("DefaultCultureName"); |
|||
|
|||
b.Property<string>("DisplayName") |
|||
.IsRequired() |
|||
.HasMaxLength(512) |
|||
.HasColumnType("varchar(512)") |
|||
.HasColumnName("DisplayName"); |
|||
|
|||
b.Property<string>("ExtraProperties") |
|||
.IsRequired() |
|||
.HasColumnType("longtext") |
|||
.HasColumnName("ExtraProperties"); |
|||
|
|||
b.Property<bool>("IsInlineLocalized") |
|||
.HasColumnType("tinyint(1)"); |
|||
|
|||
b.Property<bool>("IsLayout") |
|||
.HasColumnType("tinyint(1)"); |
|||
|
|||
b.Property<bool>("IsStatic") |
|||
.HasColumnType("tinyint(1)"); |
|||
|
|||
b.Property<string>("Layout") |
|||
.HasMaxLength(60) |
|||
.HasColumnType("varchar(60)") |
|||
.HasColumnName("Layout"); |
|||
|
|||
b.Property<string>("LocalizationResourceName") |
|||
.HasMaxLength(64) |
|||
.HasColumnType("varchar(64)") |
|||
.HasColumnName("LocalizationResourceName"); |
|||
|
|||
b.Property<string>("Name") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)") |
|||
.HasColumnName("Name"); |
|||
|
|||
b.Property<string>("RenderEngine") |
|||
.HasMaxLength(30) |
|||
.HasColumnType("varchar(30)") |
|||
.HasColumnName("RenderEngine"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.ToTable("AbpTextTemplateDefinitions", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureDefinitionRecord", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("AllowedProviders") |
|||
.HasMaxLength(256) |
|||
.HasColumnType("varchar(256)"); |
|||
|
|||
b.Property<string>("DefaultValue") |
|||
.HasMaxLength(256) |
|||
.HasColumnType("varchar(256)"); |
|||
|
|||
b.Property<string>("Description") |
|||
.HasMaxLength(256) |
|||
.HasColumnType("varchar(256)"); |
|||
|
|||
b.Property<string>("DisplayName") |
|||
.IsRequired() |
|||
.HasMaxLength(256) |
|||
.HasColumnType("varchar(256)"); |
|||
|
|||
b.Property<string>("ExtraProperties") |
|||
.HasColumnType("longtext") |
|||
.HasColumnName("ExtraProperties"); |
|||
|
|||
b.Property<string>("GroupName") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.Property<bool>("IsAvailableToHost") |
|||
.HasColumnType("tinyint(1)"); |
|||
|
|||
b.Property<bool>("IsVisibleToClients") |
|||
.HasColumnType("tinyint(1)"); |
|||
|
|||
b.Property<string>("Name") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.Property<string>("ParentName") |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.Property<string>("ValueType") |
|||
.HasMaxLength(2048) |
|||
.HasColumnType("varchar(2048)"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("GroupName"); |
|||
|
|||
b.HasIndex("Name") |
|||
.IsUnique(); |
|||
|
|||
b.ToTable("AbpFeatures", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureGroupDefinitionRecord", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("DisplayName") |
|||
.IsRequired() |
|||
.HasMaxLength(256) |
|||
.HasColumnType("varchar(256)"); |
|||
|
|||
b.Property<string>("ExtraProperties") |
|||
.HasColumnType("longtext") |
|||
.HasColumnName("ExtraProperties"); |
|||
|
|||
b.Property<string>("Name") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("Name") |
|||
.IsUnique(); |
|||
|
|||
b.ToTable("AbpFeatureGroups", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureValue", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("Name") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.Property<string>("ProviderKey") |
|||
.HasMaxLength(64) |
|||
.HasColumnType("varchar(64)"); |
|||
|
|||
b.Property<string>("ProviderName") |
|||
.HasMaxLength(64) |
|||
.HasColumnType("varchar(64)"); |
|||
|
|||
b.Property<string>("Value") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("Name", "ProviderName", "ProviderKey") |
|||
.IsUnique(); |
|||
|
|||
b.ToTable("AbpFeatureValues", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionDefinitionRecord", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("DisplayName") |
|||
.IsRequired() |
|||
.HasMaxLength(256) |
|||
.HasColumnType("varchar(256)"); |
|||
|
|||
b.Property<string>("ExtraProperties") |
|||
.HasColumnType("longtext") |
|||
.HasColumnName("ExtraProperties"); |
|||
|
|||
b.Property<string>("GroupName") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.Property<bool>("IsEnabled") |
|||
.HasColumnType("tinyint(1)"); |
|||
|
|||
b.Property<byte>("MultiTenancySide") |
|||
.HasColumnType("tinyint unsigned"); |
|||
|
|||
b.Property<string>("Name") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.Property<string>("ParentName") |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.Property<string>("Providers") |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.Property<string>("StateCheckers") |
|||
.HasMaxLength(256) |
|||
.HasColumnType("varchar(256)"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("GroupName"); |
|||
|
|||
b.HasIndex("Name") |
|||
.IsUnique(); |
|||
|
|||
b.ToTable("AbpPermissions", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGrant", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("Name") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.Property<string>("ProviderKey") |
|||
.IsRequired() |
|||
.HasMaxLength(64) |
|||
.HasColumnType("varchar(64)"); |
|||
|
|||
b.Property<string>("ProviderName") |
|||
.IsRequired() |
|||
.HasMaxLength(64) |
|||
.HasColumnType("varchar(64)"); |
|||
|
|||
b.Property<Guid?>("TenantId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("TenantId"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("TenantId", "Name", "ProviderName", "ProviderKey") |
|||
.IsUnique(); |
|||
|
|||
b.ToTable("AbpPermissionGrants", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGroupDefinitionRecord", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("DisplayName") |
|||
.IsRequired() |
|||
.HasMaxLength(256) |
|||
.HasColumnType("varchar(256)"); |
|||
|
|||
b.Property<string>("ExtraProperties") |
|||
.HasColumnType("longtext") |
|||
.HasColumnName("ExtraProperties"); |
|||
|
|||
b.Property<string>("Name") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("Name") |
|||
.IsUnique(); |
|||
|
|||
b.ToTable("AbpPermissionGroups", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("Volo.Abp.SettingManagement.Setting", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("Name") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.Property<string>("ProviderKey") |
|||
.HasMaxLength(64) |
|||
.HasColumnType("varchar(64)"); |
|||
|
|||
b.Property<string>("ProviderName") |
|||
.HasMaxLength(64) |
|||
.HasColumnType("varchar(64)"); |
|||
|
|||
b.Property<string>("Value") |
|||
.IsRequired() |
|||
.HasMaxLength(2048) |
|||
.HasColumnType("varchar(2048)"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("Name", "ProviderName", "ProviderKey") |
|||
.IsUnique(); |
|||
|
|||
b.ToTable("AbpSettings", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("Volo.Abp.SettingManagement.SettingDefinitionRecord", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("DefaultValue") |
|||
.HasMaxLength(256) |
|||
.HasColumnType("varchar(256)"); |
|||
|
|||
b.Property<string>("Description") |
|||
.HasMaxLength(512) |
|||
.HasColumnType("varchar(512)"); |
|||
|
|||
b.Property<string>("DisplayName") |
|||
.IsRequired() |
|||
.HasMaxLength(256) |
|||
.HasColumnType("varchar(256)"); |
|||
|
|||
b.Property<string>("ExtraProperties") |
|||
.HasColumnType("longtext") |
|||
.HasColumnName("ExtraProperties"); |
|||
|
|||
b.Property<bool>("IsEncrypted") |
|||
.HasColumnType("tinyint(1)"); |
|||
|
|||
b.Property<bool>("IsInherited") |
|||
.HasColumnType("tinyint(1)"); |
|||
|
|||
b.Property<bool>("IsVisibleToClients") |
|||
.HasColumnType("tinyint(1)"); |
|||
|
|||
b.Property<string>("Name") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.Property<string>("Providers") |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("Name") |
|||
.IsUnique(); |
|||
|
|||
b.ToTable("AbpSettingDefinitions", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.Saas.Tenants.Tenant", b => |
|||
{ |
|||
b.HasOne("LINGYUN.Abp.Saas.Editions.Edition", "Edition") |
|||
.WithMany() |
|||
.HasForeignKey("EditionId"); |
|||
|
|||
b.Navigation("Edition"); |
|||
}); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.Saas.Tenants.TenantConnectionString", b => |
|||
{ |
|||
b.HasOne("LINGYUN.Abp.Saas.Tenants.Tenant", null) |
|||
.WithMany("ConnectionStrings") |
|||
.HasForeignKey("TenantId") |
|||
.OnDelete(DeleteBehavior.Cascade) |
|||
.IsRequired(); |
|||
}); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.Saas.Tenants.Tenant", b => |
|||
{ |
|||
b.Navigation("ConnectionStrings"); |
|||
}); |
|||
#pragma warning restore 612, 618
|
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,247 @@ |
|||
using System; |
|||
using Microsoft.EntityFrameworkCore.Migrations; |
|||
|
|||
#nullable disable |
|||
|
|||
namespace LINGYUN.Abp.MicroService.AdminService.EntityFrameworkCore.Migrations |
|||
{ |
|||
/// <inheritdoc />
|
|||
public partial class UpgradeAbpFrameworkTo740 : Migration |
|||
{ |
|||
/// <inheritdoc />
|
|||
protected override void Up(MigrationBuilder migrationBuilder) |
|||
{ |
|||
migrationBuilder.UpdateData( |
|||
table: "AbpTextTemplateDefinitions", |
|||
keyColumn: "ExtraProperties", |
|||
keyValue: null, |
|||
column: "ExtraProperties", |
|||
value: ""); |
|||
|
|||
migrationBuilder.AlterColumn<string>( |
|||
name: "ExtraProperties", |
|||
table: "AbpTextTemplateDefinitions", |
|||
type: "longtext", |
|||
nullable: false, |
|||
oldClrType: typeof(string), |
|||
oldType: "longtext", |
|||
oldNullable: true) |
|||
.Annotation("MySql:CharSet", "utf8mb4") |
|||
.OldAnnotation("MySql:CharSet", "utf8mb4"); |
|||
|
|||
migrationBuilder.UpdateData( |
|||
table: "AbpTextTemplateDefinitions", |
|||
keyColumn: "ConcurrencyStamp", |
|||
keyValue: null, |
|||
column: "ConcurrencyStamp", |
|||
value: ""); |
|||
|
|||
migrationBuilder.AlterColumn<string>( |
|||
name: "ConcurrencyStamp", |
|||
table: "AbpTextTemplateDefinitions", |
|||
type: "varchar(40)", |
|||
maxLength: 40, |
|||
nullable: false, |
|||
oldClrType: typeof(string), |
|||
oldType: "varchar(40)", |
|||
oldMaxLength: 40, |
|||
oldNullable: true) |
|||
.Annotation("MySql:CharSet", "utf8mb4") |
|||
.OldAnnotation("MySql:CharSet", "utf8mb4"); |
|||
|
|||
migrationBuilder.AddColumn<string>( |
|||
name: "LocalizationResourceName", |
|||
table: "AbpTextTemplateDefinitions", |
|||
type: "varchar(64)", |
|||
maxLength: 64, |
|||
nullable: true) |
|||
.Annotation("MySql:CharSet", "utf8mb4"); |
|||
|
|||
migrationBuilder.UpdateData( |
|||
table: "AbpTenants", |
|||
keyColumn: "ExtraProperties", |
|||
keyValue: null, |
|||
column: "ExtraProperties", |
|||
value: ""); |
|||
|
|||
migrationBuilder.AlterColumn<string>( |
|||
name: "ExtraProperties", |
|||
table: "AbpTenants", |
|||
type: "longtext", |
|||
nullable: false, |
|||
oldClrType: typeof(string), |
|||
oldType: "longtext", |
|||
oldNullable: true) |
|||
.Annotation("MySql:CharSet", "utf8mb4") |
|||
.OldAnnotation("MySql:CharSet", "utf8mb4"); |
|||
|
|||
migrationBuilder.UpdateData( |
|||
table: "AbpTenants", |
|||
keyColumn: "ConcurrencyStamp", |
|||
keyValue: null, |
|||
column: "ConcurrencyStamp", |
|||
value: ""); |
|||
|
|||
migrationBuilder.AlterColumn<string>( |
|||
name: "ConcurrencyStamp", |
|||
table: "AbpTenants", |
|||
type: "varchar(40)", |
|||
maxLength: 40, |
|||
nullable: false, |
|||
oldClrType: typeof(string), |
|||
oldType: "varchar(40)", |
|||
oldMaxLength: 40, |
|||
oldNullable: true) |
|||
.Annotation("MySql:CharSet", "utf8mb4") |
|||
.OldAnnotation("MySql:CharSet", "utf8mb4"); |
|||
|
|||
migrationBuilder.UpdateData( |
|||
table: "AbpEditions", |
|||
keyColumn: "ExtraProperties", |
|||
keyValue: null, |
|||
column: "ExtraProperties", |
|||
value: ""); |
|||
|
|||
migrationBuilder.AlterColumn<string>( |
|||
name: "ExtraProperties", |
|||
table: "AbpEditions", |
|||
type: "longtext", |
|||
nullable: false, |
|||
oldClrType: typeof(string), |
|||
oldType: "longtext", |
|||
oldNullable: true) |
|||
.Annotation("MySql:CharSet", "utf8mb4") |
|||
.OldAnnotation("MySql:CharSet", "utf8mb4"); |
|||
|
|||
migrationBuilder.UpdateData( |
|||
table: "AbpEditions", |
|||
keyColumn: "ConcurrencyStamp", |
|||
keyValue: null, |
|||
column: "ConcurrencyStamp", |
|||
value: ""); |
|||
|
|||
migrationBuilder.AlterColumn<string>( |
|||
name: "ConcurrencyStamp", |
|||
table: "AbpEditions", |
|||
type: "varchar(40)", |
|||
maxLength: 40, |
|||
nullable: false, |
|||
oldClrType: typeof(string), |
|||
oldType: "varchar(40)", |
|||
oldMaxLength: 40, |
|||
oldNullable: true) |
|||
.Annotation("MySql:CharSet", "utf8mb4") |
|||
.OldAnnotation("MySql:CharSet", "utf8mb4"); |
|||
|
|||
migrationBuilder.CreateTable( |
|||
name: "AbpSettingDefinitions", |
|||
columns: table => new |
|||
{ |
|||
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"), |
|||
Name = table.Column<string>(type: "varchar(128)", maxLength: 128, nullable: false) |
|||
.Annotation("MySql:CharSet", "utf8mb4"), |
|||
DisplayName = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: false) |
|||
.Annotation("MySql:CharSet", "utf8mb4"), |
|||
Description = table.Column<string>(type: "varchar(512)", maxLength: 512, nullable: true) |
|||
.Annotation("MySql:CharSet", "utf8mb4"), |
|||
DefaultValue = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: true) |
|||
.Annotation("MySql:CharSet", "utf8mb4"), |
|||
IsVisibleToClients = table.Column<bool>(type: "tinyint(1)", nullable: false), |
|||
Providers = table.Column<string>(type: "varchar(128)", maxLength: 128, nullable: true) |
|||
.Annotation("MySql:CharSet", "utf8mb4"), |
|||
IsInherited = table.Column<bool>(type: "tinyint(1)", nullable: false), |
|||
IsEncrypted = table.Column<bool>(type: "tinyint(1)", nullable: false), |
|||
ExtraProperties = table.Column<string>(type: "longtext", nullable: true) |
|||
.Annotation("MySql:CharSet", "utf8mb4") |
|||
}, |
|||
constraints: table => |
|||
{ |
|||
table.PrimaryKey("PK_AbpSettingDefinitions", x => x.Id); |
|||
}) |
|||
.Annotation("MySql:CharSet", "utf8mb4"); |
|||
|
|||
migrationBuilder.CreateIndex( |
|||
name: "IX_AbpSettingDefinitions_Name", |
|||
table: "AbpSettingDefinitions", |
|||
column: "Name", |
|||
unique: true); |
|||
} |
|||
|
|||
/// <inheritdoc />
|
|||
protected override void Down(MigrationBuilder migrationBuilder) |
|||
{ |
|||
migrationBuilder.DropTable( |
|||
name: "AbpSettingDefinitions"); |
|||
|
|||
migrationBuilder.DropColumn( |
|||
name: "LocalizationResourceName", |
|||
table: "AbpTextTemplateDefinitions"); |
|||
|
|||
migrationBuilder.AlterColumn<string>( |
|||
name: "ExtraProperties", |
|||
table: "AbpTextTemplateDefinitions", |
|||
type: "longtext", |
|||
nullable: true, |
|||
oldClrType: typeof(string), |
|||
oldType: "longtext") |
|||
.Annotation("MySql:CharSet", "utf8mb4") |
|||
.OldAnnotation("MySql:CharSet", "utf8mb4"); |
|||
|
|||
migrationBuilder.AlterColumn<string>( |
|||
name: "ConcurrencyStamp", |
|||
table: "AbpTextTemplateDefinitions", |
|||
type: "varchar(40)", |
|||
maxLength: 40, |
|||
nullable: true, |
|||
oldClrType: typeof(string), |
|||
oldType: "varchar(40)", |
|||
oldMaxLength: 40) |
|||
.Annotation("MySql:CharSet", "utf8mb4") |
|||
.OldAnnotation("MySql:CharSet", "utf8mb4"); |
|||
|
|||
migrationBuilder.AlterColumn<string>( |
|||
name: "ExtraProperties", |
|||
table: "AbpTenants", |
|||
type: "longtext", |
|||
nullable: true, |
|||
oldClrType: typeof(string), |
|||
oldType: "longtext") |
|||
.Annotation("MySql:CharSet", "utf8mb4") |
|||
.OldAnnotation("MySql:CharSet", "utf8mb4"); |
|||
|
|||
migrationBuilder.AlterColumn<string>( |
|||
name: "ConcurrencyStamp", |
|||
table: "AbpTenants", |
|||
type: "varchar(40)", |
|||
maxLength: 40, |
|||
nullable: true, |
|||
oldClrType: typeof(string), |
|||
oldType: "varchar(40)", |
|||
oldMaxLength: 40) |
|||
.Annotation("MySql:CharSet", "utf8mb4") |
|||
.OldAnnotation("MySql:CharSet", "utf8mb4"); |
|||
|
|||
migrationBuilder.AlterColumn<string>( |
|||
name: "ExtraProperties", |
|||
table: "AbpEditions", |
|||
type: "longtext", |
|||
nullable: true, |
|||
oldClrType: typeof(string), |
|||
oldType: "longtext") |
|||
.Annotation("MySql:CharSet", "utf8mb4") |
|||
.OldAnnotation("MySql:CharSet", "utf8mb4"); |
|||
|
|||
migrationBuilder.AlterColumn<string>( |
|||
name: "ConcurrencyStamp", |
|||
table: "AbpEditions", |
|||
type: "varchar(40)", |
|||
maxLength: 40, |
|||
nullable: true, |
|||
oldClrType: typeof(string), |
|||
oldType: "varchar(40)", |
|||
oldMaxLength: 40) |
|||
.Annotation("MySql:CharSet", "utf8mb4") |
|||
.OldAnnotation("MySql:CharSet", "utf8mb4"); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,646 @@ |
|||
// <auto-generated />
|
|||
using System; |
|||
using Microsoft.EntityFrameworkCore; |
|||
using Microsoft.EntityFrameworkCore.Infrastructure; |
|||
using Microsoft.EntityFrameworkCore.Migrations; |
|||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion; |
|||
using Volo.Abp.EntityFrameworkCore; |
|||
|
|||
#nullable disable |
|||
|
|||
namespace LINGYUN.Abp.MicroService.AdminService.EntityFrameworkCore.Migrations |
|||
{ |
|||
[DbContext(typeof(AdminServiceMigrationsDbContext))] |
|||
[Migration("20240218002657_Upgrade-Abp-Framework-To-8.0.3")] |
|||
partial class UpgradeAbpFrameworkTo803 |
|||
{ |
|||
/// <inheritdoc />
|
|||
protected override void BuildTargetModel(ModelBuilder modelBuilder) |
|||
{ |
|||
#pragma warning disable 612, 618
|
|||
modelBuilder |
|||
.HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.MySql) |
|||
.HasAnnotation("ProductVersion", "8.0.0") |
|||
.HasAnnotation("Relational:MaxIdentifierLength", 64); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.Saas.Editions.Edition", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("ConcurrencyStamp") |
|||
.IsConcurrencyToken() |
|||
.IsRequired() |
|||
.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<Guid?>("DeleterId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("DeleterId"); |
|||
|
|||
b.Property<DateTime?>("DeletionTime") |
|||
.HasColumnType("datetime(6)") |
|||
.HasColumnName("DeletionTime"); |
|||
|
|||
b.Property<string>("DisplayName") |
|||
.IsRequired() |
|||
.HasMaxLength(64) |
|||
.HasColumnType("varchar(64)"); |
|||
|
|||
b.Property<int>("EntityVersion") |
|||
.HasColumnType("int"); |
|||
|
|||
b.Property<string>("ExtraProperties") |
|||
.IsRequired() |
|||
.HasColumnType("longtext") |
|||
.HasColumnName("ExtraProperties"); |
|||
|
|||
b.Property<bool>("IsDeleted") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("tinyint(1)") |
|||
.HasDefaultValue(false) |
|||
.HasColumnName("IsDeleted"); |
|||
|
|||
b.Property<DateTime?>("LastModificationTime") |
|||
.HasColumnType("datetime(6)") |
|||
.HasColumnName("LastModificationTime"); |
|||
|
|||
b.Property<Guid?>("LastModifierId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("LastModifierId"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("DisplayName"); |
|||
|
|||
b.ToTable("AbpEditions", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.Saas.Tenants.Tenant", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("ConcurrencyStamp") |
|||
.IsConcurrencyToken() |
|||
.IsRequired() |
|||
.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<Guid?>("DeleterId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("DeleterId"); |
|||
|
|||
b.Property<DateTime?>("DeletionTime") |
|||
.HasColumnType("datetime(6)") |
|||
.HasColumnName("DeletionTime"); |
|||
|
|||
b.Property<DateTime?>("DisableTime") |
|||
.HasColumnType("datetime(6)"); |
|||
|
|||
b.Property<Guid?>("EditionId") |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<DateTime?>("EnableTime") |
|||
.HasColumnType("datetime(6)"); |
|||
|
|||
b.Property<int>("EntityVersion") |
|||
.HasColumnType("int"); |
|||
|
|||
b.Property<string>("ExtraProperties") |
|||
.IsRequired() |
|||
.HasColumnType("longtext") |
|||
.HasColumnName("ExtraProperties"); |
|||
|
|||
b.Property<bool>("IsActive") |
|||
.HasColumnType("tinyint(1)"); |
|||
|
|||
b.Property<bool>("IsDeleted") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("tinyint(1)") |
|||
.HasDefaultValue(false) |
|||
.HasColumnName("IsDeleted"); |
|||
|
|||
b.Property<DateTime?>("LastModificationTime") |
|||
.HasColumnType("datetime(6)") |
|||
.HasColumnName("LastModificationTime"); |
|||
|
|||
b.Property<Guid?>("LastModifierId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("LastModifierId"); |
|||
|
|||
b.Property<string>("Name") |
|||
.IsRequired() |
|||
.HasMaxLength(64) |
|||
.HasColumnType("varchar(64)"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("EditionId"); |
|||
|
|||
b.HasIndex("Name"); |
|||
|
|||
b.ToTable("AbpTenants", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.Saas.Tenants.TenantConnectionString", b => |
|||
{ |
|||
b.Property<Guid>("TenantId") |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("Name") |
|||
.HasMaxLength(64) |
|||
.HasColumnType("varchar(64)"); |
|||
|
|||
b.Property<string>("Value") |
|||
.IsRequired() |
|||
.HasMaxLength(1024) |
|||
.HasColumnType("varchar(1024)"); |
|||
|
|||
b.HasKey("TenantId", "Name"); |
|||
|
|||
b.ToTable("AbpTenantConnectionStrings", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.TextTemplating.TextTemplate", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("Content") |
|||
.HasMaxLength(1048576) |
|||
.HasColumnType("longtext") |
|||
.HasColumnName("Content"); |
|||
|
|||
b.Property<DateTime>("CreationTime") |
|||
.HasColumnType("datetime(6)") |
|||
.HasColumnName("CreationTime"); |
|||
|
|||
b.Property<Guid?>("CreatorId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("CreatorId"); |
|||
|
|||
b.Property<string>("Culture") |
|||
.HasMaxLength(30) |
|||
.HasColumnType("varchar(30)") |
|||
.HasColumnName("Culture"); |
|||
|
|||
b.Property<string>("DisplayName") |
|||
.IsRequired() |
|||
.HasMaxLength(100) |
|||
.HasColumnType("varchar(100)") |
|||
.HasColumnName("DisplayName"); |
|||
|
|||
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<Guid?>("TenantId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("TenantId"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("TenantId", "Name") |
|||
.HasDatabaseName("IX_Tenant_Text_Template_Name"); |
|||
|
|||
b.ToTable("AbpTextTemplates", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.TextTemplating.TextTemplateDefinition", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("ConcurrencyStamp") |
|||
.IsConcurrencyToken() |
|||
.IsRequired() |
|||
.HasMaxLength(40) |
|||
.HasColumnType("varchar(40)") |
|||
.HasColumnName("ConcurrencyStamp"); |
|||
|
|||
b.Property<string>("DefaultCultureName") |
|||
.HasMaxLength(30) |
|||
.HasColumnType("varchar(30)") |
|||
.HasColumnName("DefaultCultureName"); |
|||
|
|||
b.Property<string>("DisplayName") |
|||
.IsRequired() |
|||
.HasMaxLength(512) |
|||
.HasColumnType("varchar(512)") |
|||
.HasColumnName("DisplayName"); |
|||
|
|||
b.Property<string>("ExtraProperties") |
|||
.IsRequired() |
|||
.HasColumnType("longtext") |
|||
.HasColumnName("ExtraProperties"); |
|||
|
|||
b.Property<bool>("IsInlineLocalized") |
|||
.HasColumnType("tinyint(1)"); |
|||
|
|||
b.Property<bool>("IsLayout") |
|||
.HasColumnType("tinyint(1)"); |
|||
|
|||
b.Property<bool>("IsStatic") |
|||
.HasColumnType("tinyint(1)"); |
|||
|
|||
b.Property<string>("Layout") |
|||
.HasMaxLength(60) |
|||
.HasColumnType("varchar(60)") |
|||
.HasColumnName("Layout"); |
|||
|
|||
b.Property<string>("LocalizationResourceName") |
|||
.HasMaxLength(64) |
|||
.HasColumnType("varchar(64)") |
|||
.HasColumnName("LocalizationResourceName"); |
|||
|
|||
b.Property<string>("Name") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)") |
|||
.HasColumnName("Name"); |
|||
|
|||
b.Property<string>("RenderEngine") |
|||
.HasMaxLength(30) |
|||
.HasColumnType("varchar(30)") |
|||
.HasColumnName("RenderEngine"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.ToTable("AbpTextTemplateDefinitions", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureDefinitionRecord", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("AllowedProviders") |
|||
.HasMaxLength(256) |
|||
.HasColumnType("varchar(256)"); |
|||
|
|||
b.Property<string>("DefaultValue") |
|||
.HasMaxLength(256) |
|||
.HasColumnType("varchar(256)"); |
|||
|
|||
b.Property<string>("Description") |
|||
.HasMaxLength(256) |
|||
.HasColumnType("varchar(256)"); |
|||
|
|||
b.Property<string>("DisplayName") |
|||
.IsRequired() |
|||
.HasMaxLength(256) |
|||
.HasColumnType("varchar(256)"); |
|||
|
|||
b.Property<string>("ExtraProperties") |
|||
.HasColumnType("longtext") |
|||
.HasColumnName("ExtraProperties"); |
|||
|
|||
b.Property<string>("GroupName") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.Property<bool>("IsAvailableToHost") |
|||
.HasColumnType("tinyint(1)"); |
|||
|
|||
b.Property<bool>("IsVisibleToClients") |
|||
.HasColumnType("tinyint(1)"); |
|||
|
|||
b.Property<string>("Name") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.Property<string>("ParentName") |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.Property<string>("ValueType") |
|||
.HasMaxLength(2048) |
|||
.HasColumnType("varchar(2048)"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("GroupName"); |
|||
|
|||
b.HasIndex("Name") |
|||
.IsUnique(); |
|||
|
|||
b.ToTable("AbpFeatures", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureGroupDefinitionRecord", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("DisplayName") |
|||
.IsRequired() |
|||
.HasMaxLength(256) |
|||
.HasColumnType("varchar(256)"); |
|||
|
|||
b.Property<string>("ExtraProperties") |
|||
.HasColumnType("longtext") |
|||
.HasColumnName("ExtraProperties"); |
|||
|
|||
b.Property<string>("Name") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("Name") |
|||
.IsUnique(); |
|||
|
|||
b.ToTable("AbpFeatureGroups", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureValue", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("Name") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.Property<string>("ProviderKey") |
|||
.HasMaxLength(64) |
|||
.HasColumnType("varchar(64)"); |
|||
|
|||
b.Property<string>("ProviderName") |
|||
.HasMaxLength(64) |
|||
.HasColumnType("varchar(64)"); |
|||
|
|||
b.Property<string>("Value") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("Name", "ProviderName", "ProviderKey") |
|||
.IsUnique(); |
|||
|
|||
b.ToTable("AbpFeatureValues", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionDefinitionRecord", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("DisplayName") |
|||
.IsRequired() |
|||
.HasMaxLength(256) |
|||
.HasColumnType("varchar(256)"); |
|||
|
|||
b.Property<string>("ExtraProperties") |
|||
.HasColumnType("longtext") |
|||
.HasColumnName("ExtraProperties"); |
|||
|
|||
b.Property<string>("GroupName") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.Property<bool>("IsEnabled") |
|||
.HasColumnType("tinyint(1)"); |
|||
|
|||
b.Property<byte>("MultiTenancySide") |
|||
.HasColumnType("tinyint unsigned"); |
|||
|
|||
b.Property<string>("Name") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.Property<string>("ParentName") |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.Property<string>("Providers") |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.Property<string>("StateCheckers") |
|||
.HasMaxLength(256) |
|||
.HasColumnType("varchar(256)"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("GroupName"); |
|||
|
|||
b.HasIndex("Name") |
|||
.IsUnique(); |
|||
|
|||
b.ToTable("AbpPermissions", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGrant", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("Name") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.Property<string>("ProviderKey") |
|||
.IsRequired() |
|||
.HasMaxLength(64) |
|||
.HasColumnType("varchar(64)"); |
|||
|
|||
b.Property<string>("ProviderName") |
|||
.IsRequired() |
|||
.HasMaxLength(64) |
|||
.HasColumnType("varchar(64)"); |
|||
|
|||
b.Property<Guid?>("TenantId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("TenantId"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("TenantId", "Name", "ProviderName", "ProviderKey") |
|||
.IsUnique(); |
|||
|
|||
b.ToTable("AbpPermissionGrants", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGroupDefinitionRecord", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("DisplayName") |
|||
.IsRequired() |
|||
.HasMaxLength(256) |
|||
.HasColumnType("varchar(256)"); |
|||
|
|||
b.Property<string>("ExtraProperties") |
|||
.HasColumnType("longtext") |
|||
.HasColumnName("ExtraProperties"); |
|||
|
|||
b.Property<string>("Name") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("Name") |
|||
.IsUnique(); |
|||
|
|||
b.ToTable("AbpPermissionGroups", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("Volo.Abp.SettingManagement.Setting", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("Name") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.Property<string>("ProviderKey") |
|||
.HasMaxLength(64) |
|||
.HasColumnType("varchar(64)"); |
|||
|
|||
b.Property<string>("ProviderName") |
|||
.HasMaxLength(64) |
|||
.HasColumnType("varchar(64)"); |
|||
|
|||
b.Property<string>("Value") |
|||
.IsRequired() |
|||
.HasMaxLength(2048) |
|||
.HasColumnType("varchar(2048)"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("Name", "ProviderName", "ProviderKey") |
|||
.IsUnique(); |
|||
|
|||
b.ToTable("AbpSettings", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("Volo.Abp.SettingManagement.SettingDefinitionRecord", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("DefaultValue") |
|||
.HasMaxLength(2048) |
|||
.HasColumnType("varchar(2048)"); |
|||
|
|||
b.Property<string>("Description") |
|||
.HasMaxLength(512) |
|||
.HasColumnType("varchar(512)"); |
|||
|
|||
b.Property<string>("DisplayName") |
|||
.IsRequired() |
|||
.HasMaxLength(256) |
|||
.HasColumnType("varchar(256)"); |
|||
|
|||
b.Property<string>("ExtraProperties") |
|||
.HasColumnType("longtext") |
|||
.HasColumnName("ExtraProperties"); |
|||
|
|||
b.Property<bool>("IsEncrypted") |
|||
.HasColumnType("tinyint(1)"); |
|||
|
|||
b.Property<bool>("IsInherited") |
|||
.HasColumnType("tinyint(1)"); |
|||
|
|||
b.Property<bool>("IsVisibleToClients") |
|||
.HasColumnType("tinyint(1)"); |
|||
|
|||
b.Property<string>("Name") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.Property<string>("Providers") |
|||
.HasMaxLength(1024) |
|||
.HasColumnType("varchar(1024)"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("Name") |
|||
.IsUnique(); |
|||
|
|||
b.ToTable("AbpSettingDefinitions", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.Saas.Tenants.Tenant", b => |
|||
{ |
|||
b.HasOne("LINGYUN.Abp.Saas.Editions.Edition", "Edition") |
|||
.WithMany() |
|||
.HasForeignKey("EditionId"); |
|||
|
|||
b.Navigation("Edition"); |
|||
}); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.Saas.Tenants.TenantConnectionString", b => |
|||
{ |
|||
b.HasOne("LINGYUN.Abp.Saas.Tenants.Tenant", null) |
|||
.WithMany("ConnectionStrings") |
|||
.HasForeignKey("TenantId") |
|||
.OnDelete(DeleteBehavior.Cascade) |
|||
.IsRequired(); |
|||
}); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.Saas.Tenants.Tenant", b => |
|||
{ |
|||
b.Navigation("ConnectionStrings"); |
|||
}); |
|||
#pragma warning restore 612, 618
|
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,70 @@ |
|||
using Microsoft.EntityFrameworkCore.Migrations; |
|||
|
|||
#nullable disable |
|||
|
|||
namespace LINGYUN.Abp.MicroService.AdminService.EntityFrameworkCore.Migrations |
|||
{ |
|||
/// <inheritdoc />
|
|||
public partial class UpgradeAbpFrameworkTo803 : Migration |
|||
{ |
|||
/// <inheritdoc />
|
|||
protected override void Up(MigrationBuilder migrationBuilder) |
|||
{ |
|||
migrationBuilder.AlterColumn<string>( |
|||
name: "Providers", |
|||
table: "AbpSettingDefinitions", |
|||
type: "varchar(1024)", |
|||
maxLength: 1024, |
|||
nullable: true, |
|||
oldClrType: typeof(string), |
|||
oldType: "varchar(128)", |
|||
oldMaxLength: 128, |
|||
oldNullable: true) |
|||
.Annotation("MySql:CharSet", "utf8mb4") |
|||
.OldAnnotation("MySql:CharSet", "utf8mb4"); |
|||
|
|||
migrationBuilder.AlterColumn<string>( |
|||
name: "DefaultValue", |
|||
table: "AbpSettingDefinitions", |
|||
type: "varchar(2048)", |
|||
maxLength: 2048, |
|||
nullable: true, |
|||
oldClrType: typeof(string), |
|||
oldType: "varchar(256)", |
|||
oldMaxLength: 256, |
|||
oldNullable: true) |
|||
.Annotation("MySql:CharSet", "utf8mb4") |
|||
.OldAnnotation("MySql:CharSet", "utf8mb4"); |
|||
} |
|||
|
|||
/// <inheritdoc />
|
|||
protected override void Down(MigrationBuilder migrationBuilder) |
|||
{ |
|||
migrationBuilder.AlterColumn<string>( |
|||
name: "Providers", |
|||
table: "AbpSettingDefinitions", |
|||
type: "varchar(128)", |
|||
maxLength: 128, |
|||
nullable: true, |
|||
oldClrType: typeof(string), |
|||
oldType: "varchar(1024)", |
|||
oldMaxLength: 1024, |
|||
oldNullable: true) |
|||
.Annotation("MySql:CharSet", "utf8mb4") |
|||
.OldAnnotation("MySql:CharSet", "utf8mb4"); |
|||
|
|||
migrationBuilder.AlterColumn<string>( |
|||
name: "DefaultValue", |
|||
table: "AbpSettingDefinitions", |
|||
type: "varchar(256)", |
|||
maxLength: 256, |
|||
nullable: true, |
|||
oldClrType: typeof(string), |
|||
oldType: "varchar(2048)", |
|||
oldMaxLength: 2048, |
|||
oldNullable: true) |
|||
.Annotation("MySql:CharSet", "utf8mb4") |
|||
.OldAnnotation("MySql:CharSet", "utf8mb4"); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,652 @@ |
|||
// <auto-generated />
|
|||
using System; |
|||
using Microsoft.EntityFrameworkCore; |
|||
using Microsoft.EntityFrameworkCore.Infrastructure; |
|||
using Microsoft.EntityFrameworkCore.Migrations; |
|||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion; |
|||
using Volo.Abp.EntityFrameworkCore; |
|||
|
|||
#nullable disable |
|||
|
|||
namespace LINGYUN.Abp.MicroService.AdminService.EntityFrameworkCore.Migrations |
|||
{ |
|||
[DbContext(typeof(AdminServiceMigrationsDbContext))] |
|||
[Migration("20240413021854_Upgrade-Abp-Framework-To-8-1-0")] |
|||
partial class UpgradeAbpFrameworkTo810 |
|||
{ |
|||
/// <inheritdoc />
|
|||
protected override void BuildTargetModel(ModelBuilder modelBuilder) |
|||
{ |
|||
#pragma warning disable 612, 618
|
|||
modelBuilder |
|||
.HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.MySql) |
|||
.HasAnnotation("ProductVersion", "8.0.0") |
|||
.HasAnnotation("Relational:MaxIdentifierLength", 64); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.Saas.Editions.Edition", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("ConcurrencyStamp") |
|||
.IsConcurrencyToken() |
|||
.IsRequired() |
|||
.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<Guid?>("DeleterId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("DeleterId"); |
|||
|
|||
b.Property<DateTime?>("DeletionTime") |
|||
.HasColumnType("datetime(6)") |
|||
.HasColumnName("DeletionTime"); |
|||
|
|||
b.Property<string>("DisplayName") |
|||
.IsRequired() |
|||
.HasMaxLength(64) |
|||
.HasColumnType("varchar(64)"); |
|||
|
|||
b.Property<int>("EntityVersion") |
|||
.HasColumnType("int"); |
|||
|
|||
b.Property<string>("ExtraProperties") |
|||
.IsRequired() |
|||
.HasColumnType("longtext") |
|||
.HasColumnName("ExtraProperties"); |
|||
|
|||
b.Property<bool>("IsDeleted") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("tinyint(1)") |
|||
.HasDefaultValue(false) |
|||
.HasColumnName("IsDeleted"); |
|||
|
|||
b.Property<DateTime?>("LastModificationTime") |
|||
.HasColumnType("datetime(6)") |
|||
.HasColumnName("LastModificationTime"); |
|||
|
|||
b.Property<Guid?>("LastModifierId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("LastModifierId"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("DisplayName"); |
|||
|
|||
b.ToTable("AbpEditions", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.Saas.Tenants.Tenant", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("ConcurrencyStamp") |
|||
.IsConcurrencyToken() |
|||
.IsRequired() |
|||
.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<Guid?>("DeleterId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("DeleterId"); |
|||
|
|||
b.Property<DateTime?>("DeletionTime") |
|||
.HasColumnType("datetime(6)") |
|||
.HasColumnName("DeletionTime"); |
|||
|
|||
b.Property<DateTime?>("DisableTime") |
|||
.HasColumnType("datetime(6)"); |
|||
|
|||
b.Property<Guid?>("EditionId") |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<DateTime?>("EnableTime") |
|||
.HasColumnType("datetime(6)"); |
|||
|
|||
b.Property<int>("EntityVersion") |
|||
.HasColumnType("int"); |
|||
|
|||
b.Property<string>("ExtraProperties") |
|||
.IsRequired() |
|||
.HasColumnType("longtext") |
|||
.HasColumnName("ExtraProperties"); |
|||
|
|||
b.Property<bool>("IsActive") |
|||
.HasColumnType("tinyint(1)"); |
|||
|
|||
b.Property<bool>("IsDeleted") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("tinyint(1)") |
|||
.HasDefaultValue(false) |
|||
.HasColumnName("IsDeleted"); |
|||
|
|||
b.Property<DateTime?>("LastModificationTime") |
|||
.HasColumnType("datetime(6)") |
|||
.HasColumnName("LastModificationTime"); |
|||
|
|||
b.Property<Guid?>("LastModifierId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("LastModifierId"); |
|||
|
|||
b.Property<string>("Name") |
|||
.IsRequired() |
|||
.HasMaxLength(64) |
|||
.HasColumnType("varchar(64)"); |
|||
|
|||
b.Property<string>("NormalizedName") |
|||
.HasMaxLength(64) |
|||
.HasColumnType("varchar(64)"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("EditionId"); |
|||
|
|||
b.HasIndex("Name"); |
|||
|
|||
b.HasIndex("NormalizedName"); |
|||
|
|||
b.ToTable("AbpTenants", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.Saas.Tenants.TenantConnectionString", b => |
|||
{ |
|||
b.Property<Guid>("TenantId") |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("Name") |
|||
.HasMaxLength(64) |
|||
.HasColumnType("varchar(64)"); |
|||
|
|||
b.Property<string>("Value") |
|||
.IsRequired() |
|||
.HasMaxLength(1024) |
|||
.HasColumnType("varchar(1024)"); |
|||
|
|||
b.HasKey("TenantId", "Name"); |
|||
|
|||
b.ToTable("AbpTenantConnectionStrings", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.TextTemplating.TextTemplate", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("Content") |
|||
.HasMaxLength(1048576) |
|||
.HasColumnType("longtext") |
|||
.HasColumnName("Content"); |
|||
|
|||
b.Property<DateTime>("CreationTime") |
|||
.HasColumnType("datetime(6)") |
|||
.HasColumnName("CreationTime"); |
|||
|
|||
b.Property<Guid?>("CreatorId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("CreatorId"); |
|||
|
|||
b.Property<string>("Culture") |
|||
.HasMaxLength(30) |
|||
.HasColumnType("varchar(30)") |
|||
.HasColumnName("Culture"); |
|||
|
|||
b.Property<string>("DisplayName") |
|||
.IsRequired() |
|||
.HasMaxLength(100) |
|||
.HasColumnType("varchar(100)") |
|||
.HasColumnName("DisplayName"); |
|||
|
|||
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<Guid?>("TenantId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("TenantId"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("TenantId", "Name") |
|||
.HasDatabaseName("IX_Tenant_Text_Template_Name"); |
|||
|
|||
b.ToTable("AbpTextTemplates", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.TextTemplating.TextTemplateDefinition", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("ConcurrencyStamp") |
|||
.IsConcurrencyToken() |
|||
.IsRequired() |
|||
.HasMaxLength(40) |
|||
.HasColumnType("varchar(40)") |
|||
.HasColumnName("ConcurrencyStamp"); |
|||
|
|||
b.Property<string>("DefaultCultureName") |
|||
.HasMaxLength(30) |
|||
.HasColumnType("varchar(30)") |
|||
.HasColumnName("DefaultCultureName"); |
|||
|
|||
b.Property<string>("DisplayName") |
|||
.IsRequired() |
|||
.HasMaxLength(512) |
|||
.HasColumnType("varchar(512)") |
|||
.HasColumnName("DisplayName"); |
|||
|
|||
b.Property<string>("ExtraProperties") |
|||
.IsRequired() |
|||
.HasColumnType("longtext") |
|||
.HasColumnName("ExtraProperties"); |
|||
|
|||
b.Property<bool>("IsInlineLocalized") |
|||
.HasColumnType("tinyint(1)"); |
|||
|
|||
b.Property<bool>("IsLayout") |
|||
.HasColumnType("tinyint(1)"); |
|||
|
|||
b.Property<bool>("IsStatic") |
|||
.HasColumnType("tinyint(1)"); |
|||
|
|||
b.Property<string>("Layout") |
|||
.HasMaxLength(60) |
|||
.HasColumnType("varchar(60)") |
|||
.HasColumnName("Layout"); |
|||
|
|||
b.Property<string>("LocalizationResourceName") |
|||
.HasMaxLength(64) |
|||
.HasColumnType("varchar(64)") |
|||
.HasColumnName("LocalizationResourceName"); |
|||
|
|||
b.Property<string>("Name") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)") |
|||
.HasColumnName("Name"); |
|||
|
|||
b.Property<string>("RenderEngine") |
|||
.HasMaxLength(30) |
|||
.HasColumnType("varchar(30)") |
|||
.HasColumnName("RenderEngine"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.ToTable("AbpTextTemplateDefinitions", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureDefinitionRecord", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("AllowedProviders") |
|||
.HasMaxLength(256) |
|||
.HasColumnType("varchar(256)"); |
|||
|
|||
b.Property<string>("DefaultValue") |
|||
.HasMaxLength(256) |
|||
.HasColumnType("varchar(256)"); |
|||
|
|||
b.Property<string>("Description") |
|||
.HasMaxLength(256) |
|||
.HasColumnType("varchar(256)"); |
|||
|
|||
b.Property<string>("DisplayName") |
|||
.IsRequired() |
|||
.HasMaxLength(256) |
|||
.HasColumnType("varchar(256)"); |
|||
|
|||
b.Property<string>("ExtraProperties") |
|||
.HasColumnType("longtext") |
|||
.HasColumnName("ExtraProperties"); |
|||
|
|||
b.Property<string>("GroupName") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.Property<bool>("IsAvailableToHost") |
|||
.HasColumnType("tinyint(1)"); |
|||
|
|||
b.Property<bool>("IsVisibleToClients") |
|||
.HasColumnType("tinyint(1)"); |
|||
|
|||
b.Property<string>("Name") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.Property<string>("ParentName") |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.Property<string>("ValueType") |
|||
.HasMaxLength(2048) |
|||
.HasColumnType("varchar(2048)"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("GroupName"); |
|||
|
|||
b.HasIndex("Name") |
|||
.IsUnique(); |
|||
|
|||
b.ToTable("AbpFeatures", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureGroupDefinitionRecord", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("DisplayName") |
|||
.IsRequired() |
|||
.HasMaxLength(256) |
|||
.HasColumnType("varchar(256)"); |
|||
|
|||
b.Property<string>("ExtraProperties") |
|||
.HasColumnType("longtext") |
|||
.HasColumnName("ExtraProperties"); |
|||
|
|||
b.Property<string>("Name") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("Name") |
|||
.IsUnique(); |
|||
|
|||
b.ToTable("AbpFeatureGroups", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureValue", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("Name") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.Property<string>("ProviderKey") |
|||
.HasMaxLength(64) |
|||
.HasColumnType("varchar(64)"); |
|||
|
|||
b.Property<string>("ProviderName") |
|||
.HasMaxLength(64) |
|||
.HasColumnType("varchar(64)"); |
|||
|
|||
b.Property<string>("Value") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("Name", "ProviderName", "ProviderKey") |
|||
.IsUnique(); |
|||
|
|||
b.ToTable("AbpFeatureValues", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionDefinitionRecord", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("DisplayName") |
|||
.IsRequired() |
|||
.HasMaxLength(256) |
|||
.HasColumnType("varchar(256)"); |
|||
|
|||
b.Property<string>("ExtraProperties") |
|||
.HasColumnType("longtext") |
|||
.HasColumnName("ExtraProperties"); |
|||
|
|||
b.Property<string>("GroupName") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.Property<bool>("IsEnabled") |
|||
.HasColumnType("tinyint(1)"); |
|||
|
|||
b.Property<byte>("MultiTenancySide") |
|||
.HasColumnType("tinyint unsigned"); |
|||
|
|||
b.Property<string>("Name") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.Property<string>("ParentName") |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.Property<string>("Providers") |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.Property<string>("StateCheckers") |
|||
.HasMaxLength(256) |
|||
.HasColumnType("varchar(256)"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("GroupName"); |
|||
|
|||
b.HasIndex("Name") |
|||
.IsUnique(); |
|||
|
|||
b.ToTable("AbpPermissions", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGrant", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("Name") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.Property<string>("ProviderKey") |
|||
.IsRequired() |
|||
.HasMaxLength(64) |
|||
.HasColumnType("varchar(64)"); |
|||
|
|||
b.Property<string>("ProviderName") |
|||
.IsRequired() |
|||
.HasMaxLength(64) |
|||
.HasColumnType("varchar(64)"); |
|||
|
|||
b.Property<Guid?>("TenantId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("TenantId"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("TenantId", "Name", "ProviderName", "ProviderKey") |
|||
.IsUnique(); |
|||
|
|||
b.ToTable("AbpPermissionGrants", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGroupDefinitionRecord", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("DisplayName") |
|||
.IsRequired() |
|||
.HasMaxLength(256) |
|||
.HasColumnType("varchar(256)"); |
|||
|
|||
b.Property<string>("ExtraProperties") |
|||
.HasColumnType("longtext") |
|||
.HasColumnName("ExtraProperties"); |
|||
|
|||
b.Property<string>("Name") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("Name") |
|||
.IsUnique(); |
|||
|
|||
b.ToTable("AbpPermissionGroups", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("Volo.Abp.SettingManagement.Setting", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("Name") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.Property<string>("ProviderKey") |
|||
.HasMaxLength(64) |
|||
.HasColumnType("varchar(64)"); |
|||
|
|||
b.Property<string>("ProviderName") |
|||
.HasMaxLength(64) |
|||
.HasColumnType("varchar(64)"); |
|||
|
|||
b.Property<string>("Value") |
|||
.IsRequired() |
|||
.HasMaxLength(2048) |
|||
.HasColumnType("varchar(2048)"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("Name", "ProviderName", "ProviderKey") |
|||
.IsUnique(); |
|||
|
|||
b.ToTable("AbpSettings", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("Volo.Abp.SettingManagement.SettingDefinitionRecord", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("DefaultValue") |
|||
.HasMaxLength(2048) |
|||
.HasColumnType("varchar(2048)"); |
|||
|
|||
b.Property<string>("Description") |
|||
.HasMaxLength(512) |
|||
.HasColumnType("varchar(512)"); |
|||
|
|||
b.Property<string>("DisplayName") |
|||
.IsRequired() |
|||
.HasMaxLength(256) |
|||
.HasColumnType("varchar(256)"); |
|||
|
|||
b.Property<string>("ExtraProperties") |
|||
.HasColumnType("longtext") |
|||
.HasColumnName("ExtraProperties"); |
|||
|
|||
b.Property<bool>("IsEncrypted") |
|||
.HasColumnType("tinyint(1)"); |
|||
|
|||
b.Property<bool>("IsInherited") |
|||
.HasColumnType("tinyint(1)"); |
|||
|
|||
b.Property<bool>("IsVisibleToClients") |
|||
.HasColumnType("tinyint(1)"); |
|||
|
|||
b.Property<string>("Name") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.Property<string>("Providers") |
|||
.HasMaxLength(1024) |
|||
.HasColumnType("varchar(1024)"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("Name") |
|||
.IsUnique(); |
|||
|
|||
b.ToTable("AbpSettingDefinitions", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.Saas.Tenants.Tenant", b => |
|||
{ |
|||
b.HasOne("LINGYUN.Abp.Saas.Editions.Edition", "Edition") |
|||
.WithMany() |
|||
.HasForeignKey("EditionId"); |
|||
|
|||
b.Navigation("Edition"); |
|||
}); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.Saas.Tenants.TenantConnectionString", b => |
|||
{ |
|||
b.HasOne("LINGYUN.Abp.Saas.Tenants.Tenant", null) |
|||
.WithMany("ConnectionStrings") |
|||
.HasForeignKey("TenantId") |
|||
.OnDelete(DeleteBehavior.Cascade) |
|||
.IsRequired(); |
|||
}); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.Saas.Tenants.Tenant", b => |
|||
{ |
|||
b.Navigation("ConnectionStrings"); |
|||
}); |
|||
#pragma warning restore 612, 618
|
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,39 @@ |
|||
using Microsoft.EntityFrameworkCore.Migrations; |
|||
|
|||
#nullable disable |
|||
|
|||
namespace LINGYUN.Abp.MicroService.AdminService.EntityFrameworkCore.Migrations |
|||
{ |
|||
/// <inheritdoc />
|
|||
public partial class UpgradeAbpFrameworkTo810 : Migration |
|||
{ |
|||
/// <inheritdoc />
|
|||
protected override void Up(MigrationBuilder migrationBuilder) |
|||
{ |
|||
migrationBuilder.AddColumn<string>( |
|||
name: "NormalizedName", |
|||
table: "AbpTenants", |
|||
type: "varchar(64)", |
|||
maxLength: 64, |
|||
nullable: true) |
|||
.Annotation("MySql:CharSet", "utf8mb4"); |
|||
|
|||
migrationBuilder.CreateIndex( |
|||
name: "IX_AbpTenants_NormalizedName", |
|||
table: "AbpTenants", |
|||
column: "NormalizedName"); |
|||
} |
|||
|
|||
/// <inheritdoc />
|
|||
protected override void Down(MigrationBuilder migrationBuilder) |
|||
{ |
|||
migrationBuilder.DropIndex( |
|||
name: "IX_AbpTenants_NormalizedName", |
|||
table: "AbpTenants"); |
|||
|
|||
migrationBuilder.DropColumn( |
|||
name: "NormalizedName", |
|||
table: "AbpTenants"); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,931 @@ |
|||
// <auto-generated />
|
|||
using System; |
|||
using Microsoft.EntityFrameworkCore; |
|||
using Microsoft.EntityFrameworkCore.Infrastructure; |
|||
using Microsoft.EntityFrameworkCore.Migrations; |
|||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion; |
|||
using Volo.Abp.EntityFrameworkCore; |
|||
|
|||
#nullable disable |
|||
|
|||
namespace LINGYUN.Abp.MicroService.AdminService.EntityFrameworkCore.Migrations |
|||
{ |
|||
[DbContext(typeof(AdminServiceMigrationsDbContext))] |
|||
[Migration("20240515073346_Add-Data-Protected-Module")] |
|||
partial class AddDataProtectedModule |
|||
{ |
|||
/// <inheritdoc />
|
|||
protected override void BuildTargetModel(ModelBuilder modelBuilder) |
|||
{ |
|||
#pragma warning disable 612, 618
|
|||
modelBuilder |
|||
.HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.MySql) |
|||
.HasAnnotation("ProductVersion", "8.0.0") |
|||
.HasAnnotation("Relational:MaxIdentifierLength", 64); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.DataProtectionManagement.EntityPropertyInfo", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("DisplayName") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)") |
|||
.HasColumnName("DisplayName"); |
|||
|
|||
b.Property<string>("Name") |
|||
.IsRequired() |
|||
.HasMaxLength(64) |
|||
.HasColumnType("varchar(64)") |
|||
.HasColumnName("Name"); |
|||
|
|||
b.Property<string>("TypeFullName") |
|||
.IsRequired() |
|||
.HasMaxLength(256) |
|||
.HasColumnType("varchar(256)") |
|||
.HasColumnName("TypeFullName"); |
|||
|
|||
b.Property<Guid>("TypeInfoId") |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("ValueRange") |
|||
.HasMaxLength(512) |
|||
.HasColumnType("varchar(512)") |
|||
.HasColumnName("ValueRange"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("TypeInfoId", "TypeFullName"); |
|||
|
|||
b.ToTable("AbpAuthEntityProperties", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.DataProtectionManagement.EntityTypeInfo", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("ConcurrencyStamp") |
|||
.IsConcurrencyToken() |
|||
.IsRequired() |
|||
.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>("DisplayName") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)") |
|||
.HasColumnName("DisplayName"); |
|||
|
|||
b.Property<string>("ExtraProperties") |
|||
.IsRequired() |
|||
.HasColumnType("longtext") |
|||
.HasColumnName("ExtraProperties"); |
|||
|
|||
b.Property<bool>("IsAuditEnabled") |
|||
.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(64) |
|||
.HasColumnType("varchar(64)") |
|||
.HasColumnName("Name"); |
|||
|
|||
b.Property<string>("TypeFullName") |
|||
.IsRequired() |
|||
.HasMaxLength(256) |
|||
.HasColumnType("varchar(256)") |
|||
.HasColumnName("TypeFullName"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("TypeFullName"); |
|||
|
|||
b.ToTable("AbpAuthEntitites", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.DataProtectionManagement.OrganizationUnitEntityRule", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("ConcurrencyStamp") |
|||
.IsConcurrencyToken() |
|||
.IsRequired() |
|||
.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>("EntityTypeFullName") |
|||
.HasColumnType("longtext"); |
|||
|
|||
b.Property<Guid>("EntityTypeId") |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("ExtraProperties") |
|||
.IsRequired() |
|||
.HasColumnType("longtext") |
|||
.HasColumnName("ExtraProperties"); |
|||
|
|||
b.Property<string>("FilterGroup") |
|||
.HasColumnType("longtext") |
|||
.HasColumnName("FilterGroup"); |
|||
|
|||
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<int>("Operation") |
|||
.HasColumnType("int"); |
|||
|
|||
b.Property<string>("OrgCode") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)") |
|||
.HasColumnName("OrgCode"); |
|||
|
|||
b.Property<Guid>("OrgId") |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<Guid?>("TenantId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("TenantId"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("EntityTypeId"); |
|||
|
|||
b.ToTable("AbpAuthOrganizationUnitEntityRules", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.DataProtectionManagement.RoleEntityRule", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("ConcurrencyStamp") |
|||
.IsConcurrencyToken() |
|||
.IsRequired() |
|||
.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>("EntityTypeFullName") |
|||
.HasColumnType("longtext"); |
|||
|
|||
b.Property<Guid>("EntityTypeId") |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("ExtraProperties") |
|||
.IsRequired() |
|||
.HasColumnType("longtext") |
|||
.HasColumnName("ExtraProperties"); |
|||
|
|||
b.Property<string>("FilterGroup") |
|||
.HasColumnType("longtext") |
|||
.HasColumnName("FilterGroup"); |
|||
|
|||
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<int>("Operation") |
|||
.HasColumnType("int"); |
|||
|
|||
b.Property<Guid>("RoleId") |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("RoleName") |
|||
.IsRequired() |
|||
.HasMaxLength(256) |
|||
.HasColumnType("varchar(256)") |
|||
.HasColumnName("RoleName"); |
|||
|
|||
b.Property<Guid?>("TenantId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("TenantId"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("EntityTypeId"); |
|||
|
|||
b.ToTable("AbpAuthRoleEntityRules", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.Saas.Editions.Edition", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("ConcurrencyStamp") |
|||
.IsConcurrencyToken() |
|||
.IsRequired() |
|||
.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<Guid?>("DeleterId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("DeleterId"); |
|||
|
|||
b.Property<DateTime?>("DeletionTime") |
|||
.HasColumnType("datetime(6)") |
|||
.HasColumnName("DeletionTime"); |
|||
|
|||
b.Property<string>("DisplayName") |
|||
.IsRequired() |
|||
.HasMaxLength(64) |
|||
.HasColumnType("varchar(64)"); |
|||
|
|||
b.Property<int>("EntityVersion") |
|||
.HasColumnType("int"); |
|||
|
|||
b.Property<string>("ExtraProperties") |
|||
.IsRequired() |
|||
.HasColumnType("longtext") |
|||
.HasColumnName("ExtraProperties"); |
|||
|
|||
b.Property<bool>("IsDeleted") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("tinyint(1)") |
|||
.HasDefaultValue(false) |
|||
.HasColumnName("IsDeleted"); |
|||
|
|||
b.Property<DateTime?>("LastModificationTime") |
|||
.HasColumnType("datetime(6)") |
|||
.HasColumnName("LastModificationTime"); |
|||
|
|||
b.Property<Guid?>("LastModifierId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("LastModifierId"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("DisplayName"); |
|||
|
|||
b.ToTable("AbpEditions", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.Saas.Tenants.Tenant", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("ConcurrencyStamp") |
|||
.IsConcurrencyToken() |
|||
.IsRequired() |
|||
.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<Guid?>("DeleterId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("DeleterId"); |
|||
|
|||
b.Property<DateTime?>("DeletionTime") |
|||
.HasColumnType("datetime(6)") |
|||
.HasColumnName("DeletionTime"); |
|||
|
|||
b.Property<DateTime?>("DisableTime") |
|||
.HasColumnType("datetime(6)"); |
|||
|
|||
b.Property<Guid?>("EditionId") |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<DateTime?>("EnableTime") |
|||
.HasColumnType("datetime(6)"); |
|||
|
|||
b.Property<int>("EntityVersion") |
|||
.HasColumnType("int"); |
|||
|
|||
b.Property<string>("ExtraProperties") |
|||
.IsRequired() |
|||
.HasColumnType("longtext") |
|||
.HasColumnName("ExtraProperties"); |
|||
|
|||
b.Property<bool>("IsActive") |
|||
.HasColumnType("tinyint(1)"); |
|||
|
|||
b.Property<bool>("IsDeleted") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("tinyint(1)") |
|||
.HasDefaultValue(false) |
|||
.HasColumnName("IsDeleted"); |
|||
|
|||
b.Property<DateTime?>("LastModificationTime") |
|||
.HasColumnType("datetime(6)") |
|||
.HasColumnName("LastModificationTime"); |
|||
|
|||
b.Property<Guid?>("LastModifierId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("LastModifierId"); |
|||
|
|||
b.Property<string>("Name") |
|||
.IsRequired() |
|||
.HasMaxLength(64) |
|||
.HasColumnType("varchar(64)"); |
|||
|
|||
b.Property<string>("NormalizedName") |
|||
.HasMaxLength(64) |
|||
.HasColumnType("varchar(64)"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("EditionId"); |
|||
|
|||
b.HasIndex("Name"); |
|||
|
|||
b.HasIndex("NormalizedName"); |
|||
|
|||
b.ToTable("AbpTenants", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.Saas.Tenants.TenantConnectionString", b => |
|||
{ |
|||
b.Property<Guid>("TenantId") |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("Name") |
|||
.HasMaxLength(64) |
|||
.HasColumnType("varchar(64)"); |
|||
|
|||
b.Property<string>("Value") |
|||
.IsRequired() |
|||
.HasMaxLength(1024) |
|||
.HasColumnType("varchar(1024)"); |
|||
|
|||
b.HasKey("TenantId", "Name"); |
|||
|
|||
b.ToTable("AbpTenantConnectionStrings", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.TextTemplating.TextTemplate", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("Content") |
|||
.HasMaxLength(1048576) |
|||
.HasColumnType("longtext") |
|||
.HasColumnName("Content"); |
|||
|
|||
b.Property<DateTime>("CreationTime") |
|||
.HasColumnType("datetime(6)") |
|||
.HasColumnName("CreationTime"); |
|||
|
|||
b.Property<Guid?>("CreatorId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("CreatorId"); |
|||
|
|||
b.Property<string>("Culture") |
|||
.HasMaxLength(30) |
|||
.HasColumnType("varchar(30)") |
|||
.HasColumnName("Culture"); |
|||
|
|||
b.Property<string>("DisplayName") |
|||
.IsRequired() |
|||
.HasMaxLength(100) |
|||
.HasColumnType("varchar(100)") |
|||
.HasColumnName("DisplayName"); |
|||
|
|||
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<Guid?>("TenantId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("TenantId"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("TenantId", "Name") |
|||
.HasDatabaseName("IX_Tenant_Text_Template_Name"); |
|||
|
|||
b.ToTable("AbpTextTemplates", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.TextTemplating.TextTemplateDefinition", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("ConcurrencyStamp") |
|||
.IsConcurrencyToken() |
|||
.IsRequired() |
|||
.HasMaxLength(40) |
|||
.HasColumnType("varchar(40)") |
|||
.HasColumnName("ConcurrencyStamp"); |
|||
|
|||
b.Property<string>("DefaultCultureName") |
|||
.HasMaxLength(30) |
|||
.HasColumnType("varchar(30)") |
|||
.HasColumnName("DefaultCultureName"); |
|||
|
|||
b.Property<string>("DisplayName") |
|||
.IsRequired() |
|||
.HasMaxLength(512) |
|||
.HasColumnType("varchar(512)") |
|||
.HasColumnName("DisplayName"); |
|||
|
|||
b.Property<string>("ExtraProperties") |
|||
.IsRequired() |
|||
.HasColumnType("longtext") |
|||
.HasColumnName("ExtraProperties"); |
|||
|
|||
b.Property<bool>("IsInlineLocalized") |
|||
.HasColumnType("tinyint(1)"); |
|||
|
|||
b.Property<bool>("IsLayout") |
|||
.HasColumnType("tinyint(1)"); |
|||
|
|||
b.Property<bool>("IsStatic") |
|||
.HasColumnType("tinyint(1)"); |
|||
|
|||
b.Property<string>("Layout") |
|||
.HasMaxLength(60) |
|||
.HasColumnType("varchar(60)") |
|||
.HasColumnName("Layout"); |
|||
|
|||
b.Property<string>("LocalizationResourceName") |
|||
.HasMaxLength(64) |
|||
.HasColumnType("varchar(64)") |
|||
.HasColumnName("LocalizationResourceName"); |
|||
|
|||
b.Property<string>("Name") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)") |
|||
.HasColumnName("Name"); |
|||
|
|||
b.Property<string>("RenderEngine") |
|||
.HasMaxLength(30) |
|||
.HasColumnType("varchar(30)") |
|||
.HasColumnName("RenderEngine"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.ToTable("AbpTextTemplateDefinitions", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureDefinitionRecord", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("AllowedProviders") |
|||
.HasMaxLength(256) |
|||
.HasColumnType("varchar(256)"); |
|||
|
|||
b.Property<string>("DefaultValue") |
|||
.HasMaxLength(256) |
|||
.HasColumnType("varchar(256)"); |
|||
|
|||
b.Property<string>("Description") |
|||
.HasMaxLength(256) |
|||
.HasColumnType("varchar(256)"); |
|||
|
|||
b.Property<string>("DisplayName") |
|||
.IsRequired() |
|||
.HasMaxLength(256) |
|||
.HasColumnType("varchar(256)"); |
|||
|
|||
b.Property<string>("ExtraProperties") |
|||
.HasColumnType("longtext") |
|||
.HasColumnName("ExtraProperties"); |
|||
|
|||
b.Property<string>("GroupName") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.Property<bool>("IsAvailableToHost") |
|||
.HasColumnType("tinyint(1)"); |
|||
|
|||
b.Property<bool>("IsVisibleToClients") |
|||
.HasColumnType("tinyint(1)"); |
|||
|
|||
b.Property<string>("Name") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.Property<string>("ParentName") |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.Property<string>("ValueType") |
|||
.HasMaxLength(2048) |
|||
.HasColumnType("varchar(2048)"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("GroupName"); |
|||
|
|||
b.HasIndex("Name") |
|||
.IsUnique(); |
|||
|
|||
b.ToTable("AbpFeatures", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureGroupDefinitionRecord", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("DisplayName") |
|||
.IsRequired() |
|||
.HasMaxLength(256) |
|||
.HasColumnType("varchar(256)"); |
|||
|
|||
b.Property<string>("ExtraProperties") |
|||
.HasColumnType("longtext") |
|||
.HasColumnName("ExtraProperties"); |
|||
|
|||
b.Property<string>("Name") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("Name") |
|||
.IsUnique(); |
|||
|
|||
b.ToTable("AbpFeatureGroups", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureValue", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("Name") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.Property<string>("ProviderKey") |
|||
.HasMaxLength(64) |
|||
.HasColumnType("varchar(64)"); |
|||
|
|||
b.Property<string>("ProviderName") |
|||
.HasMaxLength(64) |
|||
.HasColumnType("varchar(64)"); |
|||
|
|||
b.Property<string>("Value") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("Name", "ProviderName", "ProviderKey") |
|||
.IsUnique(); |
|||
|
|||
b.ToTable("AbpFeatureValues", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionDefinitionRecord", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("DisplayName") |
|||
.IsRequired() |
|||
.HasMaxLength(256) |
|||
.HasColumnType("varchar(256)"); |
|||
|
|||
b.Property<string>("ExtraProperties") |
|||
.HasColumnType("longtext") |
|||
.HasColumnName("ExtraProperties"); |
|||
|
|||
b.Property<string>("GroupName") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.Property<bool>("IsEnabled") |
|||
.HasColumnType("tinyint(1)"); |
|||
|
|||
b.Property<byte>("MultiTenancySide") |
|||
.HasColumnType("tinyint unsigned"); |
|||
|
|||
b.Property<string>("Name") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.Property<string>("ParentName") |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.Property<string>("Providers") |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.Property<string>("StateCheckers") |
|||
.HasMaxLength(256) |
|||
.HasColumnType("varchar(256)"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("GroupName"); |
|||
|
|||
b.HasIndex("Name") |
|||
.IsUnique(); |
|||
|
|||
b.ToTable("AbpPermissions", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGrant", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("Name") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.Property<string>("ProviderKey") |
|||
.IsRequired() |
|||
.HasMaxLength(64) |
|||
.HasColumnType("varchar(64)"); |
|||
|
|||
b.Property<string>("ProviderName") |
|||
.IsRequired() |
|||
.HasMaxLength(64) |
|||
.HasColumnType("varchar(64)"); |
|||
|
|||
b.Property<Guid?>("TenantId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("TenantId"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("TenantId", "Name", "ProviderName", "ProviderKey") |
|||
.IsUnique(); |
|||
|
|||
b.ToTable("AbpPermissionGrants", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGroupDefinitionRecord", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("DisplayName") |
|||
.IsRequired() |
|||
.HasMaxLength(256) |
|||
.HasColumnType("varchar(256)"); |
|||
|
|||
b.Property<string>("ExtraProperties") |
|||
.HasColumnType("longtext") |
|||
.HasColumnName("ExtraProperties"); |
|||
|
|||
b.Property<string>("Name") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("Name") |
|||
.IsUnique(); |
|||
|
|||
b.ToTable("AbpPermissionGroups", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("Volo.Abp.SettingManagement.Setting", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("Name") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.Property<string>("ProviderKey") |
|||
.HasMaxLength(64) |
|||
.HasColumnType("varchar(64)"); |
|||
|
|||
b.Property<string>("ProviderName") |
|||
.HasMaxLength(64) |
|||
.HasColumnType("varchar(64)"); |
|||
|
|||
b.Property<string>("Value") |
|||
.IsRequired() |
|||
.HasMaxLength(2048) |
|||
.HasColumnType("varchar(2048)"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("Name", "ProviderName", "ProviderKey") |
|||
.IsUnique(); |
|||
|
|||
b.ToTable("AbpSettings", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("Volo.Abp.SettingManagement.SettingDefinitionRecord", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("DefaultValue") |
|||
.HasMaxLength(2048) |
|||
.HasColumnType("varchar(2048)"); |
|||
|
|||
b.Property<string>("Description") |
|||
.HasMaxLength(512) |
|||
.HasColumnType("varchar(512)"); |
|||
|
|||
b.Property<string>("DisplayName") |
|||
.IsRequired() |
|||
.HasMaxLength(256) |
|||
.HasColumnType("varchar(256)"); |
|||
|
|||
b.Property<string>("ExtraProperties") |
|||
.HasColumnType("longtext") |
|||
.HasColumnName("ExtraProperties"); |
|||
|
|||
b.Property<bool>("IsEncrypted") |
|||
.HasColumnType("tinyint(1)"); |
|||
|
|||
b.Property<bool>("IsInherited") |
|||
.HasColumnType("tinyint(1)"); |
|||
|
|||
b.Property<bool>("IsVisibleToClients") |
|||
.HasColumnType("tinyint(1)"); |
|||
|
|||
b.Property<string>("Name") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.Property<string>("Providers") |
|||
.HasMaxLength(1024) |
|||
.HasColumnType("varchar(1024)"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("Name") |
|||
.IsUnique(); |
|||
|
|||
b.ToTable("AbpSettingDefinitions", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.DataProtectionManagement.EntityPropertyInfo", b => |
|||
{ |
|||
b.HasOne("LINGYUN.Abp.DataProtectionManagement.EntityTypeInfo", "TypeInfo") |
|||
.WithMany("Properties") |
|||
.HasForeignKey("TypeInfoId") |
|||
.OnDelete(DeleteBehavior.Cascade) |
|||
.IsRequired(); |
|||
|
|||
b.Navigation("TypeInfo"); |
|||
}); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.DataProtectionManagement.OrganizationUnitEntityRule", b => |
|||
{ |
|||
b.HasOne("LINGYUN.Abp.DataProtectionManagement.EntityTypeInfo", "EntityTypeInfo") |
|||
.WithMany() |
|||
.HasForeignKey("EntityTypeId") |
|||
.OnDelete(DeleteBehavior.Cascade) |
|||
.IsRequired(); |
|||
|
|||
b.Navigation("EntityTypeInfo"); |
|||
}); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.DataProtectionManagement.RoleEntityRule", b => |
|||
{ |
|||
b.HasOne("LINGYUN.Abp.DataProtectionManagement.EntityTypeInfo", "EntityTypeInfo") |
|||
.WithMany() |
|||
.HasForeignKey("EntityTypeId") |
|||
.OnDelete(DeleteBehavior.Cascade) |
|||
.IsRequired(); |
|||
|
|||
b.Navigation("EntityTypeInfo"); |
|||
}); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.Saas.Tenants.Tenant", b => |
|||
{ |
|||
b.HasOne("LINGYUN.Abp.Saas.Editions.Edition", "Edition") |
|||
.WithMany() |
|||
.HasForeignKey("EditionId"); |
|||
|
|||
b.Navigation("Edition"); |
|||
}); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.Saas.Tenants.TenantConnectionString", b => |
|||
{ |
|||
b.HasOne("LINGYUN.Abp.Saas.Tenants.Tenant", null) |
|||
.WithMany("ConnectionStrings") |
|||
.HasForeignKey("TenantId") |
|||
.OnDelete(DeleteBehavior.Cascade) |
|||
.IsRequired(); |
|||
}); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.DataProtectionManagement.EntityTypeInfo", b => |
|||
{ |
|||
b.Navigation("Properties"); |
|||
}); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.Saas.Tenants.Tenant", b => |
|||
{ |
|||
b.Navigation("ConnectionStrings"); |
|||
}); |
|||
#pragma warning restore 612, 618
|
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,179 @@ |
|||
using System; |
|||
using Microsoft.EntityFrameworkCore.Migrations; |
|||
|
|||
#nullable disable |
|||
|
|||
namespace LINGYUN.Abp.MicroService.AdminService.EntityFrameworkCore.Migrations |
|||
{ |
|||
/// <inheritdoc />
|
|||
public partial class AddDataProtectedModule : Migration |
|||
{ |
|||
/// <inheritdoc />
|
|||
protected override void Up(MigrationBuilder migrationBuilder) |
|||
{ |
|||
migrationBuilder.CreateTable( |
|||
name: "AbpAuthEntitites", |
|||
columns: table => new |
|||
{ |
|||
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"), |
|||
Name = table.Column<string>(type: "varchar(64)", maxLength: 64, nullable: false) |
|||
.Annotation("MySql:CharSet", "utf8mb4"), |
|||
DisplayName = table.Column<string>(type: "varchar(128)", maxLength: 128, nullable: false) |
|||
.Annotation("MySql:CharSet", "utf8mb4"), |
|||
TypeFullName = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: false) |
|||
.Annotation("MySql:CharSet", "utf8mb4"), |
|||
IsAuditEnabled = table.Column<bool>(type: "tinyint(1)", nullable: false), |
|||
ExtraProperties = table.Column<string>(type: "longtext", nullable: false) |
|||
.Annotation("MySql:CharSet", "utf8mb4"), |
|||
ConcurrencyStamp = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: false) |
|||
.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_AbpAuthEntitites", x => x.Id); |
|||
}) |
|||
.Annotation("MySql:CharSet", "utf8mb4"); |
|||
|
|||
migrationBuilder.CreateTable( |
|||
name: "AbpAuthEntityProperties", |
|||
columns: table => new |
|||
{ |
|||
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"), |
|||
Name = table.Column<string>(type: "varchar(64)", maxLength: 64, nullable: false) |
|||
.Annotation("MySql:CharSet", "utf8mb4"), |
|||
DisplayName = table.Column<string>(type: "varchar(128)", maxLength: 128, nullable: false) |
|||
.Annotation("MySql:CharSet", "utf8mb4"), |
|||
TypeFullName = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: false) |
|||
.Annotation("MySql:CharSet", "utf8mb4"), |
|||
ValueRange = table.Column<string>(type: "varchar(512)", maxLength: 512, nullable: true) |
|||
.Annotation("MySql:CharSet", "utf8mb4"), |
|||
TypeInfoId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci") |
|||
}, |
|||
constraints: table => |
|||
{ |
|||
table.PrimaryKey("PK_AbpAuthEntityProperties", x => x.Id); |
|||
table.ForeignKey( |
|||
name: "FK_AbpAuthEntityProperties_AbpAuthEntitites_TypeInfoId", |
|||
column: x => x.TypeInfoId, |
|||
principalTable: "AbpAuthEntitites", |
|||
principalColumn: "Id", |
|||
onDelete: ReferentialAction.Cascade); |
|||
}) |
|||
.Annotation("MySql:CharSet", "utf8mb4"); |
|||
|
|||
migrationBuilder.CreateTable( |
|||
name: "AbpAuthOrganizationUnitEntityRules", |
|||
columns: table => new |
|||
{ |
|||
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"), |
|||
OrgId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"), |
|||
OrgCode = table.Column<string>(type: "varchar(128)", maxLength: 128, nullable: false) |
|||
.Annotation("MySql:CharSet", "utf8mb4"), |
|||
ExtraProperties = table.Column<string>(type: "longtext", nullable: false) |
|||
.Annotation("MySql:CharSet", "utf8mb4"), |
|||
ConcurrencyStamp = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: false) |
|||
.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"), |
|||
TenantId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"), |
|||
IsEnabled = table.Column<bool>(type: "tinyint(1)", nullable: false), |
|||
Operation = table.Column<int>(type: "int", nullable: false), |
|||
FilterGroup = table.Column<string>(type: "longtext", nullable: true) |
|||
.Annotation("MySql:CharSet", "utf8mb4"), |
|||
EntityTypeId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"), |
|||
EntityTypeFullName = table.Column<string>(type: "longtext", nullable: true) |
|||
.Annotation("MySql:CharSet", "utf8mb4") |
|||
}, |
|||
constraints: table => |
|||
{ |
|||
table.PrimaryKey("PK_AbpAuthOrganizationUnitEntityRules", x => x.Id); |
|||
table.ForeignKey( |
|||
name: "FK_AbpAuthOrganizationUnitEntityRules_AbpAuthEntitites_EntityTy~", |
|||
column: x => x.EntityTypeId, |
|||
principalTable: "AbpAuthEntitites", |
|||
principalColumn: "Id", |
|||
onDelete: ReferentialAction.Cascade); |
|||
}) |
|||
.Annotation("MySql:CharSet", "utf8mb4"); |
|||
|
|||
migrationBuilder.CreateTable( |
|||
name: "AbpAuthRoleEntityRules", |
|||
columns: table => new |
|||
{ |
|||
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"), |
|||
RoleId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"), |
|||
RoleName = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: false) |
|||
.Annotation("MySql:CharSet", "utf8mb4"), |
|||
ExtraProperties = table.Column<string>(type: "longtext", nullable: false) |
|||
.Annotation("MySql:CharSet", "utf8mb4"), |
|||
ConcurrencyStamp = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: false) |
|||
.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"), |
|||
TenantId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"), |
|||
IsEnabled = table.Column<bool>(type: "tinyint(1)", nullable: false), |
|||
Operation = table.Column<int>(type: "int", nullable: false), |
|||
FilterGroup = table.Column<string>(type: "longtext", nullable: true) |
|||
.Annotation("MySql:CharSet", "utf8mb4"), |
|||
EntityTypeId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"), |
|||
EntityTypeFullName = table.Column<string>(type: "longtext", nullable: true) |
|||
.Annotation("MySql:CharSet", "utf8mb4") |
|||
}, |
|||
constraints: table => |
|||
{ |
|||
table.PrimaryKey("PK_AbpAuthRoleEntityRules", x => x.Id); |
|||
table.ForeignKey( |
|||
name: "FK_AbpAuthRoleEntityRules_AbpAuthEntitites_EntityTypeId", |
|||
column: x => x.EntityTypeId, |
|||
principalTable: "AbpAuthEntitites", |
|||
principalColumn: "Id", |
|||
onDelete: ReferentialAction.Cascade); |
|||
}) |
|||
.Annotation("MySql:CharSet", "utf8mb4"); |
|||
|
|||
migrationBuilder.CreateIndex( |
|||
name: "IX_AbpAuthEntitites_TypeFullName", |
|||
table: "AbpAuthEntitites", |
|||
column: "TypeFullName"); |
|||
|
|||
migrationBuilder.CreateIndex( |
|||
name: "IX_AbpAuthEntityProperties_TypeInfoId_TypeFullName", |
|||
table: "AbpAuthEntityProperties", |
|||
columns: new[] { "TypeInfoId", "TypeFullName" }); |
|||
|
|||
migrationBuilder.CreateIndex( |
|||
name: "IX_AbpAuthOrganizationUnitEntityRules_EntityTypeId", |
|||
table: "AbpAuthOrganizationUnitEntityRules", |
|||
column: "EntityTypeId"); |
|||
|
|||
migrationBuilder.CreateIndex( |
|||
name: "IX_AbpAuthRoleEntityRules_EntityTypeId", |
|||
table: "AbpAuthRoleEntityRules", |
|||
column: "EntityTypeId"); |
|||
} |
|||
|
|||
/// <inheritdoc />
|
|||
protected override void Down(MigrationBuilder migrationBuilder) |
|||
{ |
|||
migrationBuilder.DropTable( |
|||
name: "AbpAuthEntityProperties"); |
|||
|
|||
migrationBuilder.DropTable( |
|||
name: "AbpAuthOrganizationUnitEntityRules"); |
|||
|
|||
migrationBuilder.DropTable( |
|||
name: "AbpAuthRoleEntityRules"); |
|||
|
|||
migrationBuilder.DropTable( |
|||
name: "AbpAuthEntitites"); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,941 @@ |
|||
// <auto-generated />
|
|||
using System; |
|||
using Microsoft.EntityFrameworkCore; |
|||
using Microsoft.EntityFrameworkCore.Infrastructure; |
|||
using Microsoft.EntityFrameworkCore.Migrations; |
|||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion; |
|||
using Volo.Abp.EntityFrameworkCore; |
|||
|
|||
#nullable disable |
|||
|
|||
namespace LINGYUN.Abp.MicroService.AdminService.EntityFrameworkCore.Migrations |
|||
{ |
|||
[DbContext(typeof(AdminServiceMigrationsDbContext))] |
|||
[Migration("20240515092715_Add-Allow-Properties")] |
|||
partial class AddAllowProperties |
|||
{ |
|||
/// <inheritdoc />
|
|||
protected override void BuildTargetModel(ModelBuilder modelBuilder) |
|||
{ |
|||
#pragma warning disable 612, 618
|
|||
modelBuilder |
|||
.HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.MySql) |
|||
.HasAnnotation("ProductVersion", "8.0.0") |
|||
.HasAnnotation("Relational:MaxIdentifierLength", 64); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.DataProtectionManagement.EntityPropertyInfo", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("DisplayName") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)") |
|||
.HasColumnName("DisplayName"); |
|||
|
|||
b.Property<string>("Name") |
|||
.IsRequired() |
|||
.HasMaxLength(64) |
|||
.HasColumnType("varchar(64)") |
|||
.HasColumnName("Name"); |
|||
|
|||
b.Property<string>("TypeFullName") |
|||
.IsRequired() |
|||
.HasMaxLength(256) |
|||
.HasColumnType("varchar(256)") |
|||
.HasColumnName("TypeFullName"); |
|||
|
|||
b.Property<Guid>("TypeInfoId") |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("ValueRange") |
|||
.HasMaxLength(512) |
|||
.HasColumnType("varchar(512)") |
|||
.HasColumnName("ValueRange"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("TypeInfoId", "TypeFullName"); |
|||
|
|||
b.ToTable("AbpAuthEntityProperties", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.DataProtectionManagement.EntityTypeInfo", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("ConcurrencyStamp") |
|||
.IsConcurrencyToken() |
|||
.IsRequired() |
|||
.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>("DisplayName") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)") |
|||
.HasColumnName("DisplayName"); |
|||
|
|||
b.Property<string>("ExtraProperties") |
|||
.IsRequired() |
|||
.HasColumnType("longtext") |
|||
.HasColumnName("ExtraProperties"); |
|||
|
|||
b.Property<bool>("IsAuditEnabled") |
|||
.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(64) |
|||
.HasColumnType("varchar(64)") |
|||
.HasColumnName("Name"); |
|||
|
|||
b.Property<string>("TypeFullName") |
|||
.IsRequired() |
|||
.HasMaxLength(256) |
|||
.HasColumnType("varchar(256)") |
|||
.HasColumnName("TypeFullName"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("TypeFullName"); |
|||
|
|||
b.ToTable("AbpAuthEntitites", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.DataProtectionManagement.OrganizationUnitEntityRule", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("AllowProperties") |
|||
.HasMaxLength(512) |
|||
.HasColumnType("varchar(512)") |
|||
.HasColumnName("AllowProperties"); |
|||
|
|||
b.Property<string>("ConcurrencyStamp") |
|||
.IsConcurrencyToken() |
|||
.IsRequired() |
|||
.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>("EntityTypeFullName") |
|||
.HasColumnType("longtext"); |
|||
|
|||
b.Property<Guid>("EntityTypeId") |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("ExtraProperties") |
|||
.IsRequired() |
|||
.HasColumnType("longtext") |
|||
.HasColumnName("ExtraProperties"); |
|||
|
|||
b.Property<string>("FilterGroup") |
|||
.HasColumnType("longtext") |
|||
.HasColumnName("FilterGroup"); |
|||
|
|||
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<int>("Operation") |
|||
.HasColumnType("int"); |
|||
|
|||
b.Property<string>("OrgCode") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)") |
|||
.HasColumnName("OrgCode"); |
|||
|
|||
b.Property<Guid>("OrgId") |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<Guid?>("TenantId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("TenantId"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("EntityTypeId"); |
|||
|
|||
b.ToTable("AbpAuthOrganizationUnitEntityRules", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.DataProtectionManagement.RoleEntityRule", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("AllowProperties") |
|||
.HasMaxLength(512) |
|||
.HasColumnType("varchar(512)") |
|||
.HasColumnName("AllowProperties"); |
|||
|
|||
b.Property<string>("ConcurrencyStamp") |
|||
.IsConcurrencyToken() |
|||
.IsRequired() |
|||
.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>("EntityTypeFullName") |
|||
.HasColumnType("longtext"); |
|||
|
|||
b.Property<Guid>("EntityTypeId") |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("ExtraProperties") |
|||
.IsRequired() |
|||
.HasColumnType("longtext") |
|||
.HasColumnName("ExtraProperties"); |
|||
|
|||
b.Property<string>("FilterGroup") |
|||
.HasColumnType("longtext") |
|||
.HasColumnName("FilterGroup"); |
|||
|
|||
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<int>("Operation") |
|||
.HasColumnType("int"); |
|||
|
|||
b.Property<Guid>("RoleId") |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("RoleName") |
|||
.IsRequired() |
|||
.HasMaxLength(256) |
|||
.HasColumnType("varchar(256)") |
|||
.HasColumnName("RoleName"); |
|||
|
|||
b.Property<Guid?>("TenantId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("TenantId"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("EntityTypeId"); |
|||
|
|||
b.ToTable("AbpAuthRoleEntityRules", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.Saas.Editions.Edition", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("ConcurrencyStamp") |
|||
.IsConcurrencyToken() |
|||
.IsRequired() |
|||
.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<Guid?>("DeleterId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("DeleterId"); |
|||
|
|||
b.Property<DateTime?>("DeletionTime") |
|||
.HasColumnType("datetime(6)") |
|||
.HasColumnName("DeletionTime"); |
|||
|
|||
b.Property<string>("DisplayName") |
|||
.IsRequired() |
|||
.HasMaxLength(64) |
|||
.HasColumnType("varchar(64)"); |
|||
|
|||
b.Property<int>("EntityVersion") |
|||
.HasColumnType("int"); |
|||
|
|||
b.Property<string>("ExtraProperties") |
|||
.IsRequired() |
|||
.HasColumnType("longtext") |
|||
.HasColumnName("ExtraProperties"); |
|||
|
|||
b.Property<bool>("IsDeleted") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("tinyint(1)") |
|||
.HasDefaultValue(false) |
|||
.HasColumnName("IsDeleted"); |
|||
|
|||
b.Property<DateTime?>("LastModificationTime") |
|||
.HasColumnType("datetime(6)") |
|||
.HasColumnName("LastModificationTime"); |
|||
|
|||
b.Property<Guid?>("LastModifierId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("LastModifierId"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("DisplayName"); |
|||
|
|||
b.ToTable("AbpEditions", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.Saas.Tenants.Tenant", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("ConcurrencyStamp") |
|||
.IsConcurrencyToken() |
|||
.IsRequired() |
|||
.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<Guid?>("DeleterId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("DeleterId"); |
|||
|
|||
b.Property<DateTime?>("DeletionTime") |
|||
.HasColumnType("datetime(6)") |
|||
.HasColumnName("DeletionTime"); |
|||
|
|||
b.Property<DateTime?>("DisableTime") |
|||
.HasColumnType("datetime(6)"); |
|||
|
|||
b.Property<Guid?>("EditionId") |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<DateTime?>("EnableTime") |
|||
.HasColumnType("datetime(6)"); |
|||
|
|||
b.Property<int>("EntityVersion") |
|||
.HasColumnType("int"); |
|||
|
|||
b.Property<string>("ExtraProperties") |
|||
.IsRequired() |
|||
.HasColumnType("longtext") |
|||
.HasColumnName("ExtraProperties"); |
|||
|
|||
b.Property<bool>("IsActive") |
|||
.HasColumnType("tinyint(1)"); |
|||
|
|||
b.Property<bool>("IsDeleted") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("tinyint(1)") |
|||
.HasDefaultValue(false) |
|||
.HasColumnName("IsDeleted"); |
|||
|
|||
b.Property<DateTime?>("LastModificationTime") |
|||
.HasColumnType("datetime(6)") |
|||
.HasColumnName("LastModificationTime"); |
|||
|
|||
b.Property<Guid?>("LastModifierId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("LastModifierId"); |
|||
|
|||
b.Property<string>("Name") |
|||
.IsRequired() |
|||
.HasMaxLength(64) |
|||
.HasColumnType("varchar(64)"); |
|||
|
|||
b.Property<string>("NormalizedName") |
|||
.HasMaxLength(64) |
|||
.HasColumnType("varchar(64)"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("EditionId"); |
|||
|
|||
b.HasIndex("Name"); |
|||
|
|||
b.HasIndex("NormalizedName"); |
|||
|
|||
b.ToTable("AbpTenants", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.Saas.Tenants.TenantConnectionString", b => |
|||
{ |
|||
b.Property<Guid>("TenantId") |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("Name") |
|||
.HasMaxLength(64) |
|||
.HasColumnType("varchar(64)"); |
|||
|
|||
b.Property<string>("Value") |
|||
.IsRequired() |
|||
.HasMaxLength(1024) |
|||
.HasColumnType("varchar(1024)"); |
|||
|
|||
b.HasKey("TenantId", "Name"); |
|||
|
|||
b.ToTable("AbpTenantConnectionStrings", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.TextTemplating.TextTemplate", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("Content") |
|||
.HasMaxLength(1048576) |
|||
.HasColumnType("longtext") |
|||
.HasColumnName("Content"); |
|||
|
|||
b.Property<DateTime>("CreationTime") |
|||
.HasColumnType("datetime(6)") |
|||
.HasColumnName("CreationTime"); |
|||
|
|||
b.Property<Guid?>("CreatorId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("CreatorId"); |
|||
|
|||
b.Property<string>("Culture") |
|||
.HasMaxLength(30) |
|||
.HasColumnType("varchar(30)") |
|||
.HasColumnName("Culture"); |
|||
|
|||
b.Property<string>("DisplayName") |
|||
.IsRequired() |
|||
.HasMaxLength(100) |
|||
.HasColumnType("varchar(100)") |
|||
.HasColumnName("DisplayName"); |
|||
|
|||
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<Guid?>("TenantId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("TenantId"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("TenantId", "Name") |
|||
.HasDatabaseName("IX_Tenant_Text_Template_Name"); |
|||
|
|||
b.ToTable("AbpTextTemplates", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.TextTemplating.TextTemplateDefinition", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("ConcurrencyStamp") |
|||
.IsConcurrencyToken() |
|||
.IsRequired() |
|||
.HasMaxLength(40) |
|||
.HasColumnType("varchar(40)") |
|||
.HasColumnName("ConcurrencyStamp"); |
|||
|
|||
b.Property<string>("DefaultCultureName") |
|||
.HasMaxLength(30) |
|||
.HasColumnType("varchar(30)") |
|||
.HasColumnName("DefaultCultureName"); |
|||
|
|||
b.Property<string>("DisplayName") |
|||
.IsRequired() |
|||
.HasMaxLength(512) |
|||
.HasColumnType("varchar(512)") |
|||
.HasColumnName("DisplayName"); |
|||
|
|||
b.Property<string>("ExtraProperties") |
|||
.IsRequired() |
|||
.HasColumnType("longtext") |
|||
.HasColumnName("ExtraProperties"); |
|||
|
|||
b.Property<bool>("IsInlineLocalized") |
|||
.HasColumnType("tinyint(1)"); |
|||
|
|||
b.Property<bool>("IsLayout") |
|||
.HasColumnType("tinyint(1)"); |
|||
|
|||
b.Property<bool>("IsStatic") |
|||
.HasColumnType("tinyint(1)"); |
|||
|
|||
b.Property<string>("Layout") |
|||
.HasMaxLength(60) |
|||
.HasColumnType("varchar(60)") |
|||
.HasColumnName("Layout"); |
|||
|
|||
b.Property<string>("LocalizationResourceName") |
|||
.HasMaxLength(64) |
|||
.HasColumnType("varchar(64)") |
|||
.HasColumnName("LocalizationResourceName"); |
|||
|
|||
b.Property<string>("Name") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)") |
|||
.HasColumnName("Name"); |
|||
|
|||
b.Property<string>("RenderEngine") |
|||
.HasMaxLength(30) |
|||
.HasColumnType("varchar(30)") |
|||
.HasColumnName("RenderEngine"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.ToTable("AbpTextTemplateDefinitions", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureDefinitionRecord", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("AllowedProviders") |
|||
.HasMaxLength(256) |
|||
.HasColumnType("varchar(256)"); |
|||
|
|||
b.Property<string>("DefaultValue") |
|||
.HasMaxLength(256) |
|||
.HasColumnType("varchar(256)"); |
|||
|
|||
b.Property<string>("Description") |
|||
.HasMaxLength(256) |
|||
.HasColumnType("varchar(256)"); |
|||
|
|||
b.Property<string>("DisplayName") |
|||
.IsRequired() |
|||
.HasMaxLength(256) |
|||
.HasColumnType("varchar(256)"); |
|||
|
|||
b.Property<string>("ExtraProperties") |
|||
.HasColumnType("longtext") |
|||
.HasColumnName("ExtraProperties"); |
|||
|
|||
b.Property<string>("GroupName") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.Property<bool>("IsAvailableToHost") |
|||
.HasColumnType("tinyint(1)"); |
|||
|
|||
b.Property<bool>("IsVisibleToClients") |
|||
.HasColumnType("tinyint(1)"); |
|||
|
|||
b.Property<string>("Name") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.Property<string>("ParentName") |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.Property<string>("ValueType") |
|||
.HasMaxLength(2048) |
|||
.HasColumnType("varchar(2048)"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("GroupName"); |
|||
|
|||
b.HasIndex("Name") |
|||
.IsUnique(); |
|||
|
|||
b.ToTable("AbpFeatures", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureGroupDefinitionRecord", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("DisplayName") |
|||
.IsRequired() |
|||
.HasMaxLength(256) |
|||
.HasColumnType("varchar(256)"); |
|||
|
|||
b.Property<string>("ExtraProperties") |
|||
.HasColumnType("longtext") |
|||
.HasColumnName("ExtraProperties"); |
|||
|
|||
b.Property<string>("Name") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("Name") |
|||
.IsUnique(); |
|||
|
|||
b.ToTable("AbpFeatureGroups", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureValue", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("Name") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.Property<string>("ProviderKey") |
|||
.HasMaxLength(64) |
|||
.HasColumnType("varchar(64)"); |
|||
|
|||
b.Property<string>("ProviderName") |
|||
.HasMaxLength(64) |
|||
.HasColumnType("varchar(64)"); |
|||
|
|||
b.Property<string>("Value") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("Name", "ProviderName", "ProviderKey") |
|||
.IsUnique(); |
|||
|
|||
b.ToTable("AbpFeatureValues", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionDefinitionRecord", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("DisplayName") |
|||
.IsRequired() |
|||
.HasMaxLength(256) |
|||
.HasColumnType("varchar(256)"); |
|||
|
|||
b.Property<string>("ExtraProperties") |
|||
.HasColumnType("longtext") |
|||
.HasColumnName("ExtraProperties"); |
|||
|
|||
b.Property<string>("GroupName") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.Property<bool>("IsEnabled") |
|||
.HasColumnType("tinyint(1)"); |
|||
|
|||
b.Property<byte>("MultiTenancySide") |
|||
.HasColumnType("tinyint unsigned"); |
|||
|
|||
b.Property<string>("Name") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.Property<string>("ParentName") |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.Property<string>("Providers") |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.Property<string>("StateCheckers") |
|||
.HasMaxLength(256) |
|||
.HasColumnType("varchar(256)"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("GroupName"); |
|||
|
|||
b.HasIndex("Name") |
|||
.IsUnique(); |
|||
|
|||
b.ToTable("AbpPermissions", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGrant", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("Name") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.Property<string>("ProviderKey") |
|||
.IsRequired() |
|||
.HasMaxLength(64) |
|||
.HasColumnType("varchar(64)"); |
|||
|
|||
b.Property<string>("ProviderName") |
|||
.IsRequired() |
|||
.HasMaxLength(64) |
|||
.HasColumnType("varchar(64)"); |
|||
|
|||
b.Property<Guid?>("TenantId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("TenantId"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("TenantId", "Name", "ProviderName", "ProviderKey") |
|||
.IsUnique(); |
|||
|
|||
b.ToTable("AbpPermissionGrants", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGroupDefinitionRecord", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("DisplayName") |
|||
.IsRequired() |
|||
.HasMaxLength(256) |
|||
.HasColumnType("varchar(256)"); |
|||
|
|||
b.Property<string>("ExtraProperties") |
|||
.HasColumnType("longtext") |
|||
.HasColumnName("ExtraProperties"); |
|||
|
|||
b.Property<string>("Name") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("Name") |
|||
.IsUnique(); |
|||
|
|||
b.ToTable("AbpPermissionGroups", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("Volo.Abp.SettingManagement.Setting", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("Name") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.Property<string>("ProviderKey") |
|||
.HasMaxLength(64) |
|||
.HasColumnType("varchar(64)"); |
|||
|
|||
b.Property<string>("ProviderName") |
|||
.HasMaxLength(64) |
|||
.HasColumnType("varchar(64)"); |
|||
|
|||
b.Property<string>("Value") |
|||
.IsRequired() |
|||
.HasMaxLength(2048) |
|||
.HasColumnType("varchar(2048)"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("Name", "ProviderName", "ProviderKey") |
|||
.IsUnique(); |
|||
|
|||
b.ToTable("AbpSettings", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("Volo.Abp.SettingManagement.SettingDefinitionRecord", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("DefaultValue") |
|||
.HasMaxLength(2048) |
|||
.HasColumnType("varchar(2048)"); |
|||
|
|||
b.Property<string>("Description") |
|||
.HasMaxLength(512) |
|||
.HasColumnType("varchar(512)"); |
|||
|
|||
b.Property<string>("DisplayName") |
|||
.IsRequired() |
|||
.HasMaxLength(256) |
|||
.HasColumnType("varchar(256)"); |
|||
|
|||
b.Property<string>("ExtraProperties") |
|||
.HasColumnType("longtext") |
|||
.HasColumnName("ExtraProperties"); |
|||
|
|||
b.Property<bool>("IsEncrypted") |
|||
.HasColumnType("tinyint(1)"); |
|||
|
|||
b.Property<bool>("IsInherited") |
|||
.HasColumnType("tinyint(1)"); |
|||
|
|||
b.Property<bool>("IsVisibleToClients") |
|||
.HasColumnType("tinyint(1)"); |
|||
|
|||
b.Property<string>("Name") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.Property<string>("Providers") |
|||
.HasMaxLength(1024) |
|||
.HasColumnType("varchar(1024)"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("Name") |
|||
.IsUnique(); |
|||
|
|||
b.ToTable("AbpSettingDefinitions", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.DataProtectionManagement.EntityPropertyInfo", b => |
|||
{ |
|||
b.HasOne("LINGYUN.Abp.DataProtectionManagement.EntityTypeInfo", "TypeInfo") |
|||
.WithMany("Properties") |
|||
.HasForeignKey("TypeInfoId") |
|||
.OnDelete(DeleteBehavior.Cascade) |
|||
.IsRequired(); |
|||
|
|||
b.Navigation("TypeInfo"); |
|||
}); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.DataProtectionManagement.OrganizationUnitEntityRule", b => |
|||
{ |
|||
b.HasOne("LINGYUN.Abp.DataProtectionManagement.EntityTypeInfo", "EntityTypeInfo") |
|||
.WithMany() |
|||
.HasForeignKey("EntityTypeId") |
|||
.OnDelete(DeleteBehavior.Cascade) |
|||
.IsRequired(); |
|||
|
|||
b.Navigation("EntityTypeInfo"); |
|||
}); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.DataProtectionManagement.RoleEntityRule", b => |
|||
{ |
|||
b.HasOne("LINGYUN.Abp.DataProtectionManagement.EntityTypeInfo", "EntityTypeInfo") |
|||
.WithMany() |
|||
.HasForeignKey("EntityTypeId") |
|||
.OnDelete(DeleteBehavior.Cascade) |
|||
.IsRequired(); |
|||
|
|||
b.Navigation("EntityTypeInfo"); |
|||
}); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.Saas.Tenants.Tenant", b => |
|||
{ |
|||
b.HasOne("LINGYUN.Abp.Saas.Editions.Edition", "Edition") |
|||
.WithMany() |
|||
.HasForeignKey("EditionId"); |
|||
|
|||
b.Navigation("Edition"); |
|||
}); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.Saas.Tenants.TenantConnectionString", b => |
|||
{ |
|||
b.HasOne("LINGYUN.Abp.Saas.Tenants.Tenant", null) |
|||
.WithMany("ConnectionStrings") |
|||
.HasForeignKey("TenantId") |
|||
.OnDelete(DeleteBehavior.Cascade) |
|||
.IsRequired(); |
|||
}); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.DataProtectionManagement.EntityTypeInfo", b => |
|||
{ |
|||
b.Navigation("Properties"); |
|||
}); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.Saas.Tenants.Tenant", b => |
|||
{ |
|||
b.Navigation("ConnectionStrings"); |
|||
}); |
|||
#pragma warning restore 612, 618
|
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,42 @@ |
|||
using Microsoft.EntityFrameworkCore.Migrations; |
|||
|
|||
#nullable disable |
|||
|
|||
namespace LINGYUN.Abp.MicroService.AdminService.EntityFrameworkCore.Migrations |
|||
{ |
|||
/// <inheritdoc />
|
|||
public partial class AddAllowProperties : Migration |
|||
{ |
|||
/// <inheritdoc />
|
|||
protected override void Up(MigrationBuilder migrationBuilder) |
|||
{ |
|||
migrationBuilder.AddColumn<string>( |
|||
name: "AllowProperties", |
|||
table: "AbpAuthRoleEntityRules", |
|||
type: "varchar(512)", |
|||
maxLength: 512, |
|||
nullable: true) |
|||
.Annotation("MySql:CharSet", "utf8mb4"); |
|||
|
|||
migrationBuilder.AddColumn<string>( |
|||
name: "AllowProperties", |
|||
table: "AbpAuthOrganizationUnitEntityRules", |
|||
type: "varchar(512)", |
|||
maxLength: 512, |
|||
nullable: true) |
|||
.Annotation("MySql:CharSet", "utf8mb4"); |
|||
} |
|||
|
|||
/// <inheritdoc />
|
|||
protected override void Down(MigrationBuilder migrationBuilder) |
|||
{ |
|||
migrationBuilder.DropColumn( |
|||
name: "AllowProperties", |
|||
table: "AbpAuthRoleEntityRules"); |
|||
|
|||
migrationBuilder.DropColumn( |
|||
name: "AllowProperties", |
|||
table: "AbpAuthOrganizationUnitEntityRules"); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,937 @@ |
|||
// <auto-generated />
|
|||
using System; |
|||
using Microsoft.EntityFrameworkCore; |
|||
using Microsoft.EntityFrameworkCore.Infrastructure; |
|||
using Microsoft.EntityFrameworkCore.Migrations; |
|||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion; |
|||
using Volo.Abp.EntityFrameworkCore; |
|||
|
|||
#nullable disable |
|||
|
|||
namespace LINGYUN.Abp.MicroService.AdminService.EntityFrameworkCore.Migrations |
|||
{ |
|||
[DbContext(typeof(AdminServiceMigrationsDbContext))] |
|||
[Migration("20240527092536_Remote-Tenant-Id-With-Text-Template")] |
|||
partial class RemoteTenantIdWithTextTemplate |
|||
{ |
|||
/// <inheritdoc />
|
|||
protected override void BuildTargetModel(ModelBuilder modelBuilder) |
|||
{ |
|||
#pragma warning disable 612, 618
|
|||
modelBuilder |
|||
.HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.MySql) |
|||
.HasAnnotation("ProductVersion", "8.0.0") |
|||
.HasAnnotation("Relational:MaxIdentifierLength", 64); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.DataProtectionManagement.EntityPropertyInfo", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("DisplayName") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)") |
|||
.HasColumnName("DisplayName"); |
|||
|
|||
b.Property<string>("Name") |
|||
.IsRequired() |
|||
.HasMaxLength(64) |
|||
.HasColumnType("varchar(64)") |
|||
.HasColumnName("Name"); |
|||
|
|||
b.Property<string>("TypeFullName") |
|||
.IsRequired() |
|||
.HasMaxLength(256) |
|||
.HasColumnType("varchar(256)") |
|||
.HasColumnName("TypeFullName"); |
|||
|
|||
b.Property<Guid>("TypeInfoId") |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("ValueRange") |
|||
.HasMaxLength(512) |
|||
.HasColumnType("varchar(512)") |
|||
.HasColumnName("ValueRange"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("TypeInfoId", "TypeFullName"); |
|||
|
|||
b.ToTable("AbpAuthEntityProperties", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.DataProtectionManagement.EntityTypeInfo", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("ConcurrencyStamp") |
|||
.IsConcurrencyToken() |
|||
.IsRequired() |
|||
.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>("DisplayName") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)") |
|||
.HasColumnName("DisplayName"); |
|||
|
|||
b.Property<string>("ExtraProperties") |
|||
.IsRequired() |
|||
.HasColumnType("longtext") |
|||
.HasColumnName("ExtraProperties"); |
|||
|
|||
b.Property<bool>("IsAuditEnabled") |
|||
.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(64) |
|||
.HasColumnType("varchar(64)") |
|||
.HasColumnName("Name"); |
|||
|
|||
b.Property<string>("TypeFullName") |
|||
.IsRequired() |
|||
.HasMaxLength(256) |
|||
.HasColumnType("varchar(256)") |
|||
.HasColumnName("TypeFullName"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("TypeFullName"); |
|||
|
|||
b.ToTable("AbpAuthEntitites", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.DataProtectionManagement.OrganizationUnitEntityRule", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("AllowProperties") |
|||
.HasMaxLength(512) |
|||
.HasColumnType("varchar(512)") |
|||
.HasColumnName("AllowProperties"); |
|||
|
|||
b.Property<string>("ConcurrencyStamp") |
|||
.IsConcurrencyToken() |
|||
.IsRequired() |
|||
.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>("EntityTypeFullName") |
|||
.HasColumnType("longtext"); |
|||
|
|||
b.Property<Guid>("EntityTypeId") |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("ExtraProperties") |
|||
.IsRequired() |
|||
.HasColumnType("longtext") |
|||
.HasColumnName("ExtraProperties"); |
|||
|
|||
b.Property<string>("FilterGroup") |
|||
.HasColumnType("longtext") |
|||
.HasColumnName("FilterGroup"); |
|||
|
|||
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<int>("Operation") |
|||
.HasColumnType("int"); |
|||
|
|||
b.Property<string>("OrgCode") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)") |
|||
.HasColumnName("OrgCode"); |
|||
|
|||
b.Property<Guid>("OrgId") |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<Guid?>("TenantId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("TenantId"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("EntityTypeId"); |
|||
|
|||
b.ToTable("AbpAuthOrganizationUnitEntityRules", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.DataProtectionManagement.RoleEntityRule", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("AllowProperties") |
|||
.HasMaxLength(512) |
|||
.HasColumnType("varchar(512)") |
|||
.HasColumnName("AllowProperties"); |
|||
|
|||
b.Property<string>("ConcurrencyStamp") |
|||
.IsConcurrencyToken() |
|||
.IsRequired() |
|||
.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>("EntityTypeFullName") |
|||
.HasColumnType("longtext"); |
|||
|
|||
b.Property<Guid>("EntityTypeId") |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("ExtraProperties") |
|||
.IsRequired() |
|||
.HasColumnType("longtext") |
|||
.HasColumnName("ExtraProperties"); |
|||
|
|||
b.Property<string>("FilterGroup") |
|||
.HasColumnType("longtext") |
|||
.HasColumnName("FilterGroup"); |
|||
|
|||
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<int>("Operation") |
|||
.HasColumnType("int"); |
|||
|
|||
b.Property<Guid>("RoleId") |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("RoleName") |
|||
.IsRequired() |
|||
.HasMaxLength(256) |
|||
.HasColumnType("varchar(256)") |
|||
.HasColumnName("RoleName"); |
|||
|
|||
b.Property<Guid?>("TenantId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("TenantId"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("EntityTypeId"); |
|||
|
|||
b.ToTable("AbpAuthRoleEntityRules", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.Saas.Editions.Edition", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("ConcurrencyStamp") |
|||
.IsConcurrencyToken() |
|||
.IsRequired() |
|||
.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<Guid?>("DeleterId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("DeleterId"); |
|||
|
|||
b.Property<DateTime?>("DeletionTime") |
|||
.HasColumnType("datetime(6)") |
|||
.HasColumnName("DeletionTime"); |
|||
|
|||
b.Property<string>("DisplayName") |
|||
.IsRequired() |
|||
.HasMaxLength(64) |
|||
.HasColumnType("varchar(64)"); |
|||
|
|||
b.Property<int>("EntityVersion") |
|||
.HasColumnType("int"); |
|||
|
|||
b.Property<string>("ExtraProperties") |
|||
.IsRequired() |
|||
.HasColumnType("longtext") |
|||
.HasColumnName("ExtraProperties"); |
|||
|
|||
b.Property<bool>("IsDeleted") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("tinyint(1)") |
|||
.HasDefaultValue(false) |
|||
.HasColumnName("IsDeleted"); |
|||
|
|||
b.Property<DateTime?>("LastModificationTime") |
|||
.HasColumnType("datetime(6)") |
|||
.HasColumnName("LastModificationTime"); |
|||
|
|||
b.Property<Guid?>("LastModifierId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("LastModifierId"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("DisplayName"); |
|||
|
|||
b.ToTable("AbpEditions", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.Saas.Tenants.Tenant", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("ConcurrencyStamp") |
|||
.IsConcurrencyToken() |
|||
.IsRequired() |
|||
.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<Guid?>("DeleterId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("DeleterId"); |
|||
|
|||
b.Property<DateTime?>("DeletionTime") |
|||
.HasColumnType("datetime(6)") |
|||
.HasColumnName("DeletionTime"); |
|||
|
|||
b.Property<DateTime?>("DisableTime") |
|||
.HasColumnType("datetime(6)"); |
|||
|
|||
b.Property<Guid?>("EditionId") |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<DateTime?>("EnableTime") |
|||
.HasColumnType("datetime(6)"); |
|||
|
|||
b.Property<int>("EntityVersion") |
|||
.HasColumnType("int"); |
|||
|
|||
b.Property<string>("ExtraProperties") |
|||
.IsRequired() |
|||
.HasColumnType("longtext") |
|||
.HasColumnName("ExtraProperties"); |
|||
|
|||
b.Property<bool>("IsActive") |
|||
.HasColumnType("tinyint(1)"); |
|||
|
|||
b.Property<bool>("IsDeleted") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("tinyint(1)") |
|||
.HasDefaultValue(false) |
|||
.HasColumnName("IsDeleted"); |
|||
|
|||
b.Property<DateTime?>("LastModificationTime") |
|||
.HasColumnType("datetime(6)") |
|||
.HasColumnName("LastModificationTime"); |
|||
|
|||
b.Property<Guid?>("LastModifierId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("LastModifierId"); |
|||
|
|||
b.Property<string>("Name") |
|||
.IsRequired() |
|||
.HasMaxLength(64) |
|||
.HasColumnType("varchar(64)"); |
|||
|
|||
b.Property<string>("NormalizedName") |
|||
.HasMaxLength(64) |
|||
.HasColumnType("varchar(64)"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("EditionId"); |
|||
|
|||
b.HasIndex("Name"); |
|||
|
|||
b.HasIndex("NormalizedName"); |
|||
|
|||
b.ToTable("AbpTenants", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.Saas.Tenants.TenantConnectionString", b => |
|||
{ |
|||
b.Property<Guid>("TenantId") |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("Name") |
|||
.HasMaxLength(64) |
|||
.HasColumnType("varchar(64)"); |
|||
|
|||
b.Property<string>("Value") |
|||
.IsRequired() |
|||
.HasMaxLength(1024) |
|||
.HasColumnType("varchar(1024)"); |
|||
|
|||
b.HasKey("TenantId", "Name"); |
|||
|
|||
b.ToTable("AbpTenantConnectionStrings", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.TextTemplating.TextTemplate", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("Content") |
|||
.HasMaxLength(1048576) |
|||
.HasColumnType("longtext") |
|||
.HasColumnName("Content"); |
|||
|
|||
b.Property<DateTime>("CreationTime") |
|||
.HasColumnType("datetime(6)") |
|||
.HasColumnName("CreationTime"); |
|||
|
|||
b.Property<Guid?>("CreatorId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("CreatorId"); |
|||
|
|||
b.Property<string>("Culture") |
|||
.HasMaxLength(30) |
|||
.HasColumnType("varchar(30)") |
|||
.HasColumnName("Culture"); |
|||
|
|||
b.Property<string>("DisplayName") |
|||
.IsRequired() |
|||
.HasMaxLength(100) |
|||
.HasColumnType("varchar(100)") |
|||
.HasColumnName("DisplayName"); |
|||
|
|||
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.HasKey("Id"); |
|||
|
|||
b.HasIndex("Name") |
|||
.HasDatabaseName("IX_Tenant_Text_Template_Name"); |
|||
|
|||
b.ToTable("AbpTextTemplates", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.TextTemplating.TextTemplateDefinition", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("ConcurrencyStamp") |
|||
.IsConcurrencyToken() |
|||
.IsRequired() |
|||
.HasMaxLength(40) |
|||
.HasColumnType("varchar(40)") |
|||
.HasColumnName("ConcurrencyStamp"); |
|||
|
|||
b.Property<string>("DefaultCultureName") |
|||
.HasMaxLength(30) |
|||
.HasColumnType("varchar(30)") |
|||
.HasColumnName("DefaultCultureName"); |
|||
|
|||
b.Property<string>("DisplayName") |
|||
.IsRequired() |
|||
.HasMaxLength(512) |
|||
.HasColumnType("varchar(512)") |
|||
.HasColumnName("DisplayName"); |
|||
|
|||
b.Property<string>("ExtraProperties") |
|||
.IsRequired() |
|||
.HasColumnType("longtext") |
|||
.HasColumnName("ExtraProperties"); |
|||
|
|||
b.Property<bool>("IsInlineLocalized") |
|||
.HasColumnType("tinyint(1)"); |
|||
|
|||
b.Property<bool>("IsLayout") |
|||
.HasColumnType("tinyint(1)"); |
|||
|
|||
b.Property<bool>("IsStatic") |
|||
.HasColumnType("tinyint(1)"); |
|||
|
|||
b.Property<string>("Layout") |
|||
.HasMaxLength(60) |
|||
.HasColumnType("varchar(60)") |
|||
.HasColumnName("Layout"); |
|||
|
|||
b.Property<string>("LocalizationResourceName") |
|||
.HasMaxLength(64) |
|||
.HasColumnType("varchar(64)") |
|||
.HasColumnName("LocalizationResourceName"); |
|||
|
|||
b.Property<string>("Name") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)") |
|||
.HasColumnName("Name"); |
|||
|
|||
b.Property<string>("RenderEngine") |
|||
.HasMaxLength(30) |
|||
.HasColumnType("varchar(30)") |
|||
.HasColumnName("RenderEngine"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.ToTable("AbpTextTemplateDefinitions", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureDefinitionRecord", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("AllowedProviders") |
|||
.HasMaxLength(256) |
|||
.HasColumnType("varchar(256)"); |
|||
|
|||
b.Property<string>("DefaultValue") |
|||
.HasMaxLength(256) |
|||
.HasColumnType("varchar(256)"); |
|||
|
|||
b.Property<string>("Description") |
|||
.HasMaxLength(256) |
|||
.HasColumnType("varchar(256)"); |
|||
|
|||
b.Property<string>("DisplayName") |
|||
.IsRequired() |
|||
.HasMaxLength(256) |
|||
.HasColumnType("varchar(256)"); |
|||
|
|||
b.Property<string>("ExtraProperties") |
|||
.HasColumnType("longtext") |
|||
.HasColumnName("ExtraProperties"); |
|||
|
|||
b.Property<string>("GroupName") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.Property<bool>("IsAvailableToHost") |
|||
.HasColumnType("tinyint(1)"); |
|||
|
|||
b.Property<bool>("IsVisibleToClients") |
|||
.HasColumnType("tinyint(1)"); |
|||
|
|||
b.Property<string>("Name") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.Property<string>("ParentName") |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.Property<string>("ValueType") |
|||
.HasMaxLength(2048) |
|||
.HasColumnType("varchar(2048)"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("GroupName"); |
|||
|
|||
b.HasIndex("Name") |
|||
.IsUnique(); |
|||
|
|||
b.ToTable("AbpFeatures", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureGroupDefinitionRecord", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("DisplayName") |
|||
.IsRequired() |
|||
.HasMaxLength(256) |
|||
.HasColumnType("varchar(256)"); |
|||
|
|||
b.Property<string>("ExtraProperties") |
|||
.HasColumnType("longtext") |
|||
.HasColumnName("ExtraProperties"); |
|||
|
|||
b.Property<string>("Name") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("Name") |
|||
.IsUnique(); |
|||
|
|||
b.ToTable("AbpFeatureGroups", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureValue", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("Name") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.Property<string>("ProviderKey") |
|||
.HasMaxLength(64) |
|||
.HasColumnType("varchar(64)"); |
|||
|
|||
b.Property<string>("ProviderName") |
|||
.HasMaxLength(64) |
|||
.HasColumnType("varchar(64)"); |
|||
|
|||
b.Property<string>("Value") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("Name", "ProviderName", "ProviderKey") |
|||
.IsUnique(); |
|||
|
|||
b.ToTable("AbpFeatureValues", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionDefinitionRecord", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("DisplayName") |
|||
.IsRequired() |
|||
.HasMaxLength(256) |
|||
.HasColumnType("varchar(256)"); |
|||
|
|||
b.Property<string>("ExtraProperties") |
|||
.HasColumnType("longtext") |
|||
.HasColumnName("ExtraProperties"); |
|||
|
|||
b.Property<string>("GroupName") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.Property<bool>("IsEnabled") |
|||
.HasColumnType("tinyint(1)"); |
|||
|
|||
b.Property<byte>("MultiTenancySide") |
|||
.HasColumnType("tinyint unsigned"); |
|||
|
|||
b.Property<string>("Name") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.Property<string>("ParentName") |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.Property<string>("Providers") |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.Property<string>("StateCheckers") |
|||
.HasMaxLength(256) |
|||
.HasColumnType("varchar(256)"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("GroupName"); |
|||
|
|||
b.HasIndex("Name") |
|||
.IsUnique(); |
|||
|
|||
b.ToTable("AbpPermissions", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGrant", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("Name") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.Property<string>("ProviderKey") |
|||
.IsRequired() |
|||
.HasMaxLength(64) |
|||
.HasColumnType("varchar(64)"); |
|||
|
|||
b.Property<string>("ProviderName") |
|||
.IsRequired() |
|||
.HasMaxLength(64) |
|||
.HasColumnType("varchar(64)"); |
|||
|
|||
b.Property<Guid?>("TenantId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("TenantId"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("TenantId", "Name", "ProviderName", "ProviderKey") |
|||
.IsUnique(); |
|||
|
|||
b.ToTable("AbpPermissionGrants", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGroupDefinitionRecord", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("DisplayName") |
|||
.IsRequired() |
|||
.HasMaxLength(256) |
|||
.HasColumnType("varchar(256)"); |
|||
|
|||
b.Property<string>("ExtraProperties") |
|||
.HasColumnType("longtext") |
|||
.HasColumnName("ExtraProperties"); |
|||
|
|||
b.Property<string>("Name") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("Name") |
|||
.IsUnique(); |
|||
|
|||
b.ToTable("AbpPermissionGroups", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("Volo.Abp.SettingManagement.Setting", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("Name") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.Property<string>("ProviderKey") |
|||
.HasMaxLength(64) |
|||
.HasColumnType("varchar(64)"); |
|||
|
|||
b.Property<string>("ProviderName") |
|||
.HasMaxLength(64) |
|||
.HasColumnType("varchar(64)"); |
|||
|
|||
b.Property<string>("Value") |
|||
.IsRequired() |
|||
.HasMaxLength(2048) |
|||
.HasColumnType("varchar(2048)"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("Name", "ProviderName", "ProviderKey") |
|||
.IsUnique(); |
|||
|
|||
b.ToTable("AbpSettings", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("Volo.Abp.SettingManagement.SettingDefinitionRecord", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("DefaultValue") |
|||
.HasMaxLength(2048) |
|||
.HasColumnType("varchar(2048)"); |
|||
|
|||
b.Property<string>("Description") |
|||
.HasMaxLength(512) |
|||
.HasColumnType("varchar(512)"); |
|||
|
|||
b.Property<string>("DisplayName") |
|||
.IsRequired() |
|||
.HasMaxLength(256) |
|||
.HasColumnType("varchar(256)"); |
|||
|
|||
b.Property<string>("ExtraProperties") |
|||
.HasColumnType("longtext") |
|||
.HasColumnName("ExtraProperties"); |
|||
|
|||
b.Property<bool>("IsEncrypted") |
|||
.HasColumnType("tinyint(1)"); |
|||
|
|||
b.Property<bool>("IsInherited") |
|||
.HasColumnType("tinyint(1)"); |
|||
|
|||
b.Property<bool>("IsVisibleToClients") |
|||
.HasColumnType("tinyint(1)"); |
|||
|
|||
b.Property<string>("Name") |
|||
.IsRequired() |
|||
.HasMaxLength(128) |
|||
.HasColumnType("varchar(128)"); |
|||
|
|||
b.Property<string>("Providers") |
|||
.HasMaxLength(1024) |
|||
.HasColumnType("varchar(1024)"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("Name") |
|||
.IsUnique(); |
|||
|
|||
b.ToTable("AbpSettingDefinitions", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.DataProtectionManagement.EntityPropertyInfo", b => |
|||
{ |
|||
b.HasOne("LINGYUN.Abp.DataProtectionManagement.EntityTypeInfo", "TypeInfo") |
|||
.WithMany("Properties") |
|||
.HasForeignKey("TypeInfoId") |
|||
.OnDelete(DeleteBehavior.Cascade) |
|||
.IsRequired(); |
|||
|
|||
b.Navigation("TypeInfo"); |
|||
}); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.DataProtectionManagement.OrganizationUnitEntityRule", b => |
|||
{ |
|||
b.HasOne("LINGYUN.Abp.DataProtectionManagement.EntityTypeInfo", "EntityTypeInfo") |
|||
.WithMany() |
|||
.HasForeignKey("EntityTypeId") |
|||
.OnDelete(DeleteBehavior.Cascade) |
|||
.IsRequired(); |
|||
|
|||
b.Navigation("EntityTypeInfo"); |
|||
}); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.DataProtectionManagement.RoleEntityRule", b => |
|||
{ |
|||
b.HasOne("LINGYUN.Abp.DataProtectionManagement.EntityTypeInfo", "EntityTypeInfo") |
|||
.WithMany() |
|||
.HasForeignKey("EntityTypeId") |
|||
.OnDelete(DeleteBehavior.Cascade) |
|||
.IsRequired(); |
|||
|
|||
b.Navigation("EntityTypeInfo"); |
|||
}); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.Saas.Tenants.Tenant", b => |
|||
{ |
|||
b.HasOne("LINGYUN.Abp.Saas.Editions.Edition", "Edition") |
|||
.WithMany() |
|||
.HasForeignKey("EditionId"); |
|||
|
|||
b.Navigation("Edition"); |
|||
}); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.Saas.Tenants.TenantConnectionString", b => |
|||
{ |
|||
b.HasOne("LINGYUN.Abp.Saas.Tenants.Tenant", null) |
|||
.WithMany("ConnectionStrings") |
|||
.HasForeignKey("TenantId") |
|||
.OnDelete(DeleteBehavior.Cascade) |
|||
.IsRequired(); |
|||
}); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.DataProtectionManagement.EntityTypeInfo", b => |
|||
{ |
|||
b.Navigation("Properties"); |
|||
}); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.Saas.Tenants.Tenant", b => |
|||
{ |
|||
b.Navigation("ConnectionStrings"); |
|||
}); |
|||
#pragma warning restore 612, 618
|
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,48 @@ |
|||
using System; |
|||
using Microsoft.EntityFrameworkCore.Migrations; |
|||
|
|||
#nullable disable |
|||
|
|||
namespace LINGYUN.Abp.MicroService.AdminService.EntityFrameworkCore.Migrations |
|||
{ |
|||
/// <inheritdoc />
|
|||
public partial class RemoteTenantIdWithTextTemplate : Migration |
|||
{ |
|||
/// <inheritdoc />
|
|||
protected override void Up(MigrationBuilder migrationBuilder) |
|||
{ |
|||
migrationBuilder.DropIndex( |
|||
name: "IX_Tenant_Text_Template_Name", |
|||
table: "AbpTextTemplates"); |
|||
|
|||
migrationBuilder.DropColumn( |
|||
name: "TenantId", |
|||
table: "AbpTextTemplates"); |
|||
|
|||
migrationBuilder.CreateIndex( |
|||
name: "IX_Tenant_Text_Template_Name", |
|||
table: "AbpTextTemplates", |
|||
column: "Name"); |
|||
} |
|||
|
|||
/// <inheritdoc />
|
|||
protected override void Down(MigrationBuilder migrationBuilder) |
|||
{ |
|||
migrationBuilder.DropIndex( |
|||
name: "IX_Tenant_Text_Template_Name", |
|||
table: "AbpTextTemplates"); |
|||
|
|||
migrationBuilder.AddColumn<Guid>( |
|||
name: "TenantId", |
|||
table: "AbpTextTemplates", |
|||
type: "char(36)", |
|||
nullable: true, |
|||
collation: "ascii_general_ci"); |
|||
|
|||
migrationBuilder.CreateIndex( |
|||
name: "IX_Tenant_Text_Template_Name", |
|||
table: "AbpTextTemplates", |
|||
columns: new[] { "TenantId", "Name" }); |
|||
} |
|||
} |
|||
} |
|||
File diff suppressed because it is too large
@ -0,0 +1,127 @@ |
|||
using System; |
|||
using Microsoft.EntityFrameworkCore.Migrations; |
|||
|
|||
#nullable disable |
|||
|
|||
namespace LINGYUN.Abp.MicroService.AdminService.EntityFrameworkCore.Migrations |
|||
{ |
|||
/// <inheritdoc />
|
|||
public partial class UpgradeAbpFrameworkTo911 : Migration |
|||
{ |
|||
/// <inheritdoc />
|
|||
protected override void Up(MigrationBuilder migrationBuilder) |
|||
{ |
|||
migrationBuilder.DropColumn( |
|||
name: "ValueRange", |
|||
table: "AbpAuthEntityProperties"); |
|||
|
|||
migrationBuilder.RenameColumn( |
|||
name: "AllowProperties", |
|||
table: "AbpAuthRoleEntityRules", |
|||
newName: "AccessedProperties"); |
|||
|
|||
migrationBuilder.RenameColumn( |
|||
name: "AllowProperties", |
|||
table: "AbpAuthOrganizationUnitEntityRules", |
|||
newName: "AccessedProperties"); |
|||
|
|||
migrationBuilder.AddColumn<string>( |
|||
name: "JavaScriptType", |
|||
table: "AbpAuthEntityProperties", |
|||
type: "varchar(256)", |
|||
maxLength: 256, |
|||
nullable: false, |
|||
defaultValue: "") |
|||
.Annotation("MySql:CharSet", "utf8mb4"); |
|||
|
|||
migrationBuilder.CreateTable( |
|||
name: "AbpAuthEntityEnums", |
|||
columns: table => new |
|||
{ |
|||
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"), |
|||
Name = table.Column<string>(type: "varchar(64)", maxLength: 64, nullable: false) |
|||
.Annotation("MySql:CharSet", "utf8mb4"), |
|||
DisplayName = table.Column<string>(type: "varchar(128)", maxLength: 128, nullable: false) |
|||
.Annotation("MySql:CharSet", "utf8mb4"), |
|||
Value = table.Column<string>(type: "varchar(10)", maxLength: 10, nullable: false) |
|||
.Annotation("MySql:CharSet", "utf8mb4"), |
|||
PropertyInfoId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci") |
|||
}, |
|||
constraints: table => |
|||
{ |
|||
table.PrimaryKey("PK_AbpAuthEntityEnums", x => x.Id); |
|||
table.ForeignKey( |
|||
name: "FK_AbpAuthEntityEnums_AbpAuthEntityProperties_PropertyInfoId", |
|||
column: x => x.PropertyInfoId, |
|||
principalTable: "AbpAuthEntityProperties", |
|||
principalColumn: "Id", |
|||
onDelete: ReferentialAction.Cascade); |
|||
}) |
|||
.Annotation("MySql:CharSet", "utf8mb4"); |
|||
|
|||
migrationBuilder.CreateTable( |
|||
name: "AbpAuthSubjectStrategys", |
|||
columns: table => new |
|||
{ |
|||
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"), |
|||
IsEnabled = table.Column<bool>(type: "tinyint(1)", nullable: false), |
|||
TenantId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"), |
|||
SubjectName = table.Column<string>(type: "varchar(30)", maxLength: 30, nullable: false) |
|||
.Annotation("MySql:CharSet", "utf8mb4"), |
|||
SubjectId = table.Column<string>(type: "varchar(64)", maxLength: 64, nullable: true) |
|||
.Annotation("MySql:CharSet", "utf8mb4"), |
|||
Strategy = table.Column<int>(type: "int", nullable: false), |
|||
ExtraProperties = table.Column<string>(type: "longtext", nullable: false) |
|||
.Annotation("MySql:CharSet", "utf8mb4"), |
|||
ConcurrencyStamp = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: false) |
|||
.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_AbpAuthSubjectStrategys", x => x.Id); |
|||
}) |
|||
.Annotation("MySql:CharSet", "utf8mb4"); |
|||
|
|||
migrationBuilder.CreateIndex( |
|||
name: "IX_AbpAuthEntityEnums_PropertyInfoId_Name", |
|||
table: "AbpAuthEntityEnums", |
|||
columns: new[] { "PropertyInfoId", "Name" }); |
|||
} |
|||
|
|||
/// <inheritdoc />
|
|||
protected override void Down(MigrationBuilder migrationBuilder) |
|||
{ |
|||
migrationBuilder.DropTable( |
|||
name: "AbpAuthEntityEnums"); |
|||
|
|||
migrationBuilder.DropTable( |
|||
name: "AbpAuthSubjectStrategys"); |
|||
|
|||
migrationBuilder.DropColumn( |
|||
name: "JavaScriptType", |
|||
table: "AbpAuthEntityProperties"); |
|||
|
|||
migrationBuilder.RenameColumn( |
|||
name: "AccessedProperties", |
|||
table: "AbpAuthRoleEntityRules", |
|||
newName: "AllowProperties"); |
|||
|
|||
migrationBuilder.RenameColumn( |
|||
name: "AccessedProperties", |
|||
table: "AbpAuthOrganizationUnitEntityRules", |
|||
newName: "AllowProperties"); |
|||
|
|||
migrationBuilder.AddColumn<string>( |
|||
name: "ValueRange", |
|||
table: "AbpAuthEntityProperties", |
|||
type: "varchar(512)", |
|||
maxLength: 512, |
|||
nullable: true) |
|||
.Annotation("MySql:CharSet", "utf8mb4"); |
|||
} |
|||
} |
|||
} |
|||
File diff suppressed because it is too large
@ -0,0 +1,127 @@ |
|||
using System; |
|||
using Microsoft.EntityFrameworkCore.Migrations; |
|||
|
|||
#nullable disable |
|||
|
|||
namespace LINGYUN.Abp.MicroService.AdminService.EntityFrameworkCore.Migrations |
|||
{ |
|||
/// <inheritdoc />
|
|||
public partial class UpgradeAbpFrameworkTo1002 : Migration |
|||
{ |
|||
/// <inheritdoc />
|
|||
protected override void Up(MigrationBuilder migrationBuilder) |
|||
{ |
|||
migrationBuilder.DropIndex( |
|||
name: "IX_AbpPermissions_Name", |
|||
table: "AbpPermissions"); |
|||
|
|||
migrationBuilder.AlterColumn<string>( |
|||
name: "GroupName", |
|||
table: "AbpPermissions", |
|||
type: "varchar(128)", |
|||
maxLength: 128, |
|||
nullable: true, |
|||
oldClrType: typeof(string), |
|||
oldType: "varchar(128)", |
|||
oldMaxLength: 128) |
|||
.Annotation("MySql:CharSet", "utf8mb4") |
|||
.OldAnnotation("MySql:CharSet", "utf8mb4"); |
|||
|
|||
migrationBuilder.AddColumn<string>( |
|||
name: "ManagementPermissionName", |
|||
table: "AbpPermissions", |
|||
type: "varchar(128)", |
|||
maxLength: 128, |
|||
nullable: true) |
|||
.Annotation("MySql:CharSet", "utf8mb4"); |
|||
|
|||
migrationBuilder.AddColumn<string>( |
|||
name: "ResourceName", |
|||
table: "AbpPermissions", |
|||
type: "varchar(256)", |
|||
maxLength: 256, |
|||
nullable: true) |
|||
.Annotation("MySql:CharSet", "utf8mb4"); |
|||
|
|||
migrationBuilder.CreateTable( |
|||
name: "AbpResourcePermissionGrants", |
|||
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"), |
|||
Name = table.Column<string>(type: "varchar(128)", maxLength: 128, nullable: false) |
|||
.Annotation("MySql:CharSet", "utf8mb4"), |
|||
ProviderName = table.Column<string>(type: "varchar(64)", maxLength: 64, nullable: false) |
|||
.Annotation("MySql:CharSet", "utf8mb4"), |
|||
ProviderKey = table.Column<string>(type: "varchar(64)", maxLength: 64, nullable: false) |
|||
.Annotation("MySql:CharSet", "utf8mb4"), |
|||
ResourceName = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: false) |
|||
.Annotation("MySql:CharSet", "utf8mb4"), |
|||
ResourceKey = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: false) |
|||
.Annotation("MySql:CharSet", "utf8mb4") |
|||
}, |
|||
constraints: table => |
|||
{ |
|||
table.PrimaryKey("PK_AbpResourcePermissionGrants", x => x.Id); |
|||
}) |
|||
.Annotation("MySql:CharSet", "utf8mb4"); |
|||
|
|||
migrationBuilder.CreateIndex( |
|||
name: "IX_AbpPermissions_ResourceName_Name", |
|||
table: "AbpPermissions", |
|||
columns: new[] { "ResourceName", "Name" }, |
|||
unique: true); |
|||
|
|||
migrationBuilder.CreateIndex( |
|||
name: "IX_AbpResourcePermissionGrants_TenantId_Name_ResourceName_Resou~", |
|||
table: "AbpResourcePermissionGrants", |
|||
columns: new[] { "TenantId", "ResourceName", "ResourceKey", "ProviderName", "ProviderKey" }, |
|||
unique: true); |
|||
} |
|||
|
|||
/// <inheritdoc />
|
|||
protected override void Down(MigrationBuilder migrationBuilder) |
|||
{ |
|||
migrationBuilder.DropTable( |
|||
name: "AbpResourcePermissionGrants"); |
|||
|
|||
migrationBuilder.DropIndex( |
|||
name: "IX_AbpPermissions_ResourceName_Name", |
|||
table: "AbpPermissions"); |
|||
|
|||
migrationBuilder.DropColumn( |
|||
name: "ManagementPermissionName", |
|||
table: "AbpPermissions"); |
|||
|
|||
migrationBuilder.DropColumn( |
|||
name: "ResourceName", |
|||
table: "AbpPermissions"); |
|||
|
|||
migrationBuilder.UpdateData( |
|||
table: "AbpPermissions", |
|||
keyColumn: "GroupName", |
|||
keyValue: null, |
|||
column: "GroupName", |
|||
value: ""); |
|||
|
|||
migrationBuilder.AlterColumn<string>( |
|||
name: "GroupName", |
|||
table: "AbpPermissions", |
|||
type: "varchar(128)", |
|||
maxLength: 128, |
|||
nullable: false, |
|||
oldClrType: typeof(string), |
|||
oldType: "varchar(128)", |
|||
oldMaxLength: 128, |
|||
oldNullable: true) |
|||
.Annotation("MySql:CharSet", "utf8mb4") |
|||
.OldAnnotation("MySql:CharSet", "utf8mb4"); |
|||
|
|||
migrationBuilder.CreateIndex( |
|||
name: "IX_AbpPermissions_Name", |
|||
table: "AbpPermissions", |
|||
column: "Name", |
|||
unique: true); |
|||
} |
|||
} |
|||
} |
|||
File diff suppressed because it is too large
@ -0,0 +1,86 @@ |
|||
using Microsoft.EntityFrameworkCore.Migrations; |
|||
|
|||
#nullable disable |
|||
|
|||
namespace LINGYUN.Abp.MicroService.AdminService.EntityFrameworkCore.Migrations |
|||
{ |
|||
/// <inheritdoc />
|
|||
public partial class FixMySqlIndexKeyTooLangForResourcePermissionGrant : Migration |
|||
{ |
|||
/// <inheritdoc />
|
|||
protected override void Up(MigrationBuilder migrationBuilder) |
|||
{ |
|||
migrationBuilder.DropIndex( |
|||
name: "IX_AbpResourcePermissionGrants_TenantId_Name_ResourceName_Resou~", |
|||
table: "AbpResourcePermissionGrants"); |
|||
|
|||
migrationBuilder.AlterColumn<string>( |
|||
name: "ResourceName", |
|||
table: "AbpResourcePermissionGrants", |
|||
type: "varchar(128)", |
|||
maxLength: 128, |
|||
nullable: false, |
|||
oldClrType: typeof(string), |
|||
oldType: "varchar(256)", |
|||
oldMaxLength: 256) |
|||
.Annotation("MySql:CharSet", "utf8mb4") |
|||
.OldAnnotation("MySql:CharSet", "utf8mb4"); |
|||
|
|||
migrationBuilder.AlterColumn<string>( |
|||
name: "ResourceKey", |
|||
table: "AbpResourcePermissionGrants", |
|||
type: "varchar(128)", |
|||
maxLength: 128, |
|||
nullable: false, |
|||
oldClrType: typeof(string), |
|||
oldType: "varchar(256)", |
|||
oldMaxLength: 256) |
|||
.Annotation("MySql:CharSet", "utf8mb4") |
|||
.OldAnnotation("MySql:CharSet", "utf8mb4"); |
|||
|
|||
migrationBuilder.CreateIndex( |
|||
name: "IX_AbpResourcePermissionGrants_TenantId_Name_ResourceName_Resou~", |
|||
table: "AbpResourcePermissionGrants", |
|||
columns: new[] { "TenantId", "Name", "ResourceName", "ResourceKey", "ProviderName", "ProviderKey" }, |
|||
unique: true); |
|||
} |
|||
|
|||
/// <inheritdoc />
|
|||
protected override void Down(MigrationBuilder migrationBuilder) |
|||
{ |
|||
migrationBuilder.DropIndex( |
|||
name: "IX_AbpResourcePermissionGrants_TenantId_Name_ResourceName_Resou~", |
|||
table: "AbpResourcePermissionGrants"); |
|||
|
|||
migrationBuilder.AlterColumn<string>( |
|||
name: "ResourceName", |
|||
table: "AbpResourcePermissionGrants", |
|||
type: "varchar(256)", |
|||
maxLength: 256, |
|||
nullable: false, |
|||
oldClrType: typeof(string), |
|||
oldType: "varchar(128)", |
|||
oldMaxLength: 128) |
|||
.Annotation("MySql:CharSet", "utf8mb4") |
|||
.OldAnnotation("MySql:CharSet", "utf8mb4"); |
|||
|
|||
migrationBuilder.AlterColumn<string>( |
|||
name: "ResourceKey", |
|||
table: "AbpResourcePermissionGrants", |
|||
type: "varchar(256)", |
|||
maxLength: 256, |
|||
nullable: false, |
|||
oldClrType: typeof(string), |
|||
oldType: "varchar(128)", |
|||
oldMaxLength: 128) |
|||
.Annotation("MySql:CharSet", "utf8mb4") |
|||
.OldAnnotation("MySql:CharSet", "utf8mb4"); |
|||
|
|||
migrationBuilder.CreateIndex( |
|||
name: "IX_AbpResourcePermissionGrants_TenantId_Name_ResourceName_Resou~", |
|||
table: "AbpResourcePermissionGrants", |
|||
columns: new[] { "TenantId", "ResourceName", "ResourceKey", "ProviderName", "ProviderKey" }, |
|||
unique: true); |
|||
} |
|||
} |
|||
} |
|||
File diff suppressed because it is too large
@ -0,0 +1,67 @@ |
|||
# LINGYUN.Abp.MicroService.AdminService.EntityFrameworkCore |
|||
|
|||
Backend Administration Database Migration Module, providing database migration functionality for the backend management system. |
|||
|
|||
[简体中文](./README.md) |
|||
|
|||
## Features |
|||
|
|||
* Integrated SaaS multi-tenancy data migration |
|||
* Integrated Setting Management data migration |
|||
* Integrated Data Protection Management data migration |
|||
* Integrated Permission Management data migration |
|||
* Integrated Feature Management data migration |
|||
* Integrated Text Templating data migration |
|||
* Support for MySQL database |
|||
|
|||
## Module Dependencies |
|||
|
|||
```csharp |
|||
[DependsOn( |
|||
typeof(AbpSaasEntityFrameworkCoreModule), |
|||
typeof(AbpSettingManagementEntityFrameworkCoreModule), |
|||
typeof(AbpDataProtectionManagementEntityFrameworkCoreModule), |
|||
typeof(AbpPermissionManagementEntityFrameworkCoreModule), |
|||
typeof(AbpFeatureManagementEntityFrameworkCoreModule), |
|||
typeof(AbpTextTemplatingEntityFrameworkCoreModule), |
|||
typeof(AbpDataDbMigratorModule) |
|||
)] |
|||
``` |
|||
|
|||
## Configuration |
|||
|
|||
```json |
|||
{ |
|||
"ConnectionStrings": { |
|||
"BackendAdminDbMigrator": "Your database connection string" |
|||
} |
|||
} |
|||
``` |
|||
|
|||
## Basic Usage |
|||
|
|||
1. Configure Database Connection String |
|||
* Configure BackendAdminDbMigrator connection string in appsettings.json |
|||
|
|||
2. Add Module Dependency |
|||
```csharp |
|||
[DependsOn(typeof(BackendAdminMigrationsEntityFrameworkCoreModule))] |
|||
public class YourModule : AbpModule |
|||
{ |
|||
// ... |
|||
} |
|||
``` |
|||
|
|||
## Database Tables Description |
|||
|
|||
* Saas Related Tables - Tenant, edition and other multi-tenancy related data |
|||
* AbpSettings - System settings data |
|||
* AbpDataProtection - Data protection related data |
|||
* AbpPermissionGrants - Permission authorization data |
|||
* AbpFeatures - Feature data |
|||
* AbpTextTemplates - Text template data |
|||
|
|||
## More Information |
|||
|
|||
* [ABP Documentation](https://docs.abp.io) |
|||
* [ASP.NET Core Data Protection](https://docs.microsoft.com/en-us/aspnet/core/security/data-protection/introduction) |
|||
@ -0,0 +1,67 @@ |
|||
# LINGYUN.Abp.MicroService.AdminService.EntityFrameworkCore |
|||
|
|||
后台管理数据迁移模块,提供后台管理系统相关的数据库迁移功能。 |
|||
|
|||
[English](./README.EN.md) |
|||
|
|||
## 功能特性 |
|||
|
|||
* 集成SaaS多租户数据迁移 |
|||
* 集成设置管理数据迁移 |
|||
* 集成数据保护管理数据迁移 |
|||
* 集成权限管理数据迁移 |
|||
* 集成特性管理数据迁移 |
|||
* 集成文本模板数据迁移 |
|||
* 支持MySQL数据库 |
|||
|
|||
## 模块依赖 |
|||
|
|||
```csharp |
|||
[DependsOn( |
|||
typeof(AbpSaasEntityFrameworkCoreModule), |
|||
typeof(AbpSettingManagementEntityFrameworkCoreModule), |
|||
typeof(AbpDataProtectionManagementEntityFrameworkCoreModule), |
|||
typeof(AbpPermissionManagementEntityFrameworkCoreModule), |
|||
typeof(AbpFeatureManagementEntityFrameworkCoreModule), |
|||
typeof(AbpTextTemplatingEntityFrameworkCoreModule), |
|||
typeof(AbpDataDbMigratorModule) |
|||
)] |
|||
``` |
|||
|
|||
## 配置项 |
|||
|
|||
```json |
|||
{ |
|||
"ConnectionStrings": { |
|||
"BackendAdminDbMigrator": "你的数据库连接字符串" |
|||
} |
|||
} |
|||
``` |
|||
|
|||
## 基本用法 |
|||
|
|||
1. 配置数据库连接字符串 |
|||
* 在appsettings.json中配置BackendAdminDbMigrator连接字符串 |
|||
|
|||
2. 添加模块依赖 |
|||
```csharp |
|||
[DependsOn(typeof(BackendAdminMigrationsEntityFrameworkCoreModule))] |
|||
public class YourModule : AbpModule |
|||
{ |
|||
// ... |
|||
} |
|||
``` |
|||
|
|||
## 数据库表说明 |
|||
|
|||
* Saas相关表 - 租户、版本等多租户相关数据 |
|||
* AbpSettings - 系统设置数据 |
|||
* AbpDataProtection - 数据保护相关数据 |
|||
* AbpPermissionGrants - 权限授权数据 |
|||
* AbpFeatures - 功能特性数据 |
|||
* AbpTextTemplates - 文本模板数据 |
|||
|
|||
## 更多信息 |
|||
|
|||
* [ABP文档](https://docs.abp.io) |
|||
* [ASP.NET Core数据保护](https://docs.microsoft.com/zh-cn/aspnet/core/security/data-protection/introduction) |
|||
@ -0,0 +1,60 @@ |
|||
using LINGYUN.Abp.MicroService.AuthServer.EntityFrameworkCore; |
|||
using Microsoft.Extensions.Configuration; |
|||
using Microsoft.Extensions.DependencyInjection; |
|||
using Microsoft.Extensions.Hosting; |
|||
using Serilog; |
|||
using Volo.Abp; |
|||
using Volo.Abp.Data; |
|||
|
|||
namespace LINGYUN.Abp.MicroService.AuthServer.DbMigrator; |
|||
|
|||
public class AuthServerDbMigratorHostedService : IHostedService |
|||
{ |
|||
private readonly IHostApplicationLifetime _hostApplicationLifetime; |
|||
private readonly IConfiguration _configuration; |
|||
|
|||
public AuthServerDbMigratorHostedService( |
|||
IHostApplicationLifetime hostApplicationLifetime, |
|||
IConfiguration configuration) |
|||
{ |
|||
_hostApplicationLifetime = hostApplicationLifetime; |
|||
_configuration = configuration; |
|||
} |
|||
|
|||
public async Task StartAsync(CancellationToken cancellationToken) |
|||
{ |
|||
using var application = await AbpApplicationFactory |
|||
.CreateAsync<AuthServerDbMigratorModule>(options => |
|||
{ |
|||
// 从环境变量取用户机密配置, 适用于容器测试
|
|||
options.Configuration.UserSecretsId = Environment.GetEnvironmentVariable("APPLICATION_USER_SECRETS_ID"); |
|||
// 如果容器没有指定用户机密, 从项目读取
|
|||
options.Configuration.UserSecretsAssembly = typeof(AuthServerDbMigratorHostedService).Assembly; |
|||
options.Services.ReplaceConfiguration(_configuration); |
|||
options.UseAutofac(); |
|||
options.Services.AddLogging(c => c.AddSerilog()); |
|||
options.AddDataMigrationEnvironment(); |
|||
}); |
|||
await application.InitializeAsync(); |
|||
|
|||
await application |
|||
.ServiceProvider |
|||
.GetRequiredService<AuthServerDbMigrationService>() |
|||
.CheckAndApplyDatabaseMigrationsAsync(); |
|||
|
|||
await application |
|||
.ServiceProvider |
|||
.GetRequiredService<AuthServerInitializeDataSeeder>() |
|||
.SeedAsync(new DataSeedContext()); |
|||
|
|||
await application.ShutdownAsync(); |
|||
|
|||
_hostApplicationLifetime.StopApplication(); |
|||
} |
|||
|
|||
public Task StopAsync(CancellationToken cancellationToken) |
|||
{ |
|||
return Task.CompletedTask; |
|||
} |
|||
} |
|||
|
|||
@ -0,0 +1,4 @@ |
|||
namespace LINGYUN.Abp.MicroService.AuthServer.DbMigrator; |
|||
public partial class AuthServerDbMigratorModule |
|||
{ |
|||
} |
|||
@ -0,0 +1,19 @@ |
|||
using LINGYUN.Abp.Identity.Notifications; |
|||
using LINGYUN.Abp.Notifications.Common; |
|||
using LINGYUN.Abp.Notifications.EntityFrameworkCore; |
|||
using LINGYUN.Abp.MicroService.AuthServer.EntityFrameworkCore; |
|||
using Volo.Abp.Autofac; |
|||
using Volo.Abp.Modularity; |
|||
|
|||
namespace LINGYUN.Abp.MicroService.AuthServer.DbMigrator; |
|||
|
|||
[DependsOn( |
|||
typeof(AuthServerMigrationsEntityFrameworkCoreModule), |
|||
typeof(AbpNotificationsEntityFrameworkCoreModule), |
|||
typeof(AbpNotificationsCommonModule), |
|||
typeof(AbpIdentityNotificationsModule), |
|||
typeof(AbpAutofacModule) |
|||
)] |
|||
public partial class AuthServerDbMigratorModule : AbpModule |
|||
{ |
|||
} |
|||
@ -0,0 +1,20 @@ |
|||
using LINGYUN.Abp.MicroService.AuthServer.DbMigrator.DataSeeds; |
|||
using Volo.Abp.Data; |
|||
using Volo.Abp.DependencyInjection; |
|||
|
|||
namespace LINGYUN.Abp.MicroService.AuthServer.DbMigrator; |
|||
|
|||
public class AuthServerInitializeDataSeeder : ITransientDependency |
|||
{ |
|||
protected IdentityUserNotificationDataSeeder UserNotificationDataSeeder { get; } |
|||
public AuthServerInitializeDataSeeder(IdentityUserNotificationDataSeeder userNotificationDataSeeder) |
|||
{ |
|||
UserNotificationDataSeeder = userNotificationDataSeeder; |
|||
} |
|||
|
|||
public virtual async Task SeedAsync(DataSeedContext context) |
|||
{ |
|||
await UserNotificationDataSeeder.SeedAsync(context); |
|||
} |
|||
} |
|||
|
|||
@ -0,0 +1,89 @@ |
|||
using LINGYUN.Abp.Identity.Notifications; |
|||
using LINGYUN.Abp.Notifications; |
|||
using Microsoft.Extensions.Logging; |
|||
using Microsoft.Extensions.Logging.Abstractions; |
|||
using Volo.Abp.Data; |
|||
using Volo.Abp.DependencyInjection; |
|||
using Volo.Abp.Identity; |
|||
using Volo.Abp.Users; |
|||
|
|||
namespace LINGYUN.Abp.MicroService.AuthServer.DbMigrator.DataSeeds; |
|||
|
|||
public class IdentityUserNotificationDataSeeder : ITransientDependency |
|||
{ |
|||
public ILogger<IdentityUserNotificationDataSeeder> Logger { protected get; set; } |
|||
protected IdentityUserManager IdentityUserManager { get; } |
|||
protected INotificationSender NotificationSender { get; } |
|||
protected INotificationSubscriptionManager NotificationSubscriptionManager { get; } |
|||
public IdentityUserNotificationDataSeeder( |
|||
IdentityUserManager identityUserManager, |
|||
INotificationSender notificationSender, |
|||
INotificationSubscriptionManager notificationSubscriptionManager) |
|||
{ |
|||
IdentityUserManager = identityUserManager; |
|||
NotificationSender = notificationSender; |
|||
NotificationSubscriptionManager = notificationSubscriptionManager; |
|||
|
|||
Logger = NullLogger<IdentityUserNotificationDataSeeder>.Instance; |
|||
} |
|||
|
|||
public virtual async Task SeedAsync(DataSeedContext context) |
|||
{ |
|||
await SubscribeDefaultNotifierAsync(context); |
|||
} |
|||
|
|||
protected async virtual Task SubscribeDefaultNotifierAsync(DataSeedContext context) |
|||
{ |
|||
var user = await IdentityUserManager.FindByNameAsync("admin"); |
|||
if (user == null) |
|||
{ |
|||
Logger.LogInformation("No user information named {UserName} was found, so default messages cannot be subscribed to.", "admin"); |
|||
return; |
|||
} |
|||
Logger.LogInformation("User {UserId} has subscribed to default notifications.", user.Id); |
|||
var userIdentifer = new UserIdentifier(user.Id, user.UserName); |
|||
// 订阅内置通知
|
|||
await NotificationSubscriptionManager |
|||
.SubscribeAsync( |
|||
context.TenantId, |
|||
userIdentifer, |
|||
DefaultNotifications.SystemNotice); |
|||
await NotificationSubscriptionManager |
|||
.SubscribeAsync( |
|||
context.TenantId, |
|||
userIdentifer, |
|||
DefaultNotifications.OnsideNotice); |
|||
await NotificationSubscriptionManager |
|||
.SubscribeAsync( |
|||
context.TenantId, |
|||
userIdentifer, |
|||
DefaultNotifications.ActivityNotice); |
|||
|
|||
// 新用户订阅会话过期通知
|
|||
await NotificationSubscriptionManager |
|||
.SubscribeAsync( |
|||
context.TenantId, |
|||
userIdentifer, |
|||
IdentityNotificationNames.Session.ExpirationSession); |
|||
// 新用户订阅不活跃用户相关通知
|
|||
await NotificationSubscriptionManager |
|||
.SubscribeAsync( |
|||
context.TenantId, |
|||
userIdentifer, |
|||
IdentityNotificationNames.IdentityUser.InactiveUserReminderNotifier); |
|||
await NotificationSubscriptionManager |
|||
.SubscribeAsync( |
|||
context.TenantId, |
|||
userIdentifer, |
|||
IdentityNotificationNames.IdentityUser.InactiveUserDeactivationNotifier); |
|||
|
|||
// 订阅用户欢迎消息
|
|||
await NotificationSubscriptionManager |
|||
.SubscribeAsync( |
|||
context.TenantId, |
|||
userIdentifer, |
|||
UserNotificationNames.WelcomeToApplication); |
|||
|
|||
Logger.LogInformation("User {UserId} is subscribed to notifications by default.", user.Id); |
|||
} |
|||
} |
|||
@ -0,0 +1,42 @@ |
|||
<Project Sdk="Microsoft.NET.Sdk"> |
|||
|
|||
<Import Project="..\..\..\common.secrets.props" /> |
|||
|
|||
<PropertyGroup> |
|||
<OutputType>Exe</OutputType> |
|||
<TargetFramework>net10.0</TargetFramework> |
|||
<ImplicitUsings>enable</ImplicitUsings> |
|||
<Nullable>enable</Nullable> |
|||
<Configurations>Debug;Release</Configurations> |
|||
<Platforms>AnyCPU</Platforms> |
|||
<IsPackable>false</IsPackable> |
|||
</PropertyGroup> |
|||
|
|||
<ItemGroup> |
|||
<PackageReference Include="Serilog.Extensions.Logging" /> |
|||
<PackageReference Include="Serilog.Sinks.File" /> |
|||
<PackageReference Include="Serilog.Sinks.Console" /> |
|||
<PackageReference Include="Microsoft.Extensions.Hosting" /> |
|||
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools"> |
|||
<PrivateAssets>all</PrivateAssets> |
|||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> |
|||
</PackageReference> |
|||
<PackageReference Include="Volo.Abp.Autofac" /> |
|||
</ItemGroup> |
|||
|
|||
<ItemGroup> |
|||
<Compile Remove="Logs\**" /> |
|||
<Content Remove="Logs\**" /> |
|||
<EmbeddedResource Remove="Logs\**" /> |
|||
<None Remove="Logs\**" /> |
|||
</ItemGroup> |
|||
|
|||
<ItemGroup> |
|||
<ProjectReference Include="..\..\modules\identity\LINGYUN.Abp.Identity.Notifications\LINGYUN.Abp.Identity.Notifications.csproj" /> |
|||
<ProjectReference Include="..\..\modules\realtime-notifications\LINGYUN.Abp.Notifications.Common\LINGYUN.Abp.Notifications.Common.csproj" /> |
|||
<ProjectReference Include="..\..\modules\realtime-notifications\LINGYUN.Abp.Notifications.EntityFrameworkCore\LINGYUN.Abp.Notifications.EntityFrameworkCore.csproj" /> |
|||
<ProjectReference Include="..\..\modules\saas\LINGYUN.Abp.Saas.EntityFrameworkCore\LINGYUN.Abp.Saas.EntityFrameworkCore.csproj" /> |
|||
<ProjectReference Include="..\LINGYUN.Abp.MicroService.AuthServer.EntityFrameworkCore\LINGYUN.Abp.MicroService.AuthServer.EntityFrameworkCore.csproj" /> |
|||
</ItemGroup> |
|||
|
|||
</Project> |
|||
@ -0,0 +1,40 @@ |
|||
using Microsoft.Extensions.DependencyInjection; |
|||
using Microsoft.Extensions.Hosting; |
|||
using Microsoft.Extensions.Logging; |
|||
using Serilog; |
|||
using Serilog.Events; |
|||
|
|||
namespace LINGYUN.Abp.MicroService.AuthServer.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("LINGYUN.Abp.MicroService.AuthServer", LogEventLevel.Debug) |
|||
#else
|
|||
.MinimumLevel.Override("LINGYUN.Abp.MicroService.AuthServer", LogEventLevel.Information) |
|||
#endif
|
|||
.Enrich.FromLogContext() |
|||
.WriteTo.Console(outputTemplate: "{Timestamp:yyyy-MM-dd HH:mm:ss} [{Level:u3}] [{SourceContext}] [{ProcessId}] [{ThreadId}] - {Message:lj}{NewLine}{Exception}") |
|||
.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<AuthServerDbMigratorHostedService>(); |
|||
}); |
|||
} |
|||
} |
|||
@ -0,0 +1,11 @@ |
|||
{ |
|||
"profiles": { |
|||
"LINGYUN.Abp.MicroService.AuthServer.DbMigrator": { |
|||
"commandName": "Project", |
|||
"dotnetRunMessages": true, |
|||
"environmentVariables": { |
|||
"ASPNETCORE_ENVIRONMENT": "Development" |
|||
} |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,66 @@ |
|||
# LINGYUN.Abp.MicroService.AuthServer.DbMigrator |
|||
|
|||
Authentication Server Database Migration Console Application, used for executing database migrations and initializing seed data for the authentication server. |
|||
|
|||
[简体中文](./README.md) |
|||
|
|||
## Features |
|||
|
|||
* Automatic database migration execution |
|||
* Initialize necessary system seed data |
|||
* Support command line parameter configuration |
|||
* Integrated Autofac dependency injection container |
|||
* Inherit all migration features from authentication server |
|||
|
|||
## Module Dependencies |
|||
|
|||
```csharp |
|||
[DependsOn( |
|||
typeof(AuthServerMigrationsEntityFrameworkCoreModule), |
|||
typeof(AbpAutofacModule) |
|||
)] |
|||
``` |
|||
|
|||
## Configuration |
|||
|
|||
```json |
|||
{ |
|||
"ConnectionStrings": { |
|||
"AuthServerDbMigrator": "Your database connection string" |
|||
}, |
|||
"IdentityServer": { |
|||
"Clients": { |
|||
"AuthServer_App": { |
|||
"ClientId": "AuthServer_App" |
|||
} |
|||
} |
|||
} |
|||
} |
|||
``` |
|||
|
|||
## Basic Usage |
|||
|
|||
1. Configure Database Connection String |
|||
* Configure AuthServerDbMigrator connection string in appsettings.json |
|||
|
|||
2. Run Migration Program |
|||
```bash |
|||
dotnet run |
|||
``` |
|||
|
|||
## Command Line Arguments |
|||
|
|||
* --database-provider |
|||
* Specify database provider (default: MySQL) |
|||
* --connection-string |
|||
* Specify database connection string |
|||
* --skip-db-migrations |
|||
* Skip database migrations |
|||
* --skip-seed-data |
|||
* Skip seed data initialization |
|||
|
|||
## More Information |
|||
|
|||
* [ABP Documentation](https://docs.abp.io) |
|||
* [EF Core Migrations Documentation](https://docs.microsoft.com/en-us/ef/core/managing-schemas/migrations/) |
|||
* [IdentityServer4 Documentation](https://identityserver4.readthedocs.io) |
|||
@ -0,0 +1,66 @@ |
|||
# LINGYUN.Abp.MicroService.AuthServer.DbMigrator |
|||
|
|||
认证服务器数据库迁移控制台应用程序,用于执行认证服务器的数据库迁移和初始化种子数据。 |
|||
|
|||
[English](./README.EN.md) |
|||
|
|||
## 功能特性 |
|||
|
|||
* 自动执行数据库迁移 |
|||
* 初始化系统必要的种子数据 |
|||
* 支持命令行参数配置 |
|||
* 集成Autofac依赖注入容器 |
|||
* 继承认证服务器的所有迁移功能 |
|||
|
|||
## 模块依赖 |
|||
|
|||
```csharp |
|||
[DependsOn( |
|||
typeof(AuthServerMigrationsEntityFrameworkCoreModule), |
|||
typeof(AbpAutofacModule) |
|||
)] |
|||
``` |
|||
|
|||
## 配置项 |
|||
|
|||
```json |
|||
{ |
|||
"ConnectionStrings": { |
|||
"AuthServerDbMigrator": "你的数据库连接字符串" |
|||
}, |
|||
"IdentityServer": { |
|||
"Clients": { |
|||
"AuthServer_App": { |
|||
"ClientId": "AuthServer_App" |
|||
} |
|||
} |
|||
} |
|||
} |
|||
``` |
|||
|
|||
## 基本用法 |
|||
|
|||
1. 配置数据库连接字符串 |
|||
* 在appsettings.json中配置AuthServerDbMigrator连接字符串 |
|||
|
|||
2. 运行迁移程序 |
|||
```bash |
|||
dotnet run |
|||
``` |
|||
|
|||
## 命令行参数 |
|||
|
|||
* --database-provider |
|||
* 指定数据库提供程序 (默认: MySQL) |
|||
* --connection-string |
|||
* 指定数据库连接字符串 |
|||
* --skip-db-migrations |
|||
* 跳过数据库迁移 |
|||
* --skip-seed-data |
|||
* 跳过种子数据初始化 |
|||
|
|||
## 更多信息 |
|||
|
|||
* [ABP文档](https://docs.abp.io) |
|||
* [EF Core迁移文档](https://docs.microsoft.com/zh-cn/ef/core/managing-schemas/migrations/) |
|||
* [IdentityServer4文档](https://identityserver4.readthedocs.io) |
|||
@ -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,35 @@ |
|||
{ |
|||
"ConnectionStrings": { |
|||
"Default": "Server=localhost;Database=abp;User Id=root;Password=123456;SslMode=None" |
|||
}, |
|||
"OpenIddict": { |
|||
"Applications": { |
|||
"VueAdmin": { |
|||
"ClientId": "vue-admin-client", |
|||
"ClientSecret": "1q2w3e*", |
|||
"RootUrls": [ "http://localhost:5666" ] |
|||
}, |
|||
"InternalService": { |
|||
"ClientId": "InternalServiceClient", |
|||
"ClientSecret": "1q2w3e*" |
|||
}, |
|||
"VueOAuthClient": { |
|||
"ClientId": "vue-oauth-client", |
|||
"RootUrls": [ |
|||
"http://localhost:5666", |
|||
"http://localhost:30000", |
|||
"http://localhost:30010", |
|||
"http://localhost:30015", |
|||
"http://localhost:30020", |
|||
"http://localhost:30025", |
|||
"http://localhost:30030", |
|||
"http://localhost:30040", |
|||
"http://localhost:30045", |
|||
"http://localhost:30050", |
|||
"http://localhost:30060", |
|||
"http://localhost:30070" |
|||
] |
|||
} |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,36 @@ |
|||
using LINGYUN.Abp.MicroService.AuthServer.EntityFrameworkCore.DataSeeds; |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp.Data; |
|||
using Volo.Abp.DependencyInjection; |
|||
using Volo.Abp.MultiTenancy; |
|||
|
|||
namespace LINGYUN.Abp.MicroService.AuthServer.EntityFrameworkCore; |
|||
|
|||
public class AuthServerDataSeeder : ITransientDependency |
|||
{ |
|||
protected ICurrentTenant CurrentTenant { get; } |
|||
protected OpenIddictDataSeeder OpenIddictDataSeeder { get; } |
|||
protected IdentityClaimTypeDataSeeder IdentityClaimTypeDataSeeder { get; } |
|||
protected IdentityUserRoleDataSeeder IdentityUserRoleDataSeeder { get; } |
|||
public AuthServerDataSeeder( |
|||
ICurrentTenant currentTenant, |
|||
OpenIddictDataSeeder openIddictDataSeeder, |
|||
IdentityClaimTypeDataSeeder identityClaimTypeDataSeeder, |
|||
IdentityUserRoleDataSeeder identityUserRoleDataSeeder) |
|||
{ |
|||
CurrentTenant = currentTenant; |
|||
OpenIddictDataSeeder = openIddictDataSeeder; |
|||
IdentityClaimTypeDataSeeder = identityClaimTypeDataSeeder; |
|||
IdentityUserRoleDataSeeder = identityUserRoleDataSeeder; |
|||
} |
|||
|
|||
public virtual async Task SeedAsync(DataSeedContext context) |
|||
{ |
|||
using (CurrentTenant.Change(context.TenantId)) |
|||
{ |
|||
await OpenIddictDataSeeder.SeedAsync(context); |
|||
await IdentityClaimTypeDataSeeder.SeedAsync(context); |
|||
await IdentityUserRoleDataSeeder.SeedAsync(context); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,47 @@ |
|||
using Microsoft.Extensions.Logging; |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp.Data; |
|||
using Volo.Abp.DistributedLocking; |
|||
using Volo.Abp.EntityFrameworkCore.Migrations; |
|||
using Volo.Abp.EventBus.Distributed; |
|||
using Volo.Abp.Guids; |
|||
using Volo.Abp.MultiTenancy; |
|||
using Volo.Abp.Uow; |
|||
|
|||
namespace LINGYUN.Abp.MicroService.AuthServer.EntityFrameworkCore; |
|||
|
|||
public class AuthServerDbMigrationEventHandler : EfCoreDatabaseMigrationEventHandlerBase<AuthServerMigrationsDbContext> |
|||
{ |
|||
protected AuthServerDataSeeder DataSeeder { get; } |
|||
|
|||
public AuthServerDbMigrationEventHandler( |
|||
ICurrentTenant currentTenant, |
|||
IUnitOfWorkManager unitOfWorkManager, |
|||
ITenantStore tenantStore, |
|||
IAbpDistributedLock abpDistributedLock, |
|||
IDistributedEventBus distributedEventBus, |
|||
ILoggerFactory loggerFactory, |
|||
IGuidGenerator guidGenerator, |
|||
AuthServerDataSeeder dataSeeder) |
|||
: base( |
|||
ConnectionStringNameAttribute.GetConnStringName<AuthServerMigrationsDbContext>(), |
|||
currentTenant, unitOfWorkManager, tenantStore, abpDistributedLock, distributedEventBus, loggerFactory) |
|||
{ |
|||
DataSeeder = dataSeeder; |
|||
} |
|||
|
|||
protected async override Task AfterTenantCreated(TenantCreatedEto eventData, bool schemaMigrated) |
|||
{ |
|||
// 新租户数据种子
|
|||
var context = new DataSeedContext(eventData.Id); |
|||
if (eventData.Properties != null) |
|||
{ |
|||
foreach (var property in eventData.Properties) |
|||
{ |
|||
context.WithProperty(property.Key, property.Value); |
|||
} |
|||
} |
|||
|
|||
await DataSeeder.SeedAsync(context); |
|||
} |
|||
} |
|||
@ -0,0 +1,38 @@ |
|||
using LINGYUN.Abp.Data.DbMigrator; |
|||
using Microsoft.Extensions.Logging; |
|||
using System; |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp.Data; |
|||
using Volo.Abp.DependencyInjection; |
|||
using Volo.Abp.DistributedLocking; |
|||
using Volo.Abp.EventBus.Distributed; |
|||
using Volo.Abp.MultiTenancy; |
|||
using Volo.Abp.Uow; |
|||
|
|||
namespace LINGYUN.Abp.MicroService.AuthServer.EntityFrameworkCore; |
|||
|
|||
public class AuthServerDbMigrationService : EfCoreRuntimeDbMigratorBase<AuthServerMigrationsDbContext>, ITransientDependency |
|||
{ |
|||
protected AuthServerDataSeeder DataSeeder { get; } |
|||
|
|||
public AuthServerDbMigrationService( |
|||
AuthServerDataSeeder dataSeeder, |
|||
ICurrentTenant currentTenant, |
|||
IUnitOfWorkManager unitOfWorkManager, |
|||
IServiceProvider serviceProvider, |
|||
IAbpDistributedLock abpDistributedLock, |
|||
IDistributedEventBus distributedEventBus, |
|||
ILoggerFactory loggerFactory) |
|||
: base( |
|||
ConnectionStringNameAttribute.GetConnStringName<AuthServerMigrationsDbContext>(), |
|||
unitOfWorkManager, serviceProvider, currentTenant, abpDistributedLock, distributedEventBus, loggerFactory) |
|||
{ |
|||
DataSeeder = dataSeeder; |
|||
} |
|||
|
|||
protected async override Task SeedAsync() |
|||
{ |
|||
// DbMigrator迁移数据种子
|
|||
await DataSeeder.SeedAsync(new DataSeedContext()); |
|||
} |
|||
} |
|||
@ -0,0 +1,31 @@ |
|||
using LINGYUN.Abp.Gdpr.EntityFrameworkCore; |
|||
using LINGYUN.Abp.Identity.EntityFrameworkCore; |
|||
using Microsoft.EntityFrameworkCore; |
|||
using Volo.Abp.Data; |
|||
using Volo.Abp.EntityFrameworkCore; |
|||
using Volo.Abp.Identity.EntityFrameworkCore; |
|||
using Volo.Abp.OpenIddict.EntityFrameworkCore; |
|||
|
|||
namespace LINGYUN.Abp.MicroService.AuthServer.EntityFrameworkCore; |
|||
|
|||
[ConnectionStringName("AuthServerDbMigrator")] |
|||
public class AuthServerMigrationsDbContext : AbpDbContext<AuthServerMigrationsDbContext> |
|||
{ |
|||
public AuthServerMigrationsDbContext(DbContextOptions<AuthServerMigrationsDbContext> options) |
|||
: base(options) |
|||
{ |
|||
|
|||
} |
|||
|
|||
protected override void OnModelCreating(ModelBuilder modelBuilder) |
|||
{ |
|||
base.OnModelCreating(modelBuilder); |
|||
|
|||
modelBuilder.ConfigureIdentity(); |
|||
modelBuilder.ConfigureOpenIddict(); |
|||
|
|||
modelBuilder.ConfigureGdpr(); |
|||
|
|||
modelBuilder.ConfigureIdentityUserInactive(); |
|||
} |
|||
} |
|||
@ -0,0 +1,29 @@ |
|||
using Microsoft.EntityFrameworkCore; |
|||
using Microsoft.EntityFrameworkCore.Design; |
|||
using Microsoft.Extensions.Configuration; |
|||
using System.IO; |
|||
|
|||
namespace LINGYUN.Abp.MicroService.AuthServer.EntityFrameworkCore; |
|||
|
|||
public class AuthServerMigrationsDbContextFactory : IDesignTimeDbContextFactory<AuthServerMigrationsDbContext> |
|||
{ |
|||
public AuthServerMigrationsDbContext CreateDbContext(string[] args) |
|||
{ |
|||
var configuration = BuildConfiguration(); |
|||
var connectionString = configuration.GetConnectionString("Default"); |
|||
|
|||
var builder = new DbContextOptionsBuilder<AuthServerMigrationsDbContext>() |
|||
.UseMySql(connectionString, ServerVersion.AutoDetect(connectionString)); |
|||
|
|||
return new AuthServerMigrationsDbContext(builder!.Options); |
|||
} |
|||
|
|||
private static IConfigurationRoot BuildConfiguration() |
|||
{ |
|||
var builder = new ConfigurationBuilder() |
|||
.SetBasePath(Path.Combine(Directory.GetCurrentDirectory(), "../LINGYUN.Abp.MicroService.AuthServer.DbMigrator/")) |
|||
.AddJsonFile("appsettings.json", optional: false); |
|||
|
|||
return builder.Build(); |
|||
} |
|||
} |
|||
@ -0,0 +1,58 @@ |
|||
using LINGYUN.Abp.Data.DbMigrator; |
|||
using LINGYUN.Abp.EntityFrameworkCore.MySQL; |
|||
using LINGYUN.Abp.Gdpr.EntityFrameworkCore; |
|||
using LINGYUN.Abp.Identity.EntityFrameworkCore; |
|||
using LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore; |
|||
using LINGYUN.Abp.Saas.EntityFrameworkCore; |
|||
using LINGYUN.Abp.TextTemplating.EntityFrameworkCore; |
|||
using LINGYUN.Platform.EntityFrameworkCore; |
|||
using Microsoft.EntityFrameworkCore; |
|||
using Microsoft.Extensions.DependencyInjection; |
|||
using Volo.Abp.Authorization; |
|||
using Volo.Abp.EntityFrameworkCore; |
|||
using Volo.Abp.FeatureManagement.EntityFrameworkCore; |
|||
using Volo.Abp.Modularity; |
|||
using Volo.Abp.OpenIddict.EntityFrameworkCore; |
|||
using Volo.Abp.OpenIddict.Tokens; |
|||
using Volo.Abp.PermissionManagement.EntityFrameworkCore; |
|||
using Volo.Abp.SettingManagement.EntityFrameworkCore; |
|||
|
|||
namespace LINGYUN.Abp.MicroService.AuthServer.EntityFrameworkCore; |
|||
|
|||
[DependsOn( |
|||
typeof(AbpAuthorizationModule), |
|||
typeof(AbpSaasEntityFrameworkCoreModule), |
|||
typeof(AbpOpenIddictEntityFrameworkCoreModule), |
|||
typeof(AbpIdentityEntityFrameworkCoreModule), |
|||
typeof(AbpGdprEntityFrameworkCoreModule), |
|||
typeof(AbpLocalizationManagementEntityFrameworkCoreModule), |
|||
typeof(AbpPermissionManagementEntityFrameworkCoreModule), |
|||
typeof(AbpSettingManagementEntityFrameworkCoreModule), |
|||
typeof(AbpFeatureManagementEntityFrameworkCoreModule), |
|||
typeof(AbpTextTemplatingEntityFrameworkCoreModule), |
|||
typeof(PlatformEntityFrameworkCoreModule), |
|||
typeof(AbpEntityFrameworkCoreMySQLMicrotingModule), |
|||
typeof(AbpDataDbMigratorModule) |
|||
)] |
|||
public class AuthServerMigrationsEntityFrameworkCoreModule : AbpModule |
|||
{ |
|||
public override void ConfigureServices(ServiceConfigurationContext context) |
|||
{ |
|||
context.Services.AddAbpDbContext<AuthServerMigrationsDbContext>(); |
|||
|
|||
Configure<AbpDbContextOptions>(options => |
|||
{ |
|||
options.UseMySQL( |
|||
mysql => |
|||
{ |
|||
// see: https://github.com/PomeloFoundation/Pomelo.EntityFrameworkCore.MySql/issues/1960
|
|||
mysql.UseParameterizedCollectionMode(ParameterTranslationMode.Constant); |
|||
}); |
|||
}); |
|||
|
|||
context.Services.AddAbpDbContext<OpenIddictDbContext>(options => |
|||
{ |
|||
options.AddRepository<OpenIddictToken, EfCoreMySqlOpenIddictTokenRepository>(); |
|||
}); |
|||
} |
|||
} |
|||
@ -0,0 +1,96 @@ |
|||
using JetBrains.Annotations; |
|||
using Microsoft.Extensions.Logging; |
|||
using Microsoft.Extensions.Logging.Abstractions; |
|||
using OpenIddict.Abstractions; |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp.Data; |
|||
using Volo.Abp.DependencyInjection; |
|||
using Volo.Abp.Guids; |
|||
using Volo.Abp.Identity; |
|||
|
|||
namespace LINGYUN.Abp.MicroService.AuthServer.EntityFrameworkCore.DataSeeds; |
|||
public class IdentityClaimTypeDataSeeder : ITransientDependency |
|||
{ |
|||
public ILogger<IdentityClaimTypeDataSeeder> Logger { protected get; set; } |
|||
|
|||
protected IGuidGenerator GuidGenerator { get; } |
|||
protected IdentityClaimTypeManager IdentityClaimTypeManager { get; } |
|||
protected IIdentityClaimTypeRepository IdentityClaimTypeRepository { get; } |
|||
public IdentityClaimTypeDataSeeder( |
|||
IGuidGenerator guidGenerator, |
|||
IdentityClaimTypeManager identityClaimTypeManager, |
|||
IIdentityClaimTypeRepository identityClaimTypeRepository) |
|||
{ |
|||
GuidGenerator = guidGenerator; |
|||
IdentityClaimTypeManager = identityClaimTypeManager; |
|||
IdentityClaimTypeRepository = identityClaimTypeRepository; |
|||
|
|||
Logger = NullLogger<IdentityClaimTypeDataSeeder>.Instance; |
|||
} |
|||
|
|||
public async virtual Task SeedAsync(DataSeedContext context) |
|||
{ |
|||
if (context.TenantId.HasValue) |
|||
{ |
|||
return; |
|||
} |
|||
|
|||
Logger.LogInformation("Seeding the default identity claim types..."); |
|||
|
|||
await CreateIdentityClaimTypeAsync(OpenIddictConstants.Claims.Address); |
|||
await CreateIdentityClaimTypeAsync(OpenIddictConstants.Claims.Birthdate, valueType: IdentityClaimValueType.DateTime); |
|||
await CreateIdentityClaimTypeAsync(OpenIddictConstants.Claims.Country); |
|||
await CreateIdentityClaimTypeAsync(OpenIddictConstants.Claims.Email); |
|||
await CreateIdentityClaimTypeAsync(OpenIddictConstants.Claims.EmailVerified, valueType: IdentityClaimValueType.Boolean); |
|||
await CreateIdentityClaimTypeAsync(OpenIddictConstants.Claims.FamilyName); |
|||
await CreateIdentityClaimTypeAsync(OpenIddictConstants.Claims.Gender); |
|||
await CreateIdentityClaimTypeAsync(OpenIddictConstants.Claims.GivenName); |
|||
await CreateIdentityClaimTypeAsync(OpenIddictConstants.Claims.Locale); |
|||
await CreateIdentityClaimTypeAsync(OpenIddictConstants.Claims.Locality); |
|||
await CreateIdentityClaimTypeAsync(OpenIddictConstants.Claims.MiddleName); |
|||
await CreateIdentityClaimTypeAsync(OpenIddictConstants.Claims.Name); |
|||
await CreateIdentityClaimTypeAsync(OpenIddictConstants.Claims.Nickname); |
|||
await CreateIdentityClaimTypeAsync(OpenIddictConstants.Claims.PhoneNumber); |
|||
await CreateIdentityClaimTypeAsync(OpenIddictConstants.Claims.PhoneNumberVerified, valueType: IdentityClaimValueType.Boolean); |
|||
await CreateIdentityClaimTypeAsync(OpenIddictConstants.Claims.Picture); |
|||
await CreateIdentityClaimTypeAsync(OpenIddictConstants.Claims.PostalCode); |
|||
await CreateIdentityClaimTypeAsync(OpenIddictConstants.Claims.PreferredUsername); |
|||
await CreateIdentityClaimTypeAsync(OpenIddictConstants.Claims.Profile); |
|||
await CreateIdentityClaimTypeAsync(OpenIddictConstants.Claims.Region); |
|||
await CreateIdentityClaimTypeAsync(OpenIddictConstants.Claims.Role); |
|||
await CreateIdentityClaimTypeAsync(OpenIddictConstants.Claims.StreetAddress); |
|||
await CreateIdentityClaimTypeAsync(OpenIddictConstants.Claims.Username); |
|||
await CreateIdentityClaimTypeAsync(OpenIddictConstants.Claims.Website); |
|||
await CreateIdentityClaimTypeAsync(OpenIddictConstants.Claims.Zoneinfo); |
|||
|
|||
Logger.LogInformation("Seeding default identity claim types completed."); |
|||
} |
|||
|
|||
private async Task CreateIdentityClaimTypeAsync( |
|||
[NotNull] string name, |
|||
bool required = false, |
|||
bool isStatic = false, |
|||
[CanBeNull] string? regex = null, |
|||
[CanBeNull] string? regexDescription = null, |
|||
[CanBeNull] string? description = null, |
|||
IdentityClaimValueType valueType = IdentityClaimValueType.String) |
|||
{ |
|||
Logger.LogInformation("Check claim types {name} exists.", name); |
|||
|
|||
if (!await IdentityClaimTypeRepository.AnyAsync(name)) |
|||
{ |
|||
Logger.LogInformation("Create new claim types {name}.", name); |
|||
|
|||
await IdentityClaimTypeManager.CreateAsync( |
|||
new IdentityClaimType( |
|||
GuidGenerator.Create(), |
|||
name, |
|||
required, |
|||
isStatic, |
|||
regex, |
|||
regexDescription, |
|||
description, |
|||
valueType)); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,149 @@ |
|||
using Microsoft.AspNetCore.Identity; |
|||
using Microsoft.Extensions.Logging; |
|||
using Microsoft.Extensions.Logging.Abstractions; |
|||
using Microsoft.Extensions.Options; |
|||
using System; |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp.Data; |
|||
using Volo.Abp.DependencyInjection; |
|||
using Volo.Abp.Guids; |
|||
using Volo.Abp.Identity; |
|||
|
|||
namespace LINGYUN.Abp.MicroService.AuthServer.EntityFrameworkCore.DataSeeds; |
|||
|
|||
public class IdentityUserRoleDataSeeder : ITransientDependency |
|||
{ |
|||
public const string AdminUserIdPropertyName = "AdminUserId"; |
|||
public const string AdminEmailPropertyName = "AdminEmail"; |
|||
public const string AdminEmailDefaultValue = "admin@abp.io"; |
|||
public const string AdminUserNamePropertyName = "AdminUserName"; |
|||
public const string AdminUserNameDefaultValue = "admin"; |
|||
public const string AdminPasswordPropertyName = "AdminPassword"; |
|||
public const string AdminPasswordDefaultValue = "1q2w3E*"; |
|||
|
|||
public ILogger<IdentityUserRoleDataSeeder> Logger { protected get; set; } |
|||
|
|||
protected IGuidGenerator GuidGenerator { get; } |
|||
protected IIdentityRoleRepository RoleRepository { get; } |
|||
protected IIdentityUserRepository UserRepository { get; } |
|||
protected ILookupNormalizer LookupNormalizer { get; } |
|||
protected IdentityUserManager UserManager { get; } |
|||
protected IdentityRoleManager RoleManager { get; } |
|||
protected IOptions<IdentityOptions> IdentityOptions { get; } |
|||
|
|||
public IdentityUserRoleDataSeeder( |
|||
IGuidGenerator guidGenerator, |
|||
IIdentityRoleRepository roleRepository, |
|||
IIdentityUserRepository userRepository, |
|||
ILookupNormalizer lookupNormalizer, |
|||
IdentityUserManager userManager, |
|||
IdentityRoleManager roleManager, |
|||
IOptions<IdentityOptions> identityOptions) |
|||
{ |
|||
GuidGenerator = guidGenerator; |
|||
RoleRepository = roleRepository; |
|||
UserRepository = userRepository; |
|||
LookupNormalizer = lookupNormalizer; |
|||
UserManager = userManager; |
|||
RoleManager = roleManager; |
|||
IdentityOptions = identityOptions; |
|||
|
|||
Logger = NullLogger<IdentityUserRoleDataSeeder>.Instance; |
|||
} |
|||
|
|||
public virtual async Task SeedAsync(DataSeedContext context) |
|||
{ |
|||
Logger.LogInformation("Seeding the admin user roles..."); |
|||
await SeedAdminUserAsync(context); |
|||
|
|||
Logger.LogInformation("Seeding the default roles..."); |
|||
await SeedDefaultRoleAsync(context); |
|||
|
|||
Logger.LogInformation("Seeding user roles completed."); |
|||
} |
|||
|
|||
private async Task SeedAdminUserAsync(DataSeedContext context) |
|||
{ |
|||
await IdentityOptions.SetAsync(); |
|||
|
|||
const string adminRoleName = "admin"; |
|||
var adminUserName = context[AdminUserNamePropertyName] as string ?? AdminUserNameDefaultValue; |
|||
|
|||
Guid adminRoleId; |
|||
|
|||
Logger.LogInformation("Check admin role {adminRoleName} exists.", adminRoleName); |
|||
|
|||
if (!await RoleManager.RoleExistsAsync(adminRoleName)) |
|||
{ |
|||
Logger.LogInformation("Create new role {adminRoleName}.", adminRoleName); |
|||
|
|||
adminRoleId = GuidGenerator.Create(); |
|||
var adminRole = new IdentityRole( |
|||
adminRoleId, |
|||
adminRoleName, |
|||
context.TenantId) |
|||
{ |
|||
IsStatic = true, |
|||
IsPublic = true |
|||
}; |
|||
(await RoleManager.CreateAsync(adminRole)).CheckErrors(); |
|||
} |
|||
else |
|||
{ |
|||
var adminRole = await RoleManager.FindByNameAsync(adminRoleName); |
|||
adminRoleId = adminRole!.Id; |
|||
} |
|||
|
|||
var adminUserId = GuidGenerator.Create(); |
|||
if (context.Properties.TryGetValue(AdminUserIdPropertyName, out var userIdString) && |
|||
Guid.TryParse(userIdString?.ToString(), out var adminUserGuid)) |
|||
{ |
|||
adminUserId = adminUserGuid; |
|||
} |
|||
var adminEmailAddress = context[AdminEmailPropertyName] as string ?? AdminEmailDefaultValue; |
|||
var adminPassword = context[AdminPasswordPropertyName] as string ?? AdminPasswordDefaultValue; |
|||
|
|||
Logger.LogInformation("Check admin user {adminUserName} exists.", adminUserName); |
|||
|
|||
var adminUser = await UserManager.FindByNameAsync(adminUserName); |
|||
if (adminUser == null) |
|||
{ |
|||
Logger.LogInformation("Create new user {adminUserName}.", adminUserName); |
|||
|
|||
adminUser = new IdentityUser( |
|||
adminUserId, |
|||
adminUserName, |
|||
adminEmailAddress, |
|||
context.TenantId); |
|||
|
|||
adminUser.AddRole(adminRoleId); |
|||
|
|||
// 创建租户管理用户
|
|||
(await UserManager.CreateAsync(adminUser)).CheckErrors(); |
|||
|
|||
Logger.LogInformation("Add user {adminUserName} password.", adminUserName); |
|||
(await UserManager.AddPasswordAsync(adminUser, adminPassword)).CheckErrors(); |
|||
} |
|||
} |
|||
|
|||
private async Task SeedDefaultRoleAsync(DataSeedContext context) |
|||
{ |
|||
const string defaultRoleName = "Users"; |
|||
Logger.LogInformation("Check Role {defaultRoleName} exists.", defaultRoleName); |
|||
if (!await RoleManager.RoleExistsAsync(defaultRoleName)) |
|||
{ |
|||
Logger.LogInformation("Create new role {defaultRoleName}.", defaultRoleName); |
|||
var roleId = GuidGenerator.Create(); |
|||
var defaultRole = new IdentityRole( |
|||
roleId, |
|||
defaultRoleName, |
|||
context.TenantId) |
|||
{ |
|||
IsStatic = true, |
|||
IsPublic = true, |
|||
IsDefault = true, |
|||
}; |
|||
(await RoleManager.CreateAsync(defaultRole)).CheckErrors(); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,437 @@ |
|||
using Microsoft.Extensions.Configuration; |
|||
using Microsoft.Extensions.Logging; |
|||
using Microsoft.Extensions.Logging.Abstractions; |
|||
using OpenIddict.Abstractions; |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Globalization; |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp.Authorization.Permissions; |
|||
using Volo.Abp.Data; |
|||
using Volo.Abp.DependencyInjection; |
|||
using Volo.Abp.OpenIddict; |
|||
using Volo.Abp.OpenIddict.Applications; |
|||
using Volo.Abp.OpenIddict.Scopes; |
|||
using Volo.Abp.PermissionManagement; |
|||
|
|||
namespace LINGYUN.Abp.MicroService.AuthServer.EntityFrameworkCore.DataSeeds; |
|||
|
|||
public class OpenIddictDataSeeder : OpenIddictDataSeedContributorBase, ITransientDependency |
|||
{ |
|||
public ILogger<OpenIddictDataSeeder> Logger { protected get; set; } |
|||
protected IPermissionDataSeeder PermissionDataSeeder { get; } |
|||
public OpenIddictDataSeeder( |
|||
IConfiguration configuration, |
|||
IOpenIddictApplicationRepository openIddictApplicationRepository, |
|||
IAbpApplicationManager applicationManager, |
|||
IOpenIddictScopeRepository openIddictScopeRepository, |
|||
IOpenIddictScopeManager scopeManager, |
|||
IPermissionDataSeeder permissionDataSeeder) |
|||
: base(configuration, openIddictApplicationRepository, applicationManager, openIddictScopeRepository, scopeManager) |
|||
{ |
|||
PermissionDataSeeder = permissionDataSeeder; |
|||
|
|||
Logger = NullLogger<OpenIddictDataSeeder>.Instance; |
|||
} |
|||
|
|||
public async virtual Task SeedAsync(DataSeedContext context) |
|||
{ |
|||
if (context.TenantId.HasValue) |
|||
{ |
|||
return; |
|||
} |
|||
var applicationScope = "lingyun-abp-application"; |
|||
|
|||
Logger.LogInformation("Seeding the default scope..."); |
|||
await CreateDefaultScopeAsync(); |
|||
await CreateApiScopesAsync(applicationScope); |
|||
|
|||
Logger.LogInformation("Seeding the default applications..."); |
|||
await CreateApplicationAsync(applicationScope); |
|||
|
|||
Logger.LogInformation("Seeding default applications completed."); |
|||
} |
|||
|
|||
private async Task CreateDefaultScopeAsync() |
|||
{ |
|||
// OpenId Connect
|
|||
await CreateServiceScopeAsync( |
|||
OpenIddictConstants.Scopes.OpenId, |
|||
"OpenId Connect", |
|||
"身份认证", |
|||
"OpenId Connect", |
|||
"OpenId Connect协议进行身份验证", |
|||
"允许应用程序使用您的身份信息进行登录", |
|||
"Allow the application to authenticate you using OpenID Connect"); |
|||
|
|||
// Profile
|
|||
await CreateServiceScopeAsync( |
|||
OpenIddictConstants.Scopes.Profile, |
|||
"个人资料", |
|||
"个人资料", |
|||
"Profile", |
|||
"访问您的基本个人资料信息", |
|||
"允许应用程序访问您的姓名、头像等基本信息", |
|||
"Allow the application to access your basic profile information like name and picture"); |
|||
|
|||
// Email
|
|||
await CreateServiceScopeAsync( |
|||
OpenIddictConstants.Scopes.Email, |
|||
"电子邮件", |
|||
"电子邮件", |
|||
"Email", |
|||
"访问您的电子邮件地址", |
|||
"允许应用程序访问您的电子邮件地址", |
|||
"Allow the application to access your email address"); |
|||
|
|||
// Phone
|
|||
await CreateServiceScopeAsync( |
|||
OpenIddictConstants.Scopes.Phone, |
|||
"电话号码", |
|||
"电话号码", |
|||
"Phone", |
|||
"访问您的电话号码", |
|||
"允许应用程序访问您的电话号码", |
|||
"Allow the application to access your phone number"); |
|||
|
|||
// Address
|
|||
await CreateServiceScopeAsync( |
|||
OpenIddictConstants.Scopes.Address, |
|||
"地址信息", |
|||
"地址信息", |
|||
"Address", |
|||
"访问您的地址信息", |
|||
"允许应用程序访问您的地址信息", |
|||
"Allow the application to access your address information"); |
|||
|
|||
// Roles
|
|||
await CreateServiceScopeAsync( |
|||
OpenIddictConstants.Scopes.Roles, |
|||
"角色信息", |
|||
"角色信息", |
|||
"Roles", |
|||
"访问您的角色信息", |
|||
"允许应用程序访问您的角色和权限信息", |
|||
"Allow the application to access your roles and permissions"); |
|||
|
|||
// OfflineAccess
|
|||
await CreateServiceScopeAsync( |
|||
OpenIddictConstants.Scopes.OfflineAccess, |
|||
"离线访问", |
|||
"离线访问", |
|||
"Offline access", |
|||
"在您未登录时访问您的信息", |
|||
"允许应用程序在您未登录时访问您的信息", |
|||
"Allow the application to access your information while you are offline"); |
|||
} |
|||
|
|||
private async Task CreateApiScopesAsync(string scope) |
|||
{ |
|||
// 前端汇总授权范围
|
|||
await CreateServiceScopeAsync( |
|||
scope, |
|||
"微服务访问授权", |
|||
"微服务访问授权", |
|||
"MicroService applications access", |
|||
"适用于微服务体系的接口授权", |
|||
"允许应用程序使用各微服务模块的接口", |
|||
"Allow the application to use the interfaces of each microservice module", |
|||
[ |
|||
"api-gateway", |
|||
"auth-server", |
|||
"admin-service", |
|||
"ai-service", |
|||
"identity-service", |
|||
"localization-service", |
|||
"message-service", |
|||
"platform-service", |
|||
"task-service", |
|||
"webhook-service", |
|||
"wechat-service", |
|||
"workflow-service" |
|||
]); |
|||
// ApiGateway Swagger
|
|||
await CreateServiceScopeAsync( |
|||
"api-gateway", |
|||
"Api Gateway", |
|||
"应用程序接口网关", |
|||
"Api Gateway", |
|||
"适用于应用程序接口网关Swagger授权", |
|||
"适用于应用程序接口网关Swagger授权", |
|||
"Applicable to application Programming interface gateway Swagger authorization", |
|||
["api-gateway"]); |
|||
// Admin Service
|
|||
await CreateServiceScopeAsync( |
|||
"admin-service", |
|||
"Admin Service", |
|||
"后台管理服务", |
|||
"Admin Service", |
|||
"适用于后台管理服务Swagger授权", |
|||
"适用于后台管理服务Swagger授权", |
|||
"Applicable to the back-end management service Swagger authorization", |
|||
["admin-service"]); |
|||
// Auth Server
|
|||
await CreateServiceScopeAsync( |
|||
"auth-server", |
|||
"Auth Server", |
|||
"身份认证服务器", |
|||
"Auth Server", |
|||
"适用于身份认证服务器Swagger授权", |
|||
"适用于身份认证服务器Swagger授权", |
|||
"Applicable to the auth server Swagger authorization", |
|||
["auth-server"]); |
|||
// Identity Service
|
|||
await CreateServiceScopeAsync( |
|||
"identity-service", |
|||
"Identity Service", |
|||
"身份认证服务", |
|||
"Identity Service", |
|||
"适用于身份认证服务Swagger授权", |
|||
"适用于身份认证服务Swagger授权", |
|||
"Applicable to the identity service Swagger authorization", |
|||
["identity-service"]); |
|||
// Localization Service
|
|||
await CreateServiceScopeAsync( |
|||
"localization-service", |
|||
"Localization Service", |
|||
"本地化管理服务", |
|||
"Localization Service", |
|||
"适用于本地化管理服务Swagger授权", |
|||
"适用于本地化管理服务Swagger授权", |
|||
"Applicable to the Localization service Swagger authorization", |
|||
["localization-service"]); |
|||
// Message Service
|
|||
await CreateServiceScopeAsync( |
|||
"message-service", |
|||
"Message Service", |
|||
"消息管理服务", |
|||
"Message Service", |
|||
"适用于消息管理服务Swagger授权", |
|||
"适用于消息管理服务Swagger授权", |
|||
"Applicable to the Message service Swagger authorization", |
|||
["message-service"]); |
|||
// Platform Service
|
|||
await CreateServiceScopeAsync( |
|||
"platform-service", |
|||
"Platform Service", |
|||
"平台管理服务", |
|||
"Platform Service", |
|||
"适用于平台管理服务Swagger授权", |
|||
"适用于平台管理服务Swagger授权", |
|||
"Applicable to the Platform service Swagger authorization", |
|||
["platform-service"]); |
|||
// Task Service
|
|||
await CreateServiceScopeAsync( |
|||
"task-service", |
|||
"Task Service", |
|||
"任务管理服务", |
|||
"Task Service", |
|||
"适用于任务管理服务Swagger授权", |
|||
"适用于任务管理服务Swagger授权", |
|||
"Applicable to the Task service Swagger authorization", |
|||
["task-service"]); |
|||
// Webhook Service
|
|||
await CreateServiceScopeAsync( |
|||
"webhook-service", |
|||
"Webhook Service", |
|||
"Webhook管理服务", |
|||
"Webhook Service", |
|||
"适用于Webhook管理服务Swagger授权", |
|||
"适用于Webhook管理服务Swagger授权", |
|||
"Applicable to the Webhook service Swagger authorization", |
|||
["webhook-service"]); |
|||
// Wechat Service
|
|||
await CreateServiceScopeAsync( |
|||
"wechat-service", |
|||
"Wechat Service", |
|||
"微信管理服务", |
|||
"Wechat Service", |
|||
"适用于微信管理服务Swagger授权", |
|||
"适用于微信管理服务Swagger授权", |
|||
"Applicable to the Wechat service Swagger authorization", |
|||
["wechat-service"]); |
|||
// Workflow Service
|
|||
await CreateServiceScopeAsync( |
|||
"workflow-service", |
|||
"Workflow Service", |
|||
"工作流管理服务", |
|||
"Workflow Service", |
|||
"适用于工作流管理服务Swagger授权", |
|||
"适用于工作流管理服务Swagger授权", |
|||
"Applicable to the Workflow service Swagger authorization", |
|||
["workflow-service"]); |
|||
// AI Service
|
|||
await CreateServiceScopeAsync( |
|||
"ai-service", |
|||
"Artificial Intelligence Service", |
|||
"AI管理服务", |
|||
"Artificial Intelligence Service", |
|||
"适用于AI管理服务Swagger授权", |
|||
"适用于AI管理服务Swagger授权", |
|||
"Applicable to the Artificial Intelligence service Swagger authorization", |
|||
["ai-service"]); |
|||
} |
|||
|
|||
private async Task CreateApplicationAsync(string scope) |
|||
{ |
|||
var configurationSection = Configuration.GetSection("OpenIddict:Applications"); |
|||
var vueClientId = configurationSection["VueAdmin:ClientId"]; |
|||
if (!vueClientId.IsNullOrWhiteSpace()) |
|||
{ |
|||
Logger.LogInformation("Seeding application {vueClientId}...", vueClientId); |
|||
|
|||
var vueClientRootUrls = configurationSection.GetSection("VueAdmin:RootUrls").Get<List<string>>() ?? []; |
|||
|
|||
var vueClientRedirectUrls = new List<string>(); |
|||
var vueClientPostLogoutRedirectUrls = new List<string>(); |
|||
vueClientRootUrls.ForEach(url => |
|||
{ |
|||
vueClientRedirectUrls.Add(url.EnsureEndsWith('/')); |
|||
vueClientRedirectUrls.Add(url.EnsureEndsWith('/') + "signin-callback"); |
|||
|
|||
vueClientPostLogoutRedirectUrls.Add(url.EnsureEndsWith('/')); |
|||
vueClientPostLogoutRedirectUrls.Add(url.EnsureEndsWith('/') + "signout-callback"); |
|||
}); |
|||
|
|||
await CreateOrUpdateApplicationAsync( |
|||
OpenIddictConstants.ApplicationTypes.Web, |
|||
vueClientId, |
|||
OpenIddictConstants.ClientTypes.Confidential, |
|||
OpenIddictConstants.ConsentTypes.Explicit, |
|||
"Abp Vue Admin Client", |
|||
configurationSection["VueAdmin:ClientSecret"] ?? "1q2w3e*", |
|||
[OpenIddictConstants.GrantTypes.AuthorizationCode, |
|||
OpenIddictConstants.GrantTypes.Password, |
|||
OpenIddictConstants.GrantTypes.RefreshToken, |
|||
// TODO: 引用项目?
|
|||
"link_user", |
|||
"impersonation"], |
|||
[OpenIddictConstants.Scopes.OpenId, |
|||
OpenIddictConstants.Scopes.Email, |
|||
OpenIddictConstants.Scopes.Roles, |
|||
OpenIddictConstants.Scopes.Address, |
|||
OpenIddictConstants.Scopes.Phone, |
|||
OpenIddictConstants.Scopes.Profile, |
|||
OpenIddictConstants.Scopes.OfflineAccess, |
|||
scope], |
|||
vueClientRedirectUrls, |
|||
vueClientPostLogoutRedirectUrls); |
|||
|
|||
var vueClientPermissions = new string[1] |
|||
{ |
|||
"AbpIdentity.UserLookup" |
|||
}; |
|||
await PermissionDataSeeder.SeedAsync(ClientPermissionValueProvider.ProviderName, vueClientId, vueClientPermissions); |
|||
} |
|||
|
|||
var internalServiceClientId = configurationSection["InternalService:ClientId"]; |
|||
if (!internalServiceClientId.IsNullOrWhiteSpace()) |
|||
{ |
|||
Logger.LogInformation("Seeding application {internalServiceClientId}...", internalServiceClientId); |
|||
|
|||
await CreateOrUpdateApplicationAsync( |
|||
OpenIddictConstants.ApplicationTypes.Web, |
|||
internalServiceClientId, |
|||
OpenIddictConstants.ClientTypes.Confidential, |
|||
OpenIddictConstants.ConsentTypes.Implicit, |
|||
"Abp Internal Service Client", |
|||
configurationSection["InternalService:ClientSecret"] ?? "1q2w3e*", |
|||
[OpenIddictConstants.GrantTypes.ClientCredentials], |
|||
[scope]); |
|||
} |
|||
|
|||
var oauthClientId = configurationSection["VueOAuthClient:ClientId"]; |
|||
if (!oauthClientId.IsNullOrWhiteSpace()) |
|||
{ |
|||
Logger.LogInformation("Seeding application {oauthClientId}...", oauthClientId); |
|||
|
|||
var oauthClientRootUrls = configurationSection.GetSection("VueOAuthClient:RootUrls").Get<List<string>>() ?? []; |
|||
|
|||
var oauthClientRedirectUrls = new List<string>(); |
|||
var oauthClientPostLogoutRedirectUrls = new List<string>(); |
|||
oauthClientRootUrls.ForEach(url => |
|||
{ |
|||
oauthClientRedirectUrls.Add(url.EnsureEndsWith('/')); |
|||
oauthClientRedirectUrls.Add(url.EnsureEndsWith('/') + "signin-callback"); |
|||
oauthClientRedirectUrls.Add(url.EnsureEndsWith('/') + "swagger/oauth2-redirect.html"); |
|||
|
|||
oauthClientPostLogoutRedirectUrls.Add(url.EnsureEndsWith('/')); |
|||
oauthClientPostLogoutRedirectUrls.Add(url.EnsureEndsWith('/') + "signout-callback"); |
|||
}); |
|||
|
|||
await CreateOrUpdateApplicationAsync( |
|||
OpenIddictConstants.ApplicationTypes.Web, |
|||
oauthClientId, |
|||
OpenIddictConstants.ClientTypes.Public, |
|||
OpenIddictConstants.ConsentTypes.Implicit, |
|||
"Abp OAuth Client", |
|||
null, |
|||
[OpenIddictConstants.GrantTypes.AuthorizationCode, |
|||
OpenIddictConstants.GrantTypes.RefreshToken, |
|||
"link_user", |
|||
"impersonation"], |
|||
[OpenIddictConstants.Scopes.OpenId, |
|||
OpenIddictConstants.Scopes.Email, |
|||
OpenIddictConstants.Scopes.Roles, |
|||
OpenIddictConstants.Scopes.Address, |
|||
OpenIddictConstants.Scopes.Phone, |
|||
OpenIddictConstants.Scopes.Profile, |
|||
OpenIddictConstants.Scopes.OfflineAccess, |
|||
scope, |
|||
"api-gateway", |
|||
"auth-server", |
|||
"admin-service", |
|||
"ai-service", |
|||
"identity-service", |
|||
"localization-service", |
|||
"message-service", |
|||
"platform-service", |
|||
"task-service", |
|||
"webhook-service", |
|||
"wechat-service", |
|||
"workflow-service"], |
|||
oauthClientRedirectUrls, |
|||
oauthClientPostLogoutRedirectUrls); |
|||
|
|||
var oauthClientPermissions = new string[1] |
|||
{ |
|||
"AbpIdentity.UserLookup" |
|||
}; |
|||
await PermissionDataSeeder.SeedAsync(ClientPermissionValueProvider.ProviderName, oauthClientId, oauthClientPermissions); |
|||
} |
|||
} |
|||
|
|||
private async Task CreateServiceScopeAsync( |
|||
string name, |
|||
string displayNameDefault, |
|||
string displayNameZh, |
|||
string displayNameEn, |
|||
string descriptionDefault, |
|||
string descriptionZh, |
|||
string descriptionEn, |
|||
List<string>? resources = null) |
|||
{ |
|||
var descriptor = new OpenIddictScopeDescriptor |
|||
{ |
|||
Name = name, |
|||
DisplayName = displayNameDefault, |
|||
DisplayNames = |
|||
{ |
|||
[CultureInfo.GetCultureInfo("zh-Hans")] = displayNameZh, |
|||
[CultureInfo.GetCultureInfo("en")] = displayNameEn |
|||
}, |
|||
Description = descriptionDefault, |
|||
Descriptions = |
|||
{ |
|||
[CultureInfo.GetCultureInfo("zh-Hans")] = descriptionZh, |
|||
[CultureInfo.GetCultureInfo("en")] = descriptionEn |
|||
}, |
|||
}; |
|||
if (resources is { Count: > 0 }) |
|||
{ |
|||
descriptor.Resources.AddIfNotContains(resources); |
|||
} |
|||
|
|||
await CreateScopesAsync(descriptor); |
|||
} |
|||
} |
|||
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue