Browse Source

Merge pull request #1596 from colinin/optimize-microservice-project

feat: Optimize the microservice project
pull/1626/head
yx lin 2 months ago
committed by GitHub
parent
commit
7bad9db708
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 6
      .dockerignore
  2. 398
      README.en.md
  3. 327
      README.md
  4. 2
      apps/vben5/packages/@abp/notifications/src/components/send-records/NotificationSendRecordTable.vue
  5. 73
      aspnet-core/LINGYUN.MicroService.All.slnx
  6. 23
      aspnet-core/cleanup-logs.bat
  7. 13
      aspnet-core/create-database.bat
  8. 18
      aspnet-core/delete-bin-obj.bat
  9. 20
      aspnet-core/ef-update.ps1
  10. 25
      aspnet-core/framework/settings/LINGYUN.Abp.Settings/Volo/Abp/Settings/LocalizableValue.cs
  11. 13
      aspnet-core/framework/settings/LINGYUN.Abp.Settings/Volo/Abp/Settings/SettingDefinitionExtensions.cs
  12. 2
      aspnet-core/framework/settings/LINGYUN.Abp.Settings/Volo/Abp/Settings/SettingResourceDefinition.cs
  13. 12
      aspnet-core/migrate-database.bat
  14. 31
      aspnet-core/migrate-db-cmd.bat
  15. 54
      aspnet-core/migrations/LINGYUN.Abp.MicroService.AIService.DbMigrator/AIServiceDbMigratorHostedService.cs
  16. 14
      aspnet-core/migrations/LINGYUN.Abp.MicroService.AIService.DbMigrator/AIServiceDbMigratorModule.cs
  17. 32
      aspnet-core/migrations/LINGYUN.Abp.MicroService.AIService.DbMigrator/LINGYUN.Abp.MicroService.AIService.DbMigrator.csproj
  18. 43
      aspnet-core/migrations/LINGYUN.Abp.MicroService.AIService.DbMigrator/Program.cs
  19. 75
      aspnet-core/migrations/LINGYUN.Abp.MicroService.AIService.DbMigrator/appsettings.json
  20. 27
      aspnet-core/migrations/LINGYUN.Abp.MicroService.AIService.EntityFrameworkCore/AIServiceDataSeeder.cs
  21. 45
      aspnet-core/migrations/LINGYUN.Abp.MicroService.AIService.EntityFrameworkCore/AIServiceDbMigrationEventHandler.cs
  22. 37
      aspnet-core/migrations/LINGYUN.Abp.MicroService.AIService.EntityFrameworkCore/AIServiceDbMigrationService.cs
  23. 35
      aspnet-core/migrations/LINGYUN.Abp.MicroService.AIService.EntityFrameworkCore/AIServiceMigrationsDbContext.cs
  24. 29
      aspnet-core/migrations/LINGYUN.Abp.MicroService.AIService.EntityFrameworkCore/AIServiceMigrationsDbContextFactory.cs
  25. 44
      aspnet-core/migrations/LINGYUN.Abp.MicroService.AIService.EntityFrameworkCore/AIServiceMigrationsEntityFrameworkCoreModule.cs
  26. 0
      aspnet-core/migrations/LINGYUN.Abp.MicroService.AIService.EntityFrameworkCore/FodyWeavers.xml
  27. 30
      aspnet-core/migrations/LINGYUN.Abp.MicroService.AIService.EntityFrameworkCore/FodyWeavers.xsd
  28. 34
      aspnet-core/migrations/LINGYUN.Abp.MicroService.AIService.EntityFrameworkCore/LINGYUN.Abp.MicroService.AIService.EntityFrameworkCore.csproj
  29. 383
      aspnet-core/migrations/LINGYUN.Abp.MicroService.AIService.EntityFrameworkCore/Migrations/20261007004411_Initial-AI-Service.Designer.cs
  30. 219
      aspnet-core/migrations/LINGYUN.Abp.MicroService.AIService.EntityFrameworkCore/Migrations/20261007004411_Initial-AI-Service.cs
  31. 380
      aspnet-core/migrations/LINGYUN.Abp.MicroService.AIService.EntityFrameworkCore/Migrations/AIServiceMigrationsDbContextModelSnapshot.cs
  32. 55
      aspnet-core/migrations/LINGYUN.Abp.MicroService.AdminService.DbMigrator/AdminServiceDbMigratorHostedService.cs
  33. 4
      aspnet-core/migrations/LINGYUN.Abp.MicroService.AdminService.DbMigrator/AdminServiceDbMigratorModule.Configure.cs
  34. 57
      aspnet-core/migrations/LINGYUN.Abp.MicroService.AdminService.DbMigrator/AdminServiceDbMigratorModule.cs
  35. 72
      aspnet-core/migrations/LINGYUN.Abp.MicroService.AdminService.DbMigrator/LINGYUN.Abp.MicroService.AdminService.DbMigrator.csproj
  36. 40
      aspnet-core/migrations/LINGYUN.Abp.MicroService.AdminService.DbMigrator/Program.cs
  37. 11
      aspnet-core/migrations/LINGYUN.Abp.MicroService.AdminService.DbMigrator/Properties/launchSettings.json
  38. 98
      aspnet-core/migrations/LINGYUN.Abp.MicroService.AdminService.DbMigrator/README.EN.md
  39. 98
      aspnet-core/migrations/LINGYUN.Abp.MicroService.AdminService.DbMigrator/README.md
  40. 7
      aspnet-core/migrations/LINGYUN.Abp.MicroService.AdminService.DbMigrator/Usings.cs
  41. 75
      aspnet-core/migrations/LINGYUN.Abp.MicroService.AdminService.DbMigrator/appsettings.json
  42. 61
      aspnet-core/migrations/LINGYUN.Abp.MicroService.AdminService.EntityFrameworkCore/AdminServiceDataSeeder.cs
  43. 45
      aspnet-core/migrations/LINGYUN.Abp.MicroService.AdminService.EntityFrameworkCore/AdminServiceDbMigrationEventHandler.cs
  44. 38
      aspnet-core/migrations/LINGYUN.Abp.MicroService.AdminService.EntityFrameworkCore/AdminServiceDbMigrationService.cs
  45. 43
      aspnet-core/migrations/LINGYUN.Abp.MicroService.AdminService.EntityFrameworkCore/AdminServiceMigrationsDbContext.cs
  46. 29
      aspnet-core/migrations/LINGYUN.Abp.MicroService.AdminService.EntityFrameworkCore/AdminServiceMigrationsDbContextFactory.cs
  47. 42
      aspnet-core/migrations/LINGYUN.Abp.MicroService.AdminService.EntityFrameworkCore/AdminServiceMigrationsEntityFrameworkCoreModule.cs
  48. 0
      aspnet-core/migrations/LINGYUN.Abp.MicroService.AdminService.EntityFrameworkCore/FodyWeavers.xml
  49. 30
      aspnet-core/migrations/LINGYUN.Abp.MicroService.AdminService.EntityFrameworkCore/FodyWeavers.xsd
  50. 34
      aspnet-core/migrations/LINGYUN.Abp.MicroService.AdminService.EntityFrameworkCore/LINGYUN.Abp.MicroService.AdminService.EntityFrameworkCore.csproj
  51. 523
      aspnet-core/migrations/LINGYUN.Abp.MicroService.AdminService.EntityFrameworkCore/Migrations/20230109083613_Initial-Backend-Admin.Designer.cs
  52. 388
      aspnet-core/migrations/LINGYUN.Abp.MicroService.AdminService.EntityFrameworkCore/Migrations/20230109083613_Initial-Backend-Admin.cs
  53. 577
      aspnet-core/migrations/LINGYUN.Abp.MicroService.AdminService.EntityFrameworkCore/Migrations/20230304062910_Add-Text-Template-Definition.Designer.cs
  54. 50
      aspnet-core/migrations/LINGYUN.Abp.MicroService.AdminService.EntityFrameworkCore/Migrations/20230304062910_Add-Text-Template-Definition.cs
  55. 581
      aspnet-core/migrations/LINGYUN.Abp.MicroService.AdminService.EntityFrameworkCore/Migrations/20230304083526_Add-IsStatic-Field.Designer.cs
  56. 29
      aspnet-core/migrations/LINGYUN.Abp.MicroService.AdminService.EntityFrameworkCore/Migrations/20230304083526_Add-IsStatic-Field.cs
  57. 586
      aspnet-core/migrations/LINGYUN.Abp.MicroService.AdminService.EntityFrameworkCore/Migrations/20230323070528_Upgrade-Abp-Framework-To-7.1.0.Designer.cs
  58. 40
      aspnet-core/migrations/LINGYUN.Abp.MicroService.AdminService.EntityFrameworkCore/Migrations/20230323070528_Upgrade-Abp-Framework-To-7.1.0.cs
  59. 646
      aspnet-core/migrations/LINGYUN.Abp.MicroService.AdminService.EntityFrameworkCore/Migrations/20231028084002_Upgrade-Abp-Framework-To-7.4.0.Designer.cs
  60. 247
      aspnet-core/migrations/LINGYUN.Abp.MicroService.AdminService.EntityFrameworkCore/Migrations/20231028084002_Upgrade-Abp-Framework-To-7.4.0.cs
  61. 646
      aspnet-core/migrations/LINGYUN.Abp.MicroService.AdminService.EntityFrameworkCore/Migrations/20240218002657_Upgrade-Abp-Framework-To-8.0.3.Designer.cs
  62. 70
      aspnet-core/migrations/LINGYUN.Abp.MicroService.AdminService.EntityFrameworkCore/Migrations/20240218002657_Upgrade-Abp-Framework-To-8.0.3.cs
  63. 652
      aspnet-core/migrations/LINGYUN.Abp.MicroService.AdminService.EntityFrameworkCore/Migrations/20240413021854_Upgrade-Abp-Framework-To-8-1-0.Designer.cs
  64. 39
      aspnet-core/migrations/LINGYUN.Abp.MicroService.AdminService.EntityFrameworkCore/Migrations/20240413021854_Upgrade-Abp-Framework-To-8-1-0.cs
  65. 931
      aspnet-core/migrations/LINGYUN.Abp.MicroService.AdminService.EntityFrameworkCore/Migrations/20240515073346_Add-Data-Protected-Module.Designer.cs
  66. 179
      aspnet-core/migrations/LINGYUN.Abp.MicroService.AdminService.EntityFrameworkCore/Migrations/20240515073346_Add-Data-Protected-Module.cs
  67. 941
      aspnet-core/migrations/LINGYUN.Abp.MicroService.AdminService.EntityFrameworkCore/Migrations/20240515092715_Add-Allow-Properties.Designer.cs
  68. 42
      aspnet-core/migrations/LINGYUN.Abp.MicroService.AdminService.EntityFrameworkCore/Migrations/20240515092715_Add-Allow-Properties.cs
  69. 937
      aspnet-core/migrations/LINGYUN.Abp.MicroService.AdminService.EntityFrameworkCore/Migrations/20240527092536_Remote-Tenant-Id-With-Text-Template.Designer.cs
  70. 48
      aspnet-core/migrations/LINGYUN.Abp.MicroService.AdminService.EntityFrameworkCore/Migrations/20240527092536_Remote-Tenant-Id-With-Text-Template.cs
  71. 1051
      aspnet-core/migrations/LINGYUN.Abp.MicroService.AdminService.EntityFrameworkCore/Migrations/20250410015324_Upgrade-Abp-Framework-To-9-1-1.Designer.cs
  72. 127
      aspnet-core/migrations/LINGYUN.Abp.MicroService.AdminService.EntityFrameworkCore/Migrations/20250410015324_Upgrade-Abp-Framework-To-9-1-1.cs
  73. 1101
      aspnet-core/migrations/LINGYUN.Abp.MicroService.AdminService.EntityFrameworkCore/Migrations/20260420064540_Upgrade-Abp-Framework-To-10-0-2.Designer.cs
  74. 127
      aspnet-core/migrations/LINGYUN.Abp.MicroService.AdminService.EntityFrameworkCore/Migrations/20260420064540_Upgrade-Abp-Framework-To-10-0-2.cs
  75. 1101
      aspnet-core/migrations/LINGYUN.Abp.MicroService.AdminService.EntityFrameworkCore/Migrations/20260626032421_Fix-MySql-Index-Key-Too-Lang-For-Resource-Permission-Grant.Designer.cs
  76. 86
      aspnet-core/migrations/LINGYUN.Abp.MicroService.AdminService.EntityFrameworkCore/Migrations/20260626032421_Fix-MySql-Index-Key-Too-Lang-For-Resource-Permission-Grant.cs
  77. 1098
      aspnet-core/migrations/LINGYUN.Abp.MicroService.AdminService.EntityFrameworkCore/Migrations/AdminServiceMigrationsDbContextModelSnapshot.cs
  78. 67
      aspnet-core/migrations/LINGYUN.Abp.MicroService.AdminService.EntityFrameworkCore/README.EN.md
  79. 67
      aspnet-core/migrations/LINGYUN.Abp.MicroService.AdminService.EntityFrameworkCore/README.md
  80. 60
      aspnet-core/migrations/LINGYUN.Abp.MicroService.AuthServer.DbMigrator/AuthServerDbMigratorHostedService.cs
  81. 4
      aspnet-core/migrations/LINGYUN.Abp.MicroService.AuthServer.DbMigrator/AuthServerDbMigratorModule.Configure.cs
  82. 19
      aspnet-core/migrations/LINGYUN.Abp.MicroService.AuthServer.DbMigrator/AuthServerDbMigratorModule.cs
  83. 20
      aspnet-core/migrations/LINGYUN.Abp.MicroService.AuthServer.DbMigrator/AuthServerInitializeDataSeeder.cs
  84. 89
      aspnet-core/migrations/LINGYUN.Abp.MicroService.AuthServer.DbMigrator/DataSeeds/IdentityUserNotificationDataSeeder.cs
  85. 42
      aspnet-core/migrations/LINGYUN.Abp.MicroService.AuthServer.DbMigrator/LINGYUN.Abp.MicroService.AuthServer.DbMigrator.csproj
  86. 40
      aspnet-core/migrations/LINGYUN.Abp.MicroService.AuthServer.DbMigrator/Program.cs
  87. 11
      aspnet-core/migrations/LINGYUN.Abp.MicroService.AuthServer.DbMigrator/Properties/launchSettings.json
  88. 66
      aspnet-core/migrations/LINGYUN.Abp.MicroService.AuthServer.DbMigrator/README.EN.md
  89. 66
      aspnet-core/migrations/LINGYUN.Abp.MicroService.AuthServer.DbMigrator/README.md
  90. 7
      aspnet-core/migrations/LINGYUN.Abp.MicroService.AuthServer.DbMigrator/Usings.cs
  91. 35
      aspnet-core/migrations/LINGYUN.Abp.MicroService.AuthServer.DbMigrator/appsettings.json
  92. 36
      aspnet-core/migrations/LINGYUN.Abp.MicroService.AuthServer.EntityFrameworkCore/AuthServerDataSeeder.cs
  93. 47
      aspnet-core/migrations/LINGYUN.Abp.MicroService.AuthServer.EntityFrameworkCore/AuthServerDbMigrationEventHandler.cs
  94. 38
      aspnet-core/migrations/LINGYUN.Abp.MicroService.AuthServer.EntityFrameworkCore/AuthServerDbMigrationService.cs
  95. 31
      aspnet-core/migrations/LINGYUN.Abp.MicroService.AuthServer.EntityFrameworkCore/AuthServerMigrationsDbContext.cs
  96. 29
      aspnet-core/migrations/LINGYUN.Abp.MicroService.AuthServer.EntityFrameworkCore/AuthServerMigrationsDbContextFactory.cs
  97. 58
      aspnet-core/migrations/LINGYUN.Abp.MicroService.AuthServer.EntityFrameworkCore/AuthServerMigrationsEntityFrameworkCoreModule.cs
  98. 96
      aspnet-core/migrations/LINGYUN.Abp.MicroService.AuthServer.EntityFrameworkCore/DataSeeds/IdentityClaimTypeDataSeeder.cs
  99. 149
      aspnet-core/migrations/LINGYUN.Abp.MicroService.AuthServer.EntityFrameworkCore/DataSeeds/IdentityUserRoleDataSeeder.cs
  100. 437
      aspnet-core/migrations/LINGYUN.Abp.MicroService.AuthServer.EntityFrameworkCore/DataSeeds/OpenIddictDataSeeder.cs

6
.dockerignore

@ -0,0 +1,6 @@
**/.git
**/.vs
**/bin
**/obj
**/node_modules
*.user

398
README.en.md

@ -8,7 +8,7 @@ This is a [vue-vben-admin](https://github.com/anncwb/vue-vben-admin) -based Abp
## Build
[![Build](https://github.com/colinin/abp-next-admin/actions/workflows/build.yml/badge.svg)](https://github.com/colinin/abp-next-admin/actions/workflows/build.yml)
[![Build](https://github.com/colinin/abp-next-admin/actions/workflows/build.yml/badge.svg)](https://github.com/colinin/abp-next-admin/actions/workflows/build.yml) [![NuGet](https://img.shields.io/nuget/v/LINGYUN.Abp.Core.svg?style=flat-square)](https://www.nuget.org/packages/LINGYUN.Abp.Core)
## Deployment Options
@ -23,43 +23,44 @@ If you don't need a microservices architecture, you can choose the monolithic se
If you need higher scalability and a more flexible service architecture, you can choose the microservices deployment option.
## Quick Start
## Quick Start of a Microservice Project
### 0、Configurate hosts
windows: modify C:\Windows\System32\drivers\etc\hosts ;
linux: modify /etc/hosts;
add config:
### 0. Configure the hosts file
On Windows, modify C:\Windows\System32\drivers\etc\hosts ;
on Linux, modify /etc/hosts ;
add the following entry:
```
127.0.0.1 host.docker.internal
```
In linux, execute restart network command:
On Linux, restart the network after changing the hosts file:
```shell
/etc/init.d/network restart
```
### 1、Install cli
### 1. Install the dotnet tool
```shell
dotnet tool install --global LINGYUN.Abp.Cli
```
### 2、Install .NET Template
### 2. Install the .NET template
```shell
dotnet new --install LINGYUN.Abp.MicroService.Templates
```
### 3、Use cli create new project
### 3. Create a project with the CLI
```shell
# use sqlserver
# MyCompanyName you company name
# MyProjectName you project name
# MyPackageName you package name
# -o See: abp cli
# --dbms See: abp cli
# --cs See: abp cli
# --no-random-port See: abp cli
# Initialize a project with a sqlserver connection string
# MyCompanyName company name
# MyProjectName project name
# MyPackageName package name
# -o output to the specified directory, see abp cli
# --dbms specify the database provider, see abp cli
# --cs specify the database connection string, see abp cli
# --no-random-port do not use random ports (app port 5000, dapr listening port 3500 by default)
labp create MyCompanyName.MyProjectName -pk MyPackageName -o "D:\Project" --dbms sqlserver --cs "Server=127.0.0.1;Database=MyProject;User Id=sa;Password=123456" --no-random-port
cd D:\Project\host\MyPackageName.MyCompanyName.MyProjectName.HttpApi.Host
@ -74,7 +75,7 @@ In linux, execute restart network command:
### Feedback
* The author is not a freelancer and does not have much time to maintain the project. If there is a problem, please contact **colin.in@foxmail.com** by email
* The author is not a freelancer and does not have much time to maintain the project. If you have any problems, you can contact **colin.in@foxmail.com** by email
## Screenshots
@ -92,7 +93,7 @@ In linux, execute restart network command:
![Settings](./apps/vue/images/settings.png)
![Dynamic Manus](./apps/vue/images/menus.png)
![Dynamic Menus](./apps/vue/images/menus.png)
![Organization Unit](./apps/vue/images/organization-unit.png)
@ -100,13 +101,15 @@ In linux, execute restart network command:
## Related Projects
Backend projects
[abpframework/abp](https://github.com/abpframework/abp) (abp vNext)
[EasyAbp/Cap](https://github.com/EasyAbp/Abp.EventBus.CAP) (EasyAbp)
[DotNetCore/CAP](https://github.com/dotnetcore/CAP) (CAP)
Javascript version:
Frontend projects
[vue-vben-admin](https://github.com/anncwb/vue-vben-admin.git) (vue-vben-admin)
@ -123,163 +126,312 @@ Javascript version:
## Project Structure
```bash
├── mock/ # mock server & mock data
├── public # public static assets (directly copied)
│ │── favicon.ico # favicon
│ │── manifest.json # PWA config file
│ └── index.html # index.html template
├── src # main source code
│ ├── api # api service
│ ├── assets # module assets like fonts, images (processed by webpack)
│ ├── components # global components
│ ├── directives # global directives
│   ├── enums # global enums
│   ├── hooks # global hooks
│   ├── locales # locales
│   ├── layout # layouts
│ ├── router # router
│   ├── settings # global settings
│ ├── store # store
│ ├── utils # global utils
│ ├── views # views
│ ├── App.vue # main app component
│ ├── main.ts # app entry file
├── types # types
├── tests/ # tests
├── .env.xxx # env variable configuration
├── .eslintrc.js # eslint config
├── jest.config.js # jest unit test config
├── package.json # package.json
├── postcss.config.js # postcss config
├── tsconfig.json # typescript config
└── vite.config.js # vue vite config
```
## Project setup
With [yarn](https://yarnpkg.com/lang/en/) or [npm](https://www.npmjs.com/get-npm)
#### Install dependencies
### Frontend: apps/vben5 (a pnpm workspace + turbo monorepo)
```bash
yarn install
apps/vben5/
├── apps/ # Independently runnable UI applications
│ ├── app-antd/ # ABP business frontend (the one in use: pnpm dev:app / pnpm build:app)
│ ├── web-antd/ # Official vben antd demo application
│ ├── web-antdv-next/ # antdv-next demo application
│ ├── web-ele/ # Element Plus demo application
│ ├── web-naive/ # Naive UI demo application
│ └── web-tdesign/ # TDesign demo application
├── packages/
│ ├── @abp/ # ABP business module packages (27 in total)
│ │ ├── account/ # Account, external logins (third-party account binding)
│ │ ├── ai-management/ # AI management (workspaces, tools, agents)
│ │ ├── auditing/ # Audit logs and security logs
│ │ ├── blob-management/ # Object storage (containers, files)
│ │ ├── cache-management/ # Cache management
│ │ ├── components/ # Shared ABP business components
│ │ ├── core/ # ABP frontend core (request, permissions, menus, etc.)
│ │ ├── data-protection/ # Data protection (entity/field level access control)
│ │ ├── demo/ # Demo module
│ │ ├── features/ # Feature management
│ │ ├── gdpr/ # GDPR data export and deletion
│ │ ├── identity/ # Users, roles, organization units, sessions, login logs
│ │ ├── localization/ # Localization (languages, resources, texts)
│ │ ├── notifications/ # Notifications (definitions, my notifications, send records)
│ │ ├── openiddict/ # OpenIddict (applications, scopes, authorizations, tokens)
│ │ ├── oss/ # OSS/Blob file list
│ │ ├── permissions/ # Permission definitions and grants
│ │ ├── platform/ # Platform (layouts, menus, data dictionaries, email/SMS)
│ │ ├── request/ # HTTP request wrapper (token, error handling, tenant header)
│ │ ├── saas/ # Tenants and editions
│ │ ├── settings/ # Setting definitions and values
│ │ ├── signalr/ # SignalR real-time communication
│ │ ├── tasks/ # Background tasks (job management)
│ │ ├── text-templating/ # Text templates
│ │ ├── ui/ # ABP frontend UI component library
│ │ ├── webhooks/ # Webhook definitions, subscriptions and send attempts
│ │ └── wechat/ # WeChat (official account, WeCom, etc.)
│ ├── @core/ # Core: base / ui-kit / forward
│ ├── effects/ # Shared capabilities: plugins / hooks / common-ui, etc.
│ ├── icons/ types/ # Icons and type definitions
│ └── ... # The remaining shared packages (see pnpm-workspace.yaml)
├── internal/ # Engineering configuration: vite-config / lint-configs / tailwind-config / tsconfig / node-utils
├── docs/ # VitePress documentation
├── playground/ # Component and example playground
├── scripts/ # Cleanup, build and deployment scripts
├── package.json # Root scripts: dev / dev:app / build:app / lint / format / test:unit / check:type
├── pnpm-workspace.yaml # Workspace layout and dependency catalog
├── turbo.json # turbo pipeline configuration
└── vitest.config.ts # Unit test (vitest) configuration
```
### Custom vue project config
Modify the server address that the development environment will use for the proxy. Provide the following three addresses: IdentityService, IdentityServer, and ApiService
### Backend: aspnet-core and the surrounding directories
```bash
VITE_PROXY = [["/connect","http://127.0.0.1:44385"],["/api","http://127.0.0.1:30000"],["/signalr-hubs","ws://127.0.0.1:30000"]]
.
├── aspnet-core/
│ ├── services/ # Service hosts (each with its own Dockerfile)
│ │ ├── LINGYUN.Abp.MicroService.AuthServer/ # Auth server (STS, 44385)
│ │ ├── LINGYUN.Abp.MicroService.IdentityService/ # Identity service (30015)
│ │ ├── LINGYUN.Abp.MicroService.AdminService/ # Admin service (30010)
│ │ ├── LINGYUN.Abp.MicroService.LocalizationService/# Localization service (30030)
│ │ ├── LINGYUN.Abp.MicroService.PlatformService/ # Platform service (30025)
│ │ ├── LINGYUN.Abp.MicroService.MessageService/ # Message service (30020)
│ │ ├── LINGYUN.Abp.MicroService.TaskService/ # Task service (30040)
│ │ ├── LINGYUN.Abp.MicroService.WebhookService/ # Webhook service (30045)
│ │ ├── LINGYUN.Abp.MicroService.WorkflowService/ # Workflow service (30050)
│ │ ├── LINGYUN.Abp.MicroService.WeChatService/ # WeChat service (30060)
│ │ ├── LINGYUN.Abp.MicroService.AIService/ # AI service (30070)
│ │ ├── LY.MicroService.Applications.Single/ # Monolith (30000, gateway and all modules merged)
│ │ ├── LY.MicroService.IdentityServer/ # IdentityServer based services and hosts
│ │ ├── LINGYUN.Abp.Applications/ LY.AIO.Applications.Single/ # Other hosts
│ │ └── Publish/ # Publish output directory (used by the container image builds)
│ ├── modules/ # Business modules, each layered by DDD (Domain / Application / EntityFrameworkCore / HttpApi ...)
│ │ ├── account/ # Account and sign-in (OpenIddict/IdentityServer web integration, captcha)
│ │ ├── identity/ # Users, roles, organization units, sessions, login logs
│ │ ├── identityServer/ # IdentityServer4 based implementation
│ │ ├── openIddict/ # OpenIddict server (applications, scopes, tokens, Portal, QR code, SMS, WeChat)
│ │ ├── permissions-management/ # Permission management and grants
│ │ ├── saas/ # Multi-tenancy and editions
│ │ ├── settings/ feature-management/ # Settings and features
│ │ ├── localization-management/ text-templating/ # Localization and text templates
│ │ ├── auditing/ data-protection/ gdpr/ captcha/ # Auditing, data protection, GDPR, captcha
│ │ ├── blob-management/ caching-management/ # Object storage and cache management
│ │ ├── platform/ project/ system-info/ demo/ # Platform, project, system info, demo
│ │ ├── realtime-message/ realtime-notifications/ # Instant messaging and real-time notifications
│ │ ├── task-management/ rules-management/ webhooks/ # Background tasks, rules engine, webhooks
│ │ ├── ai/ elsa/ # AI capabilities and workflow (Elsa)
│ ├── framework/ # Base framework packages (33 groups), the most used ones:
│ │ ├── common/ core packages (LINGYUN.Abp.Core, CAP, Hangfire, BlobStoring, SignalR ...)
│ │ ├── security/ authentication/ authorization/ # Security, sign-in methods, authorization
│ │ ├── auditing/ logging/ telemetry/ # Auditing, logging, tracing (OpenTelemetry/SkyWalking)
│ │ ├── multi-tenancy: tenants/ # Multi-tenancy and editions
│ │ ├── wechat/ wx-pusher/ pushplus/ tui-juhe/ # WeChat and message push
│ │ ├── cloud-aliyun/ cloud-tencent/ # Aliyun and Tencent Cloud integration
│ │ ├── dapr/ elasticsearch/ efcore/ data-protection/ # Dapr, Elasticsearch, EF Core, data protection
│ │ ├── dynamic-queryable/ dynamic-definition/ exporter/ # Dynamic query, dynamic definitions, import/export
│ │ ├── localization/ settings/ features/ mvc/ open-api/ cli/ ... # Other base packages
│ ├── migrations/ # DbMigrator and EntityFrameworkCore migration projects of each service (run by deploy.ps1)
│ ├── aspire/ # .NET Aspire: LINGYUN.Abp.MicroService.AppHost and the Aspire hosts of each service
│ ├── templates/ # dotnet new project templates (micro / aio)
│ ├── tests/ # Unit test projects
│ ├── LINGYUN.MicroService.All.slnx # Full solution
│ ├── LINGYUN.MicroService.Aspire.slnx # Aspire solution
│ └── LINGYUN.MicroService.SingleProject.slnx # Monolith solution
├── gateways/
│ ├── internal/ # Internal gateway (YARP): Internal.Gateway / OpenApi.Gateway + yarp*.json routes
│ └── web/ # Web gateway: LY.MicroService.ApiGateway
├── apps/ # Frontend: vben5 (current) / vue (legacy)
├── build/ # Build and migration scripts: build-aspnetcore-ef-update.ps1, build-aspnetcore-docker-build.ps1 ...
├── deploy/ # One-click deployment script (deploy.ps1), middleware data and service log directories
├── docs/ # Documentation (monolith startup guide, etc.)
├── docker-compose.yml # Backend service orchestration
├── docker-compose.override.yml # Image tags, volumes and startup order
├── docker-compose.override.configuration.yml # Environment variables of each service (connection strings, CAP, Redis, Elasticsearch, ...)
├── docker-compose.middleware.yml # Middleware: MySQL/Redis/RabbitMQ/Elasticsearch/Kibana/Logstash/OpenObserve
├── docker-compose.override.agile.yml # AgileConfig configuration center (optional)
├── Directory.Build.props Directory.Packages.props NuGet.Config common.props # Shared build and package version management
└── README.md README.en.md RELEASE.md LICENSE # Documentation and license
```
Modify the actual address of the production environment, as above
## Starting the Project
```bash
# STS Connect
# token issue
VITE_GLOB_AUTHORITY='http://127.0.0.1:44385'
# client id
VITE_GLOB_CLIENT_ID='vue-admin-element'
# client secret
VITE_GLOB_CLIENT_SECRET='1q2w3e*'
```
Three startup options are provided; choose the one that fits your needs:
### EntityFramework migration
| Option | Description | Middleware | Frontend |
| --- | --- | --- | --- |
| Option 1: Microservices | Full microservices architecture, all backends run as containers | Must **start first**: `docker-compose.middleware.yml` | Start vben5 separately |
| Option 2: Aspire | AppHost orchestrates a local microservices development environment | AppHost creates the containers automatically (PostgreSQL/Redis/RabbitMQ/Elasticsearch/Kibana) | Started automatically by AppHost |
| Option 3: Monolith | Gateway, authentication and business modules merged into a single process | Must **start first**: `docker-compose.middleware.yml` | Start vben5 separately |
Please switch to the service project startup directory and execute the **dotnet EF ** command for database migration
### Prerequisites
example:
- **.NET SDK 10** (`dotnet --version`)
- **Docker / Docker Compose** (middleware for options 1 and 3; option 2 also relies on Docker for its middleware containers)
- **Node.js 20+ and pnpm** (the frontend lives in `apps/vben5`, a pnpm monorepo; `preinstall` runs `only-allow pnpm`)
- **hosts**: on Windows edit `C:\Windows\System32\drivers\etc\hosts`, on Linux edit `/etc/hosts`, and add the following entry
```
127.0.0.1 host.docker.internal
```
(containers reach the middleware on the host through `extra_hosts: host.docker.internal:host-gateway`)
``` shell
---
cd aspnet-core/services/admin/LINGYUN.BackendAdminApp.Host
### Option 1: Microservices
dotnet ef database update
#### 1) One-click startup: deploy/deploy.ps1
```powershell
cd ./deploy
powershell -ExecutionPolicy Bypass -File .\deploy.ps1
```
- You can also use quick migration script files: **./build/build-aspnetcore-ef-update.ps1**
The script performs the following steps (see `deploy/deploy.ps1`):
### Configure the RabbitMQ
1. Starts the middleware: `docker-compose -f .\docker-compose.middleware.yml -p labp up -d --build` (MySQL, Redis, RabbitMQ, Elasticsearch, Kibana, Logstash, OpenObserve)
2. Waits 30 seconds for MySQL initialization to complete
3. Runs the 8 database migration projects one by one (`dotnet run --no-build`, **so the backend must have been built before running the script**)
4. Builds the 12 backend images (`labp-*-service:10.6.0`)
5. Starts the backend: `docker-compose -f .\docker-compose.yml -f .\docker-compose.override.yml -f .\docker-compose.override.configuration.yml -p labp up -d`
6. Runs `pnpm dev:app` under `apps/vben5` to start the frontend
Therefore project design for the micro service architecture, with the method of distributed event, communication between project USES is [DotNetCore/CAP](https://github.com/dotnetcore/CAP)
Notes:
The communication mode is **RabbitMQ Server**, so you need to install **RabbitMQ** in advance. Please refer to the official website for the specific installation mode
- The script must be executed in the **deploy directory** (it uses relative paths internally).
- The script calls `docker-compose` (Compose V1 command); if only the Compose V2 plugin is installed on your machine, replace `docker-compose` with `docker compose` in the script.
- The script does not include AgileConfig (`docker-compose.override.agile.yml`); all configuration comes from `docker-compose.override.configuration.yml`.
#### 2) Manual startup (equivalent to the script; make sure the middleware is started first)
```powershell
# 1) Start the middleware (must be first)
docker-compose -f .\docker-compose.middleware.yml -p labp up -d
# On the first run, wait at least 30 seconds so that MySQL can execute the init scripts under deploy/mysql/docker-entrypoint-initdb.d
Then you need to change the **CAP:RabbitMQ** configuration in the configuration file to set it to your own defined configuration. The **rabbitmq_management** plug-in is recommended for quick management of **RabbitMQ**
# 2) Database migration: use the migration script (it runs dotnet run for each of the 8 *.DbMigrator projects under aspnet-core/migrations, and builds automatically)
cd .\build
.\build-aspnetcore-ef-update.ps1
# 3) Build the backend images: produces the 12 labp-*-service:10.6.0 images (the tags must match the image values in docker-compose.override.yml)
.\build-aspnetcore-docker-build.ps1
### Compiles background services
# 4) Start the backend (all three compose files are required)
docker-compose -f .\docker-compose.yml -f .\docker-compose.override.yml -f .\docker-compose.override.configuration.yml -p labp up -d
```shell
cd aspnet-core/services
# 5) Start the frontend
cd .\apps\vben5
pnpm install
pnpm dev:app
```
Notes on the manual steps:
start-all-service.bat
- Both scripts in steps 2 and 3 must be executed in the **build directory** (they reference `./build-aspnetcore-common.ps1` relatively).
- `build-aspnetcore-ef-update.ps1` uses `dotnet run` internally (it builds first, then runs), so the manual flow does **not** require a pre-built backend; the one-click `deploy.ps1` uses `dotnet run --no-build`, so the backend must be built before running it.
- To migrate only a single service, run it from its own directory, for example:
```powershell
cd .\aspnet-core\migrations\LINGYUN.Abp.MicroService.AuthServer.DbMigrator
dotnet run
```
#### 3) Endpoints
| Component | Address |
| --- | --- |
| Frontend (vben5, `@abp/app-antd`) | http://localhost:5666 |
| API Gateway | http://localhost:30000 |
| Auth Server (STS) | http://localhost:44385 |
| Identity / Admin / Platform / Message / Localization | 30015 / 30010 / 30025 / 30020 / 30030 |
| Task / Webhook / Workflow / WeChat / AI | 30040 / 30045 / 30050 / 30060 / 30070 |
| Kibana | http://localhost:5601 |
| RabbitMQ management | http://localhost:15672 (admin / 123456) |
| MySQL | localhost:3306 (root / 123456, database `abp`) |
| Redis | localhost:6379 |
| OpenObserve console | http://localhost:5080 (admin@abp.io / ww1Z5L%6) |
### Option 2: Aspire
The AppHost brings up its own middleware containers (PostgreSQL, Redis, RabbitMQ, Elasticsearch, Kibana), automatically runs the database migration projects of each service in the Development environment, and automatically starts the vben5 frontend with `pnpm dev:app`, so there is **no need** to start `docker-compose.middleware.yml` as well.
```powershell
cd ./aspnet-core/aspire/LINGYUN.Abp.MicroService.AppHost
aspire run
```
#### Compiles and hot-reloads for development
- The Aspire CLI must be installed (the version must match the AppHost's `Aspire.AppHost.Sdk` 13.x): `dotnet tool install --global Aspire.Cli`; if you prefer not to install the CLI, you can simply run `dotnet run --project .\LINGYUN.Abp.MicroService.AppHost.csproj`.
- Docker must be running, and `apps/vben5` must already have run `pnpm install` (the AppHost runs `pnpm dev:app`, and the frontend port is fixed at 5666).
- After startup the terminal prints the Aspire Dashboard address, where you can inspect resource status, logs and traces.
- The host ports used by the AppHost fully overlap with the middleware of option 1 (6379/9200/5601/5672/15672/5432, etc.) — **do not run it at the same time as the option 1 middleware**.
```shell
### Option 3: Monolith
cd apps/vue
The monolith merges the gateway, authentication and all business modules into a single process, but it **still depends on the middleware, so the middleware must be started first**:
yarn dev
```powershell
# 1) Start the middleware
docker-compose -f .\docker-compose.middleware.yml -p labp up -d
# On the first run, wait at least 30 seconds
# 2) Start the monolith
cd .\aspnet-core\services\LY.MicroService.Applications.Single
dotnet run --launch-profile Single.MySql.Dev
# 3) Start the frontend
cd .\apps\vben5
pnpm install
pnpm dev:app
```
#### Compiles and minifies for production
- Default address **http://localhost:30000**: both `App:SelfUrl` and `AuthServer:Authority` point to it, so the token endpoint and the API share the same port.
- **Specify the profile explicitly**: without `--launch-profile`, `dotnet run` uses the first profile in `launchSettings.json` (currently `Single.PostgreSql.Dev`). With the default database (MySQL) use `Single.MySql.Dev`; the other options are `Single.PostgreSql.Dev` and `Single.SqlServer.Dev`.
- The connection strings of each database can be found in `appsettings.Development.MySql.json` / `appsettings.Development.PostgreSql.json` / `appsettings.Development.SqlServer.json`.
```bash
yarn run build
```
### Troubleshooting
### About Docker container
- **`docker-compose` command not found**: the scripts use the Compose V1 command; if only Compose V2 is installed, use `docker compose` instead.
- **Image `labp-*-service:10.6.0` not found**: `docker-compose.override.yml` references pre-built images through `image:`, so run `build/build-aspnetcore-docker-build.ps1` first (option 1, manual startup, step 3).
- **One-click migration fails (`dotnet run --no-build`)**: `deploy.ps1` uses `--no-build` internally, so the backend must be built before running the script (`dotnet build .\aspnet-core\LINGYUN.MicroService.All.slnx`); for manual migration use **build/build-aspnetcore-ef-update.ps1** instead (it uses `dotnet run` and builds automatically).
- **Frontend dependency installation fails**: `apps/vben5` enforces pnpm (`preinstall` runs `only-allow pnpm`), so use `pnpm install` / `pnpm dev:app`.
- **Containers cannot reach the middleware on the host**: make sure the hosts file contains `127.0.0.1 host.docker.internal`.
**Step 1**: Building background services, powershell script: **./build/build-aspnetcore-release.ps1**, **Warning: after the release of service need configuration file: appsettings.Production.json**
---
**Step 2**: Build the front-end, **./build/build-vue-apps.ps1**
### Lints and fixes files
**Step 3**: Build after the release of the address of the default in **./aspnet-core/services/Publish**, change nginx proxy server address: **./client/docker/nginx/default.conf**
Run the following in `apps/vben5` (vben5 enforces pnpm):
**Step 4**: Run command **sudo docker-compose down && sudo docker-compose -f docker-compose.yml -f docker-compose.override.yml up --build -d**
```bash
cd apps/vben5
**Using A CI tool such as Jenkins is recommended to simplify this into a single step**
# lint
pnpm lint
#### Lints and fixes files
# auto-fix
pnpm format
```bash
yarn lint:eslint
# type check
pnpm check:type
```
#### Run your unit tests
### Run your unit tests
```bash
yarn run test:unit
```
cd apps/vben5
pnpm test:unit
```
## How to contribute
You are very welcome to join!Raise an issue Or submit a Pull Request。
You are very welcome to join! Raise an issue or submit a Pull Request.
**Pull Request:**
1. Fork code!
1. Fork the code!
2. Create your own branch: `git checkout -b feat/xxxx`
3. Submit your changes: `git commit -am 'feat(function): add xxxxx'`
4. Push your branch: `git push origin feat/xxxx`
5. submit`pull request`
5. Submit a `pull request`
## Git Contribution submission specification
- reference [vue](./apps/vue/.github/COMMIT_CONVENTION.md) specification ([Angular](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-angular))
- Reference the [vue](./apps/vue/.github/COMMIT_CONVENTION.md) specification ([Angular](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-angular))
- `feat` Add new features
- `fix` Fix the problem/BUG
@ -295,18 +447,6 @@ You are very welcome to join!Raise an issue Or submit a Pull Request。
- `types` Type definition file changes
- `wip` In development
## Related warehouse
If these plugins are helpful to you, you can give a star support
- [vite-plugin-mock](https://github.com/anncwb/vite-plugin-mock) - Used for local and development environment data mock
- [vite-plugin-html](https://github.com/anncwb/vite-plugin-html) - Used for html template conversion and compression
- [vite-plugin-style-import](https://github.com/anncwb/vite-plugin-style-import) - Used for component library style introduction on demand
- [vite-plugin-theme](https://github.com/anncwb/vite-plugin-theme) - Used for online switching of theme colors and other color-related configurations
- [vite-plugin-imagemin](https://github.com/anncwb/vite-plugin-imagemin) - Used to pack compressed image resources
- [vite-plugin-compression](https://github.com/anncwb/vite-plugin-compression) - Used to pack input .gz|.brotil files
- [vite-plugin-svg-icons](https://github.com/anncwb/vite-plugin-svg-icons) - Used to quickly generate svg sprite
## Browser support
The `Chrome 80+` browser is recommended for local development
@ -318,11 +458,11 @@ Support modern browsers, not IE
| not support | last 2 versions | last 2 versions | last 2 versions | last 2 versions |
## License
[MIT License](./LICENSE)
## Thanks
![JetBrains Logo (Main) logo](https://resources.jetbrains.com/storage/products/company/brand/logos/jb_beam.png)
![JetBrains Logo (Main) logo](https://resources.jetbrains.com/storage/products/company/brand/logos/jb_beam.svg)

327
README.md

@ -125,148 +125,295 @@ linux下,修改完hosts后需要重启网络,在shell中执行:
## 目录结构
本项目已经为你生成了一个完整的开发框架,提供了涵盖后台开发的各类功能和坑位,下面是整个项目的目录结构。
### 前端:apps/vben5(pnpm workspace + turbo 的 monorepo)
```bash
├── mock # mock 服务器 与 模拟数据
├── public # 静态资源 (会被直接复制)
│ │── favicon.ico # favicon图标
│ │── manifest.json # PWA 配置文件
│   └── index.html # html模板
├── src # 源代码
│   ├── api # 所有请求
│   ├── assets # 主题 字体等静态资源 (由 webpack 处理加载)
│   ├── components # 全局组件
│   ├── directive # 全局指令
│   ├── enums # 全局枚举
│   ├── hooks # 全局hooks
│   ├── locales # 国际化
│   ├── layout # 全局布局
│   ├── router # 路由
│   ├── settings # 全局 配置
│   ├── store # 全局 vuex store
│   ├── utils # 全局方法
│   ├── views # 所有页面
│   ├── App.vue # 入口页面
│   └── main.js # 入口文件 加载组件 初始化等
├── types # ts类型
├── tests # 测试
├── .env.xxx # 环境变量配置
├── .eslintrc.js # eslint 配置
├── jest.config.js # jest 单元测试配置
├── package.json # package.json 依赖
├── postcss.config.js # postcss 配置
├── tsconfig.json # typescript 配置
└── vite.config.js # vue vite 配置
apps/vben5/
├── apps/ # 可独立运行的 UI 应用
│ ├── app-antd/ # ABP 业务前端(当前使用:pnpm dev:app / pnpm build:app)
│ ├── web-antd/ # vben 官方 antd 示例应用
│ ├── web-antdv-next/ # antdv-next 示例应用
│ ├── web-ele/ # Element Plus 示例应用
│ ├── web-naive/ # Naive UI 示例应用
│ └── web-tdesign/ # TDesign 示例应用
├── packages/
│ ├── @abp/ # ABP 业务模块包(27 个)
│ │ ├── account/ # 账户、外部登录(第三方账号绑定)
│ │ ├── ai-management/ # AI 管理(工作区、工具、智能体)
│ │ ├── auditing/ # 审计日志、安全日志
│ │ ├── blob-management/ # 对象存储(容器、文件)
│ │ ├── cache-management/ # 缓存管理
│ │ ├── components/ # ABP 前端通用业务组件
│ │ ├── core/ # ABP 前端核心(请求、权限、菜单等基础能力)
│ │ ├── data-protection/ # 数据保护(实体/字段级访问控制)
│ │ ├── demo/ # 示例模块
│ │ ├── features/ # 特性(Feature)管理
│ │ ├── gdpr/ # GDPR 数据导出与删除
│ │ ├── identity/ # 用户、角色、组织机构、会话、登录日志
│ │ ├── localization/ # 本地化(语言、资源、文本)
│ │ ├── notifications/ # 通知(通知定义、我的通知、发送记录)
│ │ ├── openiddict/ # OpenIddict(应用、作用域、授权、令牌)
│ │ ├── oss/ # OSS/Blob 文件列表
│ │ ├── permissions/ # 权限定义与授权
│ │ ├── platform/ # 平台(布局、菜单、数据字典、邮件/短信)
│ │ ├── request/ # HTTP 请求封装(令牌、错误处理、租户头)
│ │ ├── saas/ # 租户与版本(Edition)
│ │ ├── settings/ # 设置定义与设置值
│ │ ├── signalr/ # SignalR 实时通信
│ │ ├── tasks/ # 后台任务(作业管理)
│ │ ├── text-templating/ # 文本模板
│ │ ├── ui/ # ABP 前端 UI 组件库
│ │ ├── webhooks/ # Webhook 定义、订阅与发送记录
│ │ └── wechat/ # 微信(公众号、企业微信等)
│ ├── @core/ # 内核:base / ui-kit / forward
│ ├── effects/ # 通用能力:plugins / hooks / common-ui 等
│ ├── icons/ types/ # 图标、类型定义
│ └── ... # 其余公共包(见 pnpm-workspace.yaml)
├── internal/ # 工程化配置:vite-config / lint-configs / tailwind-config / tsconfig / node-utils
├── docs/ # VitePress 文档
├── playground/ # 组件与示例演练场
├── scripts/ # 清理、构建、部署等脚本
├── package.json # 根脚本:dev / dev:app / build:app / lint / format / test:unit / check:type
├── pnpm-workspace.yaml # workspace 划分与依赖 catalog
├── turbo.json # turbo 流水线配置
└── vitest.config.ts # 单元测试(vitest)配置
```
## 如何设置以及启动项目
### 安装依赖
### 后端:aspnet-core 与配套目录
```bash
yarn install
.
├── aspnet-core/
│ ├── services/ # 各服务宿主(含 Dockerfile)
│ │ ├── LINGYUN.Abp.MicroService.AuthServer/ # 认证服务(STS,44385)
│ │ ├── LINGYUN.Abp.MicroService.IdentityService/ # 身份服务(30015)
│ │ ├── LINGYUN.Abp.MicroService.AdminService/ # 管理服务(30010)
│ │ ├── LINGYUN.Abp.MicroService.LocalizationService/# 本地化服务(30030)
│ │ ├── LINGYUN.Abp.MicroService.PlatformService/ # 平台服务(30025)
│ │ ├── LINGYUN.Abp.MicroService.MessageService/ # 消息服务(30020)
│ │ ├── LINGYUN.Abp.MicroService.TaskService/ # 任务服务(30040)
│ │ ├── LINGYUN.Abp.MicroService.WebhookService/ # Webhook 服务(30045)
│ │ ├── LINGYUN.Abp.MicroService.WorkflowService/ # 工作流服务(30050)
│ │ ├── LINGYUN.Abp.MicroService.WeChatService/ # 微信服务(30060)
│ │ ├── LINGYUN.Abp.MicroService.AIService/ # AI 服务(30070)
│ │ ├── LY.MicroService.Applications.Single/ # 单体应用(30000,合并网关与全部模块)
│ │ ├── LY.MicroService.IdentityServer/ # IdentityServer 版本服务与宿主
│ │ ├── LINGYUN.Abp.Applications/ LY.AIO.Applications.Single/ # 其它宿主
│ │ └── Publish/ # 发布输出目录(容器镜像构建使用)
│ ├── modules/ # 业务模块,每个模块按 DDD 分层(Domain / Application / EntityFrameworkCore / HttpApi ...)
│ │ ├── account/ # 账户与登录(含 OpenIddict/IdentityServer 的 Web 集成、验证码)
│ │ ├── identity/ # 用户、角色、组织机构、会话、登录日志
│ │ ├── identityServer/ # IdentityServer4 相关实现
│ │ ├── openIddict/ # OpenIddict 服务端(应用、作用域、令牌、Portal、二维码、短信、微信登录)
│ │ ├── permissions-management/ # 权限管理与授权
│ │ ├── saas/ # 多租户与版本
│ │ ├── settings/ feature-management/ # 设置、特性管理
│ │ ├── localization-management/ text-templating/ # 本地化、文本模板
│ │ ├── auditing/ data-protection/ gdpr/ captcha/ # 审计、数据保护、GDPR、验证码
│ │ ├── blob-management/ caching-management/ # 对象存储、缓存管理
│ │ ├── platform/ project/ system-info/ demo/ # 平台、项目、系统信息、示例
│ │ ├── realtime-message/ realtime-notifications/ # 即时消息、实时通知
│ │ ├── task-management/ rules-management/ webhooks/ # 后台任务、规则引擎、Webhook
│ │ ├── ai/ elsa/ # AI 能力、工作流(Elsa)
│ ├── framework/ # 基础框架包(33 个分组),常用分组:
│ │ ├── common/ core 相关基础包(LINGYUN.Abp.Core、CAP、Hangfire、BlobStoring、SignalR ...)
│ │ ├── security/ authentication/ authorization/ # 安全、登录方式、授权
│ │ ├── auditing/ logging/ telemetry/ # 审计、日志、链路追踪(OpenTelemetry/SkyWalking)
│ │ ├── multi-tenancy 相关:tenants/ # 多租户与版本
│ │ ├── wechat/ wx-pusher/ pushplus/ tui-juhe/ # 微信、消息推送
│ │ ├── cloud-aliyun/ cloud-tencent/ # 阿里云、腾讯云集成
│ │ ├── dapr/ elasticsearch/ efcore/ data-protection/ # Dapr、ES、EF Core、数据保护
│ │ ├── dynamic-queryable/ dynamic-definition/ exporter/ # 动态查询、动态定义、导入导出
│ │ ├── localization/ settings/ features/ mvc/ open-api/ cli/ ... # 其它基础包
│ ├── migrations/ # 各服务的 DbMigrator 与 EntityFrameworkCore 迁移项目(deploy.ps1 会依次执行)
│ ├── aspire/ # .NET Aspire:LINGYUN.Abp.MicroService.AppHost 及各服务的 Aspire 宿主
│ ├── templates/ # dotnet new 项目模板(micro 微服务 / aio 单体)
│ ├── tests/ # 单元测试项目
│ ├── LINGYUN.MicroService.All.slnx # 全量解决方案
│ ├── LINGYUN.MicroService.Aspire.slnx # Aspire 解决方案
│ └── LINGYUN.MicroService.SingleProject.slnx # 单体解决方案
├── gateways/
│ ├── internal/ # 内部网关(YARP):Internal.Gateway / OpenApi.Gateway + yarp*.json 路由
│ └── web/ # Web 网关:LY.MicroService.ApiGateway
├── apps/ # 前端:vben5(当前)/ vue(旧版)
├── build/ # 构建与迁移脚本:build-aspnetcore-ef-update.ps1、build-aspnetcore-docker-build.ps1 ...
├── deploy/ # 一键部署脚本(deploy.ps1)、中间件数据与各服务日志目录
├── docs/ # 文档(单体服务启动指南等)
├── docker-compose.yml # 后端服务编排
├── docker-compose.override.yml # 镜像标签、卷映射与启动顺序
├── docker-compose.override.configuration.yml # 各服务环境变量(连接串、CAP、Redis、Elasticsearch 等)
├── docker-compose.middleware.yml # 中间件:MySQL/Redis/RabbitMQ/Elasticsearch/Kibana/Logstash/OpenObserve
├── docker-compose.override.agile.yml # AgileConfig 配置中心(可选)
├── Directory.Build.props Directory.Packages.props NuGet.Config common.props # 统一构建与包版本管理
└── README.md README.en.md RELEASE.md LICENSE # 文档与许可
```
### 更改配置文件
修改开发环境用于代理的服务器地址,以下提供了三个分别为IdentityServer、SignalR、ApiService地址
如果自己变更了端口,需要改成自己的地址
## 启动项目
```bash
本项目提供三种启动方式,按需选择:
VITE_PROXY = [["/connect","http://127.0.0.1:44385"],["/api","http://127.0.0.1:30000"],["/signalr-hubs","ws://127.0.0.1:30000"]]
| 方式 | 说明 | 中间件 | 前端 |
| --- | --- | --- | --- |
| 方式一:微服务 | 完整微服务架构,后端全部以容器运行 | 需**先启动** `docker-compose.middleware.yml` | 单独启动 vben5 |
| 方式二:Aspire | AppHost 编排本地微服务开发环境 | AppHost 自动创建容器(PostgreSQL/Redis/RabbitMQ/Elasticsearch/Kibana) | AppHost 自动启动 |
| 方式三:单体 | 网关、认证与业务模块合并为一个进程 | 需**先启动** `docker-compose.middleware.yml` | 单独启动 vben5 |
```
### 通用前提
修改生产环境真实地址,如上
- **.NET SDK 10**(`dotnet --version`)
- **Docker / Docker Compose**(方式一、三的中间件;方式二的中间件容器同样由 Docker 提供)
- **Node.js 20+ 与 pnpm**(前端位于 `apps/vben5`,为 pnpm monorepo,`preinstall` 会执行 `only-allow pnpm`)
- **hosts**:Windows 修改 `C:\Windows\System32\drivers\etc\hosts`,Linux 修改 `/etc/hosts`,增加如下配置
```
127.0.0.1 host.docker.internal
```
(容器内通过 `extra_hosts: host.docker.internal:host-gateway` 访问宿主机上的中间件)
```bash
---
# STS Connect
# token签发地址
VITE_GLOB_AUTHORITY='http://127.0.0.1:44385'
# 客户端标识
VITE_GLOB_CLIENT_ID='vue-admin-element'
# 客户端密钥
VITE_GLOB_CLIENT_SECRET='1q2w3e*'
### 方式一:微服务启动
#### 1) 一键启动:deploy/deploy.ps1
```powershell
cd ./deploy
powershell -ExecutionPolicy Bypass -File .\deploy.ps1
```
### EntityFramework 迁移
脚本依次完成(见 `deploy/deploy.ps1`):
请切换到服务项目启动目录, 执行 **dotnet ef** 命令进行数据库迁移
1. 启动中间件:`docker-compose -f .\docker-compose.middleware.yml -p labp up -d --build`(MySQL、Redis、RabbitMQ、Elasticsearch、Kibana、Logstash、OpenObserve)
2. 等待 30 秒,等 MySQL 初始化完成
3. 依次执行 8 个数据库迁移项目(`dotnet run --no-build`,**因此执行脚本前必须先构建过后端**)
4. 构建 12 个后端镜像(`labp-*-service:10.6.0`)
5. 启动后端:`docker-compose -f .\docker-compose.yml -f .\docker-compose.override.yml -f .\docker-compose.override.configuration.yml -p labp up -d`
6. 在 `apps/vben5` 下执行 `pnpm dev:app` 启动前端
例如:
``` shell
注意:
cd aspnet-core/services/admin/LINGYUN.BackendAdminApp.Host
- 必须在 **deploy 目录**下执行脚本(脚本内部使用相对路径)。
- 脚本调用的是 `docker-compose`(Compose V1 命令);本机只安装 Compose V2 插件时,请把脚本中的 `docker-compose` 改为 `docker compose`。
- 脚本不包含 AgileConfig(`docker-compose.override.agile.yml`),配置均来自 `docker-compose.override.configuration.yml`。
dotnet ef database update
```
- 也可以使用快速迁移脚本文件: **./build/build-aspnetcore-ef-update.ps1**
#### 2) 手动启动(与脚本等价,务必先启动中间件)
```powershell
# ① 启动中间件(务必先启动)
docker-compose -f .\docker-compose.middleware.yml -p labp up -d
# 首次启动请等待 30 秒以上,让 MySQL 执行 deploy/mysql/docker-entrypoint-initdb.d 下的初始化脚本
### 配置RabbitMQ
# ② 数据库迁移:使用迁移脚本(内部对 aspnet-core/migrations 下的 8 个 *.DbMigrator 依次执行 dotnet run,会自动构建)
cd .\build
.\build-aspnetcore-ef-update.ps1
因此项目设计为微服务架构,服务间通讯采用分布式事件的方式,项目采用的是[DotNetCore/CAP](https://github.com/dotnetcore/CAP)
通讯方式为**RabbitMQ Server**,所以您需要事先安装**RabbitMQ**,具体安装方式请查阅官网
# ③ 构建后端镜像:生成 12 个 labp-*-service:10.6.0(标签必须与 docker-compose.override.yml 中的 image 一致)
.\build-aspnetcore-docker-build.ps1
然后您需要更改配置文件中的**CAP:RabbitMQ**配置项,设置为您自己定义的配置,推荐使用**rabbitmq_management**插件便于快速管理**RabbitMQ**
# ④ 启动后端(三个 compose 文件缺一不可)
docker-compose -f .\docker-compose.yml -f .\docker-compose.override.yml -f .\docker-compose.override.configuration.yml -p labp up -d
# ⑤ 启动前端
cd .\apps\vben5
pnpm install
pnpm dev:app
```
### 启动后台服务
```shell
cd aspnet-core/services
手动步骤说明:
start-all-service.bat
- ②③ 两个脚本都必须在 **build 目录**下执行(脚本内部相对引用 `./build-aspnetcore-common.ps1`)。
- `build-aspnetcore-ef-update.ps1` 内部使用 `dotnet run`(会先构建再运行),因此手动流程**不需要**预先构建后端;而一键脚本 `deploy.ps1` 使用 `dotnet run --no-build`,所以走一键脚本前必须先构建过后端。
- 只想迁移某个服务时,可直接进入对应目录执行,例如:
```powershell
cd .\aspnet-core\migrations\LINGYUN.Abp.MicroService.AuthServer.DbMigrator
dotnet run
```
#### 3) 访问地址
| 组件 | 地址 |
| --- | --- |
| 前端(vben5,`@abp/app-antd`) | http://localhost:5666 |
| API 网关 | http://localhost:30000 |
| 认证服务(STS) | http://localhost:44385 |
| 身份 / 管理 / 平台 / 消息 / 本地化 | 30015 / 30010 / 30025 / 30020 / 30030 |
| 任务 / Webhook / 工作流 / 微信 / AI | 30040 / 30045 / 30050 / 30060 / 30070 |
| Kibana | http://localhost:5601 |
| RabbitMQ 管理台 | http://localhost:15672 (admin / 123456) |
| MySQL | localhost:3306 (root / 123456,数据库 `abp`) |
| Redis | localhost:6379 |
| OpenObserve 管理台 | http://localhost:5080 (admin@abp.io / ww1Z5L%6) |
### 方式二:Aspire 启动
AppHost 会自动拉起它自己的中间件容器(PostgreSQL、Redis、RabbitMQ、Elasticsearch、Kibana),在 Development 环境下自动执行各服务的数据库迁移项目,并自动以 `pnpm dev:app` 启动 vben5 前端,**不需要**再启动 `docker-compose.middleware.yml`。
```powershell
cd ./aspnet-core/aspire/LINGYUN.Abp.MicroService.AppHost
aspire run
```
### 启动本地开发环境
```shell
- 需要安装 Aspire CLI(版本需与 AppHost 的 `Aspire.AppHost.Sdk` 13.x 匹配):`dotnet tool install --global Aspire.Cli`;不使用 CLI 时也可以直接 `dotnet run --project .\LINGYUN.Abp.MicroService.AppHost.csproj`。
- 需要 Docker 处于运行状态,且 `apps/vben5` 已经执行过 `pnpm install`(AppHost 会运行 `pnpm dev:app`,前端端口固定 5666)。
- 启动后终端会输出 Aspire Dashboard 地址,可在面板中查看资源状态、日志与链路。
- AppHost 占用的宿主机端口与方式一的中间件完全重叠(6379/9200/5601/5672/15672/5432 等),**请勿与方式一的中间件同时运行**。
cd apps/vue
### 方式三:单体服务启动
yarn dev
单体服务把网关、认证与各业务模块合并到一个进程,但**仍然依赖中间件,必须先启动中间件**:
```
```powershell
# ① 启动中间件
docker-compose -f .\docker-compose.middleware.yml -p labp up -d
# 首次启动请等待 30 秒以上
### 构建生产环境
# ② 启动单体服务
cd .\aspnet-core\services\LY.MicroService.Applications.Single
dotnet run --launch-profile Single.MySql.Dev
```bash
yarn build
# ③ 启动前端
cd .\apps\vben5
pnpm install
pnpm dev:app
```
### 关于docker容器部署
- 默认地址 **http://localhost:30000**:`App:SelfUrl` 与 `AuthServer:Authority` 均指向它,认证端点与 API 同端口。
- **建议显式指定 Profile**:不指定时 `dotnet run` 使用 `launchSettings.json` 中的第一个 Profile(当前为 `Single.PostgreSql.Dev`)。使用默认数据库(MySQL)请用 `Single.MySql.Dev`,其它可选 `Single.PostgreSql.Dev`、`Single.SqlServer.Dev`。
- 各数据库连接串见 `appsettings.Development.MySql.json` / `appsettings.Development.PostgreSql.json` / `appsettings.Development.SqlServer.json`。
**第一步**: 构建后台服务, powershell脚本:**./build/build-aspnetcore-release.ps1**, **注意:发布后的服务需要 appsettings.Production.json 文件**
### 常见问题
**第二步**: 构建前端, **./build/build-vue-apps.ps1**
- **`docker-compose` 命令不存在**:脚本使用的是 Compose V1 命令;仅安装 Compose V2 时请改用 `docker compose`。
- **提示找不到镜像 `labp-*-service:10.6.0`**:`docker-compose.override.yml` 通过 `image:` 引用预构建镜像,请先执行 `build/build-aspnetcore-docker-build.ps1`(方式一·手动启动 步骤 ③)。
- **一键脚本迁移报错(`dotnet run --no-build`)**:`deploy.ps1` 内部使用 `--no-build`,执行脚本前需先构建后端(`dotnet build .\aspnet-core\LINGYUN.MicroService.All.slnx`);手动迁移请改用 **build/build-aspnetcore-ef-update.ps1**(内部 `dotnet run`,会自动构建)。
- **前端依赖安装失败**:`apps/vben5` 强制使用 pnpm(`preinstall` 会执行 `only-allow pnpm`),请使用 `pnpm install` / `pnpm dev:app`。
- **容器内连不上宿主机中间件**:确认 hosts 文件包含 `127.0.0.1 host.docker.internal`。
**第三步**: 构建后的发布地址默认在**cd ./aspnet-core/services/Publish** ,变更nginx代理服务器地址: **./client/docker/nginx/default.conf**
---
**第四步**: 运行此命令 **sudo docker-compose down && sudo docker-compose -f docker-compose.yml -f docker-compose.override.yml up --build -d**
### 代码格式检查以及自动修复
**推荐使用 jenkins 之类的ci工具,可以将此简化为一个步骤**
在 `apps/vben5` 下执行(vben5 强制使用 pnpm):
```bash
cd apps/vben5
### 代码格式检查以及自动修复
# 代码检查
pnpm lint
```bash
yarn lint:eslint
# 自动修复
pnpm format
# 类型检查
pnpm check:type
```
### 运行单元测试
```bash
yarn test:unit
cd apps/vben5
pnpm test:unit
```
## 如何贡献

2
apps/vben5/packages/@abp/notifications/src/components/send-records/NotificationSendRecordTable.vue

@ -119,7 +119,7 @@ const formOptions: VbenFormProps = {
],
},
fieldName: 'state',
label: $t('WebhooksManagement.DisplayName:State'),
label: $t('Notifications.DisplayName:SendState'),
},
{
component: 'ApiSelect',

73
aspnet-core/LINGYUN.MicroService.All.slnx

@ -27,63 +27,70 @@
</Folder>
<Folder Name="/00 migrations/" />
<Folder Name="/00 migrations/00 admin-service/">
<Project Path="migrations/LY.MicroService.BackendAdmin.DbMigrator/LY.MicroService.BackendAdmin.DbMigrator.csproj" />
<Project Path="migrations/LY.MicroService.BackendAdmin.EntityFrameworkCore/LY.MicroService.BackendAdmin.EntityFrameworkCore.csproj" />
<Project Path="migrations/LINGYUN.Abp.MicroService.AdminService.DbMigrator/LINGYUN.Abp.MicroService.AdminService.DbMigrator.csproj" />
<Project Path="migrations/LINGYUN.Abp.MicroService.AdminService.EntityFrameworkCore/LINGYUN.Abp.MicroService.AdminService.EntityFrameworkCore.csproj" />
</Folder>
<Folder Name="/00 migrations/01 platform-service/">
<Project Path="migrations/LY.MicroService.Platform.DbMigrator/LY.MicroService.Platform.DbMigrator.csproj" />
<Project Path="migrations/LY.MicroService.Platform.EntityFrameworkCore/LY.MicroService.Platform.EntityFrameworkCore.csproj" />
<Project Path="migrations/LINGYUN.Abp.MicroService.PlatformService.DbMigrator/LINGYUN.Abp.MicroService.PlatformService.DbMigrator.csproj" />
<Project Path="migrations/LINGYUN.Abp.MicroService.PlatformService.EntityFrameworkCore/LINGYUN.Abp.MicroService.PlatformService.EntityFrameworkCore.csproj" />
</Folder>
<Folder Name="/00 migrations/02 localization-service/">
<Project Path="migrations/LY.MicroService.LocalizationManagement.DbMigrator/LY.MicroService.LocalizationManagement.DbMigrator.csproj" />
<Project Path="migrations/LY.MicroService.LocalizationManagement.EntityFrameworkCore/LY.MicroService.LocalizationManagement.EntityFrameworkCore.csproj" />
<Project Path="migrations/LINGYUN.Abp.MicroService.LocalizationService.DbMigrator/LINGYUN.Abp.MicroService.LocalizationService.DbMigrator.csproj" />
<Project Path="migrations/LINGYUN.Abp.MicroService.LocalizationService.EntityFrameworkCore/LINGYUN.Abp.MicroService.LocalizationService.EntityFrameworkCore.csproj" />
</Folder>
<Folder Name="/00 migrations/03 task-service/">
<Project Path="migrations/LY.MicroService.TaskManagement.DbMigrator/LY.MicroService.TaskManagement.DbMigrator.csproj" />
<Project Path="migrations/LY.MicroService.TaskManagement.EntityFrameworkCore/LY.MicroService.TaskManagement.EntityFrameworkCore.csproj" />
<Project Path="migrations/LINGYUN.Abp.MicroService.TaskService.DbMigrator/LINGYUN.Abp.MicroService.TaskService.DbMigrator.csproj" />
<Project Path="migrations/LINGYUN.Abp.MicroService.TaskService.EntityFrameworkCore/LINGYUN.Abp.MicroService.TaskService.EntityFrameworkCore.csproj" />
</Folder>
<Folder Name="/00 migrations/04 message-service/">
<Project Path="migrations/LY.MicroService.RealtimeMessage.DbMigrator/LY.MicroService.RealtimeMessage.DbMigrator.csproj" />
<Project Path="migrations/LY.MicroService.RealtimeMessage.EntityFrameworkCore/LY.MicroService.RealtimeMessage.EntityFrameworkCore.csproj" />
<Project Path="migrations/LINGYUN.Abp.MicroService.MessageService.DbMigrator/LINGYUN.Abp.MicroService.MessageService.DbMigrator.csproj" />
<Project Path="migrations/LINGYUN.Abp.MicroService.MessageService.EntityFrameworkCore/LINGYUN.Abp.MicroService.MessageService.EntityFrameworkCore.csproj" />
</Folder>
<Folder Name="/00 migrations/05 webhook-service/">
<Project Path="migrations/LY.MicroService.WebhooksManagement.DbMigrator/LY.MicroService.WebhooksManagement.DbMigrator.csproj" />
<Project Path="migrations/LY.MicroService.WebhooksManagement.EntityFrameworkCore/LY.MicroService.WebhooksManagement.EntityFrameworkCore.csproj" />
<Project Path="migrations/LINGYUN.Abp.MicroService.WebhookService.DbMigrator/LINGYUN.Abp.MicroService.WebhookService.DbMigrator.csproj" />
<Project Path="migrations/LINGYUN.Abp.MicroService.WebhookService.EntityFrameworkCore/LINGYUN.Abp.MicroService.WebhookService.EntityFrameworkCore.csproj" />
</Folder>
<Folder Name="/00 migrations/06 auth-server/">
<Project Path="migrations/LY.MicroService.AuthServer.DbMigrator/LY.MicroService.AuthServer.DbMigrator.csproj" />
<Project Path="migrations/LY.MicroService.AuthServer.EntityFrameworkCore/LY.MicroService.AuthServer.EntityFrameworkCore.csproj" />
<Folder Name="/00 migrations/06 ai-service/">
<Project Path="migrations/LINGYUN.Abp.MicroService.AIService.DbMigrator/LINGYUN.Abp.MicroService.AIService.DbMigrator.csproj" Id="c62969e7-044d-44f7-997b-09031d7a9bd4" />
<Project Path="migrations/LINGYUN.Abp.MicroService.AIService.EntityFrameworkCore/LINGYUN.Abp.MicroService.AIService.EntityFrameworkCore.csproj" Id="b6180ed9-2917-44b2-b470-101a8de061d1" />
</Folder>
<Folder Name="/00 migrations/07 auth-server/">
<Project Path="migrations/LINGYUN.Abp.MicroService.AuthServer.DbMigrator/LINGYUN.Abp.MicroService.AuthServer.DbMigrator.csproj" />
<Project Path="migrations/LINGYUN.Abp.MicroService.AuthServer.EntityFrameworkCore/LINGYUN.Abp.MicroService.AuthServer.EntityFrameworkCore.csproj" />
</Folder>
<Folder Name="/01 services/" />
<Folder Name="/01 services/00 localization-service/">
<Project Path="services/LY.MicroService.LocalizationManagement.HttpApi.Host/LY.MicroService.LocalizationManagement.HttpApi.Host.csproj" />
<Project Path="services/LINGYUN.Abp.MicroService.LocalizationService/LINGYUN.Abp.MicroService.LocalizationService.csproj" />
</Folder>
<Folder Name="/01 services/01 auth-server/">
<Project Path="services/LY.MicroService.AuthServer/LY.MicroService.AuthServer.csproj" />
<Project Path="services/LINGYUN.Abp.MicroService.AuthServer/LINGYUN.Abp.MicroService.AuthServer.csproj" />
</Folder>
<Folder Name="/01 services/02 admin-service/">
<Project Path="services/LY.MicroService.BackendAdmin.HttpApi.Host/LY.MicroService.BackendAdmin.HttpApi.Host.csproj" />
<Project Path="services/LINGYUN.Abp.MicroService.AdminService/LINGYUN.Abp.MicroService.AdminService.csproj" />
</Folder>
<Folder Name="/01 services/03 identity-service/">
<Project Path="services/LY.MicroService.AuthServer.HttpApi.Host/LY.MicroService.AuthServer.HttpApi.Host.csproj" />
<Project Path="services/LINGYUN.Abp.MicroService.IdentityService/LINGYUN.Abp.MicroService.IdentityService.csproj" />
</Folder>
<Folder Name="/01 services/04 platform-service/">
<Project Path="services/LY.MicroService.PlatformManagement.HttpApi.Host/LY.MicroService.PlatformManagement.HttpApi.Host.csproj" />
<Project Path="services/LINGYUN.Abp.MicroService.PlatformService/LINGYUN.Abp.MicroService.PlatformService.csproj" />
</Folder>
<Folder Name="/01 services/05 task-service/">
<Project Path="services/LY.MicroService.TaskManagement.HttpApi.Host/LY.MicroService.TaskManagement.HttpApi.Host.csproj" />
<Project Path="services/LINGYUN.Abp.MicroService.TaskService/LINGYUN.Abp.MicroService.TaskService.csproj" />
</Folder>
<Folder Name="/01 services/06 message-service/">
<Project Path="services/LY.MicroService.RealtimeMessage.HttpApi.Host/LY.MicroService.RealtimeMessage.HttpApi.Host.csproj" />
<Project Path="services/LINGYUN.Abp.MicroService.MessageService/LINGYUN.Abp.MicroService.MessageService.csproj" />
</Folder>
<Folder Name="/01 services/07 webhook-service/">
<Project Path="services/LY.MicroService.WebhooksManagement.HttpApi.Host/LY.MicroService.WebhooksManagement.HttpApi.Host.csproj" />
<Project Path="services/LINGYUN.Abp.MicroService.WebhookService/LINGYUN.Abp.MicroService.WebhookService.csproj" />
</Folder>
<Folder Name="/01 services/08 wechat-service/">
<Project Path="services/LY.MicroService.WechatManagement.HttpApi.Host/LY.MicroService.WechatManagement.HttpApi.Host.csproj" />
<Project Path="services/LINGYUN.Abp.MicroService.WeChatService/LINGYUN.Abp.MicroService.WeChatService.csproj" />
</Folder>
<Folder Name="/01 services/09 workflow-service/">
<Project Path="services/LY.MicroService.WorkflowManagement.HttpApi.Host/LY.MicroService.WorkflowManagement.HttpApi.Host.csproj" />
<Project Path="services/LINGYUN.Abp.MicroService.WorkflowService/LINGYUN.Abp.MicroService.WorkflowService.csproj" />
</Folder>
<Folder Name="/01 services/10 ai-service/">
<Project Path="services/LINGYUN.Abp.MicroService.AIService/LINGYUN.Abp.MicroService.AIService.csproj" Id="6e71205c-6ce5-48cd-95f1-25a3a0de6775" />
</Folder>
<Folder Name="/02 gateways/" />
<Folder Name="/02 gateways/00 internal/">
@ -307,6 +314,21 @@
<Project Path="modules/account/LINGYUN.Abp.Account.Web.TencentCaptcha/LINGYUN.Abp.Account.Web.TencentCaptcha.csproj" />
<Project Path="modules/account/LINGYUN.Abp.Account.Web/LINGYUN.Abp.Account.Web.csproj" />
</Folder>
<Folder Name="/modules/ai/">
<Project Path="modules/ai/LINGYUN.Abp.AI.Agent/LINGYUN.Abp.AI.Agent.csproj" />
<Project Path="modules/ai/LINGYUN.Abp.AI.Core/LINGYUN.Abp.AI.Core.csproj" />
<Project Path="modules/ai/LINGYUN.Abp.AI.Ollama/LINGYUN.Abp.AI.Ollama.csproj" />
<Project Path="modules/ai/LINGYUN.Abp.AI.Tools.Http/LINGYUN.Abp.AI.Tools.Http.csproj" />
<Project Path="modules/ai/LINGYUN.Abp.AI.Tools.Mcp/LINGYUN.Abp.AI.Tools.Mcp.csproj" />
<Project Path="modules/ai/LINGYUN.Abp.AI.Tools/LINGYUN.Abp.AI.Tools.csproj" />
<Project Path="modules/ai/LINGYUN.Abp.AIManagement.Application.Contracts/LINGYUN.Abp.AIManagement.Application.Contracts.csproj" />
<Project Path="modules/ai/LINGYUN.Abp.AIManagement.Application/LINGYUN.Abp.AIManagement.Application.csproj" />
<Project Path="modules/ai/LINGYUN.Abp.AIManagement.Domain.Shared/LINGYUN.Abp.AIManagement.Domain.Shared.csproj" />
<Project Path="modules/ai/LINGYUN.Abp.AIManagement.Domain/LINGYUN.Abp.AIManagement.Domain.csproj" />
<Project Path="modules/ai/LINGYUN.Abp.AIManagement.EntityFrameworkCore/LINGYUN.Abp.AIManagement.EntityFrameworkCore.csproj" />
<Project Path="modules/ai/LINGYUN.Abp.AIManagement.HttpApi.Client/LINGYUN.Abp.AIManagement.HttpApi.Client.csproj" />
<Project Path="modules/ai/LINGYUN.Abp.AIManagement.HttpApi/LINGYUN.Abp.AIManagement.HttpApi.csproj" />
</Folder>
<Folder Name="/modules/auditing/">
<Project Path="modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN.Abp.Auditing.Application.Contracts.csproj" />
<Project Path="modules/auditing/LINGYUN.Abp.Auditing.Application/LINGYUN.Abp.Auditing.Application.csproj" />
@ -383,6 +405,7 @@
<Project Path="modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN.Abp.Identity.Application.Contracts.csproj" />
<Project Path="modules/identity/LINGYUN.Abp.Identity.Application/LINGYUN.Abp.Identity.Application.csproj" />
<Project Path="modules/identity/LINGYUN.Abp.Identity.AspNetCore.QrCode/LINGYUN.Abp.Identity.AspNetCore.QrCode.csproj" />
<Project Path="modules/identity/LINGYUN.Abp.Identity.AspNetCore/LINGYUN.Abp.Identity.AspNetCore.csproj" />
<Project Path="modules/identity/LINGYUN.Abp.Identity.Domain.Shared/LINGYUN.Abp.Identity.Domain.Shared.csproj" />
<Project Path="modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN.Abp.Identity.Domain.csproj" />
<Project Path="modules/identity/LINGYUN.Abp.Identity.EntityFrameworkCore/LINGYUN.Abp.Identity.EntityFrameworkCore.csproj" />

23
aspnet-core/cleanup-logs.bat

@ -18,16 +18,15 @@ del .\aspire\LINGYUN.Abp.MicroService.WeChatService\Logs /Q
del .\aspire\LINGYUN.Abp.MicroService.WorkflowService\Logs /Q
del .\services\LY.MicroService.Applications.Single\Logs /Q
del .\services\LY.MicroService.BackendAdmin.HttpApi.Host\Logs /Q
del .\services\LY.MicroService.AuthServer\Logs /Q
del .\services\LY.MicroService.AuthServer.HttpApi.Host\Logs /Q
del .\services\LY.MicroService.identityServer\Logs /Q
del .\services\LY.MicroService.identityServer.HttpApi.Host\Logs /Q
del .\services\LY.MicroService.LocalizationManagement.HttpApi.Host\Logs /Q
del .\services\LY.MicroService.PlatformManagement.HttpApi.Host\Logs /Q
del .\services\LY.MicroService.RealtimeMessage.HttpApi.Host\Logs /Q
del .\services\LY.MicroService.TaskManagement.HttpApi.Host\Logs /Q
del .\services\LY.MicroService.WebhooksManagement.HttpApi.Host\Logs /Q
del .\services\LY.MicroService.WechatManagement.HttpApi.Host\Logs /Q
del .\services\LY.MicroService.WorkflowManagement.HttpApi.Host\Logs /Q
del .\services\LINGYUN.Abp.MicroService.LocalizationService\Logs /Q
del .\services\LINGYUN.Abp.MicroService.AuthServer\Logs /Q
del .\services\LINGYUN.Abp.MicroService.AdminService\Logs /Q
del .\services\LINGYUN.Abp.MicroService.IdentityService\Logs /Q
del .\services\LINGYUN.Abp.MicroService.PlatformService\Logs /Q
del .\services\LINGYUN.Abp.MicroService.TaskService\Logs /Q
del .\services\LINGYUN.Abp.MicroService.MessageService\Logs /Q
del .\services\LINGYUN.Abp.MicroService.WebhookService\Logs /Q
del .\services\LINGYUN.Abp.MicroService.WeChatService\Logs /Q
del .\services\LINGYUN.Abp.MicroService.WorkflowService\Logs /Q

13
aspnet-core/create-database.bat

@ -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

18
aspnet-core/delete-bin-obj.bat

@ -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

20
aspnet-core/ef-update.ps1

@ -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

25
aspnet-core/framework/settings/LINGYUN.Abp.Settings/Volo/Abp/Settings/LocalizableValue.cs

@ -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;
}
}

13
aspnet-core/framework/settings/LINGYUN.Abp.Settings/Volo/Abp/Settings/SettingDefinitionExtensions.cs

@ -192,6 +192,19 @@ public static class SettingDefinitionExtensions
.WithProperty(OptionValueKey, optionValues);
}
public static SettingDefinition WithOptions<TValue>(
this SettingDefinition definition,
IEnumerable<LocalizableValue<TValue>> options)
{
var optionNames = options.Select(x => $"N:{x.Name};L:{x.ResourceName}").JoinAsString(",");
var optionValues = options.Select(x => x.Value).JoinAsString(",");
return definition
.WithValueType(ValueType.Option)
.WithProperty(OptionNameKey, optionNames)
.WithProperty(OptionValueKey, optionValues);
}
public static SettingDefinition ReplaceProviders(
this SettingDefinition definition,
params string[] providers)

2
aspnet-core/framework/settings/LINGYUN.Abp.Settings/Volo/Abp/Settings/SettingResourceDefinition.cs

@ -53,7 +53,7 @@ public class SettingResourceDefinition
{
if (!string.IsNullOrWhiteSpace(ResourceType))
{
return new LocalizableString(DisplayName!, ResourceType).Localize(stringLocalizerFactory);
return new LocalizableString(Type.GetType(ResourceType)!, DisplayName!).Localize(stringLocalizerFactory);
}
return new LocalizableString(DisplayName!, ResourceName).Localize(stringLocalizerFactory);
}

12
aspnet-core/migrate-database.bat

@ -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

31
aspnet-core/migrate-db-cmd.bat

@ -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 --------

54
aspnet-core/migrations/LINGYUN.Abp.MicroService.AIService.DbMigrator/AIServiceDbMigratorHostedService.cs

@ -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;
}
}

14
aspnet-core/migrations/LINGYUN.Abp.MicroService.AIService.DbMigrator/AIServiceDbMigratorModule.cs

@ -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
{
}

32
aspnet-core/migrations/LINGYUN.Abp.MicroService.AIService.DbMigrator/LINGYUN.Abp.MicroService.AIService.DbMigrator.csproj

@ -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>

43
aspnet-core/migrations/LINGYUN.Abp.MicroService.AIService.DbMigrator/Program.cs

@ -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();
}

75
aspnet-core/migrations/LINGYUN.Abp.MicroService.AIService.DbMigrator/appsettings.json

@ -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}"
}
}
]
}
}

27
aspnet-core/migrations/LINGYUN.Abp.MicroService.AIService.EntityFrameworkCore/AIServiceDataSeeder.cs

@ -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;
}
}

45
aspnet-core/migrations/LINGYUN.Abp.MicroService.AIService.EntityFrameworkCore/AIServiceDbMigrationEventHandler.cs

@ -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);
}
}

37
aspnet-core/migrations/LINGYUN.Abp.MicroService.AIService.EntityFrameworkCore/AIServiceDbMigrationService.cs

@ -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());
}
}

35
aspnet-core/migrations/LINGYUN.Abp.MicroService.AIService.EntityFrameworkCore/AIServiceMigrationsDbContext.cs

@ -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();
}
}

29
aspnet-core/migrations/LINGYUN.Abp.MicroService.AIService.EntityFrameworkCore/AIServiceMigrationsDbContextFactory.cs

@ -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();
}
}

44
aspnet-core/migrations/LINGYUN.Abp.MicroService.AIService.EntityFrameworkCore/AIServiceMigrationsEntityFrameworkCoreModule.cs

@ -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
aspnet-core/migrations/LY.MicroService.AuthServer.EntityFrameworkCore/FodyWeavers.xml → aspnet-core/migrations/LINGYUN.Abp.MicroService.AIService.EntityFrameworkCore/FodyWeavers.xml

30
aspnet-core/migrations/LINGYUN.Abp.MicroService.AIService.EntityFrameworkCore/FodyWeavers.xsd

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<!-- This file was generated by Fody. Manual changes to this file will be lost when your project is rebuilt. -->
<xs:element name="Weavers">
<xs:complexType>
<xs:all>
<xs:element name="ConfigureAwait" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:attribute name="ContinueOnCapturedContext" type="xs:boolean" />
</xs:complexType>
</xs:element>
</xs:all>
<xs:attribute name="VerifyAssembly" type="xs:boolean">
<xs:annotation>
<xs:documentation>'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="VerifyIgnoreCodes" type="xs:string">
<xs:annotation>
<xs:documentation>A comma-separated list of error codes that can be safely ignored in assembly verification.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="GenerateXsd" type="xs:boolean">
<xs:annotation>
<xs:documentation>'false' to turn off automatic generation of the XML Schema file.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:schema>

34
aspnet-core/migrations/LINGYUN.Abp.MicroService.AIService.EntityFrameworkCore/LINGYUN.Abp.MicroService.AIService.EntityFrameworkCore.csproj

@ -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>

383
aspnet-core/migrations/LINGYUN.Abp.MicroService.AIService.EntityFrameworkCore/Migrations/20261007004411_Initial-AI-Service.Designer.cs

@ -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
}
}
}

219
aspnet-core/migrations/LINGYUN.Abp.MicroService.AIService.EntityFrameworkCore/Migrations/20261007004411_Initial-AI-Service.cs

@ -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");
}
}
}

380
aspnet-core/migrations/LINGYUN.Abp.MicroService.AIService.EntityFrameworkCore/Migrations/AIServiceMigrationsDbContextModelSnapshot.cs

@ -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
}
}
}

55
aspnet-core/migrations/LINGYUN.Abp.MicroService.AdminService.DbMigrator/AdminServiceDbMigratorHostedService.cs

@ -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;
}
}

4
aspnet-core/migrations/LINGYUN.Abp.MicroService.AdminService.DbMigrator/AdminServiceDbMigratorModule.Configure.cs

@ -0,0 +1,4 @@
namespace LINGYUN.Abp.MicroService.AdminService.DbMigrator;
public partial class AdminServiceDbMigratorModule
{
}

57
aspnet-core/migrations/LINGYUN.Abp.MicroService.AdminService.DbMigrator/AdminServiceDbMigratorModule.cs

@ -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
{
}

72
aspnet-core/migrations/LINGYUN.Abp.MicroService.AdminService.DbMigrator/LINGYUN.Abp.MicroService.AdminService.DbMigrator.csproj

@ -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>

40
aspnet-core/migrations/LINGYUN.Abp.MicroService.AdminService.DbMigrator/Program.cs

@ -0,0 +1,40 @@
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using Serilog;
using Serilog.Events;
namespace 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>();
});
}
}

11
aspnet-core/migrations/LINGYUN.Abp.MicroService.AdminService.DbMigrator/Properties/launchSettings.json

@ -0,0 +1,11 @@
{
"profiles": {
"LINGYUN.Abp.MicroService.AdminService.DbMigrator": {
"commandName": "Project",
"dotnetRunMessages": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}

98
aspnet-core/migrations/LINGYUN.Abp.MicroService.AdminService.DbMigrator/README.EN.md

@ -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)

98
aspnet-core/migrations/LINGYUN.Abp.MicroService.AdminService.DbMigrator/README.md

@ -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)

7
aspnet-core/migrations/LINGYUN.Abp.MicroService.AdminService.DbMigrator/Usings.cs

@ -0,0 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp;
using LINGYUN.Abp;

75
aspnet-core/migrations/LINGYUN.Abp.MicroService.AdminService.DbMigrator/appsettings.json

@ -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}"
}
}
]
}
}

61
aspnet-core/migrations/LINGYUN.Abp.MicroService.AdminService.EntityFrameworkCore/AdminServiceDataSeeder.cs

@ -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.");
}
}

45
aspnet-core/migrations/LINGYUN.Abp.MicroService.AdminService.EntityFrameworkCore/AdminServiceDbMigrationEventHandler.cs

@ -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);
}
}

38
aspnet-core/migrations/LINGYUN.Abp.MicroService.AdminService.EntityFrameworkCore/AdminServiceDbMigrationService.cs

@ -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());
}
}

43
aspnet-core/migrations/LINGYUN.Abp.MicroService.AdminService.EntityFrameworkCore/AdminServiceMigrationsDbContext.cs

@ -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();
});
}
}

29
aspnet-core/migrations/LINGYUN.Abp.MicroService.AdminService.EntityFrameworkCore/AdminServiceMigrationsDbContextFactory.cs

@ -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();
}
}

42
aspnet-core/migrations/LINGYUN.Abp.MicroService.AdminService.EntityFrameworkCore/AdminServiceMigrationsEntityFrameworkCoreModule.cs

@ -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
aspnet-core/migrations/LY.MicroService.BackendAdmin.EntityFrameworkCore/FodyWeavers.xml → aspnet-core/migrations/LINGYUN.Abp.MicroService.AdminService.EntityFrameworkCore/FodyWeavers.xml

30
aspnet-core/migrations/LINGYUN.Abp.MicroService.AdminService.EntityFrameworkCore/FodyWeavers.xsd

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<!-- This file was generated by Fody. Manual changes to this file will be lost when your project is rebuilt. -->
<xs:element name="Weavers">
<xs:complexType>
<xs:all>
<xs:element name="ConfigureAwait" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:attribute name="ContinueOnCapturedContext" type="xs:boolean" />
</xs:complexType>
</xs:element>
</xs:all>
<xs:attribute name="VerifyAssembly" type="xs:boolean">
<xs:annotation>
<xs:documentation>'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="VerifyIgnoreCodes" type="xs:string">
<xs:annotation>
<xs:documentation>A comma-separated list of error codes that can be safely ignored in assembly verification.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="GenerateXsd" type="xs:boolean">
<xs:annotation>
<xs:documentation>'false' to turn off automatic generation of the XML Schema file.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:schema>

34
aspnet-core/migrations/LINGYUN.Abp.MicroService.AdminService.EntityFrameworkCore/LINGYUN.Abp.MicroService.AdminService.EntityFrameworkCore.csproj

@ -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>

523
aspnet-core/migrations/LINGYUN.Abp.MicroService.AdminService.EntityFrameworkCore/Migrations/20230109083613_Initial-Backend-Admin.Designer.cs

@ -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
}
}
}

388
aspnet-core/migrations/LINGYUN.Abp.MicroService.AdminService.EntityFrameworkCore/Migrations/20230109083613_Initial-Backend-Admin.cs

@ -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");
}
}
}

577
aspnet-core/migrations/LINGYUN.Abp.MicroService.AdminService.EntityFrameworkCore/Migrations/20230304062910_Add-Text-Template-Definition.Designer.cs

@ -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
}
}
}

50
aspnet-core/migrations/LINGYUN.Abp.MicroService.AdminService.EntityFrameworkCore/Migrations/20230304062910_Add-Text-Template-Definition.cs

@ -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");
}
}
}

581
aspnet-core/migrations/LINGYUN.Abp.MicroService.AdminService.EntityFrameworkCore/Migrations/20230304083526_Add-IsStatic-Field.Designer.cs

@ -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
}
}
}

29
aspnet-core/migrations/LINGYUN.Abp.MicroService.AdminService.EntityFrameworkCore/Migrations/20230304083526_Add-IsStatic-Field.cs

@ -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");
}
}
}

586
aspnet-core/migrations/LINGYUN.Abp.MicroService.AdminService.EntityFrameworkCore/Migrations/20230323070528_Upgrade-Abp-Framework-To-7.1.0.Designer.cs

@ -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
}
}
}

40
aspnet-core/migrations/LINGYUN.Abp.MicroService.AdminService.EntityFrameworkCore/Migrations/20230323070528_Upgrade-Abp-Framework-To-7.1.0.cs

@ -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");
}
}
}

646
aspnet-core/migrations/LINGYUN.Abp.MicroService.AdminService.EntityFrameworkCore/Migrations/20231028084002_Upgrade-Abp-Framework-To-7.4.0.Designer.cs

@ -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
}
}
}

247
aspnet-core/migrations/LINGYUN.Abp.MicroService.AdminService.EntityFrameworkCore/Migrations/20231028084002_Upgrade-Abp-Framework-To-7.4.0.cs

@ -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");
}
}
}

646
aspnet-core/migrations/LINGYUN.Abp.MicroService.AdminService.EntityFrameworkCore/Migrations/20240218002657_Upgrade-Abp-Framework-To-8.0.3.Designer.cs

@ -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
}
}
}

70
aspnet-core/migrations/LINGYUN.Abp.MicroService.AdminService.EntityFrameworkCore/Migrations/20240218002657_Upgrade-Abp-Framework-To-8.0.3.cs

@ -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");
}
}
}

652
aspnet-core/migrations/LINGYUN.Abp.MicroService.AdminService.EntityFrameworkCore/Migrations/20240413021854_Upgrade-Abp-Framework-To-8-1-0.Designer.cs

@ -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
}
}
}

39
aspnet-core/migrations/LINGYUN.Abp.MicroService.AdminService.EntityFrameworkCore/Migrations/20240413021854_Upgrade-Abp-Framework-To-8-1-0.cs

@ -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");
}
}
}

931
aspnet-core/migrations/LINGYUN.Abp.MicroService.AdminService.EntityFrameworkCore/Migrations/20240515073346_Add-Data-Protected-Module.Designer.cs

@ -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
}
}
}

179
aspnet-core/migrations/LINGYUN.Abp.MicroService.AdminService.EntityFrameworkCore/Migrations/20240515073346_Add-Data-Protected-Module.cs

@ -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");
}
}
}

941
aspnet-core/migrations/LINGYUN.Abp.MicroService.AdminService.EntityFrameworkCore/Migrations/20240515092715_Add-Allow-Properties.Designer.cs

@ -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
}
}
}

42
aspnet-core/migrations/LINGYUN.Abp.MicroService.AdminService.EntityFrameworkCore/Migrations/20240515092715_Add-Allow-Properties.cs

@ -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");
}
}
}

937
aspnet-core/migrations/LINGYUN.Abp.MicroService.AdminService.EntityFrameworkCore/Migrations/20240527092536_Remote-Tenant-Id-With-Text-Template.Designer.cs

@ -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
}
}
}

48
aspnet-core/migrations/LINGYUN.Abp.MicroService.AdminService.EntityFrameworkCore/Migrations/20240527092536_Remote-Tenant-Id-With-Text-Template.cs

@ -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" });
}
}
}

1051
aspnet-core/migrations/LINGYUN.Abp.MicroService.AdminService.EntityFrameworkCore/Migrations/20250410015324_Upgrade-Abp-Framework-To-9-1-1.Designer.cs

File diff suppressed because it is too large

127
aspnet-core/migrations/LINGYUN.Abp.MicroService.AdminService.EntityFrameworkCore/Migrations/20250410015324_Upgrade-Abp-Framework-To-9-1-1.cs

@ -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");
}
}
}

1101
aspnet-core/migrations/LINGYUN.Abp.MicroService.AdminService.EntityFrameworkCore/Migrations/20260420064540_Upgrade-Abp-Framework-To-10-0-2.Designer.cs

File diff suppressed because it is too large

127
aspnet-core/migrations/LINGYUN.Abp.MicroService.AdminService.EntityFrameworkCore/Migrations/20260420064540_Upgrade-Abp-Framework-To-10-0-2.cs

@ -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);
}
}
}

1101
aspnet-core/migrations/LINGYUN.Abp.MicroService.AdminService.EntityFrameworkCore/Migrations/20260626032421_Fix-MySql-Index-Key-Too-Lang-For-Resource-Permission-Grant.Designer.cs

File diff suppressed because it is too large

86
aspnet-core/migrations/LINGYUN.Abp.MicroService.AdminService.EntityFrameworkCore/Migrations/20260626032421_Fix-MySql-Index-Key-Too-Lang-For-Resource-Permission-Grant.cs

@ -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);
}
}
}

1098
aspnet-core/migrations/LINGYUN.Abp.MicroService.AdminService.EntityFrameworkCore/Migrations/AdminServiceMigrationsDbContextModelSnapshot.cs

File diff suppressed because it is too large

67
aspnet-core/migrations/LINGYUN.Abp.MicroService.AdminService.EntityFrameworkCore/README.EN.md

@ -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)

67
aspnet-core/migrations/LINGYUN.Abp.MicroService.AdminService.EntityFrameworkCore/README.md

@ -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)

60
aspnet-core/migrations/LINGYUN.Abp.MicroService.AuthServer.DbMigrator/AuthServerDbMigratorHostedService.cs

@ -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;
}
}

4
aspnet-core/migrations/LINGYUN.Abp.MicroService.AuthServer.DbMigrator/AuthServerDbMigratorModule.Configure.cs

@ -0,0 +1,4 @@
namespace LINGYUN.Abp.MicroService.AuthServer.DbMigrator;
public partial class AuthServerDbMigratorModule
{
}

19
aspnet-core/migrations/LINGYUN.Abp.MicroService.AuthServer.DbMigrator/AuthServerDbMigratorModule.cs

@ -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
{
}

20
aspnet-core/migrations/LINGYUN.Abp.MicroService.AuthServer.DbMigrator/AuthServerInitializeDataSeeder.cs

@ -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);
}
}

89
aspnet-core/migrations/LINGYUN.Abp.MicroService.AuthServer.DbMigrator/DataSeeds/IdentityUserNotificationDataSeeder.cs

@ -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);
}
}

42
aspnet-core/migrations/LINGYUN.Abp.MicroService.AuthServer.DbMigrator/LINGYUN.Abp.MicroService.AuthServer.DbMigrator.csproj

@ -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>

40
aspnet-core/migrations/LINGYUN.Abp.MicroService.AuthServer.DbMigrator/Program.cs

@ -0,0 +1,40 @@
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using Serilog;
using Serilog.Events;
namespace 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>();
});
}
}

11
aspnet-core/migrations/LINGYUN.Abp.MicroService.AuthServer.DbMigrator/Properties/launchSettings.json

@ -0,0 +1,11 @@
{
"profiles": {
"LINGYUN.Abp.MicroService.AuthServer.DbMigrator": {
"commandName": "Project",
"dotnetRunMessages": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}

66
aspnet-core/migrations/LINGYUN.Abp.MicroService.AuthServer.DbMigrator/README.EN.md

@ -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)

66
aspnet-core/migrations/LINGYUN.Abp.MicroService.AuthServer.DbMigrator/README.md

@ -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)

7
aspnet-core/migrations/LINGYUN.Abp.MicroService.AuthServer.DbMigrator/Usings.cs

@ -0,0 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp;
using LINGYUN.Abp;

35
aspnet-core/migrations/LINGYUN.Abp.MicroService.AuthServer.DbMigrator/appsettings.json

@ -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"
]
}
}
}
}

36
aspnet-core/migrations/LINGYUN.Abp.MicroService.AuthServer.EntityFrameworkCore/AuthServerDataSeeder.cs

@ -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);
}
}
}

47
aspnet-core/migrations/LINGYUN.Abp.MicroService.AuthServer.EntityFrameworkCore/AuthServerDbMigrationEventHandler.cs

@ -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);
}
}

38
aspnet-core/migrations/LINGYUN.Abp.MicroService.AuthServer.EntityFrameworkCore/AuthServerDbMigrationService.cs

@ -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());
}
}

31
aspnet-core/migrations/LINGYUN.Abp.MicroService.AuthServer.EntityFrameworkCore/AuthServerMigrationsDbContext.cs

@ -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();
}
}

29
aspnet-core/migrations/LINGYUN.Abp.MicroService.AuthServer.EntityFrameworkCore/AuthServerMigrationsDbContextFactory.cs

@ -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();
}
}

58
aspnet-core/migrations/LINGYUN.Abp.MicroService.AuthServer.EntityFrameworkCore/AuthServerMigrationsEntityFrameworkCoreModule.cs

@ -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>();
});
}
}

96
aspnet-core/migrations/LINGYUN.Abp.MicroService.AuthServer.EntityFrameworkCore/DataSeeds/IdentityClaimTypeDataSeeder.cs

@ -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));
}
}
}

149
aspnet-core/migrations/LINGYUN.Abp.MicroService.AuthServer.EntityFrameworkCore/DataSeeds/IdentityUserRoleDataSeeder.cs

@ -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();
}
}
}

437
aspnet-core/migrations/LINGYUN.Abp.MicroService.AuthServer.EntityFrameworkCore/DataSeeds/OpenIddictDataSeeder.cs

@ -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…
Cancel
Save