Browse Source

Merge pull request #353 from colinin/4.4

enhance(tenants): added  initializing data migration for new tenants
pull/364/head
yx lin 4 years ago
committed by GitHub
parent
commit
3c657c96d8
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 9
      aspnet-core/LINGYUN.MicroService.All.sln
  2. 10
      aspnet-core/LINGYUN.MicroService.BackendAdmin.sln
  3. 7
      aspnet-core/LINGYUN.MicroService.Common.sln
  4. 7
      aspnet-core/LINGYUN.MicroService.IdentityServer.sln
  5. 7
      aspnet-core/LINGYUN.MicroService.Localization.sln
  6. 7
      aspnet-core/LINGYUN.MicroService.Messages.sln
  7. 7
      aspnet-core/LINGYUN.MicroService.Platform.sln
  8. 21
      aspnet-core/modules/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/LINGYUN/Abp/AuditLogging/Elasticsearch/ElasticsearchAuditLogManager.cs
  9. 7
      aspnet-core/modules/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/LINGYUN/Abp/AuditLogging/Elasticsearch/ElasticsearchSecurityLogManager.cs
  10. 12
      aspnet-core/modules/common/LINGYUN.Abp.Data.DbMigrator/LINGYUN.Abp.Data.DbMigrator.csproj
  11. 12
      aspnet-core/modules/common/LINGYUN.Abp.Data.DbMigrator/LINGYUN/Abp/Data/DbMigrator/AbpDataDbMigratorModule.cs
  12. 49
      aspnet-core/modules/common/LINGYUN.Abp.Data.DbMigrator/LINGYUN/Abp/Data/DbMigrator/DefaultDbSchemaMigrator.cs
  13. 15
      aspnet-core/modules/common/LINGYUN.Abp.Data.DbMigrator/LINGYUN/Abp/Data/DbMigrator/IDbSchemaMigrator.cs
  14. 56
      aspnet-core/modules/common/LINGYUN.Abp.Data.DbMigrator/README.md
  15. 3
      aspnet-core/modules/logging/LINGYUN.Abp.Logging.Serilog.Elasticsearch/LINGYUN/Abp/AuditLogging/Serilog/Elasticsearch/AbpLoggingSerilogElasticsearchModule.cs
  16. 88
      aspnet-core/modules/logging/LINGYUN.Abp.Logging.Serilog.Elasticsearch/LINGYUN/Abp/AuditLogging/Serilog/Elasticsearch/SerilogElasticsearchLoggingManager.cs
  17. 4
      aspnet-core/modules/logging/LINGYUN.Abp.Logging.Serilog.Elasticsearch/LINGYUN/Abp/AuditLogging/Serilog/Elasticsearch/SerilogField.cs
  18. 15
      aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain/LINGYUN/Abp/OssManagement/AbpOssManagementDomainModule.cs
  19. 30
      aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain/LINGYUN/Abp/OssManagement/OssStaticContainerDataSeedContributor.cs
  20. 64
      aspnet-core/modules/tenants/LINGYUN.Abp.TenantManagement.Application.Contracts/LINGYUN/Abp/TenantManagement/AbpTenantManagementApplicationContractsModule.cs
  21. 40
      aspnet-core/modules/tenants/LINGYUN.Abp.TenantManagement.Application.Contracts/LINGYUN/Abp/TenantManagement/Dto/TenantCreateDto.cs
  22. 17
      aspnet-core/modules/tenants/LINGYUN.Abp.TenantManagement.Application.Contracts/LINGYUN/Abp/TenantManagement/Localization/Resources/en.json
  23. 17
      aspnet-core/modules/tenants/LINGYUN.Abp.TenantManagement.Application.Contracts/LINGYUN/Abp/TenantManagement/Localization/Resources/zh-Hans.json
  24. 30
      aspnet-core/modules/tenants/LINGYUN.Abp.TenantManagement.Application/LINGYUN/Abp/TenantManagement/TenantAppService.cs
  25. 2
      aspnet-core/services/account/AuthServer.Host/AuthIdentityServerModule.cs
  26. 1
      aspnet-core/services/account/AuthServer.Host/AuthServer.Host.csproj
  27. 49
      aspnet-core/services/account/AuthServer.Host/EntityFrameworkCore/AuthServerHostMigrationsDbContext.cs
  28. 88
      aspnet-core/services/account/AuthServer.Host/EventBus/Handlers/TenantCreateEventHandler.cs
  29. 134
      aspnet-core/services/account/AuthServer.Host/EventBus/Handlers/TenantSynchronizer.cs
  30. 1259
      aspnet-core/services/account/AuthServer.Host/Migrations/20200513010936_Migration-IdentityServer-MySql.Designer.cs
  31. 773
      aspnet-core/services/account/AuthServer.Host/Migrations/20200513010936_Migration-IdentityServer-MySql.cs
  32. 1426
      aspnet-core/services/account/AuthServer.Host/Migrations/20200606012143_Upgrade-Abp-2.9.0.Designer.cs
  33. 199
      aspnet-core/services/account/AuthServer.Host/Migrations/20200606012143_Upgrade-Abp-2.9.0.cs
  34. 1512
      aspnet-core/services/account/AuthServer.Host/Migrations/20200908015651_Upgrade-Abp-3.1.0.Designer.cs
  35. 236
      aspnet-core/services/account/AuthServer.Host/Migrations/20200908015651_Upgrade-Abp-3.1.0.cs
  36. 657
      aspnet-core/services/account/AuthServer.Host/Migrations/20201222101851_Upgrade-Abp-4.0.0.cs
  37. 1774
      aspnet-core/services/account/AuthServer.Host/Migrations/20210302035805_Add-IdentityUser-AvatarUrl.Designer.cs
  38. 24
      aspnet-core/services/account/AuthServer.Host/Migrations/20210302035805_Add-IdentityUser-AvatarUrl.cs
  39. 3544
      aspnet-core/services/account/AuthServer.Host/Migrations/20211030124247_Re-Initlize-Db-Migration.Designer.cs
  40. 1221
      aspnet-core/services/account/AuthServer.Host/Migrations/20211030124247_Re-Initlize-Db-Migration.cs
  41. 3544
      aspnet-core/services/account/AuthServer.Host/Migrations/AuthServerHostMigrationsDbContextModelSnapshot.cs
  42. 4
      aspnet-core/services/account/AuthServer.Host/appsettings.Development.json
  43. 2
      aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/BackendAdminHostModule.cs
  44. 11
      aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/EventBus/Handlers/TenantConnectionStringCreateEventHandler.cs
  45. 82
      aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/EventBus/Handlers/TenantDeleteEventHandler.cs
  46. 299
      aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/EventBus/Handlers/TenantSynchronizer.cs
  47. 5
      aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/LINGYUN.Abp.BackendAdmin.HttpApi.Host.csproj
  48. 175
      aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/Migrations/20200804085641_Migration-Backend-Admin-MySql.Designer.cs
  49. 111
      aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/Migrations/20200804085641_Migration-Backend-Admin-MySql.cs
  50. 37
      aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/Migrations/20200910080638_Add-abp-feature-module.cs
  51. 485
      aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/Migrations/20200928020134_Add-abp-audit-logging-module.Designer.cs
  52. 166
      aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/Migrations/20200928020134_Add-abp-audit-logging-module.cs
  53. 417
      aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/Migrations/20211030090436_Re-Initlize-Db-Migration.Designer.cs
  54. 158
      aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/Migrations/20211030090436_Re-Initlize-Db-Migration.cs
  55. 692
      aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/Migrations/BackendAdminHostMigrationsDbContextModelSnapshot.cs
  56. 6
      aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/appsettings.Development.json
  57. 2
      aspnet-core/services/apigateway/LINGYUN.ApiGateway.Host/appsettings.Development.json
  58. 4
      aspnet-core/services/apigateway/LINGYUN.ApiGateway.HttpApi.Host/appsettings.Development.json
  59. 4
      aspnet-core/services/identity-server/LINGYUN.Abp.IdentityServer4.HttpApi.Host/appsettings.Development.json
  60. 2
      aspnet-core/services/localization/LINGYUN.Abp.LocalizationManagement.HttpApi.Host/AbpLocalizationManagementHttpApiHostModule.cs
  61. 56
      aspnet-core/services/localization/LINGYUN.Abp.LocalizationManagement.HttpApi.Host/EventBus/Handlers/TenantSynchronizer.cs
  62. 1
      aspnet-core/services/localization/LINGYUN.Abp.LocalizationManagement.HttpApi.Host/LINGYUN.Abp.LocalizationManagement.HttpApi.Host.csproj
  63. 4
      aspnet-core/services/localization/LINGYUN.Abp.LocalizationManagement.HttpApi.Host/appsettings.Development.json
  64. 2
      aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/AbpMessageServiceHttpApiHostModule.cs
  65. 64
      aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/EventBus/Distributed/NotificationEventHandler.cs
  66. 51
      aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/EventBus/Distributed/TenantSynchronizer.cs
  67. 1
      aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/LINGYUN.Abp.MessageService.HttpApi.Host.csproj
  68. 130
      aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/Migrations/20200601060701_Add-Abp-Message-Service-Module.Designer.cs
  69. 93
      aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/Migrations/20200601060701_Add-Abp-Message-Service-Module.cs
  70. 494
      aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/Migrations/20200602134027_Add-Chat-Message-Entites.Designer.cs
  71. 281
      aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/Migrations/20200602134027_Add-Chat-Message-Entites.cs
  72. 503
      aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/Migrations/20200609151853_Create-User-Subscription-Column-UserName.Designer.cs
  73. 24
      aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/Migrations/20200609151853_Create-User-Subscription-Column-UserName.cs
  74. 508
      aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/Migrations/20200617010925_Add-Notification-Column-CateGory.Designer.cs
  75. 42
      aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/Migrations/20200617010925_Add-Notification-Column-CateGory.cs
  76. 590
      aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/Migrations/20201024093309_Add-MemberCard-Entity.Designer.cs
  77. 125
      aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/Migrations/20201024093309_Add-MemberCard-Entity.cs
  78. 634
      aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/Migrations/20201024114206_Add-UserChatFriend-Entity.Designer.cs
  79. 44
      aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/Migrations/20201024114206_Add-UserChatFriend-Entity.cs
  80. 588
      aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/Migrations/20201029102936_Add-UserChatFriend-Column-Description.Designer.cs
  81. 116
      aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/Migrations/20201029102936_Add-UserChatFriend-Column-Description.cs
  82. 51
      aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/Migrations/20201030032219_Based-Message-Entity-To-AggregateRoot.cs
  83. 1224
      aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/Migrations/20211030131449_Re-Initlize-Db-Migration.Designer.cs
  84. 415
      aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/Migrations/20211030131449_Re-Initlize-Db-Migration.cs
  85. 1220
      aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/Migrations/MessageServiceHostMigrationsDbContextModelSnapshot.cs
  86. 4
      aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/appsettings.Development.json
  87. 2
      aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/AppPlatformHttpApiHostModule.cs
  88. 47
      aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/EventBus/Handlers/TenantSynchronizer.cs
  89. 1
      aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/LINGYUN.Platform.HttpApi.Host.csproj
  90. 397
      aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/Migrations/20200723133732_Add-Platform-Module.Designer.cs
  91. 206
      aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/Migrations/20200723133732_Add-Platform-Module.cs
  92. 397
      aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/Migrations/20200723143103_Modify-Version-File-SHA256-Length.Designer.cs
  93. 31
      aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/Migrations/20200723143103_Modify-Version-File-SHA256-Length.cs
  94. 406
      aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/Migrations/20200724092022_Add-Version-File-Field-Path-And-Platform-Type.Designer.cs
  95. 52
      aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/Migrations/20200724092022_Add-Version-File-Field-Path-And-Platform-Type.cs
  96. 637
      aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/Migrations/20201203105205_Add-Menu-Layout-Data-And-More-Entity.Designer.cs
  97. 338
      aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/Migrations/20201203105205_Add-Menu-Layout-Data-And-More-Entity.cs
  98. 643
      aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/Migrations/20201204082313_Add-Data-Item-AllowBeNull-Field.Designer.cs
  99. 40
      aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/Migrations/20201204082313_Add-Data-Item-AllowBeNull-Field.cs
  100. 645
      aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/Migrations/20201204083250_Data-Description-Field-Allow-Be-Long.Designer.cs

9
aspnet-core/LINGYUN.MicroService.All.sln

@ -349,7 +349,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.AuditLogging.El
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.AuditLogging.EntityFrameworkCore", "modules\auditing\LINGYUN.Abp.AuditLogging.EntityFrameworkCore\LINGYUN.Abp.AuditLogging.EntityFrameworkCore.csproj", "{F71A0D28-397D-4094-B1C2-7925E1310676}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.Serilog.Enrichers.Application", "modules\logging\LINGYUN.Abp.Serilog.Enrichers.Application\LINGYUN.Abp.Serilog.Enrichers.Application.csproj", "{CEAF0044-28D3-4585-B69D-D65FF6D4745E}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Serilog.Enrichers.Application", "modules\logging\LINGYUN.Abp.Serilog.Enrichers.Application\LINGYUN.Abp.Serilog.Enrichers.Application.csproj", "{CEAF0044-28D3-4585-B69D-D65FF6D4745E}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Data.DbMigrator", "modules\common\LINGYUN.Abp.Data.DbMigrator\LINGYUN.Abp.Data.DbMigrator.csproj", "{91D9F43A-BFD9-47CA-A6AD-430D1663EFF3}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@ -917,6 +919,10 @@ Global
{CEAF0044-28D3-4585-B69D-D65FF6D4745E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CEAF0044-28D3-4585-B69D-D65FF6D4745E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CEAF0044-28D3-4585-B69D-D65FF6D4745E}.Release|Any CPU.Build.0 = Release|Any CPU
{91D9F43A-BFD9-47CA-A6AD-430D1663EFF3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{91D9F43A-BFD9-47CA-A6AD-430D1663EFF3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{91D9F43A-BFD9-47CA-A6AD-430D1663EFF3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{91D9F43A-BFD9-47CA-A6AD-430D1663EFF3}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -1090,6 +1096,7 @@ Global
{AD3CC5B5-366B-4E34-8E80-EC5BB68B573A} = {67DAB2A0-D407-4CAB-8414-AE3D0AC52FC4}
{F71A0D28-397D-4094-B1C2-7925E1310676} = {67DAB2A0-D407-4CAB-8414-AE3D0AC52FC4}
{CEAF0044-28D3-4585-B69D-D65FF6D4745E} = {6FC0578B-CDF1-43AD-9F7E-4AA7E4720A02}
{91D9F43A-BFD9-47CA-A6AD-430D1663EFF3} = {8AC72641-30D3-4ACF-89FA-808FADC55C2E}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {C95FDF91-16F2-4A8B-A4BE-0E62D1B66718}

10
aspnet-core/LINGYUN.MicroService.BackendAdmin.sln

@ -89,6 +89,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Logging.Serilog
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Serilog.Enrichers.Application", "modules\logging\LINGYUN.Abp.Serilog.Enrichers.Application\LINGYUN.Abp.Serilog.Enrichers.Application.csproj", "{2AF1B4CF-471E-40FA-AF7B-CD730DA5EB7F}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "common", "common", "{380FF8BB-8924-470B-B52A-53A7E28C324D}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Data.DbMigrator", "modules\common\LINGYUN.Abp.Data.DbMigrator\LINGYUN.Abp.Data.DbMigrator.csproj", "{765D9D60-9F22-4A58-964E-5747003431BB}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -219,6 +223,10 @@ Global
{2AF1B4CF-471E-40FA-AF7B-CD730DA5EB7F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2AF1B4CF-471E-40FA-AF7B-CD730DA5EB7F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2AF1B4CF-471E-40FA-AF7B-CD730DA5EB7F}.Release|Any CPU.Build.0 = Release|Any CPU
{765D9D60-9F22-4A58-964E-5747003431BB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{765D9D60-9F22-4A58-964E-5747003431BB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{765D9D60-9F22-4A58-964E-5747003431BB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{765D9D60-9F22-4A58-964E-5747003431BB}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -265,6 +273,8 @@ Global
{0C800A57-2658-4640-99A1-A02805EE6E99} = {FC5C41DC-3E6E-4775-A6A2-D5B5B490B13D}
{EBDD5D30-7F82-46EB-A4E9-213932D14047} = {FC5C41DC-3E6E-4775-A6A2-D5B5B490B13D}
{2AF1B4CF-471E-40FA-AF7B-CD730DA5EB7F} = {FC5C41DC-3E6E-4775-A6A2-D5B5B490B13D}
{380FF8BB-8924-470B-B52A-53A7E28C324D} = {ED23B2F3-87C1-44B6-8906-9DE739422C2C}
{765D9D60-9F22-4A58-964E-5747003431BB} = {380FF8BB-8924-470B-B52A-53A7E28C324D}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {1573B900-87BA-4AD3-B785-6DD78127ADEF}

7
aspnet-core/LINGYUN.MicroService.Common.sln

@ -180,6 +180,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Serilog.Enriche
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Localization.Dynamic", "modules\common\LINGYUN.Abp.Localization.Dynamic\LINGYUN.Abp.Localization.Dynamic.csproj", "{4635BDFB-B647-43E2-BAA5-D3C17899AF24}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Data.DbMigrator", "modules\common\LINGYUN.Abp.Data.DbMigrator\LINGYUN.Abp.Data.DbMigrator.csproj", "{3993A315-B250-4C5D-98C7-90FD06841B66}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -466,6 +468,10 @@ Global
{4635BDFB-B647-43E2-BAA5-D3C17899AF24}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4635BDFB-B647-43E2-BAA5-D3C17899AF24}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4635BDFB-B647-43E2-BAA5-D3C17899AF24}.Release|Any CPU.Build.0 = Release|Any CPU
{3993A315-B250-4C5D-98C7-90FD06841B66}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3993A315-B250-4C5D-98C7-90FD06841B66}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3993A315-B250-4C5D-98C7-90FD06841B66}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3993A315-B250-4C5D-98C7-90FD06841B66}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -556,6 +562,7 @@ Global
{CD556F2A-A96B-43A2-8BB3-6C0EBA27EB02} = {23F4260D-87C1-4AA6-A302-0A8A76D53BA1}
{CCB4AE25-7059-4CA0-A3AB-CBB863A3F672} = {23F4260D-87C1-4AA6-A302-0A8A76D53BA1}
{4635BDFB-B647-43E2-BAA5-D3C17899AF24} = {E73A0F8B-2B4B-4CED-82A4-1EE5E0B89744}
{3993A315-B250-4C5D-98C7-90FD06841B66} = {086BE5BE-8594-4DA7-8819-935FEF76DABD}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {06C707C6-02C0-411A-AD3B-2D0E13787CB8}

7
aspnet-core/LINGYUN.MicroService.IdentityServer.sln

@ -69,6 +69,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.AuditLogging.El
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Serilog.Enrichers.Application", "modules\logging\LINGYUN.Abp.Serilog.Enrichers.Application\LINGYUN.Abp.Serilog.Enrichers.Application.csproj", "{596F645E-19F4-45C4-BED6-7BB6B32F5684}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Data.DbMigrator", "modules\common\LINGYUN.Abp.Data.DbMigrator\LINGYUN.Abp.Data.DbMigrator.csproj", "{0F8184B5-37B8-432E-8017-04B903175D31}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -163,6 +165,10 @@ Global
{596F645E-19F4-45C4-BED6-7BB6B32F5684}.Debug|Any CPU.Build.0 = Debug|Any CPU
{596F645E-19F4-45C4-BED6-7BB6B32F5684}.Release|Any CPU.ActiveCfg = Release|Any CPU
{596F645E-19F4-45C4-BED6-7BB6B32F5684}.Release|Any CPU.Build.0 = Release|Any CPU
{0F8184B5-37B8-432E-8017-04B903175D31}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0F8184B5-37B8-432E-8017-04B903175D31}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0F8184B5-37B8-432E-8017-04B903175D31}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0F8184B5-37B8-432E-8017-04B903175D31}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -198,6 +204,7 @@ Global
{6D86FA60-9969-4401-851C-6B8845B3FCC9} = {42D02351-CF36-402A-B89A-F10D3DAD8EC8}
{489CC1F9-C648-4E3C-869B-0CEE0454EE9E} = {42D02351-CF36-402A-B89A-F10D3DAD8EC8}
{596F645E-19F4-45C4-BED6-7BB6B32F5684} = {ACA1734A-4BF5-4DF9-94CF-3E5B3535B480}
{0F8184B5-37B8-432E-8017-04B903175D31} = {572DBB40-4637-4C01-8491-8686F7E22B45}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {FCB77471-9ECB-4666-A316-1D6A6285A468}

7
aspnet-core/LINGYUN.MicroService.Localization.sln

@ -47,6 +47,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.AuditLogging",
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.AuditLogging.Elasticsearch", "modules\auditing\LINGYUN.Abp.AuditLogging.Elasticsearch\LINGYUN.Abp.AuditLogging.Elasticsearch.csproj", "{EB92BC91-D883-4AB0-9F93-72AA9D7CC68C}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Data.DbMigrator", "modules\common\LINGYUN.Abp.Data.DbMigrator\LINGYUN.Abp.Data.DbMigrator.csproj", "{37E0844A-61C6-47FA-9F76-79628B412818}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -109,6 +111,10 @@ Global
{EB92BC91-D883-4AB0-9F93-72AA9D7CC68C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EB92BC91-D883-4AB0-9F93-72AA9D7CC68C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EB92BC91-D883-4AB0-9F93-72AA9D7CC68C}.Release|Any CPU.Build.0 = Release|Any CPU
{37E0844A-61C6-47FA-9F76-79628B412818}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{37E0844A-61C6-47FA-9F76-79628B412818}.Debug|Any CPU.Build.0 = Debug|Any CPU
{37E0844A-61C6-47FA-9F76-79628B412818}.Release|Any CPU.ActiveCfg = Release|Any CPU
{37E0844A-61C6-47FA-9F76-79628B412818}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -128,6 +134,7 @@ Global
{7BC49B77-7EFF-4998-9628-748DF18125C6} = {F89D9154-58D8-4F26-8DD7-F907D68DB9E5}
{B71D1883-106A-409B-958A-2D1F561F4357} = {0C15D7EE-42C4-4FB5-9970-8ED75B02EE9E}
{EB92BC91-D883-4AB0-9F93-72AA9D7CC68C} = {0C15D7EE-42C4-4FB5-9970-8ED75B02EE9E}
{37E0844A-61C6-47FA-9F76-79628B412818} = {19D90C55-2B0C-4E41-8BE5-23BA946071DB}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {F65E7489-B7F7-469E-8D24-7CBEEBACD119}

7
aspnet-core/LINGYUN.MicroService.Messages.sln

@ -93,6 +93,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.AuditLogging",
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.AuditLogging.Elasticsearch", "modules\auditing\LINGYUN.Abp.AuditLogging.Elasticsearch\LINGYUN.Abp.AuditLogging.Elasticsearch.csproj", "{69F5D2A0-480E-4461-9C30-1678F23258C1}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Data.DbMigrator", "modules\common\LINGYUN.Abp.Data.DbMigrator\LINGYUN.Abp.Data.DbMigrator.csproj", "{298D561E-3AFB-4161-82F1-DF0F8C54BBB4}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -247,6 +249,10 @@ Global
{69F5D2A0-480E-4461-9C30-1678F23258C1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{69F5D2A0-480E-4461-9C30-1678F23258C1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{69F5D2A0-480E-4461-9C30-1678F23258C1}.Release|Any CPU.Build.0 = Release|Any CPU
{298D561E-3AFB-4161-82F1-DF0F8C54BBB4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{298D561E-3AFB-4161-82F1-DF0F8C54BBB4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{298D561E-3AFB-4161-82F1-DF0F8C54BBB4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{298D561E-3AFB-4161-82F1-DF0F8C54BBB4}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -294,6 +300,7 @@ Global
{321FC8A7-D595-431A-AC14-1F5E1B901BCF} = {91E005C0-3A78-47C2-86F1-A21362ED350E}
{4D594462-D10D-46AF-980E-95EDE676F1CF} = {F566D959-7F56-4EB4-A448-A87AEFC92178}
{69F5D2A0-480E-4461-9C30-1678F23258C1} = {F566D959-7F56-4EB4-A448-A87AEFC92178}
{298D561E-3AFB-4161-82F1-DF0F8C54BBB4} = {C00828FB-E7D5-4086-BA50-02022594AB73}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {6238659A-7267-49B9-A499-8746BDEED6B8}

7
aspnet-core/LINGYUN.MicroService.Platform.sln

@ -84,6 +84,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.AuditLogging.El
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Serilog.Enrichers.Application", "modules\logging\LINGYUN.Abp.Serilog.Enrichers.Application\LINGYUN.Abp.Serilog.Enrichers.Application.csproj", "{6C048526-5A14-4835-B8BA-1C0C6E887225}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Data.DbMigrator", "modules\common\LINGYUN.Abp.Data.DbMigrator\LINGYUN.Abp.Data.DbMigrator.csproj", "{FA49E154-CD90-4E11-8216-3EF545C32294}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -206,6 +208,10 @@ Global
{6C048526-5A14-4835-B8BA-1C0C6E887225}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6C048526-5A14-4835-B8BA-1C0C6E887225}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6C048526-5A14-4835-B8BA-1C0C6E887225}.Release|Any CPU.Build.0 = Release|Any CPU
{FA49E154-CD90-4E11-8216-3EF545C32294}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FA49E154-CD90-4E11-8216-3EF545C32294}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FA49E154-CD90-4E11-8216-3EF545C32294}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FA49E154-CD90-4E11-8216-3EF545C32294}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -247,6 +253,7 @@ Global
{04D53D5C-873D-4A66-98D4-88195E927E20} = {20E8BAE5-C13E-4F86-9EB0-EF24F50442B5}
{F90823E2-53DC-4751-BCCD-6C11B3899592} = {20E8BAE5-C13E-4F86-9EB0-EF24F50442B5}
{6C048526-5A14-4835-B8BA-1C0C6E887225} = {D845545B-57C4-43A1-985B-23C372340CD6}
{FA49E154-CD90-4E11-8216-3EF545C32294} = {265D5E44-682B-49BC-984A-BDD8CA45E60E}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {03D3B66F-8926-4C00-B7AB-A21761EC859E}

21
aspnet-core/modules/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/LINGYUN/Abp/AuditLogging/Elasticsearch/ElasticsearchAuditLogManager.cs

@ -82,7 +82,7 @@ namespace LINGYUN.Abp.AuditLogging.Elasticsearch
hasException,
httpStatusCode);
var response = await client.CountAsync<AuditLog>(dsl =>
var response = await client.CountAsync<AuditLog>(dsl =>
dsl.Index(CreateIndex())
.Query(log => log.Bool(b => b.Must(querys.ToArray()))),
cancellationToken);
@ -115,7 +115,7 @@ namespace LINGYUN.Abp.AuditLogging.Elasticsearch
var sortOrder = !sorting.IsNullOrWhiteSpace() && sorting.EndsWith("asc", StringComparison.InvariantCultureIgnoreCase)
? SortOrder.Ascending : SortOrder.Descending;
sorting = !sorting.IsNullOrWhiteSpace()
sorting = !sorting.IsNullOrWhiteSpace()
? sorting.Split()[0]
: nameof(AuditLog.ExecutionTime);
@ -135,7 +135,7 @@ namespace LINGYUN.Abp.AuditLogging.Elasticsearch
hasException,
httpStatusCode);
SourceFilterDescriptor<AuditLog> ConvertFileSystem(SourceFilterDescriptor<AuditLog> selector)
SourceFilterDescriptor<AuditLog> SourceFilter(SourceFilterDescriptor<AuditLog> selector)
{
selector.IncludeAll();
if (!includeDetails)
@ -153,7 +153,7 @@ namespace LINGYUN.Abp.AuditLogging.Elasticsearch
var response = await client.SearchAsync<AuditLog>(dsl =>
dsl.Index(CreateIndex())
.Query(log => log.Bool(b => b.Must(querys.ToArray())))
.Source(ConvertFileSystem)
.Source(SourceFilter)
.Sort(log => log.Field(GetField(sorting), sortOrder))
.From(skipCount)
.Size(maxResultCount),
@ -163,8 +163,8 @@ namespace LINGYUN.Abp.AuditLogging.Elasticsearch
}
public virtual async Task<AuditLog> GetAsync(
Guid id,
bool includeDetails = false,
Guid id,
bool includeDetails = false,
CancellationToken cancellationToken = default)
{
var client = _clientFactory.Create();
@ -219,9 +219,9 @@ namespace LINGYUN.Abp.AuditLogging.Elasticsearch
var auditLog = await _converter.ConvertAsync(auditLogInfo);
var response = await client.IndexAsync(
auditLog,
auditLog,
(x) => x.Index(CreateIndex())
.Id(auditLog.Id),
.Id(auditLog.Id),
cancellationToken);
return response.Id;
@ -359,13 +359,12 @@ namespace LINGYUN.Abp.AuditLogging.Elasticsearch
};
protected virtual string GetField(string field)
{
field = _elasticsearchOptions.FieldCamelCase ? field.ToCamelCase() : field.ToPascalCase();
if (_fieldMaps.TryGetValue(field, out string mapField))
{
return mapField;
return _elasticsearchOptions.FieldCamelCase ? mapField.ToCamelCase() : mapField.ToPascalCase();
}
return field;
return _elasticsearchOptions.FieldCamelCase ? field.ToCamelCase() : field.ToPascalCase();
}
}
}

7
aspnet-core/modules/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/LINGYUN/Abp/AuditLogging/Elasticsearch/ElasticsearchSecurityLogManager.cs

@ -245,7 +245,7 @@ namespace LINGYUN.Abp.AuditLogging.Elasticsearch
{
return $"{_options.IndexPrefix}-security-log-{_currentTenant.Id:N}";
}
return _options.IndexPrefix.IsNullOrWhiteSpace()
return _options.IndexPrefix.IsNullOrWhiteSpace()
? "security-log"
: $"{_options.IndexPrefix}-security-log";
}
@ -267,13 +267,12 @@ namespace LINGYUN.Abp.AuditLogging.Elasticsearch
};
protected virtual string GetField(string field)
{
field = _elasticsearchOptions.FieldCamelCase ? field.ToCamelCase() : field.ToPascalCase();
if (_fieldMaps.TryGetValue(field, out string mapField))
{
return mapField;
return _elasticsearchOptions.FieldCamelCase ? mapField.ToCamelCase() : mapField.ToPascalCase();
}
return field;
return _elasticsearchOptions.FieldCamelCase ? field.ToCamelCase() : field.ToPascalCase();
}
}
}

12
aspnet-core/modules/common/LINGYUN.Abp.Data.DbMigrator/LINGYUN.Abp.Data.DbMigrator.csproj

@ -0,0 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<RootNamespace />
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.EntityFrameworkCore" Version="4.4.0" />
</ItemGroup>
</Project>

12
aspnet-core/modules/common/LINGYUN.Abp.Data.DbMigrator/LINGYUN/Abp/Data/DbMigrator/AbpDataDbMigratorModule.cs

@ -0,0 +1,12 @@
using Volo.Abp.EntityFrameworkCore;
using Volo.Abp.Modularity;
namespace LINGYUN.Abp.Data.DbMigrator
{
[DependsOn(
typeof(AbpEntityFrameworkCoreModule))]
public class AbpDataDbMigratorModule : AbpModule
{
}
}

49
aspnet-core/modules/common/LINGYUN.Abp.Data.DbMigrator/LINGYUN/Abp/Data/DbMigrator/DefaultDbSchemaMigrator.cs

@ -0,0 +1,49 @@
using JetBrains.Annotations;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options;
using System;
using System.Threading.Tasks;
using Volo.Abp.Data;
using Volo.Abp.EntityFrameworkCore;
using Volo.Abp.DependencyInjection;
namespace LINGYUN.Abp.Data.DbMigrator
{
public class DefaultDbSchemaMigrator : IDbSchemaMigrator, ITransientDependency
{
private readonly IServiceProvider _serviceProvider;
private readonly AbpDbConnectionOptions _dbConnectionOptions;
public DefaultDbSchemaMigrator(
IServiceProvider serviceProvider,
IOptions<AbpDbConnectionOptions> dbConnectionOptions)
{
_serviceProvider = serviceProvider;
_dbConnectionOptions = dbConnectionOptions.Value;
}
public virtual async Task MigrateAsync<TDbContext>(
[NotNull] Func<string, DbContextOptionsBuilder<TDbContext>, TDbContext> configureDbContext)
where TDbContext : AbpDbContext<TDbContext>
{
var connectionStringResolver = _serviceProvider
.GetRequiredService<IConnectionStringResolver>();
var connectionString = await connectionStringResolver.ResolveAsync();
// 租户连接字符串与默认连接字符串相同,则不执行迁移脚本
if (string.Equals(
connectionString,
_dbConnectionOptions.ConnectionStrings.Default,
StringComparison.InvariantCultureIgnoreCase))
{
return;
}
var dbContextBuilder = new DbContextOptionsBuilder<TDbContext>();
using var dbContext = configureDbContext(connectionString, dbContextBuilder);
await dbContext.Database.MigrateAsync();
}
}
}

15
aspnet-core/modules/common/LINGYUN.Abp.Data.DbMigrator/LINGYUN/Abp/Data/DbMigrator/IDbSchemaMigrator.cs

@ -0,0 +1,15 @@
using JetBrains.Annotations;
using Microsoft.EntityFrameworkCore;
using System;
using System.Threading.Tasks;
using Volo.Abp.EntityFrameworkCore;
namespace LINGYUN.Abp.Data.DbMigrator
{
public interface IDbSchemaMigrator
{
Task MigrateAsync<TDbContext>(
[NotNull] Func<string, DbContextOptionsBuilder<TDbContext>, TDbContext> configureDbContext)
where TDbContext : AbpDbContext<TDbContext>;
}
}

56
aspnet-core/modules/common/LINGYUN.Abp.Data.DbMigrator/README.md

@ -0,0 +1,56 @@
# LINGYUN.Abp.Data.DbMigrator
数据迁移模块,用于配合需要提供数据初始化的场景(例如新租户创建时)
## 配置使用
```csharp
[DependsOn(typeof(AbpDataDbMigratorModule))]
public class YouProjectModule : AbpModule
{
// other
}
public class FakeDbContext : AbpDbContext<FakeDbContext>
{
public FakeDbContext(DbContextOptions<FakeDbContext> options)
: base(options)
{
}
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
base.OnModelCreating(modelBuilder);
}
}
public class FakeMigretor
{
private readonly IDbSchemaMigrator _migrator;
public FakeMigretor(
IDbSchemaMigrator migrator)
{
_migrator = migrator;
}
public async Task MigrateAsync()
{
// 将执行 EF 迁移脚本, 需要提供用作数据迁移的 DbContext
await _migrator.MigrateAsync<FakeDbContext>(
// connectionString: 当前租户连接字符串,用于构建连接
// builder: 用于初始化上下文的构造器
(connectionString, builder) =>
{
// 在委托中由用户决定数据库参数
builder.UseMySql(connectionString, ServerVersion.AutoDetect(connectionString));
// 返回实例化的DbContext
return new FakeDbContext(builder.Options);
});
}
}
```

3
aspnet-core/modules/logging/LINGYUN.Abp.Logging.Serilog.Elasticsearch/LINGYUN/Abp/AuditLogging/Serilog/Elasticsearch/AbpLoggingSerilogElasticsearchModule.cs

@ -1,10 +1,7 @@
using LINGYUN.Abp.Elasticsearch;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
using Microsoft.Extensions.Options;
using Volo.Abp.AutoMapper;
using Volo.Abp.Json;
using Volo.Abp.Json.SystemTextJson;
using Volo.Abp.Modularity;
namespace LINGYUN.Abp.Logging.Serilog.Elasticsearch

88
aspnet-core/modules/logging/LINGYUN.Abp.Logging.Serilog.Elasticsearch/LINGYUN/Abp/AuditLogging/Serilog/Elasticsearch/SerilogElasticsearchLoggingManager.cs

@ -11,6 +11,7 @@ using System.Text.RegularExpressions;
using System.Threading;
using System.Threading.Tasks;
using Volo.Abp.DependencyInjection;
using Volo.Abp.MultiTenancy;
using Volo.Abp.ObjectMapping;
namespace LINGYUN.Abp.Logging.Serilog.Elasticsearch
@ -21,6 +22,7 @@ namespace LINGYUN.Abp.Logging.Serilog.Elasticsearch
private static readonly Regex IndexFormatRegex = new Regex(@"^(.*)(?:\{0\:.+\})(.*)$");
private readonly IObjectMapper _objectMapper;
private readonly ICurrentTenant _currentTenant;
private readonly AbpLoggingSerilogElasticsearchOptions _options;
private readonly IElasticsearchClientFactory _clientFactory;
@ -28,10 +30,12 @@ namespace LINGYUN.Abp.Logging.Serilog.Elasticsearch
public SerilogElasticsearchLoggingManager(
IObjectMapper objectMapper,
ICurrentTenant currentTenant,
IOptions<AbpLoggingSerilogElasticsearchOptions> options,
IElasticsearchClientFactory clientFactory)
{
_objectMapper = objectMapper;
_currentTenant = currentTenant;
_clientFactory = clientFactory;
_options = options.Value;
@ -50,15 +54,71 @@ namespace LINGYUN.Abp.Logging.Serilog.Elasticsearch
{
var client = _clientFactory.Create();
var response = await client.SearchAsync<SerilogInfo>(
dsl =>
dsl.Index(CreateIndex())
.Query(
(q) => q.Bool(
(b) => b.Should(
(s) => s.Term(
(t) => t.Field("@timestamp").Value(id))))),
cancellationToken);
ISearchResponse<SerilogInfo> response;
if (_currentTenant.IsAvailable)
{
/*
"query": {
"bool": {
"must": [
{
"term": {
"fields.TenantId.keyword": {
"value": _currentTenant.GetId()
}
}
},
{
"term": {
"@timestamp": {
"value": "2021-10-31T09:53:12.3406273+08:00"
}
}
}
]
}
}
*/
response = await client.SearchAsync<SerilogInfo>(
dsl =>
dsl.Index(CreateIndex())
.Query(
(q) => q.Bool(
(b) => b.Must(
(s) => s.Term(
(t) => t.Field("@timestamp").Value(id)),
(s) => s.Term(
(t) => t.Field(f => f.Fields.TenantId.Suffix("keyword")).Value(_currentTenant.GetId()))))),
cancellationToken);
}
else
{
/*
"query": {
"bool": {
"must": [
{
"term": {
"@timestamp": {
"value": "2021-10-31T09:53:12.3406273+08:00"
}
}
}
]
}
}
*/
response = await client.SearchAsync<SerilogInfo>(
dsl =>
dsl.Index(CreateIndex())
.Query(
(q) => q.Bool(
(b) => b.Must(
(s) => s.Term(
(t) => t.Field("@timestamp").Value(id))))),
cancellationToken);
}
return _objectMapper.Map<SerilogInfo, LogInfo>(response.Documents.FirstOrDefault());
}
@ -96,7 +156,7 @@ namespace LINGYUN.Abp.Logging.Serilog.Elasticsearch
threadId,
hasException);
var response = await client.CountAsync<SerilogInfo>((dsl) =>
var response = await client.CountAsync<SerilogInfo>((dsl) =>
dsl.Index(CreateIndex())
.Query(log => log.Bool(b => b.Must(querys.ToArray()))),
cancellationToken);
@ -167,7 +227,7 @@ namespace LINGYUN.Abp.Logging.Serilog.Elasticsearch
threadId,
hasException);
SourceFilterDescriptor<SerilogInfo> ConvertFileSystem(SourceFilterDescriptor<SerilogInfo> selector)
SourceFilterDescriptor<SerilogInfo> SourceFilter(SourceFilterDescriptor<SerilogInfo> selector)
{
selector.IncludeAll();
if (!includeDetails)
@ -182,7 +242,7 @@ namespace LINGYUN.Abp.Logging.Serilog.Elasticsearch
var response = await client.SearchAsync<SerilogInfo>((dsl) =>
dsl.Index(CreateIndex())
.Query(log => log.Bool(b => b.Must(querys.ToArray())))
.Source(ConvertFileSystem)
.Source(SourceFilter)
.Sort(log => log.Field(GetField(sorting), sortOrder))
.From(skipCount)
.Size(maxResultCount),
@ -208,6 +268,10 @@ namespace LINGYUN.Abp.Logging.Serilog.Elasticsearch
{
var querys = new List<Func<QueryContainerDescriptor<SerilogInfo>, QueryContainer>>();
if (_currentTenant.IsAvailable)
{
querys.Add((log) => log.Term((q) => q.Field((f) => f.Fields.TenantId.Suffix("keyword")).Value(_currentTenant.GetId())));
}
if (startTime.HasValue)
{
querys.Add((log) => log.DateRange((q) => q.Field(f => f.TimeStamp).GreaterThanOrEquals(startTime)));

4
aspnet-core/modules/logging/LINGYUN.Abp.Logging.Serilog.Elasticsearch/LINGYUN/Abp/AuditLogging/Serilog/Elasticsearch/SerilogField.cs

@ -1,4 +1,5 @@
using LINGYUN.Abp.Serilog.Enrichers.Application;
using System;
namespace LINGYUN.Abp.Logging.Serilog.Elasticsearch
{
@ -40,6 +41,9 @@ namespace LINGYUN.Abp.Logging.Serilog.Elasticsearch
[Nest.PropertyName("UserId")]
public string UserId { get; set; }
[Nest.PropertyName("TenantId")]
public Guid? TenantId { get; set; }
[Nest.PropertyName("ProcessId")]
public int ProcessId { get; set; }

15
aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain/LINGYUN/Abp/OssManagement/AbpOssManagementDomainModule.cs

@ -1,7 +1,4 @@
using LINGYUN.Abp.Features.LimitValidation;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options;
using Volo.Abp;
using Volo.Abp.Domain;
using Volo.Abp.Modularity;
using Volo.Abp.MultiTenancy;
@ -16,17 +13,5 @@ namespace LINGYUN.Abp.OssManagement
)]
public class AbpOssManagementDomainModule : AbpModule
{
public override void OnApplicationInitialization(ApplicationInitializationContext context)
{
// TODO: 是否有必要自动创建容器
var ossOptions = context.ServiceProvider.GetRequiredService<IOptions<AbpOssManagementOptions>>().Value;
var ossFactory = context.ServiceProvider.GetRequiredService<IOssContainerFactory>();
var ossContainer = ossFactory.Create();
foreach (var bucket in ossOptions.StaticBuckets)
{
_ = ossContainer.CreateIfNotExistsAsync(bucket);
}
}
}
}

30
aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain/LINGYUN/Abp/OssManagement/OssStaticContainerDataSeedContributor.cs

@ -0,0 +1,30 @@
using Microsoft.Extensions.Options;
using System.Threading.Tasks;
using Volo.Abp.Data;
using Volo.Abp.DependencyInjection;
namespace LINGYUN.Abp.OssManagement
{
public class OssStaticContainerDataSeedContributor : IDataSeedContributor, ITransientDependency
{
private readonly AbpOssManagementOptions _options;
private readonly IOssContainerFactory _ossContainerFactory;
public OssStaticContainerDataSeedContributor(
IOptions<AbpOssManagementOptions> options,
IOssContainerFactory ossContainerFactory)
{
_options = options.Value;
_ossContainerFactory = ossContainerFactory;
}
public virtual async Task SeedAsync(DataSeedContext context)
{
var ossContainer = _ossContainerFactory.Create();
foreach (var bucket in _options.StaticBuckets)
{
await ossContainer.CreateIfNotExistsAsync(bucket);
}
}
}
}

64
aspnet-core/modules/tenants/LINGYUN.Abp.TenantManagement.Application.Contracts/LINGYUN/Abp/TenantManagement/AbpTenantManagementApplicationContractsModule.cs

@ -1,30 +1,36 @@
using Volo.Abp.Application;
using Volo.Abp.Localization;
using Volo.Abp.Modularity;
using Volo.Abp.TenantManagement;
using Volo.Abp.TenantManagement.Localization;
using Volo.Abp.VirtualFileSystem;
namespace LINGYUN.Abp.TenantManagement
{
[DependsOn(
typeof(AbpDddApplicationModule),
typeof(AbpTenantManagementDomainSharedModule))]
public class AbpTenantManagementApplicationContractsModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
Configure<AbpVirtualFileSystemOptions>(options =>
{
options.FileSets.AddEmbedded<AbpTenantManagementApplicationContractsModule>();
});
Configure<AbpLocalizationOptions>(options =>
{
options.Resources
.Get<AbpTenantManagementResource>()
.AddVirtualJson("/LINGYUN/Abp/TenantManagement/Localization/Resources");
});
}
}
using Volo.Abp.Application;
using Volo.Abp.Localization;
using Volo.Abp.Localization.ExceptionHandling;
using Volo.Abp.Modularity;
using Volo.Abp.TenantManagement;
using Volo.Abp.TenantManagement.Localization;
using Volo.Abp.VirtualFileSystem;
namespace LINGYUN.Abp.TenantManagement
{
[DependsOn(
typeof(AbpDddApplicationModule),
typeof(AbpTenantManagementDomainSharedModule))]
public class AbpTenantManagementApplicationContractsModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
Configure<AbpVirtualFileSystemOptions>(options =>
{
options.FileSets.AddEmbedded<AbpTenantManagementApplicationContractsModule>();
});
Configure<AbpLocalizationOptions>(options =>
{
options.Resources
.Get<AbpTenantManagementResource>()
.AddVirtualJson("/LINGYUN/Abp/TenantManagement/Localization/Resources");
});
Configure<AbpExceptionLocalizationOptions>(options =>
{
options.MapCodeNamespace("LINGYUN.Abp.MultiTenancy", typeof(AbpTenantManagementResource));
});
}
}
}

40
aspnet-core/modules/tenants/LINGYUN.Abp.TenantManagement.Application.Contracts/LINGYUN/Abp/TenantManagement/Dto/TenantCreateDto.cs

@ -1,16 +1,26 @@
using System.ComponentModel.DataAnnotations;
namespace LINGYUN.Abp.TenantManagement
{
public class TenantCreateDto : TenantCreateOrUpdateDtoBase
{
[Required]
[EmailAddress]
[MaxLength(256)]
public virtual string AdminEmailAddress { get; set; }
[Required]
[MaxLength(128)]
public virtual string AdminPassword { get; set; }
}
using System.ComponentModel.DataAnnotations;
namespace LINGYUN.Abp.TenantManagement
{
public class TenantCreateDto : TenantCreateOrUpdateDtoBase
{
[Required]
[EmailAddress]
[MaxLength(256)]
public string AdminEmailAddress { get; set; }
[Required]
[MaxLength(128)]
public string AdminPassword { get; set; }
/// <summary>
/// 使用共享数据库
/// </summary>
public bool UseSharedDatabase { get; set; } = true;
/// <summary>
/// 默认数据库连接字符串
/// </summary>
public string DefaultConnectionString { get; set; }
}
}

17
aspnet-core/modules/tenants/LINGYUN.Abp.TenantManagement.Application.Contracts/LINGYUN/Abp/TenantManagement/Localization/Resources/en.json

@ -1,9 +1,10 @@
{
"culture": "en",
"texts": {
"DisplayName:Name": "Name",
"DisplayName:Value": "Value",
"TenantNotFoundById": "Tenant: {0} not found!",
"TenantNotFoundByName": "Tenant: {0} not found!"
}
{
"culture": "en",
"texts": {
"DisplayName:Name": "Name",
"DisplayName:Value": "Value",
"TenantNotFoundById": "Tenant: {0} not found!",
"TenantNotFoundByName": "Tenant: {0} not found!",
"LINGYUN.Abp.MultiTenancy:010001": "The database string that cannot be connected!"
}
}

17
aspnet-core/modules/tenants/LINGYUN.Abp.TenantManagement.Application.Contracts/LINGYUN/Abp/TenantManagement/Localization/Resources/zh-Hans.json

@ -1,9 +1,10 @@
{
"culture": "zh-Hans",
"texts": {
"DisplayName:Name": "名称",
"DisplayName:Value": "值",
"TenantNotFoundById": "租户: {0} 不存在!",
"TenantNotFoundByName": "租户: {0} 不存在!"
}
{
"culture": "zh-Hans",
"texts": {
"DisplayName:Name": "名称",
"DisplayName:Value": "值",
"TenantNotFoundById": "租户: {0} 不存在!",
"TenantNotFoundByName": "租户: {0} 不存在!",
"LINGYUN.Abp.MultiTenancy:010001": "无法连接的数据库字符串!"
}
}

30
aspnet-core/modules/tenants/LINGYUN.Abp.TenantManagement.Application/LINGYUN/Abp/TenantManagement/TenantAppService.cs

@ -70,21 +70,27 @@ namespace LINGYUN.Abp.TenantManagement
var tenant = await TenantManager.CreateAsync(input.Name);
input.MapExtraPropertiesTo(tenant);
await TenantRepository.InsertAsync(tenant);
if (!input.UseSharedDatabase && !input.DefaultConnectionString.IsNullOrWhiteSpace())
{
tenant.SetDefaultConnectionString(input.DefaultConnectionString);
}
await CurrentUnitOfWork.SaveChangesAsync();
await TenantRepository.InsertAsync(tenant);
var createEventData = new CreateEventData
CurrentUnitOfWork.OnCompleted(async () =>
{
Id = tenant.Id,
Name = tenant.Name,
AdminUserId = GuidGenerator.Create(),
AdminEmailAddress = input.AdminEmailAddress,
AdminPassword = input.AdminPassword
};
// 因为项目各自独立,租户增加时添加管理用户必须通过事件总线
// 而 TenantEto 对象没有包含所需的用户名密码,需要独立发布事件
await EventBus.PublishAsync(createEventData);
var createEventData = new CreateEventData
{
Id = tenant.Id,
Name = tenant.Name,
AdminUserId = GuidGenerator.Create(),
AdminEmailAddress = input.AdminEmailAddress,
AdminPassword = input.AdminPassword
};
// 因为项目各自独立,租户增加时添加管理用户必须通过事件总线
// 而 TenantEto 对象没有包含所需的用户名密码,需要独立发布事件
await EventBus.PublishAsync(createEventData);
});
return ObjectMapper.Map<Tenant, TenantDto>(tenant);
}

2
aspnet-core/services/account/AuthServer.Host/AuthIdentityServerModule.cs

@ -1,5 +1,6 @@
using LINGYUN.Abp.AspNetCore.HttpOverrides;
using LINGYUN.Abp.AuditLogging.Elasticsearch;
using LINGYUN.Abp.Data.DbMigrator;
using LINGYUN.Abp.EventBus.CAP;
using LINGYUN.Abp.Identity.EntityFrameworkCore;
using LINGYUN.Abp.IdentityServer;
@ -53,6 +54,7 @@ namespace AuthServer.Host
typeof(AbpSettingManagementEntityFrameworkCoreModule),
typeof(AbpFeatureManagementEntityFrameworkCoreModule),
typeof(AbpTenantManagementEntityFrameworkCoreModule),
typeof(AbpDataDbMigratorModule),
typeof(AbpAspNetCoreAuthenticationJwtBearerModule),
typeof(AbpAuditLoggingElasticsearchModule), // 放在 AbpIdentity 模块之后,避免被覆盖
typeof(AbpAspNetCoreHttpOverridesModule),

1
aspnet-core/services/account/AuthServer.Host/AuthServer.Host.csproj

@ -57,6 +57,7 @@
<ItemGroup>
<ProjectReference Include="..\..\..\modules\auditing\LINGYUN.Abp.AuditLogging.Elasticsearch\LINGYUN.Abp.AuditLogging.Elasticsearch.csproj" />
<ProjectReference Include="..\..\..\modules\common\LINGYUN.Abp.AspNetCore.HttpOverrides\LINGYUN.Abp.AspNetCore.HttpOverrides.csproj" />
<ProjectReference Include="..\..\..\modules\common\LINGYUN.Abp.Data.DbMigrator\LINGYUN.Abp.Data.DbMigrator.csproj" />
<ProjectReference Include="..\..\..\modules\common\LINGYUN.Abp.EventBus.CAP\LINGYUN.Abp.EventBus.CAP.csproj" />
<ProjectReference Include="..\..\..\modules\common\LINGYUN.Abp.Sms.Aliyun\LINGYUN.Abp.Sms.Aliyun.csproj" />
<ProjectReference Include="..\..\..\modules\identityServer\LINGYUN.Abp.IdentityServer.EntityFrameworkCore\LINGYUN.Abp.IdentityServer.EntityFrameworkCore.csproj" />

49
aspnet-core/services/account/AuthServer.Host/EntityFrameworkCore/AuthServerHostMigrationsDbContext.cs

@ -1,25 +1,24 @@
using Microsoft.EntityFrameworkCore;
using Volo.Abp.EntityFrameworkCore;
using Volo.Abp.Identity.EntityFrameworkCore;
using Volo.Abp.IdentityServer.EntityFrameworkCore;
namespace AuthServer.EntityFrameworkCore
{
public class AuthServerHostMigrationsDbContext : AbpDbContext<AuthServerHostMigrationsDbContext>
{
public AuthServerHostMigrationsDbContext(DbContextOptions<AuthServerHostMigrationsDbContext> options)
: base(options)
{
}
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
base.OnModelCreating(modelBuilder);
modelBuilder.UseMySQL();
modelBuilder.ConfigureIdentity();
modelBuilder.ConfigureIdentityServer();
}
}
}
using Microsoft.EntityFrameworkCore;
using Volo.Abp.EntityFrameworkCore;
using Volo.Abp.Identity.EntityFrameworkCore;
using Volo.Abp.IdentityServer.EntityFrameworkCore;
namespace AuthServer.EntityFrameworkCore
{
public class AuthServerHostMigrationsDbContext : AbpDbContext<AuthServerHostMigrationsDbContext>
{
public AuthServerHostMigrationsDbContext(DbContextOptions<AuthServerHostMigrationsDbContext> options)
: base(options)
{
}
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
base.OnModelCreating(modelBuilder);
modelBuilder.ConfigureIdentity();
modelBuilder.ConfigureIdentityServer();
}
}
}

88
aspnet-core/services/account/AuthServer.Host/EventBus/Handlers/TenantCreateEventHandler.cs

@ -1,88 +0,0 @@
using LINGYUN.Abp.MultiTenancy;
using Microsoft.AspNetCore.Identity;
using Microsoft.Extensions.Logging;
using System;
using System.Threading.Tasks;
using Volo.Abp.DependencyInjection;
using Volo.Abp.EventBus.Distributed;
using Volo.Abp.Guids;
using Volo.Abp.Identity;
using Volo.Abp.MultiTenancy;
using Volo.Abp.Uow;
using IdentityRole = Volo.Abp.Identity.IdentityRole;
using IdentityUser = Volo.Abp.Identity.IdentityUser;
namespace AuthServer.Host.EventBus.Handlers
{
public class TenantCreateEventHandler : IDistributedEventHandler<CreateEventData>, ITransientDependency
{
protected ILogger<TenantCreateEventHandler> Logger { get; }
protected ICurrentTenant CurrentTenant { get; }
protected IGuidGenerator GuidGenerator { get; }
protected IdentityUserManager IdentityUserManager { get; }
protected IdentityRoleManager IdentityRoleManager { get; }
public TenantCreateEventHandler(
ICurrentTenant currentTenant,
IGuidGenerator guidGenerator,
IdentityUserManager identityUserManager,
IdentityRoleManager identityRoleManager,
ILogger<TenantCreateEventHandler> logger)
{
Logger = logger;
CurrentTenant = currentTenant;
GuidGenerator = guidGenerator;
IdentityUserManager = identityUserManager;
IdentityRoleManager = identityRoleManager;
}
[UnitOfWork]
public async Task HandleEventAsync(CreateEventData eventData)
{
using (CurrentTenant.Change(eventData.Id, eventData.Name))
{
const string tenantAdminRoleName = "admin";
var tenantAdminRoleId = Guid.Empty; ;
if (!await IdentityRoleManager.RoleExistsAsync(tenantAdminRoleName))
{
tenantAdminRoleId = GuidGenerator.Create();
var tenantAdminRole = new IdentityRole(tenantAdminRoleId, tenantAdminRoleName, eventData.Id)
{
IsStatic = true,
IsPublic = true
};
(await IdentityRoleManager.CreateAsync(tenantAdminRole)).CheckErrors();
}
else
{
var tenantAdminRole = await IdentityRoleManager.FindByNameAsync(tenantAdminRoleName);
tenantAdminRoleId = tenantAdminRole.Id;
}
var tenantAdminUser = await IdentityUserManager.FindByNameAsync(eventData.AdminEmailAddress);
if (tenantAdminUser == null)
{
tenantAdminUser = new IdentityUser(eventData.AdminUserId, eventData.AdminEmailAddress,
eventData.AdminEmailAddress, eventData.Id);
tenantAdminUser.AddRole(tenantAdminRoleId);
// 创建租户管理用户
(await IdentityUserManager.CreateAsync(tenantAdminUser)).CheckErrors();
(await IdentityUserManager.AddPasswordAsync(tenantAdminUser, eventData.AdminPassword)).CheckErrors();
}
//var identitySeedResult = await IdentityDataSeeder
// .SeedAsync(eventData.AdminEmailAddress, eventData.AdminPassword, eventData.Id);
//if (!identitySeedResult.CreatedAdminUser)
//{
// Logger.LogWarning("Tenant {0} admin user {1} not created!", eventData.Name, eventData.AdminEmailAddress);
//}
//if (!identitySeedResult.CreatedAdminRole)
//{
// Logger.LogWarning("Tenant {0} admin role not created!", eventData.Name);
//}
}
}
}
}

134
aspnet-core/services/account/AuthServer.Host/EventBus/Handlers/TenantSynchronizer.cs

@ -0,0 +1,134 @@
using AuthServer.EntityFrameworkCore;
using LINGYUN.Abp.Data.DbMigrator;
using LINGYUN.Abp.MultiTenancy;
using Microsoft.AspNetCore.Identity;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Logging;
using System;
using System.Threading.Tasks;
using Volo.Abp.Authorization.Permissions;
using Volo.Abp.DependencyInjection;
using Volo.Abp.EventBus.Distributed;
using Volo.Abp.Guids;
using Volo.Abp.Identity;
using Volo.Abp.MultiTenancy;
using Volo.Abp.PermissionManagement;
using Volo.Abp.Uow;
using IdentityRole = Volo.Abp.Identity.IdentityRole;
using IdentityUser = Volo.Abp.Identity.IdentityUser;
namespace AuthServer.Host.EventBus.Handlers
{
public class TenantSynchronizer : IDistributedEventHandler<CreateEventData>, ITransientDependency
{
protected ILogger<TenantSynchronizer> Logger { get; }
protected ICurrentTenant CurrentTenant { get; }
protected IGuidGenerator GuidGenerator { get; }
protected IdentityUserManager IdentityUserManager { get; }
protected IdentityRoleManager IdentityRoleManager { get; }
protected IPermissionDataSeeder PermissionDataSeeder { get; }
protected IDbSchemaMigrator DbSchemaMigrator { get; }
public TenantSynchronizer(
ICurrentTenant currentTenant,
IGuidGenerator guidGenerator,
IdentityUserManager identityUserManager,
IdentityRoleManager identityRoleManager,
IPermissionDataSeeder permissionDataSeeder,
IDbSchemaMigrator dbSchemaMigrator,
ILogger<TenantSynchronizer> logger)
{
Logger = logger;
CurrentTenant = currentTenant;
GuidGenerator = guidGenerator;
IdentityUserManager = identityUserManager;
IdentityRoleManager = identityRoleManager;
PermissionDataSeeder = permissionDataSeeder;
DbSchemaMigrator = dbSchemaMigrator;
}
[UnitOfWork]
public async Task HandleEventAsync(CreateEventData eventData)
{
using (CurrentTenant.Change(eventData.Id, eventData.Name))
{
Logger.LogInformation("Migrating the new tenant database with AuthServer...");
// 迁移租户数据
await DbSchemaMigrator.MigrateAsync<AuthServerHostMigrationsDbContext>(
(connectionString, builder) =>
{
builder.UseMySql(connectionString, ServerVersion.AutoDetect(connectionString));
return new AuthServerHostMigrationsDbContext(builder.Options);
});
Logger.LogInformation("Migrated the new tenant database with AuthServer.");
Logger.LogInformation("Seeding the new tenant admin user and roles...");
await SeedTenantAdminAsync(eventData);
Logger.LogInformation("Seeding the new tenant default roles...");
await SeedTenantDefaultRoleAsync(eventData.Id);
Logger.LogInformation("The new tenant identity data initialized!");
}
}
private async Task SeedTenantDefaultRoleAsync(Guid tenantId)
{
// 默认用户
var roleId = GuidGenerator.Create();
var defaultRole = new IdentityRole(roleId, "Users", tenantId)
{
IsStatic = true,
IsPublic = true,
IsDefault = true,
};
(await IdentityRoleManager.CreateAsync(defaultRole)).CheckErrors();
// 所有用户都应该具有查询用户权限, 用于IM场景
await PermissionDataSeeder.SeedAsync(
RolePermissionValueProvider.ProviderName,
defaultRole.Name,
new string[] {
IdentityPermissions.UserLookup.Default,
IdentityPermissions.Users.Default
});
}
private async Task SeedTenantAdminAsync(CreateEventData eventData)
{
const string tenantAdminRoleName = "admin";
var tenantAdminRoleId = Guid.Empty; ;
if (!await IdentityRoleManager.RoleExistsAsync(tenantAdminRoleName))
{
tenantAdminRoleId = GuidGenerator.Create();
var tenantAdminRole = new IdentityRole(tenantAdminRoleId, tenantAdminRoleName, eventData.Id)
{
IsStatic = true,
IsPublic = true
};
(await IdentityRoleManager.CreateAsync(tenantAdminRole)).CheckErrors();
}
else
{
var tenantAdminRole = await IdentityRoleManager.FindByNameAsync(tenantAdminRoleName);
tenantAdminRoleId = tenantAdminRole.Id;
}
var tenantAdminUser = await IdentityUserManager.FindByNameAsync(eventData.AdminEmailAddress);
if (tenantAdminUser == null)
{
tenantAdminUser = new IdentityUser(eventData.AdminUserId, eventData.AdminEmailAddress,
eventData.AdminEmailAddress, eventData.Id);
tenantAdminUser.AddRole(tenantAdminRoleId);
// 创建租户管理用户
(await IdentityUserManager.CreateAsync(tenantAdminUser)).CheckErrors();
(await IdentityUserManager.AddPasswordAsync(tenantAdminUser, eventData.AdminPassword)).CheckErrors();
}
}
}
}

1259
aspnet-core/services/account/AuthServer.Host/Migrations/20200513010936_Migration-IdentityServer-MySql.Designer.cs

File diff suppressed because it is too large

773
aspnet-core/services/account/AuthServer.Host/Migrations/20200513010936_Migration-IdentityServer-MySql.cs

@ -1,773 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace AuthServer.Migrations
{
public partial class MigrationIdentityServerMySql : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "AbpClaimTypes",
columns: table => new
{
Id = table.Column<Guid>(nullable: false),
ExtraProperties = table.Column<string>(nullable: true),
ConcurrencyStamp = table.Column<string>(maxLength: 256, nullable: false),
Name = table.Column<string>(maxLength: 256, nullable: false),
Required = table.Column<bool>(nullable: false),
IsStatic = table.Column<bool>(nullable: false),
Regex = table.Column<string>(maxLength: 512, nullable: true),
RegexDescription = table.Column<string>(maxLength: 128, nullable: true),
Description = table.Column<string>(maxLength: 256, nullable: true),
ValueType = table.Column<int>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpClaimTypes", x => x.Id);
});
migrationBuilder.CreateTable(
name: "AbpRoles",
columns: table => new
{
Id = table.Column<Guid>(nullable: false),
ExtraProperties = table.Column<string>(nullable: true),
ConcurrencyStamp = table.Column<string>(maxLength: 256, nullable: false),
TenantId = table.Column<Guid>(nullable: true),
Name = table.Column<string>(maxLength: 256, nullable: false),
NormalizedName = table.Column<string>(maxLength: 256, nullable: false),
IsDefault = table.Column<bool>(nullable: false),
IsStatic = table.Column<bool>(nullable: false),
IsPublic = table.Column<bool>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpRoles", x => x.Id);
});
migrationBuilder.CreateTable(
name: "AbpUsers",
columns: table => new
{
Id = table.Column<Guid>(nullable: false),
ExtraProperties = table.Column<string>(nullable: true),
ConcurrencyStamp = table.Column<string>(nullable: true),
CreationTime = table.Column<DateTime>(nullable: false),
CreatorId = table.Column<Guid>(nullable: true),
LastModificationTime = table.Column<DateTime>(nullable: true),
LastModifierId = table.Column<Guid>(nullable: true),
IsDeleted = table.Column<bool>(nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(nullable: true),
DeletionTime = table.Column<DateTime>(nullable: true),
TenantId = table.Column<Guid>(nullable: true),
UserName = table.Column<string>(maxLength: 256, nullable: false),
NormalizedUserName = table.Column<string>(maxLength: 256, nullable: false),
Name = table.Column<string>(maxLength: 64, nullable: true),
Surname = table.Column<string>(maxLength: 64, nullable: true),
Email = table.Column<string>(maxLength: 256, nullable: false),
NormalizedEmail = table.Column<string>(maxLength: 256, nullable: false),
EmailConfirmed = table.Column<bool>(nullable: false, defaultValue: false),
PasswordHash = table.Column<string>(maxLength: 256, nullable: true),
SecurityStamp = table.Column<string>(maxLength: 256, nullable: false),
PhoneNumber = table.Column<string>(maxLength: 16, nullable: true),
PhoneNumberConfirmed = table.Column<bool>(nullable: false, defaultValue: false),
TwoFactorEnabled = table.Column<bool>(nullable: false, defaultValue: false),
LockoutEnd = table.Column<DateTimeOffset>(nullable: true),
LockoutEnabled = table.Column<bool>(nullable: false, defaultValue: false),
AccessFailedCount = table.Column<int>(nullable: false, defaultValue: 0)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpUsers", x => x.Id);
});
migrationBuilder.CreateTable(
name: "IdentityServerApiResources",
columns: table => new
{
Id = table.Column<Guid>(nullable: false),
ExtraProperties = table.Column<string>(nullable: true),
ConcurrencyStamp = table.Column<string>(nullable: true),
CreationTime = table.Column<DateTime>(nullable: false),
CreatorId = table.Column<Guid>(nullable: true),
LastModificationTime = table.Column<DateTime>(nullable: true),
LastModifierId = table.Column<Guid>(nullable: true),
IsDeleted = table.Column<bool>(nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(nullable: true),
DeletionTime = table.Column<DateTime>(nullable: true),
Name = table.Column<string>(maxLength: 200, nullable: false),
DisplayName = table.Column<string>(maxLength: 200, nullable: true),
Description = table.Column<string>(maxLength: 1000, nullable: true),
Enabled = table.Column<bool>(nullable: false),
Properties = table.Column<string>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_IdentityServerApiResources", x => x.Id);
});
migrationBuilder.CreateTable(
name: "IdentityServerClients",
columns: table => new
{
Id = table.Column<Guid>(nullable: false),
ExtraProperties = table.Column<string>(nullable: true),
ConcurrencyStamp = table.Column<string>(nullable: true),
CreationTime = table.Column<DateTime>(nullable: false),
CreatorId = table.Column<Guid>(nullable: true),
LastModificationTime = table.Column<DateTime>(nullable: true),
LastModifierId = table.Column<Guid>(nullable: true),
IsDeleted = table.Column<bool>(nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(nullable: true),
DeletionTime = table.Column<DateTime>(nullable: true),
ClientId = table.Column<string>(maxLength: 200, nullable: false),
ClientName = table.Column<string>(maxLength: 200, nullable: true),
Description = table.Column<string>(maxLength: 1000, nullable: true),
ClientUri = table.Column<string>(maxLength: 2000, nullable: true),
LogoUri = table.Column<string>(maxLength: 2000, nullable: true),
Enabled = table.Column<bool>(nullable: false),
ProtocolType = table.Column<string>(maxLength: 200, nullable: false),
RequireClientSecret = table.Column<bool>(nullable: false),
RequireConsent = table.Column<bool>(nullable: false),
AllowRememberConsent = table.Column<bool>(nullable: false),
AlwaysIncludeUserClaimsInIdToken = table.Column<bool>(nullable: false),
RequirePkce = table.Column<bool>(nullable: false),
AllowPlainTextPkce = table.Column<bool>(nullable: false),
AllowAccessTokensViaBrowser = table.Column<bool>(nullable: false),
FrontChannelLogoutUri = table.Column<string>(maxLength: 2000, nullable: true),
FrontChannelLogoutSessionRequired = table.Column<bool>(nullable: false),
BackChannelLogoutUri = table.Column<string>(maxLength: 2000, nullable: true),
BackChannelLogoutSessionRequired = table.Column<bool>(nullable: false),
AllowOfflineAccess = table.Column<bool>(nullable: false),
IdentityTokenLifetime = table.Column<int>(nullable: false),
AccessTokenLifetime = table.Column<int>(nullable: false),
AuthorizationCodeLifetime = table.Column<int>(nullable: false),
ConsentLifetime = table.Column<int>(nullable: true),
AbsoluteRefreshTokenLifetime = table.Column<int>(nullable: false),
SlidingRefreshTokenLifetime = table.Column<int>(nullable: false),
RefreshTokenUsage = table.Column<int>(nullable: false),
UpdateAccessTokenClaimsOnRefresh = table.Column<bool>(nullable: false),
RefreshTokenExpiration = table.Column<int>(nullable: false),
AccessTokenType = table.Column<int>(nullable: false),
EnableLocalLogin = table.Column<bool>(nullable: false),
IncludeJwtId = table.Column<bool>(nullable: false),
AlwaysSendClientClaims = table.Column<bool>(nullable: false),
ClientClaimsPrefix = table.Column<string>(maxLength: 200, nullable: true),
PairWiseSubjectSalt = table.Column<string>(maxLength: 200, nullable: true),
UserSsoLifetime = table.Column<int>(nullable: true),
UserCodeType = table.Column<string>(maxLength: 100, nullable: true),
DeviceCodeLifetime = table.Column<int>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_IdentityServerClients", x => x.Id);
});
migrationBuilder.CreateTable(
name: "IdentityServerDeviceFlowCodes",
columns: table => new
{
Id = table.Column<Guid>(nullable: false),
ExtraProperties = table.Column<string>(nullable: true),
ConcurrencyStamp = table.Column<string>(nullable: true),
CreationTime = table.Column<DateTime>(nullable: false),
CreatorId = table.Column<Guid>(nullable: true),
DeviceCode = table.Column<string>(maxLength: 200, nullable: false),
UserCode = table.Column<string>(maxLength: 200, nullable: false),
SubjectId = table.Column<string>(maxLength: 200, nullable: true),
ClientId = table.Column<string>(maxLength: 200, nullable: false),
Expiration = table.Column<DateTime>(nullable: false),
Data = table.Column<string>(maxLength: 50000, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_IdentityServerDeviceFlowCodes", x => x.Id);
});
migrationBuilder.CreateTable(
name: "IdentityServerIdentityResources",
columns: table => new
{
Id = table.Column<Guid>(nullable: false),
ExtraProperties = table.Column<string>(nullable: true),
ConcurrencyStamp = table.Column<string>(nullable: true),
CreationTime = table.Column<DateTime>(nullable: false),
CreatorId = table.Column<Guid>(nullable: true),
LastModificationTime = table.Column<DateTime>(nullable: true),
LastModifierId = table.Column<Guid>(nullable: true),
IsDeleted = table.Column<bool>(nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(nullable: true),
DeletionTime = table.Column<DateTime>(nullable: true),
Name = table.Column<string>(maxLength: 200, nullable: false),
DisplayName = table.Column<string>(maxLength: 200, nullable: true),
Description = table.Column<string>(maxLength: 1000, nullable: true),
Enabled = table.Column<bool>(nullable: false),
Required = table.Column<bool>(nullable: false),
Emphasize = table.Column<bool>(nullable: false),
ShowInDiscoveryDocument = table.Column<bool>(nullable: false),
Properties = table.Column<string>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_IdentityServerIdentityResources", x => x.Id);
});
migrationBuilder.CreateTable(
name: "IdentityServerPersistedGrants",
columns: table => new
{
Key = table.Column<string>(maxLength: 200, nullable: false),
Id = table.Column<Guid>(nullable: false),
ExtraProperties = table.Column<string>(nullable: true),
ConcurrencyStamp = table.Column<string>(nullable: true),
Type = table.Column<string>(maxLength: 50, nullable: false),
SubjectId = table.Column<string>(maxLength: 200, nullable: true),
ClientId = table.Column<string>(maxLength: 200, nullable: false),
CreationTime = table.Column<DateTime>(nullable: false),
Expiration = table.Column<DateTime>(nullable: true),
Data = table.Column<string>(maxLength: 10000, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_IdentityServerPersistedGrants", x => x.Key);
});
migrationBuilder.CreateTable(
name: "AbpRoleClaims",
columns: table => new
{
Id = table.Column<Guid>(nullable: false),
TenantId = table.Column<Guid>(nullable: true),
ClaimType = table.Column<string>(maxLength: 256, nullable: false),
ClaimValue = table.Column<string>(maxLength: 1024, nullable: true),
RoleId = table.Column<Guid>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpRoleClaims", x => x.Id);
table.ForeignKey(
name: "FK_AbpRoleClaims_AbpRoles_RoleId",
column: x => x.RoleId,
principalTable: "AbpRoles",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "AbpUserClaims",
columns: table => new
{
Id = table.Column<Guid>(nullable: false),
TenantId = table.Column<Guid>(nullable: true),
ClaimType = table.Column<string>(maxLength: 256, nullable: false),
ClaimValue = table.Column<string>(maxLength: 1024, nullable: true),
UserId = table.Column<Guid>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpUserClaims", x => x.Id);
table.ForeignKey(
name: "FK_AbpUserClaims_AbpUsers_UserId",
column: x => x.UserId,
principalTable: "AbpUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "AbpUserLogins",
columns: table => new
{
UserId = table.Column<Guid>(nullable: false),
LoginProvider = table.Column<string>(maxLength: 64, nullable: false),
TenantId = table.Column<Guid>(nullable: true),
ProviderKey = table.Column<string>(maxLength: 196, nullable: false),
ProviderDisplayName = table.Column<string>(maxLength: 128, nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpUserLogins", x => new { x.UserId, x.LoginProvider });
table.ForeignKey(
name: "FK_AbpUserLogins_AbpUsers_UserId",
column: x => x.UserId,
principalTable: "AbpUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "AbpUserRoles",
columns: table => new
{
UserId = table.Column<Guid>(nullable: false),
RoleId = table.Column<Guid>(nullable: false),
TenantId = table.Column<Guid>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpUserRoles", x => new { x.UserId, x.RoleId });
table.ForeignKey(
name: "FK_AbpUserRoles_AbpRoles_RoleId",
column: x => x.RoleId,
principalTable: "AbpRoles",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_AbpUserRoles_AbpUsers_UserId",
column: x => x.UserId,
principalTable: "AbpUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "AbpUserTokens",
columns: table => new
{
UserId = table.Column<Guid>(nullable: false),
LoginProvider = table.Column<string>(maxLength: 64, nullable: false),
Name = table.Column<string>(maxLength: 128, nullable: false),
TenantId = table.Column<Guid>(nullable: true),
Value = table.Column<string>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpUserTokens", x => new { x.UserId, x.LoginProvider, x.Name });
table.ForeignKey(
name: "FK_AbpUserTokens_AbpUsers_UserId",
column: x => x.UserId,
principalTable: "AbpUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "IdentityServerApiClaims",
columns: table => new
{
Type = table.Column<string>(maxLength: 200, nullable: false),
ApiResourceId = table.Column<Guid>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_IdentityServerApiClaims", x => new { x.ApiResourceId, x.Type });
table.ForeignKey(
name: "FK_IdentityServerApiClaims_IdentityServerApiResources_ApiResour~",
column: x => x.ApiResourceId,
principalTable: "IdentityServerApiResources",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "IdentityServerApiScopes",
columns: table => new
{
ApiResourceId = table.Column<Guid>(nullable: false),
Name = table.Column<string>(maxLength: 200, nullable: false),
DisplayName = table.Column<string>(maxLength: 200, nullable: true),
Description = table.Column<string>(maxLength: 1000, nullable: true),
Required = table.Column<bool>(nullable: false),
Emphasize = table.Column<bool>(nullable: false),
ShowInDiscoveryDocument = table.Column<bool>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_IdentityServerApiScopes", x => new { x.ApiResourceId, x.Name });
table.ForeignKey(
name: "FK_IdentityServerApiScopes_IdentityServerApiResources_ApiResour~",
column: x => x.ApiResourceId,
principalTable: "IdentityServerApiResources",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "IdentityServerApiSecrets",
columns: table => new
{
Type = table.Column<string>(maxLength: 250, nullable: false),
Value = table.Column<string>(maxLength: 300, nullable: false),
ApiResourceId = table.Column<Guid>(nullable: false),
Description = table.Column<string>(maxLength: 2000, nullable: true),
Expiration = table.Column<DateTime>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_IdentityServerApiSecrets", x => new { x.ApiResourceId, x.Type, x.Value });
table.ForeignKey(
name: "FK_IdentityServerApiSecrets_IdentityServerApiResources_ApiResou~",
column: x => x.ApiResourceId,
principalTable: "IdentityServerApiResources",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "IdentityServerClientClaims",
columns: table => new
{
ClientId = table.Column<Guid>(nullable: false),
Type = table.Column<string>(maxLength: 250, nullable: false),
Value = table.Column<string>(maxLength: 250, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_IdentityServerClientClaims", x => new { x.ClientId, x.Type, x.Value });
table.ForeignKey(
name: "FK_IdentityServerClientClaims_IdentityServerClients_ClientId",
column: x => x.ClientId,
principalTable: "IdentityServerClients",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "IdentityServerClientCorsOrigins",
columns: table => new
{
ClientId = table.Column<Guid>(nullable: false),
Origin = table.Column<string>(maxLength: 150, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_IdentityServerClientCorsOrigins", x => new { x.ClientId, x.Origin });
table.ForeignKey(
name: "FK_IdentityServerClientCorsOrigins_IdentityServerClients_Client~",
column: x => x.ClientId,
principalTable: "IdentityServerClients",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "IdentityServerClientGrantTypes",
columns: table => new
{
ClientId = table.Column<Guid>(nullable: false),
GrantType = table.Column<string>(maxLength: 250, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_IdentityServerClientGrantTypes", x => new { x.ClientId, x.GrantType });
table.ForeignKey(
name: "FK_IdentityServerClientGrantTypes_IdentityServerClients_ClientId",
column: x => x.ClientId,
principalTable: "IdentityServerClients",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "IdentityServerClientIdPRestrictions",
columns: table => new
{
ClientId = table.Column<Guid>(nullable: false),
Provider = table.Column<string>(maxLength: 200, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_IdentityServerClientIdPRestrictions", x => new { x.ClientId, x.Provider });
table.ForeignKey(
name: "FK_IdentityServerClientIdPRestrictions_IdentityServerClients_Cl~",
column: x => x.ClientId,
principalTable: "IdentityServerClients",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "IdentityServerClientPostLogoutRedirectUris",
columns: table => new
{
ClientId = table.Column<Guid>(nullable: false),
PostLogoutRedirectUri = table.Column<string>(maxLength: 300, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_IdentityServerClientPostLogoutRedirectUris", x => new { x.ClientId, x.PostLogoutRedirectUri });
table.ForeignKey(
name: "FK_IdentityServerClientPostLogoutRedirectUris_IdentityServerCli~",
column: x => x.ClientId,
principalTable: "IdentityServerClients",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "IdentityServerClientProperties",
columns: table => new
{
ClientId = table.Column<Guid>(nullable: false),
Key = table.Column<string>(maxLength: 250, nullable: false),
Value = table.Column<string>(maxLength: 2000, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_IdentityServerClientProperties", x => new { x.ClientId, x.Key });
table.ForeignKey(
name: "FK_IdentityServerClientProperties_IdentityServerClients_ClientId",
column: x => x.ClientId,
principalTable: "IdentityServerClients",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "IdentityServerClientRedirectUris",
columns: table => new
{
ClientId = table.Column<Guid>(nullable: false),
RedirectUri = table.Column<string>(maxLength: 300, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_IdentityServerClientRedirectUris", x => new { x.ClientId, x.RedirectUri });
table.ForeignKey(
name: "FK_IdentityServerClientRedirectUris_IdentityServerClients_Clien~",
column: x => x.ClientId,
principalTable: "IdentityServerClients",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "IdentityServerClientScopes",
columns: table => new
{
ClientId = table.Column<Guid>(nullable: false),
Scope = table.Column<string>(maxLength: 200, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_IdentityServerClientScopes", x => new { x.ClientId, x.Scope });
table.ForeignKey(
name: "FK_IdentityServerClientScopes_IdentityServerClients_ClientId",
column: x => x.ClientId,
principalTable: "IdentityServerClients",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "IdentityServerClientSecrets",
columns: table => new
{
Type = table.Column<string>(maxLength: 250, nullable: false),
Value = table.Column<string>(maxLength: 300, nullable: false),
ClientId = table.Column<Guid>(nullable: false),
Description = table.Column<string>(maxLength: 2000, nullable: true),
Expiration = table.Column<DateTime>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_IdentityServerClientSecrets", x => new { x.ClientId, x.Type, x.Value });
table.ForeignKey(
name: "FK_IdentityServerClientSecrets_IdentityServerClients_ClientId",
column: x => x.ClientId,
principalTable: "IdentityServerClients",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "IdentityServerIdentityClaims",
columns: table => new
{
Type = table.Column<string>(maxLength: 200, nullable: false),
IdentityResourceId = table.Column<Guid>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_IdentityServerIdentityClaims", x => new { x.IdentityResourceId, x.Type });
table.ForeignKey(
name: "FK_IdentityServerIdentityClaims_IdentityServerIdentityResources~",
column: x => x.IdentityResourceId,
principalTable: "IdentityServerIdentityResources",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "IdentityServerApiScopeClaims",
columns: table => new
{
Type = table.Column<string>(maxLength: 200, nullable: false),
ApiResourceId = table.Column<Guid>(nullable: false),
Name = table.Column<string>(maxLength: 200, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_IdentityServerApiScopeClaims", x => new { x.ApiResourceId, x.Name, x.Type });
table.ForeignKey(
name: "FK_IdentityServerApiScopeClaims_IdentityServerApiScopes_ApiReso~",
columns: x => new { x.ApiResourceId, x.Name },
principalTable: "IdentityServerApiScopes",
principalColumns: new[] { "ApiResourceId", "Name" },
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_AbpRoleClaims_RoleId",
table: "AbpRoleClaims",
column: "RoleId");
migrationBuilder.CreateIndex(
name: "IX_AbpRoles_NormalizedName",
table: "AbpRoles",
column: "NormalizedName");
migrationBuilder.CreateIndex(
name: "IX_AbpUserClaims_UserId",
table: "AbpUserClaims",
column: "UserId");
migrationBuilder.CreateIndex(
name: "IX_AbpUserLogins_LoginProvider_ProviderKey",
table: "AbpUserLogins",
columns: new[] { "LoginProvider", "ProviderKey" });
migrationBuilder.CreateIndex(
name: "IX_AbpUserRoles_RoleId_UserId",
table: "AbpUserRoles",
columns: new[] { "RoleId", "UserId" });
migrationBuilder.CreateIndex(
name: "IX_AbpUsers_Email",
table: "AbpUsers",
column: "Email");
migrationBuilder.CreateIndex(
name: "IX_AbpUsers_NormalizedEmail",
table: "AbpUsers",
column: "NormalizedEmail");
migrationBuilder.CreateIndex(
name: "IX_AbpUsers_NormalizedUserName",
table: "AbpUsers",
column: "NormalizedUserName");
migrationBuilder.CreateIndex(
name: "IX_AbpUsers_UserName",
table: "AbpUsers",
column: "UserName");
migrationBuilder.CreateIndex(
name: "IX_IdentityServerClients_ClientId",
table: "IdentityServerClients",
column: "ClientId");
migrationBuilder.CreateIndex(
name: "IX_IdentityServerDeviceFlowCodes_DeviceCode",
table: "IdentityServerDeviceFlowCodes",
column: "DeviceCode",
unique: true);
migrationBuilder.CreateIndex(
name: "IX_IdentityServerDeviceFlowCodes_Expiration",
table: "IdentityServerDeviceFlowCodes",
column: "Expiration");
migrationBuilder.CreateIndex(
name: "IX_IdentityServerDeviceFlowCodes_UserCode",
table: "IdentityServerDeviceFlowCodes",
column: "UserCode",
unique: true);
migrationBuilder.CreateIndex(
name: "IX_IdentityServerPersistedGrants_Expiration",
table: "IdentityServerPersistedGrants",
column: "Expiration");
migrationBuilder.CreateIndex(
name: "IX_IdentityServerPersistedGrants_SubjectId_ClientId_Type",
table: "IdentityServerPersistedGrants",
columns: new[] { "SubjectId", "ClientId", "Type" });
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "AbpClaimTypes");
migrationBuilder.DropTable(
name: "AbpRoleClaims");
migrationBuilder.DropTable(
name: "AbpUserClaims");
migrationBuilder.DropTable(
name: "AbpUserLogins");
migrationBuilder.DropTable(
name: "AbpUserRoles");
migrationBuilder.DropTable(
name: "AbpUserTokens");
migrationBuilder.DropTable(
name: "IdentityServerApiClaims");
migrationBuilder.DropTable(
name: "IdentityServerApiScopeClaims");
migrationBuilder.DropTable(
name: "IdentityServerApiSecrets");
migrationBuilder.DropTable(
name: "IdentityServerClientClaims");
migrationBuilder.DropTable(
name: "IdentityServerClientCorsOrigins");
migrationBuilder.DropTable(
name: "IdentityServerClientGrantTypes");
migrationBuilder.DropTable(
name: "IdentityServerClientIdPRestrictions");
migrationBuilder.DropTable(
name: "IdentityServerClientPostLogoutRedirectUris");
migrationBuilder.DropTable(
name: "IdentityServerClientProperties");
migrationBuilder.DropTable(
name: "IdentityServerClientRedirectUris");
migrationBuilder.DropTable(
name: "IdentityServerClientScopes");
migrationBuilder.DropTable(
name: "IdentityServerClientSecrets");
migrationBuilder.DropTable(
name: "IdentityServerDeviceFlowCodes");
migrationBuilder.DropTable(
name: "IdentityServerIdentityClaims");
migrationBuilder.DropTable(
name: "IdentityServerPersistedGrants");
migrationBuilder.DropTable(
name: "AbpRoles");
migrationBuilder.DropTable(
name: "AbpUsers");
migrationBuilder.DropTable(
name: "IdentityServerApiScopes");
migrationBuilder.DropTable(
name: "IdentityServerClients");
migrationBuilder.DropTable(
name: "IdentityServerIdentityResources");
migrationBuilder.DropTable(
name: "IdentityServerApiResources");
}
}
}

1426
aspnet-core/services/account/AuthServer.Host/Migrations/20200606012143_Upgrade-Abp-2.9.0.Designer.cs

File diff suppressed because it is too large

199
aspnet-core/services/account/AuthServer.Host/Migrations/20200606012143_Upgrade-Abp-2.9.0.cs

@ -1,199 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace AuthServer.Migrations
{
public partial class UpgradeAbp290 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "Value",
table: "IdentityServerClientSecrets",
maxLength: 300,
nullable: false,
oldClrType: typeof(string),
oldType: "longtext CHARACTER SET utf8mb4",
oldMaxLength: 4000);
migrationBuilder.AlterColumn<string>(
name: "RedirectUri",
table: "IdentityServerClientRedirectUris",
maxLength: 300,
nullable: false,
oldClrType: typeof(string),
oldType: "varchar(2000) CHARACTER SET utf8mb4",
oldMaxLength: 2000);
migrationBuilder.AlterColumn<string>(
name: "PostLogoutRedirectUri",
table: "IdentityServerClientPostLogoutRedirectUris",
maxLength: 300,
nullable: false,
oldClrType: typeof(string),
oldType: "varchar(2000) CHARACTER SET utf8mb4",
oldMaxLength: 2000);
migrationBuilder.AlterColumn<string>(
name: "Value",
table: "IdentityServerApiSecrets",
maxLength: 300,
nullable: false,
oldClrType: typeof(string),
oldType: "longtext CHARACTER SET utf8mb4",
oldMaxLength: 4000);
migrationBuilder.CreateTable(
name: "AbpOrganizationUnits",
columns: table => new
{
Id = table.Column<Guid>(nullable: false),
ExtraProperties = table.Column<string>(nullable: true),
ConcurrencyStamp = table.Column<string>(nullable: true),
CreationTime = table.Column<DateTime>(nullable: false),
CreatorId = table.Column<Guid>(nullable: true),
LastModificationTime = table.Column<DateTime>(nullable: true),
LastModifierId = table.Column<Guid>(nullable: true),
IsDeleted = table.Column<bool>(nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(nullable: true),
DeletionTime = table.Column<DateTime>(nullable: true),
TenantId = table.Column<Guid>(nullable: true),
ParentId = table.Column<Guid>(nullable: true),
Code = table.Column<string>(maxLength: 95, nullable: false),
DisplayName = table.Column<string>(maxLength: 128, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpOrganizationUnits", x => x.Id);
table.ForeignKey(
name: "FK_AbpOrganizationUnits_AbpOrganizationUnits_ParentId",
column: x => x.ParentId,
principalTable: "AbpOrganizationUnits",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateTable(
name: "AbpOrganizationUnitRoles",
columns: table => new
{
RoleId = table.Column<Guid>(nullable: false),
OrganizationUnitId = table.Column<Guid>(nullable: false),
CreationTime = table.Column<DateTime>(nullable: false),
CreatorId = table.Column<Guid>(nullable: true),
TenantId = table.Column<Guid>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpOrganizationUnitRoles", x => new { x.OrganizationUnitId, x.RoleId });
table.ForeignKey(
name: "FK_AbpOrganizationUnitRoles_AbpOrganizationUnits_OrganizationUn~",
column: x => x.OrganizationUnitId,
principalTable: "AbpOrganizationUnits",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_AbpOrganizationUnitRoles_AbpRoles_RoleId",
column: x => x.RoleId,
principalTable: "AbpRoles",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "AbpUserOrganizationUnits",
columns: table => new
{
UserId = table.Column<Guid>(nullable: false),
OrganizationUnitId = table.Column<Guid>(nullable: false),
CreationTime = table.Column<DateTime>(nullable: false),
CreatorId = table.Column<Guid>(nullable: true),
TenantId = table.Column<Guid>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpUserOrganizationUnits", x => new { x.OrganizationUnitId, x.UserId });
table.ForeignKey(
name: "FK_AbpUserOrganizationUnits_AbpOrganizationUnits_OrganizationUn~",
column: x => x.OrganizationUnitId,
principalTable: "AbpOrganizationUnits",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_AbpUserOrganizationUnits_AbpUsers_UserId",
column: x => x.UserId,
principalTable: "AbpUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_AbpOrganizationUnitRoles_RoleId_OrganizationUnitId",
table: "AbpOrganizationUnitRoles",
columns: new[] { "RoleId", "OrganizationUnitId" });
migrationBuilder.CreateIndex(
name: "IX_AbpOrganizationUnits_Code",
table: "AbpOrganizationUnits",
column: "Code");
migrationBuilder.CreateIndex(
name: "IX_AbpOrganizationUnits_ParentId",
table: "AbpOrganizationUnits",
column: "ParentId");
migrationBuilder.CreateIndex(
name: "IX_AbpUserOrganizationUnits_UserId_OrganizationUnitId",
table: "AbpUserOrganizationUnits",
columns: new[] { "UserId", "OrganizationUnitId" });
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "AbpOrganizationUnitRoles");
migrationBuilder.DropTable(
name: "AbpUserOrganizationUnits");
migrationBuilder.DropTable(
name: "AbpOrganizationUnits");
migrationBuilder.AlterColumn<string>(
name: "Value",
table: "IdentityServerClientSecrets",
type: "longtext CHARACTER SET utf8mb4",
maxLength: 4000,
nullable: false,
oldClrType: typeof(string),
oldMaxLength: 300);
migrationBuilder.AlterColumn<string>(
name: "RedirectUri",
table: "IdentityServerClientRedirectUris",
type: "varchar(2000) CHARACTER SET utf8mb4",
maxLength: 2000,
nullable: false,
oldClrType: typeof(string),
oldMaxLength: 300);
migrationBuilder.AlterColumn<string>(
name: "PostLogoutRedirectUri",
table: "IdentityServerClientPostLogoutRedirectUris",
type: "varchar(2000) CHARACTER SET utf8mb4",
maxLength: 2000,
nullable: false,
oldClrType: typeof(string),
oldMaxLength: 300);
migrationBuilder.AlterColumn<string>(
name: "Value",
table: "IdentityServerApiSecrets",
type: "longtext CHARACTER SET utf8mb4",
maxLength: 4000,
nullable: false,
oldClrType: typeof(string),
oldMaxLength: 300);
}
}
}

1512
aspnet-core/services/account/AuthServer.Host/Migrations/20200908015651_Upgrade-Abp-3.1.0.Designer.cs

File diff suppressed because it is too large

236
aspnet-core/services/account/AuthServer.Host/Migrations/20200908015651_Upgrade-Abp-3.1.0.cs

@ -1,236 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace AuthServer.Host.Migrations
{
public partial class UpgradeAbp310 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "ConcurrencyStamp",
table: "IdentityServerPersistedGrants",
maxLength: 40,
nullable: true,
oldClrType: typeof(string),
oldType: "longtext CHARACTER SET utf8mb4",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ConcurrencyStamp",
table: "IdentityServerIdentityResources",
maxLength: 40,
nullable: true,
oldClrType: typeof(string),
oldType: "longtext CHARACTER SET utf8mb4",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ConcurrencyStamp",
table: "IdentityServerDeviceFlowCodes",
maxLength: 40,
nullable: true,
oldClrType: typeof(string),
oldType: "longtext CHARACTER SET utf8mb4",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ConcurrencyStamp",
table: "IdentityServerClients",
maxLength: 40,
nullable: true,
oldClrType: typeof(string),
oldType: "longtext CHARACTER SET utf8mb4",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ConcurrencyStamp",
table: "IdentityServerApiResources",
maxLength: 40,
nullable: true,
oldClrType: typeof(string),
oldType: "longtext CHARACTER SET utf8mb4",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ConcurrencyStamp",
table: "AbpUsers",
maxLength: 40,
nullable: true,
oldClrType: typeof(string),
oldType: "longtext CHARACTER SET utf8mb4",
oldNullable: true);
migrationBuilder.AddColumn<bool>(
name: "IsExternal",
table: "AbpUsers",
nullable: false,
defaultValue: false);
migrationBuilder.AlterColumn<string>(
name: "ConcurrencyStamp",
table: "AbpRoles",
maxLength: 40,
nullable: true,
oldClrType: typeof(string),
oldType: "varchar(256) CHARACTER SET utf8mb4",
oldMaxLength: 256);
migrationBuilder.AlterColumn<string>(
name: "ConcurrencyStamp",
table: "AbpOrganizationUnits",
maxLength: 40,
nullable: true,
oldClrType: typeof(string),
oldType: "longtext CHARACTER SET utf8mb4",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ConcurrencyStamp",
table: "AbpClaimTypes",
maxLength: 40,
nullable: true,
oldClrType: typeof(string),
oldType: "varchar(256) CHARACTER SET utf8mb4",
oldMaxLength: 256);
migrationBuilder.CreateTable(
name: "AbpSecurityLogs",
columns: table => new
{
Id = table.Column<Guid>(nullable: false),
ExtraProperties = table.Column<string>(nullable: true),
ConcurrencyStamp = table.Column<string>(maxLength: 40, nullable: true),
TenantId = table.Column<Guid>(nullable: true),
ApplicationName = table.Column<string>(maxLength: 96, nullable: true),
Identity = table.Column<string>(maxLength: 96, nullable: true),
Action = table.Column<string>(maxLength: 96, nullable: true),
UserId = table.Column<Guid>(nullable: true),
UserName = table.Column<string>(maxLength: 256, nullable: true),
TenantName = table.Column<string>(maxLength: 64, nullable: true),
ClientId = table.Column<string>(maxLength: 64, nullable: true),
CorrelationId = table.Column<string>(maxLength: 64, nullable: true),
ClientIpAddress = table.Column<string>(maxLength: 64, nullable: true),
BrowserInfo = table.Column<string>(maxLength: 512, nullable: true),
CreationTime = table.Column<DateTime>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpSecurityLogs", x => x.Id);
});
migrationBuilder.CreateIndex(
name: "IX_AbpSecurityLogs_TenantId_Action",
table: "AbpSecurityLogs",
columns: new[] { "TenantId", "Action" });
migrationBuilder.CreateIndex(
name: "IX_AbpSecurityLogs_TenantId_ApplicationName",
table: "AbpSecurityLogs",
columns: new[] { "TenantId", "ApplicationName" });
migrationBuilder.CreateIndex(
name: "IX_AbpSecurityLogs_TenantId_Identity",
table: "AbpSecurityLogs",
columns: new[] { "TenantId", "Identity" });
migrationBuilder.CreateIndex(
name: "IX_AbpSecurityLogs_TenantId_UserId",
table: "AbpSecurityLogs",
columns: new[] { "TenantId", "UserId" });
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "AbpSecurityLogs");
migrationBuilder.DropColumn(
name: "IsExternal",
table: "AbpUsers");
migrationBuilder.AlterColumn<string>(
name: "ConcurrencyStamp",
table: "IdentityServerPersistedGrants",
type: "longtext CHARACTER SET utf8mb4",
nullable: true,
oldClrType: typeof(string),
oldMaxLength: 40,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ConcurrencyStamp",
table: "IdentityServerIdentityResources",
type: "longtext CHARACTER SET utf8mb4",
nullable: true,
oldClrType: typeof(string),
oldMaxLength: 40,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ConcurrencyStamp",
table: "IdentityServerDeviceFlowCodes",
type: "longtext CHARACTER SET utf8mb4",
nullable: true,
oldClrType: typeof(string),
oldMaxLength: 40,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ConcurrencyStamp",
table: "IdentityServerClients",
type: "longtext CHARACTER SET utf8mb4",
nullable: true,
oldClrType: typeof(string),
oldMaxLength: 40,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ConcurrencyStamp",
table: "IdentityServerApiResources",
type: "longtext CHARACTER SET utf8mb4",
nullable: true,
oldClrType: typeof(string),
oldMaxLength: 40,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ConcurrencyStamp",
table: "AbpUsers",
type: "longtext CHARACTER SET utf8mb4",
nullable: true,
oldClrType: typeof(string),
oldMaxLength: 40,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ConcurrencyStamp",
table: "AbpRoles",
type: "varchar(256) CHARACTER SET utf8mb4",
maxLength: 256,
nullable: false,
oldClrType: typeof(string),
oldMaxLength: 40,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ConcurrencyStamp",
table: "AbpOrganizationUnits",
type: "longtext CHARACTER SET utf8mb4",
nullable: true,
oldClrType: typeof(string),
oldMaxLength: 40,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ConcurrencyStamp",
table: "AbpClaimTypes",
type: "varchar(256) CHARACTER SET utf8mb4",
maxLength: 256,
nullable: false,
oldClrType: typeof(string),
oldMaxLength: 40,
oldNullable: true);
}
}
}

657
aspnet-core/services/account/AuthServer.Host/Migrations/20201222101851_Upgrade-Abp-4.0.0.cs

@ -1,657 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace AuthServer.Host.Migrations
{
public partial class UpgradeAbp400 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_IdentityServerApiClaims_IdentityServerApiResources_ApiResour~",
table: "IdentityServerApiClaims");
migrationBuilder.DropForeignKey(
name: "FK_IdentityServerApiScopeClaims_IdentityServerApiScopes_ApiReso~",
table: "IdentityServerApiScopeClaims");
migrationBuilder.DropForeignKey(
name: "FK_IdentityServerApiScopes_IdentityServerApiResources_ApiResour~",
table: "IdentityServerApiScopes");
migrationBuilder.DropTable(
name: "IdentityServerApiSecrets");
migrationBuilder.DropTable(
name: "IdentityServerIdentityClaims");
migrationBuilder.DropIndex(
name: "IX_IdentityServerDeviceFlowCodes_UserCode",
table: "IdentityServerDeviceFlowCodes");
migrationBuilder.DropPrimaryKey(
name: "PK_IdentityServerClientProperties",
table: "IdentityServerClientProperties");
migrationBuilder.DropPrimaryKey(
name: "PK_IdentityServerApiScopes",
table: "IdentityServerApiScopes");
migrationBuilder.DropPrimaryKey(
name: "PK_IdentityServerApiScopeClaims",
table: "IdentityServerApiScopeClaims");
migrationBuilder.DropPrimaryKey(
name: "PK_IdentityServerApiClaims",
table: "IdentityServerApiClaims");
migrationBuilder.DropColumn(
name: "Properties",
table: "IdentityServerIdentityResources");
migrationBuilder.DropColumn(
name: "Name",
table: "IdentityServerApiScopeClaims");
migrationBuilder.DropColumn(
name: "Properties",
table: "IdentityServerApiResources");
migrationBuilder.RenameTable(
name: "IdentityServerApiClaims",
newName: "IdentityServerApiResourceClaims");
migrationBuilder.RenameColumn(
name: "ApiResourceId",
table: "IdentityServerApiScopes",
newName: "Id");
migrationBuilder.RenameColumn(
name: "ApiResourceId",
table: "IdentityServerApiScopeClaims",
newName: "ApiScopeId");
migrationBuilder.AddColumn<DateTime>(
name: "ConsumedTime",
table: "IdentityServerPersistedGrants",
type: "datetime(6)",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "Description",
table: "IdentityServerPersistedGrants",
type: "varchar(200) CHARACTER SET utf8mb4",
maxLength: 200,
nullable: true);
migrationBuilder.AddColumn<string>(
name: "SessionId",
table: "IdentityServerPersistedGrants",
type: "varchar(100) CHARACTER SET utf8mb4",
maxLength: 100,
nullable: true);
migrationBuilder.AddColumn<string>(
name: "Description",
table: "IdentityServerDeviceFlowCodes",
type: "varchar(200) CHARACTER SET utf8mb4",
maxLength: 200,
nullable: true);
migrationBuilder.AddColumn<string>(
name: "SessionId",
table: "IdentityServerDeviceFlowCodes",
type: "varchar(100) CHARACTER SET utf8mb4",
maxLength: 100,
nullable: true);
migrationBuilder.AddColumn<string>(
name: "AllowedIdentityTokenSigningAlgorithms",
table: "IdentityServerClients",
type: "varchar(100) CHARACTER SET utf8mb4",
maxLength: 100,
nullable: true);
migrationBuilder.AddColumn<bool>(
name: "RequireRequestObject",
table: "IdentityServerClients",
type: "tinyint(1)",
nullable: false,
defaultValue: false);
migrationBuilder.AlterColumn<string>(
name: "Value",
table: "IdentityServerClientProperties",
type: "varchar(300) CHARACTER SET utf8mb4",
maxLength: 300,
nullable: false,
oldClrType: typeof(string),
oldType: "varchar(2000) CHARACTER SET utf8mb4",
oldMaxLength: 2000);
migrationBuilder.AddColumn<string>(
name: "ConcurrencyStamp",
table: "IdentityServerApiScopes",
type: "varchar(40) CHARACTER SET utf8mb4",
maxLength: 40,
nullable: true);
migrationBuilder.AddColumn<DateTime>(
name: "CreationTime",
table: "IdentityServerApiScopes",
type: "datetime(6)",
nullable: false,
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
migrationBuilder.AddColumn<Guid>(
name: "CreatorId",
table: "IdentityServerApiScopes",
type: "char(36)",
nullable: true);
migrationBuilder.AddColumn<Guid>(
name: "DeleterId",
table: "IdentityServerApiScopes",
type: "char(36)",
nullable: true);
migrationBuilder.AddColumn<DateTime>(
name: "DeletionTime",
table: "IdentityServerApiScopes",
type: "datetime(6)",
nullable: true);
migrationBuilder.AddColumn<bool>(
name: "Enabled",
table: "IdentityServerApiScopes",
type: "tinyint(1)",
nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<string>(
name: "ExtraProperties",
table: "IdentityServerApiScopes",
type: "longtext CHARACTER SET utf8mb4",
nullable: true);
migrationBuilder.AddColumn<bool>(
name: "IsDeleted",
table: "IdentityServerApiScopes",
type: "tinyint(1)",
nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<DateTime>(
name: "LastModificationTime",
table: "IdentityServerApiScopes",
type: "datetime(6)",
nullable: true);
migrationBuilder.AddColumn<Guid>(
name: "LastModifierId",
table: "IdentityServerApiScopes",
type: "char(36)",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "AllowedAccessTokenSigningAlgorithms",
table: "IdentityServerApiResources",
type: "varchar(100) CHARACTER SET utf8mb4",
maxLength: 100,
nullable: true);
migrationBuilder.AddColumn<bool>(
name: "ShowInDiscoveryDocument",
table: "IdentityServerApiResources",
type: "tinyint(1)",
nullable: false,
defaultValue: false);
migrationBuilder.AddPrimaryKey(
name: "PK_IdentityServerClientProperties",
table: "IdentityServerClientProperties",
columns: new[] { "ClientId", "Key", "Value" });
migrationBuilder.AddPrimaryKey(
name: "PK_IdentityServerApiScopes",
table: "IdentityServerApiScopes",
column: "Id");
migrationBuilder.AddPrimaryKey(
name: "PK_IdentityServerApiScopeClaims",
table: "IdentityServerApiScopeClaims",
columns: new[] { "ApiScopeId", "Type" });
migrationBuilder.AddPrimaryKey(
name: "PK_IdentityServerApiResourceClaims",
table: "IdentityServerApiResourceClaims",
columns: new[] { "ApiResourceId", "Type" });
migrationBuilder.CreateTable(
name: "AbpLinkUsers",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false),
SourceUserId = table.Column<Guid>(type: "char(36)", nullable: false),
SourceTenantId = table.Column<Guid>(type: "char(36)", nullable: true),
TargetUserId = table.Column<Guid>(type: "char(36)", nullable: false),
TargetTenantId = table.Column<Guid>(type: "char(36)", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpLinkUsers", x => x.Id);
});
migrationBuilder.CreateTable(
name: "IdentityServerApiResourceProperties",
columns: table => new
{
ApiResourceId = table.Column<Guid>(type: "char(36)", nullable: false),
Key = table.Column<string>(type: "varchar(250) CHARACTER SET utf8mb4", maxLength: 250, nullable: false),
Value = table.Column<string>(type: "varchar(300) CHARACTER SET utf8mb4", maxLength: 300, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_IdentityServerApiResourceProperties", x => new { x.ApiResourceId, x.Key, x.Value });
table.ForeignKey(
name: "FK_IdentityServerApiResourceProperties_IdentityServerApiResourc~",
column: x => x.ApiResourceId,
principalTable: "IdentityServerApiResources",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "IdentityServerApiResourceScopes",
columns: table => new
{
ApiResourceId = table.Column<Guid>(type: "char(36)", nullable: false),
Scope = table.Column<string>(type: "varchar(200) CHARACTER SET utf8mb4", maxLength: 200, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_IdentityServerApiResourceScopes", x => new { x.ApiResourceId, x.Scope });
table.ForeignKey(
name: "FK_IdentityServerApiResourceScopes_IdentityServerApiResources_A~",
column: x => x.ApiResourceId,
principalTable: "IdentityServerApiResources",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "IdentityServerApiResourceSecrets",
columns: table => new
{
Type = table.Column<string>(type: "varchar(250) CHARACTER SET utf8mb4", maxLength: 250, nullable: false),
Value = table.Column<string>(type: "varchar(300) CHARACTER SET utf8mb4", maxLength: 300, nullable: false),
ApiResourceId = table.Column<Guid>(type: "char(36)", nullable: false),
Description = table.Column<string>(type: "varchar(1000) CHARACTER SET utf8mb4", maxLength: 1000, nullable: true),
Expiration = table.Column<DateTime>(type: "datetime(6)", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_IdentityServerApiResourceSecrets", x => new { x.ApiResourceId, x.Type, x.Value });
table.ForeignKey(
name: "FK_IdentityServerApiResourceSecrets_IdentityServerApiResources_~",
column: x => x.ApiResourceId,
principalTable: "IdentityServerApiResources",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "IdentityServerApiScopeProperties",
columns: table => new
{
ApiScopeId = table.Column<Guid>(type: "char(36)", nullable: false),
Key = table.Column<string>(type: "varchar(250) CHARACTER SET utf8mb4", maxLength: 250, nullable: false),
Value = table.Column<string>(type: "varchar(300) CHARACTER SET utf8mb4", maxLength: 300, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_IdentityServerApiScopeProperties", x => new { x.ApiScopeId, x.Key, x.Value });
table.ForeignKey(
name: "FK_IdentityServerApiScopeProperties_IdentityServerApiScopes_Api~",
column: x => x.ApiScopeId,
principalTable: "IdentityServerApiScopes",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "IdentityServerIdentityResourceClaims",
columns: table => new
{
Type = table.Column<string>(type: "varchar(200) CHARACTER SET utf8mb4", maxLength: 200, nullable: false),
IdentityResourceId = table.Column<Guid>(type: "char(36)", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_IdentityServerIdentityResourceClaims", x => new { x.IdentityResourceId, x.Type });
table.ForeignKey(
name: "FK_IdentityServerIdentityResourceClaims_IdentityServerIdentityR~",
column: x => x.IdentityResourceId,
principalTable: "IdentityServerIdentityResources",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "IdentityServerIdentityResourceProperties",
columns: table => new
{
IdentityResourceId = table.Column<Guid>(type: "char(36)", nullable: false),
Key = table.Column<string>(type: "varchar(250) CHARACTER SET utf8mb4", maxLength: 250, nullable: false),
Value = table.Column<string>(type: "varchar(300) CHARACTER SET utf8mb4", maxLength: 300, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_IdentityServerIdentityResourceProperties", x => new { x.IdentityResourceId, x.Key, x.Value });
table.ForeignKey(
name: "FK_IdentityServerIdentityResourceProperties_IdentityServerIdent~",
column: x => x.IdentityResourceId,
principalTable: "IdentityServerIdentityResources",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_IdentityServerPersistedGrants_SubjectId_SessionId_Type",
table: "IdentityServerPersistedGrants",
columns: new[] { "SubjectId", "SessionId", "Type" });
migrationBuilder.CreateIndex(
name: "IX_IdentityServerDeviceFlowCodes_UserCode",
table: "IdentityServerDeviceFlowCodes",
column: "UserCode");
migrationBuilder.CreateIndex(
name: "IX_AbpLinkUsers_SourceUserId_SourceTenantId_TargetUserId_Target~",
table: "AbpLinkUsers",
columns: new[] { "SourceUserId", "SourceTenantId", "TargetUserId", "TargetTenantId" },
unique: true);
migrationBuilder.AddForeignKey(
name: "FK_IdentityServerApiResourceClaims_IdentityServerApiResources_A~",
table: "IdentityServerApiResourceClaims",
column: "ApiResourceId",
principalTable: "IdentityServerApiResources",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_IdentityServerApiScopeClaims_IdentityServerApiScopes_ApiScop~",
table: "IdentityServerApiScopeClaims",
column: "ApiScopeId",
principalTable: "IdentityServerApiScopes",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_IdentityServerApiResourceClaims_IdentityServerApiResources_A~",
table: "IdentityServerApiResourceClaims");
migrationBuilder.DropForeignKey(
name: "FK_IdentityServerApiScopeClaims_IdentityServerApiScopes_ApiScop~",
table: "IdentityServerApiScopeClaims");
migrationBuilder.DropTable(
name: "AbpLinkUsers");
migrationBuilder.DropTable(
name: "IdentityServerApiResourceProperties");
migrationBuilder.DropTable(
name: "IdentityServerApiResourceScopes");
migrationBuilder.DropTable(
name: "IdentityServerApiResourceSecrets");
migrationBuilder.DropTable(
name: "IdentityServerApiScopeProperties");
migrationBuilder.DropTable(
name: "IdentityServerIdentityResourceClaims");
migrationBuilder.DropTable(
name: "IdentityServerIdentityResourceProperties");
migrationBuilder.DropIndex(
name: "IX_IdentityServerPersistedGrants_SubjectId_SessionId_Type",
table: "IdentityServerPersistedGrants");
migrationBuilder.DropIndex(
name: "IX_IdentityServerDeviceFlowCodes_UserCode",
table: "IdentityServerDeviceFlowCodes");
migrationBuilder.DropPrimaryKey(
name: "PK_IdentityServerClientProperties",
table: "IdentityServerClientProperties");
migrationBuilder.DropPrimaryKey(
name: "PK_IdentityServerApiScopes",
table: "IdentityServerApiScopes");
migrationBuilder.DropPrimaryKey(
name: "PK_IdentityServerApiScopeClaims",
table: "IdentityServerApiScopeClaims");
migrationBuilder.DropPrimaryKey(
name: "PK_IdentityServerApiResourceClaims",
table: "IdentityServerApiResourceClaims");
migrationBuilder.DropColumn(
name: "ConsumedTime",
table: "IdentityServerPersistedGrants");
migrationBuilder.DropColumn(
name: "Description",
table: "IdentityServerPersistedGrants");
migrationBuilder.DropColumn(
name: "SessionId",
table: "IdentityServerPersistedGrants");
migrationBuilder.DropColumn(
name: "Description",
table: "IdentityServerDeviceFlowCodes");
migrationBuilder.DropColumn(
name: "SessionId",
table: "IdentityServerDeviceFlowCodes");
migrationBuilder.DropColumn(
name: "AllowedIdentityTokenSigningAlgorithms",
table: "IdentityServerClients");
migrationBuilder.DropColumn(
name: "RequireRequestObject",
table: "IdentityServerClients");
migrationBuilder.DropColumn(
name: "ConcurrencyStamp",
table: "IdentityServerApiScopes");
migrationBuilder.DropColumn(
name: "CreationTime",
table: "IdentityServerApiScopes");
migrationBuilder.DropColumn(
name: "CreatorId",
table: "IdentityServerApiScopes");
migrationBuilder.DropColumn(
name: "DeleterId",
table: "IdentityServerApiScopes");
migrationBuilder.DropColumn(
name: "DeletionTime",
table: "IdentityServerApiScopes");
migrationBuilder.DropColumn(
name: "Enabled",
table: "IdentityServerApiScopes");
migrationBuilder.DropColumn(
name: "ExtraProperties",
table: "IdentityServerApiScopes");
migrationBuilder.DropColumn(
name: "IsDeleted",
table: "IdentityServerApiScopes");
migrationBuilder.DropColumn(
name: "LastModificationTime",
table: "IdentityServerApiScopes");
migrationBuilder.DropColumn(
name: "LastModifierId",
table: "IdentityServerApiScopes");
migrationBuilder.DropColumn(
name: "AllowedAccessTokenSigningAlgorithms",
table: "IdentityServerApiResources");
migrationBuilder.DropColumn(
name: "ShowInDiscoveryDocument",
table: "IdentityServerApiResources");
migrationBuilder.RenameTable(
name: "IdentityServerApiResourceClaims",
newName: "IdentityServerApiClaims");
migrationBuilder.RenameColumn(
name: "Id",
table: "IdentityServerApiScopes",
newName: "ApiResourceId");
migrationBuilder.RenameColumn(
name: "ApiScopeId",
table: "IdentityServerApiScopeClaims",
newName: "ApiResourceId");
migrationBuilder.AddColumn<string>(
name: "Properties",
table: "IdentityServerIdentityResources",
type: "longtext CHARACTER SET utf8mb4",
nullable: true);
migrationBuilder.AlterColumn<string>(
name: "Value",
table: "IdentityServerClientProperties",
type: "varchar(2000) CHARACTER SET utf8mb4",
maxLength: 2000,
nullable: false,
oldClrType: typeof(string),
oldType: "varchar(300) CHARACTER SET utf8mb4",
oldMaxLength: 300);
migrationBuilder.AddColumn<string>(
name: "Name",
table: "IdentityServerApiScopeClaims",
type: "varchar(200) CHARACTER SET utf8mb4",
maxLength: 200,
nullable: false,
defaultValue: "");
migrationBuilder.AddColumn<string>(
name: "Properties",
table: "IdentityServerApiResources",
type: "longtext CHARACTER SET utf8mb4",
nullable: true);
migrationBuilder.AddPrimaryKey(
name: "PK_IdentityServerClientProperties",
table: "IdentityServerClientProperties",
columns: new[] { "ClientId", "Key" });
migrationBuilder.AddPrimaryKey(
name: "PK_IdentityServerApiScopes",
table: "IdentityServerApiScopes",
columns: new[] { "ApiResourceId", "Name" });
migrationBuilder.AddPrimaryKey(
name: "PK_IdentityServerApiScopeClaims",
table: "IdentityServerApiScopeClaims",
columns: new[] { "ApiResourceId", "Name", "Type" });
migrationBuilder.AddPrimaryKey(
name: "PK_IdentityServerApiClaims",
table: "IdentityServerApiClaims",
columns: new[] { "ApiResourceId", "Type" });
migrationBuilder.CreateTable(
name: "IdentityServerApiSecrets",
columns: table => new
{
ApiResourceId = table.Column<Guid>(type: "char(36)", nullable: false),
Type = table.Column<string>(type: "varchar(250) CHARACTER SET utf8mb4", maxLength: 250, nullable: false),
Value = table.Column<string>(type: "varchar(300) CHARACTER SET utf8mb4", maxLength: 300, nullable: false),
Description = table.Column<string>(type: "varchar(2000) CHARACTER SET utf8mb4", maxLength: 2000, nullable: true),
Expiration = table.Column<DateTime>(type: "datetime(6)", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_IdentityServerApiSecrets", x => new { x.ApiResourceId, x.Type, x.Value });
table.ForeignKey(
name: "FK_IdentityServerApiSecrets_IdentityServerApiResources_ApiResou~",
column: x => x.ApiResourceId,
principalTable: "IdentityServerApiResources",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "IdentityServerIdentityClaims",
columns: table => new
{
IdentityResourceId = table.Column<Guid>(type: "char(36)", nullable: false),
Type = table.Column<string>(type: "varchar(200) CHARACTER SET utf8mb4", maxLength: 200, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_IdentityServerIdentityClaims", x => new { x.IdentityResourceId, x.Type });
table.ForeignKey(
name: "FK_IdentityServerIdentityClaims_IdentityServerIdentityResources~",
column: x => x.IdentityResourceId,
principalTable: "IdentityServerIdentityResources",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_IdentityServerDeviceFlowCodes_UserCode",
table: "IdentityServerDeviceFlowCodes",
column: "UserCode",
unique: true);
migrationBuilder.AddForeignKey(
name: "FK_IdentityServerApiClaims_IdentityServerApiResources_ApiResour~",
table: "IdentityServerApiClaims",
column: "ApiResourceId",
principalTable: "IdentityServerApiResources",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_IdentityServerApiScopeClaims_IdentityServerApiScopes_ApiReso~",
table: "IdentityServerApiScopeClaims",
columns: new[] { "ApiResourceId", "Name" },
principalTable: "IdentityServerApiScopes",
principalColumns: new[] { "ApiResourceId", "Name" },
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_IdentityServerApiScopes_IdentityServerApiResources_ApiResour~",
table: "IdentityServerApiScopes",
column: "ApiResourceId",
principalTable: "IdentityServerApiResources",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
}
}

1774
aspnet-core/services/account/AuthServer.Host/Migrations/20210302035805_Add-IdentityUser-AvatarUrl.Designer.cs

File diff suppressed because it is too large

24
aspnet-core/services/account/AuthServer.Host/Migrations/20210302035805_Add-IdentityUser-AvatarUrl.cs

@ -1,24 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace AuthServer.Host.Migrations
{
public partial class AddIdentityUserAvatarUrl : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "AvatarUrl",
table: "AbpUsers",
type: "varchar(128) CHARACTER SET utf8mb4",
maxLength: 128,
nullable: true);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "AvatarUrl",
table: "AbpUsers");
}
}
}

3544
aspnet-core/services/account/AuthServer.Host/Migrations/20201222101851_Upgrade-Abp-4.0.0.Designer.cs → aspnet-core/services/account/AuthServer.Host/Migrations/20211030124247_Re-Initlize-Db-Migration.Designer.cs

File diff suppressed because it is too large

1221
aspnet-core/services/account/AuthServer.Host/Migrations/20211030124247_Re-Initlize-Db-Migration.cs

File diff suppressed because it is too large

3544
aspnet-core/services/account/AuthServer.Host/Migrations/IdentityServerMigrationsDbContextModelSnapshot.cs → aspnet-core/services/account/AuthServer.Host/Migrations/AuthServerHostMigrationsDbContextModelSnapshot.cs

File diff suppressed because it is too large

4
aspnet-core/services/account/AuthServer.Host/appsettings.Development.json

@ -80,7 +80,7 @@
},
"AuditLogging": {
"Elasticsearch": {
"IndexPrefix": "lingyun.abp.auditing"
"IndexPrefix": "abp.dev.auditing"
}
},
"Elasticsearch": {
@ -107,7 +107,7 @@
"Name": "Elasticsearch",
"Args": {
"nodeUris": "http://localhost:9200",
"indexFormat": "lingyun.abp.logging-{0:yyyy.MM.dd}",
"indexFormat": "abp.dev.logging-{0:yyyy.MM.dd}",
"autoRegisterTemplate": true,
"autoRegisterTemplateVersion": "ESv7"
}

2
aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/BackendAdminHostModule.cs

@ -1,6 +1,7 @@
using LINGYUN.Abp.AspNetCore.HttpOverrides;
using LINGYUN.Abp.Auditing;
using LINGYUN.Abp.AuditLogging.Elasticsearch;
using LINGYUN.Abp.Data.DbMigrator;
using LINGYUN.Abp.EventBus.CAP;
using LINGYUN.Abp.ExceptionHandling.Emailing;
using LINGYUN.Abp.FeatureManagement;
@ -64,6 +65,7 @@ namespace LINGYUN.Abp.BackendAdmin
typeof(AbpPermissionManagementEntityFrameworkCoreModule),
typeof(AbpFeatureManagementEntityFrameworkCoreModule),
typeof(AbpLocalizationManagementEntityFrameworkCoreModule),
typeof(AbpDataDbMigratorModule),
typeof(AbpAspNetCoreAuthenticationJwtBearerModule),
typeof(AbpEmailingExceptionHandlingModule),
typeof(AbpCAPEventBusModule),

11
aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/EventBus/Handlers/TenantConnectionStringCreateEventHandler.cs

@ -1,11 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace LINGYUN.Abp.BackendAdmin.EventBus.Handlers
{
public class TenantConnectionStringCreateEventHandler
{
}
}

82
aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/EventBus/Handlers/TenantDeleteEventHandler.cs

@ -1,82 +0,0 @@
using Microsoft.EntityFrameworkCore;
using System;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Domain.Entities.Events.Distributed;
using Volo.Abp.Domain.Repositories;
using Volo.Abp.EventBus.Distributed;
using Volo.Abp.Guids;
using Volo.Abp.MultiTenancy;
using Volo.Abp.PermissionManagement;
using Volo.Abp.TenantManagement;
using Volo.Abp.Uow;
namespace LINGYUN.Abp.BackendAdmin.EventBus.Handlers
{
public class TenantDeleteEventHandler : IDistributedEventHandler<EntityDeletedEto<TenantEto>>, ITransientDependency
{
protected ICurrentTenant CurrentTenant { get; }
protected IGuidGenerator GuidGenerator { get; }
protected IUnitOfWorkManager UnitOfWorkManager { get; }
protected IPermissionGrantRepository PermissionGrantRepository { get; }
public TenantDeleteEventHandler(
ICurrentTenant currentTenant,
IGuidGenerator guidGenerator,
IUnitOfWorkManager unitOfWorkManager,
IPermissionGrantRepository permissionGrantRepository)
{
CurrentTenant = currentTenant;
GuidGenerator = guidGenerator;
UnitOfWorkManager = unitOfWorkManager;
PermissionGrantRepository = permissionGrantRepository;
}
public async Task HandleEventAsync(EntityDeletedEto<TenantEto> eventData)
{
using var unitOfWork = UnitOfWorkManager.Begin();
// 订阅租户删除事件,删除管理员角色所有权限
// TODO: 租户貌似不存在了,删除应该会失败
// 有缓存存在的话,可以获取到租户连接字符串
using (CurrentTenant.Change(eventData.Entity.Id))
{
// var grantPermissions = await PermissionGrantRepository.GetListAsync("R", "admin");
// EfCore MySql 批量删除还是一条一条的语句?
// PermissionGrantRepository.GetDbSet().RemoveRange(grantPermissions);
var dbContext = await PermissionGrantRepository.GetDbContextAsync();
var permissionEntityType = dbContext.Model.FindEntityType(typeof(PermissionGrant));
var permissionTableName = permissionEntityType.GetTableName();
var batchRmovePermissionSql = string.Empty;
if (dbContext.Database.IsMySql())
{
batchRmovePermissionSql = BuildMySqlBatchDeleteScript(permissionTableName, eventData.Entity.Id);
}
else
{
batchRmovePermissionSql = BuildSqlServerBatchDeleteScript(permissionTableName, eventData.Entity.Id);
}
await dbContext.Database.ExecuteSqlRawAsync(batchRmovePermissionSql);
await unitOfWork.SaveChangesAsync();
}
}
protected virtual string BuildMySqlBatchDeleteScript(string tableName, Guid tenantId)
{
var batchRemovePermissionSql = new StringBuilder(128);
batchRemovePermissionSql.AppendLine($"DELETE FROM `{tableName}` WHERE `TenantId` = '{tenantId}'");
batchRemovePermissionSql.AppendLine("AND `ProviderName`='R' AND `ProviderKey`='admin'");
return batchRemovePermissionSql.ToString();
}
protected virtual string BuildSqlServerBatchDeleteScript(string tableName, Guid tenantId)
{
var batchRemovePermissionSql = new StringBuilder(128);
batchRemovePermissionSql.AppendLine($"DELETE {tableName} WHERE TenantId = '{tenantId}'");
batchRemovePermissionSql.AppendLine("AND ProviderName='R' AND ProviderKey='admin'");
return batchRemovePermissionSql.ToString();
}
}
}

299
aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/EventBus/Handlers/TenantCreateEventHandler.cs → aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/EventBus/Handlers/TenantSynchronizer.cs

@ -1,111 +1,188 @@
using LINGYUN.Abp.MultiTenancy;
using Microsoft.EntityFrameworkCore;
using System;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Authorization.Permissions;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Domain.Repositories;
using Volo.Abp.EventBus.Distributed;
using Volo.Abp.Guids;
using Volo.Abp.MultiTenancy;
using Volo.Abp.PermissionManagement;
using Volo.Abp.Uow;
namespace LINGYUN.Abp.BackendAdmin.EventBus.Handlers
{
public class TenantCreateEventHandler : IDistributedEventHandler<CreateEventData>, ITransientDependency
{
protected ICurrentTenant CurrentTenant { get; }
protected IGuidGenerator GuidGenerator { get; }
protected IUnitOfWorkManager UnitOfWorkManager { get; }
protected IPermissionGrantRepository PermissionGrantRepository { get; }
protected IPermissionDefinitionManager PermissionDefinitionManager { get; }
public TenantCreateEventHandler(
ICurrentTenant currentTenant,
IGuidGenerator guidGenerator,
IUnitOfWorkManager unitOfWorkManager,
IPermissionGrantRepository permissionGrantRepository,
IPermissionDefinitionManager permissionDefinitionManager)
{
CurrentTenant = currentTenant;
GuidGenerator = guidGenerator;
UnitOfWorkManager = unitOfWorkManager;
PermissionGrantRepository = permissionGrantRepository;
PermissionDefinitionManager = permissionDefinitionManager;
}
public async Task HandleEventAsync(CreateEventData eventData)
{
using (var unitOfWork = UnitOfWorkManager.Begin())
{
// 订阅租户新增事件,置入管理员角色所有权限
using (CurrentTenant.Change(eventData.Id, eventData.Name))
{
var definitionPermissions = PermissionDefinitionManager.GetPermissions();
var grantPermissions = definitionPermissions
.Where(p => p.MultiTenancySide.HasFlag(MultiTenancySides.Tenant))
.Select(p => p.Name).ToArray();
//var grantPermissions = new List<PermissionGrant>();
//foreach (var permission in definitionPermissions)
//{
// var permissionGrant = new PermissionGrant(GuidGenerator.Create(),
// permission.Name, "R", "admin", eventData.Id);
// grantPermissions.Add(permissionGrant);
//}
// TODO: MySql 批量新增还是一条一条的语句?
// await PermissionGrantRepository.GetDbSet().AddRangeAsync(grantPermissions);
var dbContext = await PermissionGrantRepository.GetDbContextAsync();
var permissionEntityType = dbContext.Model.FindEntityType(typeof(PermissionGrant));
var permissionTableName = permissionEntityType.GetTableName();
var batchInsertPermissionSql = string.Empty;
if (dbContext.Database.IsMySql())
{
batchInsertPermissionSql = BuildMySqlBatchInsertScript(permissionTableName, eventData.Id, grantPermissions);
}
else
{
batchInsertPermissionSql = BuildSqlServerBatchInsertScript(permissionTableName, eventData.Id, grantPermissions);
}
await dbContext.Database.ExecuteSqlRawAsync(batchInsertPermissionSql);
await unitOfWork.SaveChangesAsync();
}
}
}
protected virtual string BuildMySqlBatchInsertScript(string tableName, Guid tenantId, string[] permissions)
{
var batchInsertPermissionSql = new StringBuilder(128);
batchInsertPermissionSql.AppendLine($"INSERT INTO `{tableName}`(`Id`, `TenantId`, `Name`, `ProviderName`, `ProviderKey`)");
batchInsertPermissionSql.AppendLine("VALUES");
for (int i = 0; i < permissions.Length; i++)
{
batchInsertPermissionSql.AppendLine($"(UUID(), '{tenantId}','{permissions[i]}','R','admin')");
if(i < permissions.Length - 1)
{
batchInsertPermissionSql.AppendLine(",");
}
}
return batchInsertPermissionSql.ToString();
}
protected virtual string BuildSqlServerBatchInsertScript(string tableName, Guid tenantId, string[] permissions)
{
var batchInsertPermissionSql = new StringBuilder(128);
batchInsertPermissionSql.AppendLine($"INSERT INTO {tableName}(Id, TenantId, Name, ProviderName, ProviderKey)");
batchInsertPermissionSql.Append("VALUES");
for (int i = 0; i < permissions.Length; i++)
{
batchInsertPermissionSql.AppendLine($"(NEWID(), '{tenantId}','{permissions[i]}','R','admin')");
if (i < permissions.Length - 1)
{
batchInsertPermissionSql.AppendLine(",");
}
}
return batchInsertPermissionSql.ToString();
}
}
}
using LINGYUN.Abp.BackendAdmin.EntityFrameworkCore;
using LINGYUN.Abp.Data.DbMigrator;
using LINGYUN.Abp.MultiTenancy;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Logging;
using System;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Authorization.Permissions;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Domain.Entities.Events.Distributed;
using Volo.Abp.Domain.Repositories;
using Volo.Abp.EventBus.Distributed;
using Volo.Abp.Guids;
using Volo.Abp.MultiTenancy;
using Volo.Abp.PermissionManagement;
using Volo.Abp.TenantManagement;
using Volo.Abp.Uow;
namespace LINGYUN.Abp.BackendAdmin.EventBus.Handlers
{
public class TenantSynchronizer :
IDistributedEventHandler<CreateEventData>,
IDistributedEventHandler<EntityDeletedEto<TenantEto>>,
ITransientDependency
{
protected ILogger<TenantSynchronizer> Logger { get; }
protected ICurrentTenant CurrentTenant { get; }
protected IGuidGenerator GuidGenerator { get; }
protected IUnitOfWorkManager UnitOfWorkManager { get; }
protected IDbSchemaMigrator DbSchemaMigrator { get; }
protected IPermissionGrantRepository PermissionGrantRepository { get; }
protected IPermissionDefinitionManager PermissionDefinitionManager { get; }
public TenantSynchronizer(
ICurrentTenant currentTenant,
IGuidGenerator guidGenerator,
IUnitOfWorkManager unitOfWorkManager,
IDbSchemaMigrator dbSchemaMigrator,
IPermissionGrantRepository permissionGrantRepository,
IPermissionDefinitionManager permissionDefinitionManager,
ILogger<TenantSynchronizer> logger)
{
CurrentTenant = currentTenant;
GuidGenerator = guidGenerator;
UnitOfWorkManager = unitOfWorkManager;
DbSchemaMigrator = dbSchemaMigrator;
PermissionGrantRepository = permissionGrantRepository;
PermissionDefinitionManager = permissionDefinitionManager;
Logger = logger;
}
public async Task HandleEventAsync(EntityDeletedEto<TenantEto> eventData)
{
using var unitOfWork = UnitOfWorkManager.Begin();
// 订阅租户删除事件,删除管理员角色所有权限
// TODO: 租户貌似不存在了,删除应该会失败
// 有缓存存在的话,可以获取到租户连接字符串
using (CurrentTenant.Change(eventData.Entity.Id))
{
// var grantPermissions = await PermissionGrantRepository.GetListAsync("R", "admin");
// EfCore MySql 批量删除还是一条一条的语句?
// PermissionGrantRepository.GetDbSet().RemoveRange(grantPermissions);
var dbContext = await PermissionGrantRepository.GetDbContextAsync();
var permissionEntityType = dbContext.Model.FindEntityType(typeof(PermissionGrant));
var permissionTableName = permissionEntityType.GetTableName();
var batchRmovePermissionSql = string.Empty;
if (dbContext.Database.IsMySql())
{
batchRmovePermissionSql = BuildMySqlBatchDeleteScript(permissionTableName, eventData.Entity.Id);
}
else
{
batchRmovePermissionSql = BuildSqlServerBatchDeleteScript(permissionTableName, eventData.Entity.Id);
}
await dbContext.Database.ExecuteSqlRawAsync(batchRmovePermissionSql);
await unitOfWork.SaveChangesAsync();
}
}
public async Task HandleEventAsync(CreateEventData eventData)
{
using (var unitOfWork = UnitOfWorkManager.Begin())
{
// 订阅租户新增事件,置入管理员角色所有权限
using (CurrentTenant.Change(eventData.Id, eventData.Name))
{
Logger.LogInformation("Migrating the new tenant database with platform...");
// 迁移租户数据
await DbSchemaMigrator.MigrateAsync<BackendAdminHostMigrationsDbContext>(
(connectionString, builder) =>
{
builder.UseMySql(connectionString, ServerVersion.AutoDetect(connectionString));
return new BackendAdminHostMigrationsDbContext(builder.Options);
});
Logger.LogInformation("Migrated the new tenant database with platform.");
Logger.LogInformation("Seeding the new tenant admin role permissions...");
var definitionPermissions = PermissionDefinitionManager.GetPermissions();
var grantPermissions = definitionPermissions
.Where(p => p.MultiTenancySide.HasFlag(MultiTenancySides.Tenant))
.Select(p => p.Name).ToArray();
//var grantPermissions = new List<PermissionGrant>();
//foreach (var permission in definitionPermissions)
//{
// var permissionGrant = new PermissionGrant(GuidGenerator.Create(),
// permission.Name, "R", "admin", eventData.Id);
// grantPermissions.Add(permissionGrant);
//}
// TODO: MySql 批量新增还是一条一条的语句?
// await PermissionGrantRepository.GetDbSet().AddRangeAsync(grantPermissions);
var dbContext = await PermissionGrantRepository.GetDbContextAsync();
var permissionEntityType = dbContext.Model.FindEntityType(typeof(PermissionGrant));
var permissionTableName = permissionEntityType.GetTableName();
var batchInsertPermissionSql = string.Empty;
if (dbContext.Database.IsMySql())
{
batchInsertPermissionSql = BuildMySqlBatchInsertScript(permissionTableName, eventData.Id, grantPermissions);
}
else
{
batchInsertPermissionSql = BuildSqlServerBatchInsertScript(permissionTableName, eventData.Id, grantPermissions);
}
await dbContext.Database.ExecuteSqlRawAsync(batchInsertPermissionSql);
await unitOfWork.SaveChangesAsync();
Logger.LogInformation("The new tenant permissions data initialized!");
}
}
}
protected virtual string BuildMySqlBatchInsertScript(string tableName, Guid tenantId, string[] permissions)
{
var batchInsertPermissionSql = new StringBuilder(128);
batchInsertPermissionSql.AppendLine($"INSERT INTO `{tableName}`(`Id`, `TenantId`, `Name`, `ProviderName`, `ProviderKey`)");
batchInsertPermissionSql.AppendLine("VALUES");
for (int i = 0; i < permissions.Length; i++)
{
batchInsertPermissionSql.AppendLine($"(UUID(), '{tenantId}','{permissions[i]}','R','admin')");
if (i < permissions.Length - 1)
{
batchInsertPermissionSql.AppendLine(",");
}
}
return batchInsertPermissionSql.ToString();
}
protected virtual string BuildSqlServerBatchInsertScript(string tableName, Guid tenantId, string[] permissions)
{
var batchInsertPermissionSql = new StringBuilder(128);
batchInsertPermissionSql.AppendLine($"INSERT INTO {tableName}(Id, TenantId, Name, ProviderName, ProviderKey)");
batchInsertPermissionSql.Append("VALUES");
for (int i = 0; i < permissions.Length; i++)
{
batchInsertPermissionSql.AppendLine($"(NEWID(), '{tenantId}','{permissions[i]}','R','admin')");
if (i < permissions.Length - 1)
{
batchInsertPermissionSql.AppendLine(",");
}
}
return batchInsertPermissionSql.ToString();
}
protected virtual string BuildMySqlBatchDeleteScript(string tableName, Guid tenantId)
{
var batchRemovePermissionSql = new StringBuilder(128);
batchRemovePermissionSql.AppendLine($"DELETE FROM `{tableName}` WHERE `TenantId` = '{tenantId}'");
batchRemovePermissionSql.AppendLine("AND `ProviderName`='R' AND `ProviderKey`='admin'");
return batchRemovePermissionSql.ToString();
}
protected virtual string BuildSqlServerBatchDeleteScript(string tableName, Guid tenantId)
{
var batchRemovePermissionSql = new StringBuilder(128);
batchRemovePermissionSql.AppendLine($"DELETE {tableName} WHERE TenantId = '{tenantId}'");
batchRemovePermissionSql.AppendLine("AND ProviderName='R' AND ProviderKey='admin'");
return batchRemovePermissionSql.ToString();
}
}
}

5
aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/LINGYUN.Abp.BackendAdmin.HttpApi.Host.csproj

@ -65,6 +65,7 @@
<ProjectReference Include="..\..\..\modules\auditing\LINGYUN.Abp.Auditing.HttpApi\LINGYUN.Abp.Auditing.HttpApi.csproj" />
<ProjectReference Include="..\..\..\modules\auditing\LINGYUN.Abp.AuditLogging.Elasticsearch\LINGYUN.Abp.AuditLogging.Elasticsearch.csproj" />
<ProjectReference Include="..\..\..\modules\common\LINGYUN.Abp.AspNetCore.HttpOverrides\LINGYUN.Abp.AspNetCore.HttpOverrides.csproj" />
<ProjectReference Include="..\..\..\modules\common\LINGYUN.Abp.Data.DbMigrator\LINGYUN.Abp.Data.DbMigrator.csproj" />
<ProjectReference Include="..\..\..\modules\common\LINGYUN.Abp.EventBus.CAP\LINGYUN.Abp.EventBus.CAP.csproj" />
<ProjectReference Include="..\..\..\modules\common\LINGYUN.Abp.ExceptionHandling.Emailing\LINGYUN.Abp.ExceptionHandling.Emailing.csproj" />
<ProjectReference Include="..\..\..\modules\common\LINGYUN.Abp.Localization.Dynamic\LINGYUN.Abp.Localization.Dynamic.csproj" />
@ -81,8 +82,4 @@
<ProjectReference Include="..\..\..\modules\tenants\LINGYUN.Abp.TenantManagement.Application\LINGYUN.Abp.TenantManagement.Application.csproj" />
<ProjectReference Include="..\..\..\modules\tenants\LINGYUN.Abp.TenantManagement.HttpApi\LINGYUN.Abp.TenantManagement.HttpApi.csproj" />
</ItemGroup>
<ItemGroup>
<Folder Include="Migrations\" />
</ItemGroup>
</Project>

175
aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/Migrations/20200804085641_Migration-Backend-Admin-MySql.Designer.cs

@ -1,175 +0,0 @@
// <auto-generated />
using System;
using LINGYUN.Abp.BackendAdmin.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Volo.Abp.EntityFrameworkCore;
namespace LINGYUN.Abp.BackendAdmin.Migrations
{
[DbContext(typeof(BackendAdminHostMigrationsDbContext))]
[Migration("20200804085641_Migration-Backend-Admin-MySql")]
partial class MigrationBackendAdminMySql
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.MySql)
.HasAnnotation("ProductVersion", "3.1.5")
.HasAnnotation("Relational:MaxIdentifierLength", 64);
modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGrant", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("varchar(128) CHARACTER SET utf8mb4")
.HasMaxLength(128);
b.Property<string>("ProviderKey")
.IsRequired()
.HasColumnType("varchar(64) CHARACTER SET utf8mb4")
.HasMaxLength(64);
b.Property<string>("ProviderName")
.IsRequired()
.HasColumnType("varchar(64) CHARACTER SET utf8mb4")
.HasMaxLength(64);
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.HasKey("Id");
b.HasIndex("Name", "ProviderName", "ProviderKey");
b.ToTable("AbpPermissionGrants");
});
modelBuilder.Entity("Volo.Abp.SettingManagement.Setting", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("varchar(128) CHARACTER SET utf8mb4")
.HasMaxLength(128);
b.Property<string>("ProviderKey")
.HasColumnType("varchar(64) CHARACTER SET utf8mb4")
.HasMaxLength(64);
b.Property<string>("ProviderName")
.HasColumnType("varchar(64) CHARACTER SET utf8mb4")
.HasMaxLength(64);
b.Property<string>("Value")
.IsRequired()
.HasColumnType("longtext CHARACTER SET utf8mb4")
.HasMaxLength(2048);
b.HasKey("Id");
b.HasIndex("Name", "ProviderName", "ProviderKey");
b.ToTable("AbpSettings");
});
modelBuilder.Entity("Volo.Abp.TenantManagement.Tenant", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnName("ConcurrencyStamp")
.HasColumnType("varchar(40) CHARACTER SET utf8mb4")
.HasMaxLength(40);
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("CreatorId")
.HasColumnName("CreatorId")
.HasColumnType("char(36)");
b.Property<Guid?>("DeleterId")
.HasColumnName("DeleterId")
.HasColumnType("char(36)");
b.Property<DateTime?>("DeletionTime")
.HasColumnName("DeletionTime")
.HasColumnType("datetime(6)");
b.Property<string>("ExtraProperties")
.HasColumnName("ExtraProperties")
.HasColumnType("longtext CHARACTER SET utf8mb4");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnName("IsDeleted")
.HasColumnType("tinyint(1)")
.HasDefaultValue(false);
b.Property<DateTime?>("LastModificationTime")
.HasColumnName("LastModificationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("LastModifierId")
.HasColumnName("LastModifierId")
.HasColumnType("char(36)");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("varchar(64) CHARACTER SET utf8mb4")
.HasMaxLength(64);
b.HasKey("Id");
b.HasIndex("Name");
b.ToTable("AbpTenants");
});
modelBuilder.Entity("Volo.Abp.TenantManagement.TenantConnectionString", b =>
{
b.Property<Guid>("TenantId")
.HasColumnType("char(36)");
b.Property<string>("Name")
.HasColumnType("varchar(64) CHARACTER SET utf8mb4")
.HasMaxLength(64);
b.Property<string>("Value")
.IsRequired()
.HasColumnType("varchar(1024) CHARACTER SET utf8mb4")
.HasMaxLength(1024);
b.HasKey("TenantId", "Name");
b.ToTable("AbpTenantConnectionStrings");
});
modelBuilder.Entity("Volo.Abp.TenantManagement.TenantConnectionString", b =>
{
b.HasOne("Volo.Abp.TenantManagement.Tenant", null)
.WithMany("ConnectionStrings")
.HasForeignKey("TenantId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
#pragma warning restore 612, 618
}
}
}

111
aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/Migrations/20200804085641_Migration-Backend-Admin-MySql.cs

@ -1,111 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace LINGYUN.Abp.BackendAdmin.Migrations
{
public partial class MigrationBackendAdminMySql : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "AbpPermissionGrants",
columns: table => new
{
Id = table.Column<Guid>(nullable: false),
TenantId = table.Column<Guid>(nullable: true),
Name = table.Column<string>(maxLength: 128, nullable: false),
ProviderName = table.Column<string>(maxLength: 64, nullable: false),
ProviderKey = table.Column<string>(maxLength: 64, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpPermissionGrants", x => x.Id);
});
migrationBuilder.CreateTable(
name: "AbpSettings",
columns: table => new
{
Id = table.Column<Guid>(nullable: false),
Name = table.Column<string>(maxLength: 128, nullable: false),
Value = table.Column<string>(maxLength: 2048, nullable: false),
ProviderName = table.Column<string>(maxLength: 64, nullable: true),
ProviderKey = table.Column<string>(maxLength: 64, nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpSettings", x => x.Id);
});
migrationBuilder.CreateTable(
name: "AbpTenants",
columns: table => new
{
Id = table.Column<Guid>(nullable: false),
ExtraProperties = table.Column<string>(nullable: true),
ConcurrencyStamp = table.Column<string>(maxLength: 40, nullable: true),
CreationTime = table.Column<DateTime>(nullable: false),
CreatorId = table.Column<Guid>(nullable: true),
LastModificationTime = table.Column<DateTime>(nullable: true),
LastModifierId = table.Column<Guid>(nullable: true),
IsDeleted = table.Column<bool>(nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(nullable: true),
DeletionTime = table.Column<DateTime>(nullable: true),
Name = table.Column<string>(maxLength: 64, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpTenants", x => x.Id);
});
migrationBuilder.CreateTable(
name: "AbpTenantConnectionStrings",
columns: table => new
{
TenantId = table.Column<Guid>(nullable: false),
Name = table.Column<string>(maxLength: 64, nullable: false),
Value = table.Column<string>(maxLength: 1024, nullable: false)
},
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);
});
migrationBuilder.CreateIndex(
name: "IX_AbpPermissionGrants_Name_ProviderName_ProviderKey",
table: "AbpPermissionGrants",
columns: new[] { "Name", "ProviderName", "ProviderKey" });
migrationBuilder.CreateIndex(
name: "IX_AbpSettings_Name_ProviderName_ProviderKey",
table: "AbpSettings",
columns: new[] { "Name", "ProviderName", "ProviderKey" });
migrationBuilder.CreateIndex(
name: "IX_AbpTenants_Name",
table: "AbpTenants",
column: "Name");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "AbpPermissionGrants");
migrationBuilder.DropTable(
name: "AbpSettings");
migrationBuilder.DropTable(
name: "AbpTenantConnectionStrings");
migrationBuilder.DropTable(
name: "AbpTenants");
}
}
}

37
aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/Migrations/20200910080638_Add-abp-feature-module.cs

@ -1,37 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace LINGYUN.Abp.BackendAdmin.Migrations
{
public partial class Addabpfeaturemodule : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "AbpFeatureValues",
columns: table => new
{
Id = table.Column<Guid>(nullable: false),
Name = table.Column<string>(maxLength: 128, nullable: false),
Value = table.Column<string>(maxLength: 128, nullable: false),
ProviderName = table.Column<string>(maxLength: 64, nullable: true),
ProviderKey = table.Column<string>(maxLength: 64, nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpFeatureValues", x => x.Id);
});
migrationBuilder.CreateIndex(
name: "IX_AbpFeatureValues_Name_ProviderName_ProviderKey",
table: "AbpFeatureValues",
columns: new[] { "Name", "ProviderName", "ProviderKey" });
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "AbpFeatureValues");
}
}
}

485
aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/Migrations/20200928020134_Add-abp-audit-logging-module.Designer.cs

@ -1,485 +0,0 @@
// <auto-generated />
using System;
using LINGYUN.Abp.BackendAdmin.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Volo.Abp.EntityFrameworkCore;
namespace LINGYUN.Abp.BackendAdmin.Migrations
{
[DbContext(typeof(BackendAdminHostMigrationsDbContext))]
[Migration("20200928020134_Add-abp-audit-logging-module")]
partial class Addabpauditloggingmodule
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.MySql)
.HasAnnotation("ProductVersion", "3.1.7")
.HasAnnotation("Relational:MaxIdentifierLength", 64);
modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<string>("ApplicationName")
.HasColumnName("ApplicationName")
.HasColumnType("varchar(96) CHARACTER SET utf8mb4")
.HasMaxLength(96);
b.Property<string>("BrowserInfo")
.HasColumnName("BrowserInfo")
.HasColumnType("varchar(512) CHARACTER SET utf8mb4")
.HasMaxLength(512);
b.Property<string>("ClientId")
.HasColumnName("ClientId")
.HasColumnType("varchar(64) CHARACTER SET utf8mb4")
.HasMaxLength(64);
b.Property<string>("ClientIpAddress")
.HasColumnName("ClientIpAddress")
.HasColumnType("varchar(64) CHARACTER SET utf8mb4")
.HasMaxLength(64);
b.Property<string>("ClientName")
.HasColumnName("ClientName")
.HasColumnType("varchar(128) CHARACTER SET utf8mb4")
.HasMaxLength(128);
b.Property<string>("Comments")
.HasColumnName("Comments")
.HasColumnType("varchar(256) CHARACTER SET utf8mb4")
.HasMaxLength(256);
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnName("ConcurrencyStamp")
.HasColumnType("varchar(40) CHARACTER SET utf8mb4")
.HasMaxLength(40);
b.Property<string>("CorrelationId")
.HasColumnName("CorrelationId")
.HasColumnType("varchar(64) CHARACTER SET utf8mb4")
.HasMaxLength(64);
b.Property<string>("Exceptions")
.HasColumnName("Exceptions")
.HasColumnType("longtext CHARACTER SET utf8mb4")
.HasMaxLength(4000);
b.Property<int>("ExecutionDuration")
.HasColumnName("ExecutionDuration")
.HasColumnType("int");
b.Property<DateTime>("ExecutionTime")
.HasColumnType("datetime(6)");
b.Property<string>("ExtraProperties")
.HasColumnName("ExtraProperties")
.HasColumnType("longtext CHARACTER SET utf8mb4");
b.Property<string>("HttpMethod")
.HasColumnName("HttpMethod")
.HasColumnType("varchar(16) CHARACTER SET utf8mb4")
.HasMaxLength(16);
b.Property<int?>("HttpStatusCode")
.HasColumnName("HttpStatusCode")
.HasColumnType("int");
b.Property<Guid?>("ImpersonatorTenantId")
.HasColumnName("ImpersonatorTenantId")
.HasColumnType("char(36)");
b.Property<Guid?>("ImpersonatorUserId")
.HasColumnName("ImpersonatorUserId")
.HasColumnType("char(36)");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.Property<string>("TenantName")
.HasColumnType("longtext CHARACTER SET utf8mb4");
b.Property<string>("Url")
.HasColumnName("Url")
.HasColumnType("varchar(256) CHARACTER SET utf8mb4")
.HasMaxLength(256);
b.Property<Guid?>("UserId")
.HasColumnName("UserId")
.HasColumnType("char(36)");
b.Property<string>("UserName")
.HasColumnName("UserName")
.HasColumnType("varchar(256) CHARACTER SET utf8mb4")
.HasMaxLength(256);
b.HasKey("Id");
b.HasIndex("TenantId", "ExecutionTime");
b.HasIndex("TenantId", "UserId", "ExecutionTime");
b.ToTable("AbpAuditLogs");
});
modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<Guid>("AuditLogId")
.HasColumnName("AuditLogId")
.HasColumnType("char(36)");
b.Property<int>("ExecutionDuration")
.HasColumnName("ExecutionDuration")
.HasColumnType("int");
b.Property<DateTime>("ExecutionTime")
.HasColumnName("ExecutionTime")
.HasColumnType("datetime(6)");
b.Property<string>("ExtraProperties")
.HasColumnName("ExtraProperties")
.HasColumnType("longtext CHARACTER SET utf8mb4");
b.Property<string>("MethodName")
.HasColumnName("MethodName")
.HasColumnType("varchar(128) CHARACTER SET utf8mb4")
.HasMaxLength(128);
b.Property<string>("Parameters")
.HasColumnName("Parameters")
.HasColumnType("varchar(2000) CHARACTER SET utf8mb4")
.HasMaxLength(2000);
b.Property<string>("ServiceName")
.HasColumnName("ServiceName")
.HasColumnType("varchar(256) CHARACTER SET utf8mb4")
.HasMaxLength(256);
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.HasKey("Id");
b.HasIndex("AuditLogId");
b.HasIndex("TenantId", "ServiceName", "MethodName", "ExecutionTime");
b.ToTable("AbpAuditLogActions");
});
modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<Guid>("AuditLogId")
.HasColumnName("AuditLogId")
.HasColumnType("char(36)");
b.Property<DateTime>("ChangeTime")
.HasColumnName("ChangeTime")
.HasColumnType("datetime(6)");
b.Property<byte>("ChangeType")
.HasColumnName("ChangeType")
.HasColumnType("tinyint unsigned");
b.Property<string>("EntityId")
.IsRequired()
.HasColumnName("EntityId")
.HasColumnType("varchar(128) CHARACTER SET utf8mb4")
.HasMaxLength(128);
b.Property<Guid?>("EntityTenantId")
.HasColumnType("char(36)");
b.Property<string>("EntityTypeFullName")
.IsRequired()
.HasColumnName("EntityTypeFullName")
.HasColumnType("varchar(128) CHARACTER SET utf8mb4")
.HasMaxLength(128);
b.Property<string>("ExtraProperties")
.HasColumnName("ExtraProperties")
.HasColumnType("longtext CHARACTER SET utf8mb4");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.HasKey("Id");
b.HasIndex("AuditLogId");
b.HasIndex("TenantId", "EntityTypeFullName", "EntityId");
b.ToTable("AbpEntityChanges");
});
modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<Guid>("EntityChangeId")
.HasColumnType("char(36)");
b.Property<string>("NewValue")
.HasColumnName("NewValue")
.HasColumnType("varchar(512) CHARACTER SET utf8mb4")
.HasMaxLength(512);
b.Property<string>("OriginalValue")
.HasColumnName("OriginalValue")
.HasColumnType("varchar(512) CHARACTER SET utf8mb4")
.HasMaxLength(512);
b.Property<string>("PropertyName")
.IsRequired()
.HasColumnName("PropertyName")
.HasColumnType("varchar(128) CHARACTER SET utf8mb4")
.HasMaxLength(128);
b.Property<string>("PropertyTypeFullName")
.IsRequired()
.HasColumnName("PropertyTypeFullName")
.HasColumnType("varchar(64) CHARACTER SET utf8mb4")
.HasMaxLength(64);
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.HasKey("Id");
b.HasIndex("EntityChangeId");
b.ToTable("AbpEntityPropertyChanges");
});
modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureValue", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("varchar(128) CHARACTER SET utf8mb4")
.HasMaxLength(128);
b.Property<string>("ProviderKey")
.HasColumnType("varchar(64) CHARACTER SET utf8mb4")
.HasMaxLength(64);
b.Property<string>("ProviderName")
.HasColumnType("varchar(64) CHARACTER SET utf8mb4")
.HasMaxLength(64);
b.Property<string>("Value")
.IsRequired()
.HasColumnType("varchar(128) CHARACTER SET utf8mb4")
.HasMaxLength(128);
b.HasKey("Id");
b.HasIndex("Name", "ProviderName", "ProviderKey");
b.ToTable("AbpFeatureValues");
});
modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGrant", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("varchar(128) CHARACTER SET utf8mb4")
.HasMaxLength(128);
b.Property<string>("ProviderKey")
.IsRequired()
.HasColumnType("varchar(64) CHARACTER SET utf8mb4")
.HasMaxLength(64);
b.Property<string>("ProviderName")
.IsRequired()
.HasColumnType("varchar(64) CHARACTER SET utf8mb4")
.HasMaxLength(64);
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.HasKey("Id");
b.HasIndex("Name", "ProviderName", "ProviderKey");
b.ToTable("AbpPermissionGrants");
});
modelBuilder.Entity("Volo.Abp.SettingManagement.Setting", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("varchar(128) CHARACTER SET utf8mb4")
.HasMaxLength(128);
b.Property<string>("ProviderKey")
.HasColumnType("varchar(64) CHARACTER SET utf8mb4")
.HasMaxLength(64);
b.Property<string>("ProviderName")
.HasColumnType("varchar(64) CHARACTER SET utf8mb4")
.HasMaxLength(64);
b.Property<string>("Value")
.IsRequired()
.HasColumnType("longtext CHARACTER SET utf8mb4")
.HasMaxLength(2048);
b.HasKey("Id");
b.HasIndex("Name", "ProviderName", "ProviderKey");
b.ToTable("AbpSettings");
});
modelBuilder.Entity("Volo.Abp.TenantManagement.Tenant", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnName("ConcurrencyStamp")
.HasColumnType("varchar(40) CHARACTER SET utf8mb4")
.HasMaxLength(40);
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("CreatorId")
.HasColumnName("CreatorId")
.HasColumnType("char(36)");
b.Property<Guid?>("DeleterId")
.HasColumnName("DeleterId")
.HasColumnType("char(36)");
b.Property<DateTime?>("DeletionTime")
.HasColumnName("DeletionTime")
.HasColumnType("datetime(6)");
b.Property<string>("ExtraProperties")
.HasColumnName("ExtraProperties")
.HasColumnType("longtext CHARACTER SET utf8mb4");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnName("IsDeleted")
.HasColumnType("tinyint(1)")
.HasDefaultValue(false);
b.Property<DateTime?>("LastModificationTime")
.HasColumnName("LastModificationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("LastModifierId")
.HasColumnName("LastModifierId")
.HasColumnType("char(36)");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("varchar(64) CHARACTER SET utf8mb4")
.HasMaxLength(64);
b.HasKey("Id");
b.HasIndex("Name");
b.ToTable("AbpTenants");
});
modelBuilder.Entity("Volo.Abp.TenantManagement.TenantConnectionString", b =>
{
b.Property<Guid>("TenantId")
.HasColumnType("char(36)");
b.Property<string>("Name")
.HasColumnType("varchar(64) CHARACTER SET utf8mb4")
.HasMaxLength(64);
b.Property<string>("Value")
.IsRequired()
.HasColumnType("varchar(1024) CHARACTER SET utf8mb4")
.HasMaxLength(1024);
b.HasKey("TenantId", "Name");
b.ToTable("AbpTenantConnectionStrings");
});
modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b =>
{
b.HasOne("Volo.Abp.AuditLogging.AuditLog", null)
.WithMany("Actions")
.HasForeignKey("AuditLogId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b =>
{
b.HasOne("Volo.Abp.AuditLogging.AuditLog", null)
.WithMany("EntityChanges")
.HasForeignKey("AuditLogId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b =>
{
b.HasOne("Volo.Abp.AuditLogging.EntityChange", null)
.WithMany("PropertyChanges")
.HasForeignKey("EntityChangeId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Volo.Abp.TenantManagement.TenantConnectionString", b =>
{
b.HasOne("Volo.Abp.TenantManagement.Tenant", null)
.WithMany("ConnectionStrings")
.HasForeignKey("TenantId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
#pragma warning restore 612, 618
}
}
}

166
aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/Migrations/20200928020134_Add-abp-audit-logging-module.cs

@ -1,166 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace LINGYUN.Abp.BackendAdmin.Migrations
{
public partial class Addabpauditloggingmodule : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "AbpAuditLogs",
columns: table => new
{
Id = table.Column<Guid>(nullable: false),
ExtraProperties = table.Column<string>(nullable: true),
ConcurrencyStamp = table.Column<string>(maxLength: 40, nullable: true),
ApplicationName = table.Column<string>(maxLength: 96, nullable: true),
UserId = table.Column<Guid>(nullable: true),
UserName = table.Column<string>(maxLength: 256, nullable: true),
TenantId = table.Column<Guid>(nullable: true),
TenantName = table.Column<string>(nullable: true),
ImpersonatorUserId = table.Column<Guid>(nullable: true),
ImpersonatorTenantId = table.Column<Guid>(nullable: true),
ExecutionTime = table.Column<DateTime>(nullable: false),
ExecutionDuration = table.Column<int>(nullable: false),
ClientIpAddress = table.Column<string>(maxLength: 64, nullable: true),
ClientName = table.Column<string>(maxLength: 128, nullable: true),
ClientId = table.Column<string>(maxLength: 64, nullable: true),
CorrelationId = table.Column<string>(maxLength: 64, nullable: true),
BrowserInfo = table.Column<string>(maxLength: 512, nullable: true),
HttpMethod = table.Column<string>(maxLength: 16, nullable: true),
Url = table.Column<string>(maxLength: 256, nullable: true),
Exceptions = table.Column<string>(maxLength: 4000, nullable: true),
Comments = table.Column<string>(maxLength: 256, nullable: true),
HttpStatusCode = table.Column<int>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpAuditLogs", x => x.Id);
});
migrationBuilder.CreateTable(
name: "AbpAuditLogActions",
columns: table => new
{
Id = table.Column<Guid>(nullable: false),
TenantId = table.Column<Guid>(nullable: true),
AuditLogId = table.Column<Guid>(nullable: false),
ServiceName = table.Column<string>(maxLength: 256, nullable: true),
MethodName = table.Column<string>(maxLength: 128, nullable: true),
Parameters = table.Column<string>(maxLength: 2000, nullable: true),
ExecutionTime = table.Column<DateTime>(nullable: false),
ExecutionDuration = table.Column<int>(nullable: false),
ExtraProperties = table.Column<string>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpAuditLogActions", x => x.Id);
table.ForeignKey(
name: "FK_AbpAuditLogActions_AbpAuditLogs_AuditLogId",
column: x => x.AuditLogId,
principalTable: "AbpAuditLogs",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "AbpEntityChanges",
columns: table => new
{
Id = table.Column<Guid>(nullable: false),
AuditLogId = table.Column<Guid>(nullable: false),
TenantId = table.Column<Guid>(nullable: true),
ChangeTime = table.Column<DateTime>(nullable: false),
ChangeType = table.Column<byte>(nullable: false),
EntityTenantId = table.Column<Guid>(nullable: true),
EntityId = table.Column<string>(maxLength: 128, nullable: false),
EntityTypeFullName = table.Column<string>(maxLength: 128, nullable: false),
ExtraProperties = table.Column<string>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpEntityChanges", x => x.Id);
table.ForeignKey(
name: "FK_AbpEntityChanges_AbpAuditLogs_AuditLogId",
column: x => x.AuditLogId,
principalTable: "AbpAuditLogs",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "AbpEntityPropertyChanges",
columns: table => new
{
Id = table.Column<Guid>(nullable: false),
TenantId = table.Column<Guid>(nullable: true),
EntityChangeId = table.Column<Guid>(nullable: false),
NewValue = table.Column<string>(maxLength: 512, nullable: true),
OriginalValue = table.Column<string>(maxLength: 512, nullable: true),
PropertyName = table.Column<string>(maxLength: 128, nullable: false),
PropertyTypeFullName = table.Column<string>(maxLength: 64, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpEntityPropertyChanges", x => x.Id);
table.ForeignKey(
name: "FK_AbpEntityPropertyChanges_AbpEntityChanges_EntityChangeId",
column: x => x.EntityChangeId,
principalTable: "AbpEntityChanges",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_AbpAuditLogActions_AuditLogId",
table: "AbpAuditLogActions",
column: "AuditLogId");
migrationBuilder.CreateIndex(
name: "IX_AbpAuditLogActions_TenantId_ServiceName_MethodName_Execution~",
table: "AbpAuditLogActions",
columns: new[] { "TenantId", "ServiceName", "MethodName", "ExecutionTime" });
migrationBuilder.CreateIndex(
name: "IX_AbpAuditLogs_TenantId_ExecutionTime",
table: "AbpAuditLogs",
columns: new[] { "TenantId", "ExecutionTime" });
migrationBuilder.CreateIndex(
name: "IX_AbpAuditLogs_TenantId_UserId_ExecutionTime",
table: "AbpAuditLogs",
columns: new[] { "TenantId", "UserId", "ExecutionTime" });
migrationBuilder.CreateIndex(
name: "IX_AbpEntityChanges_AuditLogId",
table: "AbpEntityChanges",
column: "AuditLogId");
migrationBuilder.CreateIndex(
name: "IX_AbpEntityChanges_TenantId_EntityTypeFullName_EntityId",
table: "AbpEntityChanges",
columns: new[] { "TenantId", "EntityTypeFullName", "EntityId" });
migrationBuilder.CreateIndex(
name: "IX_AbpEntityPropertyChanges_EntityChangeId",
table: "AbpEntityPropertyChanges",
column: "EntityChangeId");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "AbpAuditLogActions");
migrationBuilder.DropTable(
name: "AbpEntityPropertyChanges");
migrationBuilder.DropTable(
name: "AbpEntityChanges");
migrationBuilder.DropTable(
name: "AbpAuditLogs");
}
}
}

417
aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/Migrations/20200910080638_Add-abp-feature-module.Designer.cs → aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/Migrations/20211030090436_Re-Initlize-Db-Migration.Designer.cs

@ -1,206 +1,211 @@
// <auto-generated />
using System;
using LINGYUN.Abp.BackendAdmin.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Volo.Abp.EntityFrameworkCore;
namespace LINGYUN.Abp.BackendAdmin.Migrations
{
[DbContext(typeof(BackendAdminHostMigrationsDbContext))]
[Migration("20200910080638_Add-abp-feature-module")]
partial class Addabpfeaturemodule
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.MySql)
.HasAnnotation("ProductVersion", "3.1.7")
.HasAnnotation("Relational:MaxIdentifierLength", 64);
modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureValue", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("varchar(128) CHARACTER SET utf8mb4")
.HasMaxLength(128);
b.Property<string>("ProviderKey")
.HasColumnType("varchar(64) CHARACTER SET utf8mb4")
.HasMaxLength(64);
b.Property<string>("ProviderName")
.HasColumnType("varchar(64) CHARACTER SET utf8mb4")
.HasMaxLength(64);
b.Property<string>("Value")
.IsRequired()
.HasColumnType("varchar(128) CHARACTER SET utf8mb4")
.HasMaxLength(128);
b.HasKey("Id");
b.HasIndex("Name", "ProviderName", "ProviderKey");
b.ToTable("AbpFeatureValues");
});
modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGrant", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("varchar(128) CHARACTER SET utf8mb4")
.HasMaxLength(128);
b.Property<string>("ProviderKey")
.IsRequired()
.HasColumnType("varchar(64) CHARACTER SET utf8mb4")
.HasMaxLength(64);
b.Property<string>("ProviderName")
.IsRequired()
.HasColumnType("varchar(64) CHARACTER SET utf8mb4")
.HasMaxLength(64);
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.HasKey("Id");
b.HasIndex("Name", "ProviderName", "ProviderKey");
b.ToTable("AbpPermissionGrants");
});
modelBuilder.Entity("Volo.Abp.SettingManagement.Setting", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("varchar(128) CHARACTER SET utf8mb4")
.HasMaxLength(128);
b.Property<string>("ProviderKey")
.HasColumnType("varchar(64) CHARACTER SET utf8mb4")
.HasMaxLength(64);
b.Property<string>("ProviderName")
.HasColumnType("varchar(64) CHARACTER SET utf8mb4")
.HasMaxLength(64);
b.Property<string>("Value")
.IsRequired()
.HasColumnType("longtext CHARACTER SET utf8mb4")
.HasMaxLength(2048);
b.HasKey("Id");
b.HasIndex("Name", "ProviderName", "ProviderKey");
b.ToTable("AbpSettings");
});
modelBuilder.Entity("Volo.Abp.TenantManagement.Tenant", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnName("ConcurrencyStamp")
.HasColumnType("varchar(40) CHARACTER SET utf8mb4")
.HasMaxLength(40);
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("CreatorId")
.HasColumnName("CreatorId")
.HasColumnType("char(36)");
b.Property<Guid?>("DeleterId")
.HasColumnName("DeleterId")
.HasColumnType("char(36)");
b.Property<DateTime?>("DeletionTime")
.HasColumnName("DeletionTime")
.HasColumnType("datetime(6)");
b.Property<string>("ExtraProperties")
.HasColumnName("ExtraProperties")
.HasColumnType("longtext CHARACTER SET utf8mb4");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnName("IsDeleted")
.HasColumnType("tinyint(1)")
.HasDefaultValue(false);
b.Property<DateTime?>("LastModificationTime")
.HasColumnName("LastModificationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("LastModifierId")
.HasColumnName("LastModifierId")
.HasColumnType("char(36)");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("varchar(64) CHARACTER SET utf8mb4")
.HasMaxLength(64);
b.HasKey("Id");
b.HasIndex("Name");
b.ToTable("AbpTenants");
});
modelBuilder.Entity("Volo.Abp.TenantManagement.TenantConnectionString", b =>
{
b.Property<Guid>("TenantId")
.HasColumnType("char(36)");
b.Property<string>("Name")
.HasColumnType("varchar(64) CHARACTER SET utf8mb4")
.HasMaxLength(64);
b.Property<string>("Value")
.IsRequired()
.HasColumnType("varchar(1024) CHARACTER SET utf8mb4")
.HasMaxLength(1024);
b.HasKey("TenantId", "Name");
b.ToTable("AbpTenantConnectionStrings");
});
modelBuilder.Entity("Volo.Abp.TenantManagement.TenantConnectionString", b =>
{
b.HasOne("Volo.Abp.TenantManagement.Tenant", null)
.WithMany("ConnectionStrings")
.HasForeignKey("TenantId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
#pragma warning restore 612, 618
}
}
}
// <auto-generated />
using System;
using LINGYUN.Abp.BackendAdmin.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Volo.Abp.EntityFrameworkCore;
namespace LINGYUN.Abp.BackendAdmin.Migrations
{
[DbContext(typeof(BackendAdminHostMigrationsDbContext))]
[Migration("20211030090436_Re-Initlize-Db-Migration")]
partial class ReInitlizeDbMigration
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.MySql)
.HasAnnotation("Relational:MaxIdentifierLength", 64)
.HasAnnotation("ProductVersion", "5.0.11");
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");
b.ToTable("AbpFeatureValues");
});
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("Name", "ProviderName", "ProviderKey");
b.ToTable("AbpPermissionGrants");
});
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");
b.ToTable("AbpSettings");
});
modelBuilder.Entity("Volo.Abp.TenantManagement.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<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.Property<string>("Name")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("varchar(64)");
b.HasKey("Id");
b.HasIndex("Name");
b.ToTable("AbpTenants");
});
modelBuilder.Entity("Volo.Abp.TenantManagement.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");
});
modelBuilder.Entity("Volo.Abp.TenantManagement.TenantConnectionString", b =>
{
b.HasOne("Volo.Abp.TenantManagement.Tenant", null)
.WithMany("ConnectionStrings")
.HasForeignKey("TenantId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Volo.Abp.TenantManagement.Tenant", b =>
{
b.Navigation("ConnectionStrings");
});
#pragma warning restore 612, 618
}
}
}

158
aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/Migrations/20211030090436_Re-Initlize-Db-Migration.cs

@ -0,0 +1,158 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace LINGYUN.Abp.BackendAdmin.Migrations
{
public partial class ReInitlizeDbMigration : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterDatabase()
.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: "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: "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"),
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);
})
.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_AbpFeatureValues_Name_ProviderName_ProviderKey",
table: "AbpFeatureValues",
columns: new[] { "Name", "ProviderName", "ProviderKey" });
migrationBuilder.CreateIndex(
name: "IX_AbpPermissionGrants_Name_ProviderName_ProviderKey",
table: "AbpPermissionGrants",
columns: new[] { "Name", "ProviderName", "ProviderKey" });
migrationBuilder.CreateIndex(
name: "IX_AbpSettings_Name_ProviderName_ProviderKey",
table: "AbpSettings",
columns: new[] { "Name", "ProviderName", "ProviderKey" });
migrationBuilder.CreateIndex(
name: "IX_AbpTenants_Name",
table: "AbpTenants",
column: "Name");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "AbpFeatureValues");
migrationBuilder.DropTable(
name: "AbpPermissionGrants");
migrationBuilder.DropTable(
name: "AbpSettings");
migrationBuilder.DropTable(
name: "AbpTenantConnectionStrings");
migrationBuilder.DropTable(
name: "AbpTenants");
}
}
}

692
aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/Migrations/BackendAdminHostMigrationsDbContextModelSnapshot.cs

@ -1,483 +1,209 @@
// <auto-generated />
using System;
using LINGYUN.Abp.BackendAdmin.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Volo.Abp.EntityFrameworkCore;
namespace LINGYUN.Abp.BackendAdmin.Migrations
{
[DbContext(typeof(BackendAdminHostMigrationsDbContext))]
partial class BackendAdminHostMigrationsDbContextModelSnapshot : ModelSnapshot
{
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.MySql)
.HasAnnotation("ProductVersion", "3.1.7")
.HasAnnotation("Relational:MaxIdentifierLength", 64);
modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<string>("ApplicationName")
.HasColumnName("ApplicationName")
.HasColumnType("varchar(96) CHARACTER SET utf8mb4")
.HasMaxLength(96);
b.Property<string>("BrowserInfo")
.HasColumnName("BrowserInfo")
.HasColumnType("varchar(512) CHARACTER SET utf8mb4")
.HasMaxLength(512);
b.Property<string>("ClientId")
.HasColumnName("ClientId")
.HasColumnType("varchar(64) CHARACTER SET utf8mb4")
.HasMaxLength(64);
b.Property<string>("ClientIpAddress")
.HasColumnName("ClientIpAddress")
.HasColumnType("varchar(64) CHARACTER SET utf8mb4")
.HasMaxLength(64);
b.Property<string>("ClientName")
.HasColumnName("ClientName")
.HasColumnType("varchar(128) CHARACTER SET utf8mb4")
.HasMaxLength(128);
b.Property<string>("Comments")
.HasColumnName("Comments")
.HasColumnType("varchar(256) CHARACTER SET utf8mb4")
.HasMaxLength(256);
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnName("ConcurrencyStamp")
.HasColumnType("varchar(40) CHARACTER SET utf8mb4")
.HasMaxLength(40);
b.Property<string>("CorrelationId")
.HasColumnName("CorrelationId")
.HasColumnType("varchar(64) CHARACTER SET utf8mb4")
.HasMaxLength(64);
b.Property<string>("Exceptions")
.HasColumnName("Exceptions")
.HasColumnType("longtext CHARACTER SET utf8mb4")
.HasMaxLength(4000);
b.Property<int>("ExecutionDuration")
.HasColumnName("ExecutionDuration")
.HasColumnType("int");
b.Property<DateTime>("ExecutionTime")
.HasColumnType("datetime(6)");
b.Property<string>("ExtraProperties")
.HasColumnName("ExtraProperties")
.HasColumnType("longtext CHARACTER SET utf8mb4");
b.Property<string>("HttpMethod")
.HasColumnName("HttpMethod")
.HasColumnType("varchar(16) CHARACTER SET utf8mb4")
.HasMaxLength(16);
b.Property<int?>("HttpStatusCode")
.HasColumnName("HttpStatusCode")
.HasColumnType("int");
b.Property<Guid?>("ImpersonatorTenantId")
.HasColumnName("ImpersonatorTenantId")
.HasColumnType("char(36)");
b.Property<Guid?>("ImpersonatorUserId")
.HasColumnName("ImpersonatorUserId")
.HasColumnType("char(36)");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.Property<string>("TenantName")
.HasColumnType("longtext CHARACTER SET utf8mb4");
b.Property<string>("Url")
.HasColumnName("Url")
.HasColumnType("varchar(256) CHARACTER SET utf8mb4")
.HasMaxLength(256);
b.Property<Guid?>("UserId")
.HasColumnName("UserId")
.HasColumnType("char(36)");
b.Property<string>("UserName")
.HasColumnName("UserName")
.HasColumnType("varchar(256) CHARACTER SET utf8mb4")
.HasMaxLength(256);
b.HasKey("Id");
b.HasIndex("TenantId", "ExecutionTime");
b.HasIndex("TenantId", "UserId", "ExecutionTime");
b.ToTable("AbpAuditLogs");
});
modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<Guid>("AuditLogId")
.HasColumnName("AuditLogId")
.HasColumnType("char(36)");
b.Property<int>("ExecutionDuration")
.HasColumnName("ExecutionDuration")
.HasColumnType("int");
b.Property<DateTime>("ExecutionTime")
.HasColumnName("ExecutionTime")
.HasColumnType("datetime(6)");
b.Property<string>("ExtraProperties")
.HasColumnName("ExtraProperties")
.HasColumnType("longtext CHARACTER SET utf8mb4");
b.Property<string>("MethodName")
.HasColumnName("MethodName")
.HasColumnType("varchar(128) CHARACTER SET utf8mb4")
.HasMaxLength(128);
b.Property<string>("Parameters")
.HasColumnName("Parameters")
.HasColumnType("varchar(2000) CHARACTER SET utf8mb4")
.HasMaxLength(2000);
b.Property<string>("ServiceName")
.HasColumnName("ServiceName")
.HasColumnType("varchar(256) CHARACTER SET utf8mb4")
.HasMaxLength(256);
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.HasKey("Id");
b.HasIndex("AuditLogId");
b.HasIndex("TenantId", "ServiceName", "MethodName", "ExecutionTime");
b.ToTable("AbpAuditLogActions");
});
modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<Guid>("AuditLogId")
.HasColumnName("AuditLogId")
.HasColumnType("char(36)");
b.Property<DateTime>("ChangeTime")
.HasColumnName("ChangeTime")
.HasColumnType("datetime(6)");
b.Property<byte>("ChangeType")
.HasColumnName("ChangeType")
.HasColumnType("tinyint unsigned");
b.Property<string>("EntityId")
.IsRequired()
.HasColumnName("EntityId")
.HasColumnType("varchar(128) CHARACTER SET utf8mb4")
.HasMaxLength(128);
b.Property<Guid?>("EntityTenantId")
.HasColumnType("char(36)");
b.Property<string>("EntityTypeFullName")
.IsRequired()
.HasColumnName("EntityTypeFullName")
.HasColumnType("varchar(128) CHARACTER SET utf8mb4")
.HasMaxLength(128);
b.Property<string>("ExtraProperties")
.HasColumnName("ExtraProperties")
.HasColumnType("longtext CHARACTER SET utf8mb4");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.HasKey("Id");
b.HasIndex("AuditLogId");
b.HasIndex("TenantId", "EntityTypeFullName", "EntityId");
b.ToTable("AbpEntityChanges");
});
modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<Guid>("EntityChangeId")
.HasColumnType("char(36)");
b.Property<string>("NewValue")
.HasColumnName("NewValue")
.HasColumnType("varchar(512) CHARACTER SET utf8mb4")
.HasMaxLength(512);
b.Property<string>("OriginalValue")
.HasColumnName("OriginalValue")
.HasColumnType("varchar(512) CHARACTER SET utf8mb4")
.HasMaxLength(512);
b.Property<string>("PropertyName")
.IsRequired()
.HasColumnName("PropertyName")
.HasColumnType("varchar(128) CHARACTER SET utf8mb4")
.HasMaxLength(128);
b.Property<string>("PropertyTypeFullName")
.IsRequired()
.HasColumnName("PropertyTypeFullName")
.HasColumnType("varchar(64) CHARACTER SET utf8mb4")
.HasMaxLength(64);
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.HasKey("Id");
b.HasIndex("EntityChangeId");
b.ToTable("AbpEntityPropertyChanges");
});
modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureValue", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("varchar(128) CHARACTER SET utf8mb4")
.HasMaxLength(128);
b.Property<string>("ProviderKey")
.HasColumnType("varchar(64) CHARACTER SET utf8mb4")
.HasMaxLength(64);
b.Property<string>("ProviderName")
.HasColumnType("varchar(64) CHARACTER SET utf8mb4")
.HasMaxLength(64);
b.Property<string>("Value")
.IsRequired()
.HasColumnType("varchar(128) CHARACTER SET utf8mb4")
.HasMaxLength(128);
b.HasKey("Id");
b.HasIndex("Name", "ProviderName", "ProviderKey");
b.ToTable("AbpFeatureValues");
});
modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGrant", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("varchar(128) CHARACTER SET utf8mb4")
.HasMaxLength(128);
b.Property<string>("ProviderKey")
.IsRequired()
.HasColumnType("varchar(64) CHARACTER SET utf8mb4")
.HasMaxLength(64);
b.Property<string>("ProviderName")
.IsRequired()
.HasColumnType("varchar(64) CHARACTER SET utf8mb4")
.HasMaxLength(64);
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.HasKey("Id");
b.HasIndex("Name", "ProviderName", "ProviderKey");
b.ToTable("AbpPermissionGrants");
});
modelBuilder.Entity("Volo.Abp.SettingManagement.Setting", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("varchar(128) CHARACTER SET utf8mb4")
.HasMaxLength(128);
b.Property<string>("ProviderKey")
.HasColumnType("varchar(64) CHARACTER SET utf8mb4")
.HasMaxLength(64);
b.Property<string>("ProviderName")
.HasColumnType("varchar(64) CHARACTER SET utf8mb4")
.HasMaxLength(64);
b.Property<string>("Value")
.IsRequired()
.HasColumnType("longtext CHARACTER SET utf8mb4")
.HasMaxLength(2048);
b.HasKey("Id");
b.HasIndex("Name", "ProviderName", "ProviderKey");
b.ToTable("AbpSettings");
});
modelBuilder.Entity("Volo.Abp.TenantManagement.Tenant", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnName("ConcurrencyStamp")
.HasColumnType("varchar(40) CHARACTER SET utf8mb4")
.HasMaxLength(40);
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("CreatorId")
.HasColumnName("CreatorId")
.HasColumnType("char(36)");
b.Property<Guid?>("DeleterId")
.HasColumnName("DeleterId")
.HasColumnType("char(36)");
b.Property<DateTime?>("DeletionTime")
.HasColumnName("DeletionTime")
.HasColumnType("datetime(6)");
b.Property<string>("ExtraProperties")
.HasColumnName("ExtraProperties")
.HasColumnType("longtext CHARACTER SET utf8mb4");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnName("IsDeleted")
.HasColumnType("tinyint(1)")
.HasDefaultValue(false);
b.Property<DateTime?>("LastModificationTime")
.HasColumnName("LastModificationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("LastModifierId")
.HasColumnName("LastModifierId")
.HasColumnType("char(36)");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("varchar(64) CHARACTER SET utf8mb4")
.HasMaxLength(64);
b.HasKey("Id");
b.HasIndex("Name");
b.ToTable("AbpTenants");
});
modelBuilder.Entity("Volo.Abp.TenantManagement.TenantConnectionString", b =>
{
b.Property<Guid>("TenantId")
.HasColumnType("char(36)");
b.Property<string>("Name")
.HasColumnType("varchar(64) CHARACTER SET utf8mb4")
.HasMaxLength(64);
b.Property<string>("Value")
.IsRequired()
.HasColumnType("varchar(1024) CHARACTER SET utf8mb4")
.HasMaxLength(1024);
b.HasKey("TenantId", "Name");
b.ToTable("AbpTenantConnectionStrings");
});
modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b =>
{
b.HasOne("Volo.Abp.AuditLogging.AuditLog", null)
.WithMany("Actions")
.HasForeignKey("AuditLogId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b =>
{
b.HasOne("Volo.Abp.AuditLogging.AuditLog", null)
.WithMany("EntityChanges")
.HasForeignKey("AuditLogId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b =>
{
b.HasOne("Volo.Abp.AuditLogging.EntityChange", null)
.WithMany("PropertyChanges")
.HasForeignKey("EntityChangeId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Volo.Abp.TenantManagement.TenantConnectionString", b =>
{
b.HasOne("Volo.Abp.TenantManagement.Tenant", null)
.WithMany("ConnectionStrings")
.HasForeignKey("TenantId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
#pragma warning restore 612, 618
}
}
}
// <auto-generated />
using System;
using LINGYUN.Abp.BackendAdmin.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Volo.Abp.EntityFrameworkCore;
namespace LINGYUN.Abp.BackendAdmin.Migrations
{
[DbContext(typeof(BackendAdminHostMigrationsDbContext))]
partial class BackendAdminHostMigrationsDbContextModelSnapshot : ModelSnapshot
{
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.MySql)
.HasAnnotation("Relational:MaxIdentifierLength", 64)
.HasAnnotation("ProductVersion", "5.0.11");
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");
b.ToTable("AbpFeatureValues");
});
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("Name", "ProviderName", "ProviderKey");
b.ToTable("AbpPermissionGrants");
});
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");
b.ToTable("AbpSettings");
});
modelBuilder.Entity("Volo.Abp.TenantManagement.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<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.Property<string>("Name")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("varchar(64)");
b.HasKey("Id");
b.HasIndex("Name");
b.ToTable("AbpTenants");
});
modelBuilder.Entity("Volo.Abp.TenantManagement.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");
});
modelBuilder.Entity("Volo.Abp.TenantManagement.TenantConnectionString", b =>
{
b.HasOne("Volo.Abp.TenantManagement.Tenant", null)
.WithMany("ConnectionStrings")
.HasForeignKey("TenantId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Volo.Abp.TenantManagement.Tenant", b =>
{
b.Navigation("ConnectionStrings");
});
#pragma warning restore 612, 618
}
}
}

6
aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/appsettings.Development.json

@ -49,13 +49,13 @@
"Logging": {
"Serilog": {
"Elasticsearch": {
"IndexFormat": "lingyun.abp.logging-{0:yyyy.MM.dd}"
"IndexFormat": "abp.dev.logging-{0:yyyy.MM.dd}"
}
}
},
"AuditLogging": {
"Elasticsearch": {
"IndexPrefix": "lingyun.abp.auditing"
"IndexPrefix": "abp.dev.auditing"
}
},
"Elasticsearch": {
@ -82,7 +82,7 @@
"Name": "Elasticsearch",
"Args": {
"nodeUris": "http://localhost:9200",
"indexFormat": "lingyun.abp.logging-{0:yyyy.MM.dd}",
"indexFormat": "abp.dev.logging-{0:yyyy.MM.dd}",
"autoRegisterTemplate": true,
"autoRegisterTemplateVersion": "ESv7"
}

2
aspnet-core/services/apigateway/LINGYUN.ApiGateway.Host/appsettings.Development.json

@ -69,7 +69,7 @@
"Name": "Elasticsearch",
"Args": {
"nodeUris": "http://localhost:9200",
"indexFormat": "lingyun.abp.logging-{0:yyyy.MM.dd}",
"indexFormat": "abp.dev.logging-{0:yyyy.MM.dd}",
"autoRegisterTemplate": true,
"autoRegisterTemplateVersion": "ESv7"
}

4
aspnet-core/services/apigateway/LINGYUN.ApiGateway.HttpApi.Host/appsettings.Development.json

@ -40,7 +40,7 @@
},
"AuditLogging": {
"Elasticsearch": {
"IndexPrefix": "lingyun.abp.auditing"
"IndexPrefix": "abp.dev.auditing"
}
},
"Elasticsearch": {
@ -67,7 +67,7 @@
"Name": "Elasticsearch",
"Args": {
"nodeUris": "http://localhost:9200",
"indexFormat": "lingyun.abp.logging-{0:yyyy.MM.dd}",
"indexFormat": "abp.dev.logging-{0:yyyy.MM.dd}",
"autoRegisterTemplate": true,
"autoRegisterTemplateVersion": "ESv7"
}

4
aspnet-core/services/identity-server/LINGYUN.Abp.IdentityServer4.HttpApi.Host/appsettings.Development.json

@ -42,7 +42,7 @@
},
"AuditLogging": {
"Elasticsearch": {
"IndexPrefix": "lingyun.abp.auditing"
"IndexPrefix": "abp.dev.auditing"
}
},
"Elasticsearch": {
@ -69,7 +69,7 @@
"Name": "Elasticsearch",
"Args": {
"nodeUris": "http://localhost:9200",
"indexFormat": "lingyun.abp.logging-{0:yyyy.MM.dd}",
"indexFormat": "abp.dev.logging-{0:yyyy.MM.dd}",
"autoRegisterTemplate": true,
"autoRegisterTemplateVersion": "ESv7"
}

2
aspnet-core/services/localization/LINGYUN.Abp.LocalizationManagement.HttpApi.Host/AbpLocalizationManagementHttpApiHostModule.cs

@ -1,5 +1,6 @@
using LINGYUN.Abp.AspNetCore.HttpOverrides;
using LINGYUN.Abp.AuditLogging.Elasticsearch;
using LINGYUN.Abp.Data.DbMigrator;
using LINGYUN.Abp.EventBus.CAP;
using LINGYUN.Abp.ExceptionHandling.Emailing;
using LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore;
@ -34,6 +35,7 @@ namespace LINGYUN.Abp.LocalizationManagement
typeof(AbpTenantManagementEntityFrameworkCoreModule),
typeof(AbpSettingManagementEntityFrameworkCoreModule),
typeof(AbpPermissionManagementEntityFrameworkCoreModule),
typeof(AbpDataDbMigratorModule),
typeof(AbpAspNetCoreAuthenticationJwtBearerModule),
typeof(AbpEmailingExceptionHandlingModule),
typeof(AbpCAPEventBusModule),

56
aspnet-core/services/localization/LINGYUN.Abp.LocalizationManagement.HttpApi.Host/EventBus/Handlers/TenantSynchronizer.cs

@ -0,0 +1,56 @@
using LINGYUN.Abp.Data.DbMigrator;
using LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore;
using LINGYUN.Abp.MultiTenancy;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Logging;
using System.Threading.Tasks;
using Volo.Abp.DependencyInjection;
using Volo.Abp.EventBus.Distributed;
using Volo.Abp.MultiTenancy;
using Volo.Abp.Uow;
namespace LINGYUN.Abp.LocalizationManagement.EventBus.Handlers
{
public class TenantSynchronizer : IDistributedEventHandler<CreateEventData>, ITransientDependency
{
protected ILogger<TenantSynchronizer> Logger { get; }
protected ICurrentTenant CurrentTenant { get; }
protected IUnitOfWorkManager UnitOfWorkManager { get; }
protected IDbSchemaMigrator DbSchemaMigrator { get; }
public TenantSynchronizer(
ICurrentTenant currentTenant,
IUnitOfWorkManager unitOfWorkManager,
IDbSchemaMigrator dbSchemaMigrator,
ILogger<TenantSynchronizer> logger)
{
CurrentTenant = currentTenant;
UnitOfWorkManager = unitOfWorkManager;
DbSchemaMigrator = dbSchemaMigrator;
Logger = logger;
}
public async Task HandleEventAsync(CreateEventData eventData)
{
using (var unitOfWork = UnitOfWorkManager.Begin())
{
using (CurrentTenant.Change(eventData.Id, eventData.Name))
{
Logger.LogInformation("Migrating the new tenant database with localization..");
// 迁移租户数据
await DbSchemaMigrator.MigrateAsync<LocalizationManagementHttpApiHostMigrationsDbContext>(
(connectionString, builder) =>
{
builder.UseMySql(connectionString, ServerVersion.AutoDetect(connectionString));
return new LocalizationManagementHttpApiHostMigrationsDbContext(builder.Options);
});
await unitOfWork.SaveChangesAsync();
Logger.LogInformation("Migrated the new tenant database with localization.");
}
}
}
}
}

1
aspnet-core/services/localization/LINGYUN.Abp.LocalizationManagement.HttpApi.Host/LINGYUN.Abp.LocalizationManagement.HttpApi.Host.csproj

@ -37,6 +37,7 @@
<ItemGroup>
<ProjectReference Include="..\..\..\modules\auditing\LINGYUN.Abp.AuditLogging.Elasticsearch\LINGYUN.Abp.AuditLogging.Elasticsearch.csproj" />
<ProjectReference Include="..\..\..\modules\common\LINGYUN.Abp.AspNetCore.HttpOverrides\LINGYUN.Abp.AspNetCore.HttpOverrides.csproj" />
<ProjectReference Include="..\..\..\modules\common\LINGYUN.Abp.Data.DbMigrator\LINGYUN.Abp.Data.DbMigrator.csproj" />
<ProjectReference Include="..\..\..\modules\common\LINGYUN.Abp.EventBus.CAP\LINGYUN.Abp.EventBus.CAP.csproj" />
<ProjectReference Include="..\..\..\modules\common\LINGYUN.Abp.ExceptionHandling.Emailing\LINGYUN.Abp.ExceptionHandling.Emailing.csproj" />
<ProjectReference Include="..\..\..\modules\logging\LINGYUN.Abp.Serilog.Enrichers.Application\LINGYUN.Abp.Serilog.Enrichers.Application.csproj" />

4
aspnet-core/services/localization/LINGYUN.Abp.LocalizationManagement.HttpApi.Host/appsettings.Development.json

@ -39,7 +39,7 @@
},
"AuditLogging": {
"Elasticsearch": {
"IndexPrefix": "lingyun.abp.auditing"
"IndexPrefix": "abp.dev.auditing"
}
},
"Elasticsearch": {
@ -66,7 +66,7 @@
"Name": "Elasticsearch",
"Args": {
"nodeUris": "http://localhost:9200",
"indexFormat": "lingyun.abp.logging-{0:yyyy.MM.dd}",
"indexFormat": "abp.dev.logging-{0:yyyy.MM.dd}",
"autoRegisterTemplate": true,
"autoRegisterTemplateVersion": "ESv7"
}

2
aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/AbpMessageServiceHttpApiHostModule.cs

@ -3,6 +3,7 @@ using LINGYUN.Abp.AspNetCore.HttpOverrides;
using LINGYUN.Abp.AspNetCore.SignalR.Protocol.Json;
using LINGYUN.Abp.AuditLogging.Elasticsearch;
using LINGYUN.Abp.BackgroundJobs.Hangfire;
using LINGYUN.Abp.Data.DbMigrator;
using LINGYUN.Abp.EventBus.CAP;
using LINGYUN.Abp.ExceptionHandling.Notifications;
using LINGYUN.Abp.Hangfire.Storage.MySql;
@ -48,6 +49,7 @@ namespace LINGYUN.Abp.MessageService
typeof(AbpSettingManagementEntityFrameworkCoreModule),
typeof(AbpPermissionManagementEntityFrameworkCoreModule),
typeof(AbpLocalizationManagementEntityFrameworkCoreModule),
typeof(AbpDataDbMigratorModule),
typeof(AbpAspNetCoreAuthenticationJwtBearerModule),
typeof(AbpHangfireMySqlStorageModule),
typeof(AbpBackgroundJobsHangfireModule),

64
aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/EventBus/Distributed/NotificationEventHandler.cs

@ -1,6 +1,4 @@
using LINGYUN.Abp.MessageService.Utils;
using LINGYUN.Abp.Notifications;
using LINGYUN.Abp.RealTime;
using LINGYUN.Abp.Notifications;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Abstractions;
using Microsoft.Extensions.Options;
@ -12,6 +10,7 @@ using Volo.Abp.BackgroundJobs;
using Volo.Abp.DependencyInjection;
using Volo.Abp.EventBus.Distributed;
using Volo.Abp.Json;
using Volo.Abp.MultiTenancy;
using Volo.Abp.Uow;
namespace LINGYUN.Abp.MessageService.EventBus.Distributed
@ -34,6 +33,10 @@ namespace LINGYUN.Abp.MessageService.EventBus.Distributed
/// </summary>
protected AbpNotificationOptions Options { get; }
/// <summary>
/// Reference to <see cref="ICurrentTenant"/>.
/// </summary>
protected ICurrentTenant CurrentTenant { get; }
/// <summary>
/// Reference to <see cref="IJsonSerializer"/>.
/// </summary>
protected IJsonSerializer JsonSerializer { get; }
@ -62,6 +65,7 @@ namespace LINGYUN.Abp.MessageService.EventBus.Distributed
/// Initializes a new instance of the <see cref="NotificationEventHandler"/> class.
/// </summary>
public NotificationEventHandler(
ICurrentTenant currentTenant,
IJsonSerializer jsonSerializer,
IBackgroundJobManager backgroundJobManager,
IOptions<AbpNotificationOptions> options,
@ -71,6 +75,7 @@ namespace LINGYUN.Abp.MessageService.EventBus.Distributed
INotificationPublishProviderManager notificationPublishProviderManager)
{
Options = options.Value;
CurrentTenant = currentTenant;
JsonSerializer = jsonSerializer;
BackgroundJobManager = backgroundJobManager;
NotificationStore = notificationStore;
@ -84,37 +89,40 @@ namespace LINGYUN.Abp.MessageService.EventBus.Distributed
[UnitOfWork]
public virtual async Task HandleEventAsync(NotificationEto<NotificationData> eventData)
{
// 如果上面过滤了应用程序,这里可以使用Get方法,否则,最好使用GetOrNull加以判断
var notification = NotificationDefinitionManager.GetOrNull(eventData.Name);
if (notification == null)
using (CurrentTenant.Change(eventData.TenantId))
{
return;
}
// 如果上面过滤了应用程序,这里可以使用Get方法,否则,最好使用GetOrNull加以判断
var notification = NotificationDefinitionManager.GetOrNull(eventData.Name);
if (notification == null)
{
return;
}
var notificationInfo = new NotificationInfo
{
Name = notification.Name,
CreationTime = eventData.CreationTime,
Data = eventData.Data,
Severity = eventData.Severity,
Lifetime = notification.NotificationLifetime,
TenantId = eventData.TenantId,
Type = notification.NotificationType
};
notificationInfo.SetId(eventData.Id);
var notificationInfo = new NotificationInfo
{
Name = notification.Name,
CreationTime = eventData.CreationTime,
Data = eventData.Data,
Severity = eventData.Severity,
Lifetime = notification.NotificationLifetime,
TenantId = eventData.TenantId,
Type = notification.NotificationType
};
notificationInfo.SetId(eventData.Id);
// TODO: 可以做成一个接口来序列化消息
notificationInfo.Data = NotificationDataConverter.Convert(notificationInfo.Data);
// TODO: 可以做成一个接口来序列化消息
notificationInfo.Data = NotificationDataConverter.Convert(notificationInfo.Data);
Logger.LogDebug($"Persistent notification {notificationInfo.Name}");
Logger.LogDebug($"Persistent notification {notificationInfo.Name}");
// 持久化通知
await NotificationStore.InsertNotificationAsync(notificationInfo);
// 持久化通知
await NotificationStore.InsertNotificationAsync(notificationInfo);
var providers = Enumerable
.Reverse(NotificationPublishProviderManager.Providers);
var providers = Enumerable
.Reverse(NotificationPublishProviderManager.Providers);
await PublishFromProvidersAsync(providers, eventData.Users, notificationInfo);
await PublishFromProvidersAsync(providers, eventData.Users, notificationInfo);
}
}
/// <summary>
@ -182,7 +190,7 @@ namespace LINGYUN.Abp.MessageService.EventBus.Distributed
/// <param name="subscriptionUserIdentifiers">订阅用户列表</param>
/// <returns></returns>
protected async Task PublishAsync(
INotificationPublishProvider provider,
INotificationPublishProvider provider,
NotificationInfo notificationInfo,
IEnumerable<UserIdentifier> subscriptionUserIdentifiers)
{

51
aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/EventBus/Distributed/TenantCreateEventHandler.cs → aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/EventBus/Distributed/TenantSynchronizer.cs

@ -1,6 +1,9 @@
using LINGYUN.Abp.MessageService.Localization;
using LINGYUN.Abp.Data.DbMigrator;
using LINGYUN.Abp.MessageService.EntityFrameworkCore;
using LINGYUN.Abp.MessageService.Localization;
using LINGYUN.Abp.MultiTenancy;
using LINGYUN.Abp.Notifications;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
@ -9,30 +12,65 @@ using Volo.Abp.DependencyInjection;
using Volo.Abp.EventBus.Distributed;
using Volo.Abp.Localization;
using Volo.Abp.MultiTenancy;
using Volo.Abp.Uow;
namespace LINGYUN.Abp.MessageService.EventBus.Distributed
{
public class TenantCreateEventHandler : IDistributedEventHandler<CreateEventData>, ITransientDependency
public class TenantSynchronizer : IDistributedEventHandler<CreateEventData>, ITransientDependency
{
protected ILogger<TenantCreateEventHandler> Logger { get; }
protected ILogger<TenantSynchronizer> Logger { get; }
protected ICurrentTenant CurrentTenant { get; }
protected IUnitOfWorkManager UnitOfWorkManager { get; }
protected IDbSchemaMigrator DbSchemaMigrator { get; }
protected INotificationSender NotificationSender { get; }
protected INotificationSubscriptionManager NotificationSubscriptionManager { get; }
public TenantCreateEventHandler(
public TenantSynchronizer(
ICurrentTenant currentTenant,
IDbSchemaMigrator dbSchemaMigrator,
IUnitOfWorkManager unitOfWorkManager,
INotificationSender notificationSender,
INotificationSubscriptionManager notificationSubscriptionManager,
ILogger<TenantCreateEventHandler> logger)
ILogger<TenantSynchronizer> logger)
{
Logger = logger;
CurrentTenant = currentTenant;
DbSchemaMigrator = dbSchemaMigrator;
UnitOfWorkManager = unitOfWorkManager;
NotificationSender = notificationSender;
NotificationSubscriptionManager = notificationSubscriptionManager;
}
public async Task HandleEventAsync(CreateEventData eventData)
{
using (var unitOfWork = UnitOfWorkManager.Begin())
{
using (CurrentTenant.Change(eventData.Id, eventData.Name))
{
Logger.LogInformation("Migrating the new tenant database with messages...");
// 迁移租户数据
await DbSchemaMigrator.MigrateAsync<MessageServiceHostMigrationsDbContext>(
(connectionString, builder) =>
{
builder.UseMySql(connectionString, ServerVersion.AutoDetect(connectionString));
return new MessageServiceHostMigrationsDbContext(builder.Options);
});
Logger.LogInformation("Migrated the new tenant database with messages.");
await SendNotificationAsync(eventData);
await unitOfWork.SaveChangesAsync();
}
}
}
private async Task SendNotificationAsync(CreateEventData eventData)
{
var tenantAdminUserIdentifier = new UserIdentifier(eventData.AdminUserId, eventData.AdminEmailAddress);
Logger.LogInformation("tenant administrator subscribes to new tenant events..");
// 租户管理员订阅事件
await NotificationSubscriptionManager
.SubscribeAsync(
@ -67,6 +105,7 @@ namespace LINGYUN.Abp.MessageService.EventBus.Distributed
tenantAdminUserIdentifier,
eventData.Id,
NotificationSeverity.Success);
Logger.LogInformation("tenant administrator subscribes to new tenant events..");
}
}
}

1
aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/LINGYUN.Abp.MessageService.HttpApi.Host.csproj

@ -49,6 +49,7 @@
<ProjectReference Include="..\..\..\modules\auditing\LINGYUN.Abp.AuditLogging.Elasticsearch\LINGYUN.Abp.AuditLogging.Elasticsearch.csproj" />
<ProjectReference Include="..\..\..\modules\common\LINGYUN.Abp.AspNetCore.HttpOverrides\LINGYUN.Abp.AspNetCore.HttpOverrides.csproj" />
<ProjectReference Include="..\..\..\modules\common\LINGYUN.Abp.AspNetCore.SignalR.Protocol.Json\LINGYUN.Abp.AspNetCore.SignalR.Protocol.Json.csproj" />
<ProjectReference Include="..\..\..\modules\common\LINGYUN.Abp.Data.DbMigrator\LINGYUN.Abp.Data.DbMigrator.csproj" />
<ProjectReference Include="..\..\..\modules\common\LINGYUN.Abp.ExceptionHandling.Notifications\LINGYUN.Abp.ExceptionHandling.Notifications.csproj" />
<ProjectReference Include="..\..\..\modules\common\LINGYUN.Abp.Hangfire.Dashboard\LINGYUN.Abp.Hangfire.Dashboard.csproj" />
<ProjectReference Include="..\..\..\modules\common\LINGYUN.Abp.Hangfire.MySqlStorage\LINGYUN.Abp.Hangfire.Storage.MySql.csproj" />

130
aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/Migrations/20200601060701_Add-Abp-Message-Service-Module.Designer.cs

@ -1,130 +0,0 @@
// <auto-generated />
using System;
using LINGYUN.Abp.MessageService.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace LINGYUN.Abp.MessageService.Migrations
{
[DbContext(typeof(MessageServiceHostMigrationsDbContext))]
[Migration("20200601060701_Add-Abp-Message-Service-Module")]
partial class AddAbpMessageServiceModule
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "3.1.3")
.HasAnnotation("Relational:MaxIdentifierLength", 64);
modelBuilder.Entity("LINGYUN.Abp.MessageService.Notifications.Notification", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime")
.HasColumnType("datetime(6)");
b.Property<DateTime?>("ExpirationTime")
.HasColumnType("datetime(6)");
b.Property<string>("NotificationData")
.IsRequired()
.HasColumnType("longtext CHARACTER SET utf8mb4")
.HasMaxLength(1048576);
b.Property<long>("NotificationId")
.HasColumnType("bigint");
b.Property<string>("NotificationName")
.IsRequired()
.HasColumnType("varchar(100) CHARACTER SET utf8mb4")
.HasMaxLength(100);
b.Property<string>("NotificationTypeName")
.IsRequired()
.HasColumnType("varchar(512) CHARACTER SET utf8mb4")
.HasMaxLength(512);
b.Property<sbyte>("Severity")
.HasColumnType("tinyint");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.Property<int>("Type")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("NotificationName");
b.ToTable("AppNotifications");
});
modelBuilder.Entity("LINGYUN.Abp.MessageService.Notifications.UserNotification", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
b.Property<long>("NotificationId")
.HasColumnType("bigint");
b.Property<sbyte>("ReadStatus")
.HasColumnType("tinyint");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.Property<Guid>("UserId")
.HasColumnType("char(36)");
b.HasKey("Id");
b.HasIndex("TenantId", "UserId", "NotificationId")
.HasName("IX_Tenant_User_Notification_Id");
b.ToTable("AppUserNotifications");
});
modelBuilder.Entity("LINGYUN.Abp.MessageService.Subscriptions.UserSubscribe", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime")
.HasColumnType("datetime(6)");
b.Property<string>("NotificationName")
.IsRequired()
.HasColumnType("varchar(100) CHARACTER SET utf8mb4")
.HasMaxLength(100);
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.Property<Guid>("UserId")
.HasColumnType("char(36)");
b.HasKey("Id");
b.HasIndex("TenantId", "UserId", "NotificationName")
.IsUnique()
.HasName("IX_Tenant_User_Notification_Name");
b.ToTable("AppUserSubscribes");
});
#pragma warning restore 612, 618
}
}
}

93
aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/Migrations/20200601060701_Add-Abp-Message-Service-Module.cs

@ -1,93 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
namespace LINGYUN.Abp.MessageService.Migrations
{
public partial class AddAbpMessageServiceModule : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "AppNotifications",
columns: table => new
{
Id = table.Column<long>(nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
TenantId = table.Column<Guid>(nullable: true),
Severity = table.Column<sbyte>(nullable: false),
Type = table.Column<int>(nullable: false),
NotificationId = table.Column<long>(nullable: false),
NotificationName = table.Column<string>(maxLength: 100, nullable: false),
NotificationData = table.Column<string>(maxLength: 1048576, nullable: false),
NotificationTypeName = table.Column<string>(maxLength: 512, nullable: false),
ExpirationTime = table.Column<DateTime>(nullable: true),
CreationTime = table.Column<DateTime>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AppNotifications", x => x.Id);
});
migrationBuilder.CreateTable(
name: "AppUserNotifications",
columns: table => new
{
Id = table.Column<long>(nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
TenantId = table.Column<Guid>(nullable: true),
UserId = table.Column<Guid>(nullable: false),
NotificationId = table.Column<long>(nullable: false),
ReadStatus = table.Column<sbyte>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AppUserNotifications", x => x.Id);
});
migrationBuilder.CreateTable(
name: "AppUserSubscribes",
columns: table => new
{
Id = table.Column<long>(nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
TenantId = table.Column<Guid>(nullable: true),
CreationTime = table.Column<DateTime>(nullable: false),
NotificationName = table.Column<string>(maxLength: 100, nullable: false),
UserId = table.Column<Guid>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AppUserSubscribes", x => x.Id);
});
migrationBuilder.CreateIndex(
name: "IX_AppNotifications_NotificationName",
table: "AppNotifications",
column: "NotificationName");
migrationBuilder.CreateIndex(
name: "IX_Tenant_User_Notification_Id",
table: "AppUserNotifications",
columns: new[] { "TenantId", "UserId", "NotificationId" });
migrationBuilder.CreateIndex(
name: "IX_Tenant_User_Notification_Name",
table: "AppUserSubscribes",
columns: new[] { "TenantId", "UserId", "NotificationName" },
unique: true);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "AppNotifications");
migrationBuilder.DropTable(
name: "AppUserNotifications");
migrationBuilder.DropTable(
name: "AppUserSubscribes");
}
}
}

494
aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/Migrations/20200602134027_Add-Chat-Message-Entites.Designer.cs

@ -1,494 +0,0 @@
// <auto-generated />
using System;
using LINGYUN.Abp.MessageService.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace LINGYUN.Abp.MessageService.Migrations
{
[DbContext(typeof(MessageServiceHostMigrationsDbContext))]
[Migration("20200602134027_Add-Chat-Message-Entites")]
partial class AddChatMessageEntites
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "3.1.3")
.HasAnnotation("Relational:MaxIdentifierLength", 64);
modelBuilder.Entity("LINGYUN.Abp.MessageService.Messages.ChatGroup", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
b.Property<string>("Address")
.HasColumnType("varchar(256) CHARACTER SET utf8mb4")
.HasMaxLength(256);
b.Property<bool>("AllowAnonymous")
.HasColumnType("tinyint(1)");
b.Property<bool>("AllowSendMessage")
.HasColumnType("tinyint(1)");
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("CreatorId")
.HasColumnName("CreatorId")
.HasColumnType("char(36)");
b.Property<string>("Description")
.HasColumnType("varchar(128) CHARACTER SET utf8mb4")
.HasMaxLength(128);
b.Property<long>("GroupId")
.HasColumnType("bigint");
b.Property<DateTime?>("LastModificationTime")
.HasColumnName("LastModificationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("LastModifierId")
.HasColumnName("LastModifierId")
.HasColumnType("char(36)");
b.Property<int>("MaxUserCount")
.HasColumnType("int");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("varchar(20) CHARACTER SET utf8mb4")
.HasMaxLength(20);
b.Property<string>("Notice")
.HasColumnType("varchar(64) CHARACTER SET utf8mb4")
.HasMaxLength(64);
b.Property<string>("Tag")
.HasColumnType("varchar(512) CHARACTER SET utf8mb4")
.HasMaxLength(512);
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.HasKey("Id");
b.HasIndex("TenantId", "Name");
b.ToTable("AppChatGroups");
});
modelBuilder.Entity("LINGYUN.Abp.MessageService.Messages.ChatGroupAdmin", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
b.Property<bool>("AllowAddPeople")
.HasColumnType("tinyint(1)");
b.Property<bool>("AllowDissolveGroup")
.HasColumnType("tinyint(1)");
b.Property<bool>("AllowKickPeople")
.HasColumnType("tinyint(1)");
b.Property<bool>("AllowSendNotice")
.HasColumnType("tinyint(1)");
b.Property<bool>("AllowSilence")
.HasColumnType("tinyint(1)");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("CreatorId")
.HasColumnType("char(36)");
b.Property<long>("GroupId")
.HasColumnType("bigint");
b.Property<bool>("IsSuperAdmin")
.HasColumnType("tinyint(1)");
b.Property<DateTime?>("LastModificationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("LastModifierId")
.HasColumnType("char(36)");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.Property<Guid>("UserId")
.HasColumnType("char(36)");
b.HasKey("Id");
b.HasIndex("TenantId", "GroupId");
b.ToTable("AppChatGroupAdmins");
});
modelBuilder.Entity("LINGYUN.Abp.MessageService.Messages.GroupChatBlack", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("CreatorId")
.HasColumnType("char(36)");
b.Property<long>("GroupId")
.HasColumnType("bigint");
b.Property<Guid>("ShieldUserId")
.HasColumnType("char(36)");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.HasKey("Id");
b.HasIndex("TenantId", "GroupId");
b.ToTable("AppGroupChatBlacks");
});
modelBuilder.Entity("LINGYUN.Abp.MessageService.Messages.GroupMessage", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
b.Property<string>("Content")
.IsRequired()
.HasColumnType("longtext CHARACTER SET utf8mb4")
.HasMaxLength(1048576);
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("CreatorId")
.HasColumnType("char(36)");
b.Property<long>("GroupId")
.HasColumnType("bigint");
b.Property<long>("MessageId")
.HasColumnType("bigint");
b.Property<sbyte>("SendState")
.HasColumnType("tinyint");
b.Property<string>("SendUserName")
.IsRequired()
.HasColumnType("varchar(64) CHARACTER SET utf8mb4")
.HasMaxLength(64);
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.Property<int>("Type")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("TenantId", "GroupId");
b.ToTable("AppGroupMessages");
});
modelBuilder.Entity("LINGYUN.Abp.MessageService.Messages.UserChatBlack", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("CreatorId")
.HasColumnType("char(36)");
b.Property<Guid>("ShieldUserId")
.HasColumnType("char(36)");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.Property<Guid>("UserId")
.HasColumnType("char(36)");
b.HasKey("Id");
b.HasIndex("TenantId", "UserId");
b.ToTable("AppUserChatBlacks");
});
modelBuilder.Entity("LINGYUN.Abp.MessageService.Messages.UserChatGroup", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("CreatorId")
.HasColumnName("CreatorId")
.HasColumnType("char(36)");
b.Property<long>("GroupId")
.HasColumnType("bigint");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.Property<Guid>("UserId")
.HasColumnType("char(36)");
b.HasKey("Id");
b.HasIndex("TenantId", "GroupId", "UserId");
b.ToTable("AppUserChatGroups");
});
modelBuilder.Entity("LINGYUN.Abp.MessageService.Messages.UserChatSetting", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
b.Property<bool>("AllowAddFriend")
.HasColumnType("tinyint(1)");
b.Property<bool>("AllowAnonymous")
.HasColumnType("tinyint(1)");
b.Property<bool>("AllowReceiveMessage")
.HasColumnType("tinyint(1)");
b.Property<bool>("AllowSendMessage")
.HasColumnType("tinyint(1)");
b.Property<bool>("RequireAddFriendValition")
.HasColumnType("tinyint(1)");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.Property<Guid>("UserId")
.HasColumnType("char(36)");
b.HasKey("Id");
b.HasIndex("TenantId", "UserId");
b.ToTable("AppUserChatSettings");
});
modelBuilder.Entity("LINGYUN.Abp.MessageService.Messages.UserMessage", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
b.Property<string>("Content")
.IsRequired()
.HasColumnType("longtext CHARACTER SET utf8mb4")
.HasMaxLength(1048576);
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("CreatorId")
.HasColumnType("char(36)");
b.Property<long>("MessageId")
.HasColumnType("bigint");
b.Property<Guid>("ReceiveUserId")
.HasColumnType("char(36)");
b.Property<sbyte>("SendState")
.HasColumnType("tinyint");
b.Property<string>("SendUserName")
.IsRequired()
.HasColumnType("varchar(64) CHARACTER SET utf8mb4")
.HasMaxLength(64);
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.Property<int>("Type")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("TenantId", "ReceiveUserId");
b.ToTable("AppUserMessages");
});
modelBuilder.Entity("LINGYUN.Abp.MessageService.Messages.UserSpecialFocus", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("CreatorId")
.HasColumnType("char(36)");
b.Property<Guid>("FocusUserId")
.HasColumnType("char(36)");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.Property<Guid>("UserId")
.HasColumnType("char(36)");
b.HasKey("Id");
b.HasIndex("TenantId", "UserId");
b.ToTable("AppUserSpecialFocuss");
});
modelBuilder.Entity("LINGYUN.Abp.MessageService.Notifications.Notification", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime")
.HasColumnType("datetime(6)");
b.Property<DateTime?>("ExpirationTime")
.HasColumnType("datetime(6)");
b.Property<string>("NotificationData")
.IsRequired()
.HasColumnType("longtext CHARACTER SET utf8mb4")
.HasMaxLength(1048576);
b.Property<long>("NotificationId")
.HasColumnType("bigint");
b.Property<string>("NotificationName")
.IsRequired()
.HasColumnType("varchar(100) CHARACTER SET utf8mb4")
.HasMaxLength(100);
b.Property<string>("NotificationTypeName")
.IsRequired()
.HasColumnType("varchar(512) CHARACTER SET utf8mb4")
.HasMaxLength(512);
b.Property<sbyte>("Severity")
.HasColumnType("tinyint");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.Property<int>("Type")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("NotificationName");
b.ToTable("AppNotifications");
});
modelBuilder.Entity("LINGYUN.Abp.MessageService.Notifications.UserNotification", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
b.Property<long>("NotificationId")
.HasColumnType("bigint");
b.Property<int>("ReadStatus")
.HasColumnType("int");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.Property<Guid>("UserId")
.HasColumnType("char(36)");
b.HasKey("Id");
b.HasIndex("TenantId", "UserId", "NotificationId")
.HasName("IX_Tenant_User_Notification_Id");
b.ToTable("AppUserNotifications");
});
modelBuilder.Entity("LINGYUN.Abp.MessageService.Subscriptions.UserSubscribe", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime")
.HasColumnType("datetime(6)");
b.Property<string>("NotificationName")
.IsRequired()
.HasColumnType("varchar(100) CHARACTER SET utf8mb4")
.HasMaxLength(100);
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.Property<Guid>("UserId")
.HasColumnType("char(36)");
b.HasKey("Id");
b.HasIndex("TenantId", "UserId", "NotificationName")
.IsUnique()
.HasName("IX_Tenant_User_Notification_Name");
b.ToTable("AppUserSubscribes");
});
#pragma warning restore 612, 618
}
}
}

281
aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/Migrations/20200602134027_Add-Chat-Message-Entites.cs

@ -1,281 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
namespace LINGYUN.Abp.MessageService.Migrations
{
public partial class AddChatMessageEntites : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<int>(
name: "ReadStatus",
table: "AppUserNotifications",
nullable: false,
oldClrType: typeof(sbyte),
oldType: "tinyint");
migrationBuilder.CreateTable(
name: "AppChatGroupAdmins",
columns: table => new
{
Id = table.Column<long>(nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
CreationTime = table.Column<DateTime>(nullable: false),
CreatorId = table.Column<Guid>(nullable: true),
LastModificationTime = table.Column<DateTime>(nullable: true),
LastModifierId = table.Column<Guid>(nullable: true),
TenantId = table.Column<Guid>(nullable: true),
GroupId = table.Column<long>(nullable: false),
UserId = table.Column<Guid>(nullable: false),
IsSuperAdmin = table.Column<bool>(nullable: false),
AllowSilence = table.Column<bool>(nullable: false),
AllowKickPeople = table.Column<bool>(nullable: false),
AllowAddPeople = table.Column<bool>(nullable: false),
AllowSendNotice = table.Column<bool>(nullable: false),
AllowDissolveGroup = table.Column<bool>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AppChatGroupAdmins", x => x.Id);
});
migrationBuilder.CreateTable(
name: "AppChatGroups",
columns: table => new
{
Id = table.Column<long>(nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
CreationTime = table.Column<DateTime>(nullable: false),
CreatorId = table.Column<Guid>(nullable: true),
LastModificationTime = table.Column<DateTime>(nullable: true),
LastModifierId = table.Column<Guid>(nullable: true),
TenantId = table.Column<Guid>(nullable: true),
GroupId = table.Column<long>(nullable: false),
Name = table.Column<string>(maxLength: 20, nullable: false),
Tag = table.Column<string>(maxLength: 512, nullable: true),
Address = table.Column<string>(maxLength: 256, nullable: true),
Notice = table.Column<string>(maxLength: 64, nullable: true),
MaxUserCount = table.Column<int>(nullable: false),
AllowAnonymous = table.Column<bool>(nullable: false),
AllowSendMessage = table.Column<bool>(nullable: false),
Description = table.Column<string>(maxLength: 128, nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AppChatGroups", x => x.Id);
});
migrationBuilder.CreateTable(
name: "AppGroupChatBlacks",
columns: table => new
{
Id = table.Column<long>(nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
CreationTime = table.Column<DateTime>(nullable: false),
CreatorId = table.Column<Guid>(nullable: true),
TenantId = table.Column<Guid>(nullable: true),
GroupId = table.Column<long>(nullable: false),
ShieldUserId = table.Column<Guid>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AppGroupChatBlacks", x => x.Id);
});
migrationBuilder.CreateTable(
name: "AppGroupMessages",
columns: table => new
{
Id = table.Column<long>(nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
CreationTime = table.Column<DateTime>(nullable: false),
CreatorId = table.Column<Guid>(nullable: true),
TenantId = table.Column<Guid>(nullable: true),
MessageId = table.Column<long>(nullable: false),
SendUserName = table.Column<string>(maxLength: 64, nullable: false),
Content = table.Column<string>(maxLength: 1048576, nullable: false),
Type = table.Column<int>(nullable: false),
SendState = table.Column<sbyte>(nullable: false),
GroupId = table.Column<long>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AppGroupMessages", x => x.Id);
});
migrationBuilder.CreateTable(
name: "AppUserChatBlacks",
columns: table => new
{
Id = table.Column<long>(nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
CreationTime = table.Column<DateTime>(nullable: false),
CreatorId = table.Column<Guid>(nullable: true),
TenantId = table.Column<Guid>(nullable: true),
UserId = table.Column<Guid>(nullable: false),
ShieldUserId = table.Column<Guid>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AppUserChatBlacks", x => x.Id);
});
migrationBuilder.CreateTable(
name: "AppUserChatGroups",
columns: table => new
{
Id = table.Column<long>(nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
CreationTime = table.Column<DateTime>(nullable: false),
CreatorId = table.Column<Guid>(nullable: true),
TenantId = table.Column<Guid>(nullable: true),
UserId = table.Column<Guid>(nullable: false),
GroupId = table.Column<long>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AppUserChatGroups", x => x.Id);
});
migrationBuilder.CreateTable(
name: "AppUserChatSettings",
columns: table => new
{
Id = table.Column<long>(nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
TenantId = table.Column<Guid>(nullable: true),
UserId = table.Column<Guid>(nullable: false),
AllowAnonymous = table.Column<bool>(nullable: false),
AllowAddFriend = table.Column<bool>(nullable: false),
RequireAddFriendValition = table.Column<bool>(nullable: false),
AllowReceiveMessage = table.Column<bool>(nullable: false),
AllowSendMessage = table.Column<bool>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AppUserChatSettings", x => x.Id);
});
migrationBuilder.CreateTable(
name: "AppUserMessages",
columns: table => new
{
Id = table.Column<long>(nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
CreationTime = table.Column<DateTime>(nullable: false),
CreatorId = table.Column<Guid>(nullable: true),
TenantId = table.Column<Guid>(nullable: true),
MessageId = table.Column<long>(nullable: false),
SendUserName = table.Column<string>(maxLength: 64, nullable: false),
Content = table.Column<string>(maxLength: 1048576, nullable: false),
Type = table.Column<int>(nullable: false),
SendState = table.Column<sbyte>(nullable: false),
ReceiveUserId = table.Column<Guid>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AppUserMessages", x => x.Id);
});
migrationBuilder.CreateTable(
name: "AppUserSpecialFocuss",
columns: table => new
{
Id = table.Column<long>(nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
CreationTime = table.Column<DateTime>(nullable: false),
CreatorId = table.Column<Guid>(nullable: true),
TenantId = table.Column<Guid>(nullable: true),
UserId = table.Column<Guid>(nullable: false),
FocusUserId = table.Column<Guid>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AppUserSpecialFocuss", x => x.Id);
});
migrationBuilder.CreateIndex(
name: "IX_AppChatGroupAdmins_TenantId_GroupId",
table: "AppChatGroupAdmins",
columns: new[] { "TenantId", "GroupId" });
migrationBuilder.CreateIndex(
name: "IX_AppChatGroups_TenantId_Name",
table: "AppChatGroups",
columns: new[] { "TenantId", "Name" });
migrationBuilder.CreateIndex(
name: "IX_AppGroupChatBlacks_TenantId_GroupId",
table: "AppGroupChatBlacks",
columns: new[] { "TenantId", "GroupId" });
migrationBuilder.CreateIndex(
name: "IX_AppGroupMessages_TenantId_GroupId",
table: "AppGroupMessages",
columns: new[] { "TenantId", "GroupId" });
migrationBuilder.CreateIndex(
name: "IX_AppUserChatBlacks_TenantId_UserId",
table: "AppUserChatBlacks",
columns: new[] { "TenantId", "UserId" });
migrationBuilder.CreateIndex(
name: "IX_AppUserChatGroups_TenantId_GroupId_UserId",
table: "AppUserChatGroups",
columns: new[] { "TenantId", "GroupId", "UserId" });
migrationBuilder.CreateIndex(
name: "IX_AppUserChatSettings_TenantId_UserId",
table: "AppUserChatSettings",
columns: new[] { "TenantId", "UserId" });
migrationBuilder.CreateIndex(
name: "IX_AppUserMessages_TenantId_ReceiveUserId",
table: "AppUserMessages",
columns: new[] { "TenantId", "ReceiveUserId" });
migrationBuilder.CreateIndex(
name: "IX_AppUserSpecialFocuss_TenantId_UserId",
table: "AppUserSpecialFocuss",
columns: new[] { "TenantId", "UserId" });
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "AppChatGroupAdmins");
migrationBuilder.DropTable(
name: "AppChatGroups");
migrationBuilder.DropTable(
name: "AppGroupChatBlacks");
migrationBuilder.DropTable(
name: "AppGroupMessages");
migrationBuilder.DropTable(
name: "AppUserChatBlacks");
migrationBuilder.DropTable(
name: "AppUserChatGroups");
migrationBuilder.DropTable(
name: "AppUserChatSettings");
migrationBuilder.DropTable(
name: "AppUserMessages");
migrationBuilder.DropTable(
name: "AppUserSpecialFocuss");
migrationBuilder.AlterColumn<sbyte>(
name: "ReadStatus",
table: "AppUserNotifications",
type: "tinyint",
nullable: false,
oldClrType: typeof(int));
}
}
}

503
aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/Migrations/20200609151853_Create-User-Subscription-Column-UserName.Designer.cs

@ -1,503 +0,0 @@
// <auto-generated />
using System;
using LINGYUN.Abp.MessageService.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Volo.Abp.EntityFrameworkCore;
namespace LINGYUN.Abp.MessageService.Migrations
{
[DbContext(typeof(MessageServiceHostMigrationsDbContext))]
[Migration("20200609151853_Create-User-Subscription-Column-UserName")]
partial class CreateUserSubscriptionColumnUserName
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.MySql)
.HasAnnotation("ProductVersion", "3.1.4")
.HasAnnotation("Relational:MaxIdentifierLength", 64);
modelBuilder.Entity("LINGYUN.Abp.MessageService.Messages.ChatGroup", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
b.Property<string>("Address")
.HasColumnType("varchar(256) CHARACTER SET utf8mb4")
.HasMaxLength(256);
b.Property<bool>("AllowAnonymous")
.HasColumnType("tinyint(1)");
b.Property<bool>("AllowSendMessage")
.HasColumnType("tinyint(1)");
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("CreatorId")
.HasColumnName("CreatorId")
.HasColumnType("char(36)");
b.Property<string>("Description")
.HasColumnType("varchar(128) CHARACTER SET utf8mb4")
.HasMaxLength(128);
b.Property<long>("GroupId")
.HasColumnType("bigint");
b.Property<DateTime?>("LastModificationTime")
.HasColumnName("LastModificationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("LastModifierId")
.HasColumnName("LastModifierId")
.HasColumnType("char(36)");
b.Property<int>("MaxUserCount")
.HasColumnType("int");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("varchar(20) CHARACTER SET utf8mb4")
.HasMaxLength(20);
b.Property<string>("Notice")
.HasColumnType("varchar(64) CHARACTER SET utf8mb4")
.HasMaxLength(64);
b.Property<string>("Tag")
.HasColumnType("varchar(512) CHARACTER SET utf8mb4")
.HasMaxLength(512);
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.HasKey("Id");
b.HasIndex("TenantId", "Name");
b.ToTable("AppChatGroups");
});
modelBuilder.Entity("LINGYUN.Abp.MessageService.Messages.ChatGroupAdmin", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
b.Property<bool>("AllowAddPeople")
.HasColumnType("tinyint(1)");
b.Property<bool>("AllowDissolveGroup")
.HasColumnType("tinyint(1)");
b.Property<bool>("AllowKickPeople")
.HasColumnType("tinyint(1)");
b.Property<bool>("AllowSendNotice")
.HasColumnType("tinyint(1)");
b.Property<bool>("AllowSilence")
.HasColumnType("tinyint(1)");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("CreatorId")
.HasColumnType("char(36)");
b.Property<long>("GroupId")
.HasColumnType("bigint");
b.Property<bool>("IsSuperAdmin")
.HasColumnType("tinyint(1)");
b.Property<DateTime?>("LastModificationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("LastModifierId")
.HasColumnType("char(36)");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.Property<Guid>("UserId")
.HasColumnType("char(36)");
b.HasKey("Id");
b.HasIndex("TenantId", "GroupId");
b.ToTable("AppChatGroupAdmins");
});
modelBuilder.Entity("LINGYUN.Abp.MessageService.Messages.GroupChatBlack", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("CreatorId")
.HasColumnType("char(36)");
b.Property<long>("GroupId")
.HasColumnType("bigint");
b.Property<Guid>("ShieldUserId")
.HasColumnType("char(36)");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.HasKey("Id");
b.HasIndex("TenantId", "GroupId");
b.ToTable("AppGroupChatBlacks");
});
modelBuilder.Entity("LINGYUN.Abp.MessageService.Messages.GroupMessage", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
b.Property<string>("Content")
.IsRequired()
.HasColumnType("longtext CHARACTER SET utf8mb4")
.HasMaxLength(1048576);
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("CreatorId")
.HasColumnType("char(36)");
b.Property<long>("GroupId")
.HasColumnType("bigint");
b.Property<long>("MessageId")
.HasColumnType("bigint");
b.Property<sbyte>("SendState")
.HasColumnType("tinyint");
b.Property<string>("SendUserName")
.IsRequired()
.HasColumnType("varchar(64) CHARACTER SET utf8mb4")
.HasMaxLength(64);
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.Property<int>("Type")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("TenantId", "GroupId");
b.ToTable("AppGroupMessages");
});
modelBuilder.Entity("LINGYUN.Abp.MessageService.Messages.UserChatBlack", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("CreatorId")
.HasColumnType("char(36)");
b.Property<Guid>("ShieldUserId")
.HasColumnType("char(36)");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.Property<Guid>("UserId")
.HasColumnType("char(36)");
b.HasKey("Id");
b.HasIndex("TenantId", "UserId");
b.ToTable("AppUserChatBlacks");
});
modelBuilder.Entity("LINGYUN.Abp.MessageService.Messages.UserChatGroup", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("CreatorId")
.HasColumnName("CreatorId")
.HasColumnType("char(36)");
b.Property<long>("GroupId")
.HasColumnType("bigint");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.Property<Guid>("UserId")
.HasColumnType("char(36)");
b.HasKey("Id");
b.HasIndex("TenantId", "GroupId", "UserId");
b.ToTable("AppUserChatGroups");
});
modelBuilder.Entity("LINGYUN.Abp.MessageService.Messages.UserChatSetting", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
b.Property<bool>("AllowAddFriend")
.HasColumnType("tinyint(1)");
b.Property<bool>("AllowAnonymous")
.HasColumnType("tinyint(1)");
b.Property<bool>("AllowReceiveMessage")
.HasColumnType("tinyint(1)");
b.Property<bool>("AllowSendMessage")
.HasColumnType("tinyint(1)");
b.Property<bool>("RequireAddFriendValition")
.HasColumnType("tinyint(1)");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.Property<Guid>("UserId")
.HasColumnType("char(36)");
b.HasKey("Id");
b.HasIndex("TenantId", "UserId");
b.ToTable("AppUserChatSettings");
});
modelBuilder.Entity("LINGYUN.Abp.MessageService.Messages.UserMessage", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
b.Property<string>("Content")
.IsRequired()
.HasColumnType("longtext CHARACTER SET utf8mb4")
.HasMaxLength(1048576);
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("CreatorId")
.HasColumnType("char(36)");
b.Property<long>("MessageId")
.HasColumnType("bigint");
b.Property<Guid>("ReceiveUserId")
.HasColumnType("char(36)");
b.Property<sbyte>("SendState")
.HasColumnType("tinyint");
b.Property<string>("SendUserName")
.IsRequired()
.HasColumnType("varchar(64) CHARACTER SET utf8mb4")
.HasMaxLength(64);
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.Property<int>("Type")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("TenantId", "ReceiveUserId");
b.ToTable("AppUserMessages");
});
modelBuilder.Entity("LINGYUN.Abp.MessageService.Messages.UserSpecialFocus", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("CreatorId")
.HasColumnType("char(36)");
b.Property<Guid>("FocusUserId")
.HasColumnType("char(36)");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.Property<Guid>("UserId")
.HasColumnType("char(36)");
b.HasKey("Id");
b.HasIndex("TenantId", "UserId");
b.ToTable("AppUserSpecialFocuss");
});
modelBuilder.Entity("LINGYUN.Abp.MessageService.Notifications.Notification", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime")
.HasColumnType("datetime(6)");
b.Property<DateTime?>("ExpirationTime")
.HasColumnType("datetime(6)");
b.Property<string>("NotificationData")
.IsRequired()
.HasColumnType("longtext CHARACTER SET utf8mb4")
.HasMaxLength(1048576);
b.Property<long>("NotificationId")
.HasColumnType("bigint");
b.Property<string>("NotificationName")
.IsRequired()
.HasColumnType("varchar(100) CHARACTER SET utf8mb4")
.HasMaxLength(100);
b.Property<string>("NotificationTypeName")
.IsRequired()
.HasColumnType("varchar(512) CHARACTER SET utf8mb4")
.HasMaxLength(512);
b.Property<sbyte>("Severity")
.HasColumnType("tinyint");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.Property<int>("Type")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("NotificationName");
b.ToTable("AppNotifications");
});
modelBuilder.Entity("LINGYUN.Abp.MessageService.Notifications.UserNotification", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
b.Property<long>("NotificationId")
.HasColumnType("bigint");
b.Property<int>("ReadStatus")
.HasColumnType("int");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.Property<Guid>("UserId")
.HasColumnType("char(36)");
b.HasKey("Id");
b.HasIndex("TenantId", "UserId", "NotificationId")
.HasName("IX_Tenant_User_Notification_Id");
b.ToTable("AppUserNotifications");
});
modelBuilder.Entity("LINGYUN.Abp.MessageService.Subscriptions.UserSubscribe", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime")
.HasColumnType("datetime(6)");
b.Property<string>("NotificationName")
.IsRequired()
.HasColumnType("varchar(100) CHARACTER SET utf8mb4")
.HasMaxLength(100);
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.Property<Guid>("UserId")
.HasColumnType("char(36)");
b.Property<string>("UserName")
.IsRequired()
.ValueGeneratedOnAdd()
.HasColumnType("varchar(128) CHARACTER SET utf8mb4")
.HasMaxLength(128)
.HasDefaultValue("/");
b.HasKey("Id");
b.HasIndex("TenantId", "UserId", "NotificationName")
.IsUnique()
.HasName("IX_Tenant_User_Notification_Name");
b.ToTable("AppUserSubscribes");
});
#pragma warning restore 612, 618
}
}
}

24
aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/Migrations/20200609151853_Create-User-Subscription-Column-UserName.cs

@ -1,24 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace LINGYUN.Abp.MessageService.Migrations
{
public partial class CreateUserSubscriptionColumnUserName : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "UserName",
table: "AppUserSubscribes",
maxLength: 128,
nullable: false,
defaultValue: "/");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "UserName",
table: "AppUserSubscribes");
}
}
}

508
aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/Migrations/20200617010925_Add-Notification-Column-CateGory.Designer.cs

@ -1,508 +0,0 @@
// <auto-generated />
using System;
using LINGYUN.Abp.MessageService.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Volo.Abp.EntityFrameworkCore;
namespace LINGYUN.Abp.MessageService.Migrations
{
[DbContext(typeof(MessageServiceHostMigrationsDbContext))]
[Migration("20200617010925_Add-Notification-Column-CateGory")]
partial class AddNotificationColumnCateGory
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.MySql)
.HasAnnotation("ProductVersion", "3.1.4")
.HasAnnotation("Relational:MaxIdentifierLength", 64);
modelBuilder.Entity("LINGYUN.Abp.MessageService.Messages.ChatGroup", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
b.Property<string>("Address")
.HasColumnType("varchar(256) CHARACTER SET utf8mb4")
.HasMaxLength(256);
b.Property<bool>("AllowAnonymous")
.HasColumnType("tinyint(1)");
b.Property<bool>("AllowSendMessage")
.HasColumnType("tinyint(1)");
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("CreatorId")
.HasColumnName("CreatorId")
.HasColumnType("char(36)");
b.Property<string>("Description")
.HasColumnType("varchar(128) CHARACTER SET utf8mb4")
.HasMaxLength(128);
b.Property<long>("GroupId")
.HasColumnType("bigint");
b.Property<DateTime?>("LastModificationTime")
.HasColumnName("LastModificationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("LastModifierId")
.HasColumnName("LastModifierId")
.HasColumnType("char(36)");
b.Property<int>("MaxUserCount")
.HasColumnType("int");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("varchar(20) CHARACTER SET utf8mb4")
.HasMaxLength(20);
b.Property<string>("Notice")
.HasColumnType("varchar(64) CHARACTER SET utf8mb4")
.HasMaxLength(64);
b.Property<string>("Tag")
.HasColumnType("varchar(512) CHARACTER SET utf8mb4")
.HasMaxLength(512);
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.HasKey("Id");
b.HasIndex("TenantId", "Name");
b.ToTable("AppChatGroups");
});
modelBuilder.Entity("LINGYUN.Abp.MessageService.Messages.ChatGroupAdmin", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
b.Property<bool>("AllowAddPeople")
.HasColumnType("tinyint(1)");
b.Property<bool>("AllowDissolveGroup")
.HasColumnType("tinyint(1)");
b.Property<bool>("AllowKickPeople")
.HasColumnType("tinyint(1)");
b.Property<bool>("AllowSendNotice")
.HasColumnType("tinyint(1)");
b.Property<bool>("AllowSilence")
.HasColumnType("tinyint(1)");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("CreatorId")
.HasColumnType("char(36)");
b.Property<long>("GroupId")
.HasColumnType("bigint");
b.Property<bool>("IsSuperAdmin")
.HasColumnType("tinyint(1)");
b.Property<DateTime?>("LastModificationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("LastModifierId")
.HasColumnType("char(36)");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.Property<Guid>("UserId")
.HasColumnType("char(36)");
b.HasKey("Id");
b.HasIndex("TenantId", "GroupId");
b.ToTable("AppChatGroupAdmins");
});
modelBuilder.Entity("LINGYUN.Abp.MessageService.Messages.GroupChatBlack", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("CreatorId")
.HasColumnType("char(36)");
b.Property<long>("GroupId")
.HasColumnType("bigint");
b.Property<Guid>("ShieldUserId")
.HasColumnType("char(36)");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.HasKey("Id");
b.HasIndex("TenantId", "GroupId");
b.ToTable("AppGroupChatBlacks");
});
modelBuilder.Entity("LINGYUN.Abp.MessageService.Messages.GroupMessage", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
b.Property<string>("Content")
.IsRequired()
.HasColumnType("longtext CHARACTER SET utf8mb4")
.HasMaxLength(1048576);
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("CreatorId")
.HasColumnType("char(36)");
b.Property<long>("GroupId")
.HasColumnType("bigint");
b.Property<long>("MessageId")
.HasColumnType("bigint");
b.Property<sbyte>("SendState")
.HasColumnType("tinyint");
b.Property<string>("SendUserName")
.IsRequired()
.HasColumnType("varchar(64) CHARACTER SET utf8mb4")
.HasMaxLength(64);
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.Property<int>("Type")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("TenantId", "GroupId");
b.ToTable("AppGroupMessages");
});
modelBuilder.Entity("LINGYUN.Abp.MessageService.Messages.UserChatBlack", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("CreatorId")
.HasColumnType("char(36)");
b.Property<Guid>("ShieldUserId")
.HasColumnType("char(36)");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.Property<Guid>("UserId")
.HasColumnType("char(36)");
b.HasKey("Id");
b.HasIndex("TenantId", "UserId");
b.ToTable("AppUserChatBlacks");
});
modelBuilder.Entity("LINGYUN.Abp.MessageService.Messages.UserChatGroup", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("CreatorId")
.HasColumnName("CreatorId")
.HasColumnType("char(36)");
b.Property<long>("GroupId")
.HasColumnType("bigint");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.Property<Guid>("UserId")
.HasColumnType("char(36)");
b.HasKey("Id");
b.HasIndex("TenantId", "GroupId", "UserId");
b.ToTable("AppUserChatGroups");
});
modelBuilder.Entity("LINGYUN.Abp.MessageService.Messages.UserChatSetting", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
b.Property<bool>("AllowAddFriend")
.HasColumnType("tinyint(1)");
b.Property<bool>("AllowAnonymous")
.HasColumnType("tinyint(1)");
b.Property<bool>("AllowReceiveMessage")
.HasColumnType("tinyint(1)");
b.Property<bool>("AllowSendMessage")
.HasColumnType("tinyint(1)");
b.Property<bool>("RequireAddFriendValition")
.HasColumnType("tinyint(1)");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.Property<Guid>("UserId")
.HasColumnType("char(36)");
b.HasKey("Id");
b.HasIndex("TenantId", "UserId");
b.ToTable("AppUserChatSettings");
});
modelBuilder.Entity("LINGYUN.Abp.MessageService.Messages.UserMessage", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
b.Property<string>("Content")
.IsRequired()
.HasColumnType("longtext CHARACTER SET utf8mb4")
.HasMaxLength(1048576);
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("CreatorId")
.HasColumnType("char(36)");
b.Property<long>("MessageId")
.HasColumnType("bigint");
b.Property<Guid>("ReceiveUserId")
.HasColumnType("char(36)");
b.Property<sbyte>("SendState")
.HasColumnType("tinyint");
b.Property<string>("SendUserName")
.IsRequired()
.HasColumnType("varchar(64) CHARACTER SET utf8mb4")
.HasMaxLength(64);
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.Property<int>("Type")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("TenantId", "ReceiveUserId");
b.ToTable("AppUserMessages");
});
modelBuilder.Entity("LINGYUN.Abp.MessageService.Messages.UserSpecialFocus", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("CreatorId")
.HasColumnType("char(36)");
b.Property<Guid>("FocusUserId")
.HasColumnType("char(36)");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.Property<Guid>("UserId")
.HasColumnType("char(36)");
b.HasKey("Id");
b.HasIndex("TenantId", "UserId");
b.ToTable("AppUserSpecialFocuss");
});
modelBuilder.Entity("LINGYUN.Abp.MessageService.Notifications.Notification", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime")
.HasColumnType("datetime(6)");
b.Property<DateTime?>("ExpirationTime")
.HasColumnType("datetime(6)");
b.Property<string>("NotificationCateGory")
.IsRequired()
.HasColumnType("varchar(50) CHARACTER SET utf8mb4")
.HasMaxLength(50);
b.Property<string>("NotificationData")
.IsRequired()
.HasColumnType("longtext CHARACTER SET utf8mb4")
.HasMaxLength(1048576);
b.Property<long>("NotificationId")
.HasColumnType("bigint");
b.Property<string>("NotificationName")
.IsRequired()
.HasColumnType("varchar(100) CHARACTER SET utf8mb4")
.HasMaxLength(100);
b.Property<string>("NotificationTypeName")
.IsRequired()
.HasColumnType("varchar(512) CHARACTER SET utf8mb4")
.HasMaxLength(512);
b.Property<sbyte>("Severity")
.HasColumnType("tinyint");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.Property<int>("Type")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("TenantId", "NotificationName");
b.ToTable("AppNotifications");
});
modelBuilder.Entity("LINGYUN.Abp.MessageService.Notifications.UserNotification", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
b.Property<long>("NotificationId")
.HasColumnType("bigint");
b.Property<int>("ReadStatus")
.HasColumnType("int");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.Property<Guid>("UserId")
.HasColumnType("char(36)");
b.HasKey("Id");
b.HasIndex("TenantId", "UserId", "NotificationId")
.HasName("IX_Tenant_User_Notification_Id");
b.ToTable("AppUserNotifications");
});
modelBuilder.Entity("LINGYUN.Abp.MessageService.Subscriptions.UserSubscribe", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime")
.HasColumnType("datetime(6)");
b.Property<string>("NotificationName")
.IsRequired()
.HasColumnType("varchar(100) CHARACTER SET utf8mb4")
.HasMaxLength(100);
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.Property<Guid>("UserId")
.HasColumnType("char(36)");
b.Property<string>("UserName")
.IsRequired()
.ValueGeneratedOnAdd()
.HasColumnType("varchar(128) CHARACTER SET utf8mb4")
.HasMaxLength(128)
.HasDefaultValue("/");
b.HasKey("Id");
b.HasIndex("TenantId", "UserId", "NotificationName")
.IsUnique()
.HasName("IX_Tenant_User_Notification_Name");
b.ToTable("AppUserSubscribes");
});
#pragma warning restore 612, 618
}
}
}

42
aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/Migrations/20200617010925_Add-Notification-Column-CateGory.cs

@ -1,42 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace LINGYUN.Abp.MessageService.Migrations
{
public partial class AddNotificationColumnCateGory : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropIndex(
name: "IX_AppNotifications_NotificationName",
table: "AppNotifications");
migrationBuilder.AddColumn<string>(
name: "NotificationCateGory",
table: "AppNotifications",
maxLength: 50,
nullable: false,
defaultValue: "");
migrationBuilder.CreateIndex(
name: "IX_AppNotifications_TenantId_NotificationName",
table: "AppNotifications",
columns: new[] { "TenantId", "NotificationName" });
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropIndex(
name: "IX_AppNotifications_TenantId_NotificationName",
table: "AppNotifications");
migrationBuilder.DropColumn(
name: "NotificationCateGory",
table: "AppNotifications");
migrationBuilder.CreateIndex(
name: "IX_AppNotifications_NotificationName",
table: "AppNotifications",
column: "NotificationName");
}
}
}

590
aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/Migrations/20201024093309_Add-MemberCard-Entity.Designer.cs

@ -1,590 +0,0 @@
// <auto-generated />
using System;
using LINGYUN.Abp.MessageService.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Volo.Abp.EntityFrameworkCore;
namespace LINGYUN.Abp.MessageService.Migrations
{
[DbContext(typeof(MessageServiceHostMigrationsDbContext))]
[Migration("20201024093309_Add-MemberCard-Entity")]
partial class AddMemberCardEntity
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.MySql)
.HasAnnotation("ProductVersion", "3.1.7")
.HasAnnotation("Relational:MaxIdentifierLength", 64);
modelBuilder.Entity("LINGYUN.Abp.MessageService.Chat.ChatGroup", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
b.Property<string>("Address")
.HasColumnType("varchar(256) CHARACTER SET utf8mb4")
.HasMaxLength(256);
b.Property<Guid>("AdminUserId")
.HasColumnType("char(36)");
b.Property<bool>("AllowAnonymous")
.HasColumnType("tinyint(1)");
b.Property<bool>("AllowSendMessage")
.HasColumnType("tinyint(1)");
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("CreatorId")
.HasColumnName("CreatorId")
.HasColumnType("char(36)");
b.Property<string>("Description")
.HasColumnType("varchar(128) CHARACTER SET utf8mb4")
.HasMaxLength(128);
b.Property<long>("GroupId")
.HasColumnType("bigint");
b.Property<DateTime?>("LastModificationTime")
.HasColumnName("LastModificationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("LastModifierId")
.HasColumnName("LastModifierId")
.HasColumnType("char(36)");
b.Property<int>("MaxUserCount")
.HasColumnType("int");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("varchar(20) CHARACTER SET utf8mb4")
.HasMaxLength(20);
b.Property<string>("Notice")
.HasColumnType("varchar(64) CHARACTER SET utf8mb4")
.HasMaxLength(64);
b.Property<string>("Tag")
.HasColumnType("varchar(512) CHARACTER SET utf8mb4")
.HasMaxLength(512);
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.HasKey("Id");
b.HasIndex("TenantId", "Name");
b.ToTable("AppChatGroups");
});
modelBuilder.Entity("LINGYUN.Abp.MessageService.Chat.GroupChatBlack", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("CreatorId")
.HasColumnType("char(36)");
b.Property<long>("GroupId")
.HasColumnType("bigint");
b.Property<Guid>("ShieldUserId")
.HasColumnType("char(36)");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.HasKey("Id");
b.HasIndex("TenantId", "GroupId");
b.ToTable("AppGroupChatBlacks");
});
modelBuilder.Entity("LINGYUN.Abp.MessageService.Chat.GroupMessage", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
b.Property<string>("Content")
.IsRequired()
.HasColumnType("longtext CHARACTER SET utf8mb4")
.HasMaxLength(1048576);
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("CreatorId")
.HasColumnType("char(36)");
b.Property<long>("GroupId")
.HasColumnType("bigint");
b.Property<long>("MessageId")
.HasColumnType("bigint");
b.Property<sbyte>("SendState")
.HasColumnType("tinyint");
b.Property<string>("SendUserName")
.IsRequired()
.HasColumnType("varchar(64) CHARACTER SET utf8mb4")
.HasMaxLength(64);
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.Property<int>("Type")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("TenantId", "GroupId");
b.ToTable("AppGroupMessages");
});
modelBuilder.Entity("LINGYUN.Abp.MessageService.Chat.UserChatBlack", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("CreatorId")
.HasColumnType("char(36)");
b.Property<Guid>("ShieldUserId")
.HasColumnType("char(36)");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.Property<Guid>("UserId")
.HasColumnType("char(36)");
b.HasKey("Id");
b.HasIndex("TenantId", "UserId");
b.ToTable("AppUserChatBlacks");
});
modelBuilder.Entity("LINGYUN.Abp.MessageService.Chat.UserChatCard", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
b.Property<int>("Age")
.HasColumnType("int");
b.Property<string>("AvatarUrl")
.HasColumnType("varchar(512) CHARACTER SET utf8mb4")
.HasMaxLength(512);
b.Property<DateTime?>("Birthday")
.HasColumnType("datetime(6)");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnName("ConcurrencyStamp")
.HasColumnType("varchar(40) CHARACTER SET utf8mb4")
.HasMaxLength(40);
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("CreatorId")
.HasColumnName("CreatorId")
.HasColumnType("char(36)");
b.Property<string>("Description")
.HasColumnType("varchar(50) CHARACTER SET utf8mb4")
.HasMaxLength(50);
b.Property<string>("ExtraProperties")
.HasColumnName("ExtraProperties")
.HasColumnType("longtext CHARACTER SET utf8mb4");
b.Property<DateTime?>("LastModificationTime")
.HasColumnName("LastModificationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("LastModifierId")
.HasColumnName("LastModifierId")
.HasColumnType("char(36)");
b.Property<string>("NickName")
.HasColumnType("varchar(256) CHARACTER SET utf8mb4")
.HasMaxLength(256);
b.Property<int>("Sex")
.HasColumnType("int");
b.Property<string>("Sign")
.HasColumnType("varchar(30) CHARACTER SET utf8mb4")
.HasMaxLength(30);
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.Property<Guid>("UserId")
.HasColumnType("char(36)");
b.Property<string>("UserName")
.IsRequired()
.HasColumnType("varchar(256) CHARACTER SET utf8mb4")
.HasMaxLength(256);
b.HasKey("Id");
b.HasIndex("TenantId", "UserId");
b.ToTable("AppUserChatCards");
});
modelBuilder.Entity("LINGYUN.Abp.MessageService.Chat.UserChatGroup", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("CreatorId")
.HasColumnName("CreatorId")
.HasColumnType("char(36)");
b.Property<long>("GroupId")
.HasColumnType("bigint");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.Property<Guid>("UserId")
.HasColumnType("char(36)");
b.HasKey("Id");
b.HasIndex("TenantId", "GroupId", "UserId");
b.ToTable("AppUserChatGroups");
});
modelBuilder.Entity("LINGYUN.Abp.MessageService.Chat.UserChatSetting", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
b.Property<bool>("AllowAddFriend")
.HasColumnType("tinyint(1)");
b.Property<bool>("AllowAnonymous")
.HasColumnType("tinyint(1)");
b.Property<bool>("AllowReceiveMessage")
.HasColumnType("tinyint(1)");
b.Property<bool>("AllowSendMessage")
.HasColumnType("tinyint(1)");
b.Property<bool>("RequireAddFriendValition")
.HasColumnType("tinyint(1)");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.Property<Guid>("UserId")
.HasColumnType("char(36)");
b.HasKey("Id");
b.HasIndex("TenantId", "UserId");
b.ToTable("AppUserChatSettings");
});
modelBuilder.Entity("LINGYUN.Abp.MessageService.Chat.UserGroupCard", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnName("ConcurrencyStamp")
.HasColumnType("varchar(40) CHARACTER SET utf8mb4")
.HasMaxLength(40);
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("CreatorId")
.HasColumnName("CreatorId")
.HasColumnType("char(36)");
b.Property<string>("ExtraProperties")
.HasColumnName("ExtraProperties")
.HasColumnType("longtext CHARACTER SET utf8mb4");
b.Property<bool>("IsAdmin")
.HasColumnType("tinyint(1)");
b.Property<DateTime?>("LastModificationTime")
.HasColumnName("LastModificationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("LastModifierId")
.HasColumnName("LastModifierId")
.HasColumnType("char(36)");
b.Property<string>("NickName")
.HasColumnType("varchar(256) CHARACTER SET utf8mb4")
.HasMaxLength(256);
b.Property<DateTime?>("SilenceEnd")
.HasColumnType("datetime(6)");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.Property<Guid>("UserId")
.HasColumnType("char(36)");
b.HasKey("Id");
b.HasIndex("TenantId", "UserId");
b.ToTable("AppUserGroupCards");
});
modelBuilder.Entity("LINGYUN.Abp.MessageService.Chat.UserMessage", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
b.Property<string>("Content")
.IsRequired()
.HasColumnType("longtext CHARACTER SET utf8mb4")
.HasMaxLength(1048576);
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("CreatorId")
.HasColumnType("char(36)");
b.Property<long>("MessageId")
.HasColumnType("bigint");
b.Property<Guid>("ReceiveUserId")
.HasColumnType("char(36)");
b.Property<sbyte>("SendState")
.HasColumnType("tinyint");
b.Property<string>("SendUserName")
.IsRequired()
.HasColumnType("varchar(64) CHARACTER SET utf8mb4")
.HasMaxLength(64);
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.Property<int>("Type")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("TenantId", "ReceiveUserId");
b.ToTable("AppUserMessages");
});
modelBuilder.Entity("LINGYUN.Abp.MessageService.Chat.UserSpecialFocus", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("CreatorId")
.HasColumnType("char(36)");
b.Property<Guid>("FocusUserId")
.HasColumnType("char(36)");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.Property<Guid>("UserId")
.HasColumnType("char(36)");
b.HasKey("Id");
b.HasIndex("TenantId", "UserId");
b.ToTable("AppUserSpecialFocuss");
});
modelBuilder.Entity("LINGYUN.Abp.MessageService.Notifications.Notification", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime")
.HasColumnType("datetime(6)");
b.Property<DateTime?>("ExpirationTime")
.HasColumnType("datetime(6)");
b.Property<string>("NotificationCateGory")
.IsRequired()
.HasColumnType("varchar(50) CHARACTER SET utf8mb4")
.HasMaxLength(50);
b.Property<string>("NotificationData")
.IsRequired()
.HasColumnType("longtext CHARACTER SET utf8mb4")
.HasMaxLength(1048576);
b.Property<long>("NotificationId")
.HasColumnType("bigint");
b.Property<string>("NotificationName")
.IsRequired()
.HasColumnType("varchar(100) CHARACTER SET utf8mb4")
.HasMaxLength(100);
b.Property<string>("NotificationTypeName")
.IsRequired()
.HasColumnType("varchar(512) CHARACTER SET utf8mb4")
.HasMaxLength(512);
b.Property<sbyte>("Severity")
.HasColumnType("tinyint");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.Property<int>("Type")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("TenantId", "NotificationName");
b.ToTable("AppNotifications");
});
modelBuilder.Entity("LINGYUN.Abp.MessageService.Notifications.UserNotification", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
b.Property<long>("NotificationId")
.HasColumnType("bigint");
b.Property<int>("ReadStatus")
.HasColumnType("int");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.Property<Guid>("UserId")
.HasColumnType("char(36)");
b.HasKey("Id");
b.HasIndex("TenantId", "UserId", "NotificationId")
.HasName("IX_Tenant_User_Notification_Id");
b.ToTable("AppUserNotifications");
});
modelBuilder.Entity("LINGYUN.Abp.MessageService.Subscriptions.UserSubscribe", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime")
.HasColumnType("datetime(6)");
b.Property<string>("NotificationName")
.IsRequired()
.HasColumnType("varchar(100) CHARACTER SET utf8mb4")
.HasMaxLength(100);
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.Property<Guid>("UserId")
.HasColumnType("char(36)");
b.Property<string>("UserName")
.IsRequired()
.ValueGeneratedOnAdd()
.HasColumnType("varchar(128) CHARACTER SET utf8mb4")
.HasMaxLength(128)
.HasDefaultValue("/");
b.HasKey("Id");
b.HasIndex("TenantId", "UserId", "NotificationName")
.IsUnique()
.HasName("IX_Tenant_User_Notification_Name");
b.ToTable("AppUserSubscribes");
});
#pragma warning restore 612, 618
}
}
}

125
aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/Migrations/20201024093309_Add-MemberCard-Entity.cs

@ -1,125 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
namespace LINGYUN.Abp.MessageService.Migrations
{
public partial class AddMemberCardEntity : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "AppChatGroupAdmins");
migrationBuilder.AddColumn<Guid>(
name: "AdminUserId",
table: "AppChatGroups",
nullable: false,
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"));
migrationBuilder.CreateTable(
name: "AppUserChatCards",
columns: table => new
{
Id = table.Column<long>(nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
ExtraProperties = table.Column<string>(nullable: true),
ConcurrencyStamp = table.Column<string>(maxLength: 40, nullable: true),
CreationTime = table.Column<DateTime>(nullable: false),
CreatorId = table.Column<Guid>(nullable: true),
LastModificationTime = table.Column<DateTime>(nullable: true),
LastModifierId = table.Column<Guid>(nullable: true),
TenantId = table.Column<Guid>(nullable: true),
UserId = table.Column<Guid>(nullable: false),
UserName = table.Column<string>(maxLength: 256, nullable: false),
Sex = table.Column<int>(nullable: false),
Sign = table.Column<string>(maxLength: 30, nullable: true),
NickName = table.Column<string>(maxLength: 256, nullable: true),
Description = table.Column<string>(maxLength: 50, nullable: true),
AvatarUrl = table.Column<string>(maxLength: 512, nullable: true),
Birthday = table.Column<DateTime>(nullable: true),
Age = table.Column<int>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AppUserChatCards", x => x.Id);
});
migrationBuilder.CreateTable(
name: "AppUserGroupCards",
columns: table => new
{
Id = table.Column<long>(nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
ExtraProperties = table.Column<string>(nullable: true),
ConcurrencyStamp = table.Column<string>(maxLength: 40, nullable: true),
CreationTime = table.Column<DateTime>(nullable: false),
CreatorId = table.Column<Guid>(nullable: true),
LastModificationTime = table.Column<DateTime>(nullable: true),
LastModifierId = table.Column<Guid>(nullable: true),
TenantId = table.Column<Guid>(nullable: true),
UserId = table.Column<Guid>(nullable: false),
NickName = table.Column<string>(maxLength: 256, nullable: true),
IsAdmin = table.Column<bool>(nullable: false),
SilenceEnd = table.Column<DateTime>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AppUserGroupCards", x => x.Id);
});
migrationBuilder.CreateIndex(
name: "IX_AppUserChatCards_TenantId_UserId",
table: "AppUserChatCards",
columns: new[] { "TenantId", "UserId" });
migrationBuilder.CreateIndex(
name: "IX_AppUserGroupCards_TenantId_UserId",
table: "AppUserGroupCards",
columns: new[] { "TenantId", "UserId" });
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "AppUserChatCards");
migrationBuilder.DropTable(
name: "AppUserGroupCards");
migrationBuilder.DropColumn(
name: "AdminUserId",
table: "AppChatGroups");
migrationBuilder.CreateTable(
name: "AppChatGroupAdmins",
columns: table => new
{
Id = table.Column<long>(type: "bigint", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
AllowAddPeople = table.Column<bool>(type: "tinyint(1)", nullable: false),
AllowDissolveGroup = table.Column<bool>(type: "tinyint(1)", nullable: false),
AllowKickPeople = table.Column<bool>(type: "tinyint(1)", nullable: false),
AllowSendNotice = table.Column<bool>(type: "tinyint(1)", nullable: false),
AllowSilence = table.Column<bool>(type: "tinyint(1)", nullable: false),
CreationTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
CreatorId = table.Column<string>(type: "char(36)", nullable: true),
GroupId = table.Column<long>(type: "bigint", nullable: false),
IsSuperAdmin = table.Column<bool>(type: "tinyint(1)", nullable: false),
LastModificationTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
LastModifierId = table.Column<string>(type: "char(36)", nullable: true),
TenantId = table.Column<string>(type: "char(36)", nullable: true),
UserId = table.Column<string>(type: "char(36)", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AppChatGroupAdmins", x => x.Id);
});
migrationBuilder.CreateIndex(
name: "IX_AppChatGroupAdmins_TenantId_GroupId",
table: "AppChatGroupAdmins",
columns: new[] { "TenantId", "GroupId" });
}
}
}

634
aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/Migrations/20201024114206_Add-UserChatFriend-Entity.Designer.cs

@ -1,634 +0,0 @@
// <auto-generated />
using System;
using LINGYUN.Abp.MessageService.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Volo.Abp.EntityFrameworkCore;
namespace LINGYUN.Abp.MessageService.Migrations
{
[DbContext(typeof(MessageServiceHostMigrationsDbContext))]
[Migration("20201024114206_Add-UserChatFriend-Entity")]
partial class AddUserChatFriendEntity
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.MySql)
.HasAnnotation("ProductVersion", "3.1.7")
.HasAnnotation("Relational:MaxIdentifierLength", 64);
modelBuilder.Entity("LINGYUN.Abp.MessageService.Chat.ChatGroup", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
b.Property<string>("Address")
.HasColumnType("varchar(256) CHARACTER SET utf8mb4")
.HasMaxLength(256);
b.Property<Guid>("AdminUserId")
.HasColumnType("char(36)");
b.Property<bool>("AllowAnonymous")
.HasColumnType("tinyint(1)");
b.Property<bool>("AllowSendMessage")
.HasColumnType("tinyint(1)");
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("CreatorId")
.HasColumnName("CreatorId")
.HasColumnType("char(36)");
b.Property<string>("Description")
.HasColumnType("varchar(128) CHARACTER SET utf8mb4")
.HasMaxLength(128);
b.Property<long>("GroupId")
.HasColumnType("bigint");
b.Property<DateTime?>("LastModificationTime")
.HasColumnName("LastModificationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("LastModifierId")
.HasColumnName("LastModifierId")
.HasColumnType("char(36)");
b.Property<int>("MaxUserCount")
.HasColumnType("int");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("varchar(20) CHARACTER SET utf8mb4")
.HasMaxLength(20);
b.Property<string>("Notice")
.HasColumnType("varchar(64) CHARACTER SET utf8mb4")
.HasMaxLength(64);
b.Property<string>("Tag")
.HasColumnType("varchar(512) CHARACTER SET utf8mb4")
.HasMaxLength(512);
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.HasKey("Id");
b.HasIndex("TenantId", "Name");
b.ToTable("AppChatGroups");
});
modelBuilder.Entity("LINGYUN.Abp.MessageService.Chat.GroupChatBlack", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("CreatorId")
.HasColumnType("char(36)");
b.Property<long>("GroupId")
.HasColumnType("bigint");
b.Property<Guid>("ShieldUserId")
.HasColumnType("char(36)");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.HasKey("Id");
b.HasIndex("TenantId", "GroupId");
b.ToTable("AppGroupChatBlacks");
});
modelBuilder.Entity("LINGYUN.Abp.MessageService.Chat.GroupMessage", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
b.Property<string>("Content")
.IsRequired()
.HasColumnType("longtext CHARACTER SET utf8mb4")
.HasMaxLength(1048576);
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("CreatorId")
.HasColumnType("char(36)");
b.Property<long>("GroupId")
.HasColumnType("bigint");
b.Property<long>("MessageId")
.HasColumnType("bigint");
b.Property<sbyte>("SendState")
.HasColumnType("tinyint");
b.Property<string>("SendUserName")
.IsRequired()
.HasColumnType("varchar(64) CHARACTER SET utf8mb4")
.HasMaxLength(64);
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.Property<int>("Type")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("TenantId", "GroupId");
b.ToTable("AppGroupMessages");
});
modelBuilder.Entity("LINGYUN.Abp.MessageService.Chat.UserChatBlack", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("CreatorId")
.HasColumnType("char(36)");
b.Property<Guid>("ShieldUserId")
.HasColumnType("char(36)");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.Property<Guid>("UserId")
.HasColumnType("char(36)");
b.HasKey("Id");
b.HasIndex("TenantId", "UserId");
b.ToTable("AppUserChatBlacks");
});
modelBuilder.Entity("LINGYUN.Abp.MessageService.Chat.UserChatCard", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
b.Property<int>("Age")
.HasColumnType("int");
b.Property<string>("AvatarUrl")
.HasColumnType("varchar(512) CHARACTER SET utf8mb4")
.HasMaxLength(512);
b.Property<DateTime?>("Birthday")
.HasColumnType("datetime(6)");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnName("ConcurrencyStamp")
.HasColumnType("varchar(40) CHARACTER SET utf8mb4")
.HasMaxLength(40);
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("CreatorId")
.HasColumnName("CreatorId")
.HasColumnType("char(36)");
b.Property<string>("Description")
.HasColumnType("varchar(50) CHARACTER SET utf8mb4")
.HasMaxLength(50);
b.Property<string>("ExtraProperties")
.HasColumnName("ExtraProperties")
.HasColumnType("longtext CHARACTER SET utf8mb4");
b.Property<DateTime?>("LastModificationTime")
.HasColumnName("LastModificationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("LastModifierId")
.HasColumnName("LastModifierId")
.HasColumnType("char(36)");
b.Property<string>("NickName")
.HasColumnType("varchar(256) CHARACTER SET utf8mb4")
.HasMaxLength(256);
b.Property<int>("Sex")
.HasColumnType("int");
b.Property<string>("Sign")
.HasColumnType("varchar(30) CHARACTER SET utf8mb4")
.HasMaxLength(30);
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.Property<Guid>("UserId")
.HasColumnType("char(36)");
b.Property<string>("UserName")
.IsRequired()
.HasColumnType("varchar(256) CHARACTER SET utf8mb4")
.HasMaxLength(256);
b.HasKey("Id");
b.HasIndex("TenantId", "UserId");
b.ToTable("AppUserChatCards");
});
modelBuilder.Entity("LINGYUN.Abp.MessageService.Chat.UserChatFriend", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
b.Property<bool>("Black")
.HasColumnType("tinyint(1)");
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("CreatorId")
.HasColumnName("CreatorId")
.HasColumnType("char(36)");
b.Property<bool>("DontDisturb")
.HasColumnType("tinyint(1)");
b.Property<Guid>("FrientId")
.HasColumnType("char(36)");
b.Property<string>("RemarkName")
.HasColumnType("varchar(256) CHARACTER SET utf8mb4")
.HasMaxLength(256);
b.Property<bool>("SpecialFocus")
.HasColumnType("tinyint(1)");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.Property<Guid>("UserId")
.HasColumnType("char(36)");
b.HasKey("Id");
b.HasIndex("TenantId", "UserId", "FrientId");
b.ToTable("AppUserChatFriends");
});
modelBuilder.Entity("LINGYUN.Abp.MessageService.Chat.UserChatGroup", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("CreatorId")
.HasColumnName("CreatorId")
.HasColumnType("char(36)");
b.Property<long>("GroupId")
.HasColumnType("bigint");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.Property<Guid>("UserId")
.HasColumnType("char(36)");
b.HasKey("Id");
b.HasIndex("TenantId", "GroupId", "UserId");
b.ToTable("AppUserChatGroups");
});
modelBuilder.Entity("LINGYUN.Abp.MessageService.Chat.UserChatSetting", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
b.Property<bool>("AllowAddFriend")
.HasColumnType("tinyint(1)");
b.Property<bool>("AllowAnonymous")
.HasColumnType("tinyint(1)");
b.Property<bool>("AllowReceiveMessage")
.HasColumnType("tinyint(1)");
b.Property<bool>("AllowSendMessage")
.HasColumnType("tinyint(1)");
b.Property<bool>("RequireAddFriendValition")
.HasColumnType("tinyint(1)");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.Property<Guid>("UserId")
.HasColumnType("char(36)");
b.HasKey("Id");
b.HasIndex("TenantId", "UserId");
b.ToTable("AppUserChatSettings");
});
modelBuilder.Entity("LINGYUN.Abp.MessageService.Chat.UserGroupCard", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnName("ConcurrencyStamp")
.HasColumnType("varchar(40) CHARACTER SET utf8mb4")
.HasMaxLength(40);
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("CreatorId")
.HasColumnName("CreatorId")
.HasColumnType("char(36)");
b.Property<string>("ExtraProperties")
.HasColumnName("ExtraProperties")
.HasColumnType("longtext CHARACTER SET utf8mb4");
b.Property<bool>("IsAdmin")
.HasColumnType("tinyint(1)");
b.Property<DateTime?>("LastModificationTime")
.HasColumnName("LastModificationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("LastModifierId")
.HasColumnName("LastModifierId")
.HasColumnType("char(36)");
b.Property<string>("NickName")
.HasColumnType("varchar(256) CHARACTER SET utf8mb4")
.HasMaxLength(256);
b.Property<DateTime?>("SilenceEnd")
.HasColumnType("datetime(6)");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.Property<Guid>("UserId")
.HasColumnType("char(36)");
b.HasKey("Id");
b.HasIndex("TenantId", "UserId");
b.ToTable("AppUserGroupCards");
});
modelBuilder.Entity("LINGYUN.Abp.MessageService.Chat.UserMessage", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
b.Property<string>("Content")
.IsRequired()
.HasColumnType("longtext CHARACTER SET utf8mb4")
.HasMaxLength(1048576);
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("CreatorId")
.HasColumnType("char(36)");
b.Property<long>("MessageId")
.HasColumnType("bigint");
b.Property<Guid>("ReceiveUserId")
.HasColumnType("char(36)");
b.Property<sbyte>("SendState")
.HasColumnType("tinyint");
b.Property<string>("SendUserName")
.IsRequired()
.HasColumnType("varchar(64) CHARACTER SET utf8mb4")
.HasMaxLength(64);
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.Property<int>("Type")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("TenantId", "ReceiveUserId");
b.ToTable("AppUserMessages");
});
modelBuilder.Entity("LINGYUN.Abp.MessageService.Chat.UserSpecialFocus", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("CreatorId")
.HasColumnType("char(36)");
b.Property<Guid>("FocusUserId")
.HasColumnType("char(36)");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.Property<Guid>("UserId")
.HasColumnType("char(36)");
b.HasKey("Id");
b.HasIndex("TenantId", "UserId");
b.ToTable("AppUserSpecialFocuss");
});
modelBuilder.Entity("LINGYUN.Abp.MessageService.Notifications.Notification", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime")
.HasColumnType("datetime(6)");
b.Property<DateTime?>("ExpirationTime")
.HasColumnType("datetime(6)");
b.Property<string>("NotificationCateGory")
.IsRequired()
.HasColumnType("varchar(50) CHARACTER SET utf8mb4")
.HasMaxLength(50);
b.Property<string>("NotificationData")
.IsRequired()
.HasColumnType("longtext CHARACTER SET utf8mb4")
.HasMaxLength(1048576);
b.Property<long>("NotificationId")
.HasColumnType("bigint");
b.Property<string>("NotificationName")
.IsRequired()
.HasColumnType("varchar(100) CHARACTER SET utf8mb4")
.HasMaxLength(100);
b.Property<string>("NotificationTypeName")
.IsRequired()
.HasColumnType("varchar(512) CHARACTER SET utf8mb4")
.HasMaxLength(512);
b.Property<sbyte>("Severity")
.HasColumnType("tinyint");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.Property<int>("Type")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("TenantId", "NotificationName");
b.ToTable("AppNotifications");
});
modelBuilder.Entity("LINGYUN.Abp.MessageService.Notifications.UserNotification", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
b.Property<long>("NotificationId")
.HasColumnType("bigint");
b.Property<int>("ReadStatus")
.HasColumnType("int");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.Property<Guid>("UserId")
.HasColumnType("char(36)");
b.HasKey("Id");
b.HasIndex("TenantId", "UserId", "NotificationId")
.HasName("IX_Tenant_User_Notification_Id");
b.ToTable("AppUserNotifications");
});
modelBuilder.Entity("LINGYUN.Abp.MessageService.Subscriptions.UserSubscribe", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime")
.HasColumnType("datetime(6)");
b.Property<string>("NotificationName")
.IsRequired()
.HasColumnType("varchar(100) CHARACTER SET utf8mb4")
.HasMaxLength(100);
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.Property<Guid>("UserId")
.HasColumnType("char(36)");
b.Property<string>("UserName")
.IsRequired()
.ValueGeneratedOnAdd()
.HasColumnType("varchar(128) CHARACTER SET utf8mb4")
.HasMaxLength(128)
.HasDefaultValue("/");
b.HasKey("Id");
b.HasIndex("TenantId", "UserId", "NotificationName")
.IsUnique()
.HasName("IX_Tenant_User_Notification_Name");
b.ToTable("AppUserSubscribes");
});
#pragma warning restore 612, 618
}
}
}

44
aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/Migrations/20201024114206_Add-UserChatFriend-Entity.cs

@ -1,44 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
namespace LINGYUN.Abp.MessageService.Migrations
{
public partial class AddUserChatFriendEntity : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "AppUserChatFriends",
columns: table => new
{
Id = table.Column<long>(nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
CreationTime = table.Column<DateTime>(nullable: false),
CreatorId = table.Column<Guid>(nullable: true),
TenantId = table.Column<Guid>(nullable: true),
UserId = table.Column<Guid>(nullable: false),
FrientId = table.Column<Guid>(nullable: false),
Black = table.Column<bool>(nullable: false),
DontDisturb = table.Column<bool>(nullable: false),
SpecialFocus = table.Column<bool>(nullable: false),
RemarkName = table.Column<string>(maxLength: 256, nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AppUserChatFriends", x => x.Id);
});
migrationBuilder.CreateIndex(
name: "IX_AppUserChatFriends_TenantId_UserId_FrientId",
table: "AppUserChatFriends",
columns: new[] { "TenantId", "UserId", "FrientId" });
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "AppUserChatFriends");
}
}
}

588
aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/Migrations/20201029102936_Add-UserChatFriend-Column-Description.Designer.cs

@ -1,588 +0,0 @@
// <auto-generated />
using System;
using LINGYUN.Abp.MessageService.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Volo.Abp.EntityFrameworkCore;
namespace LINGYUN.Abp.MessageService.Migrations
{
[DbContext(typeof(MessageServiceHostMigrationsDbContext))]
[Migration("20201029102936_Add-UserChatFriend-Column-Description")]
partial class AddUserChatFriendColumnDescription
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.MySql)
.HasAnnotation("ProductVersion", "3.1.7")
.HasAnnotation("Relational:MaxIdentifierLength", 64);
modelBuilder.Entity("LINGYUN.Abp.MessageService.Chat.UserChatCard", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
b.Property<int>("Age")
.HasColumnType("int");
b.Property<string>("AvatarUrl")
.HasColumnType("varchar(512) CHARACTER SET utf8mb4")
.HasMaxLength(512);
b.Property<DateTime?>("Birthday")
.HasColumnType("datetime(6)");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnName("ConcurrencyStamp")
.HasColumnType("varchar(40) CHARACTER SET utf8mb4")
.HasMaxLength(40);
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("CreatorId")
.HasColumnName("CreatorId")
.HasColumnType("char(36)");
b.Property<string>("Description")
.HasColumnType("varchar(50) CHARACTER SET utf8mb4")
.HasMaxLength(50);
b.Property<string>("ExtraProperties")
.HasColumnName("ExtraProperties")
.HasColumnType("longtext CHARACTER SET utf8mb4");
b.Property<DateTime?>("LastModificationTime")
.HasColumnName("LastModificationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("LastModifierId")
.HasColumnName("LastModifierId")
.HasColumnType("char(36)");
b.Property<string>("NickName")
.HasColumnType("varchar(256) CHARACTER SET utf8mb4")
.HasMaxLength(256);
b.Property<int>("Sex")
.HasColumnType("int");
b.Property<string>("Sign")
.HasColumnType("varchar(30) CHARACTER SET utf8mb4")
.HasMaxLength(30);
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.Property<Guid>("UserId")
.HasColumnType("char(36)");
b.Property<string>("UserName")
.IsRequired()
.HasColumnType("varchar(256) CHARACTER SET utf8mb4")
.HasMaxLength(256);
b.HasKey("Id");
b.HasIndex("TenantId", "UserId");
b.ToTable("AppUserChatCards");
});
modelBuilder.Entity("LINGYUN.Abp.MessageService.Chat.UserChatFriend", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
b.Property<bool>("Black")
.HasColumnType("tinyint(1)");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnName("ConcurrencyStamp")
.HasColumnType("varchar(40) CHARACTER SET utf8mb4")
.HasMaxLength(40);
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("CreatorId")
.HasColumnName("CreatorId")
.HasColumnType("char(36)");
b.Property<string>("Description")
.HasColumnType("varchar(50) CHARACTER SET utf8mb4")
.HasMaxLength(50);
b.Property<bool>("DontDisturb")
.HasColumnType("tinyint(1)");
b.Property<string>("ExtraProperties")
.HasColumnName("ExtraProperties")
.HasColumnType("longtext CHARACTER SET utf8mb4");
b.Property<Guid>("FrientId")
.HasColumnType("char(36)");
b.Property<string>("RemarkName")
.HasColumnType("varchar(256) CHARACTER SET utf8mb4")
.HasMaxLength(256);
b.Property<bool>("SpecialFocus")
.HasColumnType("tinyint(1)");
b.Property<byte>("Status")
.HasColumnType("tinyint unsigned");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.Property<Guid>("UserId")
.HasColumnType("char(36)");
b.HasKey("Id");
b.HasIndex("TenantId", "UserId", "FrientId");
b.ToTable("AppUserChatFriends");
});
modelBuilder.Entity("LINGYUN.Abp.MessageService.Chat.UserChatSetting", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
b.Property<bool>("AllowAddFriend")
.HasColumnType("tinyint(1)");
b.Property<bool>("AllowAnonymous")
.HasColumnType("tinyint(1)");
b.Property<bool>("AllowReceiveMessage")
.HasColumnType("tinyint(1)");
b.Property<bool>("AllowSendMessage")
.HasColumnType("tinyint(1)");
b.Property<bool>("RequireAddFriendValition")
.HasColumnType("tinyint(1)");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.Property<Guid>("UserId")
.HasColumnType("char(36)");
b.HasKey("Id");
b.HasIndex("TenantId", "UserId");
b.ToTable("AppUserChatSettings");
});
modelBuilder.Entity("LINGYUN.Abp.MessageService.Chat.UserMessage", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
b.Property<string>("Content")
.IsRequired()
.HasColumnType("longtext CHARACTER SET utf8mb4")
.HasMaxLength(1048576);
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("CreatorId")
.HasColumnType("char(36)");
b.Property<long>("MessageId")
.HasColumnType("bigint");
b.Property<Guid>("ReceiveUserId")
.HasColumnType("char(36)");
b.Property<sbyte>("SendState")
.HasColumnType("tinyint");
b.Property<string>("SendUserName")
.IsRequired()
.HasColumnType("varchar(64) CHARACTER SET utf8mb4")
.HasMaxLength(64);
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.Property<int>("Type")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("TenantId", "ReceiveUserId");
b.ToTable("AppUserMessages");
});
modelBuilder.Entity("LINGYUN.Abp.MessageService.Group.ChatGroup", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
b.Property<string>("Address")
.HasColumnType("varchar(256) CHARACTER SET utf8mb4")
.HasMaxLength(256);
b.Property<Guid>("AdminUserId")
.HasColumnType("char(36)");
b.Property<bool>("AllowAnonymous")
.HasColumnType("tinyint(1)");
b.Property<bool>("AllowSendMessage")
.HasColumnType("tinyint(1)");
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("CreatorId")
.HasColumnName("CreatorId")
.HasColumnType("char(36)");
b.Property<string>("Description")
.HasColumnType("varchar(128) CHARACTER SET utf8mb4")
.HasMaxLength(128);
b.Property<long>("GroupId")
.HasColumnType("bigint");
b.Property<DateTime?>("LastModificationTime")
.HasColumnName("LastModificationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("LastModifierId")
.HasColumnName("LastModifierId")
.HasColumnType("char(36)");
b.Property<int>("MaxUserCount")
.HasColumnType("int");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("varchar(20) CHARACTER SET utf8mb4")
.HasMaxLength(20);
b.Property<string>("Notice")
.HasColumnType("varchar(64) CHARACTER SET utf8mb4")
.HasMaxLength(64);
b.Property<string>("Tag")
.HasColumnType("varchar(512) CHARACTER SET utf8mb4")
.HasMaxLength(512);
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.HasKey("Id");
b.HasIndex("TenantId", "Name");
b.ToTable("AppChatGroups");
});
modelBuilder.Entity("LINGYUN.Abp.MessageService.Group.GroupChatBlack", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("CreatorId")
.HasColumnType("char(36)");
b.Property<long>("GroupId")
.HasColumnType("bigint");
b.Property<Guid>("ShieldUserId")
.HasColumnType("char(36)");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.HasKey("Id");
b.HasIndex("TenantId", "GroupId");
b.ToTable("AppGroupChatBlacks");
});
modelBuilder.Entity("LINGYUN.Abp.MessageService.Group.GroupMessage", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
b.Property<string>("Content")
.IsRequired()
.HasColumnType("longtext CHARACTER SET utf8mb4")
.HasMaxLength(1048576);
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("CreatorId")
.HasColumnType("char(36)");
b.Property<long>("GroupId")
.HasColumnType("bigint");
b.Property<long>("MessageId")
.HasColumnType("bigint");
b.Property<sbyte>("SendState")
.HasColumnType("tinyint");
b.Property<string>("SendUserName")
.IsRequired()
.HasColumnType("varchar(64) CHARACTER SET utf8mb4")
.HasMaxLength(64);
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.Property<int>("Type")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("TenantId", "GroupId");
b.ToTable("AppGroupMessages");
});
modelBuilder.Entity("LINGYUN.Abp.MessageService.Group.UserChatGroup", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("CreatorId")
.HasColumnName("CreatorId")
.HasColumnType("char(36)");
b.Property<long>("GroupId")
.HasColumnType("bigint");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.Property<Guid>("UserId")
.HasColumnType("char(36)");
b.HasKey("Id");
b.HasIndex("TenantId", "GroupId", "UserId");
b.ToTable("AppUserChatGroups");
});
modelBuilder.Entity("LINGYUN.Abp.MessageService.Group.UserGroupCard", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnName("ConcurrencyStamp")
.HasColumnType("varchar(40) CHARACTER SET utf8mb4")
.HasMaxLength(40);
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("CreatorId")
.HasColumnName("CreatorId")
.HasColumnType("char(36)");
b.Property<string>("ExtraProperties")
.HasColumnName("ExtraProperties")
.HasColumnType("longtext CHARACTER SET utf8mb4");
b.Property<bool>("IsAdmin")
.HasColumnType("tinyint(1)");
b.Property<DateTime?>("LastModificationTime")
.HasColumnName("LastModificationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("LastModifierId")
.HasColumnName("LastModifierId")
.HasColumnType("char(36)");
b.Property<string>("NickName")
.HasColumnType("varchar(256) CHARACTER SET utf8mb4")
.HasMaxLength(256);
b.Property<DateTime?>("SilenceEnd")
.HasColumnType("datetime(6)");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.Property<Guid>("UserId")
.HasColumnType("char(36)");
b.HasKey("Id");
b.HasIndex("TenantId", "UserId");
b.ToTable("AppUserGroupCards");
});
modelBuilder.Entity("LINGYUN.Abp.MessageService.Notifications.Notification", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime")
.HasColumnType("datetime(6)");
b.Property<DateTime?>("ExpirationTime")
.HasColumnType("datetime(6)");
b.Property<string>("NotificationData")
.IsRequired()
.HasColumnType("longtext CHARACTER SET utf8mb4")
.HasMaxLength(1048576);
b.Property<long>("NotificationId")
.HasColumnType("bigint");
b.Property<string>("NotificationName")
.IsRequired()
.HasColumnType("varchar(100) CHARACTER SET utf8mb4")
.HasMaxLength(100);
b.Property<string>("NotificationTypeName")
.IsRequired()
.HasColumnType("varchar(512) CHARACTER SET utf8mb4")
.HasMaxLength(512);
b.Property<sbyte>("Severity")
.HasColumnType("tinyint");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.Property<int>("Type")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("TenantId", "NotificationName");
b.ToTable("AppNotifications");
});
modelBuilder.Entity("LINGYUN.Abp.MessageService.Notifications.UserNotification", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
b.Property<long>("NotificationId")
.HasColumnType("bigint");
b.Property<int>("ReadStatus")
.HasColumnType("int");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.Property<Guid>("UserId")
.HasColumnType("char(36)");
b.HasKey("Id");
b.HasIndex("TenantId", "UserId", "NotificationId")
.HasName("IX_Tenant_User_Notification_Id");
b.ToTable("AppUserNotifications");
});
modelBuilder.Entity("LINGYUN.Abp.MessageService.Subscriptions.UserSubscribe", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime")
.HasColumnType("datetime(6)");
b.Property<string>("NotificationName")
.IsRequired()
.HasColumnType("varchar(100) CHARACTER SET utf8mb4")
.HasMaxLength(100);
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.Property<Guid>("UserId")
.HasColumnType("char(36)");
b.Property<string>("UserName")
.IsRequired()
.ValueGeneratedOnAdd()
.HasColumnType("varchar(128) CHARACTER SET utf8mb4")
.HasMaxLength(128)
.HasDefaultValue("/");
b.HasKey("Id");
b.HasIndex("TenantId", "UserId", "NotificationName")
.IsUnique()
.HasName("IX_Tenant_User_Notification_Name");
b.ToTable("AppUserSubscribes");
});
#pragma warning restore 612, 618
}
}
}

116
aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/Migrations/20201029102936_Add-UserChatFriend-Column-Description.cs

@ -1,116 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
namespace LINGYUN.Abp.MessageService.Migrations
{
public partial class AddUserChatFriendColumnDescription : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "AppUserChatBlacks");
migrationBuilder.DropTable(
name: "AppUserSpecialFocuss");
migrationBuilder.DropColumn(
name: "NotificationCateGory",
table: "AppNotifications");
migrationBuilder.AddColumn<string>(
name: "ConcurrencyStamp",
table: "AppUserChatFriends",
maxLength: 40,
nullable: true);
migrationBuilder.AddColumn<string>(
name: "Description",
table: "AppUserChatFriends",
maxLength: 50,
nullable: true);
migrationBuilder.AddColumn<string>(
name: "ExtraProperties",
table: "AppUserChatFriends",
nullable: true);
migrationBuilder.AddColumn<byte>(
name: "Status",
table: "AppUserChatFriends",
nullable: false,
defaultValue: (byte)0);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "ConcurrencyStamp",
table: "AppUserChatFriends");
migrationBuilder.DropColumn(
name: "Description",
table: "AppUserChatFriends");
migrationBuilder.DropColumn(
name: "ExtraProperties",
table: "AppUserChatFriends");
migrationBuilder.DropColumn(
name: "Status",
table: "AppUserChatFriends");
migrationBuilder.AddColumn<string>(
name: "NotificationCateGory",
table: "AppNotifications",
type: "varchar(50) CHARACTER SET utf8mb4",
maxLength: 50,
nullable: false,
defaultValue: "");
migrationBuilder.CreateTable(
name: "AppUserChatBlacks",
columns: table => new
{
Id = table.Column<long>(type: "bigint", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
CreationTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
CreatorId = table.Column<Guid>(type: "char(36)", nullable: true),
ShieldUserId = table.Column<Guid>(type: "char(36)", nullable: false),
TenantId = table.Column<Guid>(type: "char(36)", nullable: true),
UserId = table.Column<Guid>(type: "char(36)", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AppUserChatBlacks", x => x.Id);
});
migrationBuilder.CreateTable(
name: "AppUserSpecialFocuss",
columns: table => new
{
Id = table.Column<long>(type: "bigint", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
CreationTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
CreatorId = table.Column<Guid>(type: "char(36)", nullable: true),
FocusUserId = table.Column<Guid>(type: "char(36)", nullable: false),
TenantId = table.Column<Guid>(type: "char(36)", nullable: true),
UserId = table.Column<Guid>(type: "char(36)", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AppUserSpecialFocuss", x => x.Id);
});
migrationBuilder.CreateIndex(
name: "IX_AppUserChatBlacks_TenantId_UserId",
table: "AppUserChatBlacks",
columns: new[] { "TenantId", "UserId" });
migrationBuilder.CreateIndex(
name: "IX_AppUserSpecialFocuss_TenantId_UserId",
table: "AppUserSpecialFocuss",
columns: new[] { "TenantId", "UserId" });
}
}
}

51
aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/Migrations/20201030032219_Based-Message-Entity-To-AggregateRoot.cs

@ -1,51 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace LINGYUN.Abp.MessageService.Migrations
{
public partial class BasedMessageEntityToAggregateRoot : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "ConcurrencyStamp",
table: "AppUserMessages",
maxLength: 40,
nullable: true);
migrationBuilder.AddColumn<string>(
name: "ExtraProperties",
table: "AppUserMessages",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "ConcurrencyStamp",
table: "AppGroupMessages",
maxLength: 40,
nullable: true);
migrationBuilder.AddColumn<string>(
name: "ExtraProperties",
table: "AppGroupMessages",
nullable: true);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "ConcurrencyStamp",
table: "AppUserMessages");
migrationBuilder.DropColumn(
name: "ExtraProperties",
table: "AppUserMessages");
migrationBuilder.DropColumn(
name: "ConcurrencyStamp",
table: "AppGroupMessages");
migrationBuilder.DropColumn(
name: "ExtraProperties",
table: "AppGroupMessages");
}
}
}

1224
aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/Migrations/20201030032219_Based-Message-Entity-To-AggregateRoot.Designer.cs → aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/Migrations/20211030131449_Re-Initlize-Db-Migration.Designer.cs

File diff suppressed because it is too large

415
aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/Migrations/20211030131449_Re-Initlize-Db-Migration.cs

@ -0,0 +1,415 @@
using System;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
namespace LINGYUN.Abp.MessageService.Migrations
{
public partial class ReInitlizeDbMigration : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterDatabase()
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "AppChatGroups",
columns: table => new
{
Id = table.Column<long>(type: "bigint", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
TenantId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
AdminUserId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
GroupId = table.Column<long>(type: "bigint", nullable: false),
Name = table.Column<string>(type: "varchar(20)", maxLength: 20, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Tag = table.Column<string>(type: "varchar(512)", maxLength: 512, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Address = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Notice = table.Column<string>(type: "varchar(64)", maxLength: 64, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
MaxUserCount = table.Column<int>(type: "int", nullable: false),
AllowAnonymous = table.Column<bool>(type: "tinyint(1)", nullable: false),
AllowSendMessage = table.Column<bool>(type: "tinyint(1)", nullable: false),
Description = table.Column<string>(type: "varchar(128)", maxLength: 128, 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_AppChatGroups", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "AppGroupChatBlacks",
columns: table => new
{
Id = table.Column<long>(type: "bigint", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
TenantId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
GroupId = table.Column<long>(type: "bigint", nullable: false),
ShieldUserId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
CreationTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
CreatorId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci")
},
constraints: table =>
{
table.PrimaryKey("PK_AppGroupChatBlacks", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "AppGroupMessages",
columns: table => new
{
Id = table.Column<long>(type: "bigint", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
GroupId = table.Column<long>(type: "bigint", nullable: false),
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"),
TenantId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
MessageId = table.Column<long>(type: "bigint", nullable: false),
SendUserName = table.Column<string>(type: "varchar(64)", maxLength: 64, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Content = table.Column<string>(type: "longtext", maxLength: 1048576, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Type = table.Column<int>(type: "int", nullable: false),
SendState = table.Column<sbyte>(type: "tinyint", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AppGroupMessages", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "AppNotifications",
columns: table => new
{
Id = table.Column<long>(type: "bigint", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
TenantId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
Severity = table.Column<sbyte>(type: "tinyint", nullable: false),
Type = table.Column<int>(type: "int", nullable: false),
NotificationId = table.Column<long>(type: "bigint", nullable: false),
NotificationName = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
NotificationData = table.Column<string>(type: "longtext", maxLength: 1048576, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
NotificationTypeName = table.Column<string>(type: "varchar(512)", maxLength: 512, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
ExpirationTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
CreationTime = table.Column<DateTime>(type: "datetime(6)", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AppNotifications", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "AppUserChatCards",
columns: table => new
{
Id = table.Column<long>(type: "bigint", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
TenantId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
UserId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
UserName = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Sex = table.Column<int>(type: "int", nullable: false),
Sign = table.Column<string>(type: "varchar(30)", maxLength: 30, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
NickName = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Description = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
AvatarUrl = table.Column<string>(type: "varchar(512)", maxLength: 512, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Birthday = table.Column<DateTime>(type: "datetime(6)", nullable: true),
Age = table.Column<int>(type: "int", nullable: false),
ExtraProperties = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
ConcurrencyStamp = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
CreationTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
CreatorId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
LastModificationTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
LastModifierId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci")
},
constraints: table =>
{
table.PrimaryKey("PK_AppUserChatCards", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "AppUserChatFriends",
columns: table => new
{
Id = table.Column<long>(type: "bigint", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
TenantId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
UserId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
FrientId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Black = table.Column<bool>(type: "tinyint(1)", nullable: false),
DontDisturb = table.Column<bool>(type: "tinyint(1)", nullable: false),
SpecialFocus = table.Column<bool>(type: "tinyint(1)", nullable: false),
RemarkName = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Description = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Status = table.Column<byte>(type: "tinyint unsigned", nullable: false),
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")
},
constraints: table =>
{
table.PrimaryKey("PK_AppUserChatFriends", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "AppUserChatGroups",
columns: table => new
{
Id = table.Column<long>(type: "bigint", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
TenantId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
UserId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
GroupId = table.Column<long>(type: "bigint", nullable: false),
CreationTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
CreatorId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci")
},
constraints: table =>
{
table.PrimaryKey("PK_AppUserChatGroups", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "AppUserChatSettings",
columns: table => new
{
Id = table.Column<long>(type: "bigint", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
TenantId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
UserId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
AllowAnonymous = table.Column<bool>(type: "tinyint(1)", nullable: false),
AllowAddFriend = table.Column<bool>(type: "tinyint(1)", nullable: false),
RequireAddFriendValition = table.Column<bool>(type: "tinyint(1)", nullable: false),
AllowReceiveMessage = table.Column<bool>(type: "tinyint(1)", nullable: false),
AllowSendMessage = table.Column<bool>(type: "tinyint(1)", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AppUserChatSettings", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "AppUserGroupCards",
columns: table => new
{
Id = table.Column<long>(type: "bigint", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
TenantId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
UserId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
NickName = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
IsAdmin = table.Column<bool>(type: "tinyint(1)", nullable: false),
SilenceEnd = table.Column<DateTime>(type: "datetime(6)", nullable: true),
ExtraProperties = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
ConcurrencyStamp = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
CreationTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
CreatorId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
LastModificationTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
LastModifierId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci")
},
constraints: table =>
{
table.PrimaryKey("PK_AppUserGroupCards", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "AppUserMessages",
columns: table => new
{
Id = table.Column<long>(type: "bigint", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
ReceiveUserId = table.Column<Guid>(type: "char(36)", nullable: false, 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"),
TenantId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
MessageId = table.Column<long>(type: "bigint", nullable: false),
SendUserName = table.Column<string>(type: "varchar(64)", maxLength: 64, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Content = table.Column<string>(type: "longtext", maxLength: 1048576, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Type = table.Column<int>(type: "int", nullable: false),
SendState = table.Column<sbyte>(type: "tinyint", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AppUserMessages", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "AppUserNotifications",
columns: table => new
{
Id = table.Column<long>(type: "bigint", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
TenantId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
UserId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
NotificationId = table.Column<long>(type: "bigint", nullable: false),
ReadStatus = table.Column<int>(type: "int", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AppUserNotifications", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "AppUserSubscribes",
columns: table => new
{
Id = table.Column<long>(type: "bigint", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
UserId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
UserName = table.Column<string>(type: "varchar(128)", maxLength: 128, nullable: false, defaultValue: "/")
.Annotation("MySql:CharSet", "utf8mb4"),
TenantId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
CreationTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
NotificationName = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4")
},
constraints: table =>
{
table.PrimaryKey("PK_AppUserSubscribes", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateIndex(
name: "IX_AppChatGroups_TenantId_Name",
table: "AppChatGroups",
columns: new[] { "TenantId", "Name" });
migrationBuilder.CreateIndex(
name: "IX_AppGroupChatBlacks_TenantId_GroupId",
table: "AppGroupChatBlacks",
columns: new[] { "TenantId", "GroupId" });
migrationBuilder.CreateIndex(
name: "IX_AppGroupMessages_TenantId_GroupId",
table: "AppGroupMessages",
columns: new[] { "TenantId", "GroupId" });
migrationBuilder.CreateIndex(
name: "IX_AppNotifications_TenantId_NotificationName",
table: "AppNotifications",
columns: new[] { "TenantId", "NotificationName" });
migrationBuilder.CreateIndex(
name: "IX_AppUserChatCards_TenantId_UserId",
table: "AppUserChatCards",
columns: new[] { "TenantId", "UserId" });
migrationBuilder.CreateIndex(
name: "IX_AppUserChatFriends_TenantId_UserId_FrientId",
table: "AppUserChatFriends",
columns: new[] { "TenantId", "UserId", "FrientId" });
migrationBuilder.CreateIndex(
name: "IX_AppUserChatGroups_TenantId_GroupId_UserId",
table: "AppUserChatGroups",
columns: new[] { "TenantId", "GroupId", "UserId" });
migrationBuilder.CreateIndex(
name: "IX_AppUserChatSettings_TenantId_UserId",
table: "AppUserChatSettings",
columns: new[] { "TenantId", "UserId" });
migrationBuilder.CreateIndex(
name: "IX_AppUserGroupCards_TenantId_UserId",
table: "AppUserGroupCards",
columns: new[] { "TenantId", "UserId" });
migrationBuilder.CreateIndex(
name: "IX_AppUserMessages_TenantId_ReceiveUserId",
table: "AppUserMessages",
columns: new[] { "TenantId", "ReceiveUserId" });
migrationBuilder.CreateIndex(
name: "IX_Tenant_User_Notification_Id",
table: "AppUserNotifications",
columns: new[] { "TenantId", "UserId", "NotificationId" });
migrationBuilder.CreateIndex(
name: "IX_Tenant_User_Notification_Name",
table: "AppUserSubscribes",
columns: new[] { "TenantId", "UserId", "NotificationName" },
unique: true);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "AppChatGroups");
migrationBuilder.DropTable(
name: "AppGroupChatBlacks");
migrationBuilder.DropTable(
name: "AppGroupMessages");
migrationBuilder.DropTable(
name: "AppNotifications");
migrationBuilder.DropTable(
name: "AppUserChatCards");
migrationBuilder.DropTable(
name: "AppUserChatFriends");
migrationBuilder.DropTable(
name: "AppUserChatGroups");
migrationBuilder.DropTable(
name: "AppUserChatSettings");
migrationBuilder.DropTable(
name: "AppUserGroupCards");
migrationBuilder.DropTable(
name: "AppUserMessages");
migrationBuilder.DropTable(
name: "AppUserNotifications");
migrationBuilder.DropTable(
name: "AppUserSubscribes");
}
}
}

1220
aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/Migrations/MessageServiceHostMigrationsDbContextModelSnapshot.cs

File diff suppressed because it is too large

4
aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/appsettings.Development.json

@ -69,7 +69,7 @@
},
"AuditLogging": {
"Elasticsearch": {
"IndexPrefix": "lingyun.abp.auditing"
"IndexPrefix": "abp.dev.auditing"
}
},
"Elasticsearch": {
@ -100,7 +100,7 @@
"Name": "Elasticsearch",
"Args": {
"nodeUris": "http://localhost:9200",
"indexFormat": "lingyun.abp.logging-{0:yyyy.MM.dd}",
"indexFormat": "abp.dev.logging-{0:yyyy.MM.dd}",
"autoRegisterTemplate": true,
"autoRegisterTemplateVersion": "ESv7"
}

2
aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/AppPlatformHttpApiHostModule.cs

@ -1,5 +1,6 @@
using LINGYUN.Abp.AspNetCore.HttpOverrides;
using LINGYUN.Abp.AuditLogging.Elasticsearch;
using LINGYUN.Abp.Data.DbMigrator;
using LINGYUN.Abp.EventBus.CAP;
using LINGYUN.Abp.ExceptionHandling.Emailing;
using LINGYUN.Abp.Features.LimitValidation.Redis;
@ -55,6 +56,7 @@ namespace LINGYUN.Platform
typeof(AbpSettingManagementEntityFrameworkCoreModule),
typeof(AbpPermissionManagementEntityFrameworkCoreModule),
typeof(AbpLocalizationManagementEntityFrameworkCoreModule),
typeof(AbpDataDbMigratorModule),
typeof(AbpAspNetCoreAuthenticationJwtBearerModule),
typeof(AbpNotificationModule),
typeof(AbpEmailingExceptionHandlingModule),

47
aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/EventBus/Handlers/TenantSynchronizer.cs

@ -1,8 +1,14 @@
using LINGYUN.Abp.MultiTenancy;
using LINGYUN.Abp.Data.DbMigrator;
using LINGYUN.Abp.MultiTenancy;
using LINGYUN.Platform.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Logging;
using System.Threading.Tasks;
using Volo.Abp.Data;
using Volo.Abp.DependencyInjection;
using Volo.Abp.EventBus.Distributed;
using Volo.Abp.MultiTenancy;
using Volo.Abp.Uow;
namespace LINGYUN.Platform.EventBus.Handlers
{
@ -11,10 +17,25 @@ namespace LINGYUN.Platform.EventBus.Handlers
ITransientDependency
{
protected IDataSeeder DataSeeder { get; }
protected ICurrentTenant CurrentTenant { get; }
protected IDbSchemaMigrator DbSchemaMigrator { get; }
protected IUnitOfWorkManager UnitOfWorkManager { get; }
public TenantSynchronizer(IDataSeeder dataSeeder)
protected ILogger<TenantSynchronizer> Logger { get; }
public TenantSynchronizer(
IDataSeeder dataSeeder,
ICurrentTenant currentTenant,
IDbSchemaMigrator dbSchemaMigrator,
IUnitOfWorkManager unitOfWorkManager,
ILogger<TenantSynchronizer> logger)
{
DataSeeder = dataSeeder;
CurrentTenant = currentTenant;
DbSchemaMigrator = dbSchemaMigrator;
UnitOfWorkManager = unitOfWorkManager;
Logger = logger;
}
/// <summary>
@ -24,8 +45,26 @@ namespace LINGYUN.Platform.EventBus.Handlers
/// <returns></returns>
public virtual async Task HandleEventAsync(CreateEventData eventData)
{
await DataSeeder.SeedAsync(
new DataSeedContext(eventData.Id));
using (var unitOfWork = UnitOfWorkManager.Begin())
{
using (CurrentTenant.Change(eventData.Id, eventData.Name))
{
Logger.LogInformation("Migrating the new tenant database with platform...");
// 迁移租户数据
await DbSchemaMigrator.MigrateAsync<PlatformHttpApiHostMigrationsDbContext>(
(connectionString, builder) =>
{
builder.UseMySql(connectionString, ServerVersion.AutoDetect(connectionString));
return new PlatformHttpApiHostMigrationsDbContext(builder.Options);
});
Logger.LogInformation("Migrated the new tenant database with platform.");
await DataSeeder.SeedAsync(new DataSeedContext(eventData.Id));
await unitOfWork.SaveChangesAsync();
}
}
}
}
}

1
aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/LINGYUN.Platform.HttpApi.Host.csproj

@ -55,6 +55,7 @@
<ItemGroup>
<ProjectReference Include="..\..\..\modules\auditing\LINGYUN.Abp.AuditLogging.Elasticsearch\LINGYUN.Abp.AuditLogging.Elasticsearch.csproj" />
<ProjectReference Include="..\..\..\modules\common\LINGYUN.Abp.AspNetCore.HttpOverrides\LINGYUN.Abp.AspNetCore.HttpOverrides.csproj" />
<ProjectReference Include="..\..\..\modules\common\LINGYUN.Abp.Data.DbMigrator\LINGYUN.Abp.Data.DbMigrator.csproj" />
<ProjectReference Include="..\..\..\modules\common\LINGYUN.Abp.EventBus.CAP\LINGYUN.Abp.EventBus.CAP.csproj" />
<ProjectReference Include="..\..\..\modules\common\LINGYUN.Abp.ExceptionHandling.Emailing\LINGYUN.Abp.ExceptionHandling.Emailing.csproj" />
<ProjectReference Include="..\..\..\modules\common\LINGYUN.Abp.Features.LimitValidation.Redis.Client\LINGYUN.Abp.Features.LimitValidation.Redis.Client.csproj" />

397
aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/Migrations/20200723133732_Add-Platform-Module.Designer.cs

@ -1,397 +0,0 @@
// <auto-generated />
using System;
using LINGYUN.Platform.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Volo.Abp.EntityFrameworkCore;
namespace LINGYUN.Platform.Migrations
{
[DbContext(typeof(PlatformHttpApiHostMigrationsDbContext))]
[Migration("20200723133732_Add-Platform-Module")]
partial class AddPlatformModule
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.MySql)
.HasAnnotation("ProductVersion", "3.1.5")
.HasAnnotation("Relational:MaxIdentifierLength", 64);
modelBuilder.Entity("LINGYUN.Platform.Routes.RoleRoute", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("CreatorId")
.HasColumnType("char(36)");
b.Property<Guid?>("DeleterId")
.HasColumnType("char(36)");
b.Property<DateTime?>("DeletionTime")
.HasColumnType("datetime(6)");
b.Property<bool>("IsDeleted")
.HasColumnType("tinyint(1)");
b.Property<DateTime?>("LastModificationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("LastModifierId")
.HasColumnType("char(36)");
b.Property<string>("RoleName")
.IsRequired()
.HasColumnName("RoleName")
.HasColumnType("varchar(256) CHARACTER SET utf8mb4")
.HasMaxLength(256);
b.Property<Guid>("RouteId")
.HasColumnType("char(36)");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.HasKey("Id");
b.HasIndex("RoleName", "RouteId");
b.ToTable("AppPlatformRoleRoute");
});
modelBuilder.Entity("LINGYUN.Platform.Routes.Route", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<bool>("AlwaysShow")
.HasColumnType("tinyint(1)");
b.Property<string>("Code")
.IsRequired()
.HasColumnName("Code")
.HasColumnType("varchar(95) CHARACTER SET utf8mb4")
.HasMaxLength(95);
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnName("ConcurrencyStamp")
.HasColumnType("varchar(40) CHARACTER SET utf8mb4")
.HasMaxLength(40);
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("CreatorId")
.HasColumnName("CreatorId")
.HasColumnType("char(36)");
b.Property<Guid?>("DeleterId")
.HasColumnName("DeleterId")
.HasColumnType("char(36)");
b.Property<DateTime?>("DeletionTime")
.HasColumnName("DeletionTime")
.HasColumnType("datetime(6)");
b.Property<string>("Description")
.HasColumnName("Description")
.HasColumnType("varchar(255) CHARACTER SET utf8mb4")
.HasMaxLength(255);
b.Property<string>("DisplayName")
.IsRequired()
.HasColumnName("DisplayName")
.HasColumnType("varchar(128) CHARACTER SET utf8mb4")
.HasMaxLength(128);
b.Property<string>("ExtraProperties")
.HasColumnName("ExtraProperties")
.HasColumnType("longtext CHARACTER SET utf8mb4");
b.Property<string>("FullName")
.HasColumnName("FullName")
.HasColumnType("varchar(128) CHARACTER SET utf8mb4")
.HasMaxLength(128);
b.Property<string>("Icon")
.HasColumnName("Icon")
.HasColumnType("varchar(128) CHARACTER SET utf8mb4")
.HasMaxLength(128);
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnName("IsDeleted")
.HasColumnType("tinyint(1)")
.HasDefaultValue(false);
b.Property<bool>("IsMenu")
.HasColumnType("tinyint(1)");
b.Property<bool>("IsPublic")
.HasColumnType("tinyint(1)");
b.Property<bool>("IsSideBar")
.HasColumnType("tinyint(1)");
b.Property<bool>("IsStatic")
.HasColumnType("tinyint(1)");
b.Property<bool>("IsToolBar")
.HasColumnType("tinyint(1)");
b.Property<DateTime?>("LastModificationTime")
.HasColumnName("LastModificationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("LastModifierId")
.HasColumnName("LastModifierId")
.HasColumnType("char(36)");
b.Property<string>("LinkUrl")
.IsRequired()
.HasColumnName("LinkUrl")
.HasColumnType("varchar(255) CHARACTER SET utf8mb4")
.HasMaxLength(255);
b.Property<string>("Name")
.IsRequired()
.HasColumnName("Name")
.HasColumnType("varchar(64) CHARACTER SET utf8mb4")
.HasMaxLength(64);
b.Property<Guid?>("ParentId")
.HasColumnType("char(36)");
b.Property<int>("PlatformType")
.HasColumnType("int");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.HasKey("Id");
b.HasIndex("Code");
b.HasIndex("ParentId");
b.ToTable("AppPlatformRoute");
});
modelBuilder.Entity("LINGYUN.Platform.Routes.UserRoute", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("CreatorId")
.HasColumnType("char(36)");
b.Property<Guid?>("DeleterId")
.HasColumnType("char(36)");
b.Property<DateTime?>("DeletionTime")
.HasColumnType("datetime(6)");
b.Property<bool>("IsDeleted")
.HasColumnType("tinyint(1)");
b.Property<DateTime?>("LastModificationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("LastModifierId")
.HasColumnType("char(36)");
b.Property<Guid>("RouteId")
.HasColumnType("char(36)");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.Property<Guid>("UserId")
.HasColumnType("char(36)");
b.HasKey("Id");
b.HasIndex("UserId", "RouteId");
b.ToTable("AppPlatformUserRoute");
});
modelBuilder.Entity("LINGYUN.Platform.Versions.AppVersion", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnName("ConcurrencyStamp")
.HasColumnType("varchar(40) CHARACTER SET utf8mb4")
.HasMaxLength(40);
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("CreatorId")
.HasColumnName("CreatorId")
.HasColumnType("char(36)");
b.Property<Guid?>("DeleterId")
.HasColumnName("DeleterId")
.HasColumnType("char(36)");
b.Property<DateTime?>("DeletionTime")
.HasColumnName("DeletionTime")
.HasColumnType("datetime(6)");
b.Property<string>("Description")
.HasColumnName("Description")
.HasColumnType("longtext CHARACTER SET utf8mb4")
.HasMaxLength(2048);
b.Property<string>("ExtraProperties")
.HasColumnName("ExtraProperties")
.HasColumnType("longtext CHARACTER SET utf8mb4");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnName("IsDeleted")
.HasColumnType("tinyint(1)")
.HasDefaultValue(false);
b.Property<DateTime?>("LastModificationTime")
.HasColumnName("LastModificationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("LastModifierId")
.HasColumnName("LastModifierId")
.HasColumnType("char(36)");
b.Property<int>("Level")
.HasColumnType("int");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.Property<string>("Title")
.IsRequired()
.HasColumnName("Title")
.HasColumnType("varchar(50) CHARACTER SET utf8mb4")
.HasMaxLength(50);
b.Property<string>("Version")
.IsRequired()
.HasColumnName("Version")
.HasColumnType("varchar(20) CHARACTER SET utf8mb4")
.HasMaxLength(20);
b.HasKey("Id");
b.HasIndex("Version");
b.ToTable("AppPlatformVersion");
});
modelBuilder.Entity("LINGYUN.Platform.Versions.VersionFile", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<Guid>("AppVersionId")
.HasColumnType("char(36)");
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("CreatorId")
.HasColumnName("CreatorId")
.HasColumnType("char(36)");
b.Property<int>("DownloadCount")
.HasColumnType("int");
b.Property<int>("FileType")
.HasColumnType("int");
b.Property<DateTime?>("LastModificationTime")
.HasColumnName("LastModificationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("LastModifierId")
.HasColumnName("LastModifierId")
.HasColumnType("char(36)");
b.Property<string>("Name")
.IsRequired()
.HasColumnName("Name")
.HasColumnType("varchar(255) CHARACTER SET utf8mb4")
.HasMaxLength(255);
b.Property<string>("SHA256")
.IsRequired()
.HasColumnName("SHA256")
.HasColumnType("varchar(32) CHARACTER SET utf8mb4")
.HasMaxLength(32);
b.Property<long>("Size")
.HasColumnType("bigint");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.Property<string>("Version")
.IsRequired()
.HasColumnName("Version")
.HasColumnType("varchar(20) CHARACTER SET utf8mb4")
.HasMaxLength(20);
b.HasKey("Id");
b.HasIndex("AppVersionId");
b.HasIndex("Name", "Version");
b.ToTable("AppPlatformVersionFile");
});
modelBuilder.Entity("LINGYUN.Platform.Routes.Route", b =>
{
b.HasOne("LINGYUN.Platform.Routes.Route", null)
.WithMany()
.HasForeignKey("ParentId");
});
modelBuilder.Entity("LINGYUN.Platform.Versions.VersionFile", b =>
{
b.HasOne("LINGYUN.Platform.Versions.AppVersion", "AppVersion")
.WithMany("Files")
.HasForeignKey("AppVersionId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
#pragma warning restore 612, 618
}
}
}

206
aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/Migrations/20200723133732_Add-Platform-Module.cs

@ -1,206 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
namespace LINGYUN.Platform.Migrations
{
public partial class AddPlatformModule : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "AppPlatformRoleRoute",
columns: table => new
{
Id = table.Column<int>(nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
CreationTime = table.Column<DateTime>(nullable: false),
CreatorId = table.Column<Guid>(nullable: true),
LastModificationTime = table.Column<DateTime>(nullable: true),
LastModifierId = table.Column<Guid>(nullable: true),
IsDeleted = table.Column<bool>(nullable: false),
DeleterId = table.Column<Guid>(nullable: true),
DeletionTime = table.Column<DateTime>(nullable: true),
TenantId = table.Column<Guid>(nullable: true),
RoleName = table.Column<string>(maxLength: 256, nullable: false),
RouteId = table.Column<Guid>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AppPlatformRoleRoute", x => x.Id);
});
migrationBuilder.CreateTable(
name: "AppPlatformRoute",
columns: table => new
{
Id = table.Column<Guid>(nullable: false),
ExtraProperties = table.Column<string>(nullable: true),
ConcurrencyStamp = table.Column<string>(maxLength: 40, nullable: true),
CreationTime = table.Column<DateTime>(nullable: false),
CreatorId = table.Column<Guid>(nullable: true),
LastModificationTime = table.Column<DateTime>(nullable: true),
LastModifierId = table.Column<Guid>(nullable: true),
IsDeleted = table.Column<bool>(nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(nullable: true),
DeletionTime = table.Column<DateTime>(nullable: true),
TenantId = table.Column<Guid>(nullable: true),
Code = table.Column<string>(maxLength: 95, nullable: false),
Name = table.Column<string>(maxLength: 64, nullable: false),
FullName = table.Column<string>(maxLength: 128, nullable: true),
DisplayName = table.Column<string>(maxLength: 128, nullable: false),
PlatformType = table.Column<int>(nullable: false),
Description = table.Column<string>(maxLength: 255, nullable: true),
Icon = table.Column<string>(maxLength: 128, nullable: true),
LinkUrl = table.Column<string>(maxLength: 255, nullable: false),
IsMenu = table.Column<bool>(nullable: false),
IsToolBar = table.Column<bool>(nullable: false),
IsSideBar = table.Column<bool>(nullable: false),
IsPublic = table.Column<bool>(nullable: false),
IsStatic = table.Column<bool>(nullable: false),
AlwaysShow = table.Column<bool>(nullable: false),
ParentId = table.Column<Guid>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AppPlatformRoute", x => x.Id);
table.ForeignKey(
name: "FK_AppPlatformRoute_AppPlatformRoute_ParentId",
column: x => x.ParentId,
principalTable: "AppPlatformRoute",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateTable(
name: "AppPlatformUserRoute",
columns: table => new
{
Id = table.Column<int>(nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
CreationTime = table.Column<DateTime>(nullable: false),
CreatorId = table.Column<Guid>(nullable: true),
LastModificationTime = table.Column<DateTime>(nullable: true),
LastModifierId = table.Column<Guid>(nullable: true),
IsDeleted = table.Column<bool>(nullable: false),
DeleterId = table.Column<Guid>(nullable: true),
DeletionTime = table.Column<DateTime>(nullable: true),
TenantId = table.Column<Guid>(nullable: true),
UserId = table.Column<Guid>(nullable: false),
RouteId = table.Column<Guid>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AppPlatformUserRoute", x => x.Id);
});
migrationBuilder.CreateTable(
name: "AppPlatformVersion",
columns: table => new
{
Id = table.Column<Guid>(nullable: false),
ExtraProperties = table.Column<string>(nullable: true),
ConcurrencyStamp = table.Column<string>(maxLength: 40, nullable: true),
CreationTime = table.Column<DateTime>(nullable: false),
CreatorId = table.Column<Guid>(nullable: true),
LastModificationTime = table.Column<DateTime>(nullable: true),
LastModifierId = table.Column<Guid>(nullable: true),
IsDeleted = table.Column<bool>(nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(nullable: true),
DeletionTime = table.Column<DateTime>(nullable: true),
TenantId = table.Column<Guid>(nullable: true),
Title = table.Column<string>(maxLength: 50, nullable: false),
Version = table.Column<string>(maxLength: 20, nullable: false),
Description = table.Column<string>(maxLength: 2048, nullable: true),
Level = table.Column<int>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AppPlatformVersion", x => x.Id);
});
migrationBuilder.CreateTable(
name: "AppPlatformVersionFile",
columns: table => new
{
Id = table.Column<int>(nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
CreationTime = table.Column<DateTime>(nullable: false),
CreatorId = table.Column<Guid>(nullable: true),
LastModificationTime = table.Column<DateTime>(nullable: true),
LastModifierId = table.Column<Guid>(nullable: true),
TenantId = table.Column<Guid>(nullable: true),
Name = table.Column<string>(maxLength: 255, nullable: false),
Version = table.Column<string>(maxLength: 20, nullable: false),
Size = table.Column<long>(nullable: false),
FileType = table.Column<int>(nullable: false),
SHA256 = table.Column<string>(maxLength: 32, nullable: false),
DownloadCount = table.Column<int>(nullable: false),
AppVersionId = table.Column<Guid>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AppPlatformVersionFile", x => x.Id);
table.ForeignKey(
name: "FK_AppPlatformVersionFile_AppPlatformVersion_AppVersionId",
column: x => x.AppVersionId,
principalTable: "AppPlatformVersion",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_AppPlatformRoleRoute_RoleName_RouteId",
table: "AppPlatformRoleRoute",
columns: new[] { "RoleName", "RouteId" });
migrationBuilder.CreateIndex(
name: "IX_AppPlatformRoute_Code",
table: "AppPlatformRoute",
column: "Code");
migrationBuilder.CreateIndex(
name: "IX_AppPlatformRoute_ParentId",
table: "AppPlatformRoute",
column: "ParentId");
migrationBuilder.CreateIndex(
name: "IX_AppPlatformUserRoute_UserId_RouteId",
table: "AppPlatformUserRoute",
columns: new[] { "UserId", "RouteId" });
migrationBuilder.CreateIndex(
name: "IX_AppPlatformVersion_Version",
table: "AppPlatformVersion",
column: "Version");
migrationBuilder.CreateIndex(
name: "IX_AppPlatformVersionFile_AppVersionId",
table: "AppPlatformVersionFile",
column: "AppVersionId");
migrationBuilder.CreateIndex(
name: "IX_AppPlatformVersionFile_Name_Version",
table: "AppPlatformVersionFile",
columns: new[] { "Name", "Version" });
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "AppPlatformRoleRoute");
migrationBuilder.DropTable(
name: "AppPlatformRoute");
migrationBuilder.DropTable(
name: "AppPlatformUserRoute");
migrationBuilder.DropTable(
name: "AppPlatformVersionFile");
migrationBuilder.DropTable(
name: "AppPlatformVersion");
}
}
}

397
aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/Migrations/20200723143103_Modify-Version-File-SHA256-Length.Designer.cs

@ -1,397 +0,0 @@
// <auto-generated />
using System;
using LINGYUN.Platform.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Volo.Abp.EntityFrameworkCore;
namespace LINGYUN.Platform.Migrations
{
[DbContext(typeof(PlatformHttpApiHostMigrationsDbContext))]
[Migration("20200723143103_Modify-Version-File-SHA256-Length")]
partial class ModifyVersionFileSHA256Length
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.MySql)
.HasAnnotation("ProductVersion", "3.1.5")
.HasAnnotation("Relational:MaxIdentifierLength", 64);
modelBuilder.Entity("LINGYUN.Platform.Routes.RoleRoute", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("CreatorId")
.HasColumnType("char(36)");
b.Property<Guid?>("DeleterId")
.HasColumnType("char(36)");
b.Property<DateTime?>("DeletionTime")
.HasColumnType("datetime(6)");
b.Property<bool>("IsDeleted")
.HasColumnType("tinyint(1)");
b.Property<DateTime?>("LastModificationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("LastModifierId")
.HasColumnType("char(36)");
b.Property<string>("RoleName")
.IsRequired()
.HasColumnName("RoleName")
.HasColumnType("varchar(256) CHARACTER SET utf8mb4")
.HasMaxLength(256);
b.Property<Guid>("RouteId")
.HasColumnType("char(36)");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.HasKey("Id");
b.HasIndex("RoleName", "RouteId");
b.ToTable("AppPlatformRoleRoute");
});
modelBuilder.Entity("LINGYUN.Platform.Routes.Route", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<bool>("AlwaysShow")
.HasColumnType("tinyint(1)");
b.Property<string>("Code")
.IsRequired()
.HasColumnName("Code")
.HasColumnType("varchar(95) CHARACTER SET utf8mb4")
.HasMaxLength(95);
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnName("ConcurrencyStamp")
.HasColumnType("varchar(40) CHARACTER SET utf8mb4")
.HasMaxLength(40);
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("CreatorId")
.HasColumnName("CreatorId")
.HasColumnType("char(36)");
b.Property<Guid?>("DeleterId")
.HasColumnName("DeleterId")
.HasColumnType("char(36)");
b.Property<DateTime?>("DeletionTime")
.HasColumnName("DeletionTime")
.HasColumnType("datetime(6)");
b.Property<string>("Description")
.HasColumnName("Description")
.HasColumnType("varchar(255) CHARACTER SET utf8mb4")
.HasMaxLength(255);
b.Property<string>("DisplayName")
.IsRequired()
.HasColumnName("DisplayName")
.HasColumnType("varchar(128) CHARACTER SET utf8mb4")
.HasMaxLength(128);
b.Property<string>("ExtraProperties")
.HasColumnName("ExtraProperties")
.HasColumnType("longtext CHARACTER SET utf8mb4");
b.Property<string>("FullName")
.HasColumnName("FullName")
.HasColumnType("varchar(128) CHARACTER SET utf8mb4")
.HasMaxLength(128);
b.Property<string>("Icon")
.HasColumnName("Icon")
.HasColumnType("varchar(128) CHARACTER SET utf8mb4")
.HasMaxLength(128);
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnName("IsDeleted")
.HasColumnType("tinyint(1)")
.HasDefaultValue(false);
b.Property<bool>("IsMenu")
.HasColumnType("tinyint(1)");
b.Property<bool>("IsPublic")
.HasColumnType("tinyint(1)");
b.Property<bool>("IsSideBar")
.HasColumnType("tinyint(1)");
b.Property<bool>("IsStatic")
.HasColumnType("tinyint(1)");
b.Property<bool>("IsToolBar")
.HasColumnType("tinyint(1)");
b.Property<DateTime?>("LastModificationTime")
.HasColumnName("LastModificationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("LastModifierId")
.HasColumnName("LastModifierId")
.HasColumnType("char(36)");
b.Property<string>("LinkUrl")
.IsRequired()
.HasColumnName("LinkUrl")
.HasColumnType("varchar(255) CHARACTER SET utf8mb4")
.HasMaxLength(255);
b.Property<string>("Name")
.IsRequired()
.HasColumnName("Name")
.HasColumnType("varchar(64) CHARACTER SET utf8mb4")
.HasMaxLength(64);
b.Property<Guid?>("ParentId")
.HasColumnType("char(36)");
b.Property<int>("PlatformType")
.HasColumnType("int");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.HasKey("Id");
b.HasIndex("Code");
b.HasIndex("ParentId");
b.ToTable("AppPlatformRoute");
});
modelBuilder.Entity("LINGYUN.Platform.Routes.UserRoute", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("CreatorId")
.HasColumnType("char(36)");
b.Property<Guid?>("DeleterId")
.HasColumnType("char(36)");
b.Property<DateTime?>("DeletionTime")
.HasColumnType("datetime(6)");
b.Property<bool>("IsDeleted")
.HasColumnType("tinyint(1)");
b.Property<DateTime?>("LastModificationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("LastModifierId")
.HasColumnType("char(36)");
b.Property<Guid>("RouteId")
.HasColumnType("char(36)");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.Property<Guid>("UserId")
.HasColumnType("char(36)");
b.HasKey("Id");
b.HasIndex("UserId", "RouteId");
b.ToTable("AppPlatformUserRoute");
});
modelBuilder.Entity("LINGYUN.Platform.Versions.AppVersion", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnName("ConcurrencyStamp")
.HasColumnType("varchar(40) CHARACTER SET utf8mb4")
.HasMaxLength(40);
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("CreatorId")
.HasColumnName("CreatorId")
.HasColumnType("char(36)");
b.Property<Guid?>("DeleterId")
.HasColumnName("DeleterId")
.HasColumnType("char(36)");
b.Property<DateTime?>("DeletionTime")
.HasColumnName("DeletionTime")
.HasColumnType("datetime(6)");
b.Property<string>("Description")
.HasColumnName("Description")
.HasColumnType("longtext CHARACTER SET utf8mb4")
.HasMaxLength(2048);
b.Property<string>("ExtraProperties")
.HasColumnName("ExtraProperties")
.HasColumnType("longtext CHARACTER SET utf8mb4");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnName("IsDeleted")
.HasColumnType("tinyint(1)")
.HasDefaultValue(false);
b.Property<DateTime?>("LastModificationTime")
.HasColumnName("LastModificationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("LastModifierId")
.HasColumnName("LastModifierId")
.HasColumnType("char(36)");
b.Property<int>("Level")
.HasColumnType("int");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.Property<string>("Title")
.IsRequired()
.HasColumnName("Title")
.HasColumnType("varchar(50) CHARACTER SET utf8mb4")
.HasMaxLength(50);
b.Property<string>("Version")
.IsRequired()
.HasColumnName("Version")
.HasColumnType("varchar(20) CHARACTER SET utf8mb4")
.HasMaxLength(20);
b.HasKey("Id");
b.HasIndex("Version");
b.ToTable("AppPlatformVersion");
});
modelBuilder.Entity("LINGYUN.Platform.Versions.VersionFile", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<Guid>("AppVersionId")
.HasColumnType("char(36)");
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("CreatorId")
.HasColumnName("CreatorId")
.HasColumnType("char(36)");
b.Property<int>("DownloadCount")
.HasColumnType("int");
b.Property<int>("FileType")
.HasColumnType("int");
b.Property<DateTime?>("LastModificationTime")
.HasColumnName("LastModificationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("LastModifierId")
.HasColumnName("LastModifierId")
.HasColumnType("char(36)");
b.Property<string>("Name")
.IsRequired()
.HasColumnName("Name")
.HasColumnType("varchar(255) CHARACTER SET utf8mb4")
.HasMaxLength(255);
b.Property<string>("SHA256")
.IsRequired()
.HasColumnName("SHA256")
.HasColumnType("varchar(65) CHARACTER SET utf8mb4")
.HasMaxLength(65);
b.Property<long>("Size")
.HasColumnType("bigint");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.Property<string>("Version")
.IsRequired()
.HasColumnName("Version")
.HasColumnType("varchar(20) CHARACTER SET utf8mb4")
.HasMaxLength(20);
b.HasKey("Id");
b.HasIndex("AppVersionId");
b.HasIndex("Name", "Version");
b.ToTable("AppPlatformVersionFile");
});
modelBuilder.Entity("LINGYUN.Platform.Routes.Route", b =>
{
b.HasOne("LINGYUN.Platform.Routes.Route", null)
.WithMany()
.HasForeignKey("ParentId");
});
modelBuilder.Entity("LINGYUN.Platform.Versions.VersionFile", b =>
{
b.HasOne("LINGYUN.Platform.Versions.AppVersion", "AppVersion")
.WithMany("Files")
.HasForeignKey("AppVersionId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
#pragma warning restore 612, 618
}
}
}

31
aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/Migrations/20200723143103_Modify-Version-File-SHA256-Length.cs

@ -1,31 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace LINGYUN.Platform.Migrations
{
public partial class ModifyVersionFileSHA256Length : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "SHA256",
table: "AppPlatformVersionFile",
maxLength: 65,
nullable: false,
oldClrType: typeof(string),
oldType: "varchar(32) CHARACTER SET utf8mb4",
oldMaxLength: 32);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "SHA256",
table: "AppPlatformVersionFile",
type: "varchar(32) CHARACTER SET utf8mb4",
maxLength: 32,
nullable: false,
oldClrType: typeof(string),
oldMaxLength: 65);
}
}
}

406
aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/Migrations/20200724092022_Add-Version-File-Field-Path-And-Platform-Type.Designer.cs

@ -1,406 +0,0 @@
// <auto-generated />
using System;
using LINGYUN.Platform.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Volo.Abp.EntityFrameworkCore;
namespace LINGYUN.Platform.Migrations
{
[DbContext(typeof(PlatformHttpApiHostMigrationsDbContext))]
[Migration("20200724092022_Add-Version-File-Field-Path-And-Platform-Type")]
partial class AddVersionFileFieldPathAndPlatformType
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.MySql)
.HasAnnotation("ProductVersion", "3.1.5")
.HasAnnotation("Relational:MaxIdentifierLength", 64);
modelBuilder.Entity("LINGYUN.Platform.Routes.RoleRoute", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("CreatorId")
.HasColumnType("char(36)");
b.Property<Guid?>("DeleterId")
.HasColumnType("char(36)");
b.Property<DateTime?>("DeletionTime")
.HasColumnType("datetime(6)");
b.Property<bool>("IsDeleted")
.HasColumnType("tinyint(1)");
b.Property<DateTime?>("LastModificationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("LastModifierId")
.HasColumnType("char(36)");
b.Property<string>("RoleName")
.IsRequired()
.HasColumnName("RoleName")
.HasColumnType("varchar(256) CHARACTER SET utf8mb4")
.HasMaxLength(256);
b.Property<Guid>("RouteId")
.HasColumnType("char(36)");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.HasKey("Id");
b.HasIndex("RoleName", "RouteId");
b.ToTable("AppPlatformRoleRoute");
});
modelBuilder.Entity("LINGYUN.Platform.Routes.Route", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<bool>("AlwaysShow")
.HasColumnType("tinyint(1)");
b.Property<string>("Code")
.IsRequired()
.HasColumnName("Code")
.HasColumnType("varchar(95) CHARACTER SET utf8mb4")
.HasMaxLength(95);
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnName("ConcurrencyStamp")
.HasColumnType("varchar(40) CHARACTER SET utf8mb4")
.HasMaxLength(40);
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("CreatorId")
.HasColumnName("CreatorId")
.HasColumnType("char(36)");
b.Property<Guid?>("DeleterId")
.HasColumnName("DeleterId")
.HasColumnType("char(36)");
b.Property<DateTime?>("DeletionTime")
.HasColumnName("DeletionTime")
.HasColumnType("datetime(6)");
b.Property<string>("Description")
.HasColumnName("Description")
.HasColumnType("varchar(255) CHARACTER SET utf8mb4")
.HasMaxLength(255);
b.Property<string>("DisplayName")
.IsRequired()
.HasColumnName("DisplayName")
.HasColumnType("varchar(128) CHARACTER SET utf8mb4")
.HasMaxLength(128);
b.Property<string>("ExtraProperties")
.HasColumnName("ExtraProperties")
.HasColumnType("longtext CHARACTER SET utf8mb4");
b.Property<string>("FullName")
.HasColumnName("FullName")
.HasColumnType("varchar(128) CHARACTER SET utf8mb4")
.HasMaxLength(128);
b.Property<string>("Icon")
.HasColumnName("Icon")
.HasColumnType("varchar(128) CHARACTER SET utf8mb4")
.HasMaxLength(128);
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnName("IsDeleted")
.HasColumnType("tinyint(1)")
.HasDefaultValue(false);
b.Property<bool>("IsMenu")
.HasColumnType("tinyint(1)");
b.Property<bool>("IsPublic")
.HasColumnType("tinyint(1)");
b.Property<bool>("IsSideBar")
.HasColumnType("tinyint(1)");
b.Property<bool>("IsStatic")
.HasColumnType("tinyint(1)");
b.Property<bool>("IsToolBar")
.HasColumnType("tinyint(1)");
b.Property<DateTime?>("LastModificationTime")
.HasColumnName("LastModificationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("LastModifierId")
.HasColumnName("LastModifierId")
.HasColumnType("char(36)");
b.Property<string>("LinkUrl")
.IsRequired()
.HasColumnName("LinkUrl")
.HasColumnType("varchar(255) CHARACTER SET utf8mb4")
.HasMaxLength(255);
b.Property<string>("Name")
.IsRequired()
.HasColumnName("Name")
.HasColumnType("varchar(64) CHARACTER SET utf8mb4")
.HasMaxLength(64);
b.Property<Guid?>("ParentId")
.HasColumnType("char(36)");
b.Property<int>("PlatformType")
.HasColumnType("int");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.HasKey("Id");
b.HasIndex("Code");
b.HasIndex("ParentId");
b.ToTable("AppPlatformRoute");
});
modelBuilder.Entity("LINGYUN.Platform.Routes.UserRoute", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("CreatorId")
.HasColumnType("char(36)");
b.Property<Guid?>("DeleterId")
.HasColumnType("char(36)");
b.Property<DateTime?>("DeletionTime")
.HasColumnType("datetime(6)");
b.Property<bool>("IsDeleted")
.HasColumnType("tinyint(1)");
b.Property<DateTime?>("LastModificationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("LastModifierId")
.HasColumnType("char(36)");
b.Property<Guid>("RouteId")
.HasColumnType("char(36)");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.Property<Guid>("UserId")
.HasColumnType("char(36)");
b.HasKey("Id");
b.HasIndex("UserId", "RouteId");
b.ToTable("AppPlatformUserRoute");
});
modelBuilder.Entity("LINGYUN.Platform.Versions.AppVersion", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnName("ConcurrencyStamp")
.HasColumnType("varchar(40) CHARACTER SET utf8mb4")
.HasMaxLength(40);
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("CreatorId")
.HasColumnName("CreatorId")
.HasColumnType("char(36)");
b.Property<Guid?>("DeleterId")
.HasColumnName("DeleterId")
.HasColumnType("char(36)");
b.Property<DateTime?>("DeletionTime")
.HasColumnName("DeletionTime")
.HasColumnType("datetime(6)");
b.Property<string>("Description")
.HasColumnName("Description")
.HasColumnType("longtext CHARACTER SET utf8mb4")
.HasMaxLength(2048);
b.Property<string>("ExtraProperties")
.HasColumnName("ExtraProperties")
.HasColumnType("longtext CHARACTER SET utf8mb4");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnName("IsDeleted")
.HasColumnType("tinyint(1)")
.HasDefaultValue(false);
b.Property<DateTime?>("LastModificationTime")
.HasColumnName("LastModificationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("LastModifierId")
.HasColumnName("LastModifierId")
.HasColumnType("char(36)");
b.Property<int>("Level")
.HasColumnType("int");
b.Property<int>("PlatformType")
.HasColumnType("int");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.Property<string>("Title")
.IsRequired()
.HasColumnName("Title")
.HasColumnType("varchar(50) CHARACTER SET utf8mb4")
.HasMaxLength(50);
b.Property<string>("Version")
.IsRequired()
.HasColumnName("Version")
.HasColumnType("varchar(20) CHARACTER SET utf8mb4")
.HasMaxLength(20);
b.HasKey("Id");
b.HasIndex("Version");
b.ToTable("AppPlatformVersion");
});
modelBuilder.Entity("LINGYUN.Platform.Versions.VersionFile", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<Guid>("AppVersionId")
.HasColumnType("char(36)");
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("CreatorId")
.HasColumnName("CreatorId")
.HasColumnType("char(36)");
b.Property<int>("DownloadCount")
.HasColumnType("int");
b.Property<int>("FileType")
.HasColumnType("int");
b.Property<DateTime?>("LastModificationTime")
.HasColumnName("LastModificationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("LastModifierId")
.HasColumnName("LastModifierId")
.HasColumnType("char(36)");
b.Property<string>("Name")
.IsRequired()
.HasColumnName("Name")
.HasColumnType("varchar(255) CHARACTER SET utf8mb4")
.HasMaxLength(255);
b.Property<string>("Path")
.HasColumnName("Path")
.HasColumnType("varchar(255) CHARACTER SET utf8mb4")
.HasMaxLength(255);
b.Property<string>("SHA256")
.IsRequired()
.HasColumnName("SHA256")
.HasColumnType("varchar(65) CHARACTER SET utf8mb4")
.HasMaxLength(65);
b.Property<long>("Size")
.HasColumnType("bigint");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.Property<string>("Version")
.IsRequired()
.HasColumnName("Version")
.HasColumnType("varchar(20) CHARACTER SET utf8mb4")
.HasMaxLength(20);
b.HasKey("Id");
b.HasIndex("AppVersionId");
b.HasIndex("Path", "Name", "Version")
.IsUnique();
b.ToTable("AppPlatformVersionFile");
});
modelBuilder.Entity("LINGYUN.Platform.Routes.Route", b =>
{
b.HasOne("LINGYUN.Platform.Routes.Route", null)
.WithMany()
.HasForeignKey("ParentId");
});
modelBuilder.Entity("LINGYUN.Platform.Versions.VersionFile", b =>
{
b.HasOne("LINGYUN.Platform.Versions.AppVersion", "AppVersion")
.WithMany("Files")
.HasForeignKey("AppVersionId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
#pragma warning restore 612, 618
}
}
}

52
aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/Migrations/20200724092022_Add-Version-File-Field-Path-And-Platform-Type.cs

@ -1,52 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace LINGYUN.Platform.Migrations
{
public partial class AddVersionFileFieldPathAndPlatformType : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropIndex(
name: "IX_AppPlatformVersionFile_Name_Version",
table: "AppPlatformVersionFile");
migrationBuilder.AddColumn<string>(
name: "Path",
table: "AppPlatformVersionFile",
maxLength: 255,
nullable: true);
migrationBuilder.AddColumn<int>(
name: "PlatformType",
table: "AppPlatformVersion",
nullable: false,
defaultValue: 0);
migrationBuilder.CreateIndex(
name: "IX_AppPlatformVersionFile_Path_Name_Version",
table: "AppPlatformVersionFile",
columns: new[] { "Path", "Name", "Version" },
unique: true);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropIndex(
name: "IX_AppPlatformVersionFile_Path_Name_Version",
table: "AppPlatformVersionFile");
migrationBuilder.DropColumn(
name: "Path",
table: "AppPlatformVersionFile");
migrationBuilder.DropColumn(
name: "PlatformType",
table: "AppPlatformVersion");
migrationBuilder.CreateIndex(
name: "IX_AppPlatformVersionFile_Name_Version",
table: "AppPlatformVersionFile",
columns: new[] { "Name", "Version" });
}
}
}

637
aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/Migrations/20201203105205_Add-Menu-Layout-Data-And-More-Entity.Designer.cs

@ -1,637 +0,0 @@
// <auto-generated />
using System;
using LINGYUN.Platform.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Volo.Abp.EntityFrameworkCore;
namespace LINGYUN.Platform.Migrations
{
[DbContext(typeof(PlatformHttpApiHostMigrationsDbContext))]
[Migration("20201203105205_Add-Menu-Layout-Data-And-More-Entity")]
partial class AddMenuLayoutDataAndMoreEntity
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.MySql)
.HasAnnotation("ProductVersion", "3.1.8")
.HasAnnotation("Relational:MaxIdentifierLength", 64);
modelBuilder.Entity("LINGYUN.Platform.Datas.Data", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<string>("Code")
.IsRequired()
.HasColumnName("Code")
.HasColumnType("varchar(1024) CHARACTER SET utf8mb4")
.HasMaxLength(1024);
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnName("ConcurrencyStamp")
.HasColumnType("varchar(40) CHARACTER SET utf8mb4")
.HasMaxLength(40);
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("CreatorId")
.HasColumnName("CreatorId")
.HasColumnType("char(36)");
b.Property<Guid?>("DeleterId")
.HasColumnName("DeleterId")
.HasColumnType("char(36)");
b.Property<DateTime?>("DeletionTime")
.HasColumnName("DeletionTime")
.HasColumnType("datetime(6)");
b.Property<string>("Description")
.HasColumnName("Description")
.HasColumnType("varchar(128) CHARACTER SET utf8mb4")
.HasMaxLength(128);
b.Property<string>("DisplayName")
.IsRequired()
.HasColumnName("DisplayName")
.HasColumnType("varchar(128) CHARACTER SET utf8mb4")
.HasMaxLength(128);
b.Property<string>("ExtraProperties")
.HasColumnName("ExtraProperties")
.HasColumnType("longtext CHARACTER SET utf8mb4");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnName("IsDeleted")
.HasColumnType("tinyint(1)")
.HasDefaultValue(false);
b.Property<DateTime?>("LastModificationTime")
.HasColumnName("LastModificationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("LastModifierId")
.HasColumnName("LastModifierId")
.HasColumnType("char(36)");
b.Property<string>("Name")
.IsRequired()
.HasColumnName("Name")
.HasColumnType("varchar(30) CHARACTER SET utf8mb4")
.HasMaxLength(30);
b.Property<Guid?>("ParentId")
.HasColumnType("char(36)");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.HasKey("Id");
b.HasIndex("Name");
b.ToTable("AppPlatformDatas");
});
modelBuilder.Entity("LINGYUN.Platform.Datas.DataItem", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnName("ConcurrencyStamp")
.HasColumnType("varchar(40) CHARACTER SET utf8mb4")
.HasMaxLength(40);
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("CreatorId")
.HasColumnName("CreatorId")
.HasColumnType("char(36)");
b.Property<Guid>("DataId")
.HasColumnType("char(36)");
b.Property<Guid?>("DeleterId")
.HasColumnName("DeleterId")
.HasColumnType("char(36)");
b.Property<DateTime?>("DeletionTime")
.HasColumnName("DeletionTime")
.HasColumnType("datetime(6)");
b.Property<string>("Description")
.HasColumnName("Description")
.HasColumnType("varchar(128) CHARACTER SET utf8mb4")
.HasMaxLength(128);
b.Property<string>("DisplayName")
.IsRequired()
.HasColumnName("DisplayName")
.HasColumnType("varchar(128) CHARACTER SET utf8mb4")
.HasMaxLength(128);
b.Property<string>("ExtraProperties")
.HasColumnName("ExtraProperties")
.HasColumnType("longtext CHARACTER SET utf8mb4");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnName("IsDeleted")
.HasColumnType("tinyint(1)")
.HasDefaultValue(false);
b.Property<DateTime?>("LastModificationTime")
.HasColumnName("LastModificationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("LastModifierId")
.HasColumnName("LastModifierId")
.HasColumnType("char(36)");
b.Property<string>("Name")
.IsRequired()
.HasColumnName("Name")
.HasColumnType("varchar(30) CHARACTER SET utf8mb4")
.HasMaxLength(30);
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.Property<string>("Value")
.IsRequired()
.HasColumnName("Value")
.HasColumnType("varchar(128) CHARACTER SET utf8mb4")
.HasMaxLength(128);
b.Property<int>("ValueType")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("DataId");
b.HasIndex("Name");
b.ToTable("AppPlatformDataItems");
});
modelBuilder.Entity("LINGYUN.Platform.Layouts.Layout", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<string>("Code")
.HasColumnType("longtext CHARACTER SET utf8mb4");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnName("ConcurrencyStamp")
.HasColumnType("varchar(40) CHARACTER SET utf8mb4")
.HasMaxLength(40);
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("CreatorId")
.HasColumnName("CreatorId")
.HasColumnType("char(36)");
b.Property<Guid>("DataId")
.HasColumnType("char(36)");
b.Property<Guid?>("DeleterId")
.HasColumnName("DeleterId")
.HasColumnType("char(36)");
b.Property<DateTime?>("DeletionTime")
.HasColumnName("DeletionTime")
.HasColumnType("datetime(6)");
b.Property<string>("Description")
.HasColumnType("longtext CHARACTER SET utf8mb4");
b.Property<string>("DisplayName")
.IsRequired()
.HasColumnName("DisplayName")
.HasColumnType("varchar(128) CHARACTER SET utf8mb4")
.HasMaxLength(128);
b.Property<string>("ExtraProperties")
.HasColumnName("ExtraProperties")
.HasColumnType("longtext CHARACTER SET utf8mb4");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnName("IsDeleted")
.HasColumnType("tinyint(1)")
.HasDefaultValue(false);
b.Property<DateTime?>("LastModificationTime")
.HasColumnName("LastModificationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("LastModifierId")
.HasColumnName("LastModifierId")
.HasColumnType("char(36)");
b.Property<string>("Name")
.IsRequired()
.HasColumnName("Name")
.HasColumnType("varchar(64) CHARACTER SET utf8mb4")
.HasMaxLength(64);
b.Property<string>("Path")
.HasColumnName("Path")
.HasColumnType("varchar(255) CHARACTER SET utf8mb4")
.HasMaxLength(255);
b.Property<int>("PlatformType")
.HasColumnType("int");
b.Property<string>("Redirect")
.HasColumnName("Redirect")
.HasColumnType("varchar(255) CHARACTER SET utf8mb4")
.HasMaxLength(255);
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.HasKey("Id");
b.ToTable("AppPlatformLayouts");
});
modelBuilder.Entity("LINGYUN.Platform.Menus.Menu", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<string>("Code")
.HasColumnType("longtext CHARACTER SET utf8mb4");
b.Property<string>("Component")
.HasColumnType("longtext CHARACTER SET utf8mb4");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnName("ConcurrencyStamp")
.HasColumnType("varchar(40) CHARACTER SET utf8mb4")
.HasMaxLength(40);
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("CreatorId")
.HasColumnName("CreatorId")
.HasColumnType("char(36)");
b.Property<Guid?>("DeleterId")
.HasColumnName("DeleterId")
.HasColumnType("char(36)");
b.Property<DateTime?>("DeletionTime")
.HasColumnName("DeletionTime")
.HasColumnType("datetime(6)");
b.Property<string>("Description")
.HasColumnType("longtext CHARACTER SET utf8mb4");
b.Property<string>("DisplayName")
.IsRequired()
.HasColumnName("DisplayName")
.HasColumnType("varchar(128) CHARACTER SET utf8mb4")
.HasMaxLength(128);
b.Property<string>("ExtraProperties")
.HasColumnName("ExtraProperties")
.HasColumnType("longtext CHARACTER SET utf8mb4");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnName("IsDeleted")
.HasColumnType("tinyint(1)")
.HasDefaultValue(false);
b.Property<DateTime?>("LastModificationTime")
.HasColumnName("LastModificationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("LastModifierId")
.HasColumnName("LastModifierId")
.HasColumnType("char(36)");
b.Property<string>("Name")
.IsRequired()
.HasColumnName("Name")
.HasColumnType("varchar(64) CHARACTER SET utf8mb4")
.HasMaxLength(64);
b.Property<Guid?>("ParentId")
.HasColumnType("char(36)");
b.Property<string>("Path")
.HasColumnName("Path")
.HasColumnType("varchar(255) CHARACTER SET utf8mb4")
.HasMaxLength(255);
b.Property<int>("PlatformType")
.HasColumnType("int");
b.Property<string>("Redirect")
.HasColumnName("Redirect")
.HasColumnType("varchar(255) CHARACTER SET utf8mb4")
.HasMaxLength(255);
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.HasKey("Id");
b.HasIndex("ParentId");
b.ToTable("AppPlatformMenus");
});
modelBuilder.Entity("LINGYUN.Platform.Menus.RoleMenu", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("CreatorId")
.HasColumnName("CreatorId")
.HasColumnType("char(36)");
b.Property<DateTime?>("LastModificationTime")
.HasColumnName("LastModificationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("LastModifierId")
.HasColumnName("LastModifierId")
.HasColumnType("char(36)");
b.Property<Guid>("MenuId")
.HasColumnType("char(36)");
b.Property<string>("RoleName")
.IsRequired()
.HasColumnName("RoleName")
.HasColumnType("varchar(256) CHARACTER SET utf8mb4")
.HasMaxLength(256);
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.HasKey("Id");
b.HasIndex("RoleName", "MenuId");
b.ToTable("AppPlatformRoleMenus");
});
modelBuilder.Entity("LINGYUN.Platform.Menus.UserMenu", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("CreatorId")
.HasColumnName("CreatorId")
.HasColumnType("char(36)");
b.Property<DateTime?>("LastModificationTime")
.HasColumnName("LastModificationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("LastModifierId")
.HasColumnName("LastModifierId")
.HasColumnType("char(36)");
b.Property<Guid>("MenuId")
.HasColumnType("char(36)");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.Property<Guid>("UserId")
.HasColumnType("char(36)");
b.HasKey("Id");
b.HasIndex("UserId", "MenuId");
b.ToTable("AppPlatformUserMenus");
});
modelBuilder.Entity("LINGYUN.Platform.Versions.AppVersion", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnName("ConcurrencyStamp")
.HasColumnType("varchar(40) CHARACTER SET utf8mb4")
.HasMaxLength(40);
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("CreatorId")
.HasColumnName("CreatorId")
.HasColumnType("char(36)");
b.Property<Guid?>("DeleterId")
.HasColumnName("DeleterId")
.HasColumnType("char(36)");
b.Property<DateTime?>("DeletionTime")
.HasColumnName("DeletionTime")
.HasColumnType("datetime(6)");
b.Property<string>("Description")
.HasColumnName("Description")
.HasColumnType("longtext CHARACTER SET utf8mb4")
.HasMaxLength(2048);
b.Property<string>("ExtraProperties")
.HasColumnName("ExtraProperties")
.HasColumnType("longtext CHARACTER SET utf8mb4");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnName("IsDeleted")
.HasColumnType("tinyint(1)")
.HasDefaultValue(false);
b.Property<DateTime?>("LastModificationTime")
.HasColumnName("LastModificationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("LastModifierId")
.HasColumnName("LastModifierId")
.HasColumnType("char(36)");
b.Property<int>("Level")
.HasColumnType("int");
b.Property<int>("PlatformType")
.HasColumnType("int");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.Property<string>("Title")
.IsRequired()
.HasColumnName("Title")
.HasColumnType("varchar(50) CHARACTER SET utf8mb4")
.HasMaxLength(50);
b.Property<string>("Version")
.IsRequired()
.HasColumnName("Version")
.HasColumnType("varchar(20) CHARACTER SET utf8mb4")
.HasMaxLength(20);
b.HasKey("Id");
b.HasIndex("Version");
b.ToTable("AppPlatformVersion");
});
modelBuilder.Entity("LINGYUN.Platform.Versions.VersionFile", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<Guid>("AppVersionId")
.HasColumnType("char(36)");
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("CreatorId")
.HasColumnName("CreatorId")
.HasColumnType("char(36)");
b.Property<int>("DownloadCount")
.HasColumnType("int");
b.Property<int>("FileType")
.HasColumnType("int");
b.Property<DateTime?>("LastModificationTime")
.HasColumnName("LastModificationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("LastModifierId")
.HasColumnName("LastModifierId")
.HasColumnType("char(36)");
b.Property<string>("Name")
.IsRequired()
.HasColumnName("Name")
.HasColumnType("varchar(255) CHARACTER SET utf8mb4")
.HasMaxLength(255);
b.Property<string>("Path")
.HasColumnName("Path")
.HasColumnType("varchar(255) CHARACTER SET utf8mb4")
.HasMaxLength(255);
b.Property<string>("SHA256")
.IsRequired()
.HasColumnName("SHA256")
.HasColumnType("varchar(65) CHARACTER SET utf8mb4")
.HasMaxLength(65);
b.Property<long>("Size")
.HasColumnType("bigint");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.Property<string>("Version")
.IsRequired()
.HasColumnName("Version")
.HasColumnType("varchar(20) CHARACTER SET utf8mb4")
.HasMaxLength(20);
b.HasKey("Id");
b.HasIndex("AppVersionId");
b.HasIndex("Path", "Name", "Version")
.IsUnique();
b.ToTable("AppPlatformVersionFile");
});
modelBuilder.Entity("LINGYUN.Platform.Datas.DataItem", b =>
{
b.HasOne("LINGYUN.Platform.Datas.Data", null)
.WithMany("Items")
.HasForeignKey("DataId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("LINGYUN.Platform.Menus.Menu", b =>
{
b.HasOne("LINGYUN.Platform.Menus.Menu", null)
.WithMany("Children")
.HasForeignKey("ParentId");
});
modelBuilder.Entity("LINGYUN.Platform.Versions.VersionFile", b =>
{
b.HasOne("LINGYUN.Platform.Versions.AppVersion", "AppVersion")
.WithMany("Files")
.HasForeignKey("AppVersionId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
#pragma warning restore 612, 618
}
}
}

338
aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/Migrations/20201203105205_Add-Menu-Layout-Data-And-More-Entity.cs

@ -1,338 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
namespace LINGYUN.Platform.Migrations
{
public partial class AddMenuLayoutDataAndMoreEntity : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "AppPlatformRoleRoute");
migrationBuilder.DropTable(
name: "AppPlatformRoute");
migrationBuilder.DropTable(
name: "AppPlatformUserRoute");
migrationBuilder.CreateTable(
name: "AppPlatformDatas",
columns: table => new
{
Id = table.Column<Guid>(nullable: false),
ExtraProperties = table.Column<string>(nullable: true),
ConcurrencyStamp = table.Column<string>(maxLength: 40, nullable: true),
CreationTime = table.Column<DateTime>(nullable: false),
CreatorId = table.Column<Guid>(nullable: true),
LastModificationTime = table.Column<DateTime>(nullable: true),
LastModifierId = table.Column<Guid>(nullable: true),
IsDeleted = table.Column<bool>(nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(nullable: true),
DeletionTime = table.Column<DateTime>(nullable: true),
TenantId = table.Column<Guid>(nullable: true),
Name = table.Column<string>(maxLength: 30, nullable: false),
Code = table.Column<string>(maxLength: 1024, nullable: false),
DisplayName = table.Column<string>(maxLength: 128, nullable: false),
Description = table.Column<string>(maxLength: 128, nullable: true),
ParentId = table.Column<Guid>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AppPlatformDatas", x => x.Id);
});
migrationBuilder.CreateTable(
name: "AppPlatformLayouts",
columns: table => new
{
Id = table.Column<Guid>(nullable: false),
ExtraProperties = table.Column<string>(nullable: true),
ConcurrencyStamp = table.Column<string>(maxLength: 40, nullable: true),
CreationTime = table.Column<DateTime>(nullable: false),
CreatorId = table.Column<Guid>(nullable: true),
LastModificationTime = table.Column<DateTime>(nullable: true),
LastModifierId = table.Column<Guid>(nullable: true),
IsDeleted = table.Column<bool>(nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(nullable: true),
DeletionTime = table.Column<DateTime>(nullable: true),
TenantId = table.Column<Guid>(nullable: true),
Path = table.Column<string>(maxLength: 255, nullable: true),
Name = table.Column<string>(maxLength: 64, nullable: false),
DisplayName = table.Column<string>(maxLength: 128, nullable: false),
Description = table.Column<string>(nullable: true),
Redirect = table.Column<string>(maxLength: 255, nullable: true),
Code = table.Column<string>(nullable: true),
PlatformType = table.Column<int>(nullable: false),
DataId = table.Column<Guid>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AppPlatformLayouts", x => x.Id);
});
migrationBuilder.CreateTable(
name: "AppPlatformMenus",
columns: table => new
{
Id = table.Column<Guid>(nullable: false),
ExtraProperties = table.Column<string>(nullable: true),
ConcurrencyStamp = table.Column<string>(maxLength: 40, nullable: true),
CreationTime = table.Column<DateTime>(nullable: false),
CreatorId = table.Column<Guid>(nullable: true),
LastModificationTime = table.Column<DateTime>(nullable: true),
LastModifierId = table.Column<Guid>(nullable: true),
IsDeleted = table.Column<bool>(nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(nullable: true),
DeletionTime = table.Column<DateTime>(nullable: true),
TenantId = table.Column<Guid>(nullable: true),
Path = table.Column<string>(maxLength: 255, nullable: true),
Name = table.Column<string>(maxLength: 64, nullable: false),
DisplayName = table.Column<string>(maxLength: 128, nullable: false),
Description = table.Column<string>(nullable: true),
Redirect = table.Column<string>(maxLength: 255, nullable: true),
PlatformType = table.Column<int>(nullable: false),
Code = table.Column<string>(nullable: true),
Component = table.Column<string>(nullable: true),
ParentId = table.Column<Guid>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AppPlatformMenus", x => x.Id);
table.ForeignKey(
name: "FK_AppPlatformMenus_AppPlatformMenus_ParentId",
column: x => x.ParentId,
principalTable: "AppPlatformMenus",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateTable(
name: "AppPlatformRoleMenus",
columns: table => new
{
Id = table.Column<Guid>(nullable: false),
CreationTime = table.Column<DateTime>(nullable: false),
CreatorId = table.Column<Guid>(nullable: true),
LastModificationTime = table.Column<DateTime>(nullable: true),
LastModifierId = table.Column<Guid>(nullable: true),
TenantId = table.Column<Guid>(nullable: true),
MenuId = table.Column<Guid>(nullable: false),
RoleName = table.Column<string>(maxLength: 256, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AppPlatformRoleMenus", x => x.Id);
});
migrationBuilder.CreateTable(
name: "AppPlatformUserMenus",
columns: table => new
{
Id = table.Column<Guid>(nullable: false),
CreationTime = table.Column<DateTime>(nullable: false),
CreatorId = table.Column<Guid>(nullable: true),
LastModificationTime = table.Column<DateTime>(nullable: true),
LastModifierId = table.Column<Guid>(nullable: true),
TenantId = table.Column<Guid>(nullable: true),
MenuId = table.Column<Guid>(nullable: false),
UserId = table.Column<Guid>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AppPlatformUserMenus", x => x.Id);
});
migrationBuilder.CreateTable(
name: "AppPlatformDataItems",
columns: table => new
{
Id = table.Column<Guid>(nullable: false),
ExtraProperties = table.Column<string>(nullable: true),
ConcurrencyStamp = table.Column<string>(maxLength: 40, nullable: true),
CreationTime = table.Column<DateTime>(nullable: false),
CreatorId = table.Column<Guid>(nullable: true),
LastModificationTime = table.Column<DateTime>(nullable: true),
LastModifierId = table.Column<Guid>(nullable: true),
IsDeleted = table.Column<bool>(nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(nullable: true),
DeletionTime = table.Column<DateTime>(nullable: true),
TenantId = table.Column<Guid>(nullable: true),
Name = table.Column<string>(maxLength: 30, nullable: false),
DisplayName = table.Column<string>(maxLength: 128, nullable: false),
Value = table.Column<string>(maxLength: 128, nullable: false),
Description = table.Column<string>(maxLength: 128, nullable: true),
ValueType = table.Column<int>(nullable: false),
DataId = table.Column<Guid>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AppPlatformDataItems", x => x.Id);
table.ForeignKey(
name: "FK_AppPlatformDataItems_AppPlatformDatas_DataId",
column: x => x.DataId,
principalTable: "AppPlatformDatas",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_AppPlatformDataItems_DataId",
table: "AppPlatformDataItems",
column: "DataId");
migrationBuilder.CreateIndex(
name: "IX_AppPlatformDataItems_Name",
table: "AppPlatformDataItems",
column: "Name");
migrationBuilder.CreateIndex(
name: "IX_AppPlatformDatas_Name",
table: "AppPlatformDatas",
column: "Name");
migrationBuilder.CreateIndex(
name: "IX_AppPlatformMenus_ParentId",
table: "AppPlatformMenus",
column: "ParentId");
migrationBuilder.CreateIndex(
name: "IX_AppPlatformRoleMenus_RoleName_MenuId",
table: "AppPlatformRoleMenus",
columns: new[] { "RoleName", "MenuId" });
migrationBuilder.CreateIndex(
name: "IX_AppPlatformUserMenus_UserId_MenuId",
table: "AppPlatformUserMenus",
columns: new[] { "UserId", "MenuId" });
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "AppPlatformDataItems");
migrationBuilder.DropTable(
name: "AppPlatformLayouts");
migrationBuilder.DropTable(
name: "AppPlatformMenus");
migrationBuilder.DropTable(
name: "AppPlatformRoleMenus");
migrationBuilder.DropTable(
name: "AppPlatformUserMenus");
migrationBuilder.DropTable(
name: "AppPlatformDatas");
migrationBuilder.CreateTable(
name: "AppPlatformRoleRoute",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
CreationTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
CreatorId = table.Column<string>(type: "char(36)", nullable: true),
DeleterId = table.Column<string>(type: "char(36)", nullable: true),
DeletionTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false),
LastModificationTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
LastModifierId = table.Column<string>(type: "char(36)", nullable: true),
RoleName = table.Column<string>(type: "varchar(256) CHARACTER SET utf8mb4", maxLength: 256, nullable: false),
RouteId = table.Column<string>(type: "char(36)", nullable: false),
TenantId = table.Column<string>(type: "char(36)", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AppPlatformRoleRoute", x => x.Id);
});
migrationBuilder.CreateTable(
name: "AppPlatformRoute",
columns: table => new
{
Id = table.Column<string>(type: "char(36)", nullable: false),
AlwaysShow = table.Column<bool>(type: "tinyint(1)", nullable: false),
Code = table.Column<string>(type: "varchar(95) CHARACTER SET utf8mb4", maxLength: 95, nullable: false),
ConcurrencyStamp = table.Column<string>(type: "varchar(40) CHARACTER SET utf8mb4", maxLength: 40, nullable: true),
CreationTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
CreatorId = table.Column<string>(type: "char(36)", nullable: true),
DeleterId = table.Column<string>(type: "char(36)", nullable: true),
DeletionTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
Description = table.Column<string>(type: "varchar(255) CHARACTER SET utf8mb4", maxLength: 255, nullable: true),
DisplayName = table.Column<string>(type: "varchar(128) CHARACTER SET utf8mb4", maxLength: 128, nullable: false),
ExtraProperties = table.Column<string>(type: "longtext CHARACTER SET utf8mb4", nullable: true),
FullName = table.Column<string>(type: "varchar(128) CHARACTER SET utf8mb4", maxLength: 128, nullable: true),
Icon = table.Column<string>(type: "varchar(128) CHARACTER SET utf8mb4", maxLength: 128, nullable: true),
IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false),
IsMenu = table.Column<bool>(type: "tinyint(1)", nullable: false),
IsPublic = table.Column<bool>(type: "tinyint(1)", nullable: false),
IsSideBar = table.Column<bool>(type: "tinyint(1)", nullable: false),
IsStatic = table.Column<bool>(type: "tinyint(1)", nullable: false),
IsToolBar = table.Column<bool>(type: "tinyint(1)", nullable: false),
LastModificationTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
LastModifierId = table.Column<string>(type: "char(36)", nullable: true),
LinkUrl = table.Column<string>(type: "varchar(255) CHARACTER SET utf8mb4", maxLength: 255, nullable: false),
Name = table.Column<string>(type: "varchar(64) CHARACTER SET utf8mb4", maxLength: 64, nullable: false),
ParentId = table.Column<string>(type: "char(36)", nullable: true),
PlatformType = table.Column<int>(type: "int", nullable: false),
TenantId = table.Column<string>(type: "char(36)", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AppPlatformRoute", x => x.Id);
table.ForeignKey(
name: "FK_AppPlatformRoute_AppPlatformRoute_ParentId",
column: x => x.ParentId,
principalTable: "AppPlatformRoute",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateTable(
name: "AppPlatformUserRoute",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
CreationTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
CreatorId = table.Column<string>(type: "char(36)", nullable: true),
DeleterId = table.Column<string>(type: "char(36)", nullable: true),
DeletionTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false),
LastModificationTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
LastModifierId = table.Column<string>(type: "char(36)", nullable: true),
RouteId = table.Column<string>(type: "char(36)", nullable: false),
TenantId = table.Column<string>(type: "char(36)", nullable: true),
UserId = table.Column<string>(type: "char(36)", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AppPlatformUserRoute", x => x.Id);
});
migrationBuilder.CreateIndex(
name: "IX_AppPlatformRoleRoute_RoleName_RouteId",
table: "AppPlatformRoleRoute",
columns: new[] { "RoleName", "RouteId" });
migrationBuilder.CreateIndex(
name: "IX_AppPlatformRoute_Code",
table: "AppPlatformRoute",
column: "Code");
migrationBuilder.CreateIndex(
name: "IX_AppPlatformRoute_ParentId",
table: "AppPlatformRoute",
column: "ParentId");
migrationBuilder.CreateIndex(
name: "IX_AppPlatformUserRoute_UserId_RouteId",
table: "AppPlatformUserRoute",
columns: new[] { "UserId", "RouteId" });
}
}
}

643
aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/Migrations/20201204082313_Add-Data-Item-AllowBeNull-Field.Designer.cs

@ -1,643 +0,0 @@
// <auto-generated />
using System;
using LINGYUN.Platform.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Volo.Abp.EntityFrameworkCore;
namespace LINGYUN.Platform.Migrations
{
[DbContext(typeof(PlatformHttpApiHostMigrationsDbContext))]
[Migration("20201204082313_Add-Data-Item-AllowBeNull-Field")]
partial class AddDataItemAllowBeNullField
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.MySql)
.HasAnnotation("ProductVersion", "3.1.8")
.HasAnnotation("Relational:MaxIdentifierLength", 64);
modelBuilder.Entity("LINGYUN.Platform.Datas.Data", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<string>("Code")
.IsRequired()
.HasColumnName("Code")
.HasColumnType("varchar(1024) CHARACTER SET utf8mb4")
.HasMaxLength(1024);
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnName("ConcurrencyStamp")
.HasColumnType("varchar(40) CHARACTER SET utf8mb4")
.HasMaxLength(40);
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("CreatorId")
.HasColumnName("CreatorId")
.HasColumnType("char(36)");
b.Property<Guid?>("DeleterId")
.HasColumnName("DeleterId")
.HasColumnType("char(36)");
b.Property<DateTime?>("DeletionTime")
.HasColumnName("DeletionTime")
.HasColumnType("datetime(6)");
b.Property<string>("Description")
.HasColumnName("Description")
.HasColumnType("varchar(128) CHARACTER SET utf8mb4")
.HasMaxLength(128);
b.Property<string>("DisplayName")
.IsRequired()
.HasColumnName("DisplayName")
.HasColumnType("varchar(128) CHARACTER SET utf8mb4")
.HasMaxLength(128);
b.Property<string>("ExtraProperties")
.HasColumnName("ExtraProperties")
.HasColumnType("longtext CHARACTER SET utf8mb4");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnName("IsDeleted")
.HasColumnType("tinyint(1)")
.HasDefaultValue(false);
b.Property<DateTime?>("LastModificationTime")
.HasColumnName("LastModificationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("LastModifierId")
.HasColumnName("LastModifierId")
.HasColumnType("char(36)");
b.Property<string>("Name")
.IsRequired()
.HasColumnName("Name")
.HasColumnType("varchar(30) CHARACTER SET utf8mb4")
.HasMaxLength(30);
b.Property<Guid?>("ParentId")
.HasColumnType("char(36)");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.HasKey("Id");
b.HasIndex("Name");
b.ToTable("AppPlatformDatas");
});
modelBuilder.Entity("LINGYUN.Platform.Datas.DataItem", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<bool>("AllowBeNull")
.HasColumnType("tinyint(1)");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnName("ConcurrencyStamp")
.HasColumnType("varchar(40) CHARACTER SET utf8mb4")
.HasMaxLength(40);
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("CreatorId")
.HasColumnName("CreatorId")
.HasColumnType("char(36)");
b.Property<Guid>("DataId")
.HasColumnType("char(36)");
b.Property<Guid?>("DeleterId")
.HasColumnName("DeleterId")
.HasColumnType("char(36)");
b.Property<DateTime?>("DeletionTime")
.HasColumnName("DeletionTime")
.HasColumnType("datetime(6)");
b.Property<string>("Description")
.HasColumnName("Description")
.HasColumnType("varchar(128) CHARACTER SET utf8mb4")
.HasMaxLength(128);
b.Property<string>("DisplayName")
.IsRequired()
.HasColumnName("DisplayName")
.HasColumnType("varchar(128) CHARACTER SET utf8mb4")
.HasMaxLength(128);
b.Property<string>("ExtraProperties")
.HasColumnName("ExtraProperties")
.HasColumnType("longtext CHARACTER SET utf8mb4");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnName("IsDeleted")
.HasColumnType("tinyint(1)")
.HasDefaultValue(false);
b.Property<DateTime?>("LastModificationTime")
.HasColumnName("LastModificationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("LastModifierId")
.HasColumnName("LastModifierId")
.HasColumnType("char(36)");
b.Property<string>("Name")
.IsRequired()
.HasColumnName("Name")
.HasColumnType("varchar(30) CHARACTER SET utf8mb4")
.HasMaxLength(30);
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.Property<string>("Value")
.IsRequired()
.HasColumnName("Value")
.HasColumnType("varchar(128) CHARACTER SET utf8mb4")
.HasMaxLength(128);
b.Property<int>("ValueType")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("DataId");
b.HasIndex("Name");
b.ToTable("AppPlatformDataItems");
});
modelBuilder.Entity("LINGYUN.Platform.Layouts.Layout", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<string>("Code")
.HasColumnType("longtext CHARACTER SET utf8mb4");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnName("ConcurrencyStamp")
.HasColumnType("varchar(40) CHARACTER SET utf8mb4")
.HasMaxLength(40);
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("CreatorId")
.HasColumnName("CreatorId")
.HasColumnType("char(36)");
b.Property<Guid>("DataId")
.HasColumnType("char(36)");
b.Property<Guid?>("DeleterId")
.HasColumnName("DeleterId")
.HasColumnType("char(36)");
b.Property<DateTime?>("DeletionTime")
.HasColumnName("DeletionTime")
.HasColumnType("datetime(6)");
b.Property<string>("Description")
.HasColumnType("longtext CHARACTER SET utf8mb4");
b.Property<string>("DisplayName")
.IsRequired()
.HasColumnName("DisplayName")
.HasColumnType("varchar(128) CHARACTER SET utf8mb4")
.HasMaxLength(128);
b.Property<string>("ExtraProperties")
.HasColumnName("ExtraProperties")
.HasColumnType("longtext CHARACTER SET utf8mb4");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnName("IsDeleted")
.HasColumnType("tinyint(1)")
.HasDefaultValue(false);
b.Property<DateTime?>("LastModificationTime")
.HasColumnName("LastModificationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("LastModifierId")
.HasColumnName("LastModifierId")
.HasColumnType("char(36)");
b.Property<string>("Name")
.IsRequired()
.HasColumnName("Name")
.HasColumnType("varchar(64) CHARACTER SET utf8mb4")
.HasMaxLength(64);
b.Property<string>("Path")
.HasColumnName("Path")
.HasColumnType("varchar(255) CHARACTER SET utf8mb4")
.HasMaxLength(255);
b.Property<int>("PlatformType")
.HasColumnType("int");
b.Property<string>("Redirect")
.HasColumnName("Redirect")
.HasColumnType("varchar(255) CHARACTER SET utf8mb4")
.HasMaxLength(255);
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.HasKey("Id");
b.ToTable("AppPlatformLayouts");
});
modelBuilder.Entity("LINGYUN.Platform.Menus.Menu", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<string>("Code")
.HasColumnType("longtext CHARACTER SET utf8mb4");
b.Property<string>("Component")
.IsRequired()
.HasColumnName("Component")
.HasColumnType("varchar(255) CHARACTER SET utf8mb4")
.HasMaxLength(255);
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnName("ConcurrencyStamp")
.HasColumnType("varchar(40) CHARACTER SET utf8mb4")
.HasMaxLength(40);
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("CreatorId")
.HasColumnName("CreatorId")
.HasColumnType("char(36)");
b.Property<Guid?>("DeleterId")
.HasColumnName("DeleterId")
.HasColumnType("char(36)");
b.Property<DateTime?>("DeletionTime")
.HasColumnName("DeletionTime")
.HasColumnType("datetime(6)");
b.Property<string>("Description")
.HasColumnType("longtext CHARACTER SET utf8mb4");
b.Property<string>("DisplayName")
.IsRequired()
.HasColumnName("DisplayName")
.HasColumnType("varchar(128) CHARACTER SET utf8mb4")
.HasMaxLength(128);
b.Property<string>("ExtraProperties")
.HasColumnName("ExtraProperties")
.HasColumnType("longtext CHARACTER SET utf8mb4");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnName("IsDeleted")
.HasColumnType("tinyint(1)")
.HasDefaultValue(false);
b.Property<DateTime?>("LastModificationTime")
.HasColumnName("LastModificationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("LastModifierId")
.HasColumnName("LastModifierId")
.HasColumnType("char(36)");
b.Property<string>("Name")
.IsRequired()
.HasColumnName("Name")
.HasColumnType("varchar(64) CHARACTER SET utf8mb4")
.HasMaxLength(64);
b.Property<Guid?>("ParentId")
.HasColumnType("char(36)");
b.Property<string>("Path")
.HasColumnName("Path")
.HasColumnType("varchar(255) CHARACTER SET utf8mb4")
.HasMaxLength(255);
b.Property<int>("PlatformType")
.HasColumnType("int");
b.Property<string>("Redirect")
.HasColumnName("Redirect")
.HasColumnType("varchar(255) CHARACTER SET utf8mb4")
.HasMaxLength(255);
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.HasKey("Id");
b.HasIndex("ParentId");
b.ToTable("AppPlatformMenus");
});
modelBuilder.Entity("LINGYUN.Platform.Menus.RoleMenu", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("CreatorId")
.HasColumnName("CreatorId")
.HasColumnType("char(36)");
b.Property<DateTime?>("LastModificationTime")
.HasColumnName("LastModificationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("LastModifierId")
.HasColumnName("LastModifierId")
.HasColumnType("char(36)");
b.Property<Guid>("MenuId")
.HasColumnType("char(36)");
b.Property<string>("RoleName")
.IsRequired()
.HasColumnName("RoleName")
.HasColumnType("varchar(256) CHARACTER SET utf8mb4")
.HasMaxLength(256);
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.HasKey("Id");
b.HasIndex("RoleName", "MenuId");
b.ToTable("AppPlatformRoleMenus");
});
modelBuilder.Entity("LINGYUN.Platform.Menus.UserMenu", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("CreatorId")
.HasColumnName("CreatorId")
.HasColumnType("char(36)");
b.Property<DateTime?>("LastModificationTime")
.HasColumnName("LastModificationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("LastModifierId")
.HasColumnName("LastModifierId")
.HasColumnType("char(36)");
b.Property<Guid>("MenuId")
.HasColumnType("char(36)");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.Property<Guid>("UserId")
.HasColumnType("char(36)");
b.HasKey("Id");
b.HasIndex("UserId", "MenuId");
b.ToTable("AppPlatformUserMenus");
});
modelBuilder.Entity("LINGYUN.Platform.Versions.AppVersion", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnName("ConcurrencyStamp")
.HasColumnType("varchar(40) CHARACTER SET utf8mb4")
.HasMaxLength(40);
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("CreatorId")
.HasColumnName("CreatorId")
.HasColumnType("char(36)");
b.Property<Guid?>("DeleterId")
.HasColumnName("DeleterId")
.HasColumnType("char(36)");
b.Property<DateTime?>("DeletionTime")
.HasColumnName("DeletionTime")
.HasColumnType("datetime(6)");
b.Property<string>("Description")
.HasColumnName("Description")
.HasColumnType("longtext CHARACTER SET utf8mb4")
.HasMaxLength(2048);
b.Property<string>("ExtraProperties")
.HasColumnName("ExtraProperties")
.HasColumnType("longtext CHARACTER SET utf8mb4");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnName("IsDeleted")
.HasColumnType("tinyint(1)")
.HasDefaultValue(false);
b.Property<DateTime?>("LastModificationTime")
.HasColumnName("LastModificationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("LastModifierId")
.HasColumnName("LastModifierId")
.HasColumnType("char(36)");
b.Property<int>("Level")
.HasColumnType("int");
b.Property<int>("PlatformType")
.HasColumnType("int");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.Property<string>("Title")
.IsRequired()
.HasColumnName("Title")
.HasColumnType("varchar(50) CHARACTER SET utf8mb4")
.HasMaxLength(50);
b.Property<string>("Version")
.IsRequired()
.HasColumnName("Version")
.HasColumnType("varchar(20) CHARACTER SET utf8mb4")
.HasMaxLength(20);
b.HasKey("Id");
b.HasIndex("Version");
b.ToTable("AppPlatformVersion");
});
modelBuilder.Entity("LINGYUN.Platform.Versions.VersionFile", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<Guid>("AppVersionId")
.HasColumnType("char(36)");
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("CreatorId")
.HasColumnName("CreatorId")
.HasColumnType("char(36)");
b.Property<int>("DownloadCount")
.HasColumnType("int");
b.Property<int>("FileType")
.HasColumnType("int");
b.Property<DateTime?>("LastModificationTime")
.HasColumnName("LastModificationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("LastModifierId")
.HasColumnName("LastModifierId")
.HasColumnType("char(36)");
b.Property<string>("Name")
.IsRequired()
.HasColumnName("Name")
.HasColumnType("varchar(255) CHARACTER SET utf8mb4")
.HasMaxLength(255);
b.Property<string>("Path")
.HasColumnName("Path")
.HasColumnType("varchar(255) CHARACTER SET utf8mb4")
.HasMaxLength(255);
b.Property<string>("SHA256")
.IsRequired()
.HasColumnName("SHA256")
.HasColumnType("varchar(65) CHARACTER SET utf8mb4")
.HasMaxLength(65);
b.Property<long>("Size")
.HasColumnType("bigint");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.Property<string>("Version")
.IsRequired()
.HasColumnName("Version")
.HasColumnType("varchar(20) CHARACTER SET utf8mb4")
.HasMaxLength(20);
b.HasKey("Id");
b.HasIndex("AppVersionId");
b.HasIndex("Path", "Name", "Version")
.IsUnique();
b.ToTable("AppPlatformVersionFile");
});
modelBuilder.Entity("LINGYUN.Platform.Datas.DataItem", b =>
{
b.HasOne("LINGYUN.Platform.Datas.Data", null)
.WithMany("Items")
.HasForeignKey("DataId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("LINGYUN.Platform.Menus.Menu", b =>
{
b.HasOne("LINGYUN.Platform.Menus.Menu", null)
.WithMany("Children")
.HasForeignKey("ParentId");
});
modelBuilder.Entity("LINGYUN.Platform.Versions.VersionFile", b =>
{
b.HasOne("LINGYUN.Platform.Versions.AppVersion", "AppVersion")
.WithMany("Files")
.HasForeignKey("AppVersionId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
#pragma warning restore 612, 618
}
}
}

40
aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/Migrations/20201204082313_Add-Data-Item-AllowBeNull-Field.cs

@ -1,40 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace LINGYUN.Platform.Migrations
{
public partial class AddDataItemAllowBeNullField : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "Component",
table: "AppPlatformMenus",
maxLength: 255,
nullable: false,
oldClrType: typeof(string),
oldType: "longtext CHARACTER SET utf8mb4",
oldNullable: true);
migrationBuilder.AddColumn<bool>(
name: "AllowBeNull",
table: "AppPlatformDataItems",
nullable: false,
defaultValue: false);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "AllowBeNull",
table: "AppPlatformDataItems");
migrationBuilder.AlterColumn<string>(
name: "Component",
table: "AppPlatformMenus",
type: "longtext CHARACTER SET utf8mb4",
nullable: true,
oldClrType: typeof(string),
oldMaxLength: 255);
}
}
}

645
aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/Migrations/20201204083250_Data-Description-Field-Allow-Be-Long.Designer.cs

@ -1,645 +0,0 @@
// <auto-generated />
using System;
using LINGYUN.Platform.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Volo.Abp.EntityFrameworkCore;
namespace LINGYUN.Platform.Migrations
{
[DbContext(typeof(PlatformHttpApiHostMigrationsDbContext))]
[Migration("20201204083250_Data-Description-Field-Allow-Be-Long")]
partial class DataDescriptionFieldAllowBeLong
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.MySql)
.HasAnnotation("ProductVersion", "3.1.8")
.HasAnnotation("Relational:MaxIdentifierLength", 64);
modelBuilder.Entity("LINGYUN.Platform.Datas.Data", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<string>("Code")
.IsRequired()
.HasColumnName("Code")
.HasColumnType("varchar(1024) CHARACTER SET utf8mb4")
.HasMaxLength(1024);
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnName("ConcurrencyStamp")
.HasColumnType("varchar(40) CHARACTER SET utf8mb4")
.HasMaxLength(40);
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("CreatorId")
.HasColumnName("CreatorId")
.HasColumnType("char(36)");
b.Property<Guid?>("DeleterId")
.HasColumnName("DeleterId")
.HasColumnType("char(36)");
b.Property<DateTime?>("DeletionTime")
.HasColumnName("DeletionTime")
.HasColumnType("datetime(6)");
b.Property<string>("Description")
.HasColumnName("Description")
.HasColumnType("varchar(1024) CHARACTER SET utf8mb4")
.HasMaxLength(1024);
b.Property<string>("DisplayName")
.IsRequired()
.HasColumnName("DisplayName")
.HasColumnType("varchar(128) CHARACTER SET utf8mb4")
.HasMaxLength(128);
b.Property<string>("ExtraProperties")
.HasColumnName("ExtraProperties")
.HasColumnType("longtext CHARACTER SET utf8mb4");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnName("IsDeleted")
.HasColumnType("tinyint(1)")
.HasDefaultValue(false);
b.Property<DateTime?>("LastModificationTime")
.HasColumnName("LastModificationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("LastModifierId")
.HasColumnName("LastModifierId")
.HasColumnType("char(36)");
b.Property<string>("Name")
.IsRequired()
.HasColumnName("Name")
.HasColumnType("varchar(30) CHARACTER SET utf8mb4")
.HasMaxLength(30);
b.Property<Guid?>("ParentId")
.HasColumnType("char(36)");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.HasKey("Id");
b.HasIndex("Name");
b.ToTable("AppPlatformDatas");
});
modelBuilder.Entity("LINGYUN.Platform.Datas.DataItem", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<bool>("AllowBeNull")
.ValueGeneratedOnAdd()
.HasColumnType("tinyint(1)")
.HasDefaultValue(true);
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnName("ConcurrencyStamp")
.HasColumnType("varchar(40) CHARACTER SET utf8mb4")
.HasMaxLength(40);
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("CreatorId")
.HasColumnName("CreatorId")
.HasColumnType("char(36)");
b.Property<Guid>("DataId")
.HasColumnType("char(36)");
b.Property<Guid?>("DeleterId")
.HasColumnName("DeleterId")
.HasColumnType("char(36)");
b.Property<DateTime?>("DeletionTime")
.HasColumnName("DeletionTime")
.HasColumnType("datetime(6)");
b.Property<string>("Description")
.HasColumnName("Description")
.HasColumnType("varchar(1024) CHARACTER SET utf8mb4")
.HasMaxLength(1024);
b.Property<string>("DisplayName")
.IsRequired()
.HasColumnName("DisplayName")
.HasColumnType("varchar(128) CHARACTER SET utf8mb4")
.HasMaxLength(128);
b.Property<string>("ExtraProperties")
.HasColumnName("ExtraProperties")
.HasColumnType("longtext CHARACTER SET utf8mb4");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnName("IsDeleted")
.HasColumnType("tinyint(1)")
.HasDefaultValue(false);
b.Property<DateTime?>("LastModificationTime")
.HasColumnName("LastModificationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("LastModifierId")
.HasColumnName("LastModifierId")
.HasColumnType("char(36)");
b.Property<string>("Name")
.IsRequired()
.HasColumnName("Name")
.HasColumnType("varchar(30) CHARACTER SET utf8mb4")
.HasMaxLength(30);
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.Property<string>("Value")
.IsRequired()
.HasColumnName("Value")
.HasColumnType("varchar(128) CHARACTER SET utf8mb4")
.HasMaxLength(128);
b.Property<int>("ValueType")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("DataId");
b.HasIndex("Name");
b.ToTable("AppPlatformDataItems");
});
modelBuilder.Entity("LINGYUN.Platform.Layouts.Layout", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<string>("Code")
.HasColumnType("longtext CHARACTER SET utf8mb4");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnName("ConcurrencyStamp")
.HasColumnType("varchar(40) CHARACTER SET utf8mb4")
.HasMaxLength(40);
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("CreatorId")
.HasColumnName("CreatorId")
.HasColumnType("char(36)");
b.Property<Guid>("DataId")
.HasColumnType("char(36)");
b.Property<Guid?>("DeleterId")
.HasColumnName("DeleterId")
.HasColumnType("char(36)");
b.Property<DateTime?>("DeletionTime")
.HasColumnName("DeletionTime")
.HasColumnType("datetime(6)");
b.Property<string>("Description")
.HasColumnType("longtext CHARACTER SET utf8mb4");
b.Property<string>("DisplayName")
.IsRequired()
.HasColumnName("DisplayName")
.HasColumnType("varchar(128) CHARACTER SET utf8mb4")
.HasMaxLength(128);
b.Property<string>("ExtraProperties")
.HasColumnName("ExtraProperties")
.HasColumnType("longtext CHARACTER SET utf8mb4");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnName("IsDeleted")
.HasColumnType("tinyint(1)")
.HasDefaultValue(false);
b.Property<DateTime?>("LastModificationTime")
.HasColumnName("LastModificationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("LastModifierId")
.HasColumnName("LastModifierId")
.HasColumnType("char(36)");
b.Property<string>("Name")
.IsRequired()
.HasColumnName("Name")
.HasColumnType("varchar(64) CHARACTER SET utf8mb4")
.HasMaxLength(64);
b.Property<string>("Path")
.HasColumnName("Path")
.HasColumnType("varchar(255) CHARACTER SET utf8mb4")
.HasMaxLength(255);
b.Property<int>("PlatformType")
.HasColumnType("int");
b.Property<string>("Redirect")
.HasColumnName("Redirect")
.HasColumnType("varchar(255) CHARACTER SET utf8mb4")
.HasMaxLength(255);
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.HasKey("Id");
b.ToTable("AppPlatformLayouts");
});
modelBuilder.Entity("LINGYUN.Platform.Menus.Menu", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<string>("Code")
.HasColumnType("longtext CHARACTER SET utf8mb4");
b.Property<string>("Component")
.IsRequired()
.HasColumnName("Component")
.HasColumnType("varchar(255) CHARACTER SET utf8mb4")
.HasMaxLength(255);
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnName("ConcurrencyStamp")
.HasColumnType("varchar(40) CHARACTER SET utf8mb4")
.HasMaxLength(40);
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("CreatorId")
.HasColumnName("CreatorId")
.HasColumnType("char(36)");
b.Property<Guid?>("DeleterId")
.HasColumnName("DeleterId")
.HasColumnType("char(36)");
b.Property<DateTime?>("DeletionTime")
.HasColumnName("DeletionTime")
.HasColumnType("datetime(6)");
b.Property<string>("Description")
.HasColumnType("longtext CHARACTER SET utf8mb4");
b.Property<string>("DisplayName")
.IsRequired()
.HasColumnName("DisplayName")
.HasColumnType("varchar(128) CHARACTER SET utf8mb4")
.HasMaxLength(128);
b.Property<string>("ExtraProperties")
.HasColumnName("ExtraProperties")
.HasColumnType("longtext CHARACTER SET utf8mb4");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnName("IsDeleted")
.HasColumnType("tinyint(1)")
.HasDefaultValue(false);
b.Property<DateTime?>("LastModificationTime")
.HasColumnName("LastModificationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("LastModifierId")
.HasColumnName("LastModifierId")
.HasColumnType("char(36)");
b.Property<string>("Name")
.IsRequired()
.HasColumnName("Name")
.HasColumnType("varchar(64) CHARACTER SET utf8mb4")
.HasMaxLength(64);
b.Property<Guid?>("ParentId")
.HasColumnType("char(36)");
b.Property<string>("Path")
.HasColumnName("Path")
.HasColumnType("varchar(255) CHARACTER SET utf8mb4")
.HasMaxLength(255);
b.Property<int>("PlatformType")
.HasColumnType("int");
b.Property<string>("Redirect")
.HasColumnName("Redirect")
.HasColumnType("varchar(255) CHARACTER SET utf8mb4")
.HasMaxLength(255);
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.HasKey("Id");
b.HasIndex("ParentId");
b.ToTable("AppPlatformMenus");
});
modelBuilder.Entity("LINGYUN.Platform.Menus.RoleMenu", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("CreatorId")
.HasColumnName("CreatorId")
.HasColumnType("char(36)");
b.Property<DateTime?>("LastModificationTime")
.HasColumnName("LastModificationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("LastModifierId")
.HasColumnName("LastModifierId")
.HasColumnType("char(36)");
b.Property<Guid>("MenuId")
.HasColumnType("char(36)");
b.Property<string>("RoleName")
.IsRequired()
.HasColumnName("RoleName")
.HasColumnType("varchar(256) CHARACTER SET utf8mb4")
.HasMaxLength(256);
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.HasKey("Id");
b.HasIndex("RoleName", "MenuId");
b.ToTable("AppPlatformRoleMenus");
});
modelBuilder.Entity("LINGYUN.Platform.Menus.UserMenu", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("CreatorId")
.HasColumnName("CreatorId")
.HasColumnType("char(36)");
b.Property<DateTime?>("LastModificationTime")
.HasColumnName("LastModificationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("LastModifierId")
.HasColumnName("LastModifierId")
.HasColumnType("char(36)");
b.Property<Guid>("MenuId")
.HasColumnType("char(36)");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.Property<Guid>("UserId")
.HasColumnType("char(36)");
b.HasKey("Id");
b.HasIndex("UserId", "MenuId");
b.ToTable("AppPlatformUserMenus");
});
modelBuilder.Entity("LINGYUN.Platform.Versions.AppVersion", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnName("ConcurrencyStamp")
.HasColumnType("varchar(40) CHARACTER SET utf8mb4")
.HasMaxLength(40);
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("CreatorId")
.HasColumnName("CreatorId")
.HasColumnType("char(36)");
b.Property<Guid?>("DeleterId")
.HasColumnName("DeleterId")
.HasColumnType("char(36)");
b.Property<DateTime?>("DeletionTime")
.HasColumnName("DeletionTime")
.HasColumnType("datetime(6)");
b.Property<string>("Description")
.HasColumnName("Description")
.HasColumnType("longtext CHARACTER SET utf8mb4")
.HasMaxLength(2048);
b.Property<string>("ExtraProperties")
.HasColumnName("ExtraProperties")
.HasColumnType("longtext CHARACTER SET utf8mb4");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnName("IsDeleted")
.HasColumnType("tinyint(1)")
.HasDefaultValue(false);
b.Property<DateTime?>("LastModificationTime")
.HasColumnName("LastModificationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("LastModifierId")
.HasColumnName("LastModifierId")
.HasColumnType("char(36)");
b.Property<int>("Level")
.HasColumnType("int");
b.Property<int>("PlatformType")
.HasColumnType("int");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.Property<string>("Title")
.IsRequired()
.HasColumnName("Title")
.HasColumnType("varchar(50) CHARACTER SET utf8mb4")
.HasMaxLength(50);
b.Property<string>("Version")
.IsRequired()
.HasColumnName("Version")
.HasColumnType("varchar(20) CHARACTER SET utf8mb4")
.HasMaxLength(20);
b.HasKey("Id");
b.HasIndex("Version");
b.ToTable("AppPlatformVersion");
});
modelBuilder.Entity("LINGYUN.Platform.Versions.VersionFile", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<Guid>("AppVersionId")
.HasColumnType("char(36)");
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("CreatorId")
.HasColumnName("CreatorId")
.HasColumnType("char(36)");
b.Property<int>("DownloadCount")
.HasColumnType("int");
b.Property<int>("FileType")
.HasColumnType("int");
b.Property<DateTime?>("LastModificationTime")
.HasColumnName("LastModificationTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("LastModifierId")
.HasColumnName("LastModifierId")
.HasColumnType("char(36)");
b.Property<string>("Name")
.IsRequired()
.HasColumnName("Name")
.HasColumnType("varchar(255) CHARACTER SET utf8mb4")
.HasMaxLength(255);
b.Property<string>("Path")
.HasColumnName("Path")
.HasColumnType("varchar(255) CHARACTER SET utf8mb4")
.HasMaxLength(255);
b.Property<string>("SHA256")
.IsRequired()
.HasColumnName("SHA256")
.HasColumnType("varchar(65) CHARACTER SET utf8mb4")
.HasMaxLength(65);
b.Property<long>("Size")
.HasColumnType("bigint");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("char(36)");
b.Property<string>("Version")
.IsRequired()
.HasColumnName("Version")
.HasColumnType("varchar(20) CHARACTER SET utf8mb4")
.HasMaxLength(20);
b.HasKey("Id");
b.HasIndex("AppVersionId");
b.HasIndex("Path", "Name", "Version")
.IsUnique();
b.ToTable("AppPlatformVersionFile");
});
modelBuilder.Entity("LINGYUN.Platform.Datas.DataItem", b =>
{
b.HasOne("LINGYUN.Platform.Datas.Data", null)
.WithMany("Items")
.HasForeignKey("DataId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("LINGYUN.Platform.Menus.Menu", b =>
{
b.HasOne("LINGYUN.Platform.Menus.Menu", null)
.WithMany("Children")
.HasForeignKey("ParentId");
});
modelBuilder.Entity("LINGYUN.Platform.Versions.VersionFile", b =>
{
b.HasOne("LINGYUN.Platform.Versions.AppVersion", "AppVersion")
.WithMany("Files")
.HasForeignKey("AppVersionId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
#pragma warning restore 612, 618
}
}
}

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save