From ab8e7cf909e2716cfc1c9fa03e9cb10cf0014be1 Mon Sep 17 00:00:00 2001 From: colin Date: Wed, 2 Apr 2025 10:12:44 +0800 Subject: [PATCH] feat(quartz): Database initialization for table checking --- .../LINGYUN.MicroService.SingleProject.sln | 12 +- .../LINGYUN.MicroService.TaskManagement.sln | 37 +++ ...INGYUN.MicroService.WebhooksManagement.sln | 7 + aspnet-core/LINGYUN.MicroService.Workflow.sln | 7 + .../appsettings.MySql.json | 258 +----------------- .../appsettings.PostgreSql.json | 225 +-------------- .../appsettings.SqlServer.json | 225 +-------------- .../Migrations/MySqlElsaDataBaseInstaller.cs | 16 +- .../AbpElsaDataBaseInstallerOptions.cs | 19 ++ .../LINGYUN.Abp.Quartz.MySqlInstaller.csproj | 5 +- .../AbpQuartzMySqlInstallerModule.cs | 6 +- .../MySqlInstaller/QuartzMySqlInstaller.cs | 28 +- .../Quartz/MySqlInstaller/Scripts/Initial.sql | 2 +- .../FodyWeavers.xml | 3 + .../FodyWeavers.xsd | 30 ++ .../LINGYUN.Abp.Quartz.SqlInstaller.csproj | 20 ++ .../AbpQuartzSqlInstallerModule.cs | 9 + .../AbpQuartzSqlInstallerOptions.cs | 25 ++ ...NGYUN.Abp.Quartz.SqlServerInstaller.csproj | 5 +- .../AbpQuartzSqlServerInstallerModule.cs | 6 +- .../QuartzSqlServerInstaller.cs | 18 +- .../SqlServerInstaller/Scripts/Initial.sql | 2 +- .../Program.cs | 3 +- .../appsettings.Development.json | 12 +- 24 files changed, 248 insertions(+), 732 deletions(-) create mode 100644 aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.EntityFrameworkCore/LINGYUN/Abp/Elsa/EntityFrameworkCore/Migrations/AbpElsaDataBaseInstallerOptions.cs create mode 100644 aspnet-core/modules/task-management/LINGYUN.Abp.Quartz.SqlInstaller/FodyWeavers.xml create mode 100644 aspnet-core/modules/task-management/LINGYUN.Abp.Quartz.SqlInstaller/FodyWeavers.xsd create mode 100644 aspnet-core/modules/task-management/LINGYUN.Abp.Quartz.SqlInstaller/LINGYUN.Abp.Quartz.SqlInstaller.csproj create mode 100644 aspnet-core/modules/task-management/LINGYUN.Abp.Quartz.SqlInstaller/LINGYUN/Abp/Quartz/SqlInstaller/AbpQuartzSqlInstallerModule.cs create mode 100644 aspnet-core/modules/task-management/LINGYUN.Abp.Quartz.SqlInstaller/LINGYUN/Abp/Quartz/SqlInstaller/AbpQuartzSqlInstallerOptions.cs diff --git a/aspnet-core/LINGYUN.MicroService.SingleProject.sln b/aspnet-core/LINGYUN.MicroService.SingleProject.sln index 919d209bd..f27551e27 100644 --- a/aspnet-core/LINGYUN.MicroService.SingleProject.sln +++ b/aspnet-core/LINGYUN.MicroService.SingleProject.sln @@ -671,6 +671,7 @@ EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.Quartz.MySqlInstaller", "modules\task-management\LINGYUN.Abp.Quartz.MySqlInstaller\LINGYUN.Abp.Quartz.MySqlInstaller.csproj", "{B6452D3F-E58C-C433-E52A-F65EE2657E01}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.Quartz.SqlServerInstaller", "modules\task-management\LINGYUN.Abp.Quartz.SqlServerInstaller\LINGYUN.Abp.Quartz.SqlServerInstaller.csproj", "{D613F393-9CEE-2D3B-33C9-90630F8348E7}" +EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.TaskManagement.HttpApi.Client", "modules\task-management\LINGYUN.Abp.TaskManagement.HttpApi.Client\LINGYUN.Abp.TaskManagement.HttpApi.Client.csproj", "{2A8DDC93-94B6-75B4-5B0C-DA72B1AD0E6A}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.Saas.HttpApi.Client", "modules\saas\LINGYUN.Abp.Saas.HttpApi.Client\LINGYUN.Abp.Saas.HttpApi.Client.csproj", "{311C3A82-3B01-79BD-F9C5-FCC2549A9A8D}" @@ -683,6 +684,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "elasticsearch", "elasticsea EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.Elasticsearch", "framework\elasticsearch\LINGYUN.Abp.Elasticsearch\LINGYUN.Abp.Elasticsearch.csproj", "{B8D0DCBD-8D03-E450-0258-D0660A356BF0}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.Quartz.SqlInstaller", "modules\task-management\LINGYUN.Abp.Quartz.SqlInstaller\LINGYUN.Abp.Quartz.SqlInstaller.csproj", "{A8586A5A-A213-4C66-819C-E692187B1F39}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -1817,6 +1820,10 @@ Global {B8D0DCBD-8D03-E450-0258-D0660A356BF0}.Debug|Any CPU.Build.0 = Debug|Any CPU {B8D0DCBD-8D03-E450-0258-D0660A356BF0}.Release|Any CPU.ActiveCfg = Release|Any CPU {B8D0DCBD-8D03-E450-0258-D0660A356BF0}.Release|Any CPU.Build.0 = Release|Any CPU + {A8586A5A-A213-4C66-819C-E692187B1F39}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A8586A5A-A213-4C66-819C-E692187B1F39}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A8586A5A-A213-4C66-819C-E692187B1F39}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A8586A5A-A213-4C66-819C-E692187B1F39}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -2142,14 +2149,15 @@ Global {40DC9A79-2E8A-4C6F-A637-5C09D6F26B0E} = {91867618-0D86-4410-91C6-B1166A9ACDF9} {CCC8A29C-1FC1-044F-895A-EC6894CDC8E5} = {91867618-0D86-4410-91C6-B1166A9ACDF9} {32F0884D-DA64-4659-AEB7-2717B977855F} = {0DF5AD76-AEEA-4052-A6CA-A44C24879F11} - {B6452D3F-E58C-C433-E52A-F65EE2657E01} = {D9C65C9D-8591-46DA-A3EE-419393E607AB} - {D613F393-9CEE-2D3B-33C9-90630F8348E7} = {D9C65C9D-8591-46DA-A3EE-419393E607AB} + {B6452D3F-E58C-C433-E52A-F65EE2657E01} = {91EE5D5B-B6DF-43F1-BC09-1A982719A34B} + {D613F393-9CEE-2D3B-33C9-90630F8348E7} = {91EE5D5B-B6DF-43F1-BC09-1A982719A34B} {2A8DDC93-94B6-75B4-5B0C-DA72B1AD0E6A} = {D9C65C9D-8591-46DA-A3EE-419393E607AB} {311C3A82-3B01-79BD-F9C5-FCC2549A9A8D} = {0DF5AD76-AEEA-4052-A6CA-A44C24879F11} {F2A31684-7A38-B77D-CCAA-C21B9A8B45CF} = {42F31C68-B8B2-4BE0-9AD0-A7DFA6092629} {77DFF548-13F4-9FE9-930B-B7642FF722A6} = {65CF5AD9-7D2A-4E31-B695-390B2D4A70D0} {22295ECE-A973-43F0-A6F2-982F7DB02F4E} = {99B7CBDE-A251-4738-97F0-DB1DB484BEE1} {B8D0DCBD-8D03-E450-0258-D0660A356BF0} = {22295ECE-A973-43F0-A6F2-982F7DB02F4E} + {A8586A5A-A213-4C66-819C-E692187B1F39} = {91EE5D5B-B6DF-43F1-BC09-1A982719A34B} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {711A43C0-A2F8-4E5C-9B9F-F2551E4B3FF1} diff --git a/aspnet-core/LINGYUN.MicroService.TaskManagement.sln b/aspnet-core/LINGYUN.MicroService.TaskManagement.sln index 84f9888fd..371275b10 100644 --- a/aspnet-core/LINGYUN.MicroService.TaskManagement.sln +++ b/aspnet-core/LINGYUN.MicroService.TaskManagement.sln @@ -174,6 +174,18 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.Quartz.MySqlIns EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.Quartz.SqlServerInstaller", "modules\task-management\LINGYUN.Abp.Quartz.SqlServerInstaller\LINGYUN.Abp.Quartz.SqlServerInstaller.csproj", "{D613F393-9CEE-2D3B-33C9-90630F8348E7}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.Quartz.SqlInstaller", "modules\task-management\LINGYUN.Abp.Quartz.SqlInstaller\LINGYUN.Abp.Quartz.SqlInstaller.csproj", "{0EEA73CA-D8DD-F044-045D-F070F8831E26}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "saas", "saas", "{DE7B8B71-635D-4113-AA49-B218D6998CEC}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.Saas.Domain.Shared", "modules\saas\LINGYUN.Abp.Saas.Domain.Shared\LINGYUN.Abp.Saas.Domain.Shared.csproj", "{1CC72170-6771-46A2-CDE4-57D826E3C841}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.Saas.Domain", "modules\saas\LINGYUN.Abp.Saas.Domain\LINGYUN.Abp.Saas.Domain.csproj", "{618C7EAF-8D6C-50B5-84E4-AE733CEA4A8C}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.Saas.EntityFrameworkCore", "modules\saas\LINGYUN.Abp.Saas.EntityFrameworkCore\LINGYUN.Abp.Saas.EntityFrameworkCore.csproj", "{F58A7141-AC0D-26EC-F22A-DF0DB1BA6955}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.MultiTenancy.Saas", "modules\saas\LINGYUN.Abp.MultiTenancy.Saas\LINGYUN.Abp.MultiTenancy.Saas.csproj", "{E09374FE-6B13-D69E-B171-94C63E6B80E5}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -448,6 +460,26 @@ Global {D613F393-9CEE-2D3B-33C9-90630F8348E7}.Debug|Any CPU.Build.0 = Debug|Any CPU {D613F393-9CEE-2D3B-33C9-90630F8348E7}.Release|Any CPU.ActiveCfg = Release|Any CPU {D613F393-9CEE-2D3B-33C9-90630F8348E7}.Release|Any CPU.Build.0 = Release|Any CPU + {0EEA73CA-D8DD-F044-045D-F070F8831E26}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0EEA73CA-D8DD-F044-045D-F070F8831E26}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0EEA73CA-D8DD-F044-045D-F070F8831E26}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0EEA73CA-D8DD-F044-045D-F070F8831E26}.Release|Any CPU.Build.0 = Release|Any CPU + {1CC72170-6771-46A2-CDE4-57D826E3C841}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1CC72170-6771-46A2-CDE4-57D826E3C841}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1CC72170-6771-46A2-CDE4-57D826E3C841}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1CC72170-6771-46A2-CDE4-57D826E3C841}.Release|Any CPU.Build.0 = Release|Any CPU + {618C7EAF-8D6C-50B5-84E4-AE733CEA4A8C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {618C7EAF-8D6C-50B5-84E4-AE733CEA4A8C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {618C7EAF-8D6C-50B5-84E4-AE733CEA4A8C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {618C7EAF-8D6C-50B5-84E4-AE733CEA4A8C}.Release|Any CPU.Build.0 = Release|Any CPU + {F58A7141-AC0D-26EC-F22A-DF0DB1BA6955}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F58A7141-AC0D-26EC-F22A-DF0DB1BA6955}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F58A7141-AC0D-26EC-F22A-DF0DB1BA6955}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F58A7141-AC0D-26EC-F22A-DF0DB1BA6955}.Release|Any CPU.Build.0 = Release|Any CPU + {E09374FE-6B13-D69E-B171-94C63E6B80E5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E09374FE-6B13-D69E-B171-94C63E6B80E5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E09374FE-6B13-D69E-B171-94C63E6B80E5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E09374FE-6B13-D69E-B171-94C63E6B80E5}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -520,6 +552,11 @@ Global {7CF83493-6AF5-9C6D-01A7-AC7FC11BC2CE} = {5A41C31A-B966-418B-B446-5BA1D7E61A62} {B6452D3F-E58C-C433-E52A-F65EE2657E01} = {385578CC-C0F1-4377-A7A2-682B8F416234} {D613F393-9CEE-2D3B-33C9-90630F8348E7} = {385578CC-C0F1-4377-A7A2-682B8F416234} + {0EEA73CA-D8DD-F044-045D-F070F8831E26} = {385578CC-C0F1-4377-A7A2-682B8F416234} + {1CC72170-6771-46A2-CDE4-57D826E3C841} = {DE7B8B71-635D-4113-AA49-B218D6998CEC} + {618C7EAF-8D6C-50B5-84E4-AE733CEA4A8C} = {DE7B8B71-635D-4113-AA49-B218D6998CEC} + {F58A7141-AC0D-26EC-F22A-DF0DB1BA6955} = {DE7B8B71-635D-4113-AA49-B218D6998CEC} + {E09374FE-6B13-D69E-B171-94C63E6B80E5} = {DE7B8B71-635D-4113-AA49-B218D6998CEC} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {E1FD1F4C-D344-408B-97CF-B6F1F6D7D293} diff --git a/aspnet-core/LINGYUN.MicroService.WebhooksManagement.sln b/aspnet-core/LINGYUN.MicroService.WebhooksManagement.sln index e30af9fe4..8c77ae6e5 100644 --- a/aspnet-core/LINGYUN.MicroService.WebhooksManagement.sln +++ b/aspnet-core/LINGYUN.MicroService.WebhooksManagement.sln @@ -171,6 +171,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.Quartz.MySqlIns EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.Quartz.SqlServerInstaller", "modules\task-management\LINGYUN.Abp.Quartz.SqlServerInstaller\LINGYUN.Abp.Quartz.SqlServerInstaller.csproj", "{D613F393-9CEE-2D3B-33C9-90630F8348E7}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.Quartz.SqlInstaller", "modules\task-management\LINGYUN.Abp.Quartz.SqlInstaller\LINGYUN.Abp.Quartz.SqlInstaller.csproj", "{0EEA73CA-D8DD-F044-045D-F070F8831E26}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -441,6 +443,10 @@ Global {D613F393-9CEE-2D3B-33C9-90630F8348E7}.Debug|Any CPU.Build.0 = Debug|Any CPU {D613F393-9CEE-2D3B-33C9-90630F8348E7}.Release|Any CPU.ActiveCfg = Release|Any CPU {D613F393-9CEE-2D3B-33C9-90630F8348E7}.Release|Any CPU.Build.0 = Release|Any CPU + {0EEA73CA-D8DD-F044-045D-F070F8831E26}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0EEA73CA-D8DD-F044-045D-F070F8831E26}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0EEA73CA-D8DD-F044-045D-F070F8831E26}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0EEA73CA-D8DD-F044-045D-F070F8831E26}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -526,6 +532,7 @@ Global {CE07B9F4-54E8-4E74-BE14-8E5C1FB7AFC8} = {03B4B0AA-83CE-4E4B-9CE2-47369BF88B97} {B6452D3F-E58C-C433-E52A-F65EE2657E01} = {8C3DF571-BAC3-48C4-B46A-AC0E0EAA9871} {D613F393-9CEE-2D3B-33C9-90630F8348E7} = {8C3DF571-BAC3-48C4-B46A-AC0E0EAA9871} + {0EEA73CA-D8DD-F044-045D-F070F8831E26} = {8C3DF571-BAC3-48C4-B46A-AC0E0EAA9871} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {80ED12A5-C899-459F-A181-ADCC9D680DE5} diff --git a/aspnet-core/LINGYUN.MicroService.Workflow.sln b/aspnet-core/LINGYUN.MicroService.Workflow.sln index aced25869..18ca08446 100644 --- a/aspnet-core/LINGYUN.MicroService.Workflow.sln +++ b/aspnet-core/LINGYUN.MicroService.Workflow.sln @@ -193,6 +193,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.Quartz.MySqlIns EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.Quartz.SqlServerInstaller", "modules\task-management\LINGYUN.Abp.Quartz.SqlServerInstaller\LINGYUN.Abp.Quartz.SqlServerInstaller.csproj", "{52F5A9DE-50B8-42C6-9980-E908DC6A4B52}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.Quartz.SqlInstaller", "modules\task-management\LINGYUN.Abp.Quartz.SqlInstaller\LINGYUN.Abp.Quartz.SqlInstaller.csproj", "{0EEA73CA-D8DD-F044-045D-F070F8831E26}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -507,6 +509,10 @@ Global {52F5A9DE-50B8-42C6-9980-E908DC6A4B52}.Debug|Any CPU.Build.0 = Debug|Any CPU {52F5A9DE-50B8-42C6-9980-E908DC6A4B52}.Release|Any CPU.ActiveCfg = Release|Any CPU {52F5A9DE-50B8-42C6-9980-E908DC6A4B52}.Release|Any CPU.Build.0 = Release|Any CPU + {0EEA73CA-D8DD-F044-045D-F070F8831E26}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0EEA73CA-D8DD-F044-045D-F070F8831E26}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0EEA73CA-D8DD-F044-045D-F070F8831E26}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0EEA73CA-D8DD-F044-045D-F070F8831E26}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -595,6 +601,7 @@ Global {7CF83493-6AF5-9C6D-01A7-AC7FC11BC2CE} = {6DA78E72-BA55-4ECF-97DB-6258174D3E2A} {B5C96536-6387-44F4-A2E2-D4D683588AF5} = {7844FF58-7DBF-46E1-88B7-9764382A4EE9} {52F5A9DE-50B8-42C6-9980-E908DC6A4B52} = {7844FF58-7DBF-46E1-88B7-9764382A4EE9} + {0EEA73CA-D8DD-F044-045D-F070F8831E26} = {7844FF58-7DBF-46E1-88B7-9764382A4EE9} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {6BB7A5DE-DA12-44DC-BC9B-0F6CA524346F} diff --git a/aspnet-core/migrations/LY.MicroService.Applications.Single.DbMigrator/appsettings.MySql.json b/aspnet-core/migrations/LY.MicroService.Applications.Single.DbMigrator/appsettings.MySql.json index 46715f0b1..ec70eb3f3 100644 --- a/aspnet-core/migrations/LY.MicroService.Applications.Single.DbMigrator/appsettings.MySql.json +++ b/aspnet-core/migrations/LY.MicroService.Applications.Single.DbMigrator/appsettings.MySql.json @@ -1,259 +1,5 @@ { - "App": { - "ShowPii": true, - "SelfUrl": "http://127.0.0.1:30001/", - "CorsOrigins": "http://127.0.0.1:3100,http://127.0.0.1:30001,http://localhost:9010", - "Urls": { - "Applications": { - "MVC": { - "RootUrl": "http://127.0.0.1:30001/", - "Urls": { - "Abp.Account.EmailConfirm": "Account/EmailConfirm", - "Abp.Account.EmailVerifyLogin": "Account/VerifyCode" - } - }, - "STS": { - "RootUrl": "http://127.0.0.1:30001/" - }, - "VueVbenAdmin": { - "RootUrl": "http://127.0.0.1:3100", - "Urls": { - "Abp.Account.EmailConfirm": "account/email-confirm" - } - } - } - } - }, - "Auditing": { - "AllEntitiesSelector": true - }, - "DistributedCache": { - "HideErrors": true, - "KeyPrefix": "LINGYUN.Abp.Application", - "GlobalCacheEntryOptions": { - "SlidingExpiration": "30:00:00", - "AbsoluteExpirationRelativeToNow": "60:00:00" - } - }, - "Databases": { - "Default": { - "DatabaseName": "Default", - "MappedConnections": [ - "AbpAuditLogging", - "AbpIdentity", - "AbpFeatureManagement", - "AbpSettingManagement", - "AbpPermissionManagement", - "AppPlatform", - "TaskManagement", - "Notifications", - "MessageService" - ], - "IsUsedByTenants": true - }, - "HostOnly": { - "DatabaseName": "HostDb", - "MappedConnections": [ - "AbpOpenIddict", - "AbpIdentityServer", - "AbpSaas", - "AbpTextTemplating", - "AbpLocalizationManagement", - "Workflow", - "Demo" - ], - "IsUsedByTenants": false - } - }, "ConnectionStrings": { - "Default": "Server=127.0.0.1;Database=Platform-V70;User Id=root;Password=123456;SslMode=None", - "HostOnly": "Server=127.0.0.1;Database=Platform-V70;User Id=root;Password=123456;SslMode=None" - }, - "DistributedLock": { - "IsEnabled": true, - "Redis": { - "Configuration": "127.0.0.1,defaultDatabase=14" - } - }, - "Elsa": { - "Features": { - "DefaultPersistence": { - "Enabled": true, - "ConnectionStringIdentifier": "Workflow", - "EntityFrameworkCore": { - "MySql": { - "Enabled": true - } - } - }, - "Console": true, - "Http": true, - "Email": true, - "TemporalQuartz": true, - "JavaScriptActivities": true, - "UserTask": true, - "Conductor": true, - "Telnyx": true, - "BlobStoring": true, - "Emailing": true, - "Notification": true, - "Sms": true, - "IM": true, - "PublishWebhook": true, - "Webhooks": { - "Enabled": true, - "ConnectionStringIdentifier": "Workflow", - "EntityFrameworkCore": { - "MySql": { - "Enabled": true - } - } - }, - "WorkflowSettings": { - "Enabled": true, - "ConnectionStringIdentifier": "Workflow", - "EntityFrameworkCore": { - "MySql": { - "Enabled": true - } - } - } - }, - "Server": { - "BaseUrl": "http://127.0.0.1:30000" - } - }, - "Quartz": { - "UsePersistentStore": false, - "Properties": { - "quartz.jobStore.dataSource": "tkm", - "quartz.jobStore.type": "Quartz.Impl.AdoJobStore.JobStoreTX,Quartz", - "quartz.jobStore.driverDelegateType": "Quartz.Impl.AdoJobStore.MySQLDelegate,Quartz", - "quartz.dataSource.tkm.connectionString": "Server=127.0.0.1;Database=Platform-V70;User Id=root;Password=123456", - "quartz.dataSource.tkm.connectionStringName": "TaskManagement", - "quartz.dataSource.tkm.provider": "MySqlConnector", - "quartz.jobStore.clustered": "true", - "quartz.serializer.type": "json" - } - }, - "Redis": { - "IsEnabled": true, - "Configuration": "127.0.0.1,defaultDatabase=15", - "InstanceName": "LINGYUN.Abp.Application" - }, - "AuthServer": { - "UseOpenIddict": true, - "Authority": "http://127.0.0.1:30001/", - "ApiName": "lingyun-abp-application", - "SwaggerClientId": "InternalServiceClient", - "SwaggerClientSecret": "1q2w3E*" - }, - "IdentityServer": { - "Clients": { - "VueAdmin": { - "ClientId": "vue-admin-client", - "RootUrl": "http://127.0.0.1:3100/" - }, - "InternalService": { - "ClientId": "InternalServiceClient" - } - } - }, - "OpenIddict": { - "Applications": { - "VueAdmin": { - "ClientId": "vue-admin-client", - "RootUrl": "http://127.0.0.1:3100/" - }, - "InternalService": { - "ClientId": "InternalServiceClient" - } - }, - "Lifetime": { - "AuthorizationCode": "00:05:00", - "AccessToken": "14:00:00", - "DeviceCode": "00:10:00", - "IdentityToken": "00:20:00", - "RefreshToken": "14:00:00", - "RefreshTokenReuseLeeway": "00:00:30", - "UserCode": "00:10:00" - } - }, - "Identity": { - "Password": { - "RequiredLength": 6, - "RequiredUniqueChars": 0, - "RequireNonAlphanumeric": false, - "RequireLowercase": false, - "RequireUppercase": false, - "RequireDigit": false - }, - "Lockout": { - "AllowedForNewUsers": false, - "LockoutDuration": 5, - "MaxFailedAccessAttempts": 5 - }, - "SignIn": { - "RequireConfirmedEmail": false, - "RequireConfirmedPhoneNumber": false - } - }, - "FeatureManagement": { - "IsDynamicStoreEnabled": true - }, - "SettingManagement": { - "IsDynamicStoreEnabled": true - }, - "PermissionManagement": { - "IsDynamicStoreEnabled": true - }, - "TextTemplating": { - "IsDynamicStoreEnabled": true - }, - "WebhooksManagement": { - "IsDynamicStoreEnabled": true - }, - "Logging": { - "Serilog": { - "Elasticsearch": { - "IndexFormat": "abp.dev.logging-{0:yyyy.MM.dd}" - } - } - }, - "AuditLogging": { - "Elasticsearch": { - "IndexPrefix": "abp.dev.auditing" - } - }, - "Elasticsearch": { - "NodeUris": "http://127.0.0.1:9200" - }, - "Serilog": { - "MinimumLevel": { - "Default": "Debug", - "Override": { - "System": "Warning", - "Microsoft": "Warning", - "DotNetCore": "Debug" - } - }, - "WriteTo": [ - { - "Name": "Console", - "Args": { - "restrictedToMinimumLevel": "Debug", - "outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss} [{Level:u3}] [{SourceContext}] [{ProcessId}] [{ThreadId}] - {Message:lj}{NewLine}{Exception}" - } - }, - { - "Name": "Elasticsearch", - "Args": { - "nodeUris": "http://127.0.0.1:9200", - "indexFormat": "abp.dev.logging-{0:yyyy.MM.dd}", - "autoRegisterTemplate": true, - "autoRegisterTemplateVersion": "ESv7" - } - } - ] + "Default": "Server=127.0.0.1;Database=Platform-V70;User Id=root;Password=123456;SslMode=None" //MySql } -} +} \ No newline at end of file diff --git a/aspnet-core/migrations/LY.MicroService.Applications.Single.DbMigrator/appsettings.PostgreSql.json b/aspnet-core/migrations/LY.MicroService.Applications.Single.DbMigrator/appsettings.PostgreSql.json index 6858f5041..7f403166d 100644 --- a/aspnet-core/migrations/LY.MicroService.Applications.Single.DbMigrator/appsettings.PostgreSql.json +++ b/aspnet-core/migrations/LY.MicroService.Applications.Single.DbMigrator/appsettings.PostgreSql.json @@ -1,228 +1,5 @@ { - "App": { - "ShowPii": true, - "SelfUrl": "http://127.0.0.1:30001/", - "CorsOrigins": "http://127.0.0.1:3100,http://127.0.0.1:30001", - "Urls": { - "Applications": { - "MVC": { - "RootUrl": "http://127.0.0.1:30001/", - "Urls": { - "Abp.Account.EmailConfirm": "Account/EmailConfirm", - "Abp.Account.EmailVerifyLogin": "Account/VerifyCode" - } - }, - "STS": { - "RootUrl": "http://127.0.0.1:30001/" - }, - "VueVbenAdmin": { - "RootUrl": "http://127.0.0.1:3100", - "Urls": { - "Abp.Account.EmailConfirm": "account/email-confirm" - } - } - } - } - }, - "Auditing": { - "AllEntitiesSelector": true - }, - "DistributedCache": { - "HideErrors": true, - "KeyPrefix": "LINGYUN.Abp.Application", - "GlobalCacheEntryOptions": { - "SlidingExpiration": "30:00:00", - "AbsoluteExpirationRelativeToNow": "60:00:00" - } - }, "ConnectionStrings": { "Default": "Host=127.0.0.1;Database=Platform-V70;Username=postgres;Password=123456;SslMode=Prefer" - }, - "DistributedLock": { - "IsEnabled": true, - "Redis": { - "Configuration": "127.0.0.1,defaultDatabase=14" - } - }, - "Elsa": { - "Features": { - "DefaultPersistence": { - "Enabled": true, - "ConnectionStringIdentifier": "Default", - "EntityFrameworkCore": { - "PostgreSql": { - "Enabled": true - } - } - }, - "Console": true, - "Http": true, - "Email": true, - "TemporalQuartz": true, - "JavaScriptActivities": true, - "UserTask": true, - "Conductor": true, - "Telnyx": true, - "BlobStoring": true, - "Emailing": true, - "Notification": true, - "Sms": true, - "IM": true, - "PublishWebhook": true, - "Webhooks": { - "Enabled": true, - "ConnectionStringIdentifier": "Default", - "EntityFrameworkCore": { - "PostgreSql": { - "Enabled": true - } - } - }, - "WorkflowSettings": { - "Enabled": true, - "ConnectionStringIdentifier": "Default", - "EntityFrameworkCore": { - "PostgreSql": { - "Enabled": true - } - } - } - }, - "Server": { - "BaseUrl": "http://127.0.0.1:30000" - } - }, - "Quartz": { - "UsePersistentStore": false, - "Properties": { - "quartz.jobStore.dataSource": "tkm", - "quartz.jobStore.type": "Quartz.Impl.AdoJobStore.JobStoreTX, Quartz", - "quartz.jobStore.driverDelegateType": "Quartz.Impl.AdoJobStore.PostgreSQLDelegate, Quartz", - "quartz.dataSource.tkm.connectionString": "Host=127.0.0.1;Database=Platform-V70;Username=postgres;Password=123456;", - "quartz.dataSource.tkm.provider": "Npgsql", - "quartz.jobStore.clustered": "true", - "quartz.serializer.type": "json", - "quartz.dataSource.tkm.connectionStringName": "TaskManagement" - } - }, - "Redis": { - "IsEnabled": true, - "Configuration": "127.0.0.1,defaultDatabase=15", - "InstanceName": "LINGYUN.Abp.Application" - }, - "AuthServer": { - "UseOpenIddict": true, - "Authority": "http://127.0.0.1:30001/", - "ApiName": "lingyun-abp-application", - "SwaggerClientId": "InternalServiceClient", - "SwaggerClientSecret": "1q2w3E*" - }, - "IdentityServer": { - "Clients": { - "VueAdmin": { - "ClientId": "vue-admin-client", - "RootUrl": "http://127.0.0.1:3100/" - }, - "InternalService": { - "ClientId": "InternalServiceClient" - } - } - }, - "OpenIddict": { - "Applications": { - "VueAdmin": { - "ClientId": "vue-admin-client", - "RootUrl": "http://127.0.0.1:3100/" - }, - "InternalService": { - "ClientId": "InternalServiceClient" - } - }, - "Lifetime": { - "AuthorizationCode": "00:05:00", - "AccessToken": "14:00:00", - "DeviceCode": "00:10:00", - "IdentityToken": "00:20:00", - "RefreshToken": "14:00:00", - "RefreshTokenReuseLeeway": "00:00:30", - "UserCode": "00:10:00" - } - }, - "Identity": { - "Password": { - "RequiredLength": 6, - "RequiredUniqueChars": 0, - "RequireNonAlphanumeric": false, - "RequireLowercase": false, - "RequireUppercase": false, - "RequireDigit": false - }, - "Lockout": { - "AllowedForNewUsers": false, - "LockoutDuration": 5, - "MaxFailedAccessAttempts": 5 - }, - "SignIn": { - "RequireConfirmedEmail": false, - "RequireConfirmedPhoneNumber": false - } - }, - "FeatureManagement": { - "IsDynamicStoreEnabled": true - }, - "SettingManagement": { - "IsDynamicStoreEnabled": true - }, - "PermissionManagement": { - "IsDynamicStoreEnabled": true - }, - "TextTemplating": { - "IsDynamicStoreEnabled": true - }, - "WebhooksManagement": { - "IsDynamicStoreEnabled": true - }, - "Logging": { - "Serilog": { - "Elasticsearch": { - "IndexFormat": "abp.dev.logging-{0:yyyy.MM.dd}" - } - } - }, - "AuditLogging": { - "Elasticsearch": { - "IndexPrefix": "abp.dev.auditing" - } - }, - "Elasticsearch": { - "NodeUris": "http://127.0.0.1:9200" - }, - "Serilog": { - "MinimumLevel": { - "Default": "Debug", - "Override": { - "System": "Warning", - "Microsoft": "Warning", - "DotNetCore": "Debug" - } - }, - "WriteTo": [ - { - "Name": "Console", - "Args": { - "restrictedToMinimumLevel": "Debug", - "outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss} [{Level:u3}] [{SourceContext}] [{ProcessId}] [{ThreadId}] - {Message:lj}{NewLine}{Exception}" - } - }, - { - "Name": "Elasticsearch", - "Args": { - "nodeUris": "http://127.0.0.1:9200", - "indexFormat": "abp.dev.logging-{0:yyyy.MM.dd}", - "autoRegisterTemplate": true, - "autoRegisterTemplateVersion": "ESv7" - } - } - ] } -} +} \ No newline at end of file diff --git a/aspnet-core/migrations/LY.MicroService.Applications.Single.DbMigrator/appsettings.SqlServer.json b/aspnet-core/migrations/LY.MicroService.Applications.Single.DbMigrator/appsettings.SqlServer.json index 555dab9fb..d1bf86312 100644 --- a/aspnet-core/migrations/LY.MicroService.Applications.Single.DbMigrator/appsettings.SqlServer.json +++ b/aspnet-core/migrations/LY.MicroService.Applications.Single.DbMigrator/appsettings.SqlServer.json @@ -1,228 +1,5 @@ { - "App": { - "ShowPii": true, - "SelfUrl": "http://127.0.0.1:30001/", - "CorsOrigins": "http://127.0.0.1:3100,http://127.0.0.1:30001", - "Urls": { - "Applications": { - "MVC": { - "RootUrl": "http://127.0.0.1:30001/", - "Urls": { - "Abp.Account.EmailConfirm": "Account/EmailConfirm", - "Abp.Account.EmailVerifyLogin": "Account/VerifyCode" - } - }, - "STS": { - "RootUrl": "http://127.0.0.1:30001/" - }, - "VueVbenAdmin": { - "RootUrl": "http://127.0.0.1:3100", - "Urls": { - "Abp.Account.EmailConfirm": "account/email-confirm" - } - } - } - } - }, - "Auditing": { - "AllEntitiesSelector": true - }, - "DistributedCache": { - "HideErrors": true, - "KeyPrefix": "LINGYUN.Abp.Application", - "GlobalCacheEntryOptions": { - "SlidingExpiration": "30:00:00", - "AbsoluteExpirationRelativeToNow": "60:00:00" - } - }, "ConnectionStrings": { "Default": "Server=127.0.0.1;Database=Platform-V70;User Id=sa;Password=yourStrong(!)Password;TrustServerCertificate=True" - }, - "DistributedLock": { - "IsEnabled": true, - "Redis": { - "Configuration": "127.0.0.1,defaultDatabase=14" - } - }, - "Elsa": { - "Features": { - "DefaultPersistence": { - "Enabled": true, - "ConnectionStringIdentifier": "Default", - "EntityFrameworkCore": { - "SqlServer": { - "Enabled": true - } - } - }, - "Console": true, - "Http": true, - "Email": true, - "TemporalQuartz": true, - "JavaScriptActivities": true, - "UserTask": true, - "Conductor": true, - "Telnyx": true, - "BlobStoring": true, - "Emailing": true, - "Notification": true, - "Sms": true, - "IM": true, - "PublishWebhook": true, - "Webhooks": { - "Enabled": true, - "ConnectionStringIdentifier": "Default", - "EntityFrameworkCore": { - "SqlServer": { - "Enabled": true - } - } - }, - "WorkflowSettings": { - "Enabled": true, - "ConnectionStringIdentifier": "Default", - "EntityFrameworkCore": { - "SqlServer": { - "Enabled": true - } - } - } - }, - "Server": { - "BaseUrl": "http://127.0.0.1:30000" - } - }, - "Quartz": { - "UsePersistentStore": false, - "Properties": { - "quartz.jobStore.dataSource": "tkm", - "quartz.jobStore.type": "Quartz.Impl.AdoJobStore.JobStoreTX, Quartz", - "quartz.jobStore.driverDelegateType": "Quartz.Impl.AdoJobStore.SqlServerDelegate, Quartz", - "quartz.dataSource.tkm.connectionString": "Server=127.0.0.1;Database=Platform-V70;User Id=sa;Password=yourStrong(!)Password;", - "quartz.dataSource.tkm.provider": "SqlServer", - "quartz.jobStore.clustered": "true", - "quartz.serializer.type": "json", - "quartz.dataSource.tkm.connectionStringName": "TaskManagement" - } - }, - "Redis": { - "IsEnabled": true, - "Configuration": "127.0.0.1,defaultDatabase=15", - "InstanceName": "LINGYUN.Abp.Application" - }, - "AuthServer": { - "UseOpenIddict": true, - "Authority": "http://127.0.0.1:30001/", - "ApiName": "lingyun-abp-application", - "SwaggerClientId": "InternalServiceClient", - "SwaggerClientSecret": "1q2w3E*" - }, - "IdentityServer": { - "Clients": { - "VueAdmin": { - "ClientId": "vue-admin-client", - "RootUrl": "http://127.0.0.1:3100/" - }, - "InternalService": { - "ClientId": "InternalServiceClient" - } - } - }, - "OpenIddict": { - "Applications": { - "VueAdmin": { - "ClientId": "vue-admin-client", - "RootUrl": "http://127.0.0.1:3100/" - }, - "InternalService": { - "ClientId": "InternalServiceClient" - } - }, - "Lifetime": { - "AuthorizationCode": "00:05:00", - "AccessToken": "14:00:00", - "DeviceCode": "00:10:00", - "IdentityToken": "00:20:00", - "RefreshToken": "14:00:00", - "RefreshTokenReuseLeeway": "00:00:30", - "UserCode": "00:10:00" - } - }, - "Identity": { - "Password": { - "RequiredLength": 6, - "RequiredUniqueChars": 0, - "RequireNonAlphanumeric": false, - "RequireLowercase": false, - "RequireUppercase": false, - "RequireDigit": false - }, - "Lockout": { - "AllowedForNewUsers": false, - "LockoutDuration": 5, - "MaxFailedAccessAttempts": 5 - }, - "SignIn": { - "RequireConfirmedEmail": false, - "RequireConfirmedPhoneNumber": false - } - }, - "FeatureManagement": { - "IsDynamicStoreEnabled": true - }, - "SettingManagement": { - "IsDynamicStoreEnabled": true - }, - "PermissionManagement": { - "IsDynamicStoreEnabled": true - }, - "TextTemplating": { - "IsDynamicStoreEnabled": true - }, - "WebhooksManagement": { - "IsDynamicStoreEnabled": true - }, - "Logging": { - "Serilog": { - "Elasticsearch": { - "IndexFormat": "abp.dev.logging-{0:yyyy.MM.dd}" - } - } - }, - "AuditLogging": { - "Elasticsearch": { - "IndexPrefix": "abp.dev.auditing" - } - }, - "Elasticsearch": { - "NodeUris": "http://127.0.0.1:9200" - }, - "Serilog": { - "MinimumLevel": { - "Default": "Debug", - "Override": { - "System": "Warning", - "Microsoft": "Warning", - "DotNetCore": "Debug" - } - }, - "WriteTo": [ - { - "Name": "Console", - "Args": { - "restrictedToMinimumLevel": "Debug", - "outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss} [{Level:u3}] [{SourceContext}] [{ProcessId}] [{ThreadId}] - {Message:lj}{NewLine}{Exception}" - } - }, - { - "Name": "Elasticsearch", - "Args": { - "nodeUris": "http://127.0.0.1:9200", - "indexFormat": "abp.dev.logging-{0:yyyy.MM.dd}", - "autoRegisterTemplate": true, - "autoRegisterTemplateVersion": "ESv7" - } - } - ] } -} +} \ No newline at end of file diff --git a/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.EntityFrameworkCore.MySql/LINGYUN/Abp/Elsa/EntityFrameworkCore/MySql/Migrations/MySqlElsaDataBaseInstaller.cs b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.EntityFrameworkCore.MySql/LINGYUN/Abp/Elsa/EntityFrameworkCore/MySql/Migrations/MySqlElsaDataBaseInstaller.cs index 2c3fbdddb..df3b137e5 100644 --- a/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.EntityFrameworkCore.MySql/LINGYUN/Abp/Elsa/EntityFrameworkCore/MySql/Migrations/MySqlElsaDataBaseInstaller.cs +++ b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.EntityFrameworkCore.MySql/LINGYUN/Abp/Elsa/EntityFrameworkCore/MySql/Migrations/MySqlElsaDataBaseInstaller.cs @@ -2,9 +2,12 @@ using Microsoft.Extensions.FileProviders; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging.Abstractions; +using Microsoft.Extensions.Options; using MySqlConnector; using System; +using System.Collections.Generic; using System.Data; +using System.Linq; using System.Threading.Tasks; using Volo.Abp.Data; using Volo.Abp.DependencyInjection; @@ -20,10 +23,14 @@ public class MySqlElsaDataBaseInstaller : IElsaDataBaseInstaller, ITransientDepe private readonly IVirtualFileProvider _virtualFileProvider; private readonly IConnectionStringResolver _connectionStringResolver; + private readonly AbpElsaDataBaseInstallerOptions _installerOptions; + public MySqlElsaDataBaseInstaller( IVirtualFileProvider virtualFileProvider, - IConnectionStringResolver connectionStringResolver) + IConnectionStringResolver connectionStringResolver, + IOptions installerOptions) { + _installerOptions = installerOptions.Value; _virtualFileProvider = virtualFileProvider; _connectionStringResolver = connectionStringResolver; @@ -52,9 +59,14 @@ public class MySqlElsaDataBaseInstaller : IElsaDataBaseInstaller, ITransientDepe await mySqlConnection.OpenAsync(); } - using (var mySqlCommand = new MySqlCommand("SELECT COUNT(1) FROM `information_schema`.`TABLES` WHERE `TABLE_SCHEMA` = @DataBaseName;", mySqlConnection)) + var tableParams = _installerOptions.InstallTables.Select((_, index) => $"@Table_{index}").JoinAsString(","); + using (var mySqlCommand = new MySqlCommand($"SELECT COUNT(1) FROM `information_schema`.`TABLES` WHERE `TABLE_SCHEMA` = @DataBaseName AND `TABLE_NAME` IN ({tableParams});", mySqlConnection)) { mySqlCommand.Parameters.Add("@DataBaseName", MySqlDbType.String).Value = dataBaseName; + for (var index = 0; index < _installerOptions.InstallTables.Count; index++) + { + mySqlCommand.Parameters.Add($"@Table_{index}", MySqlDbType.String).Value = _installerOptions.InstallTables[index]; + } var rowsAffects = await mySqlCommand.ExecuteScalarAsync() as long?; if (rowsAffects > 0) diff --git a/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.EntityFrameworkCore/LINGYUN/Abp/Elsa/EntityFrameworkCore/Migrations/AbpElsaDataBaseInstallerOptions.cs b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.EntityFrameworkCore/LINGYUN/Abp/Elsa/EntityFrameworkCore/Migrations/AbpElsaDataBaseInstallerOptions.cs new file mode 100644 index 000000000..01673f83e --- /dev/null +++ b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.EntityFrameworkCore/LINGYUN/Abp/Elsa/EntityFrameworkCore/Migrations/AbpElsaDataBaseInstallerOptions.cs @@ -0,0 +1,19 @@ +using System.Collections.Generic; + +namespace LINGYUN.Abp.Elsa.EntityFrameworkCore.Migrations; + +public class AbpElsaDataBaseInstallerOptions +{ + public IList InstallTables { get; } + public AbpElsaDataBaseInstallerOptions() + { + InstallTables = new List + { + "Bookmarks", + "WorkflowDefinitions", + "WorkflowExecutionLogRecords", + "WorkflowInstances", + "Triggers" + }; + } +} diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.Quartz.MySqlInstaller/LINGYUN.Abp.Quartz.MySqlInstaller.csproj b/aspnet-core/modules/task-management/LINGYUN.Abp.Quartz.MySqlInstaller/LINGYUN.Abp.Quartz.MySqlInstaller.csproj index 7f15d10c2..d7d5893ef 100644 --- a/aspnet-core/modules/task-management/LINGYUN.Abp.Quartz.MySqlInstaller/LINGYUN.Abp.Quartz.MySqlInstaller.csproj +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.Quartz.MySqlInstaller/LINGYUN.Abp.Quartz.MySqlInstaller.csproj @@ -22,9 +22,12 @@ - + + + + diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.Quartz.MySqlInstaller/LINGYUN/Abp/Quartz/MySqlInstaller/AbpQuartzMySqlInstallerModule.cs b/aspnet-core/modules/task-management/LINGYUN.Abp.Quartz.MySqlInstaller/LINGYUN/Abp/Quartz/MySqlInstaller/AbpQuartzMySqlInstallerModule.cs index 94b8e0422..ad7e167e9 100644 --- a/aspnet-core/modules/task-management/LINGYUN.Abp.Quartz.MySqlInstaller/LINGYUN/Abp/Quartz/MySqlInstaller/AbpQuartzMySqlInstallerModule.cs +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.Quartz.MySqlInstaller/LINGYUN/Abp/Quartz/MySqlInstaller/AbpQuartzMySqlInstallerModule.cs @@ -1,15 +1,15 @@ -using Microsoft.Extensions.Configuration; +using LINGYUN.Abp.Quartz.SqlInstaller; +using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using System.Threading.Tasks; using Volo.Abp; using Volo.Abp.Modularity; -using Volo.Abp.Quartz; using Volo.Abp.VirtualFileSystem; namespace LINGYUN.Abp.Quartz.MySqlInstaller; [DependsOn( - typeof(AbpQuartzModule), + typeof(AbpQuartzSqlInstallerModule), typeof(AbpVirtualFileSystemModule))] public class AbpQuartzMySqlInstallerModule : AbpModule { diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.Quartz.MySqlInstaller/LINGYUN/Abp/Quartz/MySqlInstaller/QuartzMySqlInstaller.cs b/aspnet-core/modules/task-management/LINGYUN.Abp.Quartz.MySqlInstaller/LINGYUN/Abp/Quartz/MySqlInstaller/QuartzMySqlInstaller.cs index 5358d43da..38f870cbd 100644 --- a/aspnet-core/modules/task-management/LINGYUN.Abp.Quartz.MySqlInstaller/LINGYUN/Abp/Quartz/MySqlInstaller/QuartzMySqlInstaller.cs +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.Quartz.MySqlInstaller/LINGYUN/Abp/Quartz/MySqlInstaller/QuartzMySqlInstaller.cs @@ -1,10 +1,14 @@ -using Microsoft.Extensions.FileProviders; +using LINGYUN.Abp.Quartz.SqlInstaller; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.FileProviders; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging.Abstractions; using Microsoft.Extensions.Options; using MySqlConnector; using System; +using System.Collections.Generic; using System.Data; +using System.Linq; using System.Threading.Tasks; using Volo.Abp.DependencyInjection; using Volo.Abp.Quartz; @@ -18,14 +22,20 @@ public class QuartzMySqlInstaller : ITransientDependency public ILogger Logger { protected get; set; } private readonly IVirtualFileProvider _virtualFileProvider; + private readonly AbpQuartzSqlInstallerOptions _installerOptions; private readonly AbpQuartzOptions _quartzOptions; + private readonly IConfiguration _configuration; public QuartzMySqlInstaller( + IConfiguration configuration, IVirtualFileProvider virtualFileProvider, - IOptions quartzOptions) + IOptions quartzOptions, + IOptions installerOptions) { + _configuration = configuration; _quartzOptions = quartzOptions.Value; _virtualFileProvider = virtualFileProvider; + _installerOptions = installerOptions.Value; Logger = NullLogger.Instance; } @@ -33,7 +43,13 @@ public class QuartzMySqlInstaller : ITransientDependency public async virtual Task InstallAsync() { var dataSource = _quartzOptions.Properties["quartz.jobStore.dataSource"] ?? AdoProviderOptions.DefaultDataSourceName; + var connectionString = _quartzOptions.Properties[$"quartz.dataSource.{dataSource}.connectionString"]; + var connectionStringName = _quartzOptions.Properties[$"quartz.dataSource.{dataSource}.connectionStringName"]; + if (connectionString.IsNullOrWhiteSpace() && !connectionStringName.IsNullOrWhiteSpace()) + { + connectionString = _configuration.GetConnectionString(connectionStringName); + } var tablePrefix = _quartzOptions.Properties["quartz.jobStore.tablePrefix"] ?? "QRTZ_"; if (connectionString.IsNullOrWhiteSpace()) @@ -57,10 +73,16 @@ public class QuartzMySqlInstaller : ITransientDependency await mySqlConnection.OpenAsync(); } - using (var mySqlCommand = new MySqlCommand("SELECT COUNT(1) FROM `information_schema`.`TABLES` WHERE `TABLE_SCHEMA` = @DataBaseName;", mySqlConnection)) + var tableParams = _installerOptions.InstallTables.Select((_, index) => $"@Table_{index}").JoinAsString(","); + using (var mySqlCommand = new MySqlCommand($"SELECT COUNT(1) FROM `information_schema`.`TABLES` WHERE `TABLE_SCHEMA` = @DataBaseName AND `TABLE_NAME` IN ({tableParams});", mySqlConnection)) { mySqlCommand.Parameters.Add("@DataBaseName", MySqlDbType.String).Value = dataBaseName; + for (var index = 0; index < _installerOptions.InstallTables.Count; index++) + { + mySqlCommand.Parameters.Add($"@Table_{index}", MySqlDbType.String).Value = $"{tablePrefix}{_installerOptions.InstallTables[index]}"; + } + var rowsAffects = await mySqlCommand.ExecuteScalarAsync() as long?; if (rowsAffects > 0) { diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.Quartz.MySqlInstaller/LINGYUN/Abp/Quartz/MySqlInstaller/Scripts/Initial.sql b/aspnet-core/modules/task-management/LINGYUN.Abp.Quartz.MySqlInstaller/LINGYUN/Abp/Quartz/MySqlInstaller/Scripts/Initial.sql index 85a70bfff..e79264d8f 100644 --- a/aspnet-core/modules/task-management/LINGYUN.Abp.Quartz.MySqlInstaller/LINGYUN/Abp/Quartz/MySqlInstaller/Scripts/Initial.sql +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.Quartz.MySqlInstaller/LINGYUN/Abp/Quartz/MySqlInstaller/Scripts/Initial.sql @@ -24,7 +24,7 @@ SCHED_NAME VARCHAR(120) NOT NULL, JOB_NAME VARCHAR(200) NOT NULL, JOB_GROUP VARCHAR(200) NOT NULL, DESCRIPTION VARCHAR(250) NULL, -JOB_CLASS_NAME VARCHAR(250) NOT NULL, +JOB_CLASS_NAME VARCHAR(512) NOT NULL, IS_DURABLE BOOLEAN NOT NULL, IS_NONCONCURRENT BOOLEAN NOT NULL, IS_UPDATE_DATA BOOLEAN NOT NULL, diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.Quartz.SqlInstaller/FodyWeavers.xml b/aspnet-core/modules/task-management/LINGYUN.Abp.Quartz.SqlInstaller/FodyWeavers.xml new file mode 100644 index 000000000..1715698cc --- /dev/null +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.Quartz.SqlInstaller/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.Quartz.SqlInstaller/FodyWeavers.xsd b/aspnet-core/modules/task-management/LINGYUN.Abp.Quartz.SqlInstaller/FodyWeavers.xsd new file mode 100644 index 000000000..3f3946e28 --- /dev/null +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.Quartz.SqlInstaller/FodyWeavers.xsd @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.Quartz.SqlInstaller/LINGYUN.Abp.Quartz.SqlInstaller.csproj b/aspnet-core/modules/task-management/LINGYUN.Abp.Quartz.SqlInstaller/LINGYUN.Abp.Quartz.SqlInstaller.csproj new file mode 100644 index 000000000..c5c565491 --- /dev/null +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.Quartz.SqlInstaller/LINGYUN.Abp.Quartz.SqlInstaller.csproj @@ -0,0 +1,20 @@ + + + + + + + netstandard2.0;netstandard2.1;net8.0;net9.0 + LINGYUN.Abp.Quartz.SqlInstaller + LINGYUN.Abp.Quartz.SqlInstaller + false + false + false + + + + + + + + diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.Quartz.SqlInstaller/LINGYUN/Abp/Quartz/SqlInstaller/AbpQuartzSqlInstallerModule.cs b/aspnet-core/modules/task-management/LINGYUN.Abp.Quartz.SqlInstaller/LINGYUN/Abp/Quartz/SqlInstaller/AbpQuartzSqlInstallerModule.cs new file mode 100644 index 000000000..4f5fd6a66 --- /dev/null +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.Quartz.SqlInstaller/LINGYUN/Abp/Quartz/SqlInstaller/AbpQuartzSqlInstallerModule.cs @@ -0,0 +1,9 @@ +using Volo.Abp.Modularity; +using Volo.Abp.Quartz; + +namespace LINGYUN.Abp.Quartz.SqlInstaller; + +[DependsOn(typeof(AbpQuartzModule))] +public class AbpQuartzSqlInstallerModule : AbpModule +{ +} diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.Quartz.SqlInstaller/LINGYUN/Abp/Quartz/SqlInstaller/AbpQuartzSqlInstallerOptions.cs b/aspnet-core/modules/task-management/LINGYUN.Abp.Quartz.SqlInstaller/LINGYUN/Abp/Quartz/SqlInstaller/AbpQuartzSqlInstallerOptions.cs new file mode 100644 index 000000000..39889fff1 --- /dev/null +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.Quartz.SqlInstaller/LINGYUN/Abp/Quartz/SqlInstaller/AbpQuartzSqlInstallerOptions.cs @@ -0,0 +1,25 @@ +using System.Collections.Generic; + +namespace LINGYUN.Abp.Quartz.SqlInstaller; + +public class AbpQuartzSqlInstallerOptions +{ + public IList InstallTables { get; } + public AbpQuartzSqlInstallerOptions() + { + InstallTables = new List + { + "FIRED_TRIGGERS", + "PAUSED_TRIGGER_GRPS", + "SCHEDULER_STATE", + "LOCKS", + "SIMPLE_TRIGGERS", + "SIMPROP_TRIGGERS", + "CRON_TRIGGERS", + "BLOB_TRIGGERS", + "TRIGGERS", + "JOB_DETAILS", + "CALENDARS", + }; + } +} diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.Quartz.SqlServerInstaller/LINGYUN.Abp.Quartz.SqlServerInstaller.csproj b/aspnet-core/modules/task-management/LINGYUN.Abp.Quartz.SqlServerInstaller/LINGYUN.Abp.Quartz.SqlServerInstaller.csproj index e8ae8b21b..5647f4c23 100644 --- a/aspnet-core/modules/task-management/LINGYUN.Abp.Quartz.SqlServerInstaller/LINGYUN.Abp.Quartz.SqlServerInstaller.csproj +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.Quartz.SqlServerInstaller/LINGYUN.Abp.Quartz.SqlServerInstaller.csproj @@ -22,9 +22,12 @@ - + + + + diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.Quartz.SqlServerInstaller/LINGYUN/Abp/Quartz/SqlServerInstaller/AbpQuartzSqlServerInstallerModule.cs b/aspnet-core/modules/task-management/LINGYUN.Abp.Quartz.SqlServerInstaller/LINGYUN/Abp/Quartz/SqlServerInstaller/AbpQuartzSqlServerInstallerModule.cs index 0e8eabe51..51c23e512 100644 --- a/aspnet-core/modules/task-management/LINGYUN.Abp.Quartz.SqlServerInstaller/LINGYUN/Abp/Quartz/SqlServerInstaller/AbpQuartzSqlServerInstallerModule.cs +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.Quartz.SqlServerInstaller/LINGYUN/Abp/Quartz/SqlServerInstaller/AbpQuartzSqlServerInstallerModule.cs @@ -1,15 +1,15 @@ -using Microsoft.Extensions.Configuration; +using LINGYUN.Abp.Quartz.SqlInstaller; +using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using System.Threading.Tasks; using Volo.Abp; using Volo.Abp.Modularity; -using Volo.Abp.Quartz; using Volo.Abp.VirtualFileSystem; namespace LINGYUN.Abp.Quartz.SqlServerInstaller; [DependsOn( - typeof(AbpQuartzModule), + typeof(AbpQuartzSqlInstallerModule), typeof(AbpVirtualFileSystemModule))] public class AbpQuartzSqlServerInstallerModule : AbpModule { diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.Quartz.SqlServerInstaller/LINGYUN/Abp/Quartz/SqlServerInstaller/QuartzSqlServerInstaller.cs b/aspnet-core/modules/task-management/LINGYUN.Abp.Quartz.SqlServerInstaller/LINGYUN/Abp/Quartz/SqlServerInstaller/QuartzSqlServerInstaller.cs index ec2d3460e..9265c37a5 100644 --- a/aspnet-core/modules/task-management/LINGYUN.Abp.Quartz.SqlServerInstaller/LINGYUN/Abp/Quartz/SqlServerInstaller/QuartzSqlServerInstaller.cs +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.Quartz.SqlServerInstaller/LINGYUN/Abp/Quartz/SqlServerInstaller/QuartzSqlServerInstaller.cs @@ -1,10 +1,13 @@ -using Microsoft.Data.SqlClient; +using LINGYUN.Abp.Quartz.SqlInstaller; +using Microsoft.Data.SqlClient; using Microsoft.Extensions.FileProviders; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging.Abstractions; using Microsoft.Extensions.Options; using System; +using System.Collections.Generic; using System.Data; +using System.Linq; using System.Threading.Tasks; using Volo.Abp.DependencyInjection; using Volo.Abp.Quartz; @@ -18,14 +21,17 @@ public class QuartzSqlServerInstaller : ITransientDependency public ILogger Logger { protected get; set; } private readonly IVirtualFileProvider _virtualFileProvider; + private readonly AbpQuartzSqlInstallerOptions _installerOptions; private readonly AbpQuartzOptions _quartzOptions; public QuartzSqlServerInstaller( IVirtualFileProvider virtualFileProvider, - IOptions quartzOptions) + IOptions quartzOptions, + IOptions installerOptions) { _quartzOptions = quartzOptions.Value; _virtualFileProvider = virtualFileProvider; + _installerOptions = installerOptions.Value; Logger = NullLogger.Instance; } @@ -57,10 +63,16 @@ public class QuartzSqlServerInstaller : ITransientDependency await sqlConnection.OpenAsync(); } - using (var sqlCommand = new SqlCommand("SELECT COUNT(1) FROM [sys].[objects] WHERE type=N'U'", sqlConnection)) + var tableParams = _installerOptions.InstallTables.Select((_, index) => $"@Table_{index}").JoinAsString(","); + using (var sqlCommand = new SqlCommand($"SELECT COUNT(1) FROM [sys].[objects] WHERE type=N'U' AND name IN ({tableParams})", sqlConnection)) { sqlCommand.Parameters.Add("@DataBaseName", SqlDbType.NVarChar).Value = dataBaseName; + for (var index = 0; index < _installerOptions.InstallTables.Count; index++) + { + sqlCommand.Parameters.Add($"@Table_{index}", SqlDbType.NVarChar).Value = $"{tablePrefix}{_installerOptions.InstallTables[index]}"; + } + var rowsAffects = await sqlCommand.ExecuteScalarAsync() as long?; if (rowsAffects > 0) { diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.Quartz.SqlServerInstaller/LINGYUN/Abp/Quartz/SqlServerInstaller/Scripts/Initial.sql b/aspnet-core/modules/task-management/LINGYUN.Abp.Quartz.SqlServerInstaller/LINGYUN/Abp/Quartz/SqlServerInstaller/Scripts/Initial.sql index 5c4478d7d..d95fa9574 100644 --- a/aspnet-core/modules/task-management/LINGYUN.Abp.Quartz.SqlServerInstaller/LINGYUN/Abp/Quartz/SqlServerInstaller/Scripts/Initial.sql +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.Quartz.SqlServerInstaller/LINGYUN/Abp/Quartz/SqlServerInstaller/Scripts/Initial.sql @@ -144,7 +144,7 @@ CREATE TABLE [dbo].[${TablePrefix}JOB_DETAILS] ( [JOB_NAME] nvarchar(150) NOT NULL, [JOB_GROUP] nvarchar(150) NOT NULL, [DESCRIPTION] nvarchar(250) NULL, - [JOB_CLASS_NAME] nvarchar(250) NOT NULL, + [JOB_CLASS_NAME] nvarchar(512) NOT NULL, [IS_DURABLE] bit NOT NULL, [IS_NONCONCURRENT] bit NOT NULL, [IS_UPDATE_DATA] bit NOT NULL, diff --git a/aspnet-core/services/LY.MicroService.Applications.Single/Program.cs b/aspnet-core/services/LY.MicroService.Applications.Single/Program.cs index 898e912cc..a180dbc14 100644 --- a/aspnet-core/services/LY.MicroService.Applications.Single/Program.cs +++ b/aspnet-core/services/LY.MicroService.Applications.Single/Program.cs @@ -31,8 +31,7 @@ builder.Host.AddAppSettingsSecretsJson() .ConfigureAppConfiguration((context, config) => { var configuration = config.Build(); - var agileConfigEnabled = configuration["AgileConfig:IsEnabled"]; - if (agileConfigEnabled.IsNullOrEmpty() || bool.Parse(agileConfigEnabled)) + if (configuration.GetValue("AgileConfig:IsEnabled", false)) { config.AddAgileConfig(new AgileConfig.Client.ConfigClient(configuration)); } diff --git a/aspnet-core/services/LY.MicroService.Applications.Single/appsettings.Development.json b/aspnet-core/services/LY.MicroService.Applications.Single/appsettings.Development.json index 05c826ae1..8cb0069e9 100644 --- a/aspnet-core/services/LY.MicroService.Applications.Single/appsettings.Development.json +++ b/aspnet-core/services/LY.MicroService.Applications.Single/appsettings.Development.json @@ -74,7 +74,7 @@ "Features": { "DefaultPersistence": { "Enabled": true, - "ConnectionStringIdentifier": "Workflow", + "ConnectionStringIdentifier": "Default", "EntityFrameworkCore": { "MySql": { "Enabled": true @@ -97,7 +97,7 @@ "PublishWebhook": true, "Webhooks": { "Enabled": true, - "ConnectionStringIdentifier": "Workflow", + "ConnectionStringIdentifier": "Default", "EntityFrameworkCore": { "MySql": { "Enabled": true @@ -106,7 +106,7 @@ }, "WorkflowSettings": { "Enabled": true, - "ConnectionStringIdentifier": "Workflow", + "ConnectionStringIdentifier": "Default", "EntityFrameworkCore": { "MySql": { "Enabled": true @@ -119,13 +119,13 @@ } }, "Quartz": { - "UsePersistentStore": false, + "UsePersistentStore": true, "Properties": { "quartz.jobStore.dataSource": "tkm", "quartz.jobStore.type": "Quartz.Impl.AdoJobStore.JobStoreTX,Quartz", "quartz.jobStore.driverDelegateType": "Quartz.Impl.AdoJobStore.MySQLDelegate,Quartz", - "quartz.dataSource.tkm.connectionString": "Server=127.0.0.1;Database=Platform-V70;User Id=root;Password=123456", - "quartz.dataSource.tkm.connectionStringName": "TaskManagement", + "quartz.dataSource.tkm.connectionString": "Server=127.0.0.1;Database=Platform-V70;User Id=root;Password=123456;SslMode=None", + "quartz.dataSource.tkm.connectionStringName": "Default", "quartz.dataSource.tkm.provider": "MySqlConnector", "quartz.jobStore.clustered": "true", "quartz.serializer.type": "json"