diff --git a/Directory.Build.props b/Directory.Build.props index 69c61b6beb..fa2a7fea8d 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,7 +1,7 @@ Elsa Workflows Community - 2024 + 2025 https://github.com/elsa-workflows/elsa-core https://github.com/elsa-workflows/elsa-core diff --git a/Directory.Packages.props b/Directory.Packages.props index 66a6882246..7510cde914 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -1,169 +1,225 @@ - - true - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + true + false + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Elsa.sln b/Elsa.sln index 6be65074b5..d67f34f16a 100644 --- a/Elsa.sln +++ b/Elsa.sln @@ -24,20 +24,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "doc", "doc", "{0354F050-399 EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "modules", "modules", "{5BA4A8FA-F7F4-45B3-AEC8-8886D35AAC79}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Elsa.Quartz", "src\modules\Elsa.Quartz\Elsa.Quartz.csproj", "{7D5A49B4-9A9B-496E-803B-DEB85B2C3132}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Elsa.Http", "src\modules\Elsa.Http\Elsa.Http.csproj", "{82E26BF9-5F3A-4365-899A-AB1FFD54AA45}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Elsa.Scheduling", "src\modules\Elsa.Scheduling\Elsa.Scheduling.csproj", "{ACD65CE5-3CC2-47B1-BFAC-72443D764F6E}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Elsa.JavaScript", "src\modules\Elsa.JavaScript\Elsa.JavaScript.csproj", "{D31581AB-A6C1-4B73-AB63-45667F6C82AE}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Elsa.Hangfire", "src\modules\Elsa.Hangfire\Elsa.Hangfire.csproj", "{0601A2A6-2C62-418B-9104-8CDE497E5283}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Elsa.WorkflowContexts", "src\modules\Elsa.WorkflowContexts\Elsa.WorkflowContexts.csproj", "{302BFC43-ED2F-43AE-8AD4-FCD481B0AC67}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Elsa.MassTransit", "src\modules\Elsa.MassTransit\Elsa.MassTransit.csproj", "{BB983D0B-A939-4008-B9E3-C7C172BCF83A}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{90031D64-CA0F-46D0-9AF4-8DC023A5FFCD}" ProjectSection(SolutionItems) = preProject test\Directory.Build.props = test\Directory.Build.props @@ -45,12 +31,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{90031D64-C EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Elsa.Labels", "src\modules\Elsa.Labels\Elsa.Labels.csproj", "{80FF5821-E831-450D-AA0C-C76D07D878F4}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Elsa.Liquid", "src\modules\Elsa.Liquid\Elsa.Liquid.csproj", "{8E5BD3D9-3529-48BC-B741-CFB7A69DB233}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Elsa.Workflows.Runtime.ProtoActor", "src\modules\Elsa.Workflows.Runtime.ProtoActor\Elsa.Workflows.Runtime.ProtoActor.csproj", "{B2049499-D384-46DF-8837-F1180107DD54}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Elsa.Dsl", "src\modules\Elsa.Dsl\Elsa.Dsl.csproj", "{78DAB791-8595-4612-8E9E-2248AF5B1862}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Elsa.Workflows.Api", "src\modules\Elsa.Workflows.Api\Elsa.Workflows.Api.csproj", "{C9539BD8-D2AE-4A8D-8281-71A05B3FBF31}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Elsa.Workflows.Core", "src\modules\Elsa.Workflows.Core\Elsa.Workflows.Core.csproj", "{169E2C9B-6687-427F-A278-30BF849BFEDC}" @@ -69,10 +49,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Elsa.Identity", "src\module EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Elsa.Common", "src\modules\Elsa.Common\Elsa.Common.csproj", "{D229105F-6879-4452-9189-75DE060C0F4C}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Elsa.EntityFrameworkCore", "src\modules\Elsa.EntityFrameworkCore\Elsa.EntityFrameworkCore.csproj", "{7CC95512-7F44-45C3-A669-95B7048D4730}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Elsa.Email", "src\modules\Elsa.Email\Elsa.Email.csproj", "{1E5BD8D9-55BE-41E2-B389-6AB9F26C22AF}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docker", "docker", "{986E5482-0482-448C-B9E4-EC67A9474B85}" ProjectSection(SolutionItems) = preProject docker\.dockerignore = docker\.dockerignore @@ -86,10 +62,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docker", "docker", "{986E54 docker\otel-collector-config.yaml = docker\otel-collector-config.yaml EndProjectSection EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Elsa.Elasticsearch", "src\modules\Elsa.Elasticsearch\Elsa.Elasticsearch.csproj", "{3246883E-2FA7-4B4A-BDC5-99039A2869BC}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Elsa.Webhooks", "src\modules\Elsa.Webhooks\Elsa.Webhooks.csproj", "{2BBFDE36-28A7-4875-8EBE-CC25C76B97FF}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "unit", "unit", "{18453B51-25EB-4317-A4B3-B10518252E92}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "integration", "integration", "{1B8D5897-902E-4632-8698-E89CAF3DDF54}" @@ -107,78 +79,18 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Elsa.Api.Client", "src\clie EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Elsa.Environments", "src\modules\Elsa.Environments\Elsa.Environments.csproj", "{B5CDF747-8066-40D5-9BAE-CBE397BC9B51}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "persistence", "persistence", "{9B4F139F-7D26-435C-A561-89E65A67A8E5}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "scripting", "scripting", "{6EF07978-A6D2-40EB-891D-7D70C5F37E76}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "servicebus", "servicebus", "{DD089B8B-DA73-492A-9010-F772D1C178DA}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "expressions", "expressions", "{6EF07978-A6D2-40EB-891D-7D70C5F37E76}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "security", "security", "{5948B0A5-7873-4DBB-BA03-EB283D6EA91B}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{B08B4E00-C2AB-48F3-8389-449F42AEF179}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "timers", "timers", "{AB797AF0-C12C-46DE-A157-7E25625C6200}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "runtimes", "runtimes", "{58C59255-281C-4595-8732-808158F1DC6E}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Elsa.Dapper", "src\modules\Elsa.Dapper\Elsa.Dapper.csproj", "{4D8F3BB2-709D-481A-8FD3-0DA9762B366D}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Elsa.Dapper.Migrations", "src\modules\Elsa.Dapper.Migrations\Elsa.Dapper.Migrations.csproj", "{A86DF0F0-24E9-470E-984B-9E7332544972}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Elsa.WorkflowProviders.BlobStorage", "src\modules\Elsa.WorkflowProviders.BlobStorage\Elsa.WorkflowProviders.BlobStorage.csproj", "{A702DD84-B55C-4807-9C28-D8F5AC3CCA78}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Elsa.MongoDb", "src\modules\Elsa.MongoDb\Elsa.MongoDb.csproj", "{3A377A6A-F735-4010-9E00-72E8BEB8F1F2}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Elsa.Mediator", "src\common\Elsa.Mediator\Elsa.Mediator.csproj", "{28818676-F6AF-4203-8B65-BD33A50CB9A2}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Elsa.Workflows.Core.UnitTests", "test\unit\Elsa.Workflows.Core.UnitTests\Elsa.Workflows.Core.UnitTests.csproj", "{DC9CCAD0-7363-4691-B964-FF5B3AEA3F95}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Elsa.DropIns.Core", "src\common\Elsa.DropIns.Core\Elsa.DropIns.Core.csproj", "{1B794B9C-9B8A-4D5A-9848-B51274BD1FC5}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Elsa.DropIns", "src\common\Elsa.DropIns\Elsa.DropIns.csproj", "{4E7F15D1-729E-4DA7-992A-C3A2C6054B37}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Elsa.SasTokens", "src\modules\Elsa.SasTokens\Elsa.SasTokens.csproj", "{3095C95A-F1F9-487A-A983-1B100A33E4C7}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "alterations", "alterations", "{CF3DA5F1-F98D-49C9-A980-27E570B38B8D}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Elsa.Alterations.Core", "src\modules\Elsa.Alterations.Core\Elsa.Alterations.Core.csproj", "{8DBEC8F3-908D-46B3-95CA-47EA138AB1A4}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Elsa.Alterations", "src\modules\Elsa.Alterations\Elsa.Alterations.csproj", "{CC7DE119-736D-4FC5-85DC-70A6770749F6}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Elsa.EntityFrameworkCore.Sqlite", "src\modules\Elsa.EntityFrameworkCore.Sqlite\Elsa.EntityFrameworkCore.Sqlite.csproj", "{EFE4A814-F58D-4C19-8F7F-B95F4EE343F0}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Elsa.EntityFrameworkCore.SqlServer", "src\modules\Elsa.EntityFrameworkCore.SqlServer\Elsa.EntityFrameworkCore.SqlServer.csproj", "{1C84408D-A0A7-4513-AD9A-1BA137ABE62C}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Elsa.EntityFrameworkCore.MySql", "src\modules\Elsa.EntityFrameworkCore.MySql\Elsa.EntityFrameworkCore.MySql.csproj", "{E4300D97-1D53-4029-9435-483FB7EC9621}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Elsa.EntityFrameworkCore.PostgreSql", "src\modules\Elsa.EntityFrameworkCore.PostgreSql\Elsa.EntityFrameworkCore.PostgreSql.csproj", "{84AB9951-3DBF-43A4-8F5D-AEED1102CE88}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Elsa.Alterations.MassTransit", "src\modules\Elsa.Alterations.MassTransit\Elsa.Alterations.MassTransit.csproj", "{1F621382-08FB-45EA-B94C-96A7FECB9489}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Elsa.EntityFrameworkCore.Common", "src\modules\Elsa.EntityFrameworkCore.Common\Elsa.EntityFrameworkCore.Common.csproj", "{FBA14F8A-9F14-4364-ABDB-B8AE81A0D755}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Elsa.Quartz.EntityFrameworkCore.Sqlite", "src\modules\Elsa.Quartz.EntityFrameworkCore.Sqlite\Elsa.Quartz.EntityFrameworkCore.Sqlite.csproj", "{A71557F2-D5FB-4772-9391-F7D18A3B6C44}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Elsa.Quartz.EntityFrameworkCore.SqlServer", "src\modules\Elsa.Quartz.EntityFrameworkCore.SqlServer\Elsa.Quartz.EntityFrameworkCore.SqlServer.csproj", "{05F3B23E-CF28-467B-AD3C-595EA4ED6B96}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Elsa.Quartz.EntityFrameworkCore.MySql", "src\modules\Elsa.Quartz.EntityFrameworkCore.MySql\Elsa.Quartz.EntityFrameworkCore.MySql.csproj", "{74ACD9D0-8B4C-42FA-A582-E93BF0075023}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Elsa.Quartz.EntityFrameworkCore.PostgreSql", "src\modules\Elsa.Quartz.EntityFrameworkCore.PostgreSql\Elsa.Quartz.EntityFrameworkCore.PostgreSql.csproj", "{CCCCEF8C-7D96-4BEA-B9D0-E91EDF08E65D}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Elsa.EntityFrameworkCore.Oracle", "src\modules\Elsa.EntityFrameworkCore.Oracle\Elsa.EntityFrameworkCore.Oracle.csproj", "{49D8D2CF-AF68-40FA-951F-018247C97443}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Elsa.FileStorage", "src\modules\Elsa.FileStorage\Elsa.FileStorage.csproj", "{732BF088-6AD7-4C4D-9A48-8074253596D4}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "storage", "storage", "{B818988E-639C-4E6E-85C1-B231BCAD9DAB}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Elsa.Tenants", "src\modules\Elsa.Tenants\Elsa.Tenants.csproj", "{29638A67-E79F-44FE-AC05-DA499EBA929E}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Elsa.CSharp", "src\modules\Elsa.CSharp\Elsa.CSharp.csproj", "{24331E82-D7AF-45B1-ACF0-CA6C3B0B77DC}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Elsa.Python", "src\modules\Elsa.Python\Elsa.Python.csproj", "{790E94F2-5393-47DF-AC52-D9247F5B243A}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Elsa.MassTransit.RabbitMq", "src\modules\Elsa.MassTransit.RabbitMq\Elsa.MassTransit.RabbitMq.csproj", "{169BEA3D-2A81-47EE-A6C1-3F8719EEC1F6}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "pipelines", "pipelines", "{B789B743-0FBE-4BBC-9F45-84C20C8D4814}" ProjectSection(SolutionItems) = preProject .github\workflows\bounty.yml = .github\workflows\bounty.yml @@ -192,12 +104,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "pipelines", "pipelines", "{ EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "_build", "build\_build.csproj", "{99F2B1DA-2F69-4D70-A2A3-AC985AD91EC4}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Elsa.MassTransit.AzureServiceBus", "src\modules\Elsa.MassTransit.AzureServiceBus\Elsa.MassTransit.AzureServiceBus.csproj", "{AFEB799E-82C3-4D02-9D5C-766BB8DEF004}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "scripts", "scripts", "{C80C8231-D35C-4ACC-9ED6-9F3DB221535E}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Elsa.Alterations.IntegrationTests", "test\integration\Elsa.Alterations.IntegrationTests\Elsa.Alterations.IntegrationTests.csproj", "{F50336DA-42D1-4DD1-A107-67AFEB8A33EE}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "hosting", "hosting", "{A516931E-EDBB-4FC3-BB94-1BB824D5BC61}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Elsa.Hosting.Management", "src\modules\Elsa.Hosting.Management\Elsa.Hosting.Management.csproj", "{BBCE36D1-6767-4ED1-B3E8-84D2567A962A}" @@ -206,14 +114,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Elsa.KeyValues", "src\modul EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Elsa.Workflows.Runtime.UnitTests", "test\unit\Elsa.Workflows.Runtime.UnitTests\Elsa.Workflows.Runtime.UnitTests.csproj", "{B0946844-DE0E-4C59-9391-C0EB649DBF4E}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Elsa.Caching", "src\modules\Elsa.Caching\Elsa.Caching.csproj", "{A1FE2CA0-8EF3-4EDB-9055-DD282E374E16}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "caching", "caching", "{EB3A7401-0DE3-476F-9E6F-057F1F4590FB}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Elsa.Caching.Distributed.MassTransit", "src\modules\Elsa.Caching.Distributed.MassTransit\Elsa.Caching.Distributed.MassTransit.csproj", "{BF4CDE28-F0CC-482D-8392-C1C9BB4C368F}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Elsa.Caching.Distributed", "src\modules\Elsa.Caching.Distributed\Elsa.Caching.Distributed.csproj", "{7EB0CFB8-B668-4F3F-898D-80411095BC2F}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Elsa.Workflows.ComponentTests", "test\component\Elsa.Workflows.ComponentTests\Elsa.Workflows.ComponentTests.csproj", "{34BC9836-681D-43A5-BC39-E4FEE17FC528}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "performance", "performance", "{CBB515F3-A0EF-43B5-A907-FD4E652DD66E}" @@ -223,14 +123,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "performance", "performance" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Elsa.Workflows.PerformanceTests", "test\performance\Elsa.Workflows.PerformanceTests\Elsa.Workflows.PerformanceTests.csproj", "{90CD37A9-C866-4D90-A3B1-8C87F53B845E}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "retention", "retention", "{3F20899B-C5E1-485F-808B-ADB1877EB3FD}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Elsa.Retention", "src\modules\Elsa.Retention\Elsa.Retention.csproj", "{3D42FCA2-5BD0-4624-9FCA-F4BF935B27AE}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Elsa.MongoDb.UnitTests", "test\unit\Elsa.MongoDb.UnitTests\Elsa.MongoDb.UnitTests.csproj", "{56CAA9F2-1882-4EFA-BAC0-9C3D804553F1}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Elsa.Workflows.Runtime.Distributed", "src\modules\Elsa.Workflows.Runtime.Distributed\Elsa.Workflows.Runtime.Distributed.csproj", "{0D4A88A1-8AEE-49ED-BC2E-ED68C96F60AD}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Elsa.Testing.Shared", "src\common\Elsa.Testing.Shared\Elsa.Testing.Shared.csproj", "{5CBCBEA4-6038-48CA-B45D-C1D0F6B4ACA4}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Elsa.Testing.Shared.Integration", "src\common\Elsa.Testing.Shared.Integration\Elsa.Testing.Shared.Integration.csproj", "{94A61AD7-2A2B-40DB-81F3-C59D596958A8}" @@ -260,10 +152,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Elsa.Studio.Web", "src\apps EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Elsa.OpenTelemetry", "src\modules\Elsa.OpenTelemetry\Elsa.OpenTelemetry.csproj", "{2CDF3E1C-267D-4198-B1C7-7E1F548FC120}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Elsa.ProtoActor.Core", "src\modules\Elsa.ProtoActor.Core\Elsa.ProtoActor.Core.csproj", "{01B96BB9-35E8-4364-ACB8-6D12A14D8DBA}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Elsa.Caching.Distributed.ProtoActor", "src\modules\Elsa.Caching.Distributed.ProtoActor\Elsa.Caching.Distributed.ProtoActor.csproj", "{47FBCB04-0C2D-453C-BE2F-7052CAC22524}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "k8s", "k8s", "{B32DB9B2-AD6C-48A5-8682-4373CB045185}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "elsa-server", "elsa-server", "{454652D5-E1BB-4D4B-9B21-9CEFC900C4FB}" @@ -293,16 +181,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "trace-lens", "trace-lens", scripts\k8s\trace-lens\service.yaml = scripts\k8s\trace-lens\service.yaml EndProjectSection EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "integrations", "integrations", "{EBD0CF78-C5D7-4B4B-94C9-C5D8C20B6F59}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Elsa.Secrets.Core", "src\modules\Elsa.Secrets.Core\Elsa.Secrets.Core.csproj", "{34FAB60D-7259-47B9-B50E-B533C7C3CFEC}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "secrets", "secrets", "{8CEEC194-820A-4C8D-AB9E-E51E6D3E9CC1}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Elsa.Secrets.Management", "src\modules\Elsa.Secrets.Management\Elsa.Secrets.Management.csproj", "{19329441-2A59-4BAC-A1BE-BBAB70C93CA0}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Elsa.Secrets.Api", "src\modules\Elsa.Secrets.Api\Elsa.Secrets.Api.csproj", "{37D16EAF-ACD8-4105-8BD3-B2745819CFF8}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "migrations", "migrations", "{3666CF13-1353-4620-9472-506670214A6A}" ProjectSection(SolutionItems) = preProject scripts\migrations\efcore-3.0.sh = scripts\migrations\efcore-3.0.sh @@ -330,45 +208,15 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "elsa-studio", "elsa-studio" scripts\k8s\elsa-studio\service.yaml = scripts\k8s\elsa-studio\service.yaml EndProjectSection EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Elsa.Secrets.Persistence.EntityFrameworkCore", "src\modules\Elsa.Secrets.Persistence.EntityFrameworkCore\Elsa.Secrets.Persistence.EntityFrameworkCore.csproj", "{9A6D67DE-51B1-456D-B25D-19E0356C8F60}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Elsa.Secrets.Persistence.EntityFrameworkCore.Sqlite", "src\modules\Elsa.Secrets.Persistence.EntityFrameworkCore.Sqlite\Elsa.Secrets.Persistence.EntityFrameworkCore.Sqlite.csproj", "{44A03CF6-4EB6-434C-90D1-FF8142FE394E}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Elsa.Secrets.Models", "src\modules\Elsa.Secrets.Models\Elsa.Secrets.Models.csproj", "{29D12ADC-55E9-40D0-9E4C-F0EBB6E098EC}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Elsa.Secrets.Scripting", "src\modules\Elsa.Secrets.Scripting\Elsa.Secrets.Scripting.csproj", "{6C606FEB-9A1F-4816-ABE4-22AFA8CEE771}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Elsa.JavaScript.Libraries", "src\modules\Elsa.JavaScript.Libraries\Elsa.JavaScript.Libraries.csproj", "{5F80663C-B072-49DE-9A67-FD804BAD787E}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Elsa.Secrets.Persistence.EntityFrameworkCore.PostgreSql", "src\modules\Elsa.Secrets.Persistence.EntityFrameworkCore.PostgreSql\Elsa.Secrets.Persistence.EntityFrameworkCore.PostgreSql.csproj", "{630E2D93-7F7D-4A8A-BB52-D8095A1F24D9}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Elsa.Secrets.Persistence.EntityFrameworkCore.SqlServer", "src\modules\Elsa.Secrets.Persistence.EntityFrameworkCore.SqlServer\Elsa.Secrets.Persistence.EntityFrameworkCore.SqlServer.csproj", "{59E7614A-3630-4C39-9C7F-9E12BC95D37E}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "multitenancy", "multitenancy", "{2F3E1026-5054-4E1F-899B-F1A7F70F9912}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Elsa.Tenants.AspNetCore", "src\modules\Elsa.Tenants.AspNetCore\Elsa.Tenants.AspNetCore.csproj", "{D5720DBC-8C2B-42D5-9D9F-2FF6EAD4001C}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Elsa.Kafka", "src\modules\Elsa.Kafka\Elsa.Kafka.csproj", "{BF934627-F531-44FB-BEC2-ECA801FF31E7}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "oracle-setup", "oracle-setup", "{66E2E2CF-967F-4564-89E8-F46FA973C99B}" ProjectSection(SolutionItems) = preProject docker\oracle-setup\setup.sql = docker\oracle-setup\setup.sql EndProjectSection EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "connections", "connections", "{9DF81143-2F39-4CFB-9DA3-902279010622}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Elsa.Connections.Models", "src\modules\Elsa.Connections.Models\Elsa.Connections.Models.csproj", "{75E08B0E-A41A-425C-9DCA-155505CE41CD}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Elsa.Connections.Api", "src\modules\Elsa.Connections.Api\Elsa.Connections.Api.csproj", "{BD120D97-4862-469E-B2CF-4109F7F21C20}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Elsa.Connections.Core", "src\modules\Elsa.Connections.Core\Elsa.Connections.Core.csproj", "{8A3443F3-D40E-44B9-9805-B4CB7A3F022C}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Elsa.Connections.Persistence", "src\modules\Elsa.Connections.Persistence\Elsa.Connections.Persistence.csproj", "{FA2B2B44-7E3E-444B-A157-7526B376E9CA}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Elsa.Connections.Persistence.EntityFrameworkCore", "src\modules\Elsa.Connections.Persistence.EntityFrameworkCore\Elsa.Connections.Persistence.EntityFrameworkCore.csproj", "{DF0CA7E2-F5DF-40ED-91B6-748767084FC7}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Elsa.Connections.Persistence.EntityFrameworkCore.Sqlite", "src\modules\Elsa.Connections.Persistence.EntityFrameworkCore.Sqlite\Elsa.Connections.Persistence.EntityFrameworkCore.Sqlite.csproj", "{DB20B168-CD90-41F2-BE08-3D8C6F142459}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "adr", "adr", "{0A04B1FD-06C0-4271-A910-A08C263DBC44}" ProjectSection(SolutionItems) = preProject doc\adr\0001-record-architecture-decisions.md = doc\adr\0001-record-architecture-decisions.md @@ -392,56 +240,36 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Elsa.Resilience.Core", "src EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Elsa.Resilience", "src\modules\Elsa.Resilience\Elsa.Resilience.csproj", "{E7137FB0-1988-4562-AD8D-D0D9D2EE85F6}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "caching", "caching", "{02EA681E-C7D8-13C7-8484-4AC65E1B71E8}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Elsa.Caching", "src\modules\Elsa.Caching\Elsa.Caching.csproj", "{6F14B066-DF7B-2409-59D8-CCCA90A4974C}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "http", "http", "{C55015F0-E9DF-4BF9-8131-D7539E938220}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Elsa.Http", "src\modules\Elsa.Http\Elsa.Http.csproj", "{E0B22AB7-7CB5-6D17-562C-4A989DC61F8A}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Elsa.Expressions.CSharp", "src\modules\Elsa.Expressions.CSharp\Elsa.Expressions.CSharp.csproj", "{16C3FBDE-A832-E3CD-5FBF-F51744D1F79B}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Elsa.Expressions.Dsl", "src\modules\Elsa.Expressions.Dsl\Elsa.Expressions.Dsl.csproj", "{765392DE-8560-B464-62DD-6890720FF5D5}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Elsa.Expressions.JavaScript", "src\modules\Elsa.Expressions.JavaScript\Elsa.Expressions.JavaScript.csproj", "{099D5DCE-CCF7-16FE-6EDC-A64B694F50BE}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Elsa.Expressions.JavaScript.Libraries", "src\modules\Elsa.Expressions.JavaScript.Libraries\Elsa.Expressions.JavaScript.Libraries.csproj", "{08B69CC4-B5F0-44E8-FA7A-6BF6F00CA40A}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Elsa.Expressions.Liquid", "src\modules\Elsa.Expressions.Liquid\Elsa.Expressions.Liquid.csproj", "{6AF53651-99F0-1DE0-D37B-4FF6B0348DBB}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Elsa.Expressions.Python", "src\modules\Elsa.Expressions.Python\Elsa.Expressions.Python.csproj", "{9D8FB664-88B4-10BE-58A2-D9A1644AD2E4}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {7D5A49B4-9A9B-496E-803B-DEB85B2C3132}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7D5A49B4-9A9B-496E-803B-DEB85B2C3132}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7D5A49B4-9A9B-496E-803B-DEB85B2C3132}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7D5A49B4-9A9B-496E-803B-DEB85B2C3132}.Release|Any CPU.Build.0 = Release|Any CPU - {82E26BF9-5F3A-4365-899A-AB1FFD54AA45}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {82E26BF9-5F3A-4365-899A-AB1FFD54AA45}.Debug|Any CPU.Build.0 = Debug|Any CPU - {82E26BF9-5F3A-4365-899A-AB1FFD54AA45}.Release|Any CPU.ActiveCfg = Release|Any CPU - {82E26BF9-5F3A-4365-899A-AB1FFD54AA45}.Release|Any CPU.Build.0 = Release|Any CPU - {ACD65CE5-3CC2-47B1-BFAC-72443D764F6E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {ACD65CE5-3CC2-47B1-BFAC-72443D764F6E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {ACD65CE5-3CC2-47B1-BFAC-72443D764F6E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {ACD65CE5-3CC2-47B1-BFAC-72443D764F6E}.Release|Any CPU.Build.0 = Release|Any CPU - {D31581AB-A6C1-4B73-AB63-45667F6C82AE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D31581AB-A6C1-4B73-AB63-45667F6C82AE}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D31581AB-A6C1-4B73-AB63-45667F6C82AE}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D31581AB-A6C1-4B73-AB63-45667F6C82AE}.Release|Any CPU.Build.0 = Release|Any CPU - {0601A2A6-2C62-418B-9104-8CDE497E5283}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {0601A2A6-2C62-418B-9104-8CDE497E5283}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0601A2A6-2C62-418B-9104-8CDE497E5283}.Release|Any CPU.ActiveCfg = Release|Any CPU - {0601A2A6-2C62-418B-9104-8CDE497E5283}.Release|Any CPU.Build.0 = Release|Any CPU - {302BFC43-ED2F-43AE-8AD4-FCD481B0AC67}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {302BFC43-ED2F-43AE-8AD4-FCD481B0AC67}.Debug|Any CPU.Build.0 = Debug|Any CPU - {302BFC43-ED2F-43AE-8AD4-FCD481B0AC67}.Release|Any CPU.ActiveCfg = Release|Any CPU - {302BFC43-ED2F-43AE-8AD4-FCD481B0AC67}.Release|Any CPU.Build.0 = Release|Any CPU - {BB983D0B-A939-4008-B9E3-C7C172BCF83A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {BB983D0B-A939-4008-B9E3-C7C172BCF83A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {BB983D0B-A939-4008-B9E3-C7C172BCF83A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {BB983D0B-A939-4008-B9E3-C7C172BCF83A}.Release|Any CPU.Build.0 = Release|Any CPU {80FF5821-E831-450D-AA0C-C76D07D878F4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {80FF5821-E831-450D-AA0C-C76D07D878F4}.Debug|Any CPU.Build.0 = Debug|Any CPU {80FF5821-E831-450D-AA0C-C76D07D878F4}.Release|Any CPU.ActiveCfg = Release|Any CPU {80FF5821-E831-450D-AA0C-C76D07D878F4}.Release|Any CPU.Build.0 = Release|Any CPU - {8E5BD3D9-3529-48BC-B741-CFB7A69DB233}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {8E5BD3D9-3529-48BC-B741-CFB7A69DB233}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8E5BD3D9-3529-48BC-B741-CFB7A69DB233}.Release|Any CPU.ActiveCfg = Release|Any CPU - {8E5BD3D9-3529-48BC-B741-CFB7A69DB233}.Release|Any CPU.Build.0 = Release|Any CPU - {B2049499-D384-46DF-8837-F1180107DD54}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B2049499-D384-46DF-8837-F1180107DD54}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B2049499-D384-46DF-8837-F1180107DD54}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B2049499-D384-46DF-8837-F1180107DD54}.Release|Any CPU.Build.0 = Release|Any CPU - {78DAB791-8595-4612-8E9E-2248AF5B1862}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {78DAB791-8595-4612-8E9E-2248AF5B1862}.Debug|Any CPU.Build.0 = Debug|Any CPU - {78DAB791-8595-4612-8E9E-2248AF5B1862}.Release|Any CPU.ActiveCfg = Release|Any CPU - {78DAB791-8595-4612-8E9E-2248AF5B1862}.Release|Any CPU.Build.0 = Release|Any CPU {C9539BD8-D2AE-4A8D-8281-71A05B3FBF31}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {C9539BD8-D2AE-4A8D-8281-71A05B3FBF31}.Debug|Any CPU.Build.0 = Debug|Any CPU {C9539BD8-D2AE-4A8D-8281-71A05B3FBF31}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -478,22 +306,6 @@ Global {D229105F-6879-4452-9189-75DE060C0F4C}.Debug|Any CPU.Build.0 = Debug|Any CPU {D229105F-6879-4452-9189-75DE060C0F4C}.Release|Any CPU.ActiveCfg = Release|Any CPU {D229105F-6879-4452-9189-75DE060C0F4C}.Release|Any CPU.Build.0 = Release|Any CPU - {7CC95512-7F44-45C3-A669-95B7048D4730}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7CC95512-7F44-45C3-A669-95B7048D4730}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7CC95512-7F44-45C3-A669-95B7048D4730}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7CC95512-7F44-45C3-A669-95B7048D4730}.Release|Any CPU.Build.0 = Release|Any CPU - {1E5BD8D9-55BE-41E2-B389-6AB9F26C22AF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1E5BD8D9-55BE-41E2-B389-6AB9F26C22AF}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1E5BD8D9-55BE-41E2-B389-6AB9F26C22AF}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1E5BD8D9-55BE-41E2-B389-6AB9F26C22AF}.Release|Any CPU.Build.0 = Release|Any CPU - {3246883E-2FA7-4B4A-BDC5-99039A2869BC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3246883E-2FA7-4B4A-BDC5-99039A2869BC}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3246883E-2FA7-4B4A-BDC5-99039A2869BC}.Release|Any CPU.ActiveCfg = Release|Any CPU - {3246883E-2FA7-4B4A-BDC5-99039A2869BC}.Release|Any CPU.Build.0 = Release|Any CPU - {2BBFDE36-28A7-4875-8EBE-CC25C76B97FF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {2BBFDE36-28A7-4875-8EBE-CC25C76B97FF}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2BBFDE36-28A7-4875-8EBE-CC25C76B97FF}.Release|Any CPU.ActiveCfg = Release|Any CPU - {2BBFDE36-28A7-4875-8EBE-CC25C76B97FF}.Release|Any CPU.Build.0 = Release|Any CPU {E9652738-2B3D-4357-B84B-54F0EA161382}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {E9652738-2B3D-4357-B84B-54F0EA161382}.Debug|Any CPU.Build.0 = Debug|Any CPU {E9652738-2B3D-4357-B84B-54F0EA161382}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -506,22 +318,6 @@ Global {B5CDF747-8066-40D5-9BAE-CBE397BC9B51}.Debug|Any CPU.Build.0 = Debug|Any CPU {B5CDF747-8066-40D5-9BAE-CBE397BC9B51}.Release|Any CPU.ActiveCfg = Release|Any CPU {B5CDF747-8066-40D5-9BAE-CBE397BC9B51}.Release|Any CPU.Build.0 = Release|Any CPU - {4D8F3BB2-709D-481A-8FD3-0DA9762B366D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {4D8F3BB2-709D-481A-8FD3-0DA9762B366D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4D8F3BB2-709D-481A-8FD3-0DA9762B366D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {4D8F3BB2-709D-481A-8FD3-0DA9762B366D}.Release|Any CPU.Build.0 = Release|Any CPU - {A86DF0F0-24E9-470E-984B-9E7332544972}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A86DF0F0-24E9-470E-984B-9E7332544972}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A86DF0F0-24E9-470E-984B-9E7332544972}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A86DF0F0-24E9-470E-984B-9E7332544972}.Release|Any CPU.Build.0 = Release|Any CPU - {A702DD84-B55C-4807-9C28-D8F5AC3CCA78}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A702DD84-B55C-4807-9C28-D8F5AC3CCA78}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A702DD84-B55C-4807-9C28-D8F5AC3CCA78}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A702DD84-B55C-4807-9C28-D8F5AC3CCA78}.Release|Any CPU.Build.0 = Release|Any CPU - {3A377A6A-F735-4010-9E00-72E8BEB8F1F2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3A377A6A-F735-4010-9E00-72E8BEB8F1F2}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3A377A6A-F735-4010-9E00-72E8BEB8F1F2}.Release|Any CPU.ActiveCfg = Release|Any CPU - {3A377A6A-F735-4010-9E00-72E8BEB8F1F2}.Release|Any CPU.Build.0 = Release|Any CPU {28818676-F6AF-4203-8B65-BD33A50CB9A2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {28818676-F6AF-4203-8B65-BD33A50CB9A2}.Debug|Any CPU.Build.0 = Debug|Any CPU {28818676-F6AF-4203-8B65-BD33A50CB9A2}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -530,100 +326,12 @@ Global {DC9CCAD0-7363-4691-B964-FF5B3AEA3F95}.Debug|Any CPU.Build.0 = Debug|Any CPU {DC9CCAD0-7363-4691-B964-FF5B3AEA3F95}.Release|Any CPU.ActiveCfg = Release|Any CPU {DC9CCAD0-7363-4691-B964-FF5B3AEA3F95}.Release|Any CPU.Build.0 = Release|Any CPU - {1B794B9C-9B8A-4D5A-9848-B51274BD1FC5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1B794B9C-9B8A-4D5A-9848-B51274BD1FC5}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1B794B9C-9B8A-4D5A-9848-B51274BD1FC5}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1B794B9C-9B8A-4D5A-9848-B51274BD1FC5}.Release|Any CPU.Build.0 = Release|Any CPU - {4E7F15D1-729E-4DA7-992A-C3A2C6054B37}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {4E7F15D1-729E-4DA7-992A-C3A2C6054B37}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4E7F15D1-729E-4DA7-992A-C3A2C6054B37}.Release|Any CPU.ActiveCfg = Release|Any CPU - {4E7F15D1-729E-4DA7-992A-C3A2C6054B37}.Release|Any CPU.Build.0 = Release|Any CPU - {3095C95A-F1F9-487A-A983-1B100A33E4C7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3095C95A-F1F9-487A-A983-1B100A33E4C7}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3095C95A-F1F9-487A-A983-1B100A33E4C7}.Release|Any CPU.ActiveCfg = Release|Any CPU - {3095C95A-F1F9-487A-A983-1B100A33E4C7}.Release|Any CPU.Build.0 = Release|Any CPU - {8DBEC8F3-908D-46B3-95CA-47EA138AB1A4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {8DBEC8F3-908D-46B3-95CA-47EA138AB1A4}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8DBEC8F3-908D-46B3-95CA-47EA138AB1A4}.Release|Any CPU.ActiveCfg = Release|Any CPU - {8DBEC8F3-908D-46B3-95CA-47EA138AB1A4}.Release|Any CPU.Build.0 = Release|Any CPU - {CC7DE119-736D-4FC5-85DC-70A6770749F6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {CC7DE119-736D-4FC5-85DC-70A6770749F6}.Debug|Any CPU.Build.0 = Debug|Any CPU - {CC7DE119-736D-4FC5-85DC-70A6770749F6}.Release|Any CPU.ActiveCfg = Release|Any CPU - {CC7DE119-736D-4FC5-85DC-70A6770749F6}.Release|Any CPU.Build.0 = Release|Any CPU - {EFE4A814-F58D-4C19-8F7F-B95F4EE343F0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {EFE4A814-F58D-4C19-8F7F-B95F4EE343F0}.Debug|Any CPU.Build.0 = Debug|Any CPU - {EFE4A814-F58D-4C19-8F7F-B95F4EE343F0}.Release|Any CPU.ActiveCfg = Release|Any CPU - {EFE4A814-F58D-4C19-8F7F-B95F4EE343F0}.Release|Any CPU.Build.0 = Release|Any CPU - {1C84408D-A0A7-4513-AD9A-1BA137ABE62C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1C84408D-A0A7-4513-AD9A-1BA137ABE62C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1C84408D-A0A7-4513-AD9A-1BA137ABE62C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1C84408D-A0A7-4513-AD9A-1BA137ABE62C}.Release|Any CPU.Build.0 = Release|Any CPU - {E4300D97-1D53-4029-9435-483FB7EC9621}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E4300D97-1D53-4029-9435-483FB7EC9621}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E4300D97-1D53-4029-9435-483FB7EC9621}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E4300D97-1D53-4029-9435-483FB7EC9621}.Release|Any CPU.Build.0 = Release|Any CPU - {84AB9951-3DBF-43A4-8F5D-AEED1102CE88}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {84AB9951-3DBF-43A4-8F5D-AEED1102CE88}.Debug|Any CPU.Build.0 = Debug|Any CPU - {84AB9951-3DBF-43A4-8F5D-AEED1102CE88}.Release|Any CPU.ActiveCfg = Release|Any CPU - {84AB9951-3DBF-43A4-8F5D-AEED1102CE88}.Release|Any CPU.Build.0 = Release|Any CPU - {1F621382-08FB-45EA-B94C-96A7FECB9489}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1F621382-08FB-45EA-B94C-96A7FECB9489}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1F621382-08FB-45EA-B94C-96A7FECB9489}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1F621382-08FB-45EA-B94C-96A7FECB9489}.Release|Any CPU.Build.0 = Release|Any CPU - {FBA14F8A-9F14-4364-ABDB-B8AE81A0D755}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {FBA14F8A-9F14-4364-ABDB-B8AE81A0D755}.Debug|Any CPU.Build.0 = Debug|Any CPU - {FBA14F8A-9F14-4364-ABDB-B8AE81A0D755}.Release|Any CPU.ActiveCfg = Release|Any CPU - {FBA14F8A-9F14-4364-ABDB-B8AE81A0D755}.Release|Any CPU.Build.0 = Release|Any CPU - {A71557F2-D5FB-4772-9391-F7D18A3B6C44}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A71557F2-D5FB-4772-9391-F7D18A3B6C44}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A71557F2-D5FB-4772-9391-F7D18A3B6C44}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A71557F2-D5FB-4772-9391-F7D18A3B6C44}.Release|Any CPU.Build.0 = Release|Any CPU - {05F3B23E-CF28-467B-AD3C-595EA4ED6B96}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {05F3B23E-CF28-467B-AD3C-595EA4ED6B96}.Debug|Any CPU.Build.0 = Debug|Any CPU - {05F3B23E-CF28-467B-AD3C-595EA4ED6B96}.Release|Any CPU.ActiveCfg = Release|Any CPU - {05F3B23E-CF28-467B-AD3C-595EA4ED6B96}.Release|Any CPU.Build.0 = Release|Any CPU - {74ACD9D0-8B4C-42FA-A582-E93BF0075023}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {74ACD9D0-8B4C-42FA-A582-E93BF0075023}.Debug|Any CPU.Build.0 = Debug|Any CPU - {74ACD9D0-8B4C-42FA-A582-E93BF0075023}.Release|Any CPU.ActiveCfg = Release|Any CPU - {74ACD9D0-8B4C-42FA-A582-E93BF0075023}.Release|Any CPU.Build.0 = Release|Any CPU - {CCCCEF8C-7D96-4BEA-B9D0-E91EDF08E65D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {CCCCEF8C-7D96-4BEA-B9D0-E91EDF08E65D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {CCCCEF8C-7D96-4BEA-B9D0-E91EDF08E65D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {CCCCEF8C-7D96-4BEA-B9D0-E91EDF08E65D}.Release|Any CPU.Build.0 = Release|Any CPU - {49D8D2CF-AF68-40FA-951F-018247C97443}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {49D8D2CF-AF68-40FA-951F-018247C97443}.Debug|Any CPU.Build.0 = Debug|Any CPU - {49D8D2CF-AF68-40FA-951F-018247C97443}.Release|Any CPU.ActiveCfg = Release|Any CPU - {49D8D2CF-AF68-40FA-951F-018247C97443}.Release|Any CPU.Build.0 = Release|Any CPU - {732BF088-6AD7-4C4D-9A48-8074253596D4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {732BF088-6AD7-4C4D-9A48-8074253596D4}.Debug|Any CPU.Build.0 = Debug|Any CPU - {732BF088-6AD7-4C4D-9A48-8074253596D4}.Release|Any CPU.ActiveCfg = Release|Any CPU - {732BF088-6AD7-4C4D-9A48-8074253596D4}.Release|Any CPU.Build.0 = Release|Any CPU {29638A67-E79F-44FE-AC05-DA499EBA929E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {29638A67-E79F-44FE-AC05-DA499EBA929E}.Debug|Any CPU.Build.0 = Debug|Any CPU {29638A67-E79F-44FE-AC05-DA499EBA929E}.Release|Any CPU.ActiveCfg = Release|Any CPU {29638A67-E79F-44FE-AC05-DA499EBA929E}.Release|Any CPU.Build.0 = Release|Any CPU - {24331E82-D7AF-45B1-ACF0-CA6C3B0B77DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {24331E82-D7AF-45B1-ACF0-CA6C3B0B77DC}.Debug|Any CPU.Build.0 = Debug|Any CPU - {24331E82-D7AF-45B1-ACF0-CA6C3B0B77DC}.Release|Any CPU.ActiveCfg = Release|Any CPU - {24331E82-D7AF-45B1-ACF0-CA6C3B0B77DC}.Release|Any CPU.Build.0 = Release|Any CPU - {790E94F2-5393-47DF-AC52-D9247F5B243A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {790E94F2-5393-47DF-AC52-D9247F5B243A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {790E94F2-5393-47DF-AC52-D9247F5B243A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {790E94F2-5393-47DF-AC52-D9247F5B243A}.Release|Any CPU.Build.0 = Release|Any CPU - {169BEA3D-2A81-47EE-A6C1-3F8719EEC1F6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {169BEA3D-2A81-47EE-A6C1-3F8719EEC1F6}.Debug|Any CPU.Build.0 = Debug|Any CPU - {169BEA3D-2A81-47EE-A6C1-3F8719EEC1F6}.Release|Any CPU.ActiveCfg = Release|Any CPU - {169BEA3D-2A81-47EE-A6C1-3F8719EEC1F6}.Release|Any CPU.Build.0 = Release|Any CPU {99F2B1DA-2F69-4D70-A2A3-AC985AD91EC4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {99F2B1DA-2F69-4D70-A2A3-AC985AD91EC4}.Release|Any CPU.ActiveCfg = Release|Any CPU - {AFEB799E-82C3-4D02-9D5C-766BB8DEF004}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {AFEB799E-82C3-4D02-9D5C-766BB8DEF004}.Debug|Any CPU.Build.0 = Debug|Any CPU - {AFEB799E-82C3-4D02-9D5C-766BB8DEF004}.Release|Any CPU.ActiveCfg = Release|Any CPU - {AFEB799E-82C3-4D02-9D5C-766BB8DEF004}.Release|Any CPU.Build.0 = Release|Any CPU - {F50336DA-42D1-4DD1-A107-67AFEB8A33EE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F50336DA-42D1-4DD1-A107-67AFEB8A33EE}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F50336DA-42D1-4DD1-A107-67AFEB8A33EE}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F50336DA-42D1-4DD1-A107-67AFEB8A33EE}.Release|Any CPU.Build.0 = Release|Any CPU {BBCE36D1-6767-4ED1-B3E8-84D2567A962A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {BBCE36D1-6767-4ED1-B3E8-84D2567A962A}.Debug|Any CPU.Build.0 = Debug|Any CPU {BBCE36D1-6767-4ED1-B3E8-84D2567A962A}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -636,18 +344,6 @@ Global {B0946844-DE0E-4C59-9391-C0EB649DBF4E}.Debug|Any CPU.Build.0 = Debug|Any CPU {B0946844-DE0E-4C59-9391-C0EB649DBF4E}.Release|Any CPU.ActiveCfg = Release|Any CPU {B0946844-DE0E-4C59-9391-C0EB649DBF4E}.Release|Any CPU.Build.0 = Release|Any CPU - {A1FE2CA0-8EF3-4EDB-9055-DD282E374E16}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A1FE2CA0-8EF3-4EDB-9055-DD282E374E16}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A1FE2CA0-8EF3-4EDB-9055-DD282E374E16}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A1FE2CA0-8EF3-4EDB-9055-DD282E374E16}.Release|Any CPU.Build.0 = Release|Any CPU - {BF4CDE28-F0CC-482D-8392-C1C9BB4C368F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {BF4CDE28-F0CC-482D-8392-C1C9BB4C368F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {BF4CDE28-F0CC-482D-8392-C1C9BB4C368F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {BF4CDE28-F0CC-482D-8392-C1C9BB4C368F}.Release|Any CPU.Build.0 = Release|Any CPU - {7EB0CFB8-B668-4F3F-898D-80411095BC2F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7EB0CFB8-B668-4F3F-898D-80411095BC2F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7EB0CFB8-B668-4F3F-898D-80411095BC2F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7EB0CFB8-B668-4F3F-898D-80411095BC2F}.Release|Any CPU.Build.0 = Release|Any CPU {34BC9836-681D-43A5-BC39-E4FEE17FC528}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {34BC9836-681D-43A5-BC39-E4FEE17FC528}.Debug|Any CPU.Build.0 = Debug|Any CPU {34BC9836-681D-43A5-BC39-E4FEE17FC528}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -656,18 +352,6 @@ Global {90CD37A9-C866-4D90-A3B1-8C87F53B845E}.Debug|Any CPU.Build.0 = Debug|Any CPU {90CD37A9-C866-4D90-A3B1-8C87F53B845E}.Release|Any CPU.ActiveCfg = Release|Any CPU {90CD37A9-C866-4D90-A3B1-8C87F53B845E}.Release|Any CPU.Build.0 = Release|Any CPU - {3D42FCA2-5BD0-4624-9FCA-F4BF935B27AE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3D42FCA2-5BD0-4624-9FCA-F4BF935B27AE}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3D42FCA2-5BD0-4624-9FCA-F4BF935B27AE}.Release|Any CPU.ActiveCfg = Release|Any CPU - {3D42FCA2-5BD0-4624-9FCA-F4BF935B27AE}.Release|Any CPU.Build.0 = Release|Any CPU - {56CAA9F2-1882-4EFA-BAC0-9C3D804553F1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {56CAA9F2-1882-4EFA-BAC0-9C3D804553F1}.Debug|Any CPU.Build.0 = Debug|Any CPU - {56CAA9F2-1882-4EFA-BAC0-9C3D804553F1}.Release|Any CPU.ActiveCfg = Release|Any CPU - {56CAA9F2-1882-4EFA-BAC0-9C3D804553F1}.Release|Any CPU.Build.0 = Release|Any CPU - {0D4A88A1-8AEE-49ED-BC2E-ED68C96F60AD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {0D4A88A1-8AEE-49ED-BC2E-ED68C96F60AD}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0D4A88A1-8AEE-49ED-BC2E-ED68C96F60AD}.Release|Any CPU.ActiveCfg = Release|Any CPU - {0D4A88A1-8AEE-49ED-BC2E-ED68C96F60AD}.Release|Any CPU.Build.0 = Release|Any CPU {5CBCBEA4-6038-48CA-B45D-C1D0F6B4ACA4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {5CBCBEA4-6038-48CA-B45D-C1D0F6B4ACA4}.Debug|Any CPU.Build.0 = Debug|Any CPU {5CBCBEA4-6038-48CA-B45D-C1D0F6B4ACA4}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -716,86 +400,10 @@ Global {2CDF3E1C-267D-4198-B1C7-7E1F548FC120}.Debug|Any CPU.Build.0 = Debug|Any CPU {2CDF3E1C-267D-4198-B1C7-7E1F548FC120}.Release|Any CPU.ActiveCfg = Release|Any CPU {2CDF3E1C-267D-4198-B1C7-7E1F548FC120}.Release|Any CPU.Build.0 = Release|Any CPU - {01B96BB9-35E8-4364-ACB8-6D12A14D8DBA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {01B96BB9-35E8-4364-ACB8-6D12A14D8DBA}.Debug|Any CPU.Build.0 = Debug|Any CPU - {01B96BB9-35E8-4364-ACB8-6D12A14D8DBA}.Release|Any CPU.ActiveCfg = Release|Any CPU - {01B96BB9-35E8-4364-ACB8-6D12A14D8DBA}.Release|Any CPU.Build.0 = Release|Any CPU - {47FBCB04-0C2D-453C-BE2F-7052CAC22524}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {47FBCB04-0C2D-453C-BE2F-7052CAC22524}.Debug|Any CPU.Build.0 = Debug|Any CPU - {47FBCB04-0C2D-453C-BE2F-7052CAC22524}.Release|Any CPU.ActiveCfg = Release|Any CPU - {47FBCB04-0C2D-453C-BE2F-7052CAC22524}.Release|Any CPU.Build.0 = Release|Any CPU - {34FAB60D-7259-47B9-B50E-B533C7C3CFEC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {34FAB60D-7259-47B9-B50E-B533C7C3CFEC}.Debug|Any CPU.Build.0 = Debug|Any CPU - {34FAB60D-7259-47B9-B50E-B533C7C3CFEC}.Release|Any CPU.ActiveCfg = Release|Any CPU - {34FAB60D-7259-47B9-B50E-B533C7C3CFEC}.Release|Any CPU.Build.0 = Release|Any CPU - {19329441-2A59-4BAC-A1BE-BBAB70C93CA0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {19329441-2A59-4BAC-A1BE-BBAB70C93CA0}.Debug|Any CPU.Build.0 = Debug|Any CPU - {19329441-2A59-4BAC-A1BE-BBAB70C93CA0}.Release|Any CPU.ActiveCfg = Release|Any CPU - {19329441-2A59-4BAC-A1BE-BBAB70C93CA0}.Release|Any CPU.Build.0 = Release|Any CPU - {37D16EAF-ACD8-4105-8BD3-B2745819CFF8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {37D16EAF-ACD8-4105-8BD3-B2745819CFF8}.Debug|Any CPU.Build.0 = Debug|Any CPU - {37D16EAF-ACD8-4105-8BD3-B2745819CFF8}.Release|Any CPU.ActiveCfg = Release|Any CPU - {37D16EAF-ACD8-4105-8BD3-B2745819CFF8}.Release|Any CPU.Build.0 = Release|Any CPU - {9A6D67DE-51B1-456D-B25D-19E0356C8F60}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {9A6D67DE-51B1-456D-B25D-19E0356C8F60}.Debug|Any CPU.Build.0 = Debug|Any CPU - {9A6D67DE-51B1-456D-B25D-19E0356C8F60}.Release|Any CPU.ActiveCfg = Release|Any CPU - {9A6D67DE-51B1-456D-B25D-19E0356C8F60}.Release|Any CPU.Build.0 = Release|Any CPU - {44A03CF6-4EB6-434C-90D1-FF8142FE394E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {44A03CF6-4EB6-434C-90D1-FF8142FE394E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {44A03CF6-4EB6-434C-90D1-FF8142FE394E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {44A03CF6-4EB6-434C-90D1-FF8142FE394E}.Release|Any CPU.Build.0 = Release|Any CPU - {29D12ADC-55E9-40D0-9E4C-F0EBB6E098EC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {29D12ADC-55E9-40D0-9E4C-F0EBB6E098EC}.Debug|Any CPU.Build.0 = Debug|Any CPU - {29D12ADC-55E9-40D0-9E4C-F0EBB6E098EC}.Release|Any CPU.ActiveCfg = Release|Any CPU - {29D12ADC-55E9-40D0-9E4C-F0EBB6E098EC}.Release|Any CPU.Build.0 = Release|Any CPU - {6C606FEB-9A1F-4816-ABE4-22AFA8CEE771}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6C606FEB-9A1F-4816-ABE4-22AFA8CEE771}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6C606FEB-9A1F-4816-ABE4-22AFA8CEE771}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6C606FEB-9A1F-4816-ABE4-22AFA8CEE771}.Release|Any CPU.Build.0 = Release|Any CPU - {5F80663C-B072-49DE-9A67-FD804BAD787E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {5F80663C-B072-49DE-9A67-FD804BAD787E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {5F80663C-B072-49DE-9A67-FD804BAD787E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {5F80663C-B072-49DE-9A67-FD804BAD787E}.Release|Any CPU.Build.0 = Release|Any CPU - {630E2D93-7F7D-4A8A-BB52-D8095A1F24D9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {630E2D93-7F7D-4A8A-BB52-D8095A1F24D9}.Debug|Any CPU.Build.0 = Debug|Any CPU - {630E2D93-7F7D-4A8A-BB52-D8095A1F24D9}.Release|Any CPU.ActiveCfg = Release|Any CPU - {630E2D93-7F7D-4A8A-BB52-D8095A1F24D9}.Release|Any CPU.Build.0 = Release|Any CPU - {59E7614A-3630-4C39-9C7F-9E12BC95D37E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {59E7614A-3630-4C39-9C7F-9E12BC95D37E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {59E7614A-3630-4C39-9C7F-9E12BC95D37E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {59E7614A-3630-4C39-9C7F-9E12BC95D37E}.Release|Any CPU.Build.0 = Release|Any CPU {D5720DBC-8C2B-42D5-9D9F-2FF6EAD4001C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {D5720DBC-8C2B-42D5-9D9F-2FF6EAD4001C}.Debug|Any CPU.Build.0 = Debug|Any CPU {D5720DBC-8C2B-42D5-9D9F-2FF6EAD4001C}.Release|Any CPU.ActiveCfg = Release|Any CPU {D5720DBC-8C2B-42D5-9D9F-2FF6EAD4001C}.Release|Any CPU.Build.0 = Release|Any CPU - {BF934627-F531-44FB-BEC2-ECA801FF31E7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {BF934627-F531-44FB-BEC2-ECA801FF31E7}.Debug|Any CPU.Build.0 = Debug|Any CPU - {BF934627-F531-44FB-BEC2-ECA801FF31E7}.Release|Any CPU.ActiveCfg = Release|Any CPU - {BF934627-F531-44FB-BEC2-ECA801FF31E7}.Release|Any CPU.Build.0 = Release|Any CPU - {75E08B0E-A41A-425C-9DCA-155505CE41CD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {75E08B0E-A41A-425C-9DCA-155505CE41CD}.Debug|Any CPU.Build.0 = Debug|Any CPU - {75E08B0E-A41A-425C-9DCA-155505CE41CD}.Release|Any CPU.ActiveCfg = Release|Any CPU - {75E08B0E-A41A-425C-9DCA-155505CE41CD}.Release|Any CPU.Build.0 = Release|Any CPU - {BD120D97-4862-469E-B2CF-4109F7F21C20}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {BD120D97-4862-469E-B2CF-4109F7F21C20}.Debug|Any CPU.Build.0 = Debug|Any CPU - {BD120D97-4862-469E-B2CF-4109F7F21C20}.Release|Any CPU.ActiveCfg = Release|Any CPU - {BD120D97-4862-469E-B2CF-4109F7F21C20}.Release|Any CPU.Build.0 = Release|Any CPU - {8A3443F3-D40E-44B9-9805-B4CB7A3F022C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {8A3443F3-D40E-44B9-9805-B4CB7A3F022C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8A3443F3-D40E-44B9-9805-B4CB7A3F022C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {8A3443F3-D40E-44B9-9805-B4CB7A3F022C}.Release|Any CPU.Build.0 = Release|Any CPU - {FA2B2B44-7E3E-444B-A157-7526B376E9CA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {FA2B2B44-7E3E-444B-A157-7526B376E9CA}.Debug|Any CPU.Build.0 = Debug|Any CPU - {FA2B2B44-7E3E-444B-A157-7526B376E9CA}.Release|Any CPU.ActiveCfg = Release|Any CPU - {FA2B2B44-7E3E-444B-A157-7526B376E9CA}.Release|Any CPU.Build.0 = Release|Any CPU - {DF0CA7E2-F5DF-40ED-91B6-748767084FC7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {DF0CA7E2-F5DF-40ED-91B6-748767084FC7}.Debug|Any CPU.Build.0 = Debug|Any CPU - {DF0CA7E2-F5DF-40ED-91B6-748767084FC7}.Release|Any CPU.ActiveCfg = Release|Any CPU - {DF0CA7E2-F5DF-40ED-91B6-748767084FC7}.Release|Any CPU.Build.0 = Release|Any CPU - {DB20B168-CD90-41F2-BE08-3D8C6F142459}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {DB20B168-CD90-41F2-BE08-3D8C6F142459}.Debug|Any CPU.Build.0 = Debug|Any CPU - {DB20B168-CD90-41F2-BE08-3D8C6F142459}.Release|Any CPU.ActiveCfg = Release|Any CPU - {DB20B168-CD90-41F2-BE08-3D8C6F142459}.Release|Any CPU.Build.0 = Release|Any CPU {70593549-8B26-4D63-9857-6BA8BB3E31DB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {70593549-8B26-4D63-9857-6BA8BB3E31DB}.Debug|Any CPU.Build.0 = Debug|Any CPU {70593549-8B26-4D63-9857-6BA8BB3E31DB}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -804,6 +412,38 @@ Global {E7137FB0-1988-4562-AD8D-D0D9D2EE85F6}.Debug|Any CPU.Build.0 = Debug|Any CPU {E7137FB0-1988-4562-AD8D-D0D9D2EE85F6}.Release|Any CPU.ActiveCfg = Release|Any CPU {E7137FB0-1988-4562-AD8D-D0D9D2EE85F6}.Release|Any CPU.Build.0 = Release|Any CPU + {6F14B066-DF7B-2409-59D8-CCCA90A4974C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6F14B066-DF7B-2409-59D8-CCCA90A4974C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6F14B066-DF7B-2409-59D8-CCCA90A4974C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6F14B066-DF7B-2409-59D8-CCCA90A4974C}.Release|Any CPU.Build.0 = Release|Any CPU + {E0B22AB7-7CB5-6D17-562C-4A989DC61F8A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E0B22AB7-7CB5-6D17-562C-4A989DC61F8A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E0B22AB7-7CB5-6D17-562C-4A989DC61F8A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E0B22AB7-7CB5-6D17-562C-4A989DC61F8A}.Release|Any CPU.Build.0 = Release|Any CPU + {16C3FBDE-A832-E3CD-5FBF-F51744D1F79B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {16C3FBDE-A832-E3CD-5FBF-F51744D1F79B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {16C3FBDE-A832-E3CD-5FBF-F51744D1F79B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {16C3FBDE-A832-E3CD-5FBF-F51744D1F79B}.Release|Any CPU.Build.0 = Release|Any CPU + {765392DE-8560-B464-62DD-6890720FF5D5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {765392DE-8560-B464-62DD-6890720FF5D5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {765392DE-8560-B464-62DD-6890720FF5D5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {765392DE-8560-B464-62DD-6890720FF5D5}.Release|Any CPU.Build.0 = Release|Any CPU + {099D5DCE-CCF7-16FE-6EDC-A64B694F50BE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {099D5DCE-CCF7-16FE-6EDC-A64B694F50BE}.Debug|Any CPU.Build.0 = Debug|Any CPU + {099D5DCE-CCF7-16FE-6EDC-A64B694F50BE}.Release|Any CPU.ActiveCfg = Release|Any CPU + {099D5DCE-CCF7-16FE-6EDC-A64B694F50BE}.Release|Any CPU.Build.0 = Release|Any CPU + {08B69CC4-B5F0-44E8-FA7A-6BF6F00CA40A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {08B69CC4-B5F0-44E8-FA7A-6BF6F00CA40A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {08B69CC4-B5F0-44E8-FA7A-6BF6F00CA40A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {08B69CC4-B5F0-44E8-FA7A-6BF6F00CA40A}.Release|Any CPU.Build.0 = Release|Any CPU + {6AF53651-99F0-1DE0-D37B-4FF6B0348DBB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6AF53651-99F0-1DE0-D37B-4FF6B0348DBB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6AF53651-99F0-1DE0-D37B-4FF6B0348DBB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6AF53651-99F0-1DE0-D37B-4FF6B0348DBB}.Release|Any CPU.Build.0 = Release|Any CPU + {9D8FB664-88B4-10BE-58A2-D9A1644AD2E4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9D8FB664-88B4-10BE-58A2-D9A1644AD2E4}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9D8FB664-88B4-10BE-58A2-D9A1644AD2E4}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9D8FB664-88B4-10BE-58A2-D9A1644AD2E4}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -811,17 +451,7 @@ Global GlobalSection(NestedProjects) = preSolution {C6658DE0-2B2F-47F0-BB61-2CA66D435C09} = {61017E64-6D00-49CB-9E81-5002DC8F7D5F} {5BA4A8FA-F7F4-45B3-AEC8-8886D35AAC79} = {61017E64-6D00-49CB-9E81-5002DC8F7D5F} - {7D5A49B4-9A9B-496E-803B-DEB85B2C3132} = {AB797AF0-C12C-46DE-A157-7E25625C6200} - {82E26BF9-5F3A-4365-899A-AB1FFD54AA45} = {EBD0CF78-C5D7-4B4B-94C9-C5D8C20B6F59} - {ACD65CE5-3CC2-47B1-BFAC-72443D764F6E} = {AB797AF0-C12C-46DE-A157-7E25625C6200} - {D31581AB-A6C1-4B73-AB63-45667F6C82AE} = {6EF07978-A6D2-40EB-891D-7D70C5F37E76} - {0601A2A6-2C62-418B-9104-8CDE497E5283} = {AB797AF0-C12C-46DE-A157-7E25625C6200} - {302BFC43-ED2F-43AE-8AD4-FCD481B0AC67} = {B08B4E00-C2AB-48F3-8389-449F42AEF179} - {BB983D0B-A939-4008-B9E3-C7C172BCF83A} = {DD089B8B-DA73-492A-9010-F772D1C178DA} {80FF5821-E831-450D-AA0C-C76D07D878F4} = {5BA4A8FA-F7F4-45B3-AEC8-8886D35AAC79} - {8E5BD3D9-3529-48BC-B741-CFB7A69DB233} = {6EF07978-A6D2-40EB-891D-7D70C5F37E76} - {B2049499-D384-46DF-8837-F1180107DD54} = {58C59255-281C-4595-8732-808158F1DC6E} - {78DAB791-8595-4612-8E9E-2248AF5B1862} = {6EF07978-A6D2-40EB-891D-7D70C5F37E76} {C9539BD8-D2AE-4A8D-8281-71A05B3FBF31} = {B08B4E00-C2AB-48F3-8389-449F42AEF179} {169E2C9B-6687-427F-A278-30BF849BFEDC} = {B08B4E00-C2AB-48F3-8389-449F42AEF179} {2DD5D66B-85E9-4AF9-911C-C9F963234159} = {B08B4E00-C2AB-48F3-8389-449F42AEF179} @@ -831,10 +461,6 @@ Global {39CD855E-83B1-4A96-93F7-01608211EBE3} = {C6658DE0-2B2F-47F0-BB61-2CA66D435C09} {30B49E42-AE61-4F7C-981F-923F07BB3986} = {5948B0A5-7873-4DBB-BA03-EB283D6EA91B} {D229105F-6879-4452-9189-75DE060C0F4C} = {5BA4A8FA-F7F4-45B3-AEC8-8886D35AAC79} - {7CC95512-7F44-45C3-A669-95B7048D4730} = {9B4F139F-7D26-435C-A561-89E65A67A8E5} - {1E5BD8D9-55BE-41E2-B389-6AB9F26C22AF} = {EBD0CF78-C5D7-4B4B-94C9-C5D8C20B6F59} - {3246883E-2FA7-4B4A-BDC5-99039A2869BC} = {9B4F139F-7D26-435C-A561-89E65A67A8E5} - {2BBFDE36-28A7-4875-8EBE-CC25C76B97FF} = {EBD0CF78-C5D7-4B4B-94C9-C5D8C20B6F59} {18453B51-25EB-4317-A4B3-B10518252E92} = {90031D64-CA0F-46D0-9AF4-8DC023A5FFCD} {1B8D5897-902E-4632-8698-E89CAF3DDF54} = {90031D64-CA0F-46D0-9AF4-8DC023A5FFCD} {08B41FFA-CEE3-46A7-B5C0-3EB65D37A16C} = {90031D64-CA0F-46D0-9AF4-8DC023A5FFCD} @@ -842,59 +468,19 @@ Global {89608AA5-5ADE-4832-AC7B-871C4AE64210} = {61017E64-6D00-49CB-9E81-5002DC8F7D5F} {1FCB2200-28B8-4703-8E89-73241AAED047} = {89608AA5-5ADE-4832-AC7B-871C4AE64210} {B5CDF747-8066-40D5-9BAE-CBE397BC9B51} = {5BA4A8FA-F7F4-45B3-AEC8-8886D35AAC79} - {9B4F139F-7D26-435C-A561-89E65A67A8E5} = {5BA4A8FA-F7F4-45B3-AEC8-8886D35AAC79} {6EF07978-A6D2-40EB-891D-7D70C5F37E76} = {5BA4A8FA-F7F4-45B3-AEC8-8886D35AAC79} - {DD089B8B-DA73-492A-9010-F772D1C178DA} = {5BA4A8FA-F7F4-45B3-AEC8-8886D35AAC79} {5948B0A5-7873-4DBB-BA03-EB283D6EA91B} = {5BA4A8FA-F7F4-45B3-AEC8-8886D35AAC79} {B08B4E00-C2AB-48F3-8389-449F42AEF179} = {5BA4A8FA-F7F4-45B3-AEC8-8886D35AAC79} - {AB797AF0-C12C-46DE-A157-7E25625C6200} = {5BA4A8FA-F7F4-45B3-AEC8-8886D35AAC79} - {58C59255-281C-4595-8732-808158F1DC6E} = {5BA4A8FA-F7F4-45B3-AEC8-8886D35AAC79} - {4D8F3BB2-709D-481A-8FD3-0DA9762B366D} = {9B4F139F-7D26-435C-A561-89E65A67A8E5} - {A86DF0F0-24E9-470E-984B-9E7332544972} = {9B4F139F-7D26-435C-A561-89E65A67A8E5} - {A702DD84-B55C-4807-9C28-D8F5AC3CCA78} = {B08B4E00-C2AB-48F3-8389-449F42AEF179} - {3A377A6A-F735-4010-9E00-72E8BEB8F1F2} = {9B4F139F-7D26-435C-A561-89E65A67A8E5} {28818676-F6AF-4203-8B65-BD33A50CB9A2} = {C6658DE0-2B2F-47F0-BB61-2CA66D435C09} {DC9CCAD0-7363-4691-B964-FF5B3AEA3F95} = {18453B51-25EB-4317-A4B3-B10518252E92} - {1B794B9C-9B8A-4D5A-9848-B51274BD1FC5} = {C6658DE0-2B2F-47F0-BB61-2CA66D435C09} - {4E7F15D1-729E-4DA7-992A-C3A2C6054B37} = {C6658DE0-2B2F-47F0-BB61-2CA66D435C09} - {3095C95A-F1F9-487A-A983-1B100A33E4C7} = {5948B0A5-7873-4DBB-BA03-EB283D6EA91B} - {CF3DA5F1-F98D-49C9-A980-27E570B38B8D} = {5BA4A8FA-F7F4-45B3-AEC8-8886D35AAC79} - {8DBEC8F3-908D-46B3-95CA-47EA138AB1A4} = {CF3DA5F1-F98D-49C9-A980-27E570B38B8D} - {CC7DE119-736D-4FC5-85DC-70A6770749F6} = {CF3DA5F1-F98D-49C9-A980-27E570B38B8D} - {EFE4A814-F58D-4C19-8F7F-B95F4EE343F0} = {9B4F139F-7D26-435C-A561-89E65A67A8E5} - {1C84408D-A0A7-4513-AD9A-1BA137ABE62C} = {9B4F139F-7D26-435C-A561-89E65A67A8E5} - {E4300D97-1D53-4029-9435-483FB7EC9621} = {9B4F139F-7D26-435C-A561-89E65A67A8E5} - {84AB9951-3DBF-43A4-8F5D-AEED1102CE88} = {9B4F139F-7D26-435C-A561-89E65A67A8E5} - {1F621382-08FB-45EA-B94C-96A7FECB9489} = {CF3DA5F1-F98D-49C9-A980-27E570B38B8D} - {FBA14F8A-9F14-4364-ABDB-B8AE81A0D755} = {9B4F139F-7D26-435C-A561-89E65A67A8E5} - {A71557F2-D5FB-4772-9391-F7D18A3B6C44} = {AB797AF0-C12C-46DE-A157-7E25625C6200} - {05F3B23E-CF28-467B-AD3C-595EA4ED6B96} = {AB797AF0-C12C-46DE-A157-7E25625C6200} - {74ACD9D0-8B4C-42FA-A582-E93BF0075023} = {AB797AF0-C12C-46DE-A157-7E25625C6200} - {CCCCEF8C-7D96-4BEA-B9D0-E91EDF08E65D} = {AB797AF0-C12C-46DE-A157-7E25625C6200} - {49D8D2CF-AF68-40FA-951F-018247C97443} = {9B4F139F-7D26-435C-A561-89E65A67A8E5} - {732BF088-6AD7-4C4D-9A48-8074253596D4} = {B818988E-639C-4E6E-85C1-B231BCAD9DAB} - {B818988E-639C-4E6E-85C1-B231BCAD9DAB} = {5BA4A8FA-F7F4-45B3-AEC8-8886D35AAC79} {29638A67-E79F-44FE-AC05-DA499EBA929E} = {2F3E1026-5054-4E1F-899B-F1A7F70F9912} - {24331E82-D7AF-45B1-ACF0-CA6C3B0B77DC} = {6EF07978-A6D2-40EB-891D-7D70C5F37E76} - {790E94F2-5393-47DF-AC52-D9247F5B243A} = {6EF07978-A6D2-40EB-891D-7D70C5F37E76} - {169BEA3D-2A81-47EE-A6C1-3F8719EEC1F6} = {DD089B8B-DA73-492A-9010-F772D1C178DA} - {AFEB799E-82C3-4D02-9D5C-766BB8DEF004} = {DD089B8B-DA73-492A-9010-F772D1C178DA} - {F50336DA-42D1-4DD1-A107-67AFEB8A33EE} = {1B8D5897-902E-4632-8698-E89CAF3DDF54} {A516931E-EDBB-4FC3-BB94-1BB824D5BC61} = {5BA4A8FA-F7F4-45B3-AEC8-8886D35AAC79} {BBCE36D1-6767-4ED1-B3E8-84D2567A962A} = {A516931E-EDBB-4FC3-BB94-1BB824D5BC61} {73BBB1E3-AEEC-44E8-83D7-6DD9CD687FE3} = {5BA4A8FA-F7F4-45B3-AEC8-8886D35AAC79} {B0946844-DE0E-4C59-9391-C0EB649DBF4E} = {18453B51-25EB-4317-A4B3-B10518252E92} - {A1FE2CA0-8EF3-4EDB-9055-DD282E374E16} = {EB3A7401-0DE3-476F-9E6F-057F1F4590FB} - {EB3A7401-0DE3-476F-9E6F-057F1F4590FB} = {5BA4A8FA-F7F4-45B3-AEC8-8886D35AAC79} - {BF4CDE28-F0CC-482D-8392-C1C9BB4C368F} = {EB3A7401-0DE3-476F-9E6F-057F1F4590FB} - {7EB0CFB8-B668-4F3F-898D-80411095BC2F} = {EB3A7401-0DE3-476F-9E6F-057F1F4590FB} {34BC9836-681D-43A5-BC39-E4FEE17FC528} = {08B41FFA-CEE3-46A7-B5C0-3EB65D37A16C} {CBB515F3-A0EF-43B5-A907-FD4E652DD66E} = {90031D64-CA0F-46D0-9AF4-8DC023A5FFCD} {90CD37A9-C866-4D90-A3B1-8C87F53B845E} = {CBB515F3-A0EF-43B5-A907-FD4E652DD66E} - {3F20899B-C5E1-485F-808B-ADB1877EB3FD} = {5BA4A8FA-F7F4-45B3-AEC8-8886D35AAC79} - {3D42FCA2-5BD0-4624-9FCA-F4BF935B27AE} = {3F20899B-C5E1-485F-808B-ADB1877EB3FD} - {56CAA9F2-1882-4EFA-BAC0-9C3D804553F1} = {18453B51-25EB-4317-A4B3-B10518252E92} - {0D4A88A1-8AEE-49ED-BC2E-ED68C96F60AD} = {58C59255-281C-4595-8732-808158F1DC6E} {5CBCBEA4-6038-48CA-B45D-C1D0F6B4ACA4} = {C6658DE0-2B2F-47F0-BB61-2CA66D435C09} {94A61AD7-2A2B-40DB-81F3-C59D596958A8} = {C6658DE0-2B2F-47F0-BB61-2CA66D435C09} {4B598AF7-BD7D-4544-A274-2CDDD98F4167} = {C6658DE0-2B2F-47F0-BB61-2CA66D435C09} @@ -908,44 +494,32 @@ Global {060FD0BA-BD78-48E1-A8A7-4906A5AD5E39} = {D92BEAB2-60D6-4BB4-885A-6BA681C6CCF1} {169A82A5-2DB3-40EA-801E-14C08D743DF7} = {D92BEAB2-60D6-4BB4-885A-6BA681C6CCF1} {2CDF3E1C-267D-4198-B1C7-7E1F548FC120} = {5BA4A8FA-F7F4-45B3-AEC8-8886D35AAC79} - {01B96BB9-35E8-4364-ACB8-6D12A14D8DBA} = {5BA4A8FA-F7F4-45B3-AEC8-8886D35AAC79} - {47FBCB04-0C2D-453C-BE2F-7052CAC22524} = {EB3A7401-0DE3-476F-9E6F-057F1F4590FB} {B32DB9B2-AD6C-48A5-8682-4373CB045185} = {C80C8231-D35C-4ACC-9ED6-9F3DB221535E} {454652D5-E1BB-4D4B-9B21-9CEFC900C4FB} = {B32DB9B2-AD6C-48A5-8682-4373CB045185} {31089E79-694B-4F45-97AF-86D34A7B231E} = {B32DB9B2-AD6C-48A5-8682-4373CB045185} {6DDB9ECF-D454-4894-A262-A6BB3026E61E} = {B32DB9B2-AD6C-48A5-8682-4373CB045185} {16B570BC-E293-4A19-B20E-5C97BAF8476B} = {B32DB9B2-AD6C-48A5-8682-4373CB045185} - {EBD0CF78-C5D7-4B4B-94C9-C5D8C20B6F59} = {5BA4A8FA-F7F4-45B3-AEC8-8886D35AAC79} - {34FAB60D-7259-47B9-B50E-B533C7C3CFEC} = {8CEEC194-820A-4C8D-AB9E-E51E6D3E9CC1} - {8CEEC194-820A-4C8D-AB9E-E51E6D3E9CC1} = {5BA4A8FA-F7F4-45B3-AEC8-8886D35AAC79} - {19329441-2A59-4BAC-A1BE-BBAB70C93CA0} = {8CEEC194-820A-4C8D-AB9E-E51E6D3E9CC1} - {37D16EAF-ACD8-4105-8BD3-B2745819CFF8} = {8CEEC194-820A-4C8D-AB9E-E51E6D3E9CC1} {3666CF13-1353-4620-9472-506670214A6A} = {C80C8231-D35C-4ACC-9ED6-9F3DB221535E} {AA5ACF15-8647-4AC9-B9F5-73FCB92BE7E3} = {C80C8231-D35C-4ACC-9ED6-9F3DB221535E} {DFFE6199-B5A7-4BA8-A5E1-77D0426C6468} = {B32DB9B2-AD6C-48A5-8682-4373CB045185} - {9A6D67DE-51B1-456D-B25D-19E0356C8F60} = {8CEEC194-820A-4C8D-AB9E-E51E6D3E9CC1} - {44A03CF6-4EB6-434C-90D1-FF8142FE394E} = {8CEEC194-820A-4C8D-AB9E-E51E6D3E9CC1} - {29D12ADC-55E9-40D0-9E4C-F0EBB6E098EC} = {8CEEC194-820A-4C8D-AB9E-E51E6D3E9CC1} - {6C606FEB-9A1F-4816-ABE4-22AFA8CEE771} = {8CEEC194-820A-4C8D-AB9E-E51E6D3E9CC1} - {5F80663C-B072-49DE-9A67-FD804BAD787E} = {6EF07978-A6D2-40EB-891D-7D70C5F37E76} - {630E2D93-7F7D-4A8A-BB52-D8095A1F24D9} = {8CEEC194-820A-4C8D-AB9E-E51E6D3E9CC1} - {59E7614A-3630-4C39-9C7F-9E12BC95D37E} = {8CEEC194-820A-4C8D-AB9E-E51E6D3E9CC1} {2F3E1026-5054-4E1F-899B-F1A7F70F9912} = {5BA4A8FA-F7F4-45B3-AEC8-8886D35AAC79} {D5720DBC-8C2B-42D5-9D9F-2FF6EAD4001C} = {2F3E1026-5054-4E1F-899B-F1A7F70F9912} - {BF934627-F531-44FB-BEC2-ECA801FF31E7} = {DD089B8B-DA73-492A-9010-F772D1C178DA} {66E2E2CF-967F-4564-89E8-F46FA973C99B} = {986E5482-0482-448C-B9E4-EC67A9474B85} - {9DF81143-2F39-4CFB-9DA3-902279010622} = {5BA4A8FA-F7F4-45B3-AEC8-8886D35AAC79} - {75E08B0E-A41A-425C-9DCA-155505CE41CD} = {9DF81143-2F39-4CFB-9DA3-902279010622} - {BD120D97-4862-469E-B2CF-4109F7F21C20} = {9DF81143-2F39-4CFB-9DA3-902279010622} - {8A3443F3-D40E-44B9-9805-B4CB7A3F022C} = {9DF81143-2F39-4CFB-9DA3-902279010622} - {FA2B2B44-7E3E-444B-A157-7526B376E9CA} = {9DF81143-2F39-4CFB-9DA3-902279010622} - {DF0CA7E2-F5DF-40ED-91B6-748767084FC7} = {9DF81143-2F39-4CFB-9DA3-902279010622} - {DB20B168-CD90-41F2-BE08-3D8C6F142459} = {9DF81143-2F39-4CFB-9DA3-902279010622} {0A04B1FD-06C0-4271-A910-A08C263DBC44} = {0354F050-3992-4DD4-B0EE-5FBA04AC72B6} {9B80A705-2E31-4012-964A-83963DCDB384} = {0354F050-3992-4DD4-B0EE-5FBA04AC72B6} {CD7DC0D1-FFDC-417A-89BE-7F32408F583E} = {5BA4A8FA-F7F4-45B3-AEC8-8886D35AAC79} {70593549-8B26-4D63-9857-6BA8BB3E31DB} = {CD7DC0D1-FFDC-417A-89BE-7F32408F583E} {E7137FB0-1988-4562-AD8D-D0D9D2EE85F6} = {CD7DC0D1-FFDC-417A-89BE-7F32408F583E} + {02EA681E-C7D8-13C7-8484-4AC65E1B71E8} = {5BA4A8FA-F7F4-45B3-AEC8-8886D35AAC79} + {6F14B066-DF7B-2409-59D8-CCCA90A4974C} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8} + {C55015F0-E9DF-4BF9-8131-D7539E938220} = {5BA4A8FA-F7F4-45B3-AEC8-8886D35AAC79} + {E0B22AB7-7CB5-6D17-562C-4A989DC61F8A} = {C55015F0-E9DF-4BF9-8131-D7539E938220} + {16C3FBDE-A832-E3CD-5FBF-F51744D1F79B} = {6EF07978-A6D2-40EB-891D-7D70C5F37E76} + {765392DE-8560-B464-62DD-6890720FF5D5} = {6EF07978-A6D2-40EB-891D-7D70C5F37E76} + {099D5DCE-CCF7-16FE-6EDC-A64B694F50BE} = {6EF07978-A6D2-40EB-891D-7D70C5F37E76} + {08B69CC4-B5F0-44E8-FA7A-6BF6F00CA40A} = {6EF07978-A6D2-40EB-891D-7D70C5F37E76} + {6AF53651-99F0-1DE0-D37B-4FF6B0348DBB} = {6EF07978-A6D2-40EB-891D-7D70C5F37E76} + {9D8FB664-88B4-10BE-58A2-D9A1644AD2E4} = {6EF07978-A6D2-40EB-891D-7D70C5F37E76} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {D4B5CEAA-7D70-4FCB-A68E-B03FBE5E0E5E} diff --git a/build/_build.csproj b/build/_build.csproj index 465dc8f654..0e27141ab1 100644 --- a/build/_build.csproj +++ b/build/_build.csproj @@ -3,7 +3,7 @@ Exe net9.0 - + CS0649;CS0169;CA1050;CA1822;CA2211;IDE1006 .. .. @@ -24,7 +24,7 @@ - + diff --git a/src/apps/Elsa.Server.Web/Elsa.Server.Web.csproj b/src/apps/Elsa.Server.Web/Elsa.Server.Web.csproj index ce9d79c767..2f3bf9e382 100644 --- a/src/apps/Elsa.Server.Web/Elsa.Server.Web.csproj +++ b/src/apps/Elsa.Server.Web/Elsa.Server.Web.csproj @@ -1,77 +1,85 @@  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - + diff --git a/src/apps/Elsa.Server.Web/Extensions/MultitenantConnectionStringServiceProviderExtensions.cs b/src/apps/Elsa.Server.Web/Extensions/MultitenantConnectionStringServiceProviderExtensions.cs index 0cc7a9c415..9c5fabbc8b 100644 --- a/src/apps/Elsa.Server.Web/Extensions/MultitenantConnectionStringServiceProviderExtensions.cs +++ b/src/apps/Elsa.Server.Web/Extensions/MultitenantConnectionStringServiceProviderExtensions.cs @@ -1,5 +1,5 @@ using Elsa.Common.Multitenancy; -using Elsa.EntityFrameworkCore.Extensions; +using Elsa.Persistence.EFCore.Extensions; namespace Elsa.Server.Web.Extensions; diff --git a/src/apps/Elsa.Server.Web/Program.cs b/src/apps/Elsa.Server.Web/Program.cs index 28fb61c494..8c64a538bc 100644 --- a/src/apps/Elsa.Server.Web/Program.cs +++ b/src/apps/Elsa.Server.Web/Program.cs @@ -5,28 +5,26 @@ using Elsa.Common.Codecs; using Elsa.Common.DistributedHosting.DistributedLocks; using Elsa.Common.RecurringTasks; -using Elsa.Dapper.Extensions; -using Elsa.Dapper.Services; using Elsa.DropIns.Extensions; -using Elsa.EntityFrameworkCore.Extensions; -using Elsa.EntityFrameworkCore.Modules.Alterations; -using Elsa.EntityFrameworkCore.Modules.Identity; -using Elsa.EntityFrameworkCore.Modules.Management; -using Elsa.EntityFrameworkCore.Modules.Runtime; -using Elsa.EntityFrameworkCore.Modules.Tenants; using Elsa.Expressions.Helpers; using Elsa.Extensions; using Elsa.Features.Services; using Elsa.Identity.Multitenancy; -using Elsa.Kafka; -using Elsa.MassTransit.Extensions; -using Elsa.MongoDb.Extensions; -using Elsa.MongoDb.Modules.Alterations; -using Elsa.MongoDb.Modules.Identity; -using Elsa.MongoDb.Modules.Management; -using Elsa.MongoDb.Modules.Runtime; -using Elsa.MongoDb.Modules.Tenants; using Elsa.OpenTelemetry.Middleware; +using Elsa.Persistence.Dapper.Extensions; +using Elsa.Persistence.Dapper.Services; +using Elsa.Persistence.EFCore.Extensions; +using Elsa.Persistence.EFCore.Modules.Alterations; +using Elsa.Persistence.EFCore.Modules.Identity; +using Elsa.Persistence.EFCore.Modules.Management; +using Elsa.Persistence.EFCore.Modules.Runtime; +using Elsa.Persistence.EFCore.Modules.Tenants; +using Elsa.Persistence.MongoDb.Extensions; +using Elsa.Persistence.MongoDb.Modules.Alterations; +using Elsa.Persistence.MongoDb.Modules.Identity; +using Elsa.Persistence.MongoDb.Modules.Management; +using Elsa.Persistence.MongoDb.Modules.Runtime; +using Elsa.Persistence.MongoDb.Modules.Tenants; using Elsa.Retention.Extensions; using Elsa.Retention.Models; using Elsa.Secrets.Extensions; @@ -35,6 +33,13 @@ using Elsa.Server.Web; using Elsa.Server.Web.Extensions; using Elsa.Server.Web.Filters; +using Elsa.ServiceBus.Kafka; +using Elsa.ServiceBus.MassTransit.Extensions; +using Elsa.Sql.Extensions; +using Elsa.Sql.MySql; +using Elsa.Sql.Sqlite; +using Elsa.Sql.PostgreSql; +using Elsa.Sql.SqlServer; using Elsa.Tenants.AspNetCore; using Elsa.Tenants.Extensions; using Elsa.Workflows; @@ -328,7 +333,7 @@ if (sqlDatabaseProvider == SqlDatabaseProvider.SqlServer) { //ef.UseSqlServer(sqlServerConnectionString, new ElsaDbContextOptions); - var migrationsAssembly = typeof(Elsa.EntityFrameworkCore.SqlServer.IdentityDbContextFactory).Assembly; + var migrationsAssembly = typeof(Elsa.Persistence.EFCore.SqlServer.IdentityDbContextFactory).Assembly; var connectionString = sqlServerConnectionString; ef.DbContextOptionsBuilder = (_, db) => db.UseElsaSqlServer(migrationsAssembly, connectionString, null, configure => configure.CommandTimeout(60000)); } @@ -424,17 +429,17 @@ options.AppendScript("string Greet(string name) => $\"Hello {name}!\";"); options.AppendScript("string SayHelloWorld() => Greet(\"World\");"); }) - .UseJavaScript(options => - { - options.AllowClrAccess = true; - options.DisableWrappers = disableVariableWrappers; - options.DisableVariableCopying = disableVariableCopying; - options.ConfigureEngine(engine => - { - engine.Execute("function greet(name) { return `Hello ${name}!`; }"); - engine.Execute("function sayHelloWorld() { return greet('World'); }"); - }); - }) + //.UseJavaScript(options => + //{ + // options.AllowClrAccess = true; + // options.DisableWrappers = disableVariableWrappers; + // options.DisableVariableCopying = disableVariableCopying; + // options.ConfigureEngine(engine => + // { + // engine.Execute("function greet(name) { return `Hello ${name}!`; }"); + // engine.Execute("function sayHelloWorld() { return greet('World'); }"); + // }); + //}) .UsePython(python => { python.PythonOptions += options => @@ -458,6 +463,16 @@ if (useCaching) http.UseCache(); }) + .UseSql(options => + { + options.Clients = client => + { + client.Register("MySql"); + client.Register("PostgreSql"); + client.Register("Sqlite"); + client.Register("Sql Server"); + }; + }) .UseEmail(email => email.ConfigureOptions = options => configuration.GetSection("Smtp").Bind(options)) .UseAlterations(alterations => { diff --git a/src/apps/Elsa.ServerAndStudio.Web/Elsa.ServerAndStudio.Web.csproj b/src/apps/Elsa.ServerAndStudio.Web/Elsa.ServerAndStudio.Web.csproj index 3ea5601f3a..0a49cfc263 100644 --- a/src/apps/Elsa.ServerAndStudio.Web/Elsa.ServerAndStudio.Web.csproj +++ b/src/apps/Elsa.ServerAndStudio.Web/Elsa.ServerAndStudio.Web.csproj @@ -7,48 +7,49 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/apps/Elsa.ServerAndStudio.Web/Program.cs b/src/apps/Elsa.ServerAndStudio.Web/Program.cs index 01b787cad1..be6a4cc96a 100644 --- a/src/apps/Elsa.ServerAndStudio.Web/Program.cs +++ b/src/apps/Elsa.ServerAndStudio.Web/Program.cs @@ -1,19 +1,18 @@ using Elsa.Agents; -using Elsa.EntityFrameworkCore.Extensions; -using Elsa.EntityFrameworkCore.Modules.Management; -using Elsa.EntityFrameworkCore.Modules.Runtime; -using Elsa.MassTransit.Options; +using Elsa.Expressions.JavaScript.Libraries.Extensions; using Elsa.Extensions; -using Elsa.JavaScript.Libraries.Extensions; -using Elsa.ServerAndStudio.Web.Extensions; -using Elsa.MassTransit.Extensions; +using Elsa.Persistence.EFCore.Extensions; +using Elsa.Persistence.EFCore.Modules.Management; +using Elsa.Persistence.EFCore.Modules.Runtime; using Elsa.ServerAndStudio.Web.Enums; +using Elsa.ServerAndStudio.Web.Extensions; +using Elsa.ServiceBus.MassTransit.Extensions; +using Elsa.ServiceBus.MassTransit.Options; using Medallion.Threading.FileSystem; using Microsoft.AspNetCore.Mvc; using Microsoft.Data.Sqlite; -using WebhooksCore.Options; -using Elsa.Connections.Middleware; using Proto.Persistence.Sqlite; +using WebhooksCore.Options; const bool useMassTransit = true; const bool useProtoActor = true; diff --git a/src/common/Elsa.DropIns.Core/Elsa.DropIns.Core.csproj b/src/common/Elsa.DropIns.Core/Elsa.DropIns.Core.csproj deleted file mode 100644 index d684d14cc6..0000000000 --- a/src/common/Elsa.DropIns.Core/Elsa.DropIns.Core.csproj +++ /dev/null @@ -1,18 +0,0 @@ - - - - - Reference this package when developing drop-ins for Elsa Workflows. - - elsa drop-ins common - - - - - - - - - - - diff --git a/src/common/Elsa.DropIns.Core/IDropIn.cs b/src/common/Elsa.DropIns.Core/IDropIn.cs deleted file mode 100644 index ef2ca2d47b..0000000000 --- a/src/common/Elsa.DropIns.Core/IDropIn.cs +++ /dev/null @@ -1,25 +0,0 @@ -using Elsa.Features.Services; - -namespace Elsa.DropIns.Core; - -/// -/// Implement this in your drop-in module to configure elsa and register services. -/// -public interface IDropIn -{ - /// - /// Called when the drop-in is installed. - /// - /// The Elsa module. - void Install(IModule module); - - /// - /// Called when the drop-in is being configured. - /// - ValueTask ConfigureAsync(IServiceProvider serviceProvider, CancellationToken cancellationToken); - - /// - /// Unconfigure the drop-in when it's deleted. - /// - void Unconfigure(IServiceProvider serviceProvider); -} \ No newline at end of file diff --git a/src/common/Elsa.DropIns/Catalogs/AssembliesDropInCatalog.cs b/src/common/Elsa.DropIns/Catalogs/AssembliesDropInCatalog.cs deleted file mode 100644 index 6372ddd339..0000000000 --- a/src/common/Elsa.DropIns/Catalogs/AssembliesDropInCatalog.cs +++ /dev/null @@ -1,29 +0,0 @@ -using System.Reflection; -using Elsa.DropIns.Contracts; -using Elsa.DropIns.Models; - -namespace Elsa.DropIns.Catalogs; - -public class AssembliesDropInCatalog : IDropInCatalog -{ - private readonly IEnumerable _assemblies; - - public AssembliesDropInCatalog(IEnumerable assemblies) - { - _assemblies = assemblies; - } - - public IEnumerable List() - { - var allDropIns = new List(); - - foreach (var assembly in _assemblies) - { - var assemblyCatalog = new AssemblyDropInCatalog(assembly); - var dropIns = assemblyCatalog.List(); - allDropIns.AddRange(dropIns); - } - - return allDropIns; - } -} \ No newline at end of file diff --git a/src/common/Elsa.DropIns/Catalogs/AssemblyDropInCatalog.cs b/src/common/Elsa.DropIns/Catalogs/AssemblyDropInCatalog.cs deleted file mode 100644 index 791757a3b8..0000000000 --- a/src/common/Elsa.DropIns/Catalogs/AssemblyDropInCatalog.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System.Reflection; -using Elsa.DropIns.Contracts; -using Elsa.DropIns.Core; -using Elsa.DropIns.Helpers; -using Elsa.DropIns.Models; - -namespace Elsa.DropIns.Catalogs; - -public class AssemblyDropInCatalog : IDropInCatalog -{ - private readonly Assembly _assembly; - - public AssemblyDropInCatalog(Assembly assembly) - { - _assembly = assembly; - } - - public IEnumerable List() - { - var dropIns = TypeFinder.FindImplementationsOf(_assembly) - .Select(type => new DropInDescriptor(type)) - .ToList(); - - return dropIns; - } -} \ No newline at end of file diff --git a/src/common/Elsa.DropIns/Catalogs/DirectoryDropInCatalog.cs b/src/common/Elsa.DropIns/Catalogs/DirectoryDropInCatalog.cs deleted file mode 100644 index 8a05e24608..0000000000 --- a/src/common/Elsa.DropIns/Catalogs/DirectoryDropInCatalog.cs +++ /dev/null @@ -1,62 +0,0 @@ -using System.Reflection; -using Elsa.DropIns.Contracts; -using Elsa.DropIns.Helpers; -using Elsa.DropIns.Models; - -namespace Elsa.DropIns.Catalogs; - -/// -/// A catalog that lists drop-ins from a directory. -/// -public class DirectoryDropInCatalog : IDropInCatalog -{ - private readonly string _directoryPath; - - /// - /// Initializes a new instance of the class. - /// - /// The directory path to list drop-ins from. - public DirectoryDropInCatalog(string directoryPath) - { - _directoryPath = directoryPath; - } - - /// - public IEnumerable List() - { - if (!Directory.Exists(_directoryPath)) - return Enumerable.Empty(); - - var assemblies = ListAssemblies(); - var packages = ListPackages(); - var assembliesCatalog = new AssembliesDropInCatalog(assemblies); - var packagesCatalog = new NuGetPackagesCatalog(packages); - - return assembliesCatalog.List().Concat(packagesCatalog.List()); - } - - private IEnumerable ListAssemblies() - { - var assemblyPaths = Directory.GetFiles(_directoryPath, "*.dll", SearchOption.AllDirectories); - - foreach (var assemblyPath in assemblyPaths) - { - var assembly = LoadDropInAssembly(assemblyPath); - - if (assembly == null) - continue; - - yield return assembly; - } - } - - private string[] ListPackages() - { - return Directory.GetFiles(_directoryPath, "*.nupkg", SearchOption.AllDirectories); - } - - private static Assembly? LoadDropInAssembly(string path) - { - return !File.Exists(path) ? null : AssemblyLoader.LoadPath(path); - } -} \ No newline at end of file diff --git a/src/common/Elsa.DropIns/Catalogs/NuGetPackageCatalog.cs b/src/common/Elsa.DropIns/Catalogs/NuGetPackageCatalog.cs deleted file mode 100644 index 9f8dbcbb16..0000000000 --- a/src/common/Elsa.DropIns/Catalogs/NuGetPackageCatalog.cs +++ /dev/null @@ -1,24 +0,0 @@ -using Elsa.DropIns.Contexts; -using Elsa.DropIns.Contracts; -using Elsa.DropIns.Models; - -namespace Elsa.DropIns.Catalogs; - -public class NuGetPackageCatalog : IDropInCatalog -{ - private readonly string _packagePath; - - public NuGetPackageCatalog(string packagePath) - { - _packagePath = packagePath; - } - - public IEnumerable List() - { - var assemblyLoadContext = new NuGetPackageAssemblyLoadContext(_packagePath); - var assemblies = assemblyLoadContext.Assemblies; - var assembliesCatalog = new AssembliesDropInCatalog(assemblies); - - return assembliesCatalog.List(); - } -} \ No newline at end of file diff --git a/src/common/Elsa.DropIns/Catalogs/NuGetPackagesCatalog.cs b/src/common/Elsa.DropIns/Catalogs/NuGetPackagesCatalog.cs deleted file mode 100644 index a879325ee9..0000000000 --- a/src/common/Elsa.DropIns/Catalogs/NuGetPackagesCatalog.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Elsa.DropIns.Contracts; -using Elsa.DropIns.Models; - -namespace Elsa.DropIns.Catalogs; - -public class NuGetPackagesCatalog : IDropInCatalog -{ - private readonly IEnumerable _packagePaths; - - public NuGetPackagesCatalog(IEnumerable packagePaths) - { - _packagePaths = packagePaths; - } - - public IEnumerable List() - { - return _packagePaths.Select(packagePath => new NuGetPackageCatalog(packagePath)).SelectMany(catalog => catalog.List()); - } -} \ No newline at end of file diff --git a/src/common/Elsa.DropIns/Contexts/DirectoryAssemblyLoadContext.cs b/src/common/Elsa.DropIns/Contexts/DirectoryAssemblyLoadContext.cs deleted file mode 100644 index 4a33f99db7..0000000000 --- a/src/common/Elsa.DropIns/Contexts/DirectoryAssemblyLoadContext.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System.Reflection; -using System.Runtime.Loader; - -namespace Elsa.DropIns.Contexts; - -internal sealed class DirectoryAssemblyLoadContext : AssemblyLoadContext -{ - private readonly AssemblyDependencyResolver _resolver; - - public DirectoryAssemblyLoadContext(string dropInPath) - { - _resolver = new AssemblyDependencyResolver(dropInPath); - } - - protected override Assembly? Load(AssemblyName assemblyName) - { - var assemblyPath = _resolver.ResolveAssemblyToPath(assemblyName); - return assemblyPath != null ? LoadFromAssemblyPath(assemblyPath) : null; - } - - protected override IntPtr LoadUnmanagedDll(string unmanagedDllName) - { - var libraryPath = _resolver.ResolveUnmanagedDllToPath(unmanagedDllName); - return libraryPath != null ? LoadUnmanagedDllFromPath(libraryPath) : IntPtr.Zero; - } -} \ No newline at end of file diff --git a/src/common/Elsa.DropIns/Contexts/NuGetPackageAssemblyLoadContext.cs b/src/common/Elsa.DropIns/Contexts/NuGetPackageAssemblyLoadContext.cs deleted file mode 100644 index 8c2d1264e1..0000000000 --- a/src/common/Elsa.DropIns/Contexts/NuGetPackageAssemblyLoadContext.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System.Reflection; -using System.Runtime.Loader; -using NuGet.Packaging; - -namespace Elsa.DropIns.Contexts; - -internal sealed class NuGetPackageAssemblyLoadContext : AssemblyLoadContext -{ - private readonly Dictionary _loadedAssemblies = new Dictionary(); - - public NuGetPackageAssemblyLoadContext(string nugetPackagePath) - { - var packageReader = new PackageArchiveReader(nugetPackagePath); - - foreach (var dllFile in packageReader.GetFiles().Where(fileName => fileName.EndsWith(".dll", StringComparison.OrdinalIgnoreCase))) - { - using var dllStream = packageReader.GetStream(dllFile); - using var memoryStream = new MemoryStream(); - dllStream.CopyTo(memoryStream); - memoryStream.Seek(0, SeekOrigin.Begin); - var assembly = LoadFromStream(memoryStream); - - _loadedAssemblies[assembly.FullName!] = assembly; - } - //Closes the package reader, closing the .nupkg file - packageReader.Dispose(); - } - - protected override Assembly? Load(AssemblyName assemblyName) - { - return _loadedAssemblies.GetValueOrDefault(assemblyName.FullName); - } -} \ No newline at end of file diff --git a/src/common/Elsa.DropIns/Contracts/IDropInCatalog.cs b/src/common/Elsa.DropIns/Contracts/IDropInCatalog.cs deleted file mode 100644 index 12f88f533a..0000000000 --- a/src/common/Elsa.DropIns/Contracts/IDropInCatalog.cs +++ /dev/null @@ -1,8 +0,0 @@ -using Elsa.DropIns.Models; - -namespace Elsa.DropIns.Contracts; - -public interface IDropInCatalog -{ - IEnumerable List(); -} \ No newline at end of file diff --git a/src/common/Elsa.DropIns/Contracts/IDropInInstaller.cs b/src/common/Elsa.DropIns/Contracts/IDropInInstaller.cs deleted file mode 100644 index a1d7df12d9..0000000000 --- a/src/common/Elsa.DropIns/Contracts/IDropInInstaller.cs +++ /dev/null @@ -1,8 +0,0 @@ -using Elsa.Features.Services; - -namespace Elsa.DropIns.Contracts; - -public interface IDropInInstaller -{ - void Install(IModule module); -} \ No newline at end of file diff --git a/src/common/Elsa.DropIns/Elsa.DropIns.csproj b/src/common/Elsa.DropIns/Elsa.DropIns.csproj deleted file mode 100644 index ea1b7958c7..0000000000 --- a/src/common/Elsa.DropIns/Elsa.DropIns.csproj +++ /dev/null @@ -1,29 +0,0 @@ - - - - - Provides drop-in features for Elsa workflows. - - elsa drop-ins common - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/common/Elsa.DropIns/Extensions/ModuleExtensions.cs b/src/common/Elsa.DropIns/Extensions/ModuleExtensions.cs deleted file mode 100644 index 9ef671b843..0000000000 --- a/src/common/Elsa.DropIns/Extensions/ModuleExtensions.cs +++ /dev/null @@ -1,21 +0,0 @@ -using Elsa.DropIns.Contracts; -using Elsa.DropIns.Options; -using Elsa.Features.Services; -using Microsoft.Extensions.DependencyInjection; - -namespace Elsa.DropIns.Extensions; - -public static class ModuleExtensions -{ - public static IModule InstallDropIns(this IModule elsa, Action? configureOptions = default) - { - // Install drop-ins. - var serviceProvider = new ServiceCollection().AddDropInInstaller(configureOptions).BuildServiceProvider(); - serviceProvider.GetRequiredService().Install(elsa); - - // Register drop-in monitor. - elsa.Services.AddDropInMonitor(configureOptions); - - return elsa; - } -} \ No newline at end of file diff --git a/src/common/Elsa.DropIns/Extensions/ServiceCollectionExtensions.cs b/src/common/Elsa.DropIns/Extensions/ServiceCollectionExtensions.cs deleted file mode 100644 index 5ec1e8917c..0000000000 --- a/src/common/Elsa.DropIns/Extensions/ServiceCollectionExtensions.cs +++ /dev/null @@ -1,33 +0,0 @@ -using Elsa.DropIns.Contracts; -using Elsa.DropIns.HostedServices; -using Elsa.DropIns.Options; -using Elsa.DropIns.Services; -using Microsoft.Extensions.DependencyInjection; - -namespace Elsa.DropIns.Extensions; - -internal static class ServiceCollectionExtensions -{ - public static IServiceCollection AddDropInMonitor(this IServiceCollection services, Action? configureOptions = default) - { - services.AddDropInCore(configureOptions); - services.AddHostedService(); - - return services; - } - - public static IServiceCollection AddDropInInstaller(this IServiceCollection services, Action? configureOptions = default) - { - services.AddDropInCore(configureOptions); - services.AddSingleton(); - - return services; - } - - public static IServiceCollection AddDropInCore(this IServiceCollection services, Action? configureOptions = default) - { - services.Configure(configureOptions ?? (_ => { })); - - return services; - } -} \ No newline at end of file diff --git a/src/common/Elsa.DropIns/Helpers/AssemblyLoader.cs b/src/common/Elsa.DropIns/Helpers/AssemblyLoader.cs deleted file mode 100644 index 64b7799707..0000000000 --- a/src/common/Elsa.DropIns/Helpers/AssemblyLoader.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System.Reflection; -using System.Runtime.Loader; -using Elsa.DropIns.Contexts; - -namespace Elsa.DropIns.Helpers; - -public static class AssemblyLoader -{ - public static Assembly LoadPath(string path) - { - var loadContext = new DirectoryAssemblyLoadContext(path); - var assemblyName = AssemblyLoadContext.GetAssemblyName(path); - - // Copy drop in to memory stream to avoid file locking - using var fileStream = File.OpenRead(path); - using var memoryStream = new MemoryStream(); - fileStream.CopyTo(memoryStream); - memoryStream.Seek(0, SeekOrigin.Begin); - fileStream.Close(); - var assembly = loadContext.LoadFromStream(memoryStream); - - return assembly; - } -} \ No newline at end of file diff --git a/src/common/Elsa.DropIns/Helpers/TypeFinder.cs b/src/common/Elsa.DropIns/Helpers/TypeFinder.cs deleted file mode 100644 index b8b5655ac5..0000000000 --- a/src/common/Elsa.DropIns/Helpers/TypeFinder.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System.Reflection; - -namespace Elsa.DropIns.Helpers; - -public static class TypeFinder -{ - public static IEnumerable FindImplementationsOf(IEnumerable assemblies) - { - // Find all types that implement IDropInStartup: - return assemblies.SelectMany(FindImplementationsOf); - } - - public static IEnumerable FindImplementationsOf(Assembly assembly) - { - // Find all types that implement T: - return assembly.GetExportedTypes().Where(t => typeof(T).IsAssignableFrom(t) && t is { IsAbstract: false, IsInterface: false }); - } -} \ No newline at end of file diff --git a/src/common/Elsa.DropIns/HostedServices/DropInDirectoryMonitorHostedService.cs b/src/common/Elsa.DropIns/HostedServices/DropInDirectoryMonitorHostedService.cs deleted file mode 100644 index dda2fec587..0000000000 --- a/src/common/Elsa.DropIns/HostedServices/DropInDirectoryMonitorHostedService.cs +++ /dev/null @@ -1,143 +0,0 @@ -using Elsa.DropIns.Catalogs; -using Elsa.DropIns.Core; -using Elsa.DropIns.Options; -using Microsoft.Extensions.Hosting; -using Microsoft.Extensions.Logging; -using Microsoft.Extensions.Options; -using ThrottleDebounce; - -namespace Elsa.DropIns.HostedServices; - -/// -/// Monitors the drop-in directory for changes and loads any new drop-ins. -/// -public class DropInDirectoryMonitorHostedService : BackgroundService -{ - private readonly IOptions _options; - private readonly ILogger _logger; - private readonly IServiceProvider _serviceProvider; - private readonly RateLimitedFunc _debouncedLoader; - private readonly RateLimitedFunc _debouncedUnloader; - private readonly FileSystemWatcher _watcher; - - private readonly Dictionary> _installedDropIns; - - - /// - public DropInDirectoryMonitorHostedService( - IOptions options, - IServiceProvider serviceProvider, - ILogger logger - ) - { - _options = options; - _logger = logger; - _serviceProvider = serviceProvider; - _debouncedLoader = Debouncer.Debounce(LoadDropInAssemblyAsync, TimeSpan.FromSeconds(2)); - _debouncedUnloader = Debouncer.Debounce(UnloadDropInAssemblyAsync, TimeSpan.FromSeconds(2)); - - _installedDropIns = []; - - var rootDirectoryPath = _options.Value.DropInRootDirectory; - - if (!Directory.Exists(rootDirectoryPath)) - Directory.CreateDirectory(rootDirectoryPath); - - _watcher = new FileSystemWatcher(rootDirectoryPath) - { - EnableRaisingEvents = true, - IncludeSubdirectories = true, - NotifyFilter = NotifyFilters.LastWrite | NotifyFilters.FileName | NotifyFilters.DirectoryName - }; - } - - /// - protected override async Task ExecuteAsync(CancellationToken stoppingToken) - { - await LoadDropInAssemblyAsync(_options.Value.DropInRootDirectory); - - _watcher.Changed += OnChanged; - _watcher.Deleted += OnDeleted; - } - - private async void OnChanged(object sender, FileSystemEventArgs e) - { - var task = _debouncedLoader.Invoke(e.FullPath); - - if (task == null) - return; - - await task; - } - - private async void OnDeleted(object sender, FileSystemEventArgs e) - { - var task = _debouncedUnloader.Invoke(e.FullPath); - - if (task == null) - return; - - await task; - } - - private async Task LoadDropInAssemblyAsync(string fullPath) - { - var directory = Path.GetDirectoryName(fullPath)!; - var directoryCatalog = new DirectoryDropInCatalog(directory); - var dropInDescriptors = directoryCatalog.List(); - - foreach (var dropInDescriptor in dropInDescriptors) - { - var dropIn = (IDropIn)Activator.CreateInstance(dropInDescriptor.Type)!; - if (_installedDropIns.TryGetValue(fullPath, out var installedDropIns)) - { - installedDropIns.Add(dropIn); - } - else - { - _installedDropIns[fullPath] = [dropIn]; - } - await dropIn.ConfigureAsync(_serviceProvider, CancellationToken.None); - } - } - - private Task UnloadDropInAssemblyAsync(string fullPath) - { - if (_installedDropIns.TryGetValue(fullPath, out var installedDropIn)) - { - installedDropIn.ForEach(dropIn => - { - try - { - dropIn.Unconfigure(_serviceProvider); - } - catch (Exception ex) - { - _logger.LogError(ex, "Error unconfiguring drop-in {DropIn}", dropIn.GetType().Name); - } - }); - _installedDropIns.Remove(fullPath); - } - return Task.CompletedTask; - } - - /// - public override async Task StopAsync(CancellationToken cancellationToken) - { - _watcher.EnableRaisingEvents = false; - _watcher.Changed -= OnChanged; - _watcher.Deleted -= OnDeleted; - - await base.StopAsync(cancellationToken); - } - - /// - public override void Dispose() - { - _watcher.Changed -= OnChanged; - _watcher.Deleted -= OnDeleted; - _watcher.Dispose(); - - base.Dispose(); - } -} \ No newline at end of file diff --git a/src/common/Elsa.DropIns/Models/DropInDescriptor.cs b/src/common/Elsa.DropIns/Models/DropInDescriptor.cs deleted file mode 100644 index 8b036263ce..0000000000 --- a/src/common/Elsa.DropIns/Models/DropInDescriptor.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System.Diagnostics.CodeAnalysis; - -namespace Elsa.DropIns.Models; - -public class DropInDescriptor([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] Type type) -{ - /// - /// Gets or sets the type of the drop-in. - /// The DynamicallyAccessedMembers attribute ensures that the IL2072 warning is suppressed. - /// - [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] - public Type Type { get; set; } = type; -} \ No newline at end of file diff --git a/src/common/Elsa.DropIns/Options/DropInOptions.cs b/src/common/Elsa.DropIns/Options/DropInOptions.cs deleted file mode 100644 index e2b3987a70..0000000000 --- a/src/common/Elsa.DropIns/Options/DropInOptions.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace Elsa.DropIns.Options; - -public class DropInOptions -{ - public string DropInRootDirectory { get; set; } = default!; -} \ No newline at end of file diff --git a/src/common/Elsa.DropIns/Services/DropInInstaller.cs b/src/common/Elsa.DropIns/Services/DropInInstaller.cs deleted file mode 100644 index 3706e7c417..0000000000 --- a/src/common/Elsa.DropIns/Services/DropInInstaller.cs +++ /dev/null @@ -1,36 +0,0 @@ -using Elsa.DropIns.Catalogs; -using Elsa.DropIns.Contracts; -using Elsa.DropIns.Core; -using Elsa.DropIns.Options; -using Elsa.Features.Services; -using Microsoft.Extensions.Options; - -namespace Elsa.DropIns.Services; - -/// -public class DropInInstaller : IDropInInstaller -{ - private readonly IOptions _options; - - /// - /// Initializes a new instance of the class. - /// - public DropInInstaller(IOptions options) - { - _options = options; - } - - /// - public void Install(IModule module) - { - var dropInRootDirectory = _options.Value.DropInRootDirectory; - var directoryCatalog = new DirectoryDropInCatalog(dropInRootDirectory); - var dropInDescriptors = directoryCatalog.List(); - - foreach (var dropInDescriptor in dropInDescriptors) - { - var dropIn = (IDropIn)Activator.CreateInstance(dropInDescriptor.Type)!; - dropIn.Install(module); - } - } -} \ No newline at end of file diff --git a/src/common/Elsa.Testing.Shared.Component/Elsa.Testing.Shared.Component.csproj b/src/common/Elsa.Testing.Shared.Component/Elsa.Testing.Shared.Component.csproj index 3e0b5a4759..3d81bda8f2 100644 --- a/src/common/Elsa.Testing.Shared.Component/Elsa.Testing.Shared.Component.csproj +++ b/src/common/Elsa.Testing.Shared.Component/Elsa.Testing.Shared.Component.csproj @@ -1,4 +1,4 @@ - + @@ -9,19 +9,19 @@ + + + + + - - - - - diff --git a/src/common/Elsa.Testing.Shared.Integration/Elsa.Testing.Shared.Integration.csproj b/src/common/Elsa.Testing.Shared.Integration/Elsa.Testing.Shared.Integration.csproj index 06b02b1961..a7a7371946 100644 --- a/src/common/Elsa.Testing.Shared.Integration/Elsa.Testing.Shared.Integration.csproj +++ b/src/common/Elsa.Testing.Shared.Integration/Elsa.Testing.Shared.Integration.csproj @@ -4,22 +4,22 @@ Provides common utilities that are helpful when writing integration tests against Elsa Workflows functionality. - elsa, integration testing + elsa integration testing Elsa.Testing.Shared - + + + + + + - - - - - diff --git a/src/common/Elsa.Testing.Shared/Elsa.Testing.Shared.csproj b/src/common/Elsa.Testing.Shared/Elsa.Testing.Shared.csproj index ceabd44724..3e79f6559c 100644 --- a/src/common/Elsa.Testing.Shared/Elsa.Testing.Shared.csproj +++ b/src/common/Elsa.Testing.Shared/Elsa.Testing.Shared.csproj @@ -8,17 +8,17 @@ + + + + + - - - - - diff --git a/src/modules/Elsa.Alterations.Core/Abstractions/AlterationBase.cs b/src/modules/Elsa.Alterations.Core/Abstractions/AlterationBase.cs deleted file mode 100644 index e7f0f24791..0000000000 --- a/src/modules/Elsa.Alterations.Core/Abstractions/AlterationBase.cs +++ /dev/null @@ -1,10 +0,0 @@ -using Elsa.Alterations.Core.Contracts; - -namespace Elsa.Alterations.Core.Abstractions; - -/// -/// A base class for alterations. -/// -public abstract class AlterationBase : IAlteration -{ -} \ No newline at end of file diff --git a/src/modules/Elsa.Alterations.Core/Abstractions/AlterationHandlerBase.cs b/src/modules/Elsa.Alterations.Core/Abstractions/AlterationHandlerBase.cs deleted file mode 100644 index 0652234299..0000000000 --- a/src/modules/Elsa.Alterations.Core/Abstractions/AlterationHandlerBase.cs +++ /dev/null @@ -1,33 +0,0 @@ -using Elsa.Alterations.Core.Contexts; -using Elsa.Alterations.Core.Contracts; - -namespace Elsa.Alterations.Core.Abstractions; - -/// -/// A base class for alterations. -/// -public abstract class AlterationHandlerBase : IAlterationHandler -{ - /// - public abstract bool CanHandle(IAlteration alteration); - - /// - public abstract ValueTask HandleAsync(AlterationContext context); -} - -/// -public abstract class AlterationHandlerBase : AlterationHandlerBase where T : IAlteration -{ - /// - public override bool CanHandle(IAlteration alteration) => alteration is T; - - /// - public override ValueTask HandleAsync(AlterationContext context) => HandleAsync(context, (T)context.Alteration); - - /// - /// Applies the alteration to the specified context. - /// - /// A context object that contains information for the alteration and provides a way to alter the workflow instance and control the alteration process. - /// A strongly typed alteration. - protected abstract ValueTask HandleAsync(AlterationContext context, T alteration); -} \ No newline at end of file diff --git a/src/modules/Elsa.Alterations.Core/Contexts/AlterationHandlerContext.cs b/src/modules/Elsa.Alterations.Core/Contexts/AlterationHandlerContext.cs deleted file mode 100644 index f583f6cd33..0000000000 --- a/src/modules/Elsa.Alterations.Core/Contexts/AlterationHandlerContext.cs +++ /dev/null @@ -1,129 +0,0 @@ -using Elsa.Alterations.Core.Contracts; -using Elsa.Alterations.Core.Models; -using Elsa.Workflows; -using Elsa.Workflows.Activities; -using Microsoft.Extensions.Logging; - -namespace Elsa.Alterations.Core.Contexts; - -/// -/// Provides contextual information about an alteration. -/// -public class AlterationContext -{ - /// - /// Initializes a new instance of the class. - /// - public AlterationContext( - IAlteration alteration, - WorkflowExecutionContext workflowExecutionContext, - AlterationLog log, - CancellationToken cancellationToken) - { - Alteration = alteration; - WorkflowExecutionContext = workflowExecutionContext; - AlterationLog = log; - CancellationToken = cancellationToken; - } - - /// - /// The alteration being handled. - /// - public IAlteration Alteration { get; } - - /// - /// A workflow execution context of the workflow instance being altered. This offers maximum flexibility for altering the workflow state. - /// - public WorkflowExecutionContext WorkflowExecutionContext { get; set; } - - /// - /// The workflow of the workflow instance being altered. - /// - public Workflow Workflow => WorkflowExecutionContext.Workflow; - - /// - /// The cancellation token. - /// - public CancellationToken CancellationToken { get; } - - /// - /// The service provider. - /// - public IServiceProvider ServiceProvider => WorkflowExecutionContext.ServiceProvider; - - /// - /// The alteration log. - /// - public AlterationLog AlterationLog { get; } - - /// - /// A flag indicating whether the alteration has succeeded. - /// - public bool HasSucceeded { get; private set; } - - /// - /// A flag indicating whether the alteration has failed. - /// - public bool HasFailed { get; private set; } - - /// - /// An optional action to be executed when the alteration is committed. Set this to perform permanent side effects such as deleting records form the database. - /// - public Func? CommitAction { get; set; } - - /// - /// Logs a message. - /// - /// The event name to log. - /// The message to log. - /// The log level. - public void Log(string eventName, string message, LogLevel logLevel = LogLevel.Information) - { - AlterationLog.Add(message, logLevel, eventName); - } - - /// - /// Marks the alteration as succeeded. - /// - public void Succeed() - { - Succeed($"{Alteration.GetType().Name} succeeded"); - } - - /// - /// Marks the alteration as succeeded. - /// - public void Succeed(Func commitAction) - { - Succeed(); - CommitAction = commitAction; - } - - /// - /// Marks the alteration as succeeded. - /// - public void Succeed(string message) - { - HasSucceeded = true; - Log($"Alteration {Alteration.GetType().Name} succeeded", message, LogLevel.Information); - } - - /// - /// Marks the alteration as succeeded. - /// - public void Succeed(string message, Func commitAction) - { - Succeed(message); - CommitAction = commitAction; - } - - /// - /// Marks the alteration as failed. - /// - /// An optional message. - public void Fail(string? message = default) - { - HasFailed = true; - Log($"Alteration {Alteration.GetType().Name} failed", message ?? $"{Alteration.GetType().Name} failed", LogLevel.Error); - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Alterations.Core/Contracts/IAlteration.cs b/src/modules/Elsa.Alterations.Core/Contracts/IAlteration.cs deleted file mode 100644 index 33150b9093..0000000000 --- a/src/modules/Elsa.Alterations.Core/Contracts/IAlteration.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace Elsa.Alterations.Core.Contracts; - -/// -/// Represents an alteration. -/// -public interface IAlteration -{ -} \ No newline at end of file diff --git a/src/modules/Elsa.Alterations.Core/Contracts/IAlterationHandler.cs b/src/modules/Elsa.Alterations.Core/Contracts/IAlterationHandler.cs deleted file mode 100644 index e8aee6e016..0000000000 --- a/src/modules/Elsa.Alterations.Core/Contracts/IAlterationHandler.cs +++ /dev/null @@ -1,21 +0,0 @@ -using Elsa.Alterations.Core.Contexts; - -namespace Elsa.Alterations.Core.Contracts; - -/// -/// Represents a change to a given type T. -/// -public interface IAlterationHandler -{ - /// - /// Returns true if the alteration is supported by this handler; otherwise, false. - /// - /// - bool CanHandle(IAlteration alteration); - - /// - /// Applies the alteration to the specified context. - /// - /// A context object that contains information for the alteration and provides a way to alter the workflow instance and control the alteration process. - ValueTask HandleAsync(AlterationContext context); -} \ No newline at end of file diff --git a/src/modules/Elsa.Alterations.Core/Contracts/IAlterationJobDispatcher.cs b/src/modules/Elsa.Alterations.Core/Contracts/IAlterationJobDispatcher.cs deleted file mode 100644 index e3191dd96b..0000000000 --- a/src/modules/Elsa.Alterations.Core/Contracts/IAlterationJobDispatcher.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace Elsa.Alterations.Core.Contracts; - -/// -/// Dispatches an alteration job for execution. -/// -public interface IAlterationJobDispatcher -{ - /// - /// Dispatches an alteration job for execution. - /// - /// The ID of the job to dispatch. - /// An optional cancellation token. - ValueTask DispatchAsync(string jobId, CancellationToken cancellationToken = default); -} \ No newline at end of file diff --git a/src/modules/Elsa.Alterations.Core/Contracts/IAlterationJobRunner.cs b/src/modules/Elsa.Alterations.Core/Contracts/IAlterationJobRunner.cs deleted file mode 100644 index 82139c7126..0000000000 --- a/src/modules/Elsa.Alterations.Core/Contracts/IAlterationJobRunner.cs +++ /dev/null @@ -1,17 +0,0 @@ -using Elsa.Alterations.Core.Entities; - -namespace Elsa.Alterations.Core.Contracts; - -/// -/// Executes an alteration job. -/// -public interface IAlterationJobRunner -{ - /// - /// Executes the specified alteration plan. - /// - /// The Id of the alteration job to execute. - /// An optional cancellation token. - /// The job with updated state. - Task RunAsync(string jobId, CancellationToken cancellationToken = default); -} \ No newline at end of file diff --git a/src/modules/Elsa.Alterations.Core/Contracts/IAlterationJobStore.cs b/src/modules/Elsa.Alterations.Core/Contracts/IAlterationJobStore.cs deleted file mode 100644 index 6d2dc59bcf..0000000000 --- a/src/modules/Elsa.Alterations.Core/Contracts/IAlterationJobStore.cs +++ /dev/null @@ -1,41 +0,0 @@ -using Elsa.Alterations.Core.Entities; -using Elsa.Alterations.Core.Filters; - -namespace Elsa.Alterations.Core.Contracts; - -/// -/// A store for alteration jobs. -/// -public interface IAlterationJobStore -{ - /// - /// Saves the specified alteration job. - /// - Task SaveAsync(AlterationJob job, CancellationToken cancellationToken = default); - - /// - /// Saves the specified alteration jobs. - /// - Task SaveManyAsync(IEnumerable jobs, CancellationToken cancellationToken = default); - - /// - /// Finds the alteration job matching the specified filter. - /// - Task FindAsync(AlterationJobFilter filter, CancellationToken cancellationToken = default); - - /// - /// Finds all alteration jobs matching the specified filter. - /// - Task> FindManyAsync(AlterationJobFilter filter, CancellationToken cancellationToken = default); - - /// - /// Finds the IDs of all alteration jobs matching the specified filter. - /// - /// - Task> FindManyIdsAsync(AlterationJobFilter filter, CancellationToken cancellationToken = default); - - /// - /// Returns the number of alteration jobs matching the specified filter. - /// - Task CountAsync(AlterationJobFilter filter, CancellationToken cancellationToken = default); -} \ No newline at end of file diff --git a/src/modules/Elsa.Alterations.Core/Contracts/IAlterationPlanManager.cs b/src/modules/Elsa.Alterations.Core/Contracts/IAlterationPlanManager.cs deleted file mode 100644 index 617cf2824c..0000000000 --- a/src/modules/Elsa.Alterations.Core/Contracts/IAlterationPlanManager.cs +++ /dev/null @@ -1,24 +0,0 @@ -using Elsa.Alterations.Core.Entities; - -namespace Elsa.Alterations.Core.Contracts; - -/// -/// Represents a manager for alteration plans. -/// -public interface IAlterationPlanManager -{ - /// - /// Gets an alteration plan by ID. - /// - Task GetPlanAsync(string planId, CancellationToken cancellationToken = default); - - /// - /// Gets a value indicating whether all jobs in the plan have been completed. - /// - Task GetIsAllJobsCompletedAsync(string planId, CancellationToken cancellationToken = default); - - /// - /// Completes an alteration plan. - /// - Task CompletePlanAsync(AlterationPlan plan, CancellationToken cancellationToken = default); -} \ No newline at end of file diff --git a/src/modules/Elsa.Alterations.Core/Contracts/IAlterationPlanScheduler.cs b/src/modules/Elsa.Alterations.Core/Contracts/IAlterationPlanScheduler.cs deleted file mode 100644 index 68ee9b2a10..0000000000 --- a/src/modules/Elsa.Alterations.Core/Contracts/IAlterationPlanScheduler.cs +++ /dev/null @@ -1,14 +0,0 @@ -using Elsa.Alterations.Core.Models; - -namespace Elsa.Alterations.Core.Contracts; - -/// -/// Scheduler for alteration plans. -/// -public interface IAlterationPlanScheduler -{ - /// - /// Submits an alteration plan for execution. - /// - Task SubmitAsync(AlterationPlanParams planParams, CancellationToken cancellationToken = default); -} \ No newline at end of file diff --git a/src/modules/Elsa.Alterations.Core/Contracts/IAlterationPlanStore.cs b/src/modules/Elsa.Alterations.Core/Contracts/IAlterationPlanStore.cs deleted file mode 100644 index 9029948a03..0000000000 --- a/src/modules/Elsa.Alterations.Core/Contracts/IAlterationPlanStore.cs +++ /dev/null @@ -1,25 +0,0 @@ -using Elsa.Alterations.Core.Entities; -using Elsa.Alterations.Core.Filters; - -namespace Elsa.Alterations.Core.Contracts; - -/// -/// A store for alteration plans. -/// -public interface IAlterationPlanStore -{ - /// - /// Saves the specified alteration plan. - /// - Task SaveAsync(AlterationPlan plan, CancellationToken cancellationToken = default); - - /// - /// Finds the alteration plan matching the specified filter. - /// - Task FindAsync(AlterationPlanFilter filter, CancellationToken cancellationToken = default); - - /// - /// Returns the number of alteration plans matching the specified filter. - /// - Task CountAsync(AlterationPlanFilter filter, CancellationToken cancellationToken = default); -} \ No newline at end of file diff --git a/src/modules/Elsa.Alterations.Core/Contracts/IAlterationRunner.cs b/src/modules/Elsa.Alterations.Core/Contracts/IAlterationRunner.cs deleted file mode 100644 index 8693938bb6..0000000000 --- a/src/modules/Elsa.Alterations.Core/Contracts/IAlterationRunner.cs +++ /dev/null @@ -1,25 +0,0 @@ -using Elsa.Alterations.Core.Results; - -namespace Elsa.Alterations.Core.Contracts; - -/// -/// Runs a series of alterations on the specified workflow execution context. -/// -public interface IAlterationRunner -{ - /// - /// Runs a series of alterations on the specified workflow instances. - /// - /// The IDs of the workflow instances to alter. - /// The alterations to run. - /// An optional cancellation token. - Task> RunAsync(IEnumerable workflowInstanceIds, IEnumerable alterations, CancellationToken cancellationToken = default); - - /// - /// Runs a series of alterations on the specified workflow instances. - /// - /// The ID of the workflow instance to alter. - /// The alterations to run. - /// An optional cancellation token. - Task RunAsync(string workflowInstanceId, IEnumerable alterations, CancellationToken cancellationToken = default); -} \ No newline at end of file diff --git a/src/modules/Elsa.Alterations.Core/Contracts/IAlterationSerializer.cs b/src/modules/Elsa.Alterations.Core/Contracts/IAlterationSerializer.cs deleted file mode 100644 index c273789a84..0000000000 --- a/src/modules/Elsa.Alterations.Core/Contracts/IAlterationSerializer.cs +++ /dev/null @@ -1,27 +0,0 @@ -namespace Elsa.Alterations.Core.Contracts; - -/// -/// Serializes and deserializes objects. -/// -public interface IAlterationSerializer -{ - /// - /// Serializes the specified object. - /// - string Serialize(IAlteration alteration); - - /// - /// Serializes the specified set of objects. - /// - string SerializeMany(IEnumerable alterations); - - /// - /// Deserializes the specified JSON string into an object. - /// - IAlteration Deserialize(string json); - - /// - /// Deserializes the specified JSON string into a set of objects. - /// - IEnumerable DeserializeMany(string json); -} \ No newline at end of file diff --git a/src/modules/Elsa.Alterations.Core/Contracts/IAlteredWorkflowDispatcher.cs b/src/modules/Elsa.Alterations.Core/Contracts/IAlteredWorkflowDispatcher.cs deleted file mode 100644 index 38374cad58..0000000000 --- a/src/modules/Elsa.Alterations.Core/Contracts/IAlteredWorkflowDispatcher.cs +++ /dev/null @@ -1,23 +0,0 @@ -using Elsa.Alterations.Core.Results; - -namespace Elsa.Alterations.Core.Contracts; - -/// -/// Schedules a workflow instance to be resumed when an alteration job has been completed. -/// -public interface IAlteredWorkflowDispatcher -{ - /// - /// Schedules the altered workflow instances to be resumed. - /// - /// The results of running a series of alterations. - /// An optional cancellation token. - Task DispatchAsync(IEnumerable results, CancellationToken cancellationToken = default); - - /// - /// Schedules the altered workflow instance to be resumed. - /// - /// The result of running a series of alterations. - /// An optional cancellation token. - Task DispatchAsync(RunAlterationsResult result, CancellationToken cancellationToken = default); -} \ No newline at end of file diff --git a/src/modules/Elsa.Alterations.Core/Contracts/IWorkflowInstanceFinder.cs b/src/modules/Elsa.Alterations.Core/Contracts/IWorkflowInstanceFinder.cs deleted file mode 100644 index fd325937f0..0000000000 --- a/src/modules/Elsa.Alterations.Core/Contracts/IWorkflowInstanceFinder.cs +++ /dev/null @@ -1,14 +0,0 @@ -using Elsa.Alterations.Core.Models; - -namespace Elsa.Alterations.Core.Contracts; - -/// -/// Represents a service that can find workflow instances based on specified filters. -/// -public interface IWorkflowInstanceFinder -{ - /// - /// Finds workflow instances based on the specified filter. - /// - Task> FindAsync(AlterationWorkflowInstanceFilter filter, CancellationToken cancellationToken = default); -} \ No newline at end of file diff --git a/src/modules/Elsa.Alterations.Core/Elsa.Alterations.Core.csproj b/src/modules/Elsa.Alterations.Core/Elsa.Alterations.Core.csproj deleted file mode 100644 index 716e77f871..0000000000 --- a/src/modules/Elsa.Alterations.Core/Elsa.Alterations.Core.csproj +++ /dev/null @@ -1,19 +0,0 @@ - - - - - Provides core interfaces, models and services that support the alteration engine. - - elsa module alterations - - - - - - - - - - - - diff --git a/src/modules/Elsa.Alterations.Core/Entities/AlterationJob.cs b/src/modules/Elsa.Alterations.Core/Entities/AlterationJob.cs deleted file mode 100644 index 2cc6712878..0000000000 --- a/src/modules/Elsa.Alterations.Core/Entities/AlterationJob.cs +++ /dev/null @@ -1,46 +0,0 @@ -using Elsa.Alterations.Core.Enums; -using Elsa.Alterations.Core.Models; -using Elsa.Common.Entities; - -namespace Elsa.Alterations.Core.Entities; - -/// -/// Represents the execution of the plan for an individual workflow instance. -/// -public class AlterationJob : Entity -{ - /// - /// The ID of the plan that this job belongs to. - /// - public string PlanId { get; set; } = default!; - - /// - /// The ID of the workflow instance that this job applies to. - /// - public string WorkflowInstanceId { get; set; } = default!; - - /// - /// The status of the job. - /// - public AlterationJobStatus Status { get; set; } - - /// - /// The serialized log of the job. - /// - public ICollection? Log { get; set; } = new List(); - - /// - /// The date and time at which the job was created. - /// - public DateTimeOffset CreatedAt { get; set; } - - /// - /// The date and time at which the job was started. - /// - public DateTimeOffset? StartedAt { get; set; } - - /// - /// The date and time at which the job was completed. - /// - public DateTimeOffset? CompletedAt { get; set; } -} \ No newline at end of file diff --git a/src/modules/Elsa.Alterations.Core/Entities/AlterationPlan.cs b/src/modules/Elsa.Alterations.Core/Entities/AlterationPlan.cs deleted file mode 100644 index 10c6a4729f..0000000000 --- a/src/modules/Elsa.Alterations.Core/Entities/AlterationPlan.cs +++ /dev/null @@ -1,42 +0,0 @@ -using Elsa.Alterations.Core.Contracts; -using Elsa.Alterations.Core.Enums; -using Elsa.Alterations.Core.Models; -using Elsa.Common.Entities; - -namespace Elsa.Alterations.Core.Entities; - -/// -/// A plan that contains a list of alterations to be applied to a set of workflow instances. -/// -public class AlterationPlan : Entity -{ - /// - /// The alterations to be applied. - /// - public ICollection Alterations { get; set; } = new List(); - - /// - /// The IDs of the workflow instances that this plan applies to. - /// - public AlterationWorkflowInstanceFilter WorkflowInstanceFilter { get; set; } = new(); - - /// - /// The status of the plan. - /// - public AlterationPlanStatus Status { get; set; } - - /// - /// The date and time at which the plan was created. - /// - public DateTimeOffset CreatedAt { get; set; } - - /// - /// The date and time at which the plan was started. - /// - public DateTimeOffset? StartedAt { get; set; } - - /// - /// The date and time at which the plan was completed. - /// - public DateTimeOffset? CompletedAt { get; set; } -} \ No newline at end of file diff --git a/src/modules/Elsa.Alterations.Core/Enums/AlterationJobStatus.cs b/src/modules/Elsa.Alterations.Core/Enums/AlterationJobStatus.cs deleted file mode 100644 index d9d7ac7f9e..0000000000 --- a/src/modules/Elsa.Alterations.Core/Enums/AlterationJobStatus.cs +++ /dev/null @@ -1,27 +0,0 @@ -namespace Elsa.Alterations.Core.Enums; - -/// -/// The status of an alteration plan for a workflow instance. -/// -public enum AlterationJobStatus -{ - /// - /// The plan is pending execution. - /// - Pending, - - /// - /// The plan is currently being executed. - /// - Running, - - /// - /// The plan has been completed. - /// - Completed, - - /// - /// The job has failed. - /// - Failed -} \ No newline at end of file diff --git a/src/modules/Elsa.Alterations.Core/Enums/AlterationPlanStatus.cs b/src/modules/Elsa.Alterations.Core/Enums/AlterationPlanStatus.cs deleted file mode 100644 index 2ba9eea21a..0000000000 --- a/src/modules/Elsa.Alterations.Core/Enums/AlterationPlanStatus.cs +++ /dev/null @@ -1,37 +0,0 @@ -namespace Elsa.Alterations.Core.Enums; - -/// -/// The status of an alteration plan. -/// -public enum AlterationPlanStatus -{ - /// - /// The plan is pending execution. - /// - Pending, - - /// - /// The plan is currently generating jobs. - /// - Generating, - - /// - /// The plan is currently dispatching jobs. - /// - Dispatching, - - /// - /// The plan is currently being executed. - /// - Running, - - /// - /// The plan has been completed. - /// - Completed, - - /// - /// The plan has failed. - /// - Failed -} \ No newline at end of file diff --git a/src/modules/Elsa.Alterations.Core/Extensions/ServiceCollectionExtensions.cs b/src/modules/Elsa.Alterations.Core/Extensions/ServiceCollectionExtensions.cs deleted file mode 100644 index 13f473b626..0000000000 --- a/src/modules/Elsa.Alterations.Core/Extensions/ServiceCollectionExtensions.cs +++ /dev/null @@ -1,37 +0,0 @@ -using Elsa.Alterations.Core.Contracts; -using Elsa.Alterations.Core.Options; -using Elsa.Alterations.Core.Serialization; -using Elsa.Alterations.Core.Services; -using Elsa.Extensions; -using Microsoft.Extensions.DependencyInjection; - -namespace Elsa.Alterations.Core.Extensions; - -/// -/// Extension methods for . -/// -public static class ServiceCollectionExtensions -{ - /// - /// Adds the core Elsa alterations services. - /// - public static IServiceCollection AddAlterationsCore(this IServiceCollection services) - { - services.Configure(_ => { }); // Ensure that the options are configured even if the application doesn't do so. - services.AddScoped(); - services.AddScoped(); - services.AddSingleton(); - services.AddSerializationOptionsConfigurator(); - return services; - } - - /// - /// Adds an alteration handler. - /// - public static IServiceCollection AddAlteration(this IServiceCollection services) where T : IAlteration where THandler : class, IAlterationHandler - { - services.Configure(options => options.AlterationTypes.Add(typeof(T))); - services.AddScoped(); - return services; - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Alterations.Core/Filters/AlterationJobFilter.cs b/src/modules/Elsa.Alterations.Core/Filters/AlterationJobFilter.cs deleted file mode 100644 index 37751d05a3..0000000000 --- a/src/modules/Elsa.Alterations.Core/Filters/AlterationJobFilter.cs +++ /dev/null @@ -1,50 +0,0 @@ -using Elsa.Alterations.Core.Entities; -using Elsa.Alterations.Core.Enums; - -namespace Elsa.Alterations.Core.Filters; - -/// -/// A filter for querying alteration jobs. -/// -public class AlterationJobFilter -{ - /// - /// The ID of the job. - /// - public string? Id { get; set; } - - /// - /// The ID of the plan. - /// - public string? PlanId { get; set; } - - /// - /// The status of the job. - /// - public AlterationJobStatus? Status { get; set; } - - /// - /// The statuses of the job to match. - /// - public ICollection? Statuses { get; set; } - - /// - /// Applies the filter to the specified query. - /// - public IQueryable Apply(IQueryable query) - { - if (!string.IsNullOrWhiteSpace(Id)) - query = query.Where(x => x.Id == Id); - - if (!string.IsNullOrWhiteSpace(PlanId)) - query = query.Where(x => x.PlanId == PlanId); - - if (Status != null) - query = query.Where(x => x.Status == Status); - - if (Statuses != null) - query = query.Where(x => Statuses.Contains(x.Status)); - - return query; - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Alterations.Core/Filters/AlterationPlanFilter.cs b/src/modules/Elsa.Alterations.Core/Filters/AlterationPlanFilter.cs deleted file mode 100644 index cc2cbc038d..0000000000 --- a/src/modules/Elsa.Alterations.Core/Filters/AlterationPlanFilter.cs +++ /dev/null @@ -1,25 +0,0 @@ -using Elsa.Alterations.Core.Entities; - -namespace Elsa.Alterations.Core.Filters; - -/// -/// A filter for querying alteration plans. -/// -public class AlterationPlanFilter -{ - /// - /// The ID of the plan. - /// - public string? Id { get; set; } - - /// - /// Applies the filter to the specified query. - /// - public IQueryable Apply(IQueryable query) - { - if (!string.IsNullOrWhiteSpace(Id)) - query = query.Where(x => x.Id == Id); - - return query; - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Alterations.Core/Models/ActivityFilter.cs b/src/modules/Elsa.Alterations.Core/Models/ActivityFilter.cs deleted file mode 100644 index f13ba2cd61..0000000000 --- a/src/modules/Elsa.Alterations.Core/Models/ActivityFilter.cs +++ /dev/null @@ -1,36 +0,0 @@ -using Elsa.Workflows; -using JetBrains.Annotations; - -namespace Elsa.Alterations.Core.Models; - -/// -/// Represents a filter for activities. -/// -[UsedImplicitly] -public class ActivityFilter -{ - /// - /// The ID of the activity. - /// - public string? ActivityId { get; set; } - - /// - /// The ID of the activity instance. - /// - public string? ActivityInstanceId { get; set; } - - /// - /// The node ID of the activity. - /// - public string? NodeId { get; set; } - - /// - /// The name of the activity. - /// - public string? Name { get; set; } - - /// - /// The status of the activity. - /// - public ActivityStatus? Status { get; set; } -} \ No newline at end of file diff --git a/src/modules/Elsa.Alterations.Core/Models/AlterationLog.cs b/src/modules/Elsa.Alterations.Core/Models/AlterationLog.cs deleted file mode 100644 index 1032bb52cf..0000000000 --- a/src/modules/Elsa.Alterations.Core/Models/AlterationLog.cs +++ /dev/null @@ -1,46 +0,0 @@ -using Elsa.Common; -using Microsoft.Extensions.Logging; - -namespace Elsa.Alterations.Core.Models; - - -/// -/// Represents a log of alterations. -/// -public class AlterationLog -{ - private readonly ISystemClock _systemClock; - private readonly List _logEntries = new(); - - /// - /// Initializes a new instance of the class. - /// - public AlterationLog(ISystemClock systemClock) - { - _systemClock = systemClock; - } - - /// - /// Gets the log entries. - /// - public IReadOnlyCollection LogEntries => _logEntries.ToList().AsReadOnly(); - - /// - /// Adds a log entry. - /// - /// The message. - /// The log level. - /// The event that generated the log entry. - public void Add(string message, LogLevel logLevel = LogLevel.Information, string? eventName = null) - { - var entry = new AlterationLogEntry(message, logLevel, _systemClock.UtcNow, eventName); - - _logEntries.Add(entry); - } - - /// - /// Adds a set of log entries. - /// - /// - public void AddRange(IEnumerable entries) => _logEntries.AddRange(entries); -} \ No newline at end of file diff --git a/src/modules/Elsa.Alterations.Core/Models/AlterationLogEntry.cs b/src/modules/Elsa.Alterations.Core/Models/AlterationLogEntry.cs deleted file mode 100644 index 77b772c65a..0000000000 --- a/src/modules/Elsa.Alterations.Core/Models/AlterationLogEntry.cs +++ /dev/null @@ -1,12 +0,0 @@ -using Microsoft.Extensions.Logging; - -namespace Elsa.Alterations.Core.Models; - -/// -/// A log entry for an alteration. -/// -/// The log message. -/// The log level. -/// The timestamp when the log entry was created. -/// The event that generated the log entry. -public record AlterationLogEntry(string Message, LogLevel LogLevel, DateTimeOffset Timestamp, string? EventName = null); \ No newline at end of file diff --git a/src/modules/Elsa.Alterations.Core/Models/AlterationPlanParams.cs b/src/modules/Elsa.Alterations.Core/Models/AlterationPlanParams.cs deleted file mode 100644 index 08c266c4c9..0000000000 --- a/src/modules/Elsa.Alterations.Core/Models/AlterationPlanParams.cs +++ /dev/null @@ -1,24 +0,0 @@ -using Elsa.Alterations.Core.Contracts; - -namespace Elsa.Alterations.Core.Models; - -/// -/// Represents a new alteration plan. -/// -public class AlterationPlanParams -{ - /// - /// The unique identifier for the alteration plan. If not specified, a new ID will be generated. - /// - public string? Id { get; set; } - - /// - /// The alterations to be applied. - /// - public ICollection Alterations { get; set; } = new List(); - - /// - /// The filter used to determine which workflow instances that this plan applies to. - /// - public AlterationWorkflowInstanceFilter Filter { get; set; } = new(); -} \ No newline at end of file diff --git a/src/modules/Elsa.Alterations.Core/Models/AlterationWorkflowInstanceFilter.cs b/src/modules/Elsa.Alterations.Core/Models/AlterationWorkflowInstanceFilter.cs deleted file mode 100644 index 51f2cd680d..0000000000 --- a/src/modules/Elsa.Alterations.Core/Models/AlterationWorkflowInstanceFilter.cs +++ /dev/null @@ -1,78 +0,0 @@ -using Elsa.Workflows; -using Elsa.Workflows.Management.Models; -using JetBrains.Annotations; - -namespace Elsa.Alterations.Core.Models; - -/// -/// Represents a filter for workflow instances. -/// -[UsedImplicitly] -public class AlterationWorkflowInstanceFilter -{ - /// - /// If the filter is empty, all records are matched. - /// - public bool EmptyFilterSelectsAll { get; set; } - - /// - /// The IDs of the workflow instances that this plan applies to. - /// - public IEnumerable? WorkflowInstanceIds { get; set; } - - /// - /// The correlation IDs of the workflow instances that this plan applies to. - /// - public IEnumerable? CorrelationIds { get; set; } - - /// - /// A collection of names associated with the workflow instances being filtered. - /// - public ICollection? Names { get; set; } - - /// - /// A search term used to filter workflow instances based on matching criteria. - /// - public string? SearchTerm { get; set; } - - /// - /// A collection of timestamp filters used for filtering data based on specified timestamp columns and operators. - /// - public IEnumerable? TimestampFilters { get; set; } - - /// - /// The IDs of the workflow definitions that this plan applies to. - /// - public ICollection? DefinitionIds { get; set; } - - /// - /// The IDs of the workflow definitions that this plan applies to. - /// - public IEnumerable? DefinitionVersionIds { get; set; } - - /// - /// Whether the workflow instances to match have incidents. - /// - public bool? HasIncidents { get; set; } - - /// - /// Whether the workflow instances to match are system workflows. Defaults to false. - /// - public bool? IsSystem { get; set; } = false; - - /// - /// Represents the workflow statuses included in the filter. - /// - public ICollection? Statuses { get; set; } - - /// - /// A collection of sub-statuses used to filter workflow instances by their specific sub-state. - /// - public ICollection? SubStatuses { get; set; } - - /// - /// Represents a collection of filters for activities. - /// - public IEnumerable? ActivityFilters { get; set; } - -} \ No newline at end of file diff --git a/src/modules/Elsa.Alterations.Core/Models/NewAlterationJob.cs b/src/modules/Elsa.Alterations.Core/Models/NewAlterationJob.cs deleted file mode 100644 index 8b994b6471..0000000000 --- a/src/modules/Elsa.Alterations.Core/Models/NewAlterationJob.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace Elsa.Alterations.Core.Models; - -public class NewAlterationJob -{ - public string PlanId { get; set; } - public string WorkflowInstanceId { get; set; } -} \ No newline at end of file diff --git a/src/modules/Elsa.Alterations.Core/Notifications/AlterationJobCompleted.cs b/src/modules/Elsa.Alterations.Core/Notifications/AlterationJobCompleted.cs deleted file mode 100644 index b15d44cbc5..0000000000 --- a/src/modules/Elsa.Alterations.Core/Notifications/AlterationJobCompleted.cs +++ /dev/null @@ -1,9 +0,0 @@ -using Elsa.Alterations.Core.Entities; -using Elsa.Mediator.Contracts; - -namespace Elsa.Alterations.Core.Notifications; - -/// -/// A notification that is published when an alteration job is completed. -/// -public record AlterationJobCompleted(AlterationJob Job, bool WorkflowContainsScheduledWork) : INotification; \ No newline at end of file diff --git a/src/modules/Elsa.Alterations.Core/Notifications/AlterationPlanCompleted.cs b/src/modules/Elsa.Alterations.Core/Notifications/AlterationPlanCompleted.cs deleted file mode 100644 index 70a13fb5b8..0000000000 --- a/src/modules/Elsa.Alterations.Core/Notifications/AlterationPlanCompleted.cs +++ /dev/null @@ -1,9 +0,0 @@ -using Elsa.Alterations.Core.Entities; -using Elsa.Mediator.Contracts; - -namespace Elsa.Alterations.Core.Notifications; - -/// -/// A notification that is published when an alteration plan is completed. -/// -public record AlterationPlanCompleted(AlterationPlan Plan) : INotification; \ No newline at end of file diff --git a/src/modules/Elsa.Alterations.Core/Notifications/AlterationPlanSubmitted.cs b/src/modules/Elsa.Alterations.Core/Notifications/AlterationPlanSubmitted.cs deleted file mode 100644 index e9681838f2..0000000000 --- a/src/modules/Elsa.Alterations.Core/Notifications/AlterationPlanSubmitted.cs +++ /dev/null @@ -1,9 +0,0 @@ -using Elsa.Alterations.Core.Entities; -using Elsa.Mediator.Contracts; - -namespace Elsa.Alterations.Core.Notifications; - -/// -/// A notification that is published when an alteration plan is submitted. -/// -public record AlterationPlanSubmitted(AlterationPlan Plan) : INotification; \ No newline at end of file diff --git a/src/modules/Elsa.Alterations.Core/Options/AlterationOptions.cs b/src/modules/Elsa.Alterations.Core/Options/AlterationOptions.cs deleted file mode 100644 index 3d54cc2180..0000000000 --- a/src/modules/Elsa.Alterations.Core/Options/AlterationOptions.cs +++ /dev/null @@ -1,12 +0,0 @@ -namespace Elsa.Alterations.Core.Options; - -/// -/// Options for the Alteration module. -/// -public class AlterationOptions -{ - /// - /// The types of alterations that are supported. - /// - public ISet AlterationTypes { get; set; } = new HashSet(); -} \ No newline at end of file diff --git a/src/modules/Elsa.Alterations.Core/Results/RunAlterationsResult.cs b/src/modules/Elsa.Alterations.Core/Results/RunAlterationsResult.cs deleted file mode 100644 index 42e5e979b2..0000000000 --- a/src/modules/Elsa.Alterations.Core/Results/RunAlterationsResult.cs +++ /dev/null @@ -1,39 +0,0 @@ -using Elsa.Alterations.Core.Models; -using Microsoft.Extensions.Logging; - -namespace Elsa.Alterations.Core.Results; - -/// -/// The result of running a series of alterations. -/// -public class RunAlterationsResult -{ - /// - /// Initializes a new instance of the class. - /// - public RunAlterationsResult(string workflowInstanceId, AlterationLog log) - { - WorkflowInstanceId = workflowInstanceId; - Log = log; - } - - /// - /// The ID of the workflow instance that was altered. - /// - public string WorkflowInstanceId { get; } - - /// - /// A log of the alterations that were run. - /// - public AlterationLog Log { get; set; } - - /// - /// A flag indicating whether the workflow has scheduled work. - /// - public bool WorkflowHasScheduledWork { get; set; } - - /// - /// A flag indicating whether the alterations have succeeded. - /// - public bool IsSuccessful => Log.LogEntries.Any(x => x.LogLevel <= LogLevel.Warning); -} \ No newline at end of file diff --git a/src/modules/Elsa.Alterations.Core/Serialization/AlterationSerializationOptionConfigurator.cs b/src/modules/Elsa.Alterations.Core/Serialization/AlterationSerializationOptionConfigurator.cs deleted file mode 100644 index 217331a5f8..0000000000 --- a/src/modules/Elsa.Alterations.Core/Serialization/AlterationSerializationOptionConfigurator.cs +++ /dev/null @@ -1,43 +0,0 @@ -using System.Text.Json.Serialization; -using System.Text.Json.Serialization.Metadata; -using Elsa.Alterations.Core.Contracts; -using Elsa.Alterations.Core.Options; -using Elsa.Workflows; -using JetBrains.Annotations; -using Microsoft.Extensions.Options; - -namespace Elsa.Alterations.Core.Serialization; - -/// -/// Add additional objects. -/// -[UsedImplicitly] -public class AlterationSerializationOptionConfigurator(IOptions options) : SerializationOptionsConfiguratorBase -{ - /// - public override IEnumerable> GetModifiers() - { - var alterationTypes = options.Value.AlterationTypes; - - yield return typeInfo => - { - if (typeInfo.Type != typeof(IAlteration)) - return; - - if (typeInfo.Kind != JsonTypeInfoKind.Object) - return; - - var polymorphismOptions = new JsonPolymorphismOptions - { - TypeDiscriminatorPropertyName = "type" - }; - - foreach (var alterationType in alterationTypes.ToList()) - { - polymorphismOptions.DerivedTypes.Add(new(alterationType, alterationType.Name)); - } - - typeInfo.PolymorphismOptions = polymorphismOptions; - }; - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Alterations.Core/Serialization/AlterationSerializer.cs b/src/modules/Elsa.Alterations.Core/Serialization/AlterationSerializer.cs deleted file mode 100644 index 001dc5aab8..0000000000 --- a/src/modules/Elsa.Alterations.Core/Serialization/AlterationSerializer.cs +++ /dev/null @@ -1,49 +0,0 @@ -using System.Diagnostics.CodeAnalysis; -using System.Text.Json; -using Elsa.Alterations.Core.Contracts; -using Elsa.Common.Serialization; - -namespace Elsa.Alterations.Core.Serialization; - -/// -/// A serializer for objects. -/// -public class AlterationSerializer : ConfigurableSerializer, IAlterationSerializer -{ - /// - public AlterationSerializer(IServiceProvider serviceProvider) : base(serviceProvider) - { - } - - /// - [RequiresUnreferencedCode("The type of the alteration must be known at compile time.")] - public string Serialize(IAlteration alteration) - { - var options = GetOptions(); - return JsonSerializer.Serialize(alteration, options); - } - - /// - [RequiresUnreferencedCode("The type of the alteration must be known at compile time.")] - public string SerializeMany(IEnumerable alterations) - { - var options = GetOptions(); - return JsonSerializer.Serialize(alterations.ToArray(), options); - } - - /// - [RequiresUnreferencedCode("The type of the alteration must be known at compile time.")] - public IAlteration Deserialize(string json) - { - var options = GetOptions(); - return JsonSerializer.Deserialize(json, options)!; - } - - /// - [RequiresUnreferencedCode("The type of the alteration must be known at compile time.")] - public IEnumerable DeserializeMany(string json) - { - var options = GetOptions(); - return JsonSerializer.Deserialize(json, options)!; - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Alterations.Core/Services/AlteredWorkflowDispatcher.cs b/src/modules/Elsa.Alterations.Core/Services/AlteredWorkflowDispatcher.cs deleted file mode 100644 index 1014dfdadc..0000000000 --- a/src/modules/Elsa.Alterations.Core/Services/AlteredWorkflowDispatcher.cs +++ /dev/null @@ -1,34 +0,0 @@ -using Elsa.Alterations.Core.Contracts; -using Elsa.Alterations.Core.Results; -using Elsa.Workflows.Runtime; -using Elsa.Workflows.Runtime.Contracts; -using Elsa.Workflows.Runtime.Requests; - -namespace Elsa.Alterations.Core.Services; - -/// -public class AlteredWorkflowDispatcher : IAlteredWorkflowDispatcher -{ - private readonly IWorkflowDispatcher _workflowDispatcher; - - /// - /// Initializes a new instance of the class. - /// - public AlteredWorkflowDispatcher(IWorkflowDispatcher workflowDispatcher) - { - _workflowDispatcher = workflowDispatcher; - } - - /// - public async Task DispatchAsync(IEnumerable results, CancellationToken cancellationToken = default) - { - foreach (var result in results.Where(x => x is { IsSuccessful: true, WorkflowHasScheduledWork: true })) - await DispatchAsync(result, cancellationToken); - } - - /// - public async Task DispatchAsync(RunAlterationsResult result, CancellationToken cancellationToken = default) - { - await _workflowDispatcher.DispatchAsync(new DispatchWorkflowInstanceRequest(result.WorkflowInstanceId), cancellationToken: cancellationToken); - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Alterations.Core/Services/WorkflowInstanceFinder.cs b/src/modules/Elsa.Alterations.Core/Services/WorkflowInstanceFinder.cs deleted file mode 100644 index b48b86e644..0000000000 --- a/src/modules/Elsa.Alterations.Core/Services/WorkflowInstanceFinder.cs +++ /dev/null @@ -1,93 +0,0 @@ -using Elsa.Alterations.Core.Contracts; -using Elsa.Alterations.Core.Models; -using Elsa.Workflows; -using Elsa.Workflows.Management; -using Elsa.Workflows.Management.Filters; -using Elsa.Workflows.Runtime; -using Elsa.Workflows.Runtime.Filters; - -namespace Elsa.Alterations.Core.Services; - -/// -public class WorkflowInstanceFinder(IWorkflowInstanceStore workflowInstanceStore, IActivityExecutionStore activityExecutionStore) : IWorkflowInstanceFinder -{ - /// - public async Task> FindAsync(AlterationWorkflowInstanceFilter filter, CancellationToken cancellationToken = default) - { - var workflowInstanceFilter = new WorkflowInstanceFilter - { - Ids = filter.WorkflowInstanceIds?.ToList(), - DefinitionIds = filter.DefinitionIds, - DefinitionVersionIds = filter.DefinitionVersionIds?.ToList(), - CorrelationIds = filter.CorrelationIds?.ToList(), - HasIncidents = filter.HasIncidents, - IsSystem = filter.IsSystem, - TimestampFilters = filter.TimestampFilters?.ToList(), - WorkflowStatuses = filter.Statuses?.ToList(), - WorkflowSubStatuses = filter.SubStatuses?.ToList(), - Names = filter.Names?.ToList(), - SearchTerm = filter.SearchTerm, - }; - var activityExecutionFilters = filter.ActivityFilters?.Select(x => new ActivityExecutionRecordFilter - { - ActivityId = x.ActivityId, - Id = x.ActivityInstanceId, - ActivityNodeId = x.NodeId, - Name = x.Name, - Status = x.Status, - }).ToList(); - - var emptyFilterSelectsAll = filter.EmptyFilterSelectsAll; - var workflowInstanceFilterIsEmpty = WorkflowFilterIsEmpty(workflowInstanceFilter); - - var workflowInstanceIds = workflowInstanceFilterIsEmpty && !emptyFilterSelectsAll - ? Enumerable.Empty().ToHashSet() - : (await workflowInstanceStore.FindManyIdsAsync(workflowInstanceFilter, cancellationToken)).ToHashSet(); - - if (activityExecutionFilters == null) - return workflowInstanceIds; - - foreach (ActivityExecutionRecordFilter activityExecutionFilter in activityExecutionFilters.Where(x => !x.IsEmpty)) - { - var activityExecutionRecords = await activityExecutionStore.FindManySummariesAsync(activityExecutionFilter, cancellationToken); - var matchingWorkflowInstanceIds = activityExecutionRecords.Select(x => x.WorkflowInstanceId).ToHashSet(); - - if (workflowInstanceFilterIsEmpty) - workflowInstanceIds = matchingWorkflowInstanceIds; - else - workflowInstanceIds.IntersectWith(matchingWorkflowInstanceIds); - } - - // Alterations must apply only to running workflows. - workflowInstanceIds = (await FilterRunningWorkflowInstancesAsync(workflowInstanceIds, cancellationToken)).ToHashSet(); - - return workflowInstanceIds; - } - - private async Task> FilterRunningWorkflowInstancesAsync(IEnumerable workflowInstanceIds, CancellationToken cancellationToken) - { - var filter = new WorkflowInstanceFilter - { - Ids = workflowInstanceIds.ToList(), - WorkflowStatus = WorkflowStatus.Running - }; - - return await workflowInstanceStore.FindManyIdsAsync(filter, cancellationToken); - } - - private bool WorkflowFilterIsEmpty(WorkflowInstanceFilter filter) - { - return filter.Id == null && - filter.Ids == null && - filter.DefinitionId == null && - filter.DefinitionVersionId == null && - filter.DefinitionIds == null && - filter.DefinitionVersionIds == null && - filter.Version == null && - filter.CorrelationId == null && - filter.CorrelationIds == null && - filter.HasIncidents == null && - filter.TimestampFilters == null - && string.IsNullOrWhiteSpace(filter.SearchTerm); - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Alterations.Core/Stores/MemoryAlterationJobStore.cs b/src/modules/Elsa.Alterations.Core/Stores/MemoryAlterationJobStore.cs deleted file mode 100644 index 1af9f76f0c..0000000000 --- a/src/modules/Elsa.Alterations.Core/Stores/MemoryAlterationJobStore.cs +++ /dev/null @@ -1,67 +0,0 @@ -using Elsa.Alterations.Core.Contracts; -using Elsa.Alterations.Core.Entities; -using Elsa.Alterations.Core.Filters; -using Elsa.Common.Services; - -namespace Elsa.Alterations.Core.Stores; - -/// -/// A memory-based store for alteration jobs. -/// -public class MemoryAlterationJobStore : IAlterationJobStore -{ - private readonly MemoryStore _store; - - /// - /// Initializes a new instance of the class. - /// - public MemoryAlterationJobStore(MemoryStore store) - { - _store = store; - } - - /// - public Task SaveAsync(AlterationJob job, CancellationToken cancellationToken = default) - { - _store.Save(job, x => x.Id); - return Task.CompletedTask; - } - - /// - public Task SaveManyAsync(IEnumerable jobs, CancellationToken cancellationToken = default) - { - _store.SaveMany(jobs, x => x.Id); - return Task.CompletedTask; - } - - /// - public Task FindAsync(AlterationJobFilter filter, CancellationToken cancellationToken = default) - { - var entity = _store.Query(query => Filter(query, filter)).FirstOrDefault(); - return Task.FromResult(entity); - } - - /// - public Task> FindManyAsync(AlterationJobFilter filter, CancellationToken cancellationToken) - { - var entities = _store.Query(query => Filter(query, filter)).ToList().AsEnumerable(); - return Task.FromResult(entities); - } - - /// - public Task> FindManyIdsAsync(AlterationJobFilter filter, CancellationToken cancellationToken = default) - { - var ids = _store.Query(query => Filter(query, filter)).Select(x => x.Id).ToList().AsEnumerable(); - return Task.FromResult(ids); - } - - /// - public Task CountAsync(AlterationJobFilter filter, CancellationToken cancellationToken = default) - { - var count = _store.Query(query => Filter(query, filter)).LongCount(); - return Task.FromResult(count); - } - - - private static IQueryable Filter(IQueryable query, AlterationJobFilter filter) => filter.Apply(query); -} \ No newline at end of file diff --git a/src/modules/Elsa.Alterations.Core/Stores/MemoryAlterationPlanStore.cs b/src/modules/Elsa.Alterations.Core/Stores/MemoryAlterationPlanStore.cs deleted file mode 100644 index 9657c5864f..0000000000 --- a/src/modules/Elsa.Alterations.Core/Stores/MemoryAlterationPlanStore.cs +++ /dev/null @@ -1,45 +0,0 @@ -using Elsa.Alterations.Core.Contracts; -using Elsa.Alterations.Core.Entities; -using Elsa.Alterations.Core.Filters; -using Elsa.Common.Services; - -namespace Elsa.Alterations.Core.Stores; - -/// -/// A memory-based store for alteration plans. -/// -public class MemoryAlterationPlanStore : IAlterationPlanStore -{ - private readonly MemoryStore _store; - - /// - /// Initializes a new instance of the class. - /// - public MemoryAlterationPlanStore(MemoryStore store) - { - _store = store; - } - - /// - public Task SaveAsync(AlterationPlan plan, CancellationToken cancellationToken = default) - { - _store.Save(plan, x => x.Id); - return Task.CompletedTask; - } - - /// - public Task FindAsync(AlterationPlanFilter filter, CancellationToken cancellationToken = default) - { - var entity = _store.Query(query => Filter(query, filter)).FirstOrDefault(); - return Task.FromResult(entity); - } - - /// - public Task CountAsync(AlterationPlanFilter filter, CancellationToken cancellationToken = default) - { - var count = _store.Query(query => Filter(query, filter)).LongCount(); - return Task.FromResult(count); - } - - private static IQueryable Filter(IQueryable query, AlterationPlanFilter filter) => filter.Apply(query); -} \ No newline at end of file diff --git a/src/modules/Elsa.Alterations.MassTransit/Consumers/RunAlterationJobConsumer.cs b/src/modules/Elsa.Alterations.MassTransit/Consumers/RunAlterationJobConsumer.cs deleted file mode 100644 index 8bc2fe7cf8..0000000000 --- a/src/modules/Elsa.Alterations.MassTransit/Consumers/RunAlterationJobConsumer.cs +++ /dev/null @@ -1,27 +0,0 @@ -using Elsa.Alterations.Core.Contracts; -using Elsa.Alterations.MassTransit.Messages; -using MassTransit; - -namespace Elsa.Alterations.MassTransit.Consumers; - -/// -/// Consumes messages. -/// -public class RunAlterationJobConsumer : IConsumer -{ - private readonly IAlterationJobRunner _alterationJobRunner; - - /// - /// Initializes a new instance of the class. - /// - public RunAlterationJobConsumer(IAlterationJobRunner alterationJobRunner) - { - _alterationJobRunner = alterationJobRunner; - } - - /// - public async Task Consume(ConsumeContext context) - { - await _alterationJobRunner.RunAsync(context.Message.JobId, context.CancellationToken); - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Alterations.MassTransit/Elsa.Alterations.MassTransit.csproj b/src/modules/Elsa.Alterations.MassTransit/Elsa.Alterations.MassTransit.csproj deleted file mode 100644 index d1f049a520..0000000000 --- a/src/modules/Elsa.Alterations.MassTransit/Elsa.Alterations.MassTransit.csproj +++ /dev/null @@ -1,15 +0,0 @@ - - - - - Provides alteration background job runners using MassTransit. - - elsa module alterations masstransit - - - - - - - - diff --git a/src/modules/Elsa.Alterations.MassTransit/Extensions/ModuleExtensions.cs b/src/modules/Elsa.Alterations.MassTransit/Extensions/ModuleExtensions.cs deleted file mode 100644 index f5fef366b2..0000000000 --- a/src/modules/Elsa.Alterations.MassTransit/Extensions/ModuleExtensions.cs +++ /dev/null @@ -1,20 +0,0 @@ -using Elsa.Alterations.Features; -using Elsa.Alterations.MassTransit.Features; -using Elsa.Extensions; -using Elsa.Features.Services; - -namespace Elsa.Alterations.MassTransit.Extensions; - -/// -/// Adds the . -/// -public static class ModuleExtensions -{ - /// - /// Adds the . - /// - public static IModule UseMassTransitDispatcher(this AlterationsFeature alterations, Action? configure = default) - { - return alterations.Module.Use(configure); - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Alterations.MassTransit/Features/AlterationsMassTransitFeature.cs b/src/modules/Elsa.Alterations.MassTransit/Features/AlterationsMassTransitFeature.cs deleted file mode 100644 index 27cbaf6b6c..0000000000 --- a/src/modules/Elsa.Alterations.MassTransit/Features/AlterationsMassTransitFeature.cs +++ /dev/null @@ -1,42 +0,0 @@ -using Elsa.Alterations.Features; -using Elsa.Alterations.MassTransit.Consumers; -using Elsa.Alterations.MassTransit.Messages; -using Elsa.Alterations.MassTransit.Services; -using Elsa.Extensions; -using Elsa.Features.Abstractions; -using Elsa.Features.Attributes; -using Elsa.Features.Services; -using Elsa.MassTransit.Features; -using MassTransit; -using Microsoft.Extensions.DependencyInjection; - -namespace Elsa.Alterations.MassTransit.Features; - -/// -/// A feature for enabling the Alterations MassTransit feature. -/// -[DependsOn(typeof(MassTransitFeature))] -[DependsOn(typeof(AlterationsFeature))] -public class MassTransitAlterationsFeature : FeatureBase -{ - /// - public MassTransitAlterationsFeature(IModule module) : base(module) - { - } - - /// - public override void Configure() - { - Module.Configure(feature => feature.AlterationJobDispatcherFactory = sp => sp.GetRequiredService()); - var queueName = KebabCaseEndpointNameFormatter.Instance.Consumer(); - var queueAddress = new Uri($"queue:elsa-{queueName}"); - EndpointConvention.Map(queueAddress); - Module.AddMassTransitConsumer(queueName); - } - - /// - public override void Apply() - { - Services.AddScoped(); - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Alterations.MassTransit/Messages/RunAlterationJob.cs b/src/modules/Elsa.Alterations.MassTransit/Messages/RunAlterationJob.cs deleted file mode 100644 index b96e5f932a..0000000000 --- a/src/modules/Elsa.Alterations.MassTransit/Messages/RunAlterationJob.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace Elsa.Alterations.MassTransit.Messages; - -/// -/// Represents a request to run an alteration job. -/// -/// The job ID. -public record RunAlterationJob(string JobId); \ No newline at end of file diff --git a/src/modules/Elsa.Alterations.MassTransit/Readme.md b/src/modules/Elsa.Alterations.MassTransit/Readme.md deleted file mode 100644 index 9e45a99f3f..0000000000 --- a/src/modules/Elsa.Alterations.MassTransit/Readme.md +++ /dev/null @@ -1,4 +0,0 @@ -# MassTransit Alterations Background Runner - -This module provides an implementation that processes alteration plans in the background using a MassTransit dispatcher and consumer. -This implementation is more resilient than the in-memory queue implementation provided by **Elsa.Alterations.BackgroundRunner** because it uses a message broker to persist messages. \ No newline at end of file diff --git a/src/modules/Elsa.Alterations.MassTransit/Services/MassTransitAlterationJobDispatcher.cs b/src/modules/Elsa.Alterations.MassTransit/Services/MassTransitAlterationJobDispatcher.cs deleted file mode 100644 index a2e2327585..0000000000 --- a/src/modules/Elsa.Alterations.MassTransit/Services/MassTransitAlterationJobDispatcher.cs +++ /dev/null @@ -1,28 +0,0 @@ -using Elsa.Alterations.Core.Contracts; -using Elsa.Alterations.MassTransit.Messages; -using MassTransit; - -namespace Elsa.Alterations.MassTransit.Services; - -/// -/// Dispatches an alteration job for execution using MassTransit. -/// -public class MassTransitAlterationJobDispatcher : IAlterationJobDispatcher -{ - private readonly IBus _bus; - - /// - /// Initializes a new instance of the class. - /// - public MassTransitAlterationJobDispatcher(IBus bus) - { - _bus = bus; - } - - /// - public async ValueTask DispatchAsync(string jobId, CancellationToken cancellationToken = default) - { - var message = new RunAlterationJob(jobId); - await _bus.Send(message, cancellationToken); - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Alterations/Activities/AlterationPlanCompleted.cs b/src/modules/Elsa.Alterations/Activities/AlterationPlanCompleted.cs deleted file mode 100644 index 5d6d01f469..0000000000 --- a/src/modules/Elsa.Alterations/Activities/AlterationPlanCompleted.cs +++ /dev/null @@ -1,55 +0,0 @@ -using System.ComponentModel; -using System.Runtime.CompilerServices; -using Elsa.Alterations.Bookmarks; -using Elsa.Extensions; -using Elsa.Workflows; -using Elsa.Workflows.Attributes; -using Elsa.Workflows.Memory; -using Elsa.Workflows.Models; - -namespace Elsa.Alterations.Activities; - -/// -/// Submits an alteration plan for execution. -/// -[Browsable(false)] -[Activity("Elsa", "Alterations", "Triggered when an Alteration Plan completed")] -public class AlterationPlanCompleted : Trigger -{ - /// - public AlterationPlanCompleted(Variable planId, [CallerFilePath] string? source = null, [CallerLineNumber] int? line = null) : base(source, line) - { - PlanId = new Input(planId); - } - - /// - public AlterationPlanCompleted([CallerFilePath] string? source = null, [CallerLineNumber] int? line = null) : base(source, line) - { - } - - /// - /// The ID of the alteration plan. - /// - public Input PlanId { get; set; } = null!; - - /// - protected override async ValueTask ExecuteAsync(ActivityExecutionContext context) - { - if (context.IsTriggerOfWorkflow()) - { - await context.CompleteActivityAsync(); - return; - } - - var planId = context.Get(PlanId)!; - var bookmarkPayload = new AlterationPlanCompletedPayload(planId); - context.CreateBookmark(bookmarkPayload, false); - } - - /// - protected override object GetTriggerPayload(TriggerIndexingContext context) - { - var planId = context.Get(PlanId)!; - return new AlterationPlanCompletedPayload(planId); - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Alterations/Activities/CompleteAlterationPlan.cs b/src/modules/Elsa.Alterations/Activities/CompleteAlterationPlan.cs deleted file mode 100644 index 0c1d504bf7..0000000000 --- a/src/modules/Elsa.Alterations/Activities/CompleteAlterationPlan.cs +++ /dev/null @@ -1,48 +0,0 @@ -using System.ComponentModel; -using System.Runtime.CompilerServices; -using Elsa.Alterations.Core.Contracts; -using Elsa.Workflows; -using Elsa.Workflows.Attributes; -using Elsa.Workflows.Exceptions; -using Elsa.Workflows.Memory; -using Elsa.Workflows.Models; - -namespace Elsa.Alterations.Activities; - -/// -/// Marks an alteration plan as completed. -/// -[Browsable(false)] -[Activity("Elsa", "Alterations", "Dispatches jobs for the specified Alteration Plan", Kind = ActivityKind.Task)] -public class CompleteAlterationPlan : CodeActivity -{ - /// - public CompleteAlterationPlan(Variable planId, [CallerFilePath] string? source = null, [CallerLineNumber] int? line = null) : base(source, line) - { - PlanId = new Input(planId); - } - - /// - public CompleteAlterationPlan([CallerFilePath] string? source = null, [CallerLineNumber] int? line = null) : base(source, line) - { - } - - /// - /// The ID of the alteration plan. - /// - public Input PlanId { get; set; } = null!; - - /// - protected override async ValueTask ExecuteAsync(ActivityExecutionContext context) - { - var cancellationToken = context.CancellationToken; - var planId = context.Get(PlanId)!; - var manager = context.GetRequiredService(); - var plan = await manager.GetPlanAsync(planId, cancellationToken); - - if (plan == null) - throw new FaultException(AlterationFaultCodes.PlanNotFound, AlterationFaultCategories.Alteration, DefaultFaultTypes.System, $"Alteration Plan with ID {planId} not found."); - - await manager.CompletePlanAsync(plan, cancellationToken); - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Alterations/Activities/DispatchAlterationJobs.cs b/src/modules/Elsa.Alterations/Activities/DispatchAlterationJobs.cs deleted file mode 100644 index 965a25c648..0000000000 --- a/src/modules/Elsa.Alterations/Activities/DispatchAlterationJobs.cs +++ /dev/null @@ -1,73 +0,0 @@ -using System.ComponentModel; -using System.Runtime.CompilerServices; -using Elsa.Alterations.Core.Contracts; -using Elsa.Alterations.Core.Enums; -using Elsa.Alterations.Core.Filters; -using Elsa.Workflows; -using Elsa.Workflows.Attributes; -using Elsa.Workflows.Exceptions; -using Elsa.Workflows.Memory; -using Elsa.Workflows.Models; - -namespace Elsa.Alterations.Activities; - -/// -/// Submits an alteration plan for execution. -/// -[Browsable(false)] -[Activity("Elsa", "Alterations", "Dispatches jobs for the specified Alteration Plan", Kind = ActivityKind.Task)] -public class DispatchAlterationJobs : CodeActivity -{ - /// - public DispatchAlterationJobs(Variable planId, [CallerFilePath] string? source = null, [CallerLineNumber] int? line = null) : base(source, line) - { - PlanId = new Input(planId); - } - - /// - public DispatchAlterationJobs([CallerFilePath] string? source = null, [CallerLineNumber] int? line = null) : base(source, line) - { - } - - /// - /// The ID of the alteration plan. - /// - public Input PlanId { get; set; } = null!; - - /// - protected override async ValueTask ExecuteAsync(ActivityExecutionContext context) - { - var cancellationToken = context.CancellationToken; - var planId = context.Get(PlanId)!; - var alterationPlanStore = context.GetRequiredService(); - var planFilter = new AlterationPlanFilter - { - Id = planId - }; - var plan = await alterationPlanStore.FindAsync(planFilter, cancellationToken); - - if (plan == null) - throw new FaultException(AlterationFaultCodes.PlanNotFound, AlterationFaultCategories.Alteration, DefaultFaultTypes.System, $"Alteration Plan with ID {planId} not found."); - - // Update status. - plan.Status = AlterationPlanStatus.Dispatching; - await alterationPlanStore.SaveAsync(plan, cancellationToken); - - // Find all jobs for the plan and dispatch them. - var filter = new AlterationJobFilter - { - PlanId = plan.Id - }; - var alterationJobStore = context.GetRequiredService(); - var alterationJobIds = await alterationJobStore.FindManyIdsAsync(filter, cancellationToken); - - // Dispatch each job. - var alterationJobDispatcher = context.GetRequiredService(); - foreach (var jobId in alterationJobIds) - await alterationJobDispatcher.DispatchAsync(jobId, cancellationToken); - - // Update status. - plan.Status = AlterationPlanStatus.Running; - await alterationPlanStore.SaveAsync(plan, cancellationToken); - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Alterations/Activities/GenerateAlterationJobs.cs b/src/modules/Elsa.Alterations/Activities/GenerateAlterationJobs.cs deleted file mode 100644 index 8bae6664bc..0000000000 --- a/src/modules/Elsa.Alterations/Activities/GenerateAlterationJobs.cs +++ /dev/null @@ -1,104 +0,0 @@ -using System.ComponentModel; -using System.Runtime.CompilerServices; -using Elsa.Alterations.Core.Contracts; -using Elsa.Alterations.Core.Entities; -using Elsa.Alterations.Core.Enums; -using Elsa.Alterations.Core.Filters; -using Elsa.Alterations.Core.Models; -using Elsa.Common; -using Elsa.Extensions; -using Elsa.Workflows; -using Elsa.Workflows.Attributes; -using Elsa.Workflows.Exceptions; -using Elsa.Workflows.Memory; -using Elsa.Workflows.Models; - -namespace Elsa.Alterations.Activities; - -/// -/// Submits an alteration plan for execution. -/// -[Browsable(false)] -[Activity("Elsa", "Alterations", "Generates jobs for the specified Alteration Plan", Kind = ActivityKind.Task)] -public class GenerateAlterationJobs : CodeActivity -{ - /// - public GenerateAlterationJobs([CallerFilePath] string? source = null, [CallerLineNumber] int? line = null) : base(source, line) - { - } - - /// - public GenerateAlterationJobs(Variable planId, [CallerFilePath] string? source = null, [CallerLineNumber] int? line = null) : base(source, line) - { - PlanId = new Input(planId); - } - - /// - /// The ID of the submitted alteration plan. - /// - public Input PlanId { get; set; } = null!; - - /// - protected override async ValueTask ExecuteAsync(ActivityExecutionContext context) - { - var plan = await GetPlanAsync(context); - await UpdatePlanStatusAsync(context, plan); - var workflowInstanceIds = (await FindMatchingWorkflowInstanceIdsAsync(context, plan.WorkflowInstanceFilter)).ToList(); - - if (workflowInstanceIds.Any()) - await GenerateJobsAsync(context, plan, workflowInstanceIds); - - context.SetResult(workflowInstanceIds.Count); - } - - private async Task GetPlanAsync(ActivityExecutionContext context) - { - var cancellationToken = context.CancellationToken; - var planId = context.Get(PlanId)!; - var alterationPlanStore = context.GetRequiredService(); - var planFilter = new AlterationPlanFilter - { - Id = planId - }; - var plan = await alterationPlanStore.FindAsync(planFilter, cancellationToken); - - if (plan == null) - throw new FaultException(AlterationFaultCodes.PlanNotFound, AlterationFaultCategories.Alteration, DefaultFaultTypes.System, $"Alteration Plan with ID {planId} not found."); - - return plan; - } - - private async Task UpdatePlanStatusAsync(ActivityExecutionContext context, AlterationPlan plan) - { - var cancellationToken = context.CancellationToken; - var alterationPlanStore = context.GetRequiredService(); - plan.Status = AlterationPlanStatus.Generating; - await alterationPlanStore.SaveAsync(plan, cancellationToken); - } - - private async Task> FindMatchingWorkflowInstanceIdsAsync(ActivityExecutionContext context, AlterationWorkflowInstanceFilter filter) - { - var cancellationToken = context.CancellationToken; - var workflowInstanceFinder = context.GetRequiredService(); - return await workflowInstanceFinder.FindAsync(filter, cancellationToken); - } - - private async Task GenerateJobsAsync(ActivityExecutionContext context, AlterationPlan plan, IEnumerable workflowInstanceIds) - { - var cancellationToken = context.CancellationToken; - var identityGenerator = context.GetRequiredService(); - var systemClock = context.GetRequiredService(); - var jobs = workflowInstanceIds.Select(workflowInstanceId => new AlterationJob - { - Id = identityGenerator.GenerateId(), - PlanId = plan.Id, - Status = AlterationJobStatus.Pending, - WorkflowInstanceId = workflowInstanceId, - CreatedAt = systemClock.UtcNow - }) - .ToList(); - - var alterationJobStore = context.GetRequiredService(); - await alterationJobStore.SaveManyAsync(jobs, cancellationToken); - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Alterations/Activities/SubmitAlterationPlan.cs b/src/modules/Elsa.Alterations/Activities/SubmitAlterationPlan.cs deleted file mode 100644 index d1624a4c7a..0000000000 --- a/src/modules/Elsa.Alterations/Activities/SubmitAlterationPlan.cs +++ /dev/null @@ -1,52 +0,0 @@ -using System.ComponentModel; -using Elsa.Alterations.Core.Contracts; -using Elsa.Alterations.Core.Entities; -using Elsa.Alterations.Core.Enums; -using Elsa.Alterations.Core.Models; -using Elsa.Common; -using Elsa.Extensions; -using Elsa.Workflows; -using Elsa.Workflows.Attributes; -using Elsa.Workflows.Models; - -namespace Elsa.Alterations.Activities; - -/// -/// Submits an alteration plan for execution. -/// -[Browsable(false)] -[Output( - DisplayName = "Plan ID", - Description = "The ID of the submitted alteration plan." -)] -[Activity("Elsa", "Alterations", "Submits an Alteration Plan", Kind = ActivityKind.Task)] -public class SubmitAlterationPlan : CodeActivity -{ - /// - /// The parameters for the alteration plan to be submitted. - /// - public Input Params { get; set; } = null!; - - /// - protected override async ValueTask ExecuteAsync(ActivityExecutionContext context) - { - var systemClock = context.GetRequiredService(); - var identityGenerator = context.GetRequiredService(); - var now = systemClock.UtcNow; - var planParams = context.Get(Params)!; - - var plan = new AlterationPlan - { - Id = string.IsNullOrWhiteSpace(planParams.Id) ? identityGenerator.GenerateId() : planParams.Id, - Alterations = planParams.Alterations, - WorkflowInstanceFilter = planParams.Filter, - Status = AlterationPlanStatus.Pending, - CreatedAt = now - }; - - var alterationPlanStore = context.GetRequiredService(); - var cancellationToken = context.CancellationToken; - await alterationPlanStore.SaveAsync(plan, cancellationToken); - Result.Set(context, plan.Id); - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Alterations/AlterationHandlers/CancelActivityHandler.cs b/src/modules/Elsa.Alterations/AlterationHandlers/CancelActivityHandler.cs deleted file mode 100644 index 95ffa2db7f..0000000000 --- a/src/modules/Elsa.Alterations/AlterationHandlers/CancelActivityHandler.cs +++ /dev/null @@ -1,62 +0,0 @@ -using Elsa.Alterations.AlterationTypes; -using Elsa.Alterations.Core.Abstractions; -using Elsa.Alterations.Core.Contexts; -using Elsa.Extensions; -using Elsa.Workflows; -using JetBrains.Annotations; - -namespace Elsa.Alterations.AlterationHandlers; - -/// -/// Cancels an activity. -/// -[UsedImplicitly] -public class CancelActivityHandler : AlterationHandlerBase -{ - /// - protected override ValueTask HandleAsync(AlterationContext context, CancelActivity alteration) - { - if (alteration.ActivityInstanceId == null && alteration.ActivityId == null) - { - context.Fail("Either ActivityInstanceId or ActivityId must be specified"); - return ValueTask.CompletedTask; - } - - var activityExecutionContexts = GetActivityExecutionContexts(context, alteration).ToList(); - - if (!activityExecutionContexts.Any()) - { - context.Fail( - alteration.ActivityInstanceId != null - ? $"Activity execution context with ID {alteration.ActivityInstanceId} not found" - : $"Activity execution contexts for activity with ID {alteration.ActivityId} not found"); - - return ValueTask.CompletedTask; - } - - context.Succeed(() => CancelAsync(activityExecutionContexts)); - return ValueTask.CompletedTask; - } - - private async Task CancelAsync(IEnumerable activityExecutionContexts) - { - foreach (var activityExecutionContext in activityExecutionContexts) - await CancelAsync(activityExecutionContext); - } - - private async Task CancelAsync(ActivityExecutionContext activityExecutionContext) - { - await activityExecutionContext.CancelActivityAsync(); - } - - private static IEnumerable GetActivityExecutionContexts(AlterationContext context, CancelActivity alteration) - { - var workflowExecutionContext = context.WorkflowExecutionContext; - - return alteration.ActivityInstanceId != null - ? workflowExecutionContext.ActivityExecutionContexts.Where(x => x.Id == alteration.ActivityInstanceId) - : alteration.ActivityId != null - ? workflowExecutionContext.ActivityExecutionContexts.Where(x => x.Activity.Id == alteration.ActivityId) - : Enumerable.Empty(); - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Alterations/AlterationHandlers/CancelHandler.cs b/src/modules/Elsa.Alterations/AlterationHandlers/CancelHandler.cs deleted file mode 100644 index 38bc32404b..0000000000 --- a/src/modules/Elsa.Alterations/AlterationHandlers/CancelHandler.cs +++ /dev/null @@ -1,22 +0,0 @@ -using Elsa.Alterations.AlterationTypes; -using Elsa.Alterations.Core.Abstractions; -using Elsa.Alterations.Core.Contexts; -using JetBrains.Annotations; - -namespace Elsa.Alterations.AlterationHandlers; - -/// -/// Upgrades the version of the workflow instance. -/// -[UsedImplicitly] -public class CancelHandler : AlterationHandlerBase -{ - /// - protected override ValueTask HandleAsync(AlterationContext context, Cancel alteration) - { - context.WorkflowExecutionContext.Cancel(); - - context.Succeed(); - return ValueTask.CompletedTask; - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Alterations/AlterationHandlers/MigrateHandler.cs b/src/modules/Elsa.Alterations/AlterationHandlers/MigrateHandler.cs deleted file mode 100644 index 25418edeee..0000000000 --- a/src/modules/Elsa.Alterations/AlterationHandlers/MigrateHandler.cs +++ /dev/null @@ -1,37 +0,0 @@ -using Elsa.Alterations.AlterationTypes; -using Elsa.Alterations.Core.Abstractions; -using Elsa.Alterations.Core.Contexts; -using Elsa.Common.Models; -using Elsa.Workflows.Management; -using JetBrains.Annotations; -using Microsoft.Extensions.DependencyInjection; - -namespace Elsa.Alterations.AlterationHandlers; - -/// -/// Upgrades the version of the workflow instance. -/// -[UsedImplicitly] -public class MigrateHandler : AlterationHandlerBase -{ - /// - protected override async ValueTask HandleAsync(AlterationContext context, Migrate alteration) - { - var workflowDefinitionService = context.ServiceProvider.GetRequiredService(); - var definitionId = context.Workflow.Identity.DefinitionId; - var targetVersion = alteration.TargetVersion; - var cancellationToken = context.CancellationToken; - var targetWorkflowDefinition = await workflowDefinitionService.FindWorkflowDefinitionAsync(definitionId, VersionOptions.SpecificVersion(targetVersion), cancellationToken); - - if (targetWorkflowDefinition == null) - { - context.Fail($"Workflow definition with ID {definitionId} and version {targetVersion} not found"); - return; - } - - var targetWorkflow = await workflowDefinitionService.MaterializeWorkflowAsync(targetWorkflowDefinition, cancellationToken); - await context.WorkflowExecutionContext.SetWorkflowGraphAsync(targetWorkflow); - - context.Succeed(); - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Alterations/AlterationHandlers/ModifyVariableHandler.cs b/src/modules/Elsa.Alterations/AlterationHandlers/ModifyVariableHandler.cs deleted file mode 100644 index e42d516298..0000000000 --- a/src/modules/Elsa.Alterations/AlterationHandlers/ModifyVariableHandler.cs +++ /dev/null @@ -1,74 +0,0 @@ -using System.Diagnostics.CodeAnalysis; -using Elsa.Alterations.AlterationTypes; -using Elsa.Alterations.Core.Abstractions; -using Elsa.Alterations.Core.Contexts; -using Elsa.Extensions; -using Elsa.Workflows; -using Elsa.Workflows.Activities; -using Elsa.Workflows.Memory; -using JetBrains.Annotations; -using Microsoft.Extensions.DependencyInjection; - -namespace Elsa.Alterations.AlterationHandlers; - -/// -/// Modifies a workflow variable. -/// -[UsedImplicitly] -public class ModifyVariableHandler : AlterationHandlerBase -{ - /// - [RequiresUnreferencedCode("Calls System.Text.Json.JsonSerializer.Serialize(TValue, JsonSerializerOptions)")] - protected override async ValueTask HandleAsync(AlterationContext context, ModifyVariable alteration) - { - var workflow = context.Workflow; - var cancellationToken = context.CancellationToken; - var variable = await FindVariable(context, alteration, workflow, cancellationToken); - - if (variable == null) - { - context.Fail($"Variable with ID {alteration.VariableId} not found"); - return; - } - - var convertedValue = variable.ParseValue(alteration.Value); - UpdateVariable(context, variable, convertedValue); - context.Succeed(); - } - - private void UpdateVariable(AlterationContext context, Variable variable, object? value) - { - var activityExecutionContext = FindActivityExecutionContextContainingVariable(context, variable); - - if (activityExecutionContext == null) - { - context.Fail($"Activity execution context containing variable with ID {variable.Id} not found"); - return; - } - - variable.Set(activityExecutionContext, value); - } - - private ActivityExecutionContext? FindActivityExecutionContextContainingVariable(AlterationContext context, Variable variable) - { - var query = - from activityExecutionContext in context.WorkflowExecutionContext.ActivityExecutionContexts - from var in activityExecutionContext.Variables - where var.Id == variable.Id - select activityExecutionContext; - - return query.FirstOrDefault(); - } - - private async Task FindVariable(AlterationContext context, ModifyVariable alteration, Workflow workflow, CancellationToken cancellationToken) - { - var activityVisitor = context.ServiceProvider.GetRequiredService(); - var graph = await activityVisitor.VisitAsync(workflow, cancellationToken); - var flattenedList = graph.Flatten().ToList(); - - return flattenedList - .Where(x => x.Activity is IVariableContainer) - .SelectMany(x => ((IVariableContainer)x.Activity).Variables) - .FirstOrDefault(x => x.Id == alteration.VariableId); - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Alterations/AlterationHandlers/ScheduleActivityHandler.cs b/src/modules/Elsa.Alterations/AlterationHandlers/ScheduleActivityHandler.cs deleted file mode 100644 index 89c7fd9c6e..0000000000 --- a/src/modules/Elsa.Alterations/AlterationHandlers/ScheduleActivityHandler.cs +++ /dev/null @@ -1,85 +0,0 @@ -using Elsa.Alterations.AlterationTypes; -using Elsa.Alterations.Core.Abstractions; -using Elsa.Alterations.Core.Contexts; -using Elsa.Extensions; -using Elsa.Workflows; -using Elsa.Workflows.Signals; -using JetBrains.Annotations; - -namespace Elsa.Alterations.AlterationHandlers; - -/// -/// Schedules an activity for execution. -/// -[UsedImplicitly] -public class ScheduleActivityHandler : AlterationHandlerBase -{ - /// - protected override async ValueTask HandleAsync(AlterationContext context, ScheduleActivity alteration) - { - if (alteration.ActivityInstanceId == null && alteration.ActivityId == null) - { - context.Fail("Either ActivityInstanceId or ActivityId must be specified"); - return; - } - - var workflowExecutionContext = context.WorkflowExecutionContext; - var existingActivityExecutionContext = GetActivityExecutionContext(context, alteration); - - if (existingActivityExecutionContext != null) - { - // If the activity is in a faulted state, reset it to Running. - if (existingActivityExecutionContext.Status == ActivityStatus.Faulted) - existingActivityExecutionContext.TransitionTo(ActivityStatus.Running); - - // Schedule the activity execution context. - var parentContext = existingActivityExecutionContext.ParentActivityExecutionContext; - await parentContext!.SendSignalAsync(new ScheduleChildActivity(existingActivityExecutionContext)); - context.Succeed(); - return; - } - - // Schedule a new activity instance. - var activityId = alteration.ActivityId; - - if (activityId == null) - { - context.Fail("No existing activity execution context was found and no activity ID was specified"); - return; - } - - var activityNode = workflowExecutionContext.FindNodeByActivityId(activityId); - - if (activityNode == null) - { - context.Fail($"Activity with ID {activityId} not found"); - return; - } - - // Find the parent activity execution context within which to schedule the activity. - var parentActivityContexts = workflowExecutionContext.ActivityExecutionContexts.Reverse().ToList(); - - var parentExecutionContext = - (from ancestorNode in activityNode.Ancestors() - from parentActivityContext in parentActivityContexts - where parentActivityContext.Activity.Id == ancestorNode.Activity.Id - select parentActivityContext).FirstOrDefault(); - - if (parentExecutionContext == null) - { - context.Fail($"Could not find parent activity execution context for activity with ID {activityId}"); - return; - } - - await parentExecutionContext.SendSignalAsync(new ScheduleChildActivity(activityNode.Activity)); - context.Succeed(); - } - - private static ActivityExecutionContext? GetActivityExecutionContext(AlterationContext context, ScheduleActivity alteration) - { - if (alteration.ActivityInstanceId != null) - return context.WorkflowExecutionContext.ActivityExecutionContexts.FirstOrDefault(x => x.Id == alteration.ActivityInstanceId); - - return null; - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Alterations/AlterationTypes/Cancel.cs b/src/modules/Elsa.Alterations/AlterationTypes/Cancel.cs deleted file mode 100644 index c0a5f7fded..0000000000 --- a/src/modules/Elsa.Alterations/AlterationTypes/Cancel.cs +++ /dev/null @@ -1,10 +0,0 @@ -using Elsa.Alterations.Core.Abstractions; -using JetBrains.Annotations; - -namespace Elsa.Alterations.AlterationTypes; - -/// -/// Cancels the workflow instances in an alteration plan. -/// -[UsedImplicitly] -public class Cancel : AlterationBase; \ No newline at end of file diff --git a/src/modules/Elsa.Alterations/AlterationTypes/CancelActivity.cs b/src/modules/Elsa.Alterations/AlterationTypes/CancelActivity.cs deleted file mode 100644 index 15083bae94..0000000000 --- a/src/modules/Elsa.Alterations/AlterationTypes/CancelActivity.cs +++ /dev/null @@ -1,21 +0,0 @@ -using Elsa.Alterations.Core.Abstractions; -using JetBrains.Annotations; - -namespace Elsa.Alterations.AlterationTypes; - -/// -/// Cancels an activity. -/// -[UsedImplicitly] -public class CancelActivity : AlterationBase -{ - /// - /// The ID of the activity to be cancelled. If not specified, the activity instance ID will be used. - /// - public string? ActivityId { get; set; } - - /// - /// The ID of the activity instance to be cancelled. If specified, overrides . - /// - public string? ActivityInstanceId { get; set; } -} \ No newline at end of file diff --git a/src/modules/Elsa.Alterations/AlterationTypes/Migrate.cs b/src/modules/Elsa.Alterations/AlterationTypes/Migrate.cs deleted file mode 100644 index 2097bedc0f..0000000000 --- a/src/modules/Elsa.Alterations/AlterationTypes/Migrate.cs +++ /dev/null @@ -1,16 +0,0 @@ -using Elsa.Alterations.Core.Abstractions; -using JetBrains.Annotations; - -namespace Elsa.Alterations.AlterationTypes; - -/// -/// Migrates a workflow instance to a newer version. -/// -[UsedImplicitly] -public class Migrate : AlterationBase -{ - /// - /// The target version to upgrade to. - /// - public int TargetVersion { get; set; } -} \ No newline at end of file diff --git a/src/modules/Elsa.Alterations/AlterationTypes/ModifyVariable.cs b/src/modules/Elsa.Alterations/AlterationTypes/ModifyVariable.cs deleted file mode 100644 index 179a94e459..0000000000 --- a/src/modules/Elsa.Alterations/AlterationTypes/ModifyVariable.cs +++ /dev/null @@ -1,22 +0,0 @@ -using Elsa.Alterations.Core.Abstractions; -using JetBrains.Annotations; - -namespace Elsa.Alterations.AlterationTypes; - -/// -/// Modifies a variable. -/// -[UsedImplicitly] -public class ModifyVariable : AlterationBase -{ - /// - /// The ID of the variable to modify. - /// - public string VariableId { get; set; } = default!; - - /// - /// The new value of the variable. - /// - public object? Value { get; set; } - -} \ No newline at end of file diff --git a/src/modules/Elsa.Alterations/AlterationTypes/ScheduleActivity.cs b/src/modules/Elsa.Alterations/AlterationTypes/ScheduleActivity.cs deleted file mode 100644 index de447852ea..0000000000 --- a/src/modules/Elsa.Alterations/AlterationTypes/ScheduleActivity.cs +++ /dev/null @@ -1,21 +0,0 @@ -using Elsa.Alterations.Core.Abstractions; -using JetBrains.Annotations; - -namespace Elsa.Alterations.AlterationTypes; - -/// -/// Schedules an activity for execution. -/// -[UsedImplicitly] -public class ScheduleActivity : AlterationBase -{ - /// - /// The ID of the next activity to be scheduled. If not specified, the ActivityInstanceId will be used. - /// - public string? ActivityId { get; set; } - - /// - /// The ID of the activity instance to be scheduled. If not specified, the ActivityId will be used. - /// - public string? ActivityInstanceId { get; set; } -} \ No newline at end of file diff --git a/src/modules/Elsa.Alterations/Bookmarks/AlterationPlanCompletedPayload.cs b/src/modules/Elsa.Alterations/Bookmarks/AlterationPlanCompletedPayload.cs deleted file mode 100644 index 2c1f6e99e3..0000000000 --- a/src/modules/Elsa.Alterations/Bookmarks/AlterationPlanCompletedPayload.cs +++ /dev/null @@ -1,9 +0,0 @@ -using Elsa.Alterations.Activities; - -namespace Elsa.Alterations.Bookmarks; - -/// -/// Represents bookmark payload for the trigger. -/// -/// The ID of the alteration plan. -public record AlterationPlanCompletedPayload(string PlanId); \ No newline at end of file diff --git a/src/modules/Elsa.Alterations/Constants/AlterationFaultCategories.cs b/src/modules/Elsa.Alterations/Constants/AlterationFaultCategories.cs deleted file mode 100644 index dc528751e6..0000000000 --- a/src/modules/Elsa.Alterations/Constants/AlterationFaultCategories.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace Elsa.Alterations; - -public static class AlterationFaultCategories -{ - public const string Alteration = "Alteration"; -} \ No newline at end of file diff --git a/src/modules/Elsa.Alterations/Constants/AlterationFaultCodes.cs b/src/modules/Elsa.Alterations/Constants/AlterationFaultCodes.cs deleted file mode 100644 index f3ea75e92f..0000000000 --- a/src/modules/Elsa.Alterations/Constants/AlterationFaultCodes.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace Elsa.Alterations; - -public static class AlterationFaultCodes -{ - public const string PlanNotFound = "PlanNotFound"; -} \ No newline at end of file diff --git a/src/modules/Elsa.Alterations/Elsa.Alterations.csproj b/src/modules/Elsa.Alterations/Elsa.Alterations.csproj deleted file mode 100644 index 10d13fd535..0000000000 --- a/src/modules/Elsa.Alterations/Elsa.Alterations.csproj +++ /dev/null @@ -1,15 +0,0 @@ - - - - - Provides alterations for workflow instances. - - elsa module alterations - - - - - - - - diff --git a/src/modules/Elsa.Alterations/Elsa.Alterations.csproj.DotSettings b/src/modules/Elsa.Alterations/Elsa.Alterations.csproj.DotSettings deleted file mode 100644 index fa77252972..0000000000 --- a/src/modules/Elsa.Alterations/Elsa.Alterations.csproj.DotSettings +++ /dev/null @@ -1,2 +0,0 @@ - - True \ No newline at end of file diff --git a/src/modules/Elsa.Alterations/Endpoints/Alterations/DryRun/Endpoint.cs b/src/modules/Elsa.Alterations/Endpoints/Alterations/DryRun/Endpoint.cs deleted file mode 100644 index f401755221..0000000000 --- a/src/modules/Elsa.Alterations/Endpoints/Alterations/DryRun/Endpoint.cs +++ /dev/null @@ -1,28 +0,0 @@ -using Elsa.Abstractions; -using Elsa.Alterations.Core.Contracts; -using Elsa.Alterations.Core.Models; -using JetBrains.Annotations; - -namespace Elsa.Alterations.Endpoints.Alterations.DryRun; - -/// -/// Determines which workflow instances a "Submit" request would target without actually running an alteration. -/// -[PublicAPI] -public class DryRun(IWorkflowInstanceFinder workflowInstanceFinder) : ElsaEndpoint -{ - /// - public override void Configure() - { - Post("/alterations/dry-run"); - ConfigurePermissions("run:alterations"); - } - - /// - public override async Task HandleAsync(AlterationWorkflowInstanceFilter filter, CancellationToken cancellationToken) - { - var workflowInstanceIds = await workflowInstanceFinder.FindAsync(filter, cancellationToken); - var response = new Response(workflowInstanceIds.ToList()); - await SendOkAsync(response, cancellationToken); - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Alterations/Endpoints/Alterations/DryRun/Response.cs b/src/modules/Elsa.Alterations/Endpoints/Alterations/DryRun/Response.cs deleted file mode 100644 index fdae58b051..0000000000 --- a/src/modules/Elsa.Alterations/Endpoints/Alterations/DryRun/Response.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace Elsa.Alterations.Endpoints.Alterations.DryRun; - -/// -/// The response from the endpoint. -/// -public record Response(ICollection WorkflowInstanceIds); \ No newline at end of file diff --git a/src/modules/Elsa.Alterations/Endpoints/Alterations/Get/Endpoint.cs b/src/modules/Elsa.Alterations/Endpoints/Alterations/Get/Endpoint.cs deleted file mode 100644 index 7c4be8ebe5..0000000000 --- a/src/modules/Elsa.Alterations/Endpoints/Alterations/Get/Endpoint.cs +++ /dev/null @@ -1,52 +0,0 @@ -using Elsa.Abstractions; -using Elsa.Alterations.Core.Contracts; -using Elsa.Alterations.Core.Filters; -using JetBrains.Annotations; - -namespace Elsa.Alterations.Endpoints.Alterations.Get; - -/// -/// Gets an alteration plan and its associated jobs. -/// -[PublicAPI] -public class Get : ElsaEndpointWithoutRequest -{ - private readonly IAlterationPlanStore _alterationPlanStore; - private readonly IAlterationJobStore _alterationJobStore; - - /// - public Get(IAlterationPlanStore alterationPlanStore, IAlterationJobStore alterationJobStore) - { - _alterationPlanStore = alterationPlanStore; - _alterationJobStore = alterationJobStore; - } - - /// - public override void Configure() - { - Get("/alterations/{id}"); - ConfigurePermissions("read:alterations"); - } - - /// - public override async Task HandleAsync(CancellationToken cancellationToken) - { - var planId = Route("id"); - - // Load the plan. - var plan = await _alterationPlanStore.FindAsync(new AlterationPlanFilter { Id = planId }, cancellationToken); - - if (plan == null) - { - await SendNotFoundAsync(cancellationToken); - return; - } - - // Load the jobs. - var jobs = (await _alterationJobStore.FindManyAsync(new AlterationJobFilter { PlanId = planId }, cancellationToken)).ToList(); - - // Write response. - var response = new Response(plan, jobs); - await SendOkAsync(response, cancellationToken); - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Alterations/Endpoints/Alterations/Get/Response.cs b/src/modules/Elsa.Alterations/Endpoints/Alterations/Get/Response.cs deleted file mode 100644 index 673a776802..0000000000 --- a/src/modules/Elsa.Alterations/Endpoints/Alterations/Get/Response.cs +++ /dev/null @@ -1,10 +0,0 @@ -using Elsa.Alterations.Core.Entities; - -namespace Elsa.Alterations.Endpoints.Alterations.Get; - -/// -/// Represents a response to a request to get an alteration plan. -/// -/// The alteration plan. -/// The jobs created for the plan. -public record Response(AlterationPlan Plan, ICollection Jobs); \ No newline at end of file diff --git a/src/modules/Elsa.Alterations/Endpoints/Alterations/Run/Endpoint.cs b/src/modules/Elsa.Alterations/Endpoints/Alterations/Run/Endpoint.cs deleted file mode 100644 index a1d090e5ef..0000000000 --- a/src/modules/Elsa.Alterations/Endpoints/Alterations/Run/Endpoint.cs +++ /dev/null @@ -1,43 +0,0 @@ -using Elsa.Abstractions; -using Elsa.Alterations.Core.Contracts; -using JetBrains.Annotations; - -namespace Elsa.Alterations.Endpoints.Alterations.Run; - -/// -/// Executes an alteration plan by targeting workflow instances by ID. -/// -[PublicAPI] -public class Run : ElsaEndpoint -{ - private readonly IAlterationRunner _alterationRunner; - private readonly IAlteredWorkflowDispatcher _workflowDispatcher; - - /// - public Run(IAlterationRunner alterationRunner, IAlteredWorkflowDispatcher workflowDispatcher) - { - _alterationRunner = alterationRunner; - _workflowDispatcher = workflowDispatcher; - } - - /// - public override void Configure() - { - Post("/alterations/run"); - ConfigurePermissions("run:alterations"); - } - - /// - public override async Task HandleAsync(Request request, CancellationToken cancellationToken) - { - // Run the alterations. - var results = await _alterationRunner.RunAsync(request.WorkflowInstanceIds, request.Alterations, cancellationToken); - - // Schedule each successfully updated workflow containing scheduled work. - await _workflowDispatcher.DispatchAsync(results, cancellationToken); - - // Write response. - var response = new Response(results); - await SendOkAsync(response, cancellationToken); - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Alterations/Endpoints/Alterations/Run/Request.cs b/src/modules/Elsa.Alterations/Endpoints/Alterations/Run/Request.cs deleted file mode 100644 index 9b661f91ac..0000000000 --- a/src/modules/Elsa.Alterations/Endpoints/Alterations/Run/Request.cs +++ /dev/null @@ -1,20 +0,0 @@ -using Elsa.Alterations.Core.Contracts; -// ReSharper disable CollectionNeverUpdated.Global - -namespace Elsa.Alterations.Endpoints.Alterations.Run; - -/// -/// A plan that contains a list of alterations to be applied to a set of workflow instances. -/// -public class Request -{ - /// - /// The alterations to be applied. - /// - public ICollection Alterations { get; set; } = new List(); - - /// - /// The IDs of the workflow instances that this plan applies to. - /// - public ICollection WorkflowInstanceIds { get; set; } = new List(); -} \ No newline at end of file diff --git a/src/modules/Elsa.Alterations/Endpoints/Alterations/Run/Response.cs b/src/modules/Elsa.Alterations/Endpoints/Alterations/Run/Response.cs deleted file mode 100644 index d2b04d6e31..0000000000 --- a/src/modules/Elsa.Alterations/Endpoints/Alterations/Run/Response.cs +++ /dev/null @@ -1,8 +0,0 @@ -using Elsa.Alterations.Core.Results; - -namespace Elsa.Alterations.Endpoints.Alterations.Run; - -/// -/// The response from the endpoint. -/// -public record Response(ICollection Results); \ No newline at end of file diff --git a/src/modules/Elsa.Alterations/Endpoints/Alterations/Submit/Endpoint.cs b/src/modules/Elsa.Alterations/Endpoints/Alterations/Submit/Endpoint.cs deleted file mode 100644 index e7ba1233fa..0000000000 --- a/src/modules/Elsa.Alterations/Endpoints/Alterations/Submit/Endpoint.cs +++ /dev/null @@ -1,45 +0,0 @@ -using Elsa.Abstractions; -using Elsa.Alterations.Core.Contracts; -using Elsa.Alterations.Core.Models; -using Elsa.Common; -using Elsa.Workflows; -using JetBrains.Annotations; - -namespace Elsa.Alterations.Endpoints.Alterations.Submit; - -/// -/// Submits an alteration plan to be executed targeting workflow instances by a filter. -/// -[PublicAPI] -public class Submit : ElsaEndpoint -{ - private readonly IAlterationPlanScheduler _alterationPlanScheduler; - private readonly IIdentityGenerator _identityGenerator; - private readonly ISystemClock _systemClock; - - /// - public Submit(IAlterationPlanScheduler alterationPlanScheduler, IIdentityGenerator identityGenerator, ISystemClock systemClock) - { - _alterationPlanScheduler = alterationPlanScheduler; - _identityGenerator = identityGenerator; - _systemClock = systemClock; - } - - /// - public override void Configure() - { - Post("/alterations/submit"); - ConfigurePermissions("run:alterations"); - } - - /// - public override async Task HandleAsync(AlterationPlanParams planParams, CancellationToken cancellationToken) - { - // Submit the plan. - var planId = await _alterationPlanScheduler.SubmitAsync(planParams, cancellationToken); - - // Write response. - var response = new Response(planId); - await SendOkAsync(response, cancellationToken); - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Alterations/Endpoints/Alterations/Submit/Response.cs b/src/modules/Elsa.Alterations/Endpoints/Alterations/Submit/Response.cs deleted file mode 100644 index f888d378f0..0000000000 --- a/src/modules/Elsa.Alterations/Endpoints/Alterations/Submit/Response.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace Elsa.Alterations.Endpoints.Alterations.Submit; - -/// -/// The response from the endpoint. -/// -public record Response(string PlanId); \ No newline at end of file diff --git a/src/modules/Elsa.Alterations/Endpoints/Workflows/Retry/Endpoint.cs b/src/modules/Elsa.Alterations/Endpoints/Workflows/Retry/Endpoint.cs deleted file mode 100644 index c690f65ab2..0000000000 --- a/src/modules/Elsa.Alterations/Endpoints/Workflows/Retry/Endpoint.cs +++ /dev/null @@ -1,77 +0,0 @@ -using Elsa.Abstractions; -using Elsa.Alterations.AlterationTypes; -using Elsa.Alterations.Core.Contracts; -using Elsa.Alterations.Core.Results; -using Elsa.Workflows.Management; -using Elsa.Workflows.Management.Entities; -using Elsa.Workflows.Management.Filters; -using Elsa.Workflows.Runtime; -using Elsa.Workflows.Runtime.Contracts; -using Elsa.Workflows.Runtime.Requests; -using JetBrains.Annotations; - -namespace Elsa.Alterations.Endpoints.Workflows.Retry; - -/// -/// Retries the specified workflow instances. -/// -[PublicAPI] -public class Retry : ElsaEndpoint -{ - private readonly IAlterationRunner _alterationRunner; - private readonly IWorkflowDispatcher _workflowDispatcher; - private readonly IWorkflowInstanceStore _workflowInstanceStore; - - /// - public Retry(IAlterationRunner alterationRunner, IWorkflowDispatcher workflowDispatcher, IWorkflowInstanceStore workflowInstanceStore) - { - _alterationRunner = alterationRunner; - _workflowDispatcher = workflowDispatcher; - _workflowInstanceStore = workflowInstanceStore; - } - - /// - public override void Configure() - { - Routes("/alterations/workflows/retry"); - Verbs(FastEndpoints.Http.GET, FastEndpoints.Http.POST); - ConfigurePermissions("run:alterations"); - } - - /// - public override async Task HandleAsync(Request request, CancellationToken cancellationToken) - { - var allResults = new List(); - - // Load each workflow instance. - var workflowInstances = (await _workflowInstanceStore.FindManyAsync(new WorkflowInstanceFilter { Ids = request.WorkflowInstanceIds }, cancellationToken)).ToList(); - - foreach (var workflowInstance in workflowInstances) - { - // Setup an alteration plan. - var activityIds = GetActivityIds(request, workflowInstance).ToList(); - var alterations = activityIds.Select(activityId => new ScheduleActivity { ActivityId = activityId }).Cast().ToList(); - - // Run the plan. - var results = await _alterationRunner.RunAsync(request.WorkflowInstanceIds, alterations, cancellationToken); - allResults.AddRange(results); - - // Schedule updated workflow. - await _workflowDispatcher.DispatchAsync(new DispatchWorkflowInstanceRequest(workflowInstance.Id), cancellationToken: cancellationToken); - } - - // Write response. - var response = new Response(allResults); - await SendOkAsync(response, cancellationToken); - } - - private IEnumerable GetActivityIds(Request request, WorkflowInstance workflowInstance) - { - // If activity IDs are explicitly specified, use them. - if (request.ActivityIds?.Any() == true) - return request.ActivityIds; - - // Otherwise, select IDs of all faulted activities. - return workflowInstance.WorkflowState.Incidents.Select(x => x.ActivityId).Distinct().ToList(); - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Alterations/Endpoints/Workflows/Retry/Request.cs b/src/modules/Elsa.Alterations/Endpoints/Workflows/Retry/Request.cs deleted file mode 100644 index 7539fe3e75..0000000000 --- a/src/modules/Elsa.Alterations/Endpoints/Workflows/Retry/Request.cs +++ /dev/null @@ -1,17 +0,0 @@ -namespace Elsa.Alterations.Endpoints.Workflows.Retry; - -/// -/// A request to retry one or more faulted workflow instances. -/// -public class Request -{ - /// - /// The IDs of the workflow instances that have incidents to be retried. - /// - public ICollection WorkflowInstanceIds { get; set; } = new List(); - - /// - /// An optional list of explicitly specified activity IDs to retry. If omitted, all faulted activities will be retried. - /// - public ICollection? ActivityIds { get; set; } -} \ No newline at end of file diff --git a/src/modules/Elsa.Alterations/Endpoints/Workflows/Retry/Response.cs b/src/modules/Elsa.Alterations/Endpoints/Workflows/Retry/Response.cs deleted file mode 100644 index 99a910c6b5..0000000000 --- a/src/modules/Elsa.Alterations/Endpoints/Workflows/Retry/Response.cs +++ /dev/null @@ -1,8 +0,0 @@ -using Elsa.Alterations.Core.Results; - -namespace Elsa.Alterations.Endpoints.Workflows.Retry; - -/// -/// The response from the endpoint. -/// -public record Response(ICollection Results); \ No newline at end of file diff --git a/src/modules/Elsa.Alterations/Extensions/ModuleExtensions.cs b/src/modules/Elsa.Alterations/Extensions/ModuleExtensions.cs deleted file mode 100644 index 9361504686..0000000000 --- a/src/modules/Elsa.Alterations/Extensions/ModuleExtensions.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Elsa.Alterations.Features; -using Elsa.Extensions; -using Elsa.Features.Services; - -namespace Elsa.Alterations.Extensions; - -/// -/// Adds the . -/// -public static class ModuleExtensions -{ - /// - /// Adds the . - /// - public static IModule UseAlterations(this IModule module, Action? configure = default) - { - return module.Use(configure); - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Alterations/Extensions/ServiceCollectionExtensions.cs b/src/modules/Elsa.Alterations/Extensions/ServiceCollectionExtensions.cs deleted file mode 100644 index b930d28783..0000000000 --- a/src/modules/Elsa.Alterations/Extensions/ServiceCollectionExtensions.cs +++ /dev/null @@ -1,27 +0,0 @@ -using Elsa.Alterations.AlterationHandlers; -using Elsa.Alterations.AlterationTypes; -using Elsa.Alterations.Core.Extensions; -using Elsa.Alterations.Features; -using Microsoft.Extensions.DependencyInjection; - -namespace Elsa.Alterations.Extensions; - -/// -/// Extension methods for . -/// -public static class ServiceCollectionExtensions -{ - /// - /// Adds various alteration handlers. - /// - public static IServiceCollection AddAlterations(this IServiceCollection services) - { - services.AddAlteration(); - services.AddAlteration(); - services.AddAlteration(); - services.AddAlteration(); - services.AddAlteration(); - services.AddNotificationHandlersFrom(); - return services; - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Alterations/Features/AlterationsFeature.cs b/src/modules/Elsa.Alterations/Features/AlterationsFeature.cs deleted file mode 100644 index 426a34109c..0000000000 --- a/src/modules/Elsa.Alterations/Features/AlterationsFeature.cs +++ /dev/null @@ -1,76 +0,0 @@ -using Elsa.Alterations.Core.Contracts; -using Elsa.Alterations.Core.Entities; -using Elsa.Alterations.Core.Extensions; -using Elsa.Alterations.Core.Stores; -using Elsa.Alterations.Extensions; -using Elsa.Alterations.Services; -using Elsa.Alterations.Workflows; -using Elsa.Extensions; -using Elsa.Features.Abstractions; -using Elsa.Features.Services; -using Microsoft.Extensions.DependencyInjection; - -namespace Elsa.Alterations.Features; - -/// -/// Adds the Elsa alterations services. -/// -public class AlterationsFeature : FeatureBase -{ - /// - public AlterationsFeature(IModule module) : base(module) - { - } - - /// - /// Gets or sets the factory for the alteration plan store. - /// - public Func AlterationPlanStoreFactory { get; set; } = sp => sp.GetRequiredService(); - - /// - /// Gets or sets the factory for the alteration job store. - /// - public Func AlterationJobStoreFactory { get; set; } = sp => sp.GetRequiredService(); - - /// - /// Gets or sets the factory for the alteration job dispatcher. - /// - public Func AlterationJobDispatcherFactory { get; set; } = sp => sp.GetRequiredService(); - - /// - /// Adds an alteration and its handler. - /// - /// The type of alteration. - /// The type of alteration handler. - public AlterationsFeature AddAlteration() where T : class, IAlteration where THandler : class, IAlterationHandler - { - Services.AddAlteration(); - return this; - } - - /// - public override void Configure() - { - Module.AddFastEndpointsAssembly(); - Module.AddWorkflow(); - } - - /// - public override void Apply() - { - Services.AddScoped(); - Services.AddAlterations(); - Services.AddAlterationsCore(); - Services.AddScoped(); - Services.AddScoped(); - Services.AddScoped(); - Services.AddScoped(); - - Services.AddMemoryStore(); - Services.AddMemoryStore(); - - Services.AddScoped(AlterationPlanStoreFactory); - Services.AddScoped(AlterationJobStoreFactory); - Services.AddScoped(AlterationJobDispatcherFactory); - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Alterations/Handlers/AlterationJobCompletedHandler.cs b/src/modules/Elsa.Alterations/Handlers/AlterationJobCompletedHandler.cs deleted file mode 100644 index e9b2758e5d..0000000000 --- a/src/modules/Elsa.Alterations/Handlers/AlterationJobCompletedHandler.cs +++ /dev/null @@ -1,27 +0,0 @@ -using Elsa.Alterations.Core.Contracts; -using Elsa.Alterations.Core.Notifications; -using Elsa.Mediator.Contracts; -using JetBrains.Annotations; - -namespace Elsa.Alterations.Handlers; - -/// -/// Handles notifications and updates the plan status if all jobs are completed. -/// -[UsedImplicitly] -public class AlterationJobCompletedHandler(IAlterationPlanManager manager) : INotificationHandler -{ - /// - public async Task HandleAsync(AlterationJobCompleted notification, CancellationToken cancellationToken) - { - var job = notification.Job; - var planId = job.PlanId; - var plan = (await manager.GetPlanAsync(planId, cancellationToken))!; - var allJobsCompleted = await manager.GetIsAllJobsCompletedAsync(planId, cancellationToken); - - if(!allJobsCompleted) - return; - - await manager.CompletePlanAsync(plan, cancellationToken); - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Alterations/Handlers/AlterationPlanCompletedHandler.cs b/src/modules/Elsa.Alterations/Handlers/AlterationPlanCompletedHandler.cs deleted file mode 100644 index f9b6050557..0000000000 --- a/src/modules/Elsa.Alterations/Handlers/AlterationPlanCompletedHandler.cs +++ /dev/null @@ -1,31 +0,0 @@ -using Elsa.Alterations.Bookmarks; -using Elsa.Alterations.Core.Notifications; -using Elsa.Mediator.Contracts; -using Elsa.Workflows; -using Elsa.Workflows.Helpers; -using Elsa.Workflows.Runtime; -using JetBrains.Annotations; - -namespace Elsa.Alterations.Handlers; - -/// -/// Handles notifications and triggers any workflows that are waiting for the plan to complete. -/// -[UsedImplicitly] -public class AlterationPlanCompletedHandler(IBookmarkQueue bookmarkQueue, IStimulusHasher stimulusHasher) : INotificationHandler -{ - /// - public async Task HandleAsync(AlterationPlanCompleted notification, CancellationToken cancellationToken) - { - // Trigger any workflow instances that are waiting for the plan to complete. - var planId = notification.Plan.Id; - var bookmarkPayload = new AlterationPlanCompletedPayload(planId); - var activityTypeName = ActivityTypeNameHelper.GenerateTypeName(); - var item = new NewBookmarkQueueItem - { - ActivityTypeName = activityTypeName, - StimulusHash = stimulusHasher.Hash(activityTypeName, bookmarkPayload) - }; - await bookmarkQueue.EnqueueAsync(item, cancellationToken); - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Alterations/Handlers/ResumeWorkflowInstance.cs b/src/modules/Elsa.Alterations/Handlers/ResumeWorkflowInstance.cs deleted file mode 100644 index 91bb827a45..0000000000 --- a/src/modules/Elsa.Alterations/Handlers/ResumeWorkflowInstance.cs +++ /dev/null @@ -1,43 +0,0 @@ -using Elsa.Alterations.Core.Enums; -using Elsa.Alterations.Core.Notifications; -using Elsa.Mediator.Contracts; -using Elsa.Workflows.Runtime; -using Elsa.Workflows.Runtime.Contracts; -using Elsa.Workflows.Runtime.Requests; -using JetBrains.Annotations; - -namespace Elsa.Alterations.Handlers; - -/// -/// Resumes a workflow instance when an alteration job has been completed and the workflow contains scheduled work. -/// -[UsedImplicitly] -public class ResumeWorkflowInstance : INotificationHandler -{ - private readonly IWorkflowDispatcher _workflowDispatcher; - - /// - /// Initializes a new instance of the class. - /// - public ResumeWorkflowInstance(IWorkflowDispatcher workflowDispatcher) - { - _workflowDispatcher = workflowDispatcher; - } - - /// - public async Task HandleAsync(AlterationJobCompleted notification, CancellationToken cancellationToken) - { - var job = notification.Job; - - // Check if job is completed. - if(job.Status != AlterationJobStatus.Completed) - return; - - // Check if the workflow contains scheduled work. - if(!notification.WorkflowContainsScheduledWork) - return; - - // Resume workflow instance. - await _workflowDispatcher.DispatchAsync(new DispatchWorkflowInstanceRequest(job.WorkflowInstanceId), cancellationToken: cancellationToken); - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Alterations/Middleware/Workflows/RunAlterationsMiddleware.cs b/src/modules/Elsa.Alterations/Middleware/Workflows/RunAlterationsMiddleware.cs deleted file mode 100644 index f412a8cb72..0000000000 --- a/src/modules/Elsa.Alterations/Middleware/Workflows/RunAlterationsMiddleware.cs +++ /dev/null @@ -1,58 +0,0 @@ -using Elsa.Alterations.Core.Contexts; -using Elsa.Alterations.Core.Contracts; -using Elsa.Alterations.Core.Models; -using Elsa.Extensions; -using Elsa.Workflows; -using Elsa.Workflows.Pipelines.WorkflowExecution; - -namespace Elsa.Alterations.Middleware.Workflows; - -/// -/// Middleware that runs alterations. -/// -internal class RunAlterationsMiddleware(WorkflowMiddlewareDelegate next, IEnumerable handlers) : WorkflowExecutionMiddleware(next) -{ - public static readonly object AlterationsPropertyKey = new(); - public static readonly object AlterationsLogPropertyKey = new(); - - public override async ValueTask InvokeAsync(WorkflowExecutionContext context) - { - var alterations = (IEnumerable)(context.TransientProperties.GetValue(AlterationsPropertyKey) ?? throw new InvalidOperationException("No alterations found in the transient properties.")); - var log = (AlterationLog)(context.TransientProperties.GetValue(AlterationsLogPropertyKey) ?? throw new InvalidOperationException("No alteration log found in the transient properties.")); - await RunAsync(context, alterations, log, context.CancellationToken); - } - - private async Task RunAsync(WorkflowExecutionContext workflowExecutionContext, IEnumerable alterations, AlterationLog log, CancellationToken cancellationToken = default) - { - var commitActions = new List>(); - - foreach (var alteration in alterations) - { - // Find handlers. - var supportedHandlers = handlers.Where(x => x.CanHandle(alteration)).ToList(); - - foreach (var handler in supportedHandlers) - { - // Execute handler. - var alterationContext = new AlterationContext(alteration, workflowExecutionContext, log, cancellationToken); - await handler.HandleAsync(alterationContext); - - // If the handler has failed, exit. - if (alterationContext.HasFailed) - return; - - // Collect the commit handler, if any. - if (alterationContext.CommitAction != null) - commitActions.Add(alterationContext.CommitAction); - } - } - - // Execute commit handlers. - foreach (var commitAction in commitActions) - await commitAction(); - - // Add alteration logs to the workflow execution log. - foreach (var alterationLogEntry in log.LogEntries) - workflowExecutionContext.AddExecutionLogEntry(alterationLogEntry.EventName ?? alterationLogEntry.Message, alterationLogEntry.Message); - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Alterations/Services/AlterationPlanManager.cs b/src/modules/Elsa.Alterations/Services/AlterationPlanManager.cs deleted file mode 100644 index 23e054216f..0000000000 --- a/src/modules/Elsa.Alterations/Services/AlterationPlanManager.cs +++ /dev/null @@ -1,43 +0,0 @@ -using Elsa.Alterations.Core.Contracts; -using Elsa.Alterations.Core.Entities; -using Elsa.Alterations.Core.Enums; -using Elsa.Alterations.Core.Filters; -using Elsa.Alterations.Core.Notifications; -using Elsa.Common; -using Elsa.Mediator.Contracts; - -namespace Elsa.Alterations.Services; - -/// -public class AlterationPlanManager(IAlterationPlanStore planStore, IAlterationJobStore jobStore, ISystemClock systemClock, INotificationSender notificationSender) : IAlterationPlanManager -{ - /// - public async Task GetPlanAsync(string planId, CancellationToken cancellationToken = default) - { - var planFilter = new AlterationPlanFilter { Id = planId }; - return await planStore.FindAsync(planFilter, cancellationToken); - } - - /// - public async Task GetIsAllJobsCompletedAsync(string planId, CancellationToken cancellationToken = default) - { - // Check if all jobs are completed. - var jobFilter = new AlterationJobFilter - { - PlanId = planId, - Statuses = [AlterationJobStatus.Pending, AlterationJobStatus.Running] - }; - - return await jobStore.CountAsync(jobFilter, cancellationToken) == 0; - } - - /// - public async Task CompletePlanAsync(AlterationPlan plan, CancellationToken cancellationToken = default) - { - plan.Status = AlterationPlanStatus.Completed; - plan.CompletedAt = systemClock.UtcNow; - - await planStore.SaveAsync(plan, cancellationToken); - await notificationSender.SendAsync(new AlterationPlanCompleted(plan), cancellationToken); - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Alterations/Services/BackgroundAlterationJobDispatcher.cs b/src/modules/Elsa.Alterations/Services/BackgroundAlterationJobDispatcher.cs deleted file mode 100644 index 65e3b9ace7..0000000000 --- a/src/modules/Elsa.Alterations/Services/BackgroundAlterationJobDispatcher.cs +++ /dev/null @@ -1,34 +0,0 @@ -using Elsa.Alterations.Core.Contracts; -using Elsa.Mediator.Contracts; - -namespace Elsa.Alterations.Services; - -/// -/// Dispatches an alteration job for execution using an in-memory channel. -/// -public class BackgroundAlterationJobDispatcher : IAlterationJobDispatcher -{ - private readonly IJobQueue _jobQueue; - private readonly IAlterationJobRunner _alterationJobRunner; - - /// - /// Initializes a new instance of the class. - /// - public BackgroundAlterationJobDispatcher(IJobQueue jobQueue, IAlterationJobRunner alterationJobRunner) - { - _jobQueue = jobQueue; - _alterationJobRunner = alterationJobRunner; - } - - /// - public ValueTask DispatchAsync(string jobId, CancellationToken cancellationToken = default) - { - _jobQueue.Enqueue(ct => ExecuteJobAsync(jobId, ct)); - return default; - } - - private async Task ExecuteJobAsync(string alterationJobId, CancellationToken cancellationToken) - { - await _alterationJobRunner.RunAsync(alterationJobId, cancellationToken); - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Alterations/Services/DefaultAlterationJobRunner.cs b/src/modules/Elsa.Alterations/Services/DefaultAlterationJobRunner.cs deleted file mode 100644 index 020d970a35..0000000000 --- a/src/modules/Elsa.Alterations/Services/DefaultAlterationJobRunner.cs +++ /dev/null @@ -1,58 +0,0 @@ -using Elsa.Alterations.Core.Contracts; -using Elsa.Alterations.Core.Entities; -using Elsa.Alterations.Core.Enums; -using Elsa.Alterations.Core.Filters; -using Elsa.Alterations.Core.Notifications; -using Elsa.Common; -using Elsa.Mediator.Contracts; - -namespace Elsa.Alterations.Services; - -/// -public class DefaultAlterationJobRunner : IAlterationJobRunner -{ - private readonly IAlterationPlanStore _alterationPlanStore; - private readonly IAlterationJobStore _alterationJobStore; - private readonly IAlterationRunner _alterationRunner; - private readonly INotificationSender _notificationSender; - private readonly ISystemClock _systemClock; - - /// - /// Initializes a new instance of the class. - /// - public DefaultAlterationJobRunner( - IAlterationPlanStore alterationPlanStore, - IAlterationJobStore alterationJobStore, - IAlterationRunner alterationRunner, - INotificationSender notificationSender, - ISystemClock systemClock) - { - _alterationPlanStore = alterationPlanStore; - _alterationJobStore = alterationJobStore; - _alterationRunner = alterationRunner; - _notificationSender = notificationSender; - _systemClock = systemClock; - } - - /// - public async Task RunAsync(string jobId, CancellationToken cancellationToken = default) - { - var job = (await _alterationJobStore.FindAsync(new AlterationJobFilter { Id = jobId }, cancellationToken))!; - var plan = (await _alterationPlanStore.FindAsync(new AlterationPlanFilter { Id = job.PlanId }, cancellationToken))!; - var workflowInstanceId = job.WorkflowInstanceId; - - job.Status = AlterationJobStatus.Running; - job.StartedAt = _systemClock.UtcNow; - await _alterationJobStore.SaveAsync(job, cancellationToken); - - var result = await _alterationRunner.RunAsync(workflowInstanceId, plan.Alterations, cancellationToken); - - job.Status = result.IsSuccessful ? AlterationJobStatus.Completed : AlterationJobStatus.Failed; - job.Log = result.Log.LogEntries.ToList(); - job.CompletedAt = _systemClock.UtcNow; - await _alterationJobStore.SaveAsync(job, cancellationToken); - await _notificationSender.SendAsync(new AlterationJobCompleted(job, result.WorkflowHasScheduledWork), cancellationToken); - - return job; - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Alterations/Services/DefaultAlterationPlanScheduler.cs b/src/modules/Elsa.Alterations/Services/DefaultAlterationPlanScheduler.cs deleted file mode 100644 index 4ab30f434c..0000000000 --- a/src/modules/Elsa.Alterations/Services/DefaultAlterationPlanScheduler.cs +++ /dev/null @@ -1,59 +0,0 @@ -using Elsa.Alterations.Core.Contracts; -using Elsa.Alterations.Core.Models; -using Elsa.Alterations.Workflows; -using Elsa.Common; -using Elsa.Common.Models; -using Elsa.Workflows; -using Elsa.Workflows.Management; -using Elsa.Workflows.Runtime; -using Elsa.Workflows.Runtime.Contracts; -using Elsa.Workflows.Runtime.Requests; - -namespace Elsa.Alterations.Services; - -/// -/// Stores the new plan and schedules it for immediate execution. -/// -public class DefaultAlterationPlanScheduler : IAlterationPlanScheduler -{ - private readonly IWorkflowDefinitionService _workflowDefinitionService; - private readonly IWorkflowDispatcher _workflowDispatcher; - private readonly IIdentityGenerator _identityGenerator; - private readonly IJsonSerializer _jsonSerializer; - - /// - /// Initializes a new instance of the class. - /// - public DefaultAlterationPlanScheduler(IWorkflowDefinitionService workflowDefinitionService, IWorkflowDispatcher workflowDispatcher, IIdentityGenerator identityGenerator, IJsonSerializer jsonSerializer) - { - _workflowDefinitionService = workflowDefinitionService; - _workflowDispatcher = workflowDispatcher; - _identityGenerator = identityGenerator; - _jsonSerializer = jsonSerializer; - } - - /// - public async Task SubmitAsync(AlterationPlanParams planParams, CancellationToken cancellationToken = default) - { - if(string.IsNullOrWhiteSpace(planParams.Id)) - planParams.Id = _identityGenerator.GenerateId(); - - var definitionId = ExecuteAlterationPlanWorkflow.WorkflowDefinitionId; - var workflowGraph = await _workflowDefinitionService.FindWorkflowGraphAsync(definitionId, VersionOptions.Published, cancellationToken); - - if (workflowGraph == null) - throw new($"Workflow definition with ID '{definitionId}' not found"); - - var serializedPlan = _jsonSerializer.Serialize(planParams); - var request = new DispatchWorkflowDefinitionRequest(workflowGraph.Workflow.Identity.Id) - { - Input = new Dictionary - { - ["Plan"] = serializedPlan - } - }; - await _workflowDispatcher.DispatchAsync(request, cancellationToken); - - return planParams.Id; - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Alterations/Services/DefaultAlterationRunner.cs b/src/modules/Elsa.Alterations/Services/DefaultAlterationRunner.cs deleted file mode 100644 index 71317a1883..0000000000 --- a/src/modules/Elsa.Alterations/Services/DefaultAlterationRunner.cs +++ /dev/null @@ -1,93 +0,0 @@ -using Elsa.Alterations.Core.Contracts; -using Elsa.Alterations.Core.Models; -using Elsa.Alterations.Core.Results; -using Elsa.Alterations.Middleware.Workflows; -using Elsa.Common; -using Elsa.Workflows; -using Elsa.Workflows.Management; -using Elsa.Workflows.Pipelines.WorkflowExecution; -using Elsa.Workflows.Runtime; -using Microsoft.Extensions.Logging; - -namespace Elsa.Alterations.Services; - -/// -public class DefaultAlterationRunner( - IWorkflowRuntime workflowRuntime, - IWorkflowExecutionPipeline workflowExecutionPipeline, - IWorkflowDefinitionService workflowDefinitionService, - IWorkflowStateExtractor workflowStateExtractor, - ISystemClock systemClock, - IServiceProvider serviceProvider) - : IAlterationRunner -{ - /// - public async Task> RunAsync(IEnumerable workflowInstanceIds, IEnumerable alterations, CancellationToken cancellationToken = default) - { - var results = new List(); - var alterationList = alterations as ICollection ?? alterations.ToList(); - - foreach (var workflowInstanceId in workflowInstanceIds) - { - var result = await RunAsync(workflowInstanceId, alterationList, cancellationToken); - results.Add(result); - } - - return results; - } - - /// - public async Task RunAsync(string workflowInstanceId, IEnumerable alterations, CancellationToken cancellationToken = default) - { - var log = new AlterationLog(systemClock); - var result = new RunAlterationsResult(workflowInstanceId, log); - var workflowClient = await workflowRuntime.CreateClientAsync(workflowInstanceId, cancellationToken: cancellationToken); - - // Load workflow instance. - var workflowState = await workflowClient.ExportStateAsync(cancellationToken); - - if (workflowState == null) - { - log.Add($"Workflow instance with ID '{workflowInstanceId}' not found.", LogLevel.Error); - return result; - } - - // Load workflow definition. - var workflowGraph = await workflowDefinitionService.FindWorkflowGraphAsync(workflowState.DefinitionVersionId, cancellationToken); - - if (workflowGraph == null) - { - log.Add($"Workflow definition with ID '{workflowState.DefinitionVersionId}' not found.", LogLevel.Error); - return result; - } - - // Create workflow execution context. - var workflowExecutionContext = await WorkflowExecutionContext.CreateAsync(serviceProvider, workflowGraph, workflowState, cancellationToken: cancellationToken); - workflowExecutionContext.TransientProperties.Add(RunAlterationsMiddleware.AlterationsPropertyKey, alterations); - workflowExecutionContext.TransientProperties.Add(RunAlterationsMiddleware.AlterationsLogPropertyKey, log); - - // Build a new workflow execution pipeline. - var pipelineBuilder = new WorkflowExecutionPipelineBuilder(serviceProvider); - workflowExecutionPipeline.ConfigurePipelineBuilder(pipelineBuilder); - - // Replace the terminal DefaultActivitySchedulerMiddleware with the RunAlterationsMiddleware terminal. - pipelineBuilder.ReplaceTerminal(); - - // Build modified pipeline. - var pipeline = pipelineBuilder.Build(); - - // Execute the pipeline. - await pipeline(workflowExecutionContext); - - // Extract workflow state. - workflowState = workflowStateExtractor.Extract(workflowExecutionContext); - - // Apply updated workflow state. - await workflowClient.ImportStateAsync(workflowState, cancellationToken); - - // Check if the workflow has scheduled work. - result.WorkflowHasScheduledWork = workflowExecutionContext.Scheduler.HasAny; - - return result; - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Alterations/Workflows/ExecuteAlterationPlanWorkflow.cs b/src/modules/Elsa.Alterations/Workflows/ExecuteAlterationPlanWorkflow.cs deleted file mode 100644 index 0994c79ea7..0000000000 --- a/src/modules/Elsa.Alterations/Workflows/ExecuteAlterationPlanWorkflow.cs +++ /dev/null @@ -1,48 +0,0 @@ -using Elsa.Alterations.Activities; -using Elsa.Alterations.Core.Models; -using Elsa.Extensions; -using Elsa.Workflows; -using Elsa.Workflows.Activities; - -namespace Elsa.Alterations.Workflows; - -/// -/// Executes an alteration plan. -/// -public class ExecuteAlterationPlanWorkflow : WorkflowBase -{ - internal const string WorkflowDefinitionId = "Elsa.Alterations.ExecuteAlterationPlan"; - - /// - protected override void Build(IWorkflowBuilder builder) - { - builder.WithDefinitionId(WorkflowDefinitionId); - builder.AsSystemWorkflow(); - var plan = builder.WithInput("Plan", "The parameters for the new plan"); - var planId = builder.WithVariable(); - var jobCount = builder.WithVariable(); - - builder.Root = new Sequence - { - Activities = - { - new SubmitAlterationPlan - { - Params = new(context => context.GetInput(plan)!), - Result = new(planId) - }, - new Correlate(planId), - new GenerateAlterationJobs(planId) - { - Result = new(jobCount) - }, - new If(context => jobCount.Get(context) > 0) - { - Then = new DispatchAlterationJobs(planId), - Else = new CompleteAlterationPlan(planId) - }, - new AlterationPlanCompleted(planId), - } - }; - } -} \ No newline at end of file diff --git a/src/modules/Elsa.CSharp/Elsa.CSharp.csproj b/src/modules/Elsa.CSharp/Elsa.CSharp.csproj deleted file mode 100644 index 30083f4704..0000000000 --- a/src/modules/Elsa.CSharp/Elsa.CSharp.csproj +++ /dev/null @@ -1,20 +0,0 @@ - - - - - Provides a CSharp expression provider. - - elsa module expressions scripting csharp - - - - - - - - - - - - - diff --git a/src/modules/Elsa.Caching.Distributed.MassTransit/Consumers/TriggerChangeTokenSignalConsumer.cs b/src/modules/Elsa.Caching.Distributed.MassTransit/Consumers/TriggerChangeTokenSignalConsumer.cs deleted file mode 100644 index 969533573f..0000000000 --- a/src/modules/Elsa.Caching.Distributed.MassTransit/Consumers/TriggerChangeTokenSignalConsumer.cs +++ /dev/null @@ -1,20 +0,0 @@ -using Elsa.Caching.Distributed.MassTransit.Messages; -using JetBrains.Annotations; -using MassTransit; - -namespace Elsa.Caching.Distributed.MassTransit.Consumers; - -/// -/// Consumes messages and triggers the change token signal. -/// -[UsedImplicitly] -public class TriggerChangeTokenSignalConsumer(IChangeTokenSignalInvoker changeTokenSignalInvoker) : IConsumer -{ - /// - public async Task Consume(ConsumeContext context) - { - var message = context.Message; - var cancellationToken = context.CancellationToken; - await changeTokenSignalInvoker.TriggerTokenAsync(message.Key, cancellationToken); - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Caching.Distributed.MassTransit/Elsa.Caching.Distributed.MassTransit.csproj b/src/modules/Elsa.Caching.Distributed.MassTransit/Elsa.Caching.Distributed.MassTransit.csproj deleted file mode 100644 index 16d6c0db77..0000000000 --- a/src/modules/Elsa.Caching.Distributed.MassTransit/Elsa.Caching.Distributed.MassTransit.csproj +++ /dev/null @@ -1,16 +0,0 @@ - - - - - Provides distributed caching services leveraging MassTransit for transport of signals. - - elsa module distributed caching masstransit - - - - - - - - - diff --git a/src/modules/Elsa.Caching.Distributed.MassTransit/Extensions/ModuleExtensions.cs b/src/modules/Elsa.Caching.Distributed.MassTransit/Extensions/ModuleExtensions.cs deleted file mode 100644 index 861da8c1e2..0000000000 --- a/src/modules/Elsa.Caching.Distributed.MassTransit/Extensions/ModuleExtensions.cs +++ /dev/null @@ -1,29 +0,0 @@ -using Elsa.Caching.Distributed.Features; -using Elsa.Caching.Distributed.MassTransit.Features; -using Elsa.Caching.Features; - -// ReSharper disable once CheckNamespace -namespace Elsa.Extensions; - -/// -/// Provides methods to install and configure the distributed caching feature with MassTransit. -/// -public static class ModuleExtensions -{ - /// - /// Configures the distributed caching feature to use MassTransit. - /// - public static MassTransitDistributedCacheFeature UseMassTransit(this DistributedCacheFeature distributedCacheFeature, Action? configure = default) - { - return distributedCacheFeature.Module.Configure(configure); - } - - /// - /// Configures the memory caching feature with the distributed caching feature that uses MassTransit. - /// - public static MemoryCacheFeature UseMassTransit(this MemoryCacheFeature memoryCacheFeature, Action? configure = default) - { - memoryCacheFeature.Module.Configure(configure); - return memoryCacheFeature; - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Caching.Distributed.MassTransit/Features/MassTransitDistributedCacheFeature.cs b/src/modules/Elsa.Caching.Distributed.MassTransit/Features/MassTransitDistributedCacheFeature.cs deleted file mode 100644 index f325911b65..0000000000 --- a/src/modules/Elsa.Caching.Distributed.MassTransit/Features/MassTransitDistributedCacheFeature.cs +++ /dev/null @@ -1,32 +0,0 @@ -using Elsa.Caching.Distributed.Features; -using Elsa.Caching.Distributed.MassTransit.Consumers; -using Elsa.Caching.Distributed.MassTransit.Services; -using Elsa.Extensions; -using Elsa.Features.Abstractions; -using Elsa.Features.Attributes; -using Elsa.Features.Services; -using Elsa.MassTransit.Features; -using Microsoft.Extensions.DependencyInjection; - -namespace Elsa.Caching.Distributed.MassTransit.Features; - -/// -/// Configures distributed cache management with MassTransit. -/// -[DependsOn(typeof(DistributedCacheFeature))] -[DependsOn(typeof(MassTransitFeature))] -public class MassTransitDistributedCacheFeature(IModule module) : FeatureBase(module) -{ - /// - public override void Configure() - { - Module.AddMassTransitConsumer("elsa-trigger-change-token-signal", true, true); - Module.Use(feature => feature.WithChangeTokenSignalPublisher(sp => sp.GetRequiredService())); - } - - /// - public override void Apply() - { - Services.AddSingleton(); - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Caching.Distributed.MassTransit/FodyWeavers.xml b/src/modules/Elsa.Caching.Distributed.MassTransit/FodyWeavers.xml deleted file mode 100644 index 00e1d9a1c1..0000000000 --- a/src/modules/Elsa.Caching.Distributed.MassTransit/FodyWeavers.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/src/modules/Elsa.Caching.Distributed.MassTransit/Messages/TriggerChangeTokenSignal.cs b/src/modules/Elsa.Caching.Distributed.MassTransit/Messages/TriggerChangeTokenSignal.cs deleted file mode 100644 index 600f3aa287..0000000000 --- a/src/modules/Elsa.Caching.Distributed.MassTransit/Messages/TriggerChangeTokenSignal.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace Elsa.Caching.Distributed.MassTransit.Messages; - -/// -/// Represents a message containing a signal to trigger a change token. -/// -/// The key of the change token to trigger. -public record TriggerChangeTokenSignal(string Key); \ No newline at end of file diff --git a/src/modules/Elsa.Caching.Distributed.MassTransit/Services/MassTransitChangeTokenSignalPublisher.cs b/src/modules/Elsa.Caching.Distributed.MassTransit/Services/MassTransitChangeTokenSignalPublisher.cs deleted file mode 100644 index 984dc164b7..0000000000 --- a/src/modules/Elsa.Caching.Distributed.MassTransit/Services/MassTransitChangeTokenSignalPublisher.cs +++ /dev/null @@ -1,18 +0,0 @@ -using Elsa.Caching.Distributed.Contracts; -using Elsa.Caching.Distributed.MassTransit.Messages; -using MassTransit; - -namespace Elsa.Caching.Distributed.MassTransit.Services; - -/// -/// Represents a service that publishes change token signals using MassTransit. -/// -public class MassTransitChangeTokenSignalPublisher(IBus bus) : IChangeTokenSignalPublisher -{ - /// - public async ValueTask PublishAsync(string key, CancellationToken cancellationToken = default) - { - var message = new TriggerChangeTokenSignal(key); - await bus.Publish(message, cancellationToken); - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Caching.Distributed.ProtoActor/Actors/LocalCache.cs b/src/modules/Elsa.Caching.Distributed.ProtoActor/Actors/LocalCache.cs deleted file mode 100644 index b08b899610..0000000000 --- a/src/modules/Elsa.Caching.Distributed.ProtoActor/Actors/LocalCache.cs +++ /dev/null @@ -1,22 +0,0 @@ -using Elsa.Caching.Distributed.ProtoActor.ProtoBuf; -using Proto; -using Proto.Cluster; -using Proto.Cluster.PubSub; - -namespace Elsa.Caching.Distributed.ProtoActor.Actors; - -internal class LocalCache(IContext context, IChangeTokenSignalInvoker changeTokenSignaler) : LocalCacheBase(context) -{ - public override async Task OnStopped() - { - await Cluster.Unsubscribe(Topics.ChangeTokenSignals, Context.ClusterIdentity()!); - } - - public override async Task OnReceive() - { - if (Context.Message is ProtoTriggerChangeTokenSignal triggerChangeTokenSignal) - { - await changeTokenSignaler.TriggerTokenAsync(triggerChangeTokenSignal.Key, Context.CancellationToken); - } - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Caching.Distributed.ProtoActor/Elsa.Caching.Distributed.ProtoActor.csproj b/src/modules/Elsa.Caching.Distributed.ProtoActor/Elsa.Caching.Distributed.ProtoActor.csproj deleted file mode 100644 index 14e99317b9..0000000000 --- a/src/modules/Elsa.Caching.Distributed.ProtoActor/Elsa.Caching.Distributed.ProtoActor.csproj +++ /dev/null @@ -1,27 +0,0 @@ - - - - - Provides distributed caching services leveraging Proto.Actor for transport of signals. - - elsa module distributed caching proto.actor - - - - - - - - - - - - - - - - - - - - diff --git a/src/modules/Elsa.Caching.Distributed.ProtoActor/Extensions/ClusterExtensions.cs b/src/modules/Elsa.Caching.Distributed.ProtoActor/Extensions/ClusterExtensions.cs deleted file mode 100644 index 7a70312bd8..0000000000 --- a/src/modules/Elsa.Caching.Distributed.ProtoActor/Extensions/ClusterExtensions.cs +++ /dev/null @@ -1,15 +0,0 @@ -using Elsa.Caching.Distributed.ProtoActor.ProtoBuf; -using Proto.Cluster; - -// ReSharper disable once CheckNamespace -namespace Elsa.Extensions; - -internal static class ClusterExtensions -{ - private static readonly string ActorId = Guid.NewGuid().ToString(); - - public static LocalCacheClient GetLocalCacheClient(this Cluster cluster) - { - return cluster.GetLocalCache($"{nameof(LocalCacheActor)}-{ActorId}"); - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Caching.Distributed.ProtoActor/Extensions/ProtoActorDistributedCacheFeatureExtensions.cs b/src/modules/Elsa.Caching.Distributed.ProtoActor/Extensions/ProtoActorDistributedCacheFeatureExtensions.cs deleted file mode 100644 index a657409c1c..0000000000 --- a/src/modules/Elsa.Caching.Distributed.ProtoActor/Extensions/ProtoActorDistributedCacheFeatureExtensions.cs +++ /dev/null @@ -1,22 +0,0 @@ -using Elsa.Caching.Distributed.Features; -using Elsa.Caching.Distributed.ProtoActor.Features; -using JetBrains.Annotations; - -// ReSharper disable once CheckNamespace -namespace Elsa.Extensions; - -/// -/// Provides extension methods on . -/// -[PublicAPI] -public static class ProtoActorDistributedCacheFeatureExtensions -{ - /// - /// Configure the distributed cache feature using Proto.Actor. - /// - public static DistributedCacheFeature UseProtoActor(this DistributedCacheFeature feature, Action? configure = default) - { - feature.Module.Configure(configure); - return feature; - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Caching.Distributed.ProtoActor/Features/ProtoActorDistributedCacheFeature.cs b/src/modules/Elsa.Caching.Distributed.ProtoActor/Features/ProtoActorDistributedCacheFeature.cs deleted file mode 100644 index 476aa74f6f..0000000000 --- a/src/modules/Elsa.Caching.Distributed.ProtoActor/Features/ProtoActorDistributedCacheFeature.cs +++ /dev/null @@ -1,53 +0,0 @@ -using Elsa.Caching.Distributed.Features; -using Elsa.Caching.Distributed.ProtoActor.Actors; -using Elsa.Caching.Distributed.ProtoActor.HostedServices; -using Elsa.Caching.Distributed.ProtoActor.ProtoBuf; -using Elsa.Caching.Distributed.ProtoActor.Providers; -using Elsa.Caching.Distributed.ProtoActor.Services; -using Elsa.Features.Abstractions; -using Elsa.Features.Attributes; -using Elsa.Features.Services; -using Elsa.ProtoActor; -using Microsoft.Extensions.DependencyInjection; - -namespace Elsa.Caching.Distributed.ProtoActor.Features; - -/// -/// Installs the Proto Actor feature to host & execute workflow instances. -/// -[DependsOn(typeof(DistributedCacheFeature))] -public class ProtoActorDistributedCacheFeature : FeatureBase -{ - /// - public ProtoActorDistributedCacheFeature(IModule module) : base(module) - { - } - - /// - public override void Configure() - { - // Configure runtime with ProtoActor workflow runtime. - Module.Configure().WithChangeTokenSignalPublisher(sp => ActivatorUtilities.CreateInstance(sp)); - } - - public override void ConfigureHostedServices() - { - ConfigureHostedService(); - } - - /// - public override void Apply() - { - var services = Services; - - // Actor providers. - services.AddSingleton(); - - // Actors. - services - .AddTransient(sp => new LocalCacheActor((context, _) => ActivatorUtilities.CreateInstance(sp, context))); - - // Distributed runtime. - services.AddSingleton(); - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Caching.Distributed.ProtoActor/FodyWeavers.xml b/src/modules/Elsa.Caching.Distributed.ProtoActor/FodyWeavers.xml deleted file mode 100644 index 00e1d9a1c1..0000000000 --- a/src/modules/Elsa.Caching.Distributed.ProtoActor/FodyWeavers.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/src/modules/Elsa.Caching.Distributed.ProtoActor/HostedServices/StartLocalCacheActor.cs b/src/modules/Elsa.Caching.Distributed.ProtoActor/HostedServices/StartLocalCacheActor.cs deleted file mode 100644 index e646b1a715..0000000000 --- a/src/modules/Elsa.Caching.Distributed.ProtoActor/HostedServices/StartLocalCacheActor.cs +++ /dev/null @@ -1,22 +0,0 @@ -using Elsa.Caching.Distributed.ProtoActor.ProtoBuf; -using JetBrains.Annotations; -using Microsoft.Extensions.Hosting; -using Proto.Cluster; -using Proto.Cluster.PubSub; - -namespace Elsa.Caching.Distributed.ProtoActor.HostedServices; - -/// -/// Subscribes the LocalCacheActor to the "change-token-signals" topic. -/// -[UsedImplicitly] -public class StartLocalCacheActor(Cluster cluster) : BackgroundService -{ - private static readonly string ActorName = Guid.NewGuid().ToString(); - private readonly ClusterIdentity _clusterIdentity = ClusterIdentity.Create(ActorName, LocalCacheActor.Kind); - - protected override async Task ExecuteAsync(CancellationToken stoppingToken) - { - await cluster.Subscribe(Topics.ChangeTokenSignals, _clusterIdentity, stoppingToken); - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Caching.Distributed.ProtoActor/Proto/LocalCache.Messages.proto b/src/modules/Elsa.Caching.Distributed.ProtoActor/Proto/LocalCache.Messages.proto deleted file mode 100644 index 2b46598836..0000000000 --- a/src/modules/Elsa.Caching.Distributed.ProtoActor/Proto/LocalCache.Messages.proto +++ /dev/null @@ -1,7 +0,0 @@ -syntax = "proto3"; -option csharp_namespace = "Elsa.Caching.Distributed.ProtoActor.ProtoBuf"; -package Elsa.Caching.Distributed.ProtoActor.ProtoBuf; - -message ProtoTriggerChangeTokenSignal { - string Key = 1; -} \ No newline at end of file diff --git a/src/modules/Elsa.Caching.Distributed.ProtoActor/Proto/LocalCache.proto b/src/modules/Elsa.Caching.Distributed.ProtoActor/Proto/LocalCache.proto deleted file mode 100644 index 2cb60bb31c..0000000000 --- a/src/modules/Elsa.Caching.Distributed.ProtoActor/Proto/LocalCache.proto +++ /dev/null @@ -1,6 +0,0 @@ -syntax = "proto3"; -option csharp_namespace = "Elsa.Caching.Distributed.ProtoActor.ProtoBuf"; -package Elsa.Caching.Distributed.ProtoActor.ProtoBuf; - -service LocalCache { -} \ No newline at end of file diff --git a/src/modules/Elsa.Caching.Distributed.ProtoActor/Providers/LocalCacheVirtualActorProvider.cs b/src/modules/Elsa.Caching.Distributed.ProtoActor/Providers/LocalCacheVirtualActorProvider.cs deleted file mode 100644 index e94664730f..0000000000 --- a/src/modules/Elsa.Caching.Distributed.ProtoActor/Providers/LocalCacheVirtualActorProvider.cs +++ /dev/null @@ -1,23 +0,0 @@ -using Elsa.Caching.Distributed.ProtoActor.ProtoBuf; -using Elsa.ProtoActor; -using Elsa.ProtoActor.MemberStrategies; -using Google.Protobuf.Reflection; -using Proto; -using Proto.Cluster; -using Proto.DependencyInjection; - -namespace Elsa.Caching.Distributed.ProtoActor.Providers; - -public class LocalCacheVirtualActorProvider : VirtualActorsProviderBase -{ - public override IEnumerable GetClusterKinds(ActorSystem system) - { - var props = system.DI().PropsFor(); - yield return new ClusterKind(LocalCacheActor.Kind, props).WithMemberStrategy(cluster => new LocalNodeStrategy(cluster)); - } - - public override IEnumerable GetFileDescriptors() - { - yield return LocalCacheMessagesReflection.Descriptor; - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Caching.Distributed.ProtoActor/Services/ProtoActorChangeTokenSignalPublisher.cs b/src/modules/Elsa.Caching.Distributed.ProtoActor/Services/ProtoActorChangeTokenSignalPublisher.cs deleted file mode 100644 index 8e6d5edcc6..0000000000 --- a/src/modules/Elsa.Caching.Distributed.ProtoActor/Services/ProtoActorChangeTokenSignalPublisher.cs +++ /dev/null @@ -1,18 +0,0 @@ -using Elsa.Caching.Distributed.Contracts; -using Elsa.Caching.Distributed.ProtoActor.ProtoBuf; -using Proto.Cluster; -using Proto.Cluster.PubSub; - -namespace Elsa.Caching.Distributed.ProtoActor.Services; - -public class ProtoActorChangeTokenSignalPublisher(Cluster cluster) : IChangeTokenSignalPublisher -{ - public async ValueTask PublishAsync(string key, CancellationToken cancellationToken = default) - { - var message = new ProtoTriggerChangeTokenSignal - { - Key = key - }; - await cluster.Publisher().Publish(Topics.ChangeTokenSignals, message, cancellationToken); - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Caching.Distributed.ProtoActor/Topics.cs b/src/modules/Elsa.Caching.Distributed.ProtoActor/Topics.cs deleted file mode 100644 index 193e9e1079..0000000000 --- a/src/modules/Elsa.Caching.Distributed.ProtoActor/Topics.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace Elsa.Caching.Distributed.ProtoActor; - -internal static class Topics -{ - public const string ChangeTokenSignals = "change-token-signals"; -} \ No newline at end of file diff --git a/src/modules/Elsa.Caching.Distributed/Contracts/IChangeTokenSignalPublisher.cs b/src/modules/Elsa.Caching.Distributed/Contracts/IChangeTokenSignalPublisher.cs deleted file mode 100644 index f7d7faf41f..0000000000 --- a/src/modules/Elsa.Caching.Distributed/Contracts/IChangeTokenSignalPublisher.cs +++ /dev/null @@ -1,12 +0,0 @@ -namespace Elsa.Caching.Distributed.Contracts; - -/// -/// Represents a service that can publish change token signals. -/// -public interface IChangeTokenSignalPublisher -{ - /// - /// Publishes a change token signal for the specified key. - /// - ValueTask PublishAsync(string key, CancellationToken cancellationToken = default); -} \ No newline at end of file diff --git a/src/modules/Elsa.Caching.Distributed/Elsa.Caching.Distributed.csproj b/src/modules/Elsa.Caching.Distributed/Elsa.Caching.Distributed.csproj deleted file mode 100644 index c2a63e1302..0000000000 --- a/src/modules/Elsa.Caching.Distributed/Elsa.Caching.Distributed.csproj +++ /dev/null @@ -1,15 +0,0 @@ - - - - - Provides distributed caching services and utility functions common to Elsa modules. - - elsa module caching distributed - - - - - - - - diff --git a/src/modules/Elsa.Caching.Distributed/Extensions/ModuleExtensions.cs b/src/modules/Elsa.Caching.Distributed/Extensions/ModuleExtensions.cs deleted file mode 100644 index 3d128201bd..0000000000 --- a/src/modules/Elsa.Caching.Distributed/Extensions/ModuleExtensions.cs +++ /dev/null @@ -1,20 +0,0 @@ -using Elsa.Caching.Distributed.Features; -using Elsa.Features.Services; - -// ReSharper disable once CheckNamespace -namespace Elsa.Extensions; - -/// -/// Provides methods to install and configure the distributed caching feature. -/// -public static class ModuleExtensions -{ - /// - /// Adds the feature to the system. - /// - public static IModule UseDistributedCache(this IModule module, Action? configure = default) - { - module.Configure(configure); - return module; - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Caching.Distributed/Features/DistributedCacheFeature.cs b/src/modules/Elsa.Caching.Distributed/Features/DistributedCacheFeature.cs deleted file mode 100644 index 0e36006da5..0000000000 --- a/src/modules/Elsa.Caching.Distributed/Features/DistributedCacheFeature.cs +++ /dev/null @@ -1,40 +0,0 @@ -using Elsa.Caching.Distributed.Contracts; -using Elsa.Caching.Distributed.Services; -using Elsa.Caching.Features; -using Elsa.Caching.Options; -using Elsa.Caching.Services; -using Elsa.Features.Abstractions; -using Elsa.Features.Attributes; -using Elsa.Features.Services; -using Microsoft.Extensions.DependencyInjection; - -namespace Elsa.Caching.Distributed.Features; - -/// -/// Configures distributed cache management. -/// -[DependsOn(typeof(MemoryCacheFeature))] -public class DistributedCacheFeature(IModule module) : FeatureBase(module) -{ - /// - /// A delegate to configure the . - /// - private Func ChangeTokenSignalPublisherFactory { get; set; } = _ => new NoopChangeTokenSignalPublisher(); - - /// - /// Configures the change token signal publisher. - /// - public DistributedCacheFeature WithChangeTokenSignalPublisher(Func factory) - { - ChangeTokenSignalPublisherFactory = factory; - return this; - } - - /// - public override void Apply() - { - Services.AddSingleton(ChangeTokenSignalPublisherFactory); - Services.Decorate(); - Services.AddSingleton(); - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Caching.Distributed/FodyWeavers.xml b/src/modules/Elsa.Caching.Distributed/FodyWeavers.xml deleted file mode 100644 index 00e1d9a1c1..0000000000 --- a/src/modules/Elsa.Caching.Distributed/FodyWeavers.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/src/modules/Elsa.Caching.Distributed/Services/DistributedChangeTokenSignaler.cs b/src/modules/Elsa.Caching.Distributed/Services/DistributedChangeTokenSignaler.cs deleted file mode 100644 index 5f0eba491c..0000000000 --- a/src/modules/Elsa.Caching.Distributed/Services/DistributedChangeTokenSignaler.cs +++ /dev/null @@ -1,25 +0,0 @@ -using Elsa.Caching.Distributed.Contracts; -using JetBrains.Annotations; -using Microsoft.Extensions.Primitives; - -namespace Elsa.Caching.Distributed.Services; - -/// -/// Decorates an and publishes a signal after the signal has been triggered. -/// -[UsedImplicitly] -public class DistributedChangeTokenSignaler(IChangeTokenSignaler decoratedSignaler, IChangeTokenSignalPublisher signalPublisher, IChangeTokenSignalInvoker invoker) : IChangeTokenSignaler -{ - /// - public IChangeToken GetToken(string key) - { - return decoratedSignaler.GetToken(key); - } - - /// - public async ValueTask TriggerTokenAsync(string key, CancellationToken cancellationToken = default) - { - await decoratedSignaler.TriggerTokenAsync(key, cancellationToken); - await signalPublisher.PublishAsync(key, cancellationToken); - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Caching.Distributed/Services/NoopChangeTokenSignalPublisher.cs b/src/modules/Elsa.Caching.Distributed/Services/NoopChangeTokenSignalPublisher.cs deleted file mode 100644 index 1eff9f288f..0000000000 --- a/src/modules/Elsa.Caching.Distributed/Services/NoopChangeTokenSignalPublisher.cs +++ /dev/null @@ -1,15 +0,0 @@ -using Elsa.Caching.Distributed.Contracts; - -namespace Elsa.Caching.Distributed.Services; - -/// -/// A no-op implementation of . -/// -public class NoopChangeTokenSignalPublisher : IChangeTokenSignalPublisher -{ - /// - public ValueTask PublishAsync(string key, CancellationToken cancellationToken = default) - { - return default; - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Caching/Elsa.Caching.csproj b/src/modules/Elsa.Caching/Elsa.Caching.csproj index 1f902f7cbe..ab4269db6b 100644 --- a/src/modules/Elsa.Caching/Elsa.Caching.csproj +++ b/src/modules/Elsa.Caching/Elsa.Caching.csproj @@ -8,12 +8,12 @@ - + + - - + diff --git a/src/modules/Elsa.Connections.Api/Constants.cs b/src/modules/Elsa.Connections.Api/Constants.cs deleted file mode 100644 index 732c2da997..0000000000 --- a/src/modules/Elsa.Connections.Api/Constants.cs +++ /dev/null @@ -1,5 +0,0 @@ -namespace Elsa.Connections.Api; -public class Constants -{ - public const string PermissionsNamespace = "connections"; -} diff --git a/src/modules/Elsa.Connections.Api/Elsa.Connections.Api.csproj b/src/modules/Elsa.Connections.Api/Elsa.Connections.Api.csproj deleted file mode 100644 index fbf376330b..0000000000 --- a/src/modules/Elsa.Connections.Api/Elsa.Connections.Api.csproj +++ /dev/null @@ -1,14 +0,0 @@ - - - - Provides Activity Connection API endpoints - elsa module activity connection abstraction api - - - - - - - - - diff --git a/src/modules/Elsa.Connections.Api/Endpoints/ActivityConnectionDescriptor/Get/Endpoint.cs b/src/modules/Elsa.Connections.Api/Endpoints/ActivityConnectionDescriptor/Get/Endpoint.cs deleted file mode 100644 index 7bf4aa6ebf..0000000000 --- a/src/modules/Elsa.Connections.Api/Endpoints/ActivityConnectionDescriptor/Get/Endpoint.cs +++ /dev/null @@ -1,29 +0,0 @@ -using Elsa.Abstractions; -using Elsa.Connections.Contracts; -using Elsa.Workflows.Models; - -namespace Elsa.Connections.Api.Endpoints.ActivityConnectionDescriptor.Get; - -public class Endpoint(IConnectionDescriptorRegistry store) : ElsaEndpointWithoutRequest> -{ - public override void Configure() - { - Get("/connection-configuration/input-descriptor/{ActivityType}"); - ConfigurePermissions($"{Constants.PermissionsNamespace}/descriptor:read"); - } - - public override async Task HandleAsync(CancellationToken ct) - { - var type = Route("ActivityType"); - - if (string.IsNullOrWhiteSpace(type)) - { - AddError("ActivityType is required"); - await SendErrorsAsync(cancellation: ct); - return; - } - - var config = await store.GetConnectionDescriptorAsync(type, ct); - await SendOkAsync(config, ct); - } -} diff --git a/src/modules/Elsa.Connections.Api/Endpoints/ActivityConnectionDescriptor/List/Endpoint.cs b/src/modules/Elsa.Connections.Api/Endpoints/ActivityConnectionDescriptor/List/Endpoint.cs deleted file mode 100644 index 62e35582b3..0000000000 --- a/src/modules/Elsa.Connections.Api/Endpoints/ActivityConnectionDescriptor/List/Endpoint.cs +++ /dev/null @@ -1,22 +0,0 @@ -using Elsa.Abstractions; -using Elsa.Common.Models; -using Elsa.Connections.Contracts; -using Elsa.Connections.Models; -using Elsa.Models; - -namespace Elsa.Connections.Api.Endpoints.ActivityConnectionDescriptor.List; - -public class List(IConnectionDescriptorRegistry registry) : ElsaEndpointWithoutRequest> -{ - public override void Configure() - { - Get("/connection-configuration/descriptors"); - ConfigurePermissions($"{Constants.PermissionsNamespace}/descriptor:read"); - } - - public override Task> ExecuteAsync(CancellationToken ct) - { - var descriptors = registry.ListAll().ToList(); - return Task.FromResult(new PagedListResponse(Page.Of(descriptors, descriptors.Count)) ); - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Connections.Api/Endpoints/Add/Endpoint.cs b/src/modules/Elsa.Connections.Api/Endpoints/Add/Endpoint.cs deleted file mode 100644 index 8f7cf39c5a..0000000000 --- a/src/modules/Elsa.Connections.Api/Endpoints/Add/Endpoint.cs +++ /dev/null @@ -1,53 +0,0 @@ -using Elsa.Abstractions; -using Elsa.Connections.Models; -using Elsa.Connections.Persistence.Contracts; -using Elsa.Connections.Persistence.Filters; -using Elsa.Workflows; -using Elsa.Connections.Persistence.Entities; -using Elsa.Connections.Api.Extensions; - -namespace Elsa.Connections.Api.Endpoints.Add; - -public class Endpoint(IConnectionStore store, IIdentityGenerator identityGenerator) : ElsaEndpoint -{ - public override void Configure() - { - Post("/connection-configuration"); - ConfigurePermissions($"{Constants.PermissionsNamespace}:write"); - } - - public override async Task ExecuteAsync(ConnectionInputModel model, CancellationToken ct) - { - var isNameUnique = await IsNameUniqueAsync(model.Name, ct); - - if (!isNameUnique) - { - AddError("A connection already exists with the specified name"); - await SendErrorsAsync(cancellation: ct); - return null!; - } - - var newEntity = new ConnectionDefinition - { - Id = identityGenerator.GenerateId(), - Name = model.Name, - Description = model.Description, - ConnectionType = model.ConnectionType, - ConnectionConfiguration = model.ConnectionConfiguration, - }; - await store.AddAsync(newEntity, ct); - await SendOkAsync(ct); - - return newEntity.ToModel(); - } - - private async Task IsNameUniqueAsync(string name, CancellationToken ct) - { - var filter = new ConnectionDefinitionFilter - { - Name = name - }; - return await store.FindAsync(filter, ct) == null; - } -} - diff --git a/src/modules/Elsa.Connections.Api/Endpoints/Delete/Endpoint.cs b/src/modules/Elsa.Connections.Api/Endpoints/Delete/Endpoint.cs deleted file mode 100644 index d8fda228e4..0000000000 --- a/src/modules/Elsa.Connections.Api/Endpoints/Delete/Endpoint.cs +++ /dev/null @@ -1,27 +0,0 @@ -using Elsa.Abstractions; -using Elsa.Connections.Persistence.Contracts; - -namespace Elsa.Connections.Api.Endpoints.Delete; - -public class Endpoint(IConnectionStore store) : ElsaEndpoint -{ - public override void Configure() - { - Delete("/connection-configuration/{id}"); - ConfigurePermissions($"{Constants.PermissionsNamespace}:delete"); - } - - public override async Task HandleAsync(Request req, CancellationToken ct) - { - var entity = await store.GetAsync(req.Id, ct); - - if (entity == null) - { - await SendNotFoundAsync(ct); - return; - } - - await store.DeleteAsync(entity, ct); - await SendOkAsync(ct); - } -} diff --git a/src/modules/Elsa.Connections.Api/Endpoints/Delete/Request.cs b/src/modules/Elsa.Connections.Api/Endpoints/Delete/Request.cs deleted file mode 100644 index 6e33ffacfc..0000000000 --- a/src/modules/Elsa.Connections.Api/Endpoints/Delete/Request.cs +++ /dev/null @@ -1,8 +0,0 @@ -using System.ComponentModel.DataAnnotations; - -namespace Elsa.Connections.Api.Endpoints.Delete; - -public class Request -{ - [Required] public string Id { get; set; } = null!; -} \ No newline at end of file diff --git a/src/modules/Elsa.Connections.Api/Endpoints/Get/Endpoint.cs b/src/modules/Elsa.Connections.Api/Endpoints/Get/Endpoint.cs deleted file mode 100644 index bbf6ab9531..0000000000 --- a/src/modules/Elsa.Connections.Api/Endpoints/Get/Endpoint.cs +++ /dev/null @@ -1,32 +0,0 @@ -using Elsa.Abstractions; -using Elsa.Connections.Models; -using Elsa.Connections.Persistence.Contracts; -using Elsa.Connections.Api.Extensions; - -namespace Elsa.Connections.Api.Endpoints.Get; - -public class Endpoint(IConnectionStore store) : ElsaEndpoint -{ - public override void Configure() - { - Get("/connection-configuration/{id}"); - ConfigurePermissions($"{Constants.PermissionsNamespace}:read"); - } - - public override async Task ExecuteAsync(Request req, CancellationToken ct) - { - var entity = await store.FindAsync( - new() - { - Id = req.Id - }, ct); - - if (entity == null) - { - await SendNotFoundAsync(ct); - return null!; - } - - return entity.ToModel(); - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Connections.Api/Endpoints/Get/Request.cs b/src/modules/Elsa.Connections.Api/Endpoints/Get/Request.cs deleted file mode 100644 index 933b0c2fb1..0000000000 --- a/src/modules/Elsa.Connections.Api/Endpoints/Get/Request.cs +++ /dev/null @@ -1,8 +0,0 @@ -using System.ComponentModel.DataAnnotations; - -namespace Elsa.Connections.Api.Endpoints.Get; - -public class Request -{ - [Required] public string Id { get; set; } = null!; -} \ No newline at end of file diff --git a/src/modules/Elsa.Connections.Api/Endpoints/List/Endpoint.cs b/src/modules/Elsa.Connections.Api/Endpoints/List/Endpoint.cs deleted file mode 100644 index 9f791b69e3..0000000000 --- a/src/modules/Elsa.Connections.Api/Endpoints/List/Endpoint.cs +++ /dev/null @@ -1,24 +0,0 @@ -using Elsa.Abstractions; -using Elsa.Common.Models; -using Elsa.Connections.Api.Extensions; -using Elsa.Connections.Models; -using Elsa.Connections.Persistence.Contracts; -using Elsa.Models; - -namespace Elsa.Connections.Api.Endpoints.List; - -public class Endpoint(IConnectionStore store) : ElsaEndpointWithoutRequest> -{ - public override void Configure() - { - Get("/connection-configuration"); - ConfigurePermissions($"{Constants.PermissionsNamespace}:read"); - } - - public override async Task> ExecuteAsync(CancellationToken ct) - { - var entities = await store.ListAsync(ct); - var models = entities.Select(x => x.ToModel()).ToList(); - return new(Page.Of(models, models.Count())); - } -} diff --git a/src/modules/Elsa.Connections.Api/Endpoints/Update/Endpoint.cs b/src/modules/Elsa.Connections.Api/Endpoints/Update/Endpoint.cs deleted file mode 100644 index ffba22422e..0000000000 --- a/src/modules/Elsa.Connections.Api/Endpoints/Update/Endpoint.cs +++ /dev/null @@ -1,55 +0,0 @@ -using Elsa.Abstractions; -using Elsa.Connections.Models; -using Elsa.Connections.Persistence.Contracts; -using Elsa.Connections.Persistence.Filters; -using Elsa.Connections.Api.Extensions; - -namespace Elsa.Connections.Api.Endpoints.Update; - -public class Endpoint(IConnectionStore store) : ElsaEndpoint -{ - public override void Configure() - { - Put("/connection-configuration/{id}"); - ConfigurePermissions($"{Constants.PermissionsNamespace}:write"); - } - - public override async Task ExecuteAsync(ConnectionInputModel model, CancellationToken ct) - { - var id = Route("id")!; - var entity = await store.GetAsync(id, ct); - - if (entity == null) - { - await SendNotFoundAsync(ct); - return null!; - } - - var isNameDuplicate = await IsNameDuplicateAsync(model.Name, id, ct); - - if (isNameDuplicate) - { - AddError("Another connection already exist with the specified name"); - await SendErrorsAsync(cancellation: ct); - return entity.ToModel(); - } - - entity.Name = model.Name; - entity.Description = model.Description; - entity.ConnectionConfiguration = model.ConnectionConfiguration; - - await store.UpdateAsync(entity, ct); - return entity.ToModel(); - } - - private async Task IsNameDuplicateAsync(string name, string id, CancellationToken cancellationToken) - { - var entities = await store.FindAsync(new() - { - NotId = id, - Name = name - }, cancellationToken); - - return entities != null; - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Connections.Api/Extensions/ConnectionDefinitionExtensions.cs b/src/modules/Elsa.Connections.Api/Extensions/ConnectionDefinitionExtensions.cs deleted file mode 100644 index fef90c6170..0000000000 --- a/src/modules/Elsa.Connections.Api/Extensions/ConnectionDefinitionExtensions.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Elsa.Connections.Models; -using Elsa.Connections.Persistence.Entities; - -namespace Elsa.Connections.Api.Extensions; - -public static class ConnectionDefinitionExtensions -{ - public static ConnectionModel ToModel(this ConnectionDefinition entity) - { - return new() - { - Id = entity.Id, - Name = entity.Name, - Description = entity.Description, - ConnectionType = entity.ConnectionType, - ConnectionConfiguration = entity.ConnectionConfiguration, - }; - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Connections.Api/Extensions/ModuleExtensions.cs b/src/modules/Elsa.Connections.Api/Extensions/ModuleExtensions.cs deleted file mode 100644 index 10cc541856..0000000000 --- a/src/modules/Elsa.Connections.Api/Extensions/ModuleExtensions.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Elsa.Connections.Api.Features; -using Elsa.Features.Services; - -// ReSharper disable once CheckNamespace -namespace Elsa.Extensions; - -/// -/// Extends with methods to Connection API endpoints. -/// -public static class ModuleExtensions -{ - /// - /// Installs the Connections API feature. - /// - public static IModule UseConnectionsApi(this IModule module, Action? configure = null) - { - return module.Use(configure); - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Connections.Api/Features/ConnectionsApiFeature.cs b/src/modules/Elsa.Connections.Api/Features/ConnectionsApiFeature.cs deleted file mode 100644 index d3fc3c7a49..0000000000 --- a/src/modules/Elsa.Connections.Api/Features/ConnectionsApiFeature.cs +++ /dev/null @@ -1,22 +0,0 @@ -using Elsa.Connections.Persistence.Features; -using Elsa.Extensions; -using Elsa.Features.Abstractions; -using Elsa.Features.Attributes; -using Elsa.Features.Services; -using JetBrains.Annotations; - -namespace Elsa.Connections.Api.Features; - -/// -/// A feature that installs API endpoints to interact connections. -/// -[DependsOn(typeof(ConnectionPersistenceFeature))] -[UsedImplicitly] -public class ConnectionsApiFeature(IModule module) : FeatureBase(module) -{ - /// - public override void Configure() - { - Module.AddFastEndpointsAssembly(); - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Connections.Api/FodyWeavers.xml b/src/modules/Elsa.Connections.Api/FodyWeavers.xml deleted file mode 100644 index ac6b5b2928..0000000000 --- a/src/modules/Elsa.Connections.Api/FodyWeavers.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/src/modules/Elsa.Connections.Core/Attributes/ConnectionActivityAttribute.cs b/src/modules/Elsa.Connections.Core/Attributes/ConnectionActivityAttribute.cs deleted file mode 100644 index 9156be9197..0000000000 --- a/src/modules/Elsa.Connections.Core/Attributes/ConnectionActivityAttribute.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace Elsa.Connections.Attributes; - -[AttributeUsage(AttributeTargets.Class)] -public class ConnectionActivityAttribute(string type) : Attribute -{ - /// - /// The TypeName of the connection - /// - public string Type { get; set; } = type; -} diff --git a/src/modules/Elsa.Connections.Core/Attributes/ConnectionPropertyAttribute.cs b/src/modules/Elsa.Connections.Core/Attributes/ConnectionPropertyAttribute.cs deleted file mode 100644 index 98c6d79c30..0000000000 --- a/src/modules/Elsa.Connections.Core/Attributes/ConnectionPropertyAttribute.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace Elsa.Connections.Attributes; - -public class ConnectionPropertyAttribute(string ns, string displayName, string? description = null) : Attribute -{ - public string? Namespace { get; set; } = ns; - public string? Description { get; set; } = description; - public string? DisplayName { get; set; } = displayName; -} \ No newline at end of file diff --git a/src/modules/Elsa.Connections.Core/Attributes/ConnectionTypeAttribute.cs b/src/modules/Elsa.Connections.Core/Attributes/ConnectionTypeAttribute.cs deleted file mode 100644 index e000eb7420..0000000000 --- a/src/modules/Elsa.Connections.Core/Attributes/ConnectionTypeAttribute.cs +++ /dev/null @@ -1,13 +0,0 @@ -namespace Elsa.Connections.Attributes; - -public class ConnectionTypeAttribute : Attribute -{ - public ConnectionTypeAttribute(Type type) - { - Type = type; - } - /// - /// The TypeName of the connection - /// - public Type Type { get; set; } -} diff --git a/src/modules/Elsa.Connections.Core/Attributes/NoLogAttribute.cs b/src/modules/Elsa.Connections.Core/Attributes/NoLogAttribute.cs deleted file mode 100644 index 80c4275c9c..0000000000 --- a/src/modules/Elsa.Connections.Core/Attributes/NoLogAttribute.cs +++ /dev/null @@ -1,5 +0,0 @@ -namespace Elsa.Connections.Attributes; - -public class NoLogAttribute : Attribute -{ -} diff --git a/src/modules/Elsa.Connections.Core/Contracts/IConnectionDescriptorRegistry.cs b/src/modules/Elsa.Connections.Core/Contracts/IConnectionDescriptorRegistry.cs deleted file mode 100644 index 61e525987b..0000000000 --- a/src/modules/Elsa.Connections.Core/Contracts/IConnectionDescriptorRegistry.cs +++ /dev/null @@ -1,40 +0,0 @@ -using Elsa.Connections.Models; -using Elsa.Workflows.Models; - -namespace Elsa.Connections.Contracts; - -/// -/// Store all connection descriptors available to the system -/// -public interface IConnectionDescriptorRegistry -{ - /// - /// Adds a connection descriptor to the registry - /// - /// The type of the connection - /// The type desiptor of the connection - void Add(Type connectionType, ConnectionDescriptor connectionDescriptor); - - /// - /// Removes an activity descriptor from the registry. - /// - /// The type of the connection. - /// - void Remove(Type connectionType, ActivityDescriptor descriptor); - - /// - /// Returns all connection descriptors in the registry. - /// - /// All connection descriptors in the registry. - IEnumerable ListAll(); - - Type? Get(string type); - - /// - /// Get the Input Descriptors for an connection - /// - /// The type of the connectn - /// - /// - Task> GetConnectionDescriptorAsync(string activityType, CancellationToken cancellationToken = default); -} \ No newline at end of file diff --git a/src/modules/Elsa.Connections.Core/Contracts/IConnectionDescriptorRepository.cs b/src/modules/Elsa.Connections.Core/Contracts/IConnectionDescriptorRepository.cs deleted file mode 100644 index ffb11ba741..0000000000 --- a/src/modules/Elsa.Connections.Core/Contracts/IConnectionDescriptorRepository.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace Elsa.Connections.Contracts; - -public interface IConnectionDescriptorRegistryEX -{ - -} diff --git a/src/modules/Elsa.Connections.Core/Contracts/IConnectionProperty.cs b/src/modules/Elsa.Connections.Core/Contracts/IConnectionProperty.cs deleted file mode 100644 index fd89db4df0..0000000000 --- a/src/modules/Elsa.Connections.Core/Contracts/IConnectionProperty.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System.Text.Json.Serialization; - -namespace Elsa.Connections.Contracts; -interface IConnectionProperty -{ - public string ConnectionName { get; set; } - - [JsonIgnore] - public object Properties { get; set; } -} - diff --git a/src/modules/Elsa.Connections.Core/Converters/Int32Converter.cs b/src/modules/Elsa.Connections.Core/Converters/Int32Converter.cs deleted file mode 100644 index adb9920788..0000000000 --- a/src/modules/Elsa.Connections.Core/Converters/Int32Converter.cs +++ /dev/null @@ -1,29 +0,0 @@ -using System.Text.Json; - -namespace Elsa.Connections.Converters; - -public class Int32Converter : System.Text.Json.Serialization.JsonConverter -{ - public override int Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) - { - if (reader.TokenType == JsonTokenType.String) - { - var stringValue = reader.GetString(); - if (int.TryParse(stringValue, out var value)) - { - return value; - } - } - else if (reader.TokenType == JsonTokenType.Number) - { - return reader.GetInt32(); - } - - throw new JsonException(); - } - - public override void Write(Utf8JsonWriter writer, int value, JsonSerializerOptions options) - { - writer.WriteNumberValue(value); - } -} diff --git a/src/modules/Elsa.Connections.Core/Elsa.Connections.Core.csproj b/src/modules/Elsa.Connections.Core/Elsa.Connections.Core.csproj deleted file mode 100644 index b92c7e94f5..0000000000 --- a/src/modules/Elsa.Connections.Core/Elsa.Connections.Core.csproj +++ /dev/null @@ -1,17 +0,0 @@ - - - - Provides an connection framework to use connection abtraction in activities - elsa module connection abstratction - Elsa.Connections - - - - - - - - - - - diff --git a/src/modules/Elsa.Connections.Core/Extensions/LogConnectionExtensions.cs b/src/modules/Elsa.Connections.Core/Extensions/LogConnectionExtensions.cs deleted file mode 100644 index a11192cb84..0000000000 --- a/src/modules/Elsa.Connections.Core/Extensions/LogConnectionExtensions.cs +++ /dev/null @@ -1,24 +0,0 @@ -// ReSharper disable once CheckNamespace - -using Microsoft.Extensions.Logging; - -namespace Elsa.Connections.Core.Extensions; - -/// -/// -/// -public static partial class LogConnectionExtensions -{ - [LoggerMessage( - Level = LogLevel.Warning, - Message = "Connection {name} was not found" - )] - public static partial void LogConnectionNotFound(ILogger logger, string name); - - [LoggerMessage( - Level = LogLevel.Warning, - Message = "Connection is null" - )] - public static partial void LogConnectionIsNull(ILogger logger); - -} \ No newline at end of file diff --git a/src/modules/Elsa.Connections.Core/Extensions/ModuleExtensions.cs b/src/modules/Elsa.Connections.Core/Extensions/ModuleExtensions.cs deleted file mode 100644 index d68959b7af..0000000000 --- a/src/modules/Elsa.Connections.Core/Extensions/ModuleExtensions.cs +++ /dev/null @@ -1,33 +0,0 @@ -using Elsa.Connections.Features; -using Elsa.Connections.Middleware; -using Elsa.Features.Services; -using Elsa.Workflows; -using Elsa.Workflows.Pipelines.ActivityExecution; - -// ReSharper disable once CheckNamespace -namespace Elsa.Extensions; - -/// -/// Extends with methods to install Semantic Kernel API endpoints. -/// -public static class ModuleExtensions -{ - /// - /// Installs the Semantic Kernel API feature. - /// - public static IModule UseConnections(this IModule module, Action? configure = null) - { - return module.Use(configure); - } -} - -/// -/// Adds extension methods to . -/// -public static class ConnectionMiddlewareExtensions -{ - /// - /// Installs the component in the activity execution pipeline. - /// - public static IActivityExecutionPipelineBuilder UseConnectionMiddleware(this IActivityExecutionPipelineBuilder pipelineBuilder) => pipelineBuilder.UseMiddleware(); -} diff --git a/src/modules/Elsa.Connections.Core/Features/ConnectionsFeatures.cs b/src/modules/Elsa.Connections.Core/Features/ConnectionsFeatures.cs deleted file mode 100644 index 8fc227e7a6..0000000000 --- a/src/modules/Elsa.Connections.Core/Features/ConnectionsFeatures.cs +++ /dev/null @@ -1,73 +0,0 @@ -using System.Reflection; -using Elsa.Connections.Attributes; -using Elsa.Connections.Contracts; -using Elsa.Connections.Filters; -using Elsa.Connections.ServiceProvider; -using Elsa.Connections.Services; -using Elsa.Connections.UIHints; -using Elsa.Extensions; -using Elsa.Features.Abstractions; -using Elsa.Features.Attributes; -using Elsa.Features.Services; -using Elsa.Workflows; -using Elsa.Workflows.Pipelines.ActivityExecution; -using Elsa.Workflows.Features; -using JetBrains.Annotations; -using Microsoft.Extensions.DependencyInjection; -using Elsa.Connections.Middleware; -using Elsa.Connections.Models; - -namespace Elsa.Connections.Features; - -/// -/// A feature that installs API endpoints to interact with skilled agents. -/// -[DependsOn(typeof(WorkflowsFeature))] -[UsedImplicitly] -public class ConnectionsFeatures(IModule module) : FeatureBase(module) -{ - - /// - /// A set of connection types to make available to the system. - /// - public HashSet ConnectionTypes { get; } = []; - - /// - public override void Apply() - { - // Obfuscate Connection Properties. - Services.AddActivityStateFilter(); - // Activity property options providers. - Services.AddScoped(); - - Services.AddSingleton(); - - //UIHints - Services.AddScoped(); - - Services.Configure(options => - { - foreach (var connectionType in ConnectionTypes.Distinct()) - options.ConnectionTypes.Add(connectionType); - }); - } - public override void Configure() - { - //TODO: Need to insert the middleware just before the BackgroundActivityInvoker - //How to be sure that it is inserted before? - var workflowFeature = Module.Configure() - .WithDefaultActivityExecutionPipeline(pipeline => pipeline.Insert(3)); - base.Configure(); - } - public ConnectionsFeatures AddConnectionsFrom() - { - var connectionTypes = typeof(TMarker).Assembly.GetExportedTypes() - .Where(x => x.GetCustomAttribute() != null ) - .ToList(); - - ConnectionTypes.AddRange(connectionTypes); - - return this; - } - -} diff --git a/src/modules/Elsa.Connections.Core/Filters/PropertyAttributeFilter.cs b/src/modules/Elsa.Connections.Core/Filters/PropertyAttributeFilter.cs deleted file mode 100644 index 14773afa7b..0000000000 --- a/src/modules/Elsa.Connections.Core/Filters/PropertyAttributeFilter.cs +++ /dev/null @@ -1,25 +0,0 @@ -using Elsa.Connections.Attributes; -using Elsa.Workflows; - -namespace Elsa.Connections.Filters; - -public class PropertyAttributeFilter : ActivityStateFilterBase -{ - protected override ActivityStateFilterResult OnExecute(ActivityStateFilterContext context) - { - var inputDescriptor = context.InputDescriptor; - - if (Attribute.IsDefined(inputDescriptor.PropertyInfo, typeof(NoLogAttribute))) - { - var contextValue = context.Value.GetProperty("connectionName").GetString(); - - if (contextValue == null) - return ActivityStateFilterResult.Pass(); - - var maskedValue = $"**** see connection information for {contextValue} ****"; - return Filtered(maskedValue); - } - - return ActivityStateFilterResult.Pass(); - } -} diff --git a/src/modules/Elsa.Connections.Core/FodyWeavers.xml b/src/modules/Elsa.Connections.Core/FodyWeavers.xml deleted file mode 100644 index ac6b5b2928..0000000000 --- a/src/modules/Elsa.Connections.Core/FodyWeavers.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/src/modules/Elsa.Connections.Core/Middleware/ConnectionMiddleware.cs b/src/modules/Elsa.Connections.Core/Middleware/ConnectionMiddleware.cs deleted file mode 100644 index b48b2326cc..0000000000 --- a/src/modules/Elsa.Connections.Core/Middleware/ConnectionMiddleware.cs +++ /dev/null @@ -1,70 +0,0 @@ -using System.Text.Json; -using Elsa.Connections.Attributes; -using Elsa.Connections.Models; -using Elsa.Extensions; -using Elsa.Workflows; -using Elsa.Workflows.Pipelines.ActivityExecution; -using JetBrains.Annotations; -using Microsoft.Extensions.Logging; -using Elsa.Connections.Core.Extensions; -using Elsa.Connections.Converters; -using Elsa.Connections.Persistence.Contracts; - -namespace Elsa.Connections.Middleware; - -/// -/// An activity execution middleware component that injects connection properties from Connection Name. -/// -[UsedImplicitly] -public class ConnectionMiddleware(ActivityMiddlewareDelegate next - , IConnectionStore connectionStore - ,ILogger logger) - : IActivityExecutionMiddleware -{ - private static JsonSerializerOptions? _serializerOptions; - - private static JsonSerializerOptions SerializerOptions => - _serializerOptions ??= new JsonSerializerOptions - { - PropertyNamingPolicy = JsonNamingPolicy.CamelCase, - }.WithConverters(new Int32Converter()); - - /// - public async ValueTask InvokeAsync(ActivityExecutionContext context) - { - var activityDescriptor = context.ActivityDescriptor; - - if (activityDescriptor.Attributes.Any(attr => attr.GetType() == typeof(ConnectionActivityAttribute))) - { - var inputDescriptors = activityDescriptor.Inputs.Where(x => x.PropertyInfo?.PropertyType.GetGenericTypeDefinition() == typeof(ConnectionProperties<>)).ToList(); - - if (inputDescriptors.Count > 0) - { - var input = inputDescriptors[0]; - var propertyType = input.PropertyInfo?.PropertyType.GetGenericArguments()[0]; - - dynamic inputValue = input.ValueGetter(context.Activity)!; - var connectionName = (string)inputValue.ConnectionName; - - if (connectionName == null) - LogConnectionExtensions.LogConnectionIsNull(logger); - else - { - // Get connection from store, if exists. - var connectionConfiguration = await connectionStore.FindAsync(new() { Name = connectionName }); - if (connectionConfiguration != null) - { - dynamic deserializedJson = connectionConfiguration.ConnectionConfiguration.Deserialize(propertyType, SerializerOptions)!; - - inputValue.Properties = deserializedJson; - input.ValueSetter(context.Activity, inputValue); - } - else - LogConnectionExtensions.LogConnectionNotFound(logger, connectionName); - } - } - } - - await next(context); - } -} diff --git a/src/modules/Elsa.Connections.Core/Models/ConnectionOptions.cs b/src/modules/Elsa.Connections.Core/Models/ConnectionOptions.cs deleted file mode 100644 index bf9dc94d30..0000000000 --- a/src/modules/Elsa.Connections.Core/Models/ConnectionOptions.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace Elsa.Connections.Models; - -public class ConnectionOptions -{ - /// - /// A collection of connection types that are available to the system. - /// - public HashSet ConnectionTypes { get; set; } = new(); -} \ No newline at end of file diff --git a/src/modules/Elsa.Connections.Core/ServiceProvider/ConnectionOptionsProvider.cs b/src/modules/Elsa.Connections.Core/ServiceProvider/ConnectionOptionsProvider.cs deleted file mode 100644 index 71657877e8..0000000000 --- a/src/modules/Elsa.Connections.Core/ServiceProvider/ConnectionOptionsProvider.cs +++ /dev/null @@ -1,40 +0,0 @@ -using System.Reflection; -using Elsa.Connections.Attributes; -using Elsa.Connections.Persistence.Contracts; -using Elsa.Workflows.UIHints.Dropdown; - -namespace Elsa.Connections.ServiceProvider; - -public class ConnectionOptionsProvider(IConnectionStore store) : DropDownOptionsProviderBase -{ - public new async ValueTask> GetUIPropertiesAsync(PropertyInfo propertyInfo, object? context, CancellationToken cancellationToken = default) - { - var options = await base.GetUIPropertiesAsync(propertyInfo, context, cancellationToken); - options.Add("Refresh", true); - return options; - } - - protected override async ValueTask> GetItemsAsync(PropertyInfo propertyInfo, object? context, CancellationToken cancellationToken) - { - var connection = new List(); - var connectionType = propertyInfo.GetCustomAttribute()?.Type; - - if (connectionType == null) - return connection; - - var connections = await store.FindManyAsync(new() { Type = connectionType.ToString() }, cancellationToken); - - foreach(var conn in connections) - connection.Add(new(conn.Name, conn.Name)); - - return connection; - } - - protected override IDictionary GetUIPropertyAdditionalOptions() - { - return new Dictionary - { - ["Refresh"] = true - }; - } -} diff --git a/src/modules/Elsa.Connections.Core/Services/ConnectionRegistry.cs b/src/modules/Elsa.Connections.Core/Services/ConnectionRegistry.cs deleted file mode 100644 index 6c94e1b591..0000000000 --- a/src/modules/Elsa.Connections.Core/Services/ConnectionRegistry.cs +++ /dev/null @@ -1,72 +0,0 @@ -using System.Collections.Concurrent; -using System.Reflection; -using Elsa.Connections.Attributes; -using Elsa.Connections.Contracts; -using Elsa.Connections.Models; -using Elsa.Workflows; -using Elsa.Workflows.Models; -using Microsoft.Extensions.Options; - -namespace Elsa.Connections.Services; - -public class ConnectionRegistry(IOptions options, IActivityDescriber describer) : IConnectionDescriptorRegistry -{ - private readonly ConcurrentDictionary _connectionDescriptors = new(); - private readonly ConnectionOptions _options = options.Value; - - public void Add(Type connectionType, ConnectionDescriptor connectionDescriptor) - { - var descriptor = DescribeConnection(connectionType); - - _connectionDescriptors.TryAdd(connectionType, descriptor); - } - - public IEnumerable ListAll() - { - foreach (var connectionType in _options.ConnectionTypes) - yield return DescribeConnection(connectionType); - } - - public void Remove(Type connectionType, ActivityDescriptor descriptor) - { - throw new NotImplementedException(); - } - - public Type? Get(string type) - { - return _options.ConnectionTypes.FirstOrDefault(c => c.ToString() == type); - } - - public async Task> GetConnectionDescriptorAsync(string activityType, CancellationToken cancellationToken = default) - { - var propertyType = Get(activityType); - - if (propertyType == null) - return []; - - var connectionInputProperty = describer.GetInputProperties(propertyType); - var connectionInputDescriptor = await DescribeInputPropertiesAsync(connectionInputProperty, cancellationToken); - - return connectionInputDescriptor; - } - - private async Task> DescribeInputPropertiesAsync(IEnumerable properties, CancellationToken cancellationToken = default) - { - return await Task.WhenAll(properties.Select(async x => await describer.DescribeInputPropertyAsync(x, cancellationToken))); - } - - private ConnectionDescriptor DescribeConnection(Type connectionType) - { - var connectionAttribute = connectionType.GetCustomAttribute(); - - if (connectionAttribute == null) - throw new ArgumentNullException($"{connectionType} is not a valid connection, make sure [ConnectionPropertyAttribute] is set "); - - return new( - connectionType.ToString(), - connectionAttribute.Description, - connectionAttribute.Namespace, - connectionAttribute.DisplayName - ); - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Connections.Core/UIHints/ConnectionDropDownUIHintHandler.cs b/src/modules/Elsa.Connections.Core/UIHints/ConnectionDropDownUIHintHandler.cs deleted file mode 100644 index 060ad752b9..0000000000 --- a/src/modules/Elsa.Connections.Core/UIHints/ConnectionDropDownUIHintHandler.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System.Reflection; -using Elsa.Workflows; -using Elsa.Workflows.UIHints; -using Elsa.Workflows.UIHints.Dropdown; - -namespace Elsa.Connections.UIHints; - -/// -/// UIHint Handler that use DropDown for Connection Property -/// -public class ConnectionDropDownUIHintHandler : IUIHintHandler -{ - /// - public string UIHint => $"connection-{InputUIHints.DropDown}"; - - /// - public ValueTask> GetPropertyUIHandlersAsync(PropertyInfo propertyInfo, CancellationToken cancellationToken) - { - return new([typeof(StaticDropDownOptionsProvider)]); - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Connections.Models/ConnectionDescriptor.cs b/src/modules/Elsa.Connections.Models/ConnectionDescriptor.cs deleted file mode 100644 index b79c1a5164..0000000000 --- a/src/modules/Elsa.Connections.Models/ConnectionDescriptor.cs +++ /dev/null @@ -1,3 +0,0 @@ -namespace Elsa.Connections.Models; - -public record ConnectionDescriptor(string Type, string? Description, string? Namespace, string? ProviderName); diff --git a/src/modules/Elsa.Connections.Models/ConnectionInputModel.cs b/src/modules/Elsa.Connections.Models/ConnectionInputModel.cs deleted file mode 100644 index 497cdb1a8c..0000000000 --- a/src/modules/Elsa.Connections.Models/ConnectionInputModel.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.Text.Json.Nodes; - -namespace Elsa.Connections.Models; - -public class ConnectionInputModel -{ - /// - /// The Name of the Connection - /// - [Required] public string Name { get; set; } = null!; - - /// - /// The Description of the Connection - /// - public string? Description { get; set; } - - /// - /// The Configuration of the Connection in a Json Format - /// - public JsonObject ConnectionConfiguration { get; set; } = new(); - - /// - /// The Connection Type Name - /// - [Required] public string ConnectionType { get; set; } = null!; -} \ No newline at end of file diff --git a/src/modules/Elsa.Connections.Models/ConnectionModel.cs b/src/modules/Elsa.Connections.Models/ConnectionModel.cs deleted file mode 100644 index 6caa8959f3..0000000000 --- a/src/modules/Elsa.Connections.Models/ConnectionModel.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System.ComponentModel.DataAnnotations; - -namespace Elsa.Connections.Models; - -public class ConnectionModel : ConnectionInputModel -{ - /// - /// The Id of the Connection - /// - [Required] public string Id { get; set; } = null!; -} \ No newline at end of file diff --git a/src/modules/Elsa.Connections.Models/ConnectionProperties.cs b/src/modules/Elsa.Connections.Models/ConnectionProperties.cs deleted file mode 100644 index ebed4e6d77..0000000000 --- a/src/modules/Elsa.Connections.Models/ConnectionProperties.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System.Text.Json.Serialization; - -namespace Elsa.Connections.Models; - -public class ConnectionProperties where T : class, new() -{ - /// - /// Creates a new instance of the class. - /// - [JsonConstructor] - public ConnectionProperties() - { - } - - public string? ConnectionName { get; set; } - - [JsonIgnore] - public T Properties { get; set; } = new(); -} - diff --git a/src/modules/Elsa.Connections.Models/Elsa.Connections.Models.csproj b/src/modules/Elsa.Connections.Models/Elsa.Connections.Models.csproj deleted file mode 100644 index 1bd63d6203..0000000000 --- a/src/modules/Elsa.Connections.Models/Elsa.Connections.Models.csproj +++ /dev/null @@ -1,9 +0,0 @@ - - - - Provides models that can be shared between the API and API clients - elsa module connections api - Elsa.Connections - - - diff --git a/src/modules/Elsa.Connections.Models/FodyWeavers.xml b/src/modules/Elsa.Connections.Models/FodyWeavers.xml deleted file mode 100644 index ba625ed138..0000000000 --- a/src/modules/Elsa.Connections.Models/FodyWeavers.xml +++ /dev/null @@ -1,2 +0,0 @@ - - \ No newline at end of file diff --git a/src/modules/Elsa.Connections.Persistence.EntityFrameworkCore.Sqlite/DbContextFactories.cs b/src/modules/Elsa.Connections.Persistence.EntityFrameworkCore.Sqlite/DbContextFactories.cs deleted file mode 100644 index cd4fca5367..0000000000 --- a/src/modules/Elsa.Connections.Persistence.EntityFrameworkCore.Sqlite/DbContextFactories.cs +++ /dev/null @@ -1,15 +0,0 @@ -using Elsa.EntityFrameworkCore.Abstractions; -using Elsa.EntityFrameworkCore.Extensions; -using JetBrains.Annotations; -using Microsoft.EntityFrameworkCore; - -namespace Elsa.Connections.Persistence.EntityFrameworkCore.Sqlite; - -[UsedImplicitly] -public class SqliteConnectionDbContextFactory : DesignTimeDbContextFactoryBase -{ - protected override void ConfigureBuilder(DbContextOptionsBuilder builder, string connectionString) - { - builder.UseElsaSqlite(GetType().Assembly, connectionString); - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Connections.Persistence.EntityFrameworkCore.Sqlite/Elsa.Connections.Persistence.EntityFrameworkCore.Sqlite.csproj b/src/modules/Elsa.Connections.Persistence.EntityFrameworkCore.Sqlite/Elsa.Connections.Persistence.EntityFrameworkCore.Sqlite.csproj deleted file mode 100644 index 0f350f1e23..0000000000 --- a/src/modules/Elsa.Connections.Persistence.EntityFrameworkCore.Sqlite/Elsa.Connections.Persistence.EntityFrameworkCore.Sqlite.csproj +++ /dev/null @@ -1,19 +0,0 @@ - - - - Provides an EF Core migrations for SQLite for the Connection Persistence module. - elsa module persistence efcore entity framework core sqlite - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/modules/Elsa.Connections.Persistence.EntityFrameworkCore.Sqlite/FodyWeavers.xml b/src/modules/Elsa.Connections.Persistence.EntityFrameworkCore.Sqlite/FodyWeavers.xml deleted file mode 100644 index ac6b5b2928..0000000000 --- a/src/modules/Elsa.Connections.Persistence.EntityFrameworkCore.Sqlite/FodyWeavers.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/src/modules/Elsa.Connections.Persistence.EntityFrameworkCore.Sqlite/Migrations/20250212220543_V3_3.Designer.cs b/src/modules/Elsa.Connections.Persistence.EntityFrameworkCore.Sqlite/Migrations/20250212220543_V3_3.Designer.cs deleted file mode 100644 index 8f3eb36587..0000000000 --- a/src/modules/Elsa.Connections.Persistence.EntityFrameworkCore.Sqlite/Migrations/20250212220543_V3_3.Designer.cs +++ /dev/null @@ -1,60 +0,0 @@ -// -using Elsa.Connections.Persistence.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Elsa.Connections.Persistence.EntityFrameworkCore.Sqlite.Migrations -{ - [DbContext(typeof(ConnectionDbContext))] - [Migration("20250212220543_V3_3")] - partial class V3_3 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "8.0.12"); - - modelBuilder.Entity("Elsa.Connections.Persistence.Entities.ConnectionDefinition", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("ConnectionConfiguration") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("ConnectionType") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("Description") - .HasColumnType("TEXT"); - - b.Property("Name") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("TenantId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .HasDatabaseName("IX_ConnectionDefinition_Name"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_ConnectionDefinition_TenantId"); - - b.ToTable("ConnectionDefinitions", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.Connections.Persistence.EntityFrameworkCore.Sqlite/Migrations/20250212220543_V3_3.cs b/src/modules/Elsa.Connections.Persistence.EntityFrameworkCore.Sqlite/Migrations/20250212220543_V3_3.cs deleted file mode 100644 index dd64e3a5f3..0000000000 --- a/src/modules/Elsa.Connections.Persistence.EntityFrameworkCore.Sqlite/Migrations/20250212220543_V3_3.cs +++ /dev/null @@ -1,62 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.Connections.Persistence.EntityFrameworkCore.Sqlite.Migrations -{ - /// - public partial class V3_3 : Migration - { - private readonly Elsa.EntityFrameworkCore.IElsaDbContextSchema _schema; - - /// - public V3_3(Elsa.EntityFrameworkCore.IElsaDbContextSchema schema) - { - _schema = schema; - } - - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.EnsureSchema( - name: _schema.Schema); - - migrationBuilder.CreateTable( - name: "ConnectionDefinitions", - schema: _schema.Schema, - columns: table => new - { - Id = table.Column(type: "TEXT", nullable: false), - Name = table.Column(type: "TEXT", nullable: false), - Description = table.Column(type: "TEXT", nullable: true), - ConnectionConfiguration = table.Column(type: "TEXT", nullable: false), - ConnectionType = table.Column(type: "TEXT", nullable: false), - TenantId = table.Column(type: "TEXT", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_ConnectionDefinitions", x => x.Id); - }); - - migrationBuilder.CreateIndex( - name: "IX_ConnectionDefinition_Name", - schema: _schema.Schema, - table: "ConnectionDefinitions", - column: "Name"); - - migrationBuilder.CreateIndex( - name: "IX_ConnectionDefinition_TenantId", - schema: _schema.Schema, - table: "ConnectionDefinitions", - column: "TenantId"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "ConnectionDefinitions", - schema: _schema.Schema); - } - } -} diff --git a/src/modules/Elsa.Connections.Persistence.EntityFrameworkCore.Sqlite/Migrations/ConnectionDbContextModelSnapshot.cs b/src/modules/Elsa.Connections.Persistence.EntityFrameworkCore.Sqlite/Migrations/ConnectionDbContextModelSnapshot.cs deleted file mode 100644 index 50c535a68f..0000000000 --- a/src/modules/Elsa.Connections.Persistence.EntityFrameworkCore.Sqlite/Migrations/ConnectionDbContextModelSnapshot.cs +++ /dev/null @@ -1,57 +0,0 @@ -// -using Elsa.Connections.Persistence.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Elsa.Connections.Persistence.EntityFrameworkCore.Sqlite.Migrations -{ - [DbContext(typeof(ConnectionDbContext))] - partial class ConnectionDbContextModelSnapshot : ModelSnapshot - { - protected override void BuildModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "8.0.12"); - - modelBuilder.Entity("Elsa.Connections.Persistence.Entities.ConnectionDefinition", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("ConnectionConfiguration") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("ConnectionType") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("Description") - .HasColumnType("TEXT"); - - b.Property("Name") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("TenantId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .HasDatabaseName("IX_ConnectionDefinition_Name"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_ConnectionDefinition_TenantId"); - - b.ToTable("ConnectionDefinitions", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.Connections.Persistence.EntityFrameworkCore.Sqlite/SqliteProvidersExtensions.cs b/src/modules/Elsa.Connections.Persistence.EntityFrameworkCore.Sqlite/SqliteProvidersExtensions.cs deleted file mode 100644 index 9a38e37224..0000000000 --- a/src/modules/Elsa.Connections.Persistence.EntityFrameworkCore.Sqlite/SqliteProvidersExtensions.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System.Reflection; -using Elsa.Connections.Persistence.EntityFrameworkCore; - -// ReSharper disable once CheckNamespace -namespace Elsa.EntityFrameworkCore.Extensions; - -/// -/// Provides extensions to configure EF Core to use Sqlite. -/// -public static class ConnectionsSqliteProvidersExtensions -{ - private static Assembly Assembly => typeof(ConnectionsSqliteProvidersExtensions).Assembly; - - /// - /// Configures the feature to use Sqlite. - /// - public static EFCoreConnectionPersistenceFeature UseSqlite(this EFCoreConnectionPersistenceFeature feature, string? connectionString = null, ElsaDbContextOptions? options = null) - { - feature.UseSqlite(Assembly, connectionString, options); - return feature; - } - - public static EFCoreConnectionPersistenceFeature UseSqlite(this EFCoreConnectionPersistenceFeature feature, Func connectionStringFunc, ElsaDbContextOptions? options = null) - { - feature.UseSqlite(Assembly, connectionStringFunc, options); - return feature; - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Connections.Persistence.EntityFrameworkCore.Sqlite/efcore-3.3.sh b/src/modules/Elsa.Connections.Persistence.EntityFrameworkCore.Sqlite/efcore-3.3.sh deleted file mode 100644 index e5eb4289ee..0000000000 --- a/src/modules/Elsa.Connections.Persistence.EntityFrameworkCore.Sqlite/efcore-3.3.sh +++ /dev/null @@ -1 +0,0 @@ -ef-migration-runtime-schema --interface Elsa.EntityFrameworkCore.IElsaDbContextSchema --efOptions "migrations add V3_3 -c ConnectionDbContext -o Migrations" \ No newline at end of file diff --git a/src/modules/Elsa.Connections.Persistence.EntityFrameworkCore/Configurations.cs b/src/modules/Elsa.Connections.Persistence.EntityFrameworkCore/Configurations.cs deleted file mode 100644 index cc2a3167d4..0000000000 --- a/src/modules/Elsa.Connections.Persistence.EntityFrameworkCore/Configurations.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Elsa.Connections.Models; -using Elsa.Connections.Persistence.Entities; -using Elsa.EntityFrameworkCore.Extensions; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; - -namespace Elsa.Connections.Persistence.EntityFrameworkCore; -public class Configurations : IEntityTypeConfiguration -{ - public void Configure(EntityTypeBuilder builder) - { - builder.Property(x => x.ConnectionConfiguration).HasJsonValueConversion(); - builder.HasIndex(x => x.Name).HasDatabaseName($"IX_{nameof(ConnectionDefinition)}_{nameof(ConnectionDefinition.Name)}"); - builder.HasIndex(x => x.TenantId).HasDatabaseName($"IX_{nameof(ConnectionDefinition)}_{nameof(ConnectionDefinition.TenantId)}"); - - } -} diff --git a/src/modules/Elsa.Connections.Persistence.EntityFrameworkCore/DbContext.cs b/src/modules/Elsa.Connections.Persistence.EntityFrameworkCore/DbContext.cs deleted file mode 100644 index f1b5217447..0000000000 --- a/src/modules/Elsa.Connections.Persistence.EntityFrameworkCore/DbContext.cs +++ /dev/null @@ -1,34 +0,0 @@ -using Elsa.Connections.Models; -using Elsa.EntityFrameworkCore; -using Elsa.Connections.Persistence.Entities; -using JetBrains.Annotations; -using Microsoft.EntityFrameworkCore; - -namespace Elsa.Connections.Persistence.EntityFrameworkCore; - - -/// -/// Db Context for the Connection Module -/// -[UsedImplicitly] -public class ConnectionDbContext : ElsaDbContextBase -{ - /// - public ConnectionDbContext(DbContextOptions options, IServiceProvider serviceProvider) - : base(options, serviceProvider) - { - } - - /// - /// The Connection DB set. - /// - public DbSet ConnectionDefinitions { get; set; } = default!; - - /// - protected override void OnModelCreating(ModelBuilder modelBuilder) - { - var configuration = new Configurations(); - modelBuilder.ApplyConfiguration(configuration); - base.OnModelCreating(modelBuilder); - } -} diff --git a/src/modules/Elsa.Connections.Persistence.EntityFrameworkCore/EFCoreConnectionStore.cs b/src/modules/Elsa.Connections.Persistence.EntityFrameworkCore/EFCoreConnectionStore.cs deleted file mode 100644 index bfe4a62034..0000000000 --- a/src/modules/Elsa.Connections.Persistence.EntityFrameworkCore/EFCoreConnectionStore.cs +++ /dev/null @@ -1,54 +0,0 @@ -using Elsa.Connections.Persistence.Contracts; -using Elsa.Connections.Persistence.Entities; -using Elsa.Connections.Persistence.Filters; -using Elsa.EntityFrameworkCore; -using JetBrains.Annotations; - -namespace Elsa.Connections.Persistence.EntityFrameworkCore; - -/// -/// An EF Core implementation of . -/// -[UsedImplicitly] -public class EFCoreConnectionStore(EntityStore store) : IConnectionStore -{ - public Task AddAsync(ConnectionDefinition entity, CancellationToken cancellationToken = default) - { - return store.AddAsync(entity, cancellationToken); - } - - public Task UpdateAsync(ConnectionDefinition entity, CancellationToken cancellationToken = default) - { - return store.UpdateAsync(entity, cancellationToken); - } - - public Task GetAsync(string id, CancellationToken cancellationToken = default) - { - var filter = new ConnectionDefinitionFilter - { - Id = id - }; - - return FindAsync(filter, cancellationToken); - } - - public Task FindAsync(ConnectionDefinitionFilter filter, CancellationToken cancellationToken = default) - { - return store.FindAsync(filter.Apply, cancellationToken); - } - - public Task> ListAsync(CancellationToken cancellationToken = default) - { - return store.ListAsync(cancellationToken); - } - - public Task DeleteAsync(ConnectionDefinition entity, CancellationToken cancellationToken = default) - { - return store.DeleteAsync(entity, cancellationToken); - } - - public Task> FindManyAsync(ConnectionDefinitionFilter filter, CancellationToken cancellationToken = default) - { - return store.QueryAsync(filter.Apply, cancellationToken); - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Connections.Persistence.EntityFrameworkCore/Elsa.Connections.Persistence.EntityFrameworkCore.csproj b/src/modules/Elsa.Connections.Persistence.EntityFrameworkCore/Elsa.Connections.Persistence.EntityFrameworkCore.csproj deleted file mode 100644 index 0931ad805f..0000000000 --- a/src/modules/Elsa.Connections.Persistence.EntityFrameworkCore/Elsa.Connections.Persistence.EntityFrameworkCore.csproj +++ /dev/null @@ -1,13 +0,0 @@ - - - - Provides an Entity Framework Core provider for the persistence layer of the Connection module - elsa connection persistence efcore entity framework core - - - - - - - - diff --git a/src/modules/Elsa.Connections.Persistence.EntityFrameworkCore/Extensions.cs b/src/modules/Elsa.Connections.Persistence.EntityFrameworkCore/Extensions.cs deleted file mode 100644 index 718e6446c5..0000000000 --- a/src/modules/Elsa.Connections.Persistence.EntityFrameworkCore/Extensions.cs +++ /dev/null @@ -1,22 +0,0 @@ -using Elsa.Connections.Persistence.Features; -using Elsa.Connections.Persistence.EntityFrameworkCore; -using JetBrains.Annotations; - -// ReSharper disable once CheckNamespace -namespace Elsa.Agents; - -/// -/// Provides extensions to the feature. -/// -[PublicAPI] -public static class Extensions -{ - /// - /// Configures the to use EF Core persistence providers. - /// - public static ConnectionPersistenceFeature UseEntityFrameworkCore(this ConnectionPersistenceFeature feature, Action? configure = default) - { - feature.Module.Configure(configure); - return feature; - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Connections.Persistence.EntityFrameworkCore/Feature.cs b/src/modules/Elsa.Connections.Persistence.EntityFrameworkCore/Feature.cs deleted file mode 100644 index 5d8d9524ba..0000000000 --- a/src/modules/Elsa.Connections.Persistence.EntityFrameworkCore/Feature.cs +++ /dev/null @@ -1,34 +0,0 @@ -using Elsa.Connections.Persistence.Entities; -using Elsa.Connections.Persistence.Features; -using Elsa.EntityFrameworkCore; -using Elsa.EntityFrameworkCore.EntityHandlers; -using Elsa.Features.Attributes; -using Elsa.Features.Services; -using Microsoft.Extensions.DependencyInjection; - -namespace Elsa.Connections.Persistence.EntityFrameworkCore; - -/// -/// Configures the default workflow runtime to use EF Core persistence providers. -/// -[DependsOn(typeof(ConnectionPersistenceFeature))] -public class EFCoreConnectionPersistenceFeature(IModule module) : PersistenceFeatureBase(module) -{ - /// - public override void Configure() - { - Module.Configure(feature => - { - feature - .UseConnectionStore(sp=> sp.GetRequiredService()) - ; - }); - } - - /// - public override void Apply() - { - base.Apply(); - AddEntityStore(); - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Connections.Persistence.EntityFrameworkCore/FodyWeavers.xml b/src/modules/Elsa.Connections.Persistence.EntityFrameworkCore/FodyWeavers.xml deleted file mode 100644 index ac6b5b2928..0000000000 --- a/src/modules/Elsa.Connections.Persistence.EntityFrameworkCore/FodyWeavers.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/src/modules/Elsa.Connections.Persistence/Contracts/IConnectionStore.cs b/src/modules/Elsa.Connections.Persistence/Contracts/IConnectionStore.cs deleted file mode 100644 index 1e4b63cb4d..0000000000 --- a/src/modules/Elsa.Connections.Persistence/Contracts/IConnectionStore.cs +++ /dev/null @@ -1,42 +0,0 @@ -using Elsa.Connections.Persistence.Filters; -using Elsa.Connections.Persistence.Entities; - -namespace Elsa.Connections.Persistence.Contracts; - -public interface IConnectionStore -{ - /// - /// Get The Connection from the Store - /// - public Task GetAsync(string id, CancellationToken cancellationToken = default); - - /// - /// Get All Connections from the store - /// - public Task> ListAsync(CancellationToken cancellationToken = default); - - /// - /// Get All connection using Filter - /// - public Task FindAsync(ConnectionDefinitionFilter filter, CancellationToken cancellationToken = default); - - /// - /// Get All connection using Filter - /// - public Task> FindManyAsync(ConnectionDefinitionFilter filter, CancellationToken cancellationToken = default); - - /// - /// Add a new entity to the store - /// - public Task AddAsync(ConnectionDefinition entity, CancellationToken cancellationToken = default); - - /// - /// Update the entity to the store - /// - public Task UpdateAsync(ConnectionDefinition entity, CancellationToken cancellationToken = default); - - /// - /// Delete the entity from the store - /// - public Task DeleteAsync(ConnectionDefinition entity, CancellationToken cancellationToken = default); -} diff --git a/src/modules/Elsa.Connections.Persistence/Elsa.Connections.Persistence.csproj b/src/modules/Elsa.Connections.Persistence/Elsa.Connections.Persistence.csproj deleted file mode 100644 index cf7ec74b8e..0000000000 --- a/src/modules/Elsa.Connections.Persistence/Elsa.Connections.Persistence.csproj +++ /dev/null @@ -1,13 +0,0 @@ - - - - Provides Connections persistence services - elsa module connections persistence - - - - - - - - diff --git a/src/modules/Elsa.Connections.Persistence/Entities/ConnectionDefinition.cs b/src/modules/Elsa.Connections.Persistence/Entities/ConnectionDefinition.cs deleted file mode 100644 index 15a1e46ffd..0000000000 --- a/src/modules/Elsa.Connections.Persistence/Entities/ConnectionDefinition.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System.Text.Json.Nodes; -using Elsa.Common.Entities; - -namespace Elsa.Connections.Persistence.Entities; - -public class ConnectionDefinition : Entity -{ - /// - /// The Name of the Connection - /// - public string Name { get; set; } = null!; - - /// - /// The Description of the Connection - /// - public string? Description { get; set; } - - /// - /// The Configuration of the Connection in a Json Format - /// - public JsonObject ConnectionConfiguration { get; set; } = new(); - - /// - /// The Connection Type Name - /// - public string ConnectionType { get; set; } = null!; -} \ No newline at end of file diff --git a/src/modules/Elsa.Connections.Persistence/Extensions/ConnectionPersistenceExtensions.cs b/src/modules/Elsa.Connections.Persistence/Extensions/ConnectionPersistenceExtensions.cs deleted file mode 100644 index af3eb822bc..0000000000 --- a/src/modules/Elsa.Connections.Persistence/Extensions/ConnectionPersistenceExtensions.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Elsa.Connections.Persistence.Features; -using Elsa.Features.Services; - -// ReSharper disable once CheckNamespace -namespace Elsa.Extensions; - -/// -/// Extends with methods to use Connection Persistence Feature. -/// -public static class ConnectionPersistenceExtensions -{ - /// - /// Installs the persistence feature for the Connection module. - /// - public static IModule UseConnectionPersistence(this IModule module, Action? configure = null) - { - return module.Use(configure); - } -} diff --git a/src/modules/Elsa.Connections.Persistence/Features/ConnectionPersistenceFeature.cs b/src/modules/Elsa.Connections.Persistence/Features/ConnectionPersistenceFeature.cs deleted file mode 100644 index b93658e06f..0000000000 --- a/src/modules/Elsa.Connections.Persistence/Features/ConnectionPersistenceFeature.cs +++ /dev/null @@ -1,28 +0,0 @@ -using Elsa.Extensions; -using Elsa.Features.Abstractions; -using Elsa.Features.Services; -using Microsoft.Extensions.DependencyInjection; -using Elsa.Connections.Persistence.Contracts; -using Elsa.Connections.Persistence.Services; -using Elsa.Connections.Persistence.Entities; - -namespace Elsa.Connections.Persistence.Features; - -public class ConnectionPersistenceFeature(IModule module) : FeatureBase(module) -{ - private Func _connectionStoreFactory = sp => sp.GetRequiredService(); - - public ConnectionPersistenceFeature UseConnectionStore(Func factory) - { - _connectionStoreFactory = factory; - return this; - } - - public override void Apply() - { - Services.AddScoped(_connectionStoreFactory); - - Services - .AddMemoryStore(); - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Connections.Persistence/Filters/ConnectionDefinitionFilter.cs b/src/modules/Elsa.Connections.Persistence/Filters/ConnectionDefinitionFilter.cs deleted file mode 100644 index 021a519cb4..0000000000 --- a/src/modules/Elsa.Connections.Persistence/Filters/ConnectionDefinitionFilter.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Elsa.Connections.Persistence.Entities; - -namespace Elsa.Connections.Persistence.Filters; -public class ConnectionDefinitionFilter -{ - public string? Id { get; set; } - public string? Name { get; set; } - public string? NotId { get; set; } - public string? Type { get; set; } - - public IQueryable Apply(IQueryable queryable) - { - if(!string.IsNullOrEmpty(Id)) queryable = queryable.Where(x=>x.Id == Id); - if (!string.IsNullOrWhiteSpace(NotId)) queryable = queryable.Where(x => x.Id != NotId); - if (!string.IsNullOrWhiteSpace(Name)) queryable = queryable.Where(x=> x.Name == Name); - if(!string.IsNullOrWhiteSpace(Type)) queryable = queryable.Where(x=>x.ConnectionType == Type); - return queryable; - } -} diff --git a/src/modules/Elsa.Connections.Persistence/FodyWeavers.xml b/src/modules/Elsa.Connections.Persistence/FodyWeavers.xml deleted file mode 100644 index ac6b5b2928..0000000000 --- a/src/modules/Elsa.Connections.Persistence/FodyWeavers.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/src/modules/Elsa.Connections.Persistence/Services/InMemoryConnectionStore.cs b/src/modules/Elsa.Connections.Persistence/Services/InMemoryConnectionStore.cs deleted file mode 100644 index 3a9af9fa70..0000000000 --- a/src/modules/Elsa.Connections.Persistence/Services/InMemoryConnectionStore.cs +++ /dev/null @@ -1,52 +0,0 @@ -using Elsa.Common.Services; -using Elsa.Connections.Persistence.Contracts; -using Elsa.Connections.Persistence.Filters; -using Elsa.Connections.Persistence.Entities; -using JetBrains.Annotations; - -namespace Elsa.Connections.Persistence.Services; - -[UsedImplicitly] -public class InMemoryConnectionStore(MemoryStore memoryStore) : IConnectionStore -{ - public Task AddAsync(ConnectionDefinition model, CancellationToken cancellationToken = default) - { - memoryStore.Add(model, x => x.Id); - return Task.CompletedTask; - } - - public Task DeleteAsync(ConnectionDefinition model, CancellationToken cancellationToken = default) - { - memoryStore.Delete(model.Id); - return Task.CompletedTask; - } - - public Task GetAsync(string id, CancellationToken cancellationToken = default) - { - var result = memoryStore.Find(c => c.Id == id); - return Task.FromResult(result); - } - - public Task> ListAsync(CancellationToken cancellationToken) - { - var results = memoryStore.List(); - return Task.FromResult(results); - } - public Task FindAsync(ConnectionDefinitionFilter filter, CancellationToken cancellationToken = default) - { - var entity = memoryStore.Query(filter.Apply).FirstOrDefault(); - return Task.FromResult(entity); - } - - public Task> FindManyAsync(ConnectionDefinitionFilter filter, CancellationToken cancellationToken = default) - { - var entities = memoryStore.Query(filter.Apply); - return Task.FromResult(entities); - } - - public Task UpdateAsync(ConnectionDefinition model, CancellationToken cancellationToken = default) - { - memoryStore.Update(model, x => x.Id); - return Task.CompletedTask; - } -} diff --git a/src/modules/Elsa.Dapper.Migrations/Elsa.Dapper.Migrations.csproj b/src/modules/Elsa.Dapper.Migrations/Elsa.Dapper.Migrations.csproj deleted file mode 100644 index 16c1b56acc..0000000000 --- a/src/modules/Elsa.Dapper.Migrations/Elsa.Dapper.Migrations.csproj +++ /dev/null @@ -1,14 +0,0 @@ - - - - - Provides Dapper migrations for Dapper perisstence providers from various modules. - - elsa persistence dapper migrations - - - - - - - diff --git a/src/modules/Elsa.Dapper.Migrations/FodyWeavers.xml b/src/modules/Elsa.Dapper.Migrations/FodyWeavers.xml deleted file mode 100644 index 00e1d9a1c1..0000000000 --- a/src/modules/Elsa.Dapper.Migrations/FodyWeavers.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/src/modules/Elsa.Dapper.Migrations/Identity/Initial.cs b/src/modules/Elsa.Dapper.Migrations/Identity/Initial.cs deleted file mode 100644 index aea88eae57..0000000000 --- a/src/modules/Elsa.Dapper.Migrations/Identity/Initial.cs +++ /dev/null @@ -1,48 +0,0 @@ -using FluentMigrator; -using JetBrains.Annotations; -using static System.Int32; - -namespace Elsa.Dapper.Migrations.Identity; - -/// -[Migration(30001, "Elsa:Identity:V3.0")] -[PublicAPI] -public class Initial : Migration -{ - /// - public override void Up() - { - Create - .Table("Users") - .WithColumn("Id").AsString().PrimaryKey() - .WithColumn("Name").AsString().NotNullable() - .WithColumn("HashedPassword").AsString().NotNullable() - .WithColumn("HashedPasswordSalt").AsString().NotNullable() - .WithColumn("Roles").AsString(MaxValue).NotNullable(); - - Create - .Table("Roles") - .WithColumn("Id").AsString().PrimaryKey() - .WithColumn("Name").AsString().NotNullable() - .WithColumn("Permissions").AsString(MaxValue).NotNullable(); - - Create - .Table("Applications") - .WithColumn("Id").AsString().PrimaryKey() - .WithColumn("ClientId").AsString().NotNullable() - .WithColumn("HashedClientSecret").AsString().NotNullable() - .WithColumn("HashedClientSecretSalt").AsString().NotNullable() - .WithColumn("Name").AsString().NotNullable() - .WithColumn("HashedApiKey").AsString().NotNullable() - .WithColumn("HashedApiKeySalt").AsString().NotNullable() - .WithColumn("Roles").AsString(MaxValue).NotNullable(); - } - - /// - public override void Down() - { - Delete.Table("Users"); - Delete.Table("Roles"); - Delete.Table("Applications"); - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Dapper.Migrations/Identity/V3_1.cs b/src/modules/Elsa.Dapper.Migrations/Identity/V3_1.cs deleted file mode 100644 index 75d8ab191f..0000000000 --- a/src/modules/Elsa.Dapper.Migrations/Identity/V3_1.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System.Diagnostics.CodeAnalysis; -using FluentMigrator; -using JetBrains.Annotations; - -namespace Elsa.Dapper.Migrations.Identity; - -/// -[Migration(30002, "Elsa:Identity:V3.1")] -[PublicAPI] -[SuppressMessage("ReSharper", "InconsistentNaming")] -public class V3_1 : Migration -{ - /// - public override void Up() - { - // No changes - } - - /// - public override void Down() - { - // No changes - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Dapper.Migrations/Identity/V3_2.cs b/src/modules/Elsa.Dapper.Migrations/Identity/V3_2.cs deleted file mode 100644 index 3342605ec2..0000000000 --- a/src/modules/Elsa.Dapper.Migrations/Identity/V3_2.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System.Diagnostics.CodeAnalysis; -using FluentMigrator; -using JetBrains.Annotations; - -namespace Elsa.Dapper.Migrations.Identity; - -/// -[Migration(30003, "Elsa:Identity:V3.2")] -[PublicAPI] -[SuppressMessage("ReSharper", "InconsistentNaming")] -public class V3_2 : Migration -{ - /// - public override void Up() - { - } - - /// - public override void Down() - { - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Dapper.Migrations/Identity/V3_3.cs b/src/modules/Elsa.Dapper.Migrations/Identity/V3_3.cs deleted file mode 100644 index fe79d8fff2..0000000000 --- a/src/modules/Elsa.Dapper.Migrations/Identity/V3_3.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System.Diagnostics.CodeAnalysis; -using FluentMigrator; -using JetBrains.Annotations; - -namespace Elsa.Dapper.Migrations.Identity; - -/// -[Migration(30004, "Elsa:Identity:V3.3")] -[PublicAPI] -[SuppressMessage("ReSharper", "InconsistentNaming")] -public class V3_3 : Migration -{ - /// - public override void Up() - { - Alter.Table("Users").AddColumn("TenantId").AsString().Nullable(); - Alter.Table("Roles").AddColumn("TenantId").AsString().Nullable(); - Alter.Table("Applications").AddColumn("TenantId").AsString().Nullable(); - } - - /// - public override void Down() - { - Delete.Column("TenantId").FromTable("Users"); - Delete.Column("TenantId").FromTable("Roles"); - Delete.Column("TenantId").FromTable("Applications"); - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Dapper.Migrations/Management/Initial.cs b/src/modules/Elsa.Dapper.Migrations/Management/Initial.cs deleted file mode 100644 index 4fbad50447..0000000000 --- a/src/modules/Elsa.Dapper.Migrations/Management/Initial.cs +++ /dev/null @@ -1,99 +0,0 @@ -using FluentMigrator; -using JetBrains.Annotations; -using static System.Int32; - -namespace Elsa.Dapper.Migrations.Management; - -/// -[Migration(10001, "Elsa:Management:V3.0")] -[PublicAPI] -public class Initial : Migration -{ - /// - public override void Up() - { - IfDatabase("SqlServer", "Oracle", "MySql", "Postgres") - .Create - .Table("WorkflowDefinitions") - .WithColumn("Id").AsString().PrimaryKey() - .WithColumn("DefinitionId").AsString().NotNullable() - .WithColumn("Name").AsString().Nullable() - .WithColumn("ToolVersion").AsString().Nullable() - .WithColumn("Description").AsString(MaxValue).Nullable() - .WithColumn("ProviderName").AsString().Nullable() - .WithColumn("MaterializerName").AsString().NotNullable() - .WithColumn("MaterializerContext").AsString(MaxValue).Nullable() - .WithColumn("Props").AsString(MaxValue).NotNullable() - .WithColumn("UsableAsActivity").AsBoolean().Nullable() - .WithColumn("StringData").AsString(MaxValue).Nullable() - .WithColumn("BinaryData").AsBinary(MaxValue).Nullable() - .WithColumn("CreatedAt").AsDateTimeOffset().NotNullable() - .WithColumn("Version").AsInt32().NotNullable() - .WithColumn("IsLatest").AsBoolean().NotNullable() - .WithColumn("IsReadonly").AsBoolean().NotNullable() - .WithColumn("IsPublished").AsBoolean().NotNullable(); - - - IfDatabase("Sqlite") - .Create - .Table("WorkflowDefinitions") - .WithColumn("Id").AsString().PrimaryKey() - .WithColumn("DefinitionId").AsString().NotNullable() - .WithColumn("Name").AsString().Nullable() - .WithColumn("ToolVersion").AsString().Nullable() - .WithColumn("Description").AsString(MaxValue).Nullable() - .WithColumn("ProviderName").AsString().Nullable() - .WithColumn("MaterializerName").AsString().NotNullable() - .WithColumn("MaterializerContext").AsString().Nullable() - .WithColumn("Props").AsString(MaxValue).NotNullable() - .WithColumn("UsableAsActivity").AsBoolean().Nullable() - .WithColumn("StringData").AsString(MaxValue).Nullable() - .WithColumn("BinaryData").AsBinary(MaxValue).Nullable() - .WithColumn("CreatedAt").AsDateTime2().NotNullable() - .WithColumn("Version").AsInt32().NotNullable() - .WithColumn("IsLatest").AsBoolean().NotNullable() - .WithColumn("IsReadonly").AsBoolean().NotNullable() - .WithColumn("IsPublished").AsBoolean().NotNullable(); - - IfDatabase("SqlServer", "Oracle", "MySql", "Postgres") - .Create - .Table("WorkflowInstances") - .WithColumn("Id").AsString().PrimaryKey() - .WithColumn("DefinitionId").AsString().NotNullable() - .WithColumn("DefinitionVersionId").AsString().NotNullable() - .WithColumn("Version").AsInt32().NotNullable() - .WithColumn("WorkflowState").AsString(MaxValue).NotNullable() - .WithColumn("Status").AsString().NotNullable() - .WithColumn("SubStatus").AsString().NotNullable() - .WithColumn("CorrelationId").AsString().Nullable() - .WithColumn("Name").AsString().Nullable() - .WithColumn("IncidentCount").AsInt32().NotNullable() - .WithColumn("CreatedAt").AsDateTimeOffset().NotNullable() - .WithColumn("UpdatedAt").AsDateTimeOffset().Nullable() - .WithColumn("FinishedAt").AsDateTimeOffset().Nullable(); - - IfDatabase("Sqlite") - .Create - .Table("WorkflowInstances") - .WithColumn("Id").AsString().PrimaryKey() - .WithColumn("DefinitionId").AsString().NotNullable() - .WithColumn("DefinitionVersionId").AsString().NotNullable() - .WithColumn("Version").AsInt32().NotNullable() - .WithColumn("WorkflowState").AsString(MaxValue).NotNullable() - .WithColumn("Status").AsString().NotNullable() - .WithColumn("SubStatus").AsString().NotNullable() - .WithColumn("CorrelationId").AsString().Nullable() - .WithColumn("Name").AsString().Nullable() - .WithColumn("IncidentCount").AsInt32().NotNullable() - .WithColumn("CreatedAt").AsDateTime2().NotNullable() - .WithColumn("UpdatedAt").AsDateTime2().Nullable() - .WithColumn("FinishedAt").AsDateTime2().Nullable(); - } - - /// - public override void Down() - { - Delete.Table("WorkflowDefinitions"); - Delete.Table("WorkflowInstances"); - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Dapper.Migrations/Management/V3_1.cs b/src/modules/Elsa.Dapper.Migrations/Management/V3_1.cs deleted file mode 100644 index bac4582666..0000000000 --- a/src/modules/Elsa.Dapper.Migrations/Management/V3_1.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System.Diagnostics.CodeAnalysis; -using FluentMigrator; -using JetBrains.Annotations; - -namespace Elsa.Dapper.Migrations.Management; - -/// -[Migration(10002, "Elsa:Management:V3.1")] -[PublicAPI] -[SuppressMessage("ReSharper", "InconsistentNaming")] -public class V3_1 : Migration -{ - /// - public override void Up() - { - Alter - .Table("WorkflowDefinitions") - .AddColumn("IsSystem").AsBoolean().Nullable(); - - Alter - .Table("WorkflowInstances") - .AddColumn("IsSystem").AsBoolean().Nullable(); - } - - /// - public override void Down() - { - Delete.Column("IsSystem").FromTable("WorkflowInstances"); - Delete.Column("IsSystem").FromTable("WorkflowDefinitions"); - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Dapper.Migrations/Management/V3_2.cs b/src/modules/Elsa.Dapper.Migrations/Management/V3_2.cs deleted file mode 100644 index 1d9270a86a..0000000000 --- a/src/modules/Elsa.Dapper.Migrations/Management/V3_2.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System.Diagnostics.CodeAnalysis; -using FluentMigrator; -using JetBrains.Annotations; - -namespace Elsa.Dapper.Migrations.Management; - -/// -[Migration(10003, "Elsa:Management:V3.2")] -[PublicAPI] -[SuppressMessage("ReSharper", "InconsistentNaming")] -public class V3_2 : Migration -{ - /// - public override void Up() - { - } - - /// - public override void Down() - { - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Dapper.Migrations/Management/V3_3.cs b/src/modules/Elsa.Dapper.Migrations/Management/V3_3.cs deleted file mode 100644 index ae13177d88..0000000000 --- a/src/modules/Elsa.Dapper.Migrations/Management/V3_3.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System.Diagnostics.CodeAnalysis; -using FluentMigrator; -using JetBrains.Annotations; - -namespace Elsa.Dapper.Migrations.Management; - -/// -[Migration(10004, "Elsa:Management:V3.3")] -[PublicAPI] -[SuppressMessage("ReSharper", "InconsistentNaming")] -public class V3_3: Migration -{ - /// - public override void Up() - { - Alter.Table("WorkflowDefinitions").AddColumn("TenantId").AsString().Nullable(); - Alter.Table("WorkflowInstances").AddColumn("TenantId").AsString().Nullable(); - } - - /// - public override void Down() - { - Delete.Column("TenantId").FromTable("WorkflowDefinitions"); - Delete.Column("TenantId").FromTable("WorkflowInstances"); - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Dapper.Migrations/Management/V3_4.cs b/src/modules/Elsa.Dapper.Migrations/Management/V3_4.cs deleted file mode 100644 index f4d8cff759..0000000000 --- a/src/modules/Elsa.Dapper.Migrations/Management/V3_4.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System.Diagnostics.CodeAnalysis; -using FluentMigrator; -using JetBrains.Annotations; - -namespace Elsa.Dapper.Migrations.Management; - -/// -[Migration(10005, "Elsa:Management:V3.4")] -[PublicAPI] -[SuppressMessage("ReSharper", "InconsistentNaming")] -public class V3_4: Migration -{ - /// - public override void Up() - { - Alter.Table("WorkflowInstances").AddColumn("IsExecuting").AsBoolean().NotNullable().WithDefaultValue(false); - } - - /// - public override void Down() - { - Delete.Column("IsExecuting").FromTable("WorkflowInstances"); - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Dapper.Migrations/Readme.md b/src/modules/Elsa.Dapper.Migrations/Readme.md deleted file mode 100644 index a5e0686c30..0000000000 --- a/src/modules/Elsa.Dapper.Migrations/Readme.md +++ /dev/null @@ -1,14 +0,0 @@ -# Migration versioning - -Each migration's version number is prefixed with a numerical value that represents a given module. -The following table shows the mapping between module and version prefix: - -| Module | Version prefix | -|------------------------|-----------------| -| Management | 1000 | -| Runtime | 2000 | -| Identity | 3000 | - -After the prefix comes the version of the migration. For example, the "Initial" migration is at version 1. -For the "Management" module, the "Initial" migration is at version 10001. -Similarly, the "Initial" migration for the "Runtime" module is at version 20001. diff --git a/src/modules/Elsa.Dapper.Migrations/Runtime/Initial.cs b/src/modules/Elsa.Dapper.Migrations/Runtime/Initial.cs deleted file mode 100644 index 866b4f6d79..0000000000 --- a/src/modules/Elsa.Dapper.Migrations/Runtime/Initial.cs +++ /dev/null @@ -1,183 +0,0 @@ -using FluentMigrator; -using JetBrains.Annotations; -using static System.Int32; - -namespace Elsa.Dapper.Migrations.Runtime; - -/// -[Migration(20001, "Elsa:Runtime:V3.0")] -[PublicAPI] -public class Initial : Migration -{ - private const int MaxNodeIdColumnLength = 2048; - /// - public override void Up() - { - Create - .Table("Triggers") - .WithColumn("Id").AsString().PrimaryKey() - .WithColumn("WorkflowDefinitionId").AsString().NotNullable().Indexed() - .WithColumn("WorkflowDefinitionVersionId").AsString().NotNullable().Indexed() - .WithColumn("Name").AsString().NotNullable().Indexed() - .WithColumn("ActivityId").AsString().NotNullable().Indexed() - .WithColumn("Hash").AsString().Nullable().Indexed() - .WithColumn("SerializedPayload").AsString(MaxValue).Nullable(); - - IfDatabase("SqlServer", "Oracle", "MySql", "Postgres") - .Create - .Table("Bookmarks") - .WithColumn("Id").AsString().PrimaryKey() - .WithColumn("ActivityTypeName").AsString().NotNullable().Indexed() - .WithColumn("WorkflowInstanceId").AsString().NotNullable().Indexed() - .WithColumn("CorrelationId").AsString().Nullable().Indexed() - .WithColumn("ActivityInstanceId").AsString().NotNullable().Indexed() - .WithColumn("Hash").AsString().Nullable().Indexed() - .WithColumn("SerializedPayload").AsString(MaxValue).Nullable() - .WithColumn("SerializedMetadata").AsString(MaxValue).Nullable() - .WithColumn("CreatedAt").AsDateTimeOffset().NotNullable().Indexed(); - - IfDatabase("Sqlite") - .Create - .Table("Bookmarks") - .WithColumn("Id").AsString().PrimaryKey() - .WithColumn("ActivityTypeName").AsString().NotNullable().Indexed() - .WithColumn("WorkflowInstanceId").AsString().NotNullable().Indexed() - .WithColumn("CorrelationId").AsString().Nullable().Indexed() - .WithColumn("ActivityInstanceId").AsString().NotNullable().Indexed() - .WithColumn("Hash").AsString().Nullable().Indexed() - .WithColumn("SerializedPayload").AsString(MaxValue).Nullable() - .WithColumn("SerializedMetadata").AsString(MaxValue).Nullable() - .WithColumn("CreatedAt").AsDateTime2().NotNullable().Indexed(); - - IfDatabase("SqlServer", "Oracle", "MySql", "Postgres") - .Create - .Table("WorkflowExecutionLogRecords") - .WithColumn("Id").AsString().PrimaryKey() - .WithColumn("WorkflowDefinitionId").AsString().NotNullable().Indexed() - .WithColumn("WorkflowDefinitionVersionId").AsString().NotNullable().Indexed() - .WithColumn("WorkflowInstanceId").AsString().NotNullable().Indexed() - .WithColumn("WorkflowVersion").AsInt32().NotNullable().Indexed() - .WithColumn("ActivityInstanceId").AsString().NotNullable().Indexed() - .WithColumn("ParentActivityInstanceId").AsString().Nullable().Indexed() - .WithColumn("ActivityId").AsString().NotNullable().Indexed() - .WithColumn("ActivityType").AsString().NotNullable().Indexed() - .WithColumn("ActivityTypeVersion").AsInt32().NotNullable().Indexed() - .WithColumn("ActivityName").AsString().Nullable().Indexed() - .WithColumn("ActivityNodeId").AsString(MaxNodeIdColumnLength).NotNullable().Indexed() - .WithColumn("EventName").AsString().Nullable().Indexed() - .WithColumn("Message").AsString(MaxValue).Nullable() - .WithColumn("Source").AsString().Nullable() - .WithColumn("SerializedActivityState").AsString(MaxValue).Nullable() - .WithColumn("SerializedPayload").AsString(MaxValue).Nullable() - .WithColumn("SerializedException").AsString(MaxValue).Nullable() - .WithColumn("Timestamp").AsDateTimeOffset().NotNullable().Indexed() - .WithColumn("Sequence").AsInt64().NotNullable().Indexed() - ; - - IfDatabase("Sqlite") - .Create - .Table("WorkflowExecutionLogRecords") - .WithColumn("Id").AsString().PrimaryKey() - .WithColumn("WorkflowDefinitionId").AsString().NotNullable().Indexed() - .WithColumn("WorkflowDefinitionVersionId").AsString().NotNullable().Indexed() - .WithColumn("WorkflowInstanceId").AsString().NotNullable().Indexed() - .WithColumn("WorkflowVersion").AsInt32().NotNullable().Indexed() - .WithColumn("ActivityInstanceId").AsString().NotNullable().Indexed() - .WithColumn("ParentActivityInstanceId").AsString().Nullable().Indexed() - .WithColumn("ActivityId").AsString().NotNullable().Indexed() - .WithColumn("ActivityType").AsString().NotNullable().Indexed() - .WithColumn("ActivityTypeVersion").AsInt32().NotNullable().Indexed() - .WithColumn("ActivityName").AsString().Nullable().Indexed() - .WithColumn("ActivityNodeId").AsString(MaxNodeIdColumnLength).NotNullable().Indexed() - .WithColumn("EventName").AsString().Nullable().Indexed() - .WithColumn("Message").AsString(MaxValue).Nullable() - .WithColumn("Source").AsString().Nullable() - .WithColumn("SerializedActivityState").AsString(MaxValue).Nullable() - .WithColumn("SerializedPayload").AsString(MaxValue).Nullable() - .WithColumn("SerializedOutputs").AsString(MaxValue).Nullable() - .WithColumn("SerializedException").AsString(MaxValue).Nullable() - .WithColumn("Timestamp").AsDateTime2().NotNullable().Indexed() - .WithColumn("Sequence").AsInt64().NotNullable().Indexed() - ; - - IfDatabase("SqlServer", "Oracle", "MySql", "Postgres") - .Create - .Table("ActivityExecutionRecords") - .WithColumn("Id").AsString().PrimaryKey() - .WithColumn("WorkflowInstanceId").AsString().NotNullable().Indexed() - .WithColumn("ActivityId").AsString().NotNullable().Indexed() - .WithColumn("ActivityNodeId").AsString(MaxNodeIdColumnLength).NotNullable().Indexed() - .WithColumn("ActivityType").AsString().NotNullable().Indexed() - .WithColumn("ActivityTypeVersion").AsInt32().NotNullable().Indexed() - .WithColumn("ActivityName").AsString().Nullable().Indexed() - .WithColumn("SerializedActivityState").AsString(MaxValue).Nullable() - .WithColumn("SerializedPayload").AsString(MaxValue).Nullable() - .WithColumn("SerializedOutputs").AsString(MaxValue).Nullable() - .WithColumn("SerializedException").AsString(MaxValue).Nullable() - .WithColumn("StartedAt").AsDateTimeOffset().NotNullable().Indexed() - .WithColumn("CompletedAt").AsDateTimeOffset().Nullable().Indexed() - .WithColumn("HasBookmarks").AsBoolean().NotNullable().Indexed() - .WithColumn("Status").AsString().NotNullable().Indexed() - ; - - IfDatabase("Sqlite") - .Create - .Table("ActivityExecutionRecords") - .WithColumn("Id").AsString().PrimaryKey() - .WithColumn("WorkflowInstanceId").AsString().NotNullable().Indexed() - .WithColumn("ActivityId").AsString().NotNullable().Indexed() - .WithColumn("ActivityNodeId").AsString(MaxNodeIdColumnLength).NotNullable().Indexed() - .WithColumn("ActivityType").AsString().NotNullable().Indexed() - .WithColumn("ActivityTypeVersion").AsInt32().NotNullable().Indexed() - .WithColumn("ActivityName").AsString().Nullable().Indexed() - .WithColumn("SerializedActivityState").AsString(MaxValue).Nullable() - .WithColumn("SerializedPayload").AsString(MaxValue).Nullable() - .WithColumn("SerializedOutputs").AsString(MaxValue).Nullable() - .WithColumn("SerializedException").AsString(MaxValue).Nullable() - .WithColumn("StartedAt").AsDateTime2().NotNullable().Indexed() - .WithColumn("CompletedAt").AsDateTime2().Nullable().Indexed() - .WithColumn("HasBookmarks").AsBoolean().NotNullable().Indexed() - .WithColumn("Status").AsString().NotNullable().Indexed() - ; - - IfDatabase("SqlServer", "Oracle", "MySql", "Postgres") - .Create - .Table("WorkflowInboxMessages") - .WithColumn("Id").AsString().PrimaryKey() - .WithColumn("ActivityTypeName").AsString().NotNullable().Indexed() - .WithColumn("WorkflowInstanceId").AsString().Nullable().Indexed() - .WithColumn("ActivityInstanceId").AsString().Nullable().Indexed() - .WithColumn("CorrelationId").AsString().Nullable().Indexed() - .WithColumn("Hash").AsString().NotNullable().Indexed() - .WithColumn("SerializedBookmarkPayload").AsString(MaxValue) - .WithColumn("SerializedInput").AsString(MaxValue).Nullable() - .WithColumn("CreatedAt").AsDateTimeOffset().Indexed() - .WithColumn("ExpiresAt").AsDateTimeOffset().Indexed() - ; - - IfDatabase("Sqlite") - .Create - .Table("WorkflowInboxMessages") - .WithColumn("Id").AsString().PrimaryKey() - .WithColumn("ActivityTypeName").AsString().NotNullable().Indexed() - .WithColumn("WorkflowInstanceId").AsString().Nullable().Indexed() - .WithColumn("ActivityInstanceId").AsString().Nullable().Indexed() - .WithColumn("CorrelationId").AsString().Nullable().Indexed() - .WithColumn("Hash").AsString().NotNullable().Indexed() - .WithColumn("SerializedBookmarkPayload").AsString(MaxValue) - .WithColumn("SerializedInput").AsString(MaxValue).Nullable() - .WithColumn("CreatedAt").AsDateTime2().Indexed() - .WithColumn("ExpiresAt").AsDateTime2().Indexed() - ; - } - - /// - public override void Down() - { - Delete.Table("Triggers"); - Delete.Table("Bookmarks"); - Delete.Table("WorkflowExecutionLogRecords"); - Delete.Table("ActivityExecutionRecords"); - Delete.Table("WorkflowInboxMessages"); - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Dapper.Migrations/Runtime/V3_1.cs b/src/modules/Elsa.Dapper.Migrations/Runtime/V3_1.cs deleted file mode 100644 index ff74e9fb24..0000000000 --- a/src/modules/Elsa.Dapper.Migrations/Runtime/V3_1.cs +++ /dev/null @@ -1,29 +0,0 @@ -using System.Diagnostics.CodeAnalysis; -using FluentMigrator; -using JetBrains.Annotations; -using static System.Int32; - -namespace Elsa.Dapper.Migrations.Runtime; - -/// -[Migration(20002, "Elsa:Runtime:V3.1")] -[PublicAPI] -[SuppressMessage("ReSharper", "InconsistentNaming")] -public class V3_1 : Migration -{ - /// - public override void Up() - { - Create - .Table("KeyValuePairs") - .WithColumn("Id").AsString().PrimaryKey() - .WithColumn("Key").AsString().Indexed() - .WithColumn("Value").AsString(MaxValue).NotNullable(); - } - - /// - public override void Down() - { - Delete.Table("KeyValuePairs"); - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Dapper.Migrations/Runtime/V3_2.cs b/src/modules/Elsa.Dapper.Migrations/Runtime/V3_2.cs deleted file mode 100644 index f550c6260e..0000000000 --- a/src/modules/Elsa.Dapper.Migrations/Runtime/V3_2.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System.Diagnostics.CodeAnalysis; -using FluentMigrator; -using JetBrains.Annotations; - -namespace Elsa.Dapper.Migrations.Runtime; - -/// -[Migration(20003, "Elsa:Runtime:V3.2")] -[PublicAPI] -[SuppressMessage("ReSharper", "InconsistentNaming")] -public class V3_2 : Migration -{ - /// - public override void Up() - { - } - - /// - public override void Down() - { - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Dapper.Migrations/Runtime/V3_3.cs b/src/modules/Elsa.Dapper.Migrations/Runtime/V3_3.cs deleted file mode 100644 index 9e612040bd..0000000000 --- a/src/modules/Elsa.Dapper.Migrations/Runtime/V3_3.cs +++ /dev/null @@ -1,65 +0,0 @@ -using System.Diagnostics.CodeAnalysis; -using FluentMigrator; -using JetBrains.Annotations; -using static System.Int32; - -namespace Elsa.Dapper.Migrations.Runtime; - -/// -[Migration(20004, "Elsa:Runtime:V3.3")] -[PublicAPI] -[SuppressMessage("ReSharper", "InconsistentNaming")] -public class V3_3 : Migration -{ - /// - public override void Up() - { - Alter.Table("Triggers").AddColumn("TenantId").AsString().Nullable(); - Alter.Table("Bookmarks").AddColumn("TenantId").AsString().Nullable(); - Alter.Table("WorkflowExecutionLogRecords").AddColumn("TenantId").AsString().Nullable(); - Alter.Table("ActivityExecutionRecords").AddColumn("TenantId").AsString().Nullable(); - Alter.Table("ActivityExecutionRecords").AddColumn("SerializedProperties").AsString(MaxValue).Nullable(); - Alter.Table("KeyValuePairs").AddColumn("TenantId").AsString().Nullable(); - - IfDatabase("SqlServer", "Oracle", "MySql", "Postgres") - .Create - .Table("BookmarkQueueItems") - .WithColumn("Id").AsString().PrimaryKey() - .WithColumn("TenantId").AsString().Nullable() - .WithColumn("WorkflowInstanceId").AsString().Nullable() - .WithColumn("CorrelationId").AsString().Nullable() - .WithColumn("BookmarkId").AsString().Nullable() - .WithColumn("StimulusHash").AsString().Nullable() - .WithColumn("ActivityInstanceId").AsString().Nullable() - .WithColumn("ActivityTypeName").AsString().Nullable() - .WithColumn("CreatedAt").AsDateTimeOffset().NotNullable() - ; - - IfDatabase("Sqlite") - .Create - .Table("BookmarkQueueItems") - .WithColumn("Id").AsString().PrimaryKey() - .WithColumn("TenantId").AsString().Nullable() - .WithColumn("WorkflowInstanceId").AsString().Nullable() - .WithColumn("CorrelationId").AsString().Nullable() - .WithColumn("BookmarkId").AsString().Nullable() - .WithColumn("StimulusHash").AsString().Nullable() - .WithColumn("ActivityInstanceId").AsString().Nullable() - .WithColumn("ActivityTypeName").AsString().Nullable() - .WithColumn("CreatedAt").AsDateTime2().NotNullable() - ; - } - - /// - public override void Down() - { - Delete.Column("TenantId").FromTable("Triggers"); - Delete.Column("TenantId").FromTable("Bookmarks"); - Delete.Column("TenantId").FromTable("WorkflowExecutionLogRecords"); - Delete.Column("TenantId").FromTable("ActivityExecutionRecords"); - Delete.Column("SerializedProperties").FromTable("ActivityExecutionRecords"); - Delete.Column("TenantId").FromTable("KeyValuePairs"); - Rename.Column("Id").OnTable("KeyValuePairs").To("Key"); - Delete.Table("BookmarkQueueItems"); - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Dapper.Migrations/Runtime/V3_5.cs b/src/modules/Elsa.Dapper.Migrations/Runtime/V3_5.cs deleted file mode 100644 index 8f8ee478c9..0000000000 --- a/src/modules/Elsa.Dapper.Migrations/Runtime/V3_5.cs +++ /dev/null @@ -1,25 +0,0 @@ -using System.Diagnostics.CodeAnalysis; -using FluentMigrator; -using JetBrains.Annotations; -using static System.Int32; - -namespace Elsa.Dapper.Migrations.Runtime; - -/// -[Migration(20006, "Elsa:Runtime:V3.5")] -[PublicAPI] -[SuppressMessage("ReSharper", "InconsistentNaming")] -public class V3_5 : Migration -{ - /// - public override void Up() - { - Alter.Table("ActivityExecutionRecords").AddColumn("AggregateFaultCount").AsInt32().NotNullable().WithDefault(0); - } - - /// - public override void Down() - { - Delete.Column("AggregateFaultCount").FromTable("ActivityExecutionRecords"); - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Dapper/Abstractions/SqlDialectBase.cs b/src/modules/Elsa.Dapper/Abstractions/SqlDialectBase.cs deleted file mode 100644 index 2588562449..0000000000 --- a/src/modules/Elsa.Dapper/Abstractions/SqlDialectBase.cs +++ /dev/null @@ -1,113 +0,0 @@ -using System.Text; -using Elsa.Common.Entities; -using Elsa.Common.Models; -using Elsa.Dapper.Contracts; - -namespace Elsa.Dapper.Abstractions; - -/// -/// Provides a base implementation of , where the dialect defaults to SQLite. -/// -public abstract class SqlDialectBase : ISqlDialect -{ - /// - public virtual string From(string table) => From(table, "*"); - - /// - public virtual string From(string table, params string[] fields) - { - var fieldList = string.Join(", ", fields); - return $"select {fieldList} from {table} where 1=1"; - } - - /// - public string Delete(string table) => $"delete from {table} where 1=1"; - - /// - public string Count(string table) => Count("*", table); - - /// - public string Count(string fieldExpression, string table) => $"select COUNT({fieldExpression}) from {table} where 1=1"; - - /// - public virtual string And(string field) => $"and {field} = @{field}"; - - /// - public virtual string AndNot(string field) => $"and not {field} = @{field}"; - - /// - public virtual string And(string field, string[] fieldParamNames) => $"and {field} in ({string.Join(", ", fieldParamNames)})"; - - /// - public virtual string AndNot(string field, string[] fieldParamNames) => $"and {field} not in ({string.Join(", ", fieldParamNames)})"; - - /// - public string IsNull(string field) => $"and {field} is null"; - - /// - public string IsNotNull(string field) => $"and {field} is not null"; - - /// - public virtual string OrderBy(string field, OrderDirection direction) - { - var directionString = direction == OrderDirection.Ascending ? "asc" : "desc"; - return $"order by {field} {directionString}"; - } - - /// - public virtual string Skip(int count) => $"offset {count} rows"; - - /// - public virtual string Take(int count) => $"fetch next {count} rows only"; - - /// - public virtual string Page(PageArgs pageArgs) - { - var sb = new StringBuilder(); - - // Attention: the order is important here for SQL Server (OFFSET before FETCH NEXT). - if (pageArgs.Offset != null) - sb.AppendLine(Skip(pageArgs.Offset.Value)); - - if (pageArgs.Limit != null) - sb.AppendLine(Take(pageArgs.Limit.Value)); - - return sb.ToString(); - } - - /// - public string Insert(string table, string[] fields, Func? getParamName = default) - { - getParamName ??= x => x; - var fieldList = string.Join(", ", fields); - var fieldParamNames = fields.Select(x => $"@{getParamName(x)}"); - var fieldParamList = string.Join(", ", fieldParamNames); - return $"INSERT INTO {table} ({fieldList}) VALUES ({fieldParamList});"; - } - - public string Update(string table, string primaryKeyField, string[] fields, Func? getParamName = default) - { - getParamName ??= x => x; - var fieldList = string.Join(", ", fields.Select(x => $"{x} = @{getParamName(x)}")); - return $"UPDATE {table} SET {fieldList} WHERE {primaryKeyField} = @{getParamName(primaryKeyField)};"; - } - - /// - public virtual string Upsert(string table, string primaryKeyField, string[] fields, Func? getParamName = default) - { - getParamName ??= x => x; - var fieldList = string.Join(", ", fields); - var fieldParamNames = fields.Select(x => $"@{getParamName(x)}"); - var fieldParamList = string.Join(", ", fieldParamNames); - return @$" - MERGE INTO {table} WITH (HOLDLOCK) AS Target - USING (VALUES (@{getParamName(primaryKeyField)}, {fieldParamList})) - AS Source ({primaryKeyField}, {fieldList}) - ON Target.{primaryKeyField} = Source.{primaryKeyField} - WHEN MATCHED THEN - UPDATE SET {string.Join(", ", fields.Select(x => $"{x} = Source.{x}"))} - WHEN NOT MATCHED THEN - INSERT ({primaryKeyField}, {fieldList}) - VALUES (Source.{primaryKeyField}, {string.Join(", ", fields.Select(x => $"Source.{x}"))});"; - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Dapper/Contracts/IDbConnectionProvider.cs b/src/modules/Elsa.Dapper/Contracts/IDbConnectionProvider.cs deleted file mode 100644 index 8beb78f5d4..0000000000 --- a/src/modules/Elsa.Dapper/Contracts/IDbConnectionProvider.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System.Data; - -namespace Elsa.Dapper.Contracts; - -/// -/// Provides a connection to the database and corresponding SQL dialect. -/// -public interface IDbConnectionProvider -{ - /// - /// Gets the connection string. - /// - /// The connection string. - string GetConnectionString(); - - /// - /// Gets a connection to the database. - /// - /// A connection to the database. - IDbConnection GetConnection(); - - /// - /// Gets the SQL dialect. - /// - ISqlDialect Dialect { get; } -} \ No newline at end of file diff --git a/src/modules/Elsa.Dapper/Contracts/ISqlDialect.cs b/src/modules/Elsa.Dapper/Contracts/ISqlDialect.cs deleted file mode 100644 index 526b9ce487..0000000000 --- a/src/modules/Elsa.Dapper/Contracts/ISqlDialect.cs +++ /dev/null @@ -1,135 +0,0 @@ -using Elsa.Common.Entities; -using Elsa.Common.Models; - -namespace Elsa.Dapper.Contracts; - -/// -/// Represents a SQL dialect. -/// -public interface ISqlDialect -{ - /// - /// Returns a SELECT FROM query. - /// - /// The table to query. - string From(string table); - - /// - /// Returns a SELECT FROM query. - /// - /// The table to query. - /// The fields to query. - string From(string table, params string[] fields); - - /// - /// Returns a DELETE FROM query. - /// - /// The table to query. - string Delete(string table); - - /// - /// Returns a SELECT count(*) FROM query. - /// - /// The table to query. - string Count(string table); - - /// - /// Returns a SELECT count(fieldExpression) FROM query. - /// - /// The field expression to query. Examples: "*", "distinct FieldName" - /// The table to query. - string Count(string fieldExpression, string table); - - /// - /// Returns an AND clause. - /// - /// The field to query. - string And(string field); - - /// - /// Returns a negating AND clause. - /// - /// The field to query. - string AndNot(string field); - - /// - /// Returns an AND field IN () clause. - /// - /// The field to query. - /// The parameter names to query. - string And(string field, string[] fieldParamNames); - - /// - /// Returns a negating AND field IN () clause. - /// - /// The field to query. - /// The parameter names to query. - string AndNot(string field, string[] fieldParamNames); - - /// - /// Returns an IS NULL clause. - /// - /// The field to query. - string IsNull(string field); - - /// - /// Returns an IS NOT NULL clause. - /// - /// The field to query. - string IsNotNull(string field); - - /// - /// Returns an ORDER BY clause. - /// - /// The field to order by. - /// The direction to order by. - string OrderBy(string field, OrderDirection direction); - - /// - /// Returns an OFFSET clause. - /// - /// The number of records to skip. - string Skip(int count); - - /// - /// Returns a LIMIT clause. - /// - /// The number of records to take. - string Take(int count); - - /// - /// Adds pagination to a SQL query. - /// - /// The pagination arguments. - /// The modified SQL query with pagination. - string Page(PageArgs pageArgs); - - /// - /// Builds an INSERT query. - /// - /// The table. - /// The fields. - /// An optional function to get the parameter name. - /// The query. - string Insert(string table, string[] fields, Func? getParamName = default); - - /// - /// Builds an UPDATE query. - /// - /// The table. - /// The primary key field. - /// The fields. - /// An optional function to get the parameter name. - /// The query. - string Update(string table, string primaryKeyField, string[] fields, Func? getParamName = default); - - /// - /// Builds an UPSERT query. - /// - /// The table. - /// The primary key field. - /// The fields. - /// An optional function to get the parameter name. - /// The query. - string Upsert(string table, string primaryKeyField, string[] fields, Func? getParamName = default); -} \ No newline at end of file diff --git a/src/modules/Elsa.Dapper/Dialects/PostgreSqlDialect.cs b/src/modules/Elsa.Dapper/Dialects/PostgreSqlDialect.cs deleted file mode 100644 index 2bce3e2dfd..0000000000 --- a/src/modules/Elsa.Dapper/Dialects/PostgreSqlDialect.cs +++ /dev/null @@ -1,20 +0,0 @@ -using Elsa.Dapper.Abstractions; - -namespace Elsa.Dapper.Dialects; - -/// -/// Represents a SQL Server dialect. -/// -public class PostgreSqlDialect : SqlDialectBase -{ - /// - public override string Upsert(string table, string primaryKeyField, string[] fields, Func? getParamName = default) - { - getParamName ??= x => x; - var fieldList = string.Join(", ", fields); - var fieldParamNames = fields.Select(x => $"@{getParamName(x)}"); - var fieldParamList = string.Join(", ", fieldParamNames); - var updateList = string.Join(", ", fields.Select(x => $"{x} = @{getParamName(x)}")); - return $"insert into {table} ({fieldList}) values ({fieldParamList}) on conflict({primaryKeyField}) do update set {updateList}"; - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Dapper/Dialects/SqlServerDialect.cs b/src/modules/Elsa.Dapper/Dialects/SqlServerDialect.cs deleted file mode 100644 index f0733c7ee2..0000000000 --- a/src/modules/Elsa.Dapper/Dialects/SqlServerDialect.cs +++ /dev/null @@ -1,10 +0,0 @@ -using Elsa.Dapper.Abstractions; - -namespace Elsa.Dapper.Dialects; - -/// -/// Represents a SQL Server dialect. -/// -public class SqlServerDialect : SqlDialectBase -{ -} \ No newline at end of file diff --git a/src/modules/Elsa.Dapper/Dialects/SqliteDialect.cs b/src/modules/Elsa.Dapper/Dialects/SqliteDialect.cs deleted file mode 100644 index f852ec22b8..0000000000 --- a/src/modules/Elsa.Dapper/Dialects/SqliteDialect.cs +++ /dev/null @@ -1,41 +0,0 @@ -using System.Text; -using Elsa.Common.Models; -using Elsa.Dapper.Abstractions; - -namespace Elsa.Dapper.Dialects; - -/// -/// Represents a SQLite dialect. -/// -public class SqliteDialect : SqlDialectBase -{ - /// - public override string Skip(int count) => $"offset {count}"; - - /// - public override string Take(int count) => $"limit {count}"; - - /// - public override string Page(PageArgs pageArgs) - { - var sb = new StringBuilder(); - - // Attention: the order is important here for SQLite (LIMIT must come before OFFSET). - if (pageArgs.Limit != null) - sb.AppendLine(Take(pageArgs.Limit.Value)); - - if (pageArgs.Offset != null) - sb.AppendLine(Skip(pageArgs.Offset.Value)); - - return sb.ToString(); - } - - public override string Upsert(string table, string primaryKeyField, string[] fields, Func? getParamName = default) - { - getParamName ??= x => x; - var fieldList = string.Join(", ", fields); - var fieldParamNames = fields.Select(x => $"@{getParamName(x)}"); - var fieldParamList = string.Join(", ", fieldParamNames); - return $"INSERT OR REPLACE INTO {table} ({primaryKeyField}, {fieldList}) VALUES (@{getParamName(primaryKeyField)}, {fieldParamList});"; - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Dapper/Elsa.Dapper.csproj b/src/modules/Elsa.Dapper/Elsa.Dapper.csproj deleted file mode 100644 index 6bdc0eaca4..0000000000 --- a/src/modules/Elsa.Dapper/Elsa.Dapper.csproj +++ /dev/null @@ -1,30 +0,0 @@ - - - - - Provides Dapper implementations of various persistence abstractions from various modules. - - elsa module persistence dapper - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/modules/Elsa.Dapper/Extensions/DapperFeatureExtensions.cs b/src/modules/Elsa.Dapper/Extensions/DapperFeatureExtensions.cs deleted file mode 100644 index fe8cbde32b..0000000000 --- a/src/modules/Elsa.Dapper/Extensions/DapperFeatureExtensions.cs +++ /dev/null @@ -1,21 +0,0 @@ -using Elsa.Dapper.Features; -using Elsa.Features.Services; -using JetBrains.Annotations; - -namespace Elsa.Dapper.Extensions; - -/// -/// Provides extensions to add the Dapper feature. -/// -[PublicAPI] -public static class DapperFeatureExtensions -{ - /// - /// Adds the Dapper migrations feature. - /// - public static IModule UseDapper(this IModule module, Action? configure = default) - { - module.Configure(configure); - return module; - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Dapper/Extensions/DapperMigrationsFeatureExtensions.cs b/src/modules/Elsa.Dapper/Extensions/DapperMigrationsFeatureExtensions.cs deleted file mode 100644 index cf1c275840..0000000000 --- a/src/modules/Elsa.Dapper/Extensions/DapperMigrationsFeatureExtensions.cs +++ /dev/null @@ -1,26 +0,0 @@ -using Elsa.Dapper.Features; -using FluentMigrator.Runner; -using JetBrains.Annotations; - -namespace Elsa.Dapper.Extensions; - -/// -/// Provides extensions to add the Dapper migrations feature. -/// -[PublicAPI] -public static class DapperMigrationsFeatureExtensions -{ - /// - /// Adds the Dapper migrations feature. - /// - public static DapperFeature UseMigrations(this DapperFeature feature, Action configure) => feature.UseMigrations(migrations => migrations.ConfigureRunner = configure); - - /// - /// Adds the Dapper migrations feature. - /// - public static DapperFeature UseMigrations(this DapperFeature feature, Action? configure = default) - { - feature.Module.Configure(configure); - return feature; - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Dapper/Extensions/DbConnectionProviderExtensions.cs b/src/modules/Elsa.Dapper/Extensions/DbConnectionProviderExtensions.cs deleted file mode 100644 index 72ed834356..0000000000 --- a/src/modules/Elsa.Dapper/Extensions/DbConnectionProviderExtensions.cs +++ /dev/null @@ -1,17 +0,0 @@ -using Elsa.Dapper.Contracts; -using Elsa.Dapper.Models; - -namespace Elsa.Dapper.Extensions; - -/// -/// Provides extension methods for . -/// -public static class DbConnectionProviderExtensions -{ - /// - /// Creates a instance. - /// - /// The instance. - /// A instance. - public static ParameterizedQuery CreateQuery(this IDbConnectionProvider dbConnectionProvider) => new(dbConnectionProvider.Dialect); -} \ No newline at end of file diff --git a/src/modules/Elsa.Dapper/Extensions/ParameterizedQueryBuilderExtensions.cs b/src/modules/Elsa.Dapper/Extensions/ParameterizedQueryBuilderExtensions.cs deleted file mode 100644 index 6896bab9e7..0000000000 --- a/src/modules/Elsa.Dapper/Extensions/ParameterizedQueryBuilderExtensions.cs +++ /dev/null @@ -1,469 +0,0 @@ -using System.Data; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using Elsa.Common.Entities; -using Elsa.Common.Models; -using Elsa.Dapper.Models; -using Elsa.Extensions; -using JetBrains.Annotations; - -namespace Elsa.Dapper.Extensions; - -/// -/// Provides extension methods for to build SQL queries. -/// -[PublicAPI] -public static class ParameterizedQueryBuilderExtensions -{ - /// - /// Begins a SELECT FROM query. - /// - /// The query. - /// The table. - public static ParameterizedQuery From(this ParameterizedQuery query, string table) - { - query.Sql.AppendLine(query.Dialect.From(table)); - return query; - } - - /// - /// Begins a SELECT FROM query. - /// - /// The query. - /// The table. - /// The fields. - public static ParameterizedQuery From(this ParameterizedQuery query, string table, params string[] fields) - { - query.Sql.AppendLine(query.Dialect.From(table, fields)); - return query; - } - - /// - /// Begins a SELECT FROM query. - /// - /// The query. - /// The table. - /// The fields to include based on the public properties of the specified type. - public static ParameterizedQuery From<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties)] T>(this ParameterizedQuery query, string table) => query.From(table, typeof(T)); - - /// - /// Begins a SELECT FROM query. - /// - /// The query. - /// The table. - /// The fields to include based on the public properties of the specified type. - public static ParameterizedQuery From(this ParameterizedQuery query, string table, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties)] Type modelType) - { - // Create a list of fields based on the public properties of the specified type. - var fields = modelType.GetProperties().Select(x => x.Name).ToArray(); - query.Sql.AppendLine(query.Dialect.From(table, fields)); - return query; - } - - /// - /// Begins a DELETE FROM query. - /// - /// The query. - /// The table. - public static ParameterizedQuery Delete(this ParameterizedQuery query, string table) - { - query.Sql.AppendLine(query.Dialect.Delete(table)); - return query; - } - - /// - /// Begins a DELETE FROM query. - /// - /// The query. - /// The table. - /// The primary key. - /// The inner query. - public static ParameterizedQuery Delete(this ParameterizedQuery query, string table, string primaryKey, ParameterizedQuery innerQuery) - { - query.Sql.AppendLine(query.Dialect.Delete(table)); - query.Sql.AppendLine($"and {primaryKey} in ("); - query.Sql.AppendLine(innerQuery.Sql.ToString()); - query.Sql.AppendLine(")"); - return query; - } - - /// - /// Begins a SELECT COUNT(*) FROM query. - /// - /// The query. - /// The table. - public static ParameterizedQuery Count(this ParameterizedQuery query, string table) - { - query.Sql.AppendLine(query.Dialect.Count(table)); - return query; - } - - /// - /// Begins a SELECT COUNT(expression) FROM query. - /// - /// The query. - /// The expression. Examples: "*" or "DISTINCT FieldName" - /// The table. - public static ParameterizedQuery Count(this ParameterizedQuery query, string expression, string table) - { - query.Sql.AppendLine(query.Dialect.Count(expression, table)); - return query; - } - - /// - /// Appends an AND clause to the query if the value is not null. - /// - /// The query. - /// The field. - /// The value. - public static ParameterizedQuery Is(this ParameterizedQuery query, string field, object? value) - { - if (value == null) return query; - if (value is DBNull) return IsNull(query, field); - query.Sql.AppendLine(query.Dialect.And(field)); - query.Parameters.Add($"@{field}", value); - - return query; - } - - /// - /// Appends a negating AND clause to the query if the value is not null. - /// - /// The query. - /// The field. - /// The value. - public static ParameterizedQuery IsNot(this ParameterizedQuery query, string field, object? value) - { - if (value == null) return query; - if (value is DBNull) return IsNotNull(query, field); - - query.Sql.AppendLine(query.Dialect.AndNot(field)); - query.Parameters.Add($"@{field}", value); - - return query; - } - - /// - /// Appends an IS NULL clause to the query. - /// - /// The query. - /// The field. - public static ParameterizedQuery IsNull(this ParameterizedQuery query, string field) - { - query.Sql.AppendLine(query.Dialect.IsNull(field)); - return query; - } - - /// - /// Appends an IS NOT NULL clause to the query. - /// - /// The query. - /// The field. - public static ParameterizedQuery IsNotNull(this ParameterizedQuery query, string field) - { - query.Sql.AppendLine(query.Dialect.IsNotNull(field)); - return query; - } - - /// - /// Appends a search term for workflow definitions to the search. - /// - /// The query. - /// The search term. - public static ParameterizedQuery WorkflowDefinitionSearchTerm(this ParameterizedQuery query, string? searchTerm) - { - if (string.IsNullOrWhiteSpace(searchTerm)) return query; - - var searchTermLike = $"%{searchTerm}%"; - query.Sql.AppendLine("and (Name like @SearchTermLike or Description like @SearchTermLike or Id like @SearchTerm or DefinitionId like @SearchTerm)"); - query.Parameters.Add("@SearchTerm", searchTerm); - query.Parameters.Add("@SearchTermLike", searchTermLike); - return query; - } - - /// - /// Appends an AND clause to the query if the value is not null. - /// - /// The query. - /// The field. - /// The values. - public static ParameterizedQuery In(this ParameterizedQuery query, string field, IEnumerable? values) - { - var valueList = values?.ToList(); - - if (valueList == null || !valueList.Any()) return query; - - var fieldParamNames = valueList - .Select((_, index) => $"@{field}{index}") - .ToArray(); - - query.Sql.AppendLine(query.Dialect.And(field, fieldParamNames)); - - for (var i = 0; i < fieldParamNames.Length; i++) - query.Parameters.Add(fieldParamNames[i], valueList.ElementAt(i)); - - return query; - } - - /// - /// Appends a negating AND clause to the query if the value is not null. - /// - /// The query. - /// The field. - /// The values. - public static ParameterizedQuery NotIn(this ParameterizedQuery query, string field, IEnumerable? values) - { - var valueList = values?.ToList(); - - if (valueList == null || !valueList.Any()) return query; - - var fieldParamNames = valueList - .Select((_, index) => $"@{field}{index}") - .ToArray(); - - query.Sql.AppendLine(query.Dialect.AndNot(field, fieldParamNames)); - - for (var i = 0; i < fieldParamNames.Length; i++) - query.Parameters.Add(fieldParamNames[i], valueList.ElementAt(i)); - - return query; - } - - public static ParameterizedQuery StartsWith(this ParameterizedQuery query, string field, bool startsWith, string? value) - { - if (!startsWith || value == null || string.IsNullOrWhiteSpace(value)) - return query; - - var searchTermLike = $"{value}%"; - query.Sql.AppendLine($"and {field} like @SearchTermLike"); - query.Parameters.Add($"@{field}", searchTermLike); - - return query; - } - - /// - /// Appends an AND clause to the query if the value is not null. - /// - /// The query. - /// The version options. - public static ParameterizedQuery Is(this ParameterizedQuery query, VersionOptions? versionOptions) - { - if (versionOptions == null) return query; - - var sql = query.Sql; - var options = versionOptions.Value; - if (options.IsDraft) sql.AppendLine("and IsPublished = 0"); - if (options.IsLatest) sql.AppendLine("and IsLatest = 1"); - if (options.IsPublished) sql.AppendLine("and IsPublished = 1"); - if (options.IsLatestOrPublished) sql.AppendLine("and (IsLatest = 1 or IsPublished = 1)"); - if (options.IsLatestAndPublished) sql.AppendLine("and IsLatest = 1 and IsPublished = 1"); - if (options.Version > 0) - { - sql.AppendLine(query.Dialect.And("Version")); - query.Parameters.Add("@Version", options.Version); - } - - return query; - } - - /// - /// Appends an AND clause to the query if the search term is not null. - /// - /// The query. - /// The search term. - public static ParameterizedQuery AndWorkflowInstanceSearchTerm(this ParameterizedQuery query, string? searchTerm) - { - if (string.IsNullOrWhiteSpace(searchTerm)) return query; - - var searchTermLike = $"%{searchTerm}%"; - query.Sql.AppendLine("and (Name like @SearchTermLike or ID like @SearchTerm or DefinitionId like @SearchTerm or DefinitionVersionId like @SearchTerm or CorrelationId like @SearchTerm)"); - query.Parameters.Add("@SearchTerm", searchTerm); - query.Parameters.Add("@SearchTermLike", searchTermLike); - return query; - } - - /// - /// Appends an ORDER BY clause to the query. - /// - /// The query. - /// A lambda expression that selects the field to order by. - /// The order direction. - /// The type of the record. - /// The type of the field. - public static ParameterizedQuery OrderBy(this ParameterizedQuery query, Expression> keySelector, OrderDirection direction) - { - var fieldName = keySelector.GetPropertyName(); - return query.OrderBy(fieldName, direction); - } - - /// - /// Appends an ORDER BY clause to the query. - /// - /// The query. - /// The field. - /// The direction. - public static ParameterizedQuery OrderBy(this ParameterizedQuery query, string field, OrderDirection direction) - { - var directionString = direction == OrderDirection.Ascending ? "asc" : "desc"; - query.Sql.AppendLine($"order by {field} {directionString}"); - return query; - } - - /// - /// Appends an ORDER BY clause to the query. - /// - /// The query. - /// The fields by which to order. - public static ParameterizedQuery OrderBy(this ParameterizedQuery query, params OrderField[] orderFields) - { - if (!orderFields.Any()) - return query; - - var clauses = string.Join(",", orderFields.Select(x => $"{x.Field} {(x.Direction == OrderDirection.Ascending ? "asc" : "desc")}")); - query.Sql.AppendLine($"order by {clauses}"); - return query; - } - - /// - /// Appends an OFFSET clause to the query. - /// - /// The query. - /// The number of records to skip. - public static ParameterizedQuery Skip(this ParameterizedQuery query, int skip) - { - query.Sql.AppendLine(query.Dialect.Skip(skip)); - return query; - } - - /// - /// Appends a LIMIT clause to the query. - /// - /// The query. - /// The number of records to take. - public static ParameterizedQuery Take(this ParameterizedQuery query, int take) - { - query.Sql.AppendLine(query.Dialect.Take(take)); - return query; - } - - /// - /// Applies paging to the query. - /// - /// The query. - /// The page arguments. - public static ParameterizedQuery Page(this ParameterizedQuery query, PageArgs pageArgs) - { - query.Sql.AppendLine(query.Dialect.Page(pageArgs)); - return query; - } - - /// - /// Appends a statement that updates or inserts a record. - /// - /// The query. - /// The table. - /// The primary key field. - /// The record. - /// An optional function to get the parameter name. - public static ParameterizedQuery Upsert(this ParameterizedQuery query, string table, string primaryKeyField, object record, Func? getParameterName = default) - { - var fields = record.GetType().GetProperties() - .Where(x => x.CanRead && x.Name != primaryKeyField) - .Select(x => x.Name) - .ToArray(); - - getParameterName ??= x => x; - - query.Sql.AppendLine(query.Dialect.Upsert(table, primaryKeyField, fields, getParameterName)); - - var primaryKeyValue = record.GetType().GetProperty(primaryKeyField)?.GetValue(record); - query.Parameters.Add($"@{getParameterName(primaryKeyField)}", primaryKeyValue); - - var recordType = record.GetType(); - foreach (var field in fields) - { - var prop = recordType.GetProperty(field)!; - var propType = prop.PropertyType; - var value = prop.GetValue(record); - var dbType = value == null ? GetDbType(propType) : default; - query.Parameters.Add($"@{getParameterName(field)}", value, dbType); - } - - return query; - } - - /// - /// Appends a statement that inserts a record. - /// - /// The query. - /// The table. - /// The record. - /// An optional function to get the parameter name. - public static ParameterizedQuery Insert(this ParameterizedQuery query, string table, object record, Func? getParameterName = default) - { - var fields = record.GetType().GetProperties() - .Select(x => x.Name) - .ToArray(); - - getParameterName ??= x => x; - query.Sql.AppendLine(query.Dialect.Insert(table, fields, getParameterName)); - - foreach (var field in fields) - { - var value = record.GetType().GetProperty(field)?.GetValue(record); - query.Parameters.Add($"@{getParameterName(field)}", value); - } - - return query; - } - - /// - /// Appends a statement that updates a record. - /// - public static ParameterizedQuery Update(this ParameterizedQuery query, string table, object record, string primaryKeyField, Func? getParameterName = default) - { - var fields = record.GetType().GetProperties() - .Where(x => x.CanRead && x.Name != primaryKeyField) - .Select(x => x.Name) - .ToArray(); - - return Update(query, table, record, primaryKeyField, fields, getParameterName); - } - - /// - /// Constructs an UPDATE query for the specified table and applies the provided record, primaryKeyField, and specified fields. - /// - /// The query being built. - /// The name of the table to update. - /// The object containing the values to be updated. - /// The name of the primary key field to identify the record. - /// An array of field names to include in the update statement. - /// An optional function to customize parameter names for the query. - /// Returns the updated instance of . - public static ParameterizedQuery Update(this ParameterizedQuery query, string table, object record, string primaryKeyField, string[] fields, Func? getParameterName = default) - { - getParameterName ??= x => x; - query.Sql.AppendLine(query.Dialect.Update(table, primaryKeyField, fields, getParameterName)); - - var primaryKeyValue = record.GetType().GetProperty(primaryKeyField)?.GetValue(record); - query.Parameters.Add($"@{getParameterName(primaryKeyField)}", primaryKeyValue); - - var recordType = record.GetType(); - foreach (var field in fields) - { - var prop = recordType.GetProperty(field)!; - var propType = prop.PropertyType; - var value = prop.GetValue(record); - var dbType = value == null ? GetDbType(propType) : default; - query.Parameters.Add($"@{getParameterName(field)}", value, dbType); - } - - return query; - } - - private static DbType? GetDbType(Type type) - { - if (type == typeof(byte[])) return DbType.Binary; - return null; - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Dapper/Extensions/ParameterizedQueryExtensions.cs b/src/modules/Elsa.Dapper/Extensions/ParameterizedQueryExtensions.cs deleted file mode 100644 index 50b1c3b76c..0000000000 --- a/src/modules/Elsa.Dapper/Extensions/ParameterizedQueryExtensions.cs +++ /dev/null @@ -1,84 +0,0 @@ -using System.Data; -using Dapper; -using Elsa.Dapper.Models; - -namespace Elsa.Dapper.Extensions; - -/// -/// Provides extension methods for to execute queries. -/// -public static class ParameterizedQueryExtensions -{ - /// - /// Execute a query asynchronously using Task. - /// - /// The query to execute. - /// The connection to query on. - /// The transaction to use, if any. - /// The command timeout (in seconds). - /// The type of command to execute. - /// The type to return. - /// A single row of the query result. - public static async Task SingleAsync(this ParameterizedQuery query, IDbConnection connection, IDbTransaction? transaction = null, int? commandTimeout = null, CommandType? commandType = null) - { - return await connection.QuerySingleAsync(query.Sql.ToString(), query.Parameters, transaction, commandTimeout, commandType); - } - - /// - /// Execute a single-row query asynchronously using Task. - /// - /// The type to return. - /// The query to execute. - /// The connection to query on. - /// The transaction to use, if any. - /// The command timeout (in seconds). - /// The type of command to execute. - /// A single row of the query result. - public static async Task SingleOrDefaultAsync(this ParameterizedQuery query, IDbConnection connection, IDbTransaction? transaction = null, int? commandTimeout = null, CommandType? commandType = null) - { - return await connection.QuerySingleOrDefaultAsync(query.Sql.ToString(), query.Parameters, transaction, commandTimeout, commandType); - } - - /// - /// Execute a single-row query asynchronously using Task. - /// - /// The query to execute. - /// The connection to query on. - /// The transaction to use, if any. - /// The command timeout (in seconds). - /// The type of command to execute. - /// The type to return. - /// A single row of the query result. - public static async Task FirstOrDefaultAsync(this ParameterizedQuery query, IDbConnection connection, IDbTransaction? transaction = null, int? commandTimeout = null, CommandType? commandType = null) - { - return await connection.QueryFirstOrDefaultAsync(query.Sql.ToString(), query.Parameters, transaction, commandTimeout, commandType); - } - - /// - /// Execute a query asynchronously using Task. - /// - /// The query to execute. - /// The connection to query on. - /// The transaction to use, if any. - /// The command timeout (in seconds). - /// The type of command to execute. - /// The type to return. - /// A sequence of data of the supplied type. - public static async Task> QueryAsync(this ParameterizedQuery query, IDbConnection connection, IDbTransaction? transaction = null, int? commandTimeout = null, CommandType? commandType = null) - { - return await connection.QueryAsync(query.Sql.ToString(), query.Parameters, transaction, commandTimeout, commandType); - } - - /// - /// Execute a command asynchronously using Task. - /// - /// The query to execute. - /// The connection to query on. - /// The transaction to use, if any. - /// The command timeout (in seconds). - /// The type of command to execute. - public static async Task ExecuteAsync(this ParameterizedQuery query, IDbConnection connection, IDbTransaction? transaction = null, int? commandTimeout = null, CommandType? commandType = null) - { - return await connection.ExecuteAsync(query.Sql.ToString(), query.Parameters, transaction, commandTimeout, commandType); - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Dapper/Extensions/ServiceCollectionExtensions.cs b/src/modules/Elsa.Dapper/Extensions/ServiceCollectionExtensions.cs deleted file mode 100644 index 42c11854e3..0000000000 --- a/src/modules/Elsa.Dapper/Extensions/ServiceCollectionExtensions.cs +++ /dev/null @@ -1,22 +0,0 @@ -using Elsa.Common.Entities; -using Elsa.Dapper.Records; -using Elsa.Dapper.Services; -using Microsoft.Extensions.DependencyInjection; - -namespace Elsa.Dapper.Extensions; - -/// -/// Extension methods for to register Dapper stores. -/// -public static class ServiceCollectionExtensions -{ - /// - /// Registers a Dapper store. - /// - public static IServiceCollection AddDapperStore(this IServiceCollection services, string tableName, string primaryKey = nameof(Entity.Id)) where TStore : class where TRecord : Record - { - services.AddScoped(); - services.AddScoped(sp => ActivatorUtilities.CreateInstance>(sp, tableName, primaryKey)); - return services; - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Dapper/Features/DapperFeature.cs b/src/modules/Elsa.Dapper/Features/DapperFeature.cs deleted file mode 100644 index a9bb0c4fad..0000000000 --- a/src/modules/Elsa.Dapper/Features/DapperFeature.cs +++ /dev/null @@ -1,33 +0,0 @@ -using Dapper; -using Elsa.Dapper.Contracts; -using Elsa.Dapper.Services; -using Elsa.Dapper.TypeHandlers.Sqlite; -using Elsa.Features.Abstractions; -using Elsa.Features.Services; -using Microsoft.Extensions.DependencyInjection; - -namespace Elsa.Dapper.Features; - -/// -/// Configures common Dapper features. -/// -public class DapperFeature : FeatureBase -{ - /// - public DapperFeature(IModule module) : base(module) - { - // See: https://learn.microsoft.com/en-us/dotnet/standard/data/sqlite/dapper-limitations#data-types - SqlMapper.AddTypeHandler(new GuidHandler()); - } - - /// - /// Gets or sets a factory that provides an instance. - /// - public Func DbConnectionProvider { get; set; } = _ => new SqliteDbConnectionProvider(); - - /// - public override void Apply() - { - Services.AddSingleton(DbConnectionProvider); - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Dapper/Features/DapperMigrationsFeature.cs b/src/modules/Elsa.Dapper/Features/DapperMigrationsFeature.cs deleted file mode 100644 index b04bd10e29..0000000000 --- a/src/modules/Elsa.Dapper/Features/DapperMigrationsFeature.cs +++ /dev/null @@ -1,49 +0,0 @@ -using Elsa.Dapper.Contracts; -using Elsa.Dapper.HostedServices; -using Elsa.Dapper.Migrations.Management; -using Elsa.Extensions; -using Elsa.Features.Abstractions; -using Elsa.Features.Services; -using FluentMigrator.Runner; -using Microsoft.Extensions.DependencyInjection; - -namespace Elsa.Dapper.Features; - -/// -/// Configures migrations. -/// -public class DapperMigrationsFeature(IModule module) : FeatureBase(module) -{ - /// - /// Configures migrations to use SQLite. - /// - public DapperMigrationsFeature UseSqlite() - { - ConfigureRunner += runner => runner.AddSQLite(); - return this; - } - - /// - /// Configures migrations to use SQLite. - /// - public DapperMigrationsFeature UseSqlServer() - { - ConfigureRunner += runner => runner.AddSqlServer(); - return this; - } - - /// - /// Gets or sets a delegate to configure migrations. - /// - public Action ConfigureRunner { get; set; } = runner => runner - .WithGlobalConnectionString(sp => sp.GetRequiredService().GetConnectionString()) - .WithMigrationsIn(typeof(Initial).Assembly); - - /// - public override void Configure() - { - Services.AddFluentMigratorCore(); - Services.ConfigureRunner(ConfigureRunner); - Services.AddStartupTask(); - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Dapper/FodyWeavers.xml b/src/modules/Elsa.Dapper/FodyWeavers.xml deleted file mode 100644 index 00e1d9a1c1..0000000000 --- a/src/modules/Elsa.Dapper/FodyWeavers.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/src/modules/Elsa.Dapper/HostedServices/RunMigrationsStartupTask.cs b/src/modules/Elsa.Dapper/HostedServices/RunMigrationsStartupTask.cs deleted file mode 100644 index fa82e4e5e1..0000000000 --- a/src/modules/Elsa.Dapper/HostedServices/RunMigrationsStartupTask.cs +++ /dev/null @@ -1,18 +0,0 @@ -using Elsa.Common; -using FluentMigrator.Runner; -using JetBrains.Annotations; - -namespace Elsa.Dapper.HostedServices; - -/// -/// Runs database migrations on startup. -/// -[UsedImplicitly] -public class RunMigrationsStartupTask(IMigrationRunner migrationRunner) : IStartupTask -{ - public Task ExecuteAsync(CancellationToken cancellationToken) - { - migrationRunner.MigrateUp(); - return Task.CompletedTask; - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Dapper/Models/OrderField.cs b/src/modules/Elsa.Dapper/Models/OrderField.cs deleted file mode 100644 index a7d87ef5ca..0000000000 --- a/src/modules/Elsa.Dapper/Models/OrderField.cs +++ /dev/null @@ -1,10 +0,0 @@ -using Elsa.Common.Entities; - -namespace Elsa.Dapper.Models; - -/// -/// Represents a field by which to order. -/// -/// The field. -/// The direction. -public record OrderField(string Field, OrderDirection Direction); \ No newline at end of file diff --git a/src/modules/Elsa.Dapper/Models/ParameterizedQuery.cs b/src/modules/Elsa.Dapper/Models/ParameterizedQuery.cs deleted file mode 100644 index 63f592af0e..0000000000 --- a/src/modules/Elsa.Dapper/Models/ParameterizedQuery.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System.Text; -using Dapper; -using Elsa.Dapper.Contracts; - -namespace Elsa.Dapper.Models; - -/// -/// Represents a parameterized SQL query. -/// -public class ParameterizedQuery -{ - /// - /// Initializes a new instance of the class. - /// - /// The SQL dialect. - public ParameterizedQuery(ISqlDialect dialect) - { - Dialect = dialect; - } - - /// - /// Gets the SQL dialect. - /// - public ISqlDialect Dialect { get; } - - /// A containing the SQL query. - public StringBuilder Sql { get; } = new(); - - /// A containing the parameters. - public DynamicParameters Parameters { get; } = new(); -} \ No newline at end of file diff --git a/src/modules/Elsa.Dapper/Modules/Identity/Extensions/IdentityFeatureExtensions.cs b/src/modules/Elsa.Dapper/Modules/Identity/Extensions/IdentityFeatureExtensions.cs deleted file mode 100644 index e8fdb8f522..0000000000 --- a/src/modules/Elsa.Dapper/Modules/Identity/Extensions/IdentityFeatureExtensions.cs +++ /dev/null @@ -1,20 +0,0 @@ -using Elsa.Dapper.Modules.Identity.Features; -using Elsa.Identity.Features; - -// ReSharper disable once CheckNamespace -namespace Elsa.Extensions; - -/// -/// Provides extensions for -/// -public static class IdentityFeatureExtensions -{ - /// - /// Sets up the EF Core persistence provider for the User, Application and Role stores. - /// - public static IdentityFeature UseDapper(this IdentityFeature feature, Action? configure = default) - { - feature.Module.Configure(configure); - return feature; - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Dapper/Modules/Identity/Features/Feature.cs b/src/modules/Elsa.Dapper/Modules/Identity/Features/Feature.cs deleted file mode 100644 index 6e6d628748..0000000000 --- a/src/modules/Elsa.Dapper/Modules/Identity/Features/Feature.cs +++ /dev/null @@ -1,47 +0,0 @@ -using Elsa.Dapper.Extensions; -using Elsa.Dapper.Features; -using Elsa.Dapper.Modules.Identity.Records; -using Elsa.Dapper.Modules.Identity.Stores; -using Elsa.Features.Abstractions; -using Elsa.Features.Attributes; -using Elsa.Features.Services; -using Elsa.Identity.Features; -using JetBrains.Annotations; -using Microsoft.Extensions.DependencyInjection; - -namespace Elsa.Dapper.Modules.Identity.Features; - -/// -/// Configures the feature with Dapper persistence providers. -/// -[DependsOn(typeof(IdentityFeature))] -[DependsOn(typeof(DapperFeature))] -[PublicAPI] -public class DapperIdentityPersistenceFeature : FeatureBase -{ - /// - public DapperIdentityPersistenceFeature(IModule module) : base(module) - { - } - - /// - public override void Configure() - { - Module.Configure(feature => - { - feature.UserStore = sp => sp.GetRequiredService(); - feature.ApplicationStore = sp => sp.GetRequiredService(); - feature.RoleStore = sp => sp.GetRequiredService(); - }); - } - - /// - public override void Apply() - { - base.Apply(); - - Services.AddDapperStore("Users"); - Services.AddDapperStore("Applications"); - Services.AddDapperStore("Roles"); - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Dapper/Modules/Identity/Records/ApplicationRecord.cs b/src/modules/Elsa.Dapper/Modules/Identity/Records/ApplicationRecord.cs deleted file mode 100644 index 2a60ce2dc3..0000000000 --- a/src/modules/Elsa.Dapper/Modules/Identity/Records/ApplicationRecord.cs +++ /dev/null @@ -1,14 +0,0 @@ -using Elsa.Dapper.Records; - -namespace Elsa.Dapper.Modules.Identity.Records; - -internal class ApplicationRecord : Record -{ - public string ClientId { get; set; } = default!; - public string HashedClientSecret { get; set; } = default!; - public string HashedClientSecretSalt { get; set; } = default!; - public string Name { get; set; } = default!; - public string HashedApiKey { get; set; } = default!; - public string HashedApiKeySalt { get; set; } = default!; - public string Roles { get; set; } = default!; -} \ No newline at end of file diff --git a/src/modules/Elsa.Dapper/Modules/Identity/Records/RoleRecord.cs b/src/modules/Elsa.Dapper/Modules/Identity/Records/RoleRecord.cs deleted file mode 100644 index a1f912258c..0000000000 --- a/src/modules/Elsa.Dapper/Modules/Identity/Records/RoleRecord.cs +++ /dev/null @@ -1,9 +0,0 @@ -using Elsa.Dapper.Records; - -namespace Elsa.Dapper.Modules.Identity.Records; - -internal class RoleRecord : Record -{ - public string Name { get; set; } = default!; - public string Permissions { get; set; } = default!; -} \ No newline at end of file diff --git a/src/modules/Elsa.Dapper/Modules/Identity/Records/UserRecord.cs b/src/modules/Elsa.Dapper/Modules/Identity/Records/UserRecord.cs deleted file mode 100644 index 4438bcfc98..0000000000 --- a/src/modules/Elsa.Dapper/Modules/Identity/Records/UserRecord.cs +++ /dev/null @@ -1,11 +0,0 @@ -using Elsa.Dapper.Records; - -namespace Elsa.Dapper.Modules.Identity.Records; - -internal class UserRecord : Record -{ - public string Name { get; set; } = default!; - public string HashedPassword { get; set; } = default!; - public string HashedPasswordSalt { get; set; } = default!; - public string Roles { get; set; } = default!; -} \ No newline at end of file diff --git a/src/modules/Elsa.Dapper/Modules/Identity/Stores/ApplicationStore.cs b/src/modules/Elsa.Dapper/Modules/Identity/Stores/ApplicationStore.cs deleted file mode 100644 index f63d4db009..0000000000 --- a/src/modules/Elsa.Dapper/Modules/Identity/Stores/ApplicationStore.cs +++ /dev/null @@ -1,76 +0,0 @@ -using Elsa.Dapper.Extensions; -using Elsa.Dapper.Models; -using Elsa.Dapper.Modules.Identity.Records; -using Elsa.Dapper.Services; -using Elsa.Identity.Contracts; -using Elsa.Identity.Entities; -using Elsa.Identity.Models; - -namespace Elsa.Dapper.Modules.Identity.Stores; - -/// -/// A Dapper implementation of . -/// -internal class DapperApplicationStore(Store store) : IApplicationStore -{ - /// - public async Task SaveAsync(Application application, CancellationToken cancellationToken = default) - { - var record = Map(application); - await store.SaveAsync(record, cancellationToken); - } - - /// - public async Task DeleteAsync(ApplicationFilter filter, CancellationToken cancellationToken = default) - { - await store.DeleteAsync(q => ApplyFilter(q, filter), cancellationToken); - } - - /// - public async Task FindAsync(ApplicationFilter filter, CancellationToken cancellationToken = default) - { - var record = await store.FindAsync(query => ApplyFilter(query, filter), cancellationToken); - return record == null ? null : Map(record); - } - - private void ApplyFilter(ParameterizedQuery query, ApplicationFilter filter) - { - query - .Is(nameof(ApplicationRecord.Id), filter.Id) - .Is(nameof(ApplicationRecord.ClientId), filter.ClientId) - .Is(nameof(ApplicationRecord.Name), filter.Name) - ; - } - - private ApplicationRecord Map(Application source) - { - return new() - { - Id = source.Id, - ClientId = source.ClientId, - HashedClientSecret = source.HashedClientSecret, - HashedClientSecretSalt = source.HashedClientSecretSalt, - Name = source.Name, - HashedApiKey = source.HashedApiKey, - HashedApiKeySalt = source.HashedApiKeySalt, - Roles = string.Join(',', source.Roles), - TenantId = source.TenantId - }; - } - - private Application Map(ApplicationRecord source) - { - return new() - { - Id = source.Id, - ClientId = source.ClientId, - HashedClientSecret = source.HashedClientSecret, - HashedClientSecretSalt = source.HashedClientSecretSalt, - Name = source.Name, - HashedApiKey = source.HashedApiKey, - HashedApiKeySalt = source.HashedApiKeySalt, - Roles = source.Roles.Split(',', StringSplitOptions.RemoveEmptyEntries), - TenantId = source.TenantId - }; - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Dapper/Modules/Identity/Stores/RoleStore.cs b/src/modules/Elsa.Dapper/Modules/Identity/Stores/RoleStore.cs deleted file mode 100644 index 4787bd4dac..0000000000 --- a/src/modules/Elsa.Dapper/Modules/Identity/Stores/RoleStore.cs +++ /dev/null @@ -1,80 +0,0 @@ -using Elsa.Dapper.Extensions; -using Elsa.Dapper.Models; -using Elsa.Dapper.Modules.Identity.Records; -using Elsa.Dapper.Services; -using Elsa.Identity.Contracts; -using Elsa.Identity.Entities; -using Elsa.Identity.Models; -using Open.Linq.AsyncExtensions; - -namespace Elsa.Dapper.Modules.Identity.Stores; - -/// -/// A Dapper implementation of . -/// -internal class DapperRoleStore(Store store) : IRoleStore -{ - /// - public async Task SaveAsync(Role application, CancellationToken cancellationToken = default) - { - var record = Map(application); - await store.SaveAsync(record, cancellationToken); - } - - /// - public async Task AddAsync(Role role, CancellationToken cancellationToken = default) - { - var record = Map(role); - await store.AddAsync(record, cancellationToken); - } - - /// - public async Task DeleteAsync(RoleFilter filter, CancellationToken cancellationToken = default) - { - await store.DeleteAsync(q => ApplyFilter(q, filter), cancellationToken); - } - - /// - public async Task FindAsync(RoleFilter filter, CancellationToken cancellationToken = default) - { - var record = await store.FindAsync(q => ApplyFilter(q, filter), cancellationToken); - return record == null ? null : Map(record); - } - - /// - public async Task> FindManyAsync(RoleFilter filter, CancellationToken cancellationToken = default) - { - var records = await store.FindManyAsync(queryable => ApplyFilter(queryable, filter), cancellationToken).ToList(); - return records.Select(Map); - } - - private void ApplyFilter(ParameterizedQuery query, RoleFilter filter) - { - query - .Is(nameof(RoleRecord.Id), filter.Id) - .In(nameof(RoleRecord.Name), filter.Ids) - ; - } - - private RoleRecord Map(Role source) - { - return new() - { - Id = source.Id, - Name = source.Name, - Permissions = string.Join(',', source.Permissions), - TenantId = source.TenantId - }; - } - - private Role Map(RoleRecord source) - { - return new() - { - Id = source.Id, - Name = source.Name, - Permissions = source.Permissions.Split(',', StringSplitOptions.RemoveEmptyEntries), - TenantId = source.TenantId - }; - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Dapper/Modules/Identity/Stores/UserStore.cs b/src/modules/Elsa.Dapper/Modules/Identity/Stores/UserStore.cs deleted file mode 100644 index 23a13c47e6..0000000000 --- a/src/modules/Elsa.Dapper/Modules/Identity/Stores/UserStore.cs +++ /dev/null @@ -1,69 +0,0 @@ -using Elsa.Dapper.Extensions; -using Elsa.Dapper.Models; -using Elsa.Dapper.Modules.Identity.Records; -using Elsa.Dapper.Services; -using Elsa.Identity.Contracts; -using Elsa.Identity.Entities; -using Elsa.Identity.Models; - -namespace Elsa.Dapper.Modules.Identity.Stores; - -/// -/// A Dapper implementation of . -/// -internal class DapperUserStore(Store store) : IUserStore -{ - /// - public async Task SaveAsync(User user, CancellationToken cancellationToken = default) - { - var record = Map(user); - await store.SaveAsync(record, cancellationToken); - } - - /// - public async Task DeleteAsync(UserFilter filter, CancellationToken cancellationToken = default) - { - await store.DeleteAsync(q => ApplyFilter(q, filter), cancellationToken); - } - - /// - public async Task FindAsync(UserFilter filter, CancellationToken cancellationToken = default) - { - var record = await store.FindAsync(q => ApplyFilter(q, filter), cancellationToken); - return record == null ? null : Map(record); - } - - private static void ApplyFilter(ParameterizedQuery query, UserFilter filter) - { - query - .Is(nameof(UserRecord.Id), filter.Id) - .Is(nameof(UserRecord.Name), filter.Name) - ; - } - - private UserRecord Map(User source) - { - return new() - { - Id = source.Id, - Name = source.Name, - HashedPassword = source.HashedPassword, - HashedPasswordSalt = source.HashedPasswordSalt, - Roles = string.Join(',', source.Roles), - TenantId = source.TenantId - }; - } - - private User Map(UserRecord source) - { - return new() - { - Id = source.Id, - Name = source.Name, - HashedPassword = source.HashedPassword, - HashedPasswordSalt = source.HashedPasswordSalt, - Roles = source.Roles.Split(',', StringSplitOptions.RemoveEmptyEntries), - TenantId = source.TenantId - }; - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Dapper/Modules/Management/Extensions/DapperWorkflowManagementFeatureExtensions.cs b/src/modules/Elsa.Dapper/Modules/Management/Extensions/DapperWorkflowManagementFeatureExtensions.cs deleted file mode 100644 index 2d5035f050..0000000000 --- a/src/modules/Elsa.Dapper/Modules/Management/Extensions/DapperWorkflowManagementFeatureExtensions.cs +++ /dev/null @@ -1,40 +0,0 @@ -using Elsa.Dapper.Modules.Management.Features; -using Elsa.Workflows.Management.Features; -using JetBrains.Annotations; - -// ReSharper disable once CheckNamespace -namespace Elsa.Extensions; - -/// -/// Provides extensions to various management related features. -/// -[PublicAPI] -public static class DapperWorkflowManagementFeatureExtensions -{ - /// - /// Sets up the EF Core persistence provider. - /// - public static WorkflowDefinitionsFeature UseDapper(this WorkflowDefinitionsFeature feature, Action? configure = default) - { - feature.Module.Configure(configure); - return feature; - } - - /// - /// Sets up the EF Core persistence provider. - /// - public static WorkflowInstancesFeature UseDapper(this WorkflowInstancesFeature feature, Action? configure = default) - { - feature.Module.Configure(configure); - return feature; - } - - /// - /// Sets up the Dapper persistence provider. - /// - public static WorkflowManagementFeature UseDapper(this WorkflowManagementFeature feature, Action? configure = default) - { - feature.Module.Configure(configure); - return feature; - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Dapper/Modules/Management/Features/DapperWorkflowDefinitionPersistenceFeature.cs b/src/modules/Elsa.Dapper/Modules/Management/Features/DapperWorkflowDefinitionPersistenceFeature.cs deleted file mode 100644 index aed0b03e4e..0000000000 --- a/src/modules/Elsa.Dapper/Modules/Management/Features/DapperWorkflowDefinitionPersistenceFeature.cs +++ /dev/null @@ -1,41 +0,0 @@ -using Elsa.Dapper.Extensions; -using Elsa.Dapper.Features; -using Elsa.Dapper.Modules.Management.Records; -using Elsa.Dapper.Modules.Management.Stores; -using Elsa.Features.Abstractions; -using Elsa.Features.Attributes; -using Elsa.Features.Services; -using Elsa.Workflows.Management.Features; -using Microsoft.Extensions.DependencyInjection; - -namespace Elsa.Dapper.Modules.Management.Features; - -/// -/// Configures the feature with an Entity Framework Core persistence provider. -/// -[DependsOn(typeof(WorkflowManagementFeature))] -[DependsOn(typeof(DapperFeature))] -public class DapperWorkflowDefinitionPersistenceFeature : FeatureBase -{ - /// - public DapperWorkflowDefinitionPersistenceFeature(IModule module) : base(module) - { - } - - /// - public override void Configure() - { - Module.Configure(feature => - { - feature.WorkflowDefinitionStore = sp => sp.GetRequiredService(); - }); - } - - /// - public override void Apply() - { - base.Apply(); - - Services.AddDapperStore("WorkflowDefinitions"); - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Dapper/Modules/Management/Features/DapperWorkflowInstancePersistenceFeature.cs b/src/modules/Elsa.Dapper/Modules/Management/Features/DapperWorkflowInstancePersistenceFeature.cs deleted file mode 100644 index 83ba9c740c..0000000000 --- a/src/modules/Elsa.Dapper/Modules/Management/Features/DapperWorkflowInstancePersistenceFeature.cs +++ /dev/null @@ -1,28 +0,0 @@ -using Elsa.Dapper.Features; -using Elsa.Dapper.Modules.Management.Stores; -using Elsa.Features.Abstractions; -using Elsa.Features.Attributes; -using Elsa.Features.Services; -using Elsa.Workflows.Management.Features; -using Microsoft.Extensions.DependencyInjection; - -namespace Elsa.Dapper.Modules.Management.Features; - -/// -/// Configures the feature with an Entity Framework Core persistence provider. -/// -[DependsOn(typeof(WorkflowManagementFeature))] -[DependsOn(typeof(DapperFeature))] -public class DapperWorkflowInstancePersistenceFeature : FeatureBase -{ - /// - public DapperWorkflowInstancePersistenceFeature(IModule module) : base(module) - { - } - - /// - public override void Configure() - { - Module.Configure(feature => { feature.WorkflowInstanceStore = sp => sp.GetRequiredService(); }); - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Dapper/Modules/Management/Features/DapperWorkflowManagementPersistenceFeature.cs b/src/modules/Elsa.Dapper/Modules/Management/Features/DapperWorkflowManagementPersistenceFeature.cs deleted file mode 100644 index fa4d4f03e5..0000000000 --- a/src/modules/Elsa.Dapper/Modules/Management/Features/DapperWorkflowManagementPersistenceFeature.cs +++ /dev/null @@ -1,44 +0,0 @@ -using Elsa.Dapper.Extensions; -using Elsa.Dapper.Features; -using Elsa.Dapper.Modules.Management.Records; -using Elsa.Dapper.Modules.Management.Stores; -using Elsa.Features.Abstractions; -using Elsa.Features.Attributes; -using Elsa.Features.Services; -using Elsa.Workflows.Management.Features; -using JetBrains.Annotations; -using Microsoft.Extensions.DependencyInjection; - -namespace Elsa.Dapper.Modules.Management.Features; - -/// -/// Configures the and features with a Dapper persistence provider. -/// -[DependsOn(typeof(WorkflowManagementFeature))] -[DependsOn(typeof(WorkflowInstancesFeature))] -[DependsOn(typeof(WorkflowDefinitionsFeature))] -[DependsOn(typeof(DapperFeature))] -[PublicAPI] -public class DapperWorkflowManagementPersistenceFeature : FeatureBase -{ - /// - public DapperWorkflowManagementPersistenceFeature(IModule module) : base(module) - { - } - - /// - public override void Configure() - { - Module.Configure(feature => feature.WorkflowInstanceStore = sp => sp.GetRequiredService()); - Module.Configure(feature => feature.WorkflowDefinitionStore = sp => sp.GetRequiredService()); - } - - /// - public override void Apply() - { - base.Apply(); - - Services.AddDapperStore("WorkflowInstances"); - Services.AddDapperStore("WorkflowDefinitions"); - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Dapper/Modules/Management/Records/WorkflowDefinitionRecord.cs b/src/modules/Elsa.Dapper/Modules/Management/Records/WorkflowDefinitionRecord.cs deleted file mode 100644 index 0db52eb4ed..0000000000 --- a/src/modules/Elsa.Dapper/Modules/Management/Records/WorkflowDefinitionRecord.cs +++ /dev/null @@ -1,24 +0,0 @@ -using Elsa.Dapper.Records; - -namespace Elsa.Dapper.Modules.Management.Records; - -internal class WorkflowDefinitionRecord : Record -{ - public string DefinitionId { get; set; } = default!; - public string? Name { get; set; } - public string? ToolVersion { get; set; } - public string? Description { get; set; } - public string? ProviderName { get; set; } - public string MaterializerName { get; set; } = default!; - public string? MaterializerContext { get; set; } - public string Props { get; set; } = default!; - public bool? UsableAsActivity { get; set; } - public string? StringData { get; set; } - public byte[]? BinaryData { get; set; } - public DateTimeOffset CreatedAt { get; set; } - public int Version { get; set; } = 1; - public bool IsLatest { get; set; } - public bool IsPublished { get; set; } - public bool IsReadonly { get; set; } - public bool IsSystem { get; set; } -} \ No newline at end of file diff --git a/src/modules/Elsa.Dapper/Modules/Management/Records/WorkflowInstanceRecord.cs b/src/modules/Elsa.Dapper/Modules/Management/Records/WorkflowInstanceRecord.cs deleted file mode 100644 index e2386680e4..0000000000 --- a/src/modules/Elsa.Dapper/Modules/Management/Records/WorkflowInstanceRecord.cs +++ /dev/null @@ -1,21 +0,0 @@ -using Elsa.Dapper.Records; - -namespace Elsa.Dapper.Modules.Management.Records; - -internal class WorkflowInstanceRecord : Record -{ - public string DefinitionId { get; set; } = null!; - public string DefinitionVersionId { get; set; } = null!; - public int Version { get; set; } - public string WorkflowState { get; set; } = null!; - public string Status { get; set; } = null!; - public string SubStatus { get; set; } = null!; - public bool IsExecuting { get; set; } - public string? CorrelationId { get; set; } - public string? Name { get; set; } - public int IncidentCount { get; set; } - public bool IsSystem { get; set; } - public DateTimeOffset CreatedAt { get; set; } - public DateTimeOffset UpdatedAt { get; set; } - public DateTimeOffset? FinishedAt { get; set; } -} \ No newline at end of file diff --git a/src/modules/Elsa.Dapper/Modules/Management/Stores/DapperWorkflowDefinitionStore.cs b/src/modules/Elsa.Dapper/Modules/Management/Stores/DapperWorkflowDefinitionStore.cs deleted file mode 100644 index a409c0d29d..0000000000 --- a/src/modules/Elsa.Dapper/Modules/Management/Stores/DapperWorkflowDefinitionStore.cs +++ /dev/null @@ -1,276 +0,0 @@ -using Elsa.Common.Entities; -using Elsa.Common.Models; -using Elsa.Dapper.Extensions; -using Elsa.Dapper.Models; -using Elsa.Dapper.Modules.Management.Records; -using Elsa.Dapper.Services; -using Elsa.Extensions; -using Elsa.Workflows; -using Elsa.Workflows.Management; -using Elsa.Workflows.Management.Entities; -using Elsa.Workflows.Management.Filters; -using Elsa.Workflows.Management.Models; -using Elsa.Workflows.Memory; -using Elsa.Workflows.Models; -using JetBrains.Annotations; -using Newtonsoft.Json; - -namespace Elsa.Dapper.Modules.Management.Stores; - -/// -/// Provides a Dapper implementation of . -/// -[UsedImplicitly] -internal class DapperWorkflowDefinitionStore(Store store, IPayloadSerializer payloadSerializer) - : IWorkflowDefinitionStore -{ - /// - public async Task FindAsync(WorkflowDefinitionFilter filter, CancellationToken cancellationToken = default) - { - var record = await store.FindAsync(q => ApplyFilter(q, filter), cancellationToken); - return record == null ? null : Map(record); - } - - /// - public async Task FindAsync(WorkflowDefinitionFilter filter, WorkflowDefinitionOrder order, CancellationToken cancellationToken = default) - { - var record = await store.FindAsync(q => ApplyFilter(q, filter), order.KeySelector.GetPropertyName(), order.Direction, cancellationToken); - return record == null ? null : Map(record); - } - - /// - public async Task> FindManyAsync(WorkflowDefinitionFilter filter, PageArgs pageArgs, CancellationToken cancellationToken = default) - { - return await FindManyAsync( - filter, - new WorkflowDefinitionOrder(x => x.CreatedAt, OrderDirection.Ascending), - pageArgs, - cancellationToken); - } - - /// - public async Task> FindManyAsync(WorkflowDefinitionFilter filter, WorkflowDefinitionOrder order, PageArgs pageArgs, CancellationToken cancellationToken = default) - { - var page = await store.FindManyAsync(q => ApplyFilter(q, filter), pageArgs, order.KeySelector.GetPropertyName(), order.Direction, cancellationToken); - return Map(page); - } - - /// - public async Task> FindManyAsync(WorkflowDefinitionFilter filter, CancellationToken cancellationToken = default) - { - var records = await store.FindManyAsync(q => ApplyFilter(q, filter), cancellationToken); - return Map(records).ToList(); - } - - /// - public async Task> FindManyAsync(WorkflowDefinitionFilter filter, WorkflowDefinitionOrder order, CancellationToken cancellationToken = default) - { - var records = await store.FindManyAsync(q => ApplyFilter(q, filter), order.KeySelector.GetPropertyName(), order.Direction, cancellationToken); - return Map(records).ToList(); - } - - /// - public async Task> FindSummariesAsync(WorkflowDefinitionFilter filter, PageArgs pageArgs, CancellationToken cancellationToken = default) - { - return await FindSummariesAsync( - filter, - new WorkflowDefinitionOrder(x => x.CreatedAt, OrderDirection.Ascending), - pageArgs, - cancellationToken); - } - - /// - public async Task> FindSummariesAsync(WorkflowDefinitionFilter filter, WorkflowDefinitionOrder order, PageArgs pageArgs, CancellationToken cancellationToken = default) - { - return await store.FindManyAsync(q => ApplyFilter(q, filter), pageArgs, order.KeySelector.GetPropertyName(), order.Direction, cancellationToken); - } - - /// - public async Task> FindSummariesAsync(WorkflowDefinitionFilter filter, CancellationToken cancellationToken = default) - { - var records = await store.FindManyAsync(q => ApplyFilter(q, filter), cancellationToken); - return records.ToList(); - } - - /// - public async Task> FindSummariesAsync(WorkflowDefinitionFilter filter, WorkflowDefinitionOrder order, CancellationToken cancellationToken = default) - { - return await store.FindManyAsync(q => ApplyFilter(q, filter), order.KeySelector.GetPropertyName(), order.Direction, cancellationToken); - } - - /// - public async Task FindLastVersionAsync(WorkflowDefinitionFilter filter, CancellationToken cancellationToken) - { - var record = await store.FindAsync(q => ApplyFilter(q, filter), nameof(WorkflowDefinitionRecord.Version), OrderDirection.Descending, cancellationToken); - return record == null ? null : Map(record); - } - - /// - public async Task SaveAsync(WorkflowDefinition definition, CancellationToken cancellationToken = default) - { - var record = Map(definition); - await store.SaveAsync(record, cancellationToken); - } - - /// - public async Task SaveManyAsync(IEnumerable definitions, CancellationToken cancellationToken = default) - { - var records = definitions.Select(Map).ToList(); - await store.SaveManyAsync(records, cancellationToken); - } - - /// - public async Task DeleteAsync(WorkflowDefinitionFilter filter, CancellationToken cancellationToken = default) - { - return await store.DeleteAsync(q => ApplyFilter(q, filter), cancellationToken); - } - - /// - public async Task AnyAsync(WorkflowDefinitionFilter filter, CancellationToken cancellationToken = default) - { - return await store.AnyAsync(q => ApplyFilter(q, filter), cancellationToken); - } - - /// - public async Task CountDistinctAsync(CancellationToken cancellationToken = default) - { - return await store.CountAsync( - filter => filter.Count($"distinct {nameof(WorkflowDefinition.DefinitionId)}", store.TableName), - cancellationToken); - } - - /// - public async Task GetIsNameUnique(string name, string? definitionId = default, CancellationToken cancellationToken = default) - { - var exists = await store.AnyAsync(query => - { - query.Is(nameof(WorkflowDefinition.Name), name); - - if (definitionId != null) - query.IsNot(nameof(WorkflowDefinition.DefinitionId), definitionId); - }, cancellationToken); - - return !exists; - } - - private void ApplyFilter(ParameterizedQuery query, WorkflowDefinitionFilter filter) - { - var definitionId = filter.DefinitionId ?? filter.DefinitionHandle?.DefinitionId; - var versionOptions = filter.VersionOptions ?? filter.DefinitionHandle?.VersionOptions; - var id = filter.Id ?? filter.DefinitionHandle?.DefinitionVersionId; - - query - .Is(nameof(WorkflowDefinition.DefinitionId), definitionId) - .In(nameof(WorkflowDefinition.DefinitionId), filter.DefinitionIds) - .Is(nameof(WorkflowDefinition.Id), id) - .In(nameof(WorkflowDefinition.Id), filter.Ids) - .Is(versionOptions) - .Is(nameof(WorkflowDefinition.MaterializerName), filter.MaterializerName) - .Is(nameof(WorkflowDefinition.Name), filter.Name) - .In(nameof(WorkflowDefinition.Name), filter.Names) - .Is(nameof(WorkflowDefinition.Options.UsableAsActivity), filter.UsableAsActivity) - .Is(nameof(WorkflowDefinition.IsSystem), filter.IsSystem) - .Is(nameof(WorkflowDefinition.IsReadonly), filter.IsReadonly) - .WorkflowDefinitionSearchTerm(filter.SearchTerm); - } - - private Page Map(Page source) => new(Map(source.Items).ToList(), source.TotalCount); - private IEnumerable Map(IEnumerable records) => records.Select(Map); - - private WorkflowDefinition Map(WorkflowDefinitionRecord source) - { - var props = payloadSerializer.Deserialize(source.Props); - return new WorkflowDefinition - { - Id = source.Id, - DefinitionId = source.DefinitionId, - Version = source.Version, - Name = source.Name, - Description = source.Description, - IsPublished = source.IsPublished, - IsLatest = source.IsLatest, - IsReadonly = source.IsReadonly, - IsSystem = source.IsSystem, - CreatedAt = source.CreatedAt, - StringData = source.StringData, - Options = props.Options, - Variables = props.Variables, - Inputs = props.Inputs, - Outputs = props.Outputs, - Outcomes = props.Outcomes, - CustomProperties = props.CustomProperties, - MaterializerContext = source.MaterializerContext, - BinaryData = source.BinaryData, - MaterializerName = source.MaterializerName, - ProviderName = source.ProviderName, - TenantId = source.TenantId - }; - } - - private WorkflowDefinitionRecord Map(WorkflowDefinition source) - { - var props = new WorkflowDefinitionProps - { - Options = source.Options, - Variables = source.Variables, - Inputs = source.Inputs, - Outputs = source.Outputs, - Outcomes = source.Outcomes, - CustomProperties = source.CustomProperties - }; - - return new WorkflowDefinitionRecord - { - Id = source.Id, - DefinitionId = source.DefinitionId, - Version = source.Version, - Name = source.Name, - Description = source.Description, - IsPublished = source.IsPublished, - IsLatest = source.IsLatest, - CreatedAt = source.CreatedAt, - IsReadonly = source.IsReadonly, - IsSystem = source.IsSystem, - StringData = source.StringData, - Props = payloadSerializer.Serialize(props), - MaterializerName = source.MaterializerName, - UsableAsActivity = source.Options.UsableAsActivity, - ProviderName = source.ProviderName, - BinaryData = source.BinaryData, - MaterializerContext = source.MaterializerContext, - TenantId = source.TenantId - }; - } - - private class WorkflowDefinitionProps - { - [JsonConstructor] - public WorkflowDefinitionProps() - { - } - - public WorkflowDefinitionProps( - WorkflowOptions options, - ICollection variables, - ICollection inputs, - ICollection outputs, - ICollection outcomes, - IDictionary customProperties - ) - { - Options = options; - Variables = variables; - Inputs = inputs; - Outputs = outputs; - Outcomes = outcomes; - CustomProperties = customProperties; - } - - public WorkflowOptions Options { get; set; } = new(); - public ICollection Variables { get; set; } = new List(); - public ICollection Inputs { get; set; } = new List(); - public ICollection Outputs { get; set; } = new List(); - public ICollection Outcomes { get; set; } = new List(); - public IDictionary CustomProperties { get; set; } = new Dictionary(); - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Dapper/Modules/Management/Stores/DapperWorkflowInstanceStore.cs b/src/modules/Elsa.Dapper/Modules/Management/Stores/DapperWorkflowInstanceStore.cs deleted file mode 100644 index 8c18734a51..0000000000 --- a/src/modules/Elsa.Dapper/Modules/Management/Stores/DapperWorkflowInstanceStore.cs +++ /dev/null @@ -1,262 +0,0 @@ -using System.Diagnostics.CodeAnalysis; -using Elsa.Common.Entities; -using Elsa.Common.Models; -using Elsa.Dapper.Extensions; -using Elsa.Dapper.Models; -using Elsa.Dapper.Modules.Management.Records; -using Elsa.Dapper.Services; -using Elsa.Extensions; -using Elsa.Workflows; -using Elsa.Workflows.Management; -using Elsa.Workflows.Management.Entities; -using Elsa.Workflows.Management.Filters; -using Elsa.Workflows.Management.Models; -using JetBrains.Annotations; - -namespace Elsa.Dapper.Modules.Management.Stores; - -/// -/// Provides a Dapper implementation of . -/// -[UsedImplicitly] -internal class DapperWorkflowInstanceStore(Store store, IWorkflowStateSerializer workflowStateSerializer) - : IWorkflowInstanceStore -{ - /// - [RequiresUnreferencedCode("Calls Elsa.Dapper.Modules.Management.Stores.DapperWorkflowInstanceStore.MapAsync(WorkflowInstanceRecord)")] - public async ValueTask FindAsync(WorkflowInstanceFilter filter, CancellationToken cancellationToken = default) - { - var record = await store.FindAsync(q => ApplyFilter(q, filter), cancellationToken); - return record == null ? null : Map(record); - } - - /// - [RequiresUnreferencedCode("Calls Elsa.Dapper.Modules.Management.Stores.DapperWorkflowInstanceStore.FindManyAsync(WorkflowInstanceFilter, PageArgs, WorkflowInstanceOrder, CancellationToken)")] - public async ValueTask> FindManyAsync(WorkflowInstanceFilter filter, PageArgs pageArgs, CancellationToken cancellationToken = default) - { - return await FindManyAsync( - filter, - pageArgs, - new WorkflowInstanceOrder(x => x.CreatedAt, OrderDirection.Ascending), - cancellationToken); - } - - /// - [RequiresUnreferencedCode("Calls Elsa.Dapper.Modules.Management.Stores.DapperWorkflowInstanceStore.MapAsync(Page)")] - public async ValueTask> FindManyAsync(WorkflowInstanceFilter filter, PageArgs pageArgs, WorkflowInstanceOrder order, CancellationToken cancellationToken = default) - { - var page = await store.FindManyAsync(q => ApplyFilter(q, filter), pageArgs, order.KeySelector.GetPropertyName(), order.Direction, cancellationToken); - return Map(page); - } - - /// - [RequiresUnreferencedCode("Calls Elsa.Dapper.Modules.Management.Stores.DapperWorkflowInstanceStore.MapAsync(IEnumerable)")] - public async ValueTask> FindManyAsync(WorkflowInstanceFilter filter, CancellationToken cancellationToken = default) - { - var records = await store.FindManyAsync(q => ApplyFilter(q, filter), cancellationToken); - return Map(records).ToList(); - } - - /// - [RequiresUnreferencedCode("Calls Elsa.Dapper.Modules.Management.Stores.DapperWorkflowInstanceStore.MapAsync(IEnumerable)")] - public async ValueTask> FindManyAsync(WorkflowInstanceFilter filter, WorkflowInstanceOrder order, CancellationToken cancellationToken = default) - { - var records = await store.FindManyAsync(q => ApplyFilter(q, filter), order.KeySelector.GetPropertyName(), order.Direction, cancellationToken); - return Map(records).ToList(); - } - - /// - public async ValueTask CountAsync(WorkflowInstanceFilter filter, CancellationToken cancellationToken = default) - { - return await store.CountAsync(query => ApplyFilter(query, filter), cancellationToken); - } - - /// - public async ValueTask> SummarizeManyAsync(WorkflowInstanceFilter filter, PageArgs pageArgs, CancellationToken cancellationToken = default) - { - return await SummarizeManyAsync( - filter, - pageArgs, - new WorkflowInstanceOrder(x => x.CreatedAt, OrderDirection.Ascending), - cancellationToken); - } - - /// - public async ValueTask> SummarizeManyAsync(WorkflowInstanceFilter filter, PageArgs pageArgs, WorkflowInstanceOrder order, CancellationToken cancellationToken = default) - { - return await store.FindManyAsync(q => ApplyFilter(q, filter), pageArgs, order.KeySelector.GetPropertyName(), order.Direction, cancellationToken); - } - - /// - public async ValueTask> SummarizeManyAsync(WorkflowInstanceFilter filter, CancellationToken cancellationToken = default) - { - return await SummarizeManyAsync(filter, new WorkflowInstanceOrder(x => x.CreatedAt, OrderDirection.Ascending), cancellationToken); - } - - /// - public async ValueTask> SummarizeManyAsync(WorkflowInstanceFilter filter, WorkflowInstanceOrder order, CancellationToken cancellationToken = default) - { - return await store.FindManyAsync(q => ApplyFilter(q, filter), order.KeySelector.GetPropertyName(), order.Direction, cancellationToken); - } - - /// - public async ValueTask> FindManyIdsAsync(WorkflowInstanceFilter filter, CancellationToken cancellationToken = default) - { - var items = await store.FindManyAsync(q => ApplyFilter(q, filter), cancellationToken); - return items.Select(x => x.Id).ToList(); - } - - /// - public async ValueTask> FindManyIdsAsync(WorkflowInstanceFilter filter, PageArgs pageArgs, CancellationToken cancellationToken = default) - { - return await FindManyIdsAsync( - filter, - pageArgs, - new WorkflowInstanceOrder(x => x.CreatedAt, OrderDirection.Ascending), - cancellationToken); - } - - /// - public async ValueTask> FindManyIdsAsync(WorkflowInstanceFilter filter, PageArgs pageArgs, WorkflowInstanceOrder order, CancellationToken cancellationToken = default) - { - var page = await store.FindManyAsync(q => ApplyFilter(q, filter), pageArgs, order.KeySelector.GetPropertyName(), order.Direction, cancellationToken); - var ids = page.Items.Select(x => x.Id).ToList(); - return Page.Of(ids, page.TotalCount); - } - - /// - [RequiresUnreferencedCode("Calls Elsa.Workflows.Contracts.IWorkflowStateSerializer.DeserializeAsync(String, CancellationToken)")] - public async ValueTask SaveAsync(WorkflowInstance instance, CancellationToken cancellationToken = default) - { - var record = Map(instance); - await store.SaveAsync(record, cancellationToken); - } - - /// - public async ValueTask AddAsync(WorkflowInstance instance, CancellationToken cancellationToken = default) - { - var record = Map(instance); - await store.AddAsync(record, cancellationToken); - } - - /// - public async ValueTask UpdateAsync(WorkflowInstance instance, CancellationToken cancellationToken = default) - { - var record = Map(instance); - await store.UpdateAsync(record, cancellationToken); - } - - /// - [RequiresUnreferencedCode("Calls Elsa.Workflows.Contracts.IWorkflowStateSerializer.DeserializeAsync(String, CancellationToken)")] - public async ValueTask SaveManyAsync(IEnumerable instances, CancellationToken cancellationToken = default) - { - var records = Map(instances); - await store.SaveManyAsync(records, cancellationToken); - } - - /// - public async ValueTask DeleteAsync(WorkflowInstanceFilter filter, CancellationToken cancellationToken = default) - { - return await store.DeleteAsync(q => ApplyFilter(q, filter), cancellationToken); - } - - public async Task UpdateUpdatedTimestampAsync(string workflowInstanceId, DateTimeOffset value, CancellationToken cancellationToken = default) - { - var record = new WorkflowInstanceRecord - { - Id = workflowInstanceId, - UpdatedAt = value - }; - await store.UpdateAsync(record, [x => x.UpdatedAt], cancellationToken); - } - - private void ApplyFilter(ParameterizedQuery query, WorkflowInstanceFilter filter) - { - query - .Is(nameof(WorkflowInstance.Id), filter.Id) - .In(nameof(WorkflowInstance.Id), filter.Ids) - .Is(nameof(WorkflowInstance.DefinitionId), filter.DefinitionId) - .In(nameof(WorkflowInstance.DefinitionId), filter.DefinitionIds) - .Is(nameof(WorkflowInstance.DefinitionVersionId), filter.DefinitionVersionId) - .In(nameof(WorkflowInstance.DefinitionVersionId), filter.DefinitionVersionIds) - .In(nameof(WorkflowInstance.ParentWorkflowInstanceId), filter.ParentWorkflowInstanceIds) - .Is(nameof(WorkflowInstance.Status), filter.WorkflowStatus?.ToString()) - .Is(nameof(WorkflowInstance.SubStatus), filter.WorkflowSubStatus?.ToString()) - .Is(nameof(WorkflowInstance.Name), filter.Version) - .Is(nameof(WorkflowInstance.CorrelationId), filter.CorrelationId) - .In(nameof(WorkflowInstance.CorrelationId), filter.CorrelationIds) - .In(nameof(WorkflowInstance.Status), filter.WorkflowStatuses?.Select(x => x.ToString())) - .In(nameof(WorkflowInstance.SubStatus), filter.WorkflowSubStatuses?.Select(x => x.ToString())) - .Is(nameof(WorkflowInstance.IsExecuting), filter.IsExecuting) - .AndWorkflowInstanceSearchTerm(filter.SearchTerm); - } - - [RequiresUnreferencedCode("Calls Elsa.Workflows.Contracts.IWorkflowStateSerializer.DeserializeAsync(String, CancellationToken)")] - private Page Map(Page source) - { - var items = Map(source.Items).ToList(); - return Page.Of(items, source.TotalCount); - } - - [RequiresUnreferencedCode("Calls Elsa.Workflows.Contracts.IWorkflowStateSerializer.DeserializeAsync(String, CancellationToken)")] - private IEnumerable Map(IEnumerable source) - { - return source.Select(Map); - } - - [RequiresUnreferencedCode("Calls Elsa.Workflows.Contracts.IWorkflowStateSerializer.DeserializeAsync(String, CancellationToken)")] - private IEnumerable Map(IEnumerable source) - { - return source.Select(Map); - } - - [RequiresUnreferencedCode("Calls Elsa.Workflows.Contracts.IWorkflowStateSerializer.DeserializeAsync(String, CancellationToken)")] - private WorkflowInstance Map(WorkflowInstanceRecord source) - { - var workflowState = workflowStateSerializer.Deserialize(source.WorkflowState); - return new() - { - Id = source.Id, - DefinitionId = source.DefinitionId, - DefinitionVersionId = source.DefinitionVersionId, - Version = source.Version, - Name = source.Name, - IncidentCount = source.IncidentCount, - IsSystem = source.IsSystem, - WorkflowState = workflowState, - CreatedAt = source.CreatedAt, - UpdatedAt = source.UpdatedAt, - FinishedAt = source.FinishedAt, - Status = Enum.Parse(source.Status), - SubStatus = Enum.Parse(source.SubStatus), - IsExecuting = source.IsExecuting, - CorrelationId = source.CorrelationId, - TenantId = source.TenantId - }; - } - - [RequiresUnreferencedCode("Calls Elsa.Workflows.Contracts.IWorkflowStateSerializer.DeserializeAsync(String, CancellationToken)")] - private WorkflowInstanceRecord Map(WorkflowInstance source) - { - var workflowState = workflowStateSerializer.Serialize(source.WorkflowState); - return new() - { - Id = source.Id, - DefinitionId = source.DefinitionId, - DefinitionVersionId = source.DefinitionVersionId, - Version = source.Version, - Name = source.Name, - IncidentCount = source.IncidentCount, - IsSystem = source.IsSystem, - WorkflowState = workflowState, - CreatedAt = source.CreatedAt, - UpdatedAt = source.UpdatedAt, - FinishedAt = source.FinishedAt, - Status = source.Status.ToString(), - SubStatus = source.SubStatus.ToString(), - IsExecuting = source.IsExecuting, - CorrelationId = source.CorrelationId, - TenantId = source.TenantId - }; - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Dapper/Modules/Runtime/Extensions/DapperWorkflowManagementFeatureExtensions.cs b/src/modules/Elsa.Dapper/Modules/Runtime/Extensions/DapperWorkflowManagementFeatureExtensions.cs deleted file mode 100644 index 423b2df3fa..0000000000 --- a/src/modules/Elsa.Dapper/Modules/Runtime/Extensions/DapperWorkflowManagementFeatureExtensions.cs +++ /dev/null @@ -1,22 +0,0 @@ -using Elsa.Dapper.Modules.Runtime.Features; -using Elsa.Workflows.Runtime.Features; -using JetBrains.Annotations; - -// ReSharper disable once CheckNamespace -namespace Elsa.Extensions; - -/// -/// Provides extensions to the feature. -/// -[PublicAPI] -public static class DapperWorkflowRuntimeExtensions -{ - /// - /// Configures the to use the . - /// - public static WorkflowRuntimeFeature UseDapper(this WorkflowRuntimeFeature feature, Action? configure = default) - { - feature.Module.Configure(configure); - return feature; - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Dapper/Modules/Runtime/Features/DapperWorkflowRuntimePersistenceFeature.cs b/src/modules/Elsa.Dapper/Modules/Runtime/Features/DapperWorkflowRuntimePersistenceFeature.cs deleted file mode 100644 index c07fd3bed0..0000000000 --- a/src/modules/Elsa.Dapper/Modules/Runtime/Features/DapperWorkflowRuntimePersistenceFeature.cs +++ /dev/null @@ -1,56 +0,0 @@ -using Elsa.Dapper.Extensions; -using Elsa.Dapper.Features; -using Elsa.Dapper.Modules.Runtime.Records; -using Elsa.Dapper.Modules.Runtime.Stores; -using Elsa.Features.Abstractions; -using Elsa.Features.Attributes; -using Elsa.Features.Services; -using Elsa.KeyValues.Features; -using Elsa.Workflows.Runtime.Features; -using JetBrains.Annotations; -using Microsoft.Extensions.DependencyInjection; - -namespace Elsa.Dapper.Modules.Runtime.Features; - -/// -/// Configures the default workflow runtime to use Dapper persistence providers. -/// -[DependsOn(typeof(DapperFeature))] -[PublicAPI] -public class DapperWorkflowRuntimePersistenceFeature : FeatureBase -{ - /// - public DapperWorkflowRuntimePersistenceFeature(IModule module) : base(module) - { - } - - /// - public override void Configure() - { - Module.Configure(feature => - { - feature.KeyValueStore = sp => sp.GetRequiredService(); - }); - Module.Configure(feature => - { - feature.TriggerStore = sp => sp.GetRequiredService(); - feature.BookmarkStore = sp => sp.GetRequiredService(); - feature.BookmarkQueueStore = sp => sp.GetRequiredService(); - feature.WorkflowExecutionLogStore = sp => sp.GetRequiredService(); - feature.ActivityExecutionLogStore = sp => sp.GetRequiredService(); - }); - } - - /// - public override void Apply() - { - base.Apply(); - - Services.AddDapperStore("Triggers"); - Services.AddDapperStore("Bookmarks"); - Services.AddDapperStore("BookmarkQueueItems"); - Services.AddDapperStore("WorkflowExecutionLogRecords"); - Services.AddDapperStore("ActivityExecutionRecords"); - Services.AddDapperStore("KeyValues"); - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Dapper/Modules/Runtime/Records/ActivityExecutionRecord.cs b/src/modules/Elsa.Dapper/Modules/Runtime/Records/ActivityExecutionRecord.cs deleted file mode 100644 index 19c25c98dc..0000000000 --- a/src/modules/Elsa.Dapper/Modules/Runtime/Records/ActivityExecutionRecord.cs +++ /dev/null @@ -1,84 +0,0 @@ -using Elsa.Dapper.Records; - -namespace Elsa.Dapper.Modules.Runtime.Records; - -/// -/// Represents a single workflow execution, associated with an individual activity instance. -/// -internal class ActivityExecutionRecordRecord : Record -{ - /// - /// Gets or sets the workflow instance ID. - /// - public string WorkflowInstanceId { get; set; } = null!; - - /// - /// Gets or sets the activity ID. - /// - public string ActivityId { get; set; } = null!; - - /// - /// Gets or sets the activity node ID. - /// - public string ActivityNodeId { get; set; } = null!; - - /// - /// The type of the activity. - /// - public string ActivityType { get; set; } = null!; - - /// - /// The version of the activity type. - /// - public int ActivityTypeVersion { get; set; } - - /// - /// The name of the activity. - /// - public string? ActivityName { get; set; } - - /// - /// The state of the activity at the time this record is created or last updated. - /// - public string? SerializedActivityState { get; set; } - - /// - /// Any additional payload associated with the log record. - /// - public string? SerializedPayload { get; set; } - - /// - /// Any outputs provided by the activity. - /// - public string? SerializedOutputs { get; set; } - - /// - /// Gets or sets the exception that occurred during the activity execution. - /// - public string? SerializedException { get; set; } - - /// - /// Any properties provided by the activity. - /// - public string? SerializedProperties { get; set; } - - /// - /// Gets or sets the time at which the activity execution began. - /// - public DateTimeOffset StartedAt { get; set; } - - /// - /// Gets or sets whether the activity has any bookmarks. - /// - public bool HasBookmarks { get; set; } - - /// - /// Gets or sets the status of the activity. - /// - public string Status { get; set; } = null!; - - /// - /// Gets or sets the time at which the activity execution completed. - /// - public DateTimeOffset? CompletedAt { get; set; } -} \ No newline at end of file diff --git a/src/modules/Elsa.Dapper/Modules/Runtime/Records/ActivityExecutionSummaryRecord.cs b/src/modules/Elsa.Dapper/Modules/Runtime/Records/ActivityExecutionSummaryRecord.cs deleted file mode 100644 index 228b82e474..0000000000 --- a/src/modules/Elsa.Dapper/Modules/Runtime/Records/ActivityExecutionSummaryRecord.cs +++ /dev/null @@ -1,59 +0,0 @@ -using Elsa.Dapper.Records; - -namespace Elsa.Dapper.Modules.Runtime.Records; - -/// -/// Represents a single workflow execution, associated with an individual activity instance. -/// -internal class ActivityExecutionSummaryRecord : Record -{ - /// - /// Gets or sets the workflow instance ID. - /// - public string WorkflowInstanceId { get; set; } = null!; - - /// - /// Gets or sets the activity ID. - /// - public string ActivityId { get; set; } = null!; - - /// - /// Gets or sets the activity node ID. - /// - public string ActivityNodeId { get; set; } = null!; - - /// - /// The type of the activity. - /// - public string ActivityType { get; set; } = null!; - - /// - /// The version of the activity type. - /// - public int ActivityTypeVersion { get; set; } - - /// - /// The name of the activity. - /// - public string? ActivityName { get; set; } - - /// - /// Gets or sets the time at which the activity execution began. - /// - public DateTimeOffset StartedAt { get; set; } - - /// - /// Gets or sets whether the activity has any bookmarks. - /// - public bool HasBookmarks { get; set; } - - /// - /// Gets or sets the status of the activity. - /// - public string Status { get; set; } = null!; - - /// - /// Gets or sets the time at which the activity execution completed. - /// - public DateTimeOffset? CompletedAt { get; set; } -} \ No newline at end of file diff --git a/src/modules/Elsa.Dapper/Modules/Runtime/Records/BookmarkQueueItemRecord.cs b/src/modules/Elsa.Dapper/Modules/Runtime/Records/BookmarkQueueItemRecord.cs deleted file mode 100644 index a3be1d90f6..0000000000 --- a/src/modules/Elsa.Dapper/Modules/Runtime/Records/BookmarkQueueItemRecord.cs +++ /dev/null @@ -1,14 +0,0 @@ -using Elsa.Dapper.Records; - -namespace Elsa.Dapper.Modules.Runtime.Records; - -internal class BookmarkQueueItemRecord : Record -{ - public string? WorkflowInstanceId { get; set; } - public string? BookmarkId { get; set; } - public string? StimulusHash { get; set; } - public string? ActivityInstanceId { get; set; } - public string? ActivityTypeName { get; set; } - public string? SerializedOptions { get; set; } - public DateTimeOffset CreatedAt { get; set; } -} \ No newline at end of file diff --git a/src/modules/Elsa.Dapper/Modules/Runtime/Records/KeyValuePairRecord.cs b/src/modules/Elsa.Dapper/Modules/Runtime/Records/KeyValuePairRecord.cs deleted file mode 100644 index 5a276a042e..0000000000 --- a/src/modules/Elsa.Dapper/Modules/Runtime/Records/KeyValuePairRecord.cs +++ /dev/null @@ -1,8 +0,0 @@ -using Elsa.Dapper.Records; - -namespace Elsa.Dapper.Modules.Runtime.Records; - -internal class KeyValuePairRecord : Record -{ - public string Value { get; set; } = null!; -} \ No newline at end of file diff --git a/src/modules/Elsa.Dapper/Modules/Runtime/Records/StoredBookmarkRecord.cs b/src/modules/Elsa.Dapper/Modules/Runtime/Records/StoredBookmarkRecord.cs deleted file mode 100644 index 4040bdc921..0000000000 --- a/src/modules/Elsa.Dapper/Modules/Runtime/Records/StoredBookmarkRecord.cs +++ /dev/null @@ -1,15 +0,0 @@ -using Elsa.Dapper.Records; - -namespace Elsa.Dapper.Modules.Runtime.Records; - -internal class StoredBookmarkRecord : Record -{ - public string ActivityTypeName { get; set; } = null!; - public string Hash { get; set; } = null!; - public string WorkflowInstanceId { get; set; } = null!; - public string? CorrelationId { get; set; } - public string? ActivityInstanceId { get; set; } - public string? SerializedPayload { get; set; } - public string? SerializedMetadata { get; set; } - public DateTimeOffset CreatedAt { get; set; } -} \ No newline at end of file diff --git a/src/modules/Elsa.Dapper/Modules/Runtime/Records/StoredTriggerRecord.cs b/src/modules/Elsa.Dapper/Modules/Runtime/Records/StoredTriggerRecord.cs deleted file mode 100644 index 537c556205..0000000000 --- a/src/modules/Elsa.Dapper/Modules/Runtime/Records/StoredTriggerRecord.cs +++ /dev/null @@ -1,13 +0,0 @@ -using Elsa.Dapper.Records; - -namespace Elsa.Dapper.Modules.Runtime.Records; - -internal class StoredTriggerRecord : Record -{ - public string WorkflowDefinitionId { get; set; } = null!; - public string WorkflowDefinitionVersionId { get; set; } = null!; - public string Name { get; set; } = null!; - public string ActivityId { get; set; } = null!; - public string? Hash { get; set; } - public string? SerializedPayload { get; set; } -} \ No newline at end of file diff --git a/src/modules/Elsa.Dapper/Modules/Runtime/Records/WorkflowExecutionLogRecordRecord.cs b/src/modules/Elsa.Dapper/Modules/Runtime/Records/WorkflowExecutionLogRecordRecord.cs deleted file mode 100644 index 5b2b5c74ac..0000000000 --- a/src/modules/Elsa.Dapper/Modules/Runtime/Records/WorkflowExecutionLogRecordRecord.cs +++ /dev/null @@ -1,26 +0,0 @@ -using Elsa.Dapper.Records; - -namespace Elsa.Dapper.Modules.Runtime.Records; - -internal class WorkflowExecutionLogRecordRecord : Record -{ - public string Id { get; set; } = null!; - public string WorkflowDefinitionId { get; set; } = null!; - public string WorkflowDefinitionVersionId { get; set; } = null!; - public string WorkflowInstanceId { get; set; } = null!; - public int WorkflowVersion { get; set; } - public string ActivityInstanceId { get; set; } = null!; - public string? ParentActivityInstanceId { get; set; } - public string ActivityId { get; set; } = null!; - public string ActivityType { get; set; } = null!; - public int ActivityTypeVersion { get; set; } - public string? ActivityName { get; set; } - public string ActivityNodeId { get; set; } = null!; - public DateTimeOffset Timestamp { get; set; } - public long Sequence { get; set; } - public string? EventName { get; set; } - public string? Message { get; set; } - public string? Source { get; set; } - public string? SerializedActivityState { get; set; } - public string? SerializedPayload { get; set; } -} \ No newline at end of file diff --git a/src/modules/Elsa.Dapper/Modules/Runtime/Stores/DapperActivityExecutionRecordStore.cs b/src/modules/Elsa.Dapper/Modules/Runtime/Stores/DapperActivityExecutionRecordStore.cs deleted file mode 100644 index 37879078cf..0000000000 --- a/src/modules/Elsa.Dapper/Modules/Runtime/Stores/DapperActivityExecutionRecordStore.cs +++ /dev/null @@ -1,176 +0,0 @@ -using Elsa.Dapper.Extensions; -using Elsa.Dapper.Models; -using Elsa.Dapper.Modules.Runtime.Records; -using Elsa.Dapper.Services; -using Elsa.Extensions; -using Elsa.Workflows; -using Elsa.Workflows.Runtime; -using Elsa.Workflows.Runtime.Entities; -using Elsa.Workflows.Runtime.Filters; -using Elsa.Workflows.Runtime.OrderDefinitions; -using Elsa.Workflows.State; -using JetBrains.Annotations; - -namespace Elsa.Dapper.Modules.Runtime.Stores; - -/// -/// Implements the using Dapper. -/// -[UsedImplicitly] -internal class DapperActivityExecutionRecordStore(Store store, IPayloadSerializer payloadSerializer, ISafeSerializer safeSerializer) - : IActivityExecutionStore -{ - /// - public async Task SaveAsync(ActivityExecutionRecord record, CancellationToken cancellationToken = default) - { - var mappedRecord = Map(record); - await store.SaveAsync(mappedRecord, cancellationToken); - } - - /// - public async Task SaveManyAsync(IEnumerable records, CancellationToken cancellationToken = default) - { - var mappedRecords = records.Select(Map).ToList(); - await store.SaveManyAsync(mappedRecords, cancellationToken); - } - - /// - public async Task AddManyAsync(IEnumerable records, CancellationToken cancellationToken = default) - { - var mappedRecords = records.Select(Map).ToList(); - await store.AddManyAsync(mappedRecords, cancellationToken); - } - - /// - public async Task FindAsync(ActivityExecutionRecordFilter filter, CancellationToken cancellationToken = default) - { - var record = await store.FindAsync(q => ApplyFilter(q, filter), cancellationToken); - return record == null ? null : Map(record); - } - - /// - public async Task> FindManyAsync(ActivityExecutionRecordFilter filter, ActivityExecutionRecordOrder order, CancellationToken cancellationToken = default) - { - var records = await store.FindManyAsync(q => ApplyFilter(q, filter), order.KeySelector.GetPropertyName(), order.Direction, cancellationToken); - return records.Select(Map).ToList(); - } - - /// - public async Task> FindManyAsync(ActivityExecutionRecordFilter filter, CancellationToken cancellationToken = default) - { - var records = await store.FindManyAsync(q => ApplyFilter(q, filter), cancellationToken); - return records.Select(Map).ToList(); - } - - /// - public async Task> FindManySummariesAsync(ActivityExecutionRecordFilter filter, ActivityExecutionRecordOrder order, CancellationToken cancellationToken = default) - { - var records = await store.FindManyAsync(q => ApplyFilter(q, filter), cancellationToken); - return records.Select(MapSummary).ToList(); - } - - /// - public async Task> FindManySummariesAsync(ActivityExecutionRecordFilter filter, CancellationToken cancellationToken = default) - { - var records = await store.FindManyAsync(q => ApplyFilter(q, filter), cancellationToken); - return records.Select(MapSummary).ToList(); - } - - /// - public async Task CountAsync(ActivityExecutionRecordFilter filter, CancellationToken cancellationToken = default) - { - return await store.CountAsync(q => ApplyFilter(q, filter), cancellationToken); - } - - /// - public async Task DeleteManyAsync(ActivityExecutionRecordFilter filter, CancellationToken cancellationToken = default) - { - return await store.DeleteAsync(q => ApplyFilter(q, filter), cancellationToken); - } - - private static void ApplyFilter(ParameterizedQuery query, ActivityExecutionRecordFilter filter) - { - query - .Is(nameof(ActivityExecutionRecordRecord.Id), filter.Id) - .In(nameof(ActivityExecutionRecordRecord.Id), filter.Ids) - .Is(nameof(ActivityExecutionRecordRecord.ActivityId), filter.ActivityId) - .In(nameof(ActivityExecutionRecordRecord.ActivityId), filter.ActivityIds) - .Is(nameof(ActivityExecutionRecordRecord.WorkflowInstanceId), filter.WorkflowInstanceId) - .In(nameof(ActivityExecutionRecordRecord.WorkflowInstanceId), filter.WorkflowInstanceIds); - - if (filter.Completed != null) - { - if (filter.Completed == true) - query.IsNotNull(nameof(ActivityExecutionRecordRecord.CompletedAt)); - else - query.IsNull(nameof(ActivityExecutionRecordRecord.CompletedAt)); - } - } - - private ActivityExecutionRecordRecord Map(ActivityExecutionRecord source) - { - return new() - { - Id = source.Id, - ActivityId = source.ActivityId, - ActivityNodeId = source.ActivityNodeId, - ActivityType = source.ActivityType, - ActivityName = source.ActivityName, - WorkflowInstanceId = source.WorkflowInstanceId, - CompletedAt = source.CompletedAt, - StartedAt = source.StartedAt, - HasBookmarks = source.HasBookmarks, - Status = source.Status.ToString(), - ActivityTypeVersion = source.ActivityTypeVersion, - SerializedActivityState = source.ActivityState?.Any() == true ? safeSerializer.Serialize(source.ActivityState) : null, - SerializedPayload = source.Payload?.Any() == true ? safeSerializer.Serialize(source.Payload) : null, - SerializedOutputs = source.Outputs?.Any() == true ? safeSerializer.Serialize(source.Outputs) : null, - SerializedException = source.Exception != null ? payloadSerializer.Serialize(source.Exception) : null, - SerializedProperties = source.Properties?.Any() == true ? safeSerializer.Serialize(source.Properties) : null, - TenantId = source.TenantId - }; - } - - private ActivityExecutionRecord Map(ActivityExecutionRecordRecord source) - { - return new() - { - Id = source.Id, - ActivityId = source.ActivityId, - ActivityNodeId = source.ActivityNodeId, - ActivityType = source.ActivityType, - ActivityName = source.ActivityName, - WorkflowInstanceId = source.WorkflowInstanceId, - CompletedAt = source.CompletedAt, - StartedAt = source.StartedAt, - HasBookmarks = source.HasBookmarks, - Status = Enum.Parse(source.Status), - ActivityTypeVersion = source.ActivityTypeVersion, - ActivityState = source.SerializedActivityState != null ? payloadSerializer.Deserialize>(source.SerializedActivityState) : null, - Payload = source.SerializedPayload != null ? safeSerializer.Deserialize>(source.SerializedPayload) : null, - Outputs = source.SerializedOutputs != null ? safeSerializer.Deserialize>(source.SerializedOutputs) : null, - Exception = source.SerializedException != null ? payloadSerializer.Deserialize(source.SerializedException) : null, - Properties = source.SerializedProperties != null ? safeSerializer.Deserialize>(source.SerializedProperties) : null, - TenantId = source.TenantId - }; - } - - private ActivityExecutionRecordSummary MapSummary(ActivityExecutionSummaryRecord source) - { - return new() - { - Id = source.Id, - ActivityId = source.ActivityId, - ActivityNodeId = source.ActivityNodeId, - ActivityType = source.ActivityType, - ActivityName = source.ActivityName, - WorkflowInstanceId = source.WorkflowInstanceId, - CompletedAt = source.CompletedAt, - StartedAt = source.StartedAt, - HasBookmarks = source.HasBookmarks, - Status = Enum.Parse(source.Status), - ActivityTypeVersion = source.ActivityTypeVersion, - TenantId = source.TenantId - }; - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Dapper/Modules/Runtime/Stores/DapperBookmarkQueueStore.cs b/src/modules/Elsa.Dapper/Modules/Runtime/Stores/DapperBookmarkQueueStore.cs deleted file mode 100644 index 1c6152afbb..0000000000 --- a/src/modules/Elsa.Dapper/Modules/Runtime/Stores/DapperBookmarkQueueStore.cs +++ /dev/null @@ -1,114 +0,0 @@ -using Elsa.Common.Models; -using Elsa.Dapper.Extensions; -using Elsa.Dapper.Models; -using Elsa.Dapper.Modules.Runtime.Records; -using Elsa.Dapper.Services; -using Elsa.Extensions; -using Elsa.Workflows; -using Elsa.Workflows.Runtime; -using Elsa.Workflows.Runtime.Entities; -using Elsa.Workflows.Runtime.Filters; -using Elsa.Workflows.Runtime.Options; -using Elsa.Workflows.Runtime.OrderDefinitions; -using JetBrains.Annotations; - -namespace Elsa.Dapper.Modules.Runtime.Stores; - -/// -/// A Dapper-based implementation. -/// -[UsedImplicitly] -internal class DapperBookmarkQueueStore(Store store, IPayloadSerializer payloadSerializer) : IBookmarkQueueStore -{ - /// - public async Task SaveAsync(BookmarkQueueItem record, CancellationToken cancellationToken = default) - { - var mappedRecord = Map(record); - await store.SaveAsync(mappedRecord, cancellationToken); - } - - /// - public async Task AddAsync(BookmarkQueueItem record, CancellationToken cancellationToken = default) - { - var mappedRecord = Map(record); - await store.AddAsync(mappedRecord, cancellationToken); - } - - /// - public async Task FindAsync(BookmarkQueueFilter filter, CancellationToken cancellationToken = default) - { - var record = await store.FindAsync(q => ApplyFilter(q, filter), cancellationToken); - return record != null ? Map(record) : default; - } - - public async Task> FindManyAsync(BookmarkQueueFilter filter, CancellationToken cancellationToken = default) - { - var records = await store.FindManyAsync(q => ApplyFilter(q, filter), cancellationToken); - return Map(records); - } - - public async Task> PageAsync(PageArgs pageArgs, BookmarkQueueItemOrder orderBy, CancellationToken cancellationToken = default) - { - var records = await store.ListAsync(pageArgs, orderBy.KeySelector.GetPropertyName(), orderBy.Direction, cancellationToken); - return Map(records); - } - - public async Task> PageAsync(PageArgs pageArgs, BookmarkQueueFilter filter, BookmarkQueueItemOrder orderBy, CancellationToken cancellationToken = default) - { - var records = await store.FindManyAsync(q => ApplyFilter(q, filter), pageArgs, orderBy.KeySelector.GetPropertyName(), orderBy.Direction, cancellationToken); - return Map(records); - } - - /// - public async Task DeleteAsync(BookmarkQueueFilter filter, CancellationToken cancellationToken = default) - { - return await store.DeleteAsync(q => ApplyFilter(q, filter), cancellationToken); - } - - private void ApplyFilter(ParameterizedQuery query, BookmarkQueueFilter filter) - { - query - .Is(nameof(BookmarkQueueItemRecord.WorkflowInstanceId), filter.WorkflowInstanceId) - .Is(nameof(BookmarkQueueItemRecord.BookmarkId), filter.BookmarkId) - .Is(nameof(BookmarkQueueItemRecord.StimulusHash), filter.BookmarkHash) - .Is(nameof(BookmarkQueueItemRecord.ActivityInstanceId), filter.ActivityInstanceId) - .Is(nameof(BookmarkQueueItemRecord.ActivityTypeName), filter.ActivityTypeName) - ; - } - - private Page Map(Page records) => new(Map(records.Items).ToList(), records.TotalCount); - private IEnumerable Map(IEnumerable source) => source.Select(Map); - private IEnumerable Map(IEnumerable source) => source.Select(Map); - - private BookmarkQueueItemRecord Map(BookmarkQueueItem source) - { - return new BookmarkQueueItemRecord - { - Id = source.Id, - WorkflowInstanceId = source.WorkflowInstanceId, - BookmarkId = source.BookmarkId, - StimulusHash = source.StimulusHash, - ActivityInstanceId = source.ActivityInstanceId, - ActivityTypeName = source.ActivityTypeName, - SerializedOptions = source.Options != null ? payloadSerializer.Serialize(source.Options) : default, - CreatedAt = source.CreatedAt, - TenantId = source.TenantId - }; - } - - private BookmarkQueueItem Map(BookmarkQueueItemRecord source) - { - return new BookmarkQueueItem - { - Id = source.Id, - WorkflowInstanceId = source.WorkflowInstanceId, - BookmarkId = source.BookmarkId, - StimulusHash = source.StimulusHash, - ActivityInstanceId = source.ActivityInstanceId, - ActivityTypeName = source.ActivityTypeName, - Options = source.SerializedOptions != null ? payloadSerializer.Deserialize(source.SerializedOptions) : default, - CreatedAt = source.CreatedAt, - TenantId = source.TenantId - }; - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Dapper/Modules/Runtime/Stores/DapperBookmarkStore.cs b/src/modules/Elsa.Dapper/Modules/Runtime/Stores/DapperBookmarkStore.cs deleted file mode 100644 index 785fea380d..0000000000 --- a/src/modules/Elsa.Dapper/Modules/Runtime/Stores/DapperBookmarkStore.cs +++ /dev/null @@ -1,103 +0,0 @@ -using Elsa.Dapper.Extensions; -using Elsa.Dapper.Models; -using Elsa.Dapper.Modules.Runtime.Records; -using Elsa.Dapper.Services; -using Elsa.Workflows; -using Elsa.Workflows.Runtime; -using Elsa.Workflows.Runtime.Entities; -using Elsa.Workflows.Runtime.Filters; -using JetBrains.Annotations; - -namespace Elsa.Dapper.Modules.Runtime.Stores; - -/// -/// A Dapper-based implementation. -/// -[UsedImplicitly] -internal class DapperBookmarkStore(Store store, IPayloadSerializer payloadSerializer) : IBookmarkStore -{ - /// - public async ValueTask SaveAsync(StoredBookmark record, CancellationToken cancellationToken = default) - { - var mappedRecord = Map(record); - await store.SaveAsync(mappedRecord, cancellationToken); - } - - /// - public async ValueTask SaveManyAsync(IEnumerable records, CancellationToken cancellationToken) - { - var mappedRecords = Map(records); - await store.SaveManyAsync(mappedRecords, cancellationToken); - } - - /// - public async ValueTask FindAsync(BookmarkFilter filter, CancellationToken cancellationToken = default) - { - var record = await store.FindAsync(q => ApplyFilter(q, filter), cancellationToken); - return record != null ? Map(record) : default; - } - - /// - public async ValueTask> FindManyAsync(BookmarkFilter filter, CancellationToken cancellationToken = default) - { - var records = await store.FindManyAsync(q => ApplyFilter(q, filter), filter.TenantAgnostic, cancellationToken); - return Map(records); - } - - /// - public async ValueTask DeleteAsync(BookmarkFilter filter, CancellationToken cancellationToken = default) - { - return await store.DeleteAsync(q => ApplyFilter(q, filter), cancellationToken); - } - - private void ApplyFilter(ParameterizedQuery query, BookmarkFilter filter) - { - query - .Is(nameof(StoredBookmarkRecord.Hash), filter.Hash) - .In(nameof(StoredBookmarkRecord.Hash), filter.Hashes) - .Is(nameof(StoredBookmarkRecord.WorkflowInstanceId), filter.WorkflowInstanceId) - .In(nameof(StoredBookmarkRecord.WorkflowInstanceId), filter.WorkflowInstanceIds) - .Is(nameof(StoredBookmarkRecord.CorrelationId), filter.CorrelationId) - .Is(nameof(StoredBookmarkRecord.ActivityTypeName), filter.Name) - .In(nameof(StoredBookmarkRecord.ActivityTypeName), filter.Names) - .Is(nameof(StoredBookmarkRecord.ActivityInstanceId), filter.ActivityInstanceId) - ; - } - - private IEnumerable Map(IEnumerable source) => source.Select(Map); - private IEnumerable Map(IEnumerable source) => source.Select(Map); - - private StoredBookmarkRecord Map(StoredBookmark source) - { - return new StoredBookmarkRecord - { - Id = source.Id, - WorkflowInstanceId = source.WorkflowInstanceId, - CorrelationId = source.CorrelationId, - ActivityInstanceId = source.ActivityInstanceId, - ActivityTypeName = source.Name, - Hash = source.Hash, - SerializedPayload = source.Payload != null ? payloadSerializer.Serialize(source.Payload) : default, - SerializedMetadata = source.Metadata != null ? payloadSerializer.Serialize(source.Metadata) : default, - CreatedAt = source.CreatedAt, - TenantId = source.TenantId - }; - } - - private StoredBookmark Map(StoredBookmarkRecord source) - { - return new StoredBookmark - { - Id = source.Id, - WorkflowInstanceId = source.WorkflowInstanceId, - CorrelationId = source.CorrelationId, - ActivityInstanceId = source.ActivityInstanceId, - Name = source.ActivityTypeName, - Hash = source.Hash, - Payload = source.SerializedPayload != null ? payloadSerializer.Deserialize(source.SerializedPayload) : default, - Metadata = source.SerializedMetadata != null ? payloadSerializer.Deserialize>(source.SerializedMetadata) : default, - CreatedAt = source.CreatedAt, - TenantId = source.TenantId - }; - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Dapper/Modules/Runtime/Stores/DapperTriggerStore.cs b/src/modules/Elsa.Dapper/Modules/Runtime/Stores/DapperTriggerStore.cs deleted file mode 100644 index e6ad75d333..0000000000 --- a/src/modules/Elsa.Dapper/Modules/Runtime/Stores/DapperTriggerStore.cs +++ /dev/null @@ -1,110 +0,0 @@ -using Elsa.Dapper.Extensions; -using Elsa.Dapper.Models; -using Elsa.Dapper.Modules.Runtime.Records; -using Elsa.Dapper.Services; -using Elsa.Workflows; -using Elsa.Workflows.Runtime; -using Elsa.Workflows.Runtime.Entities; -using Elsa.Workflows.Runtime.Filters; -using JetBrains.Annotations; - -namespace Elsa.Dapper.Modules.Runtime.Stores; - -/// -/// Provides a Dapper implementation of . -/// -[UsedImplicitly] -internal class DapperTriggerStore(Store store, IPayloadSerializer payloadSerializer) : ITriggerStore -{ - /// - public async ValueTask SaveAsync(StoredTrigger record, CancellationToken cancellationToken = default) - { - var mappedRecord = Map(record); - await store.SaveAsync(mappedRecord, cancellationToken); - } - - /// - public async ValueTask SaveManyAsync(IEnumerable records, CancellationToken cancellationToken = default) - { - var mappedRecords = records.Select(Map); - await store.SaveManyAsync(mappedRecords, cancellationToken); - } - - /// - public async ValueTask FindAsync(TriggerFilter filter, CancellationToken cancellationToken = default) - { - var record = await store.FindAsync(q => ApplyFilter(q, filter), cancellationToken); - return record != null ? Map(record) : default; - } - - /// - public async ValueTask> FindManyAsync(TriggerFilter filter, CancellationToken cancellationToken = default) - { - var records = await store.FindManyAsync(q => ApplyFilter(q, filter), cancellationToken); - return Map(records); - } - - /// - public async ValueTask ReplaceAsync(IEnumerable removed, IEnumerable added, CancellationToken cancellationToken = default) - { - var filter = new TriggerFilter - { - Ids = removed.Select(r => r.Id).ToList() - }; - await DeleteManyAsync(filter, cancellationToken); - await SaveManyAsync(added, cancellationToken); - } - - /// - public async ValueTask DeleteManyAsync(TriggerFilter filter, CancellationToken cancellationToken = default) - { - return await store.DeleteAsync(q => ApplyFilter(q, filter), cancellationToken); - } - - private void ApplyFilter(ParameterizedQuery query, TriggerFilter filter) - { - query - .Is(nameof(StoredTriggerRecord.Id), filter.Id) - .In(nameof(StoredTriggerRecord.Id), filter.Ids) - .Is(nameof(StoredTriggerRecord.WorkflowDefinitionId), filter.WorkflowDefinitionId) - .In(nameof(StoredTriggerRecord.WorkflowDefinitionId), filter.WorkflowDefinitionIds) - .Is(nameof(StoredTriggerRecord.WorkflowDefinitionVersionId), filter.WorkflowDefinitionVersionId) - .In(nameof(StoredTriggerRecord.WorkflowDefinitionVersionId), filter.WorkflowDefinitionVersionIds) - .Is(nameof(StoredTriggerRecord.Name), filter.Name) - .In(nameof(StoredTriggerRecord.Name), filter.Names) - .Is(nameof(StoredTriggerRecord.Hash), filter.Hash) - ; - } - - private IEnumerable Map(IEnumerable source) => source.Select(Map); - - private StoredTrigger Map(StoredTriggerRecord source) - { - return new StoredTrigger - { - Id = source.Id, - ActivityId = source.ActivityId, - Hash = source.Hash, - Name = source.Name, - WorkflowDefinitionId = source.WorkflowDefinitionId, - WorkflowDefinitionVersionId = source.WorkflowDefinitionVersionId, - Payload = source.SerializedPayload != null ? payloadSerializer.Deserialize(source.SerializedPayload) : default, - TenantId = source.TenantId - }; - } - - private StoredTriggerRecord Map(StoredTrigger source) - { - return new StoredTriggerRecord - { - Id = source.Id, - ActivityId = source.ActivityId, - Hash = source.Hash, - Name = source.Name, - WorkflowDefinitionId = source.WorkflowDefinitionId, - WorkflowDefinitionVersionId = source.WorkflowDefinitionVersionId, - SerializedPayload = source.Payload != null ? payloadSerializer.Serialize(source.Payload) : default, - TenantId = source.TenantId - }; - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Dapper/Modules/Runtime/Stores/DapperWorkflowExecutionLogStore.cs b/src/modules/Elsa.Dapper/Modules/Runtime/Stores/DapperWorkflowExecutionLogStore.cs deleted file mode 100644 index 32d3db0fbe..0000000000 --- a/src/modules/Elsa.Dapper/Modules/Runtime/Stores/DapperWorkflowExecutionLogStore.cs +++ /dev/null @@ -1,171 +0,0 @@ -using Elsa.Common.Entities; -using Elsa.Common.Models; -using Elsa.Dapper.Extensions; -using Elsa.Dapper.Models; -using Elsa.Dapper.Modules.Runtime.Records; -using Elsa.Dapper.Services; -using Elsa.Extensions; -using Elsa.Workflows; -using Elsa.Workflows.Runtime; -using Elsa.Workflows.Runtime.Entities; -using Elsa.Workflows.Runtime.Filters; -using Elsa.Workflows.Runtime.OrderDefinitions; -using JetBrains.Annotations; - -namespace Elsa.Dapper.Modules.Runtime.Stores; - -/// -/// Implements the using Dapper. -/// -[UsedImplicitly] -internal class DapperWorkflowExecutionLogStore(Store store, IPayloadSerializer payloadSerializer) : IWorkflowExecutionLogStore -{ - /// - public async Task AddAsync(WorkflowExecutionLogRecord record, CancellationToken cancellationToken = default) - { - var mappedRecord = Map(record); - await store.AddAsync(mappedRecord, cancellationToken); - } - - /// - public async Task AddManyAsync(IEnumerable records, CancellationToken cancellationToken = default) - { - var mappedRecords = records.Select(Map); - await store.AddManyAsync(mappedRecords, cancellationToken); - } - - /// - public async Task SaveAsync(WorkflowExecutionLogRecord record, CancellationToken cancellationToken = default) - { - var mappedRecord = Map(record); - await store.SaveAsync(mappedRecord, cancellationToken); - } - - /// - public async Task SaveManyAsync(IEnumerable records, CancellationToken cancellationToken = default) - { - var mappedRecords = records.Select(Map); - await store.SaveManyAsync(mappedRecords, cancellationToken); - } - - /// - public async Task FindAsync(WorkflowExecutionLogRecordFilter filter, CancellationToken cancellationToken = default) - { - var record = await store.FindAsync(q => ApplyFilter(q, filter), cancellationToken); - return record != null ? Map(record) : default; - } - - /// - public async Task FindAsync(WorkflowExecutionLogRecordFilter filter, WorkflowExecutionLogRecordOrder order, CancellationToken cancellationToken = default) - { - var record = await store.FindAsync(q => ApplyFilter(q, filter), order.KeySelector.GetPropertyName(), order.Direction, cancellationToken); - return record != null ? Map(record) : default; - } - - /// - public async Task> FindManyAsync(WorkflowExecutionLogRecordFilter filter, PageArgs pageArgs, CancellationToken cancellationToken = default) - { - return await FindManyAsync( - filter, - pageArgs, - new WorkflowExecutionLogRecordOrder(x => x.Timestamp, OrderDirection.Descending), - cancellationToken); - } - - /// - public async Task> FindManyAsync(WorkflowExecutionLogRecordFilter filter, PageArgs pageArgs, WorkflowExecutionLogRecordOrder order, CancellationToken cancellationToken = default) - { - var page = await store.FindManyAsync(q => ApplyFilter(q, filter), pageArgs, order.KeySelector.GetPropertyName(), order.Direction, cancellationToken); - return Map(page); - } - - /// - public async Task DeleteManyAsync(WorkflowExecutionLogRecordFilter filter, CancellationToken cancellationToken = default) - { - return await store.DeleteAsync(q => ApplyFilter(q, filter), cancellationToken); - } - - private static void ApplyFilter(ParameterizedQuery query, WorkflowExecutionLogRecordFilter filter) - { - query - .Is(nameof(WorkflowExecutionLogRecordRecord.Id), filter.Id) - .In(nameof(WorkflowExecutionLogRecordRecord.Id), filter.Ids) - .Is(nameof(WorkflowExecutionLogRecordRecord.ParentActivityInstanceId), filter.ParentActivityInstanceId) - .Is(nameof(WorkflowExecutionLogRecordRecord.ActivityId), filter.ActivityId) - .In(nameof(WorkflowExecutionLogRecordRecord.ActivityId), filter.ActivityIds) - .Is(nameof(WorkflowExecutionLogRecordRecord.WorkflowInstanceId), filter.WorkflowInstanceId) - .In(nameof(WorkflowExecutionLogRecordRecord.WorkflowInstanceId), filter.WorkflowInstanceIds) - .Is(nameof(WorkflowExecutionLogRecordRecord.EventName), filter.EventName) - .In(nameof(WorkflowExecutionLogRecordRecord.ActivityId), filter.EventNames) - .IsNot(nameof(WorkflowExecutionLogRecordRecord.ActivityType), filter.ExcludeActivityType) - .NotIn(nameof(WorkflowExecutionLogRecordRecord.ActivityType), filter.ExcludeActivityTypes) - ; - } - - private Page Map(Page source) - { - return new(source.Items.Select(Map).ToList(), source.TotalCount); - } - - private WorkflowExecutionLogRecordRecord Map(WorkflowExecutionLogRecord source) - { - return new() - { - Id = source.Id, - WorkflowDefinitionId = source.WorkflowDefinitionId, - WorkflowDefinitionVersionId = source.WorkflowDefinitionVersionId, - WorkflowInstanceId = source.WorkflowInstanceId, - WorkflowVersion = source.WorkflowVersion, - ActivityInstanceId = source.ActivityInstanceId, - ParentActivityInstanceId = source.ParentActivityInstanceId, - ActivityId = source.ActivityId, - ActivityType = source.ActivityType, - ActivityTypeVersion = source.ActivityTypeVersion, - ActivityName = source.ActivityName, - ActivityNodeId = source.ActivityNodeId, - Timestamp = source.Timestamp, - Sequence = source.Sequence, - EventName = source.EventName, - Message = source.Message, - Source = source.Source, - SerializedPayload = ShouldSerializePayload(source) ? payloadSerializer.Serialize(source.Payload!) : null, - TenantId = source.TenantId - }; - } - - private bool ShouldSerializePayload(WorkflowExecutionLogRecord source) - { - return source.Payload switch - { - null => false, - IDictionary dictionary => dictionary.Count > 0, - _ => true - }; - } - - private WorkflowExecutionLogRecord Map(WorkflowExecutionLogRecordRecord source) - { - return new() - { - Id = source.Id, - WorkflowDefinitionId = source.WorkflowDefinitionId, - WorkflowDefinitionVersionId = source.WorkflowDefinitionVersionId, - WorkflowInstanceId = source.WorkflowInstanceId, - WorkflowVersion = source.WorkflowVersion, - ActivityInstanceId = source.ActivityInstanceId, - ParentActivityInstanceId = source.ParentActivityInstanceId, - ActivityId = source.ActivityId, - ActivityType = source.ActivityType, - ActivityTypeVersion = source.ActivityTypeVersion, - ActivityName = source.ActivityName, - ActivityNodeId = source.ActivityNodeId, - Timestamp = source.Timestamp, - Sequence = source.Sequence, - EventName = source.EventName, - Message = source.Message, - Source = source.Source, - Payload = source.SerializedPayload != null ? payloadSerializer.Deserialize(source.SerializedPayload) : null, - TenantId = source.TenantId - }; - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Dapper/Modules/Runtime/Stores/KeyValueStore.cs b/src/modules/Elsa.Dapper/Modules/Runtime/Stores/KeyValueStore.cs deleted file mode 100644 index 7323281df1..0000000000 --- a/src/modules/Elsa.Dapper/Modules/Runtime/Stores/KeyValueStore.cs +++ /dev/null @@ -1,72 +0,0 @@ -using Elsa.Dapper.Extensions; -using Elsa.Dapper.Models; -using Elsa.Dapper.Modules.Runtime.Records; -using Elsa.Dapper.Services; -using Elsa.KeyValues.Contracts; -using Elsa.KeyValues.Entities; -using Elsa.KeyValues.Models; -using JetBrains.Annotations; - -namespace Elsa.Dapper.Modules.Runtime.Stores; - -/// -/// A Dapper implementation of . -/// -[UsedImplicitly] -internal class DapperKeyValueStore(Store store) : IKeyValueStore -{ - /// - public Task SaveAsync(SerializedKeyValuePair keyValuePair, CancellationToken cancellationToken) - { - var record = Map(keyValuePair); - return store.SaveAsync(record, cancellationToken); - } - - /// - public async Task FindAsync(KeyValueFilter filter, CancellationToken cancellationToken) - { - var record = await store.FindAsync(q => ApplyFilter(q, filter), cancellationToken); - return record == null ? null : Map(record); - } - - /// - public async Task> FindManyAsync(KeyValueFilter filter, CancellationToken cancellationToken) - { - var records = await store.FindManyAsync(q => ApplyFilter(q, filter), cancellationToken); - return records.Select(Map); - } - - /// - public Task DeleteAsync(string key, CancellationToken cancellationToken) - { - return store.DeleteAsync(query => query.Is(nameof(KeyValuePairRecord.Id), key), cancellationToken); - } - - private void ApplyFilter(ParameterizedQuery query, KeyValueFilter filter) - { - query - .Is(nameof(KeyValuePairRecord.Id), filter.Key) - .In(nameof(KeyValuePairRecord.Id), filter.Keys) - .StartsWith(nameof(KeyValuePairRecord.Id), filter.StartsWith, filter.Key); - } - - private KeyValuePairRecord Map(SerializedKeyValuePair source) - { - return new() - { - Id = source.Id, - Value = source.SerializedValue, - TenantId = source.TenantId - }; - } - - private SerializedKeyValuePair Map(KeyValuePairRecord source) - { - return new() - { - Id = source.Id, - SerializedValue = source.Value, - TenantId = source.TenantId - }; - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Dapper/Records/Record.cs b/src/modules/Elsa.Dapper/Records/Record.cs deleted file mode 100644 index 00fd5355c9..0000000000 --- a/src/modules/Elsa.Dapper/Records/Record.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace Elsa.Dapper.Records; - -public class Record -{ - public string Id { get; set; } = default!; - public string? TenantId { get; set; } -} \ No newline at end of file diff --git a/src/modules/Elsa.Dapper/Services/PostgreSqlDbConnectionProvider.cs b/src/modules/Elsa.Dapper/Services/PostgreSqlDbConnectionProvider.cs deleted file mode 100644 index 971145d645..0000000000 --- a/src/modules/Elsa.Dapper/Services/PostgreSqlDbConnectionProvider.cs +++ /dev/null @@ -1,48 +0,0 @@ -using System.Data; -using Elsa.Dapper.Contracts; -using Elsa.Dapper.Dialects; -using JetBrains.Annotations; -using Npgsql; - -namespace Elsa.Dapper.Services; - -/// -/// Provides a PostgreSql connection to the database. -/// -[PublicAPI] -public class PostgreSqlDbConnectionProvider : IDbConnectionProvider -{ - private readonly string _connectionString = ""; - - /// - /// Initializes a new instance of the class. - /// - public PostgreSqlDbConnectionProvider() - { - } - - /// - /// Initializes a new instance of the class. - /// - /// The connection string to use. - public PostgreSqlDbConnectionProvider(string connectionString) - { - _connectionString = connectionString; - } - - - /// - public string GetConnectionString() => _connectionString; - - /// - public IDbConnection GetConnection() - { - return new NpgsqlConnection - { - ConnectionString = GetConnectionString() - }; - } - - /// - public ISqlDialect Dialect => new PostgreSqlDialect(); -} \ No newline at end of file diff --git a/src/modules/Elsa.Dapper/Services/SqlServerDbConnectionProvider.cs b/src/modules/Elsa.Dapper/Services/SqlServerDbConnectionProvider.cs deleted file mode 100644 index f6d03a22c1..0000000000 --- a/src/modules/Elsa.Dapper/Services/SqlServerDbConnectionProvider.cs +++ /dev/null @@ -1,47 +0,0 @@ -using System.Data; -using Elsa.Dapper.Contracts; -using Elsa.Dapper.Dialects; -using JetBrains.Annotations; -using Microsoft.Data.SqlClient; - -namespace Elsa.Dapper.Services; - -/// -/// Provides a SQLite connection to the database. -/// -[PublicAPI] -public class SqlServerDbConnectionProvider : IDbConnectionProvider -{ - private readonly string _connectionString = "Server=localhost;Database=Elsa;Trusted_Connection=True;"; - - /// - /// Initializes a new instance of the class. - /// - public SqlServerDbConnectionProvider() - { - } - - /// - /// Initializes a new instance of the class. - /// - /// The connection string to use. - public SqlServerDbConnectionProvider(string connectionString) - { - _connectionString = connectionString; - } - - /// - public string GetConnectionString() =>_connectionString; - - /// - public IDbConnection GetConnection() - { - return new SqlConnection - { - ConnectionString = GetConnectionString() - }; - } - - /// - public ISqlDialect Dialect => new SqlServerDialect(); -} \ No newline at end of file diff --git a/src/modules/Elsa.Dapper/Services/SqliteDbConnectionProvider.cs b/src/modules/Elsa.Dapper/Services/SqliteDbConnectionProvider.cs deleted file mode 100644 index 26e4aa73b8..0000000000 --- a/src/modules/Elsa.Dapper/Services/SqliteDbConnectionProvider.cs +++ /dev/null @@ -1,56 +0,0 @@ -using System.Data; -using Dapper; -using Elsa.Dapper.Contracts; -using Elsa.Dapper.Dialects; -using Elsa.Dapper.TypeHandlers.Sqlite; -using JetBrains.Annotations; -using Microsoft.Data.Sqlite; - -namespace Elsa.Dapper.Services; - -/// -/// Provides a SQLite connection to the database. -/// -[PublicAPI] -public class SqliteDbConnectionProvider : IDbConnectionProvider -{ - private readonly string _connectionString = "Data Source=:memory:;Cache=Shared"; - - static SqliteDbConnectionProvider() - { - // See: https://learn.microsoft.com/en-us/dotnet/standard/data/sqlite/dapper-limitations#data-types - SqlMapper.AddTypeHandler(new DateTimeOffsetHandler()); - SqlMapper.AddTypeHandler(new TimeSpanHandler()); - } - - /// - /// Initializes a new instance of the class. - /// - public SqliteDbConnectionProvider() - { - } - - /// - /// Initializes a new instance of the class. - /// - /// The connection string to use. - public SqliteDbConnectionProvider(string connectionString) - { - _connectionString = connectionString; - } - - /// - public string GetConnectionString() => _connectionString; - - /// - public IDbConnection GetConnection() - { - return new SqliteConnection - { - ConnectionString = GetConnectionString() - }; - } - - /// - public ISqlDialect Dialect => new SqliteDialect(); -} \ No newline at end of file diff --git a/src/modules/Elsa.Dapper/Services/Store.cs b/src/modules/Elsa.Dapper/Services/Store.cs deleted file mode 100644 index 1c77912c92..0000000000 --- a/src/modules/Elsa.Dapper/Services/Store.cs +++ /dev/null @@ -1,542 +0,0 @@ -using System.Linq.Expressions; -using Dapper; -using Elsa.Common.Entities; -using Elsa.Common.Models; -using Elsa.Common.Multitenancy; -using Elsa.Dapper.Contracts; -using Elsa.Dapper.Extensions; -using Elsa.Dapper.Models; -using Elsa.Dapper.Records; -using Elsa.Extensions; -using JetBrains.Annotations; - -namespace Elsa.Dapper.Services; - -/// -/// Provides a generic store using Dapper. -/// -[PublicAPI] -public class Store(IDbConnectionProvider dbConnectionProvider, ITenantAccessor tenantAccessor, string tableName, string primaryKey = "Id") - where T : notnull -{ - /// - /// The name of the table. - /// - public string TableName { get; } = tableName; - - /// - /// The name of the primary key column. - /// - public string PrimaryKey { get; } = primaryKey; - - /// - /// Finds a single record. - /// - /// The conditions to apply to the query. - /// The cancellation token. - /// The record, if found. - public async Task FindAsync(Action filter, CancellationToken cancellationToken = default) - { - return await FindAsync(filter, false, cancellationToken); - } - - /// - /// Finds a single record. - /// - /// The conditions to apply to the query. - /// Whether to ignore the tenant filter. - /// The cancellation token. - /// The record, if found. - public async Task FindAsync(Action filter, bool tenantAgnostic = false, CancellationToken cancellationToken = default) - { - return await FindAsync(filter, null, null, tenantAgnostic, cancellationToken); - } - - /// - /// Finds a single record using the specified order key selector and order direction. - /// - /// The conditions to apply to the query. - /// The order key. - /// The order direction. - /// The cancellation token. - /// The record, if found. - public async Task FindAsync(Action filter, string orderKey, OrderDirection orderDirection, CancellationToken cancellationToken = default) - { - return await FindAsync(filter, orderKey, orderDirection, false, cancellationToken); - } - - /// - /// Finds a single record using the specified order key selector and order direction. - /// - /// The conditions to apply to the query. - /// The order key. - /// The order direction. - /// Whether to ignore the tenant filter. - /// The cancellation token. - /// The record, if found. - public async Task FindAsync(Action filter, string? orderKey = null, OrderDirection? orderDirection = null, bool tenantAgnostic = false, CancellationToken cancellationToken = default) - { - var query = dbConnectionProvider.CreateQuery().From(TableName); - ApplyTenantFilter(query, tenantAgnostic); - filter(query); - - if (orderKey != null && orderDirection != null) - query = query.OrderBy(orderKey, orderDirection.Value); - - using var connection = dbConnectionProvider.GetConnection(); - return await query.FirstOrDefaultAsync(connection); - } - - /// - /// Returns a page of records. - /// - /// The page arguments. - /// The order key selector. - /// The order direction. - /// The cancellation token. - /// A page of records. - public async Task> ListAsync(PageArgs pageArgs, string orderKey, OrderDirection orderDirection, CancellationToken cancellationToken = default) - { - return await FindManyAsync(null, pageArgs, orderKey, orderDirection, false, cancellationToken); - } - - /// - /// Returns a page of records. - /// - /// The conditions to apply to the query. - /// The page arguments. - /// The order key selector. - /// The order direction. - /// The cancellation token. - /// A page of records. - public async Task> FindManyAsync(Action? filter, PageArgs pageArgs, string orderKey, OrderDirection orderDirection, CancellationToken cancellationToken = default) - { - return await FindManyAsync(filter, pageArgs, orderKey, orderDirection, false, cancellationToken); - } - - /// - /// Returns a page of records. - /// - /// The conditions to apply to the query. - /// The page arguments. - /// The order key selector. - /// The order direction. - /// Whether to ignore the tenant filter. - /// The cancellation token. - /// A page of records. - public async Task> FindManyAsync(Action? filter, PageArgs pageArgs, string orderKey, OrderDirection orderDirection, bool tenantAgnostic, CancellationToken cancellationToken = default) - { - return await FindManyAsync(filter, pageArgs, orderKey, orderDirection, tenantAgnostic, cancellationToken); - } - - /// - /// Returns a page of records in the specified shape. - /// - /// The conditions to apply to the query. - /// The page arguments. - /// The fields by which to order the results. - /// The cancellation token. - /// A page of records. - public async Task> FindManyAsync(Action? filter, PageArgs pageArgs, IEnumerable orderFields, CancellationToken cancellationToken = default) - { - return await FindManyAsync(filter, pageArgs, orderFields, false, cancellationToken); - } - - /// - /// Returns a page of records in the specified shape. - /// - /// The conditions to apply to the query. - /// The page arguments. - /// The fields by which to order the results. - /// Whether to ignore the tenant filter. - /// The cancellation token. - /// A page of records. - public async Task> FindManyAsync(Action? filter, PageArgs pageArgs, IEnumerable orderFields, bool tenantAgnostic, CancellationToken cancellationToken = default) - { - return await FindManyAsync(filter, pageArgs, orderFields, tenantAgnostic, cancellationToken); - } - - /// - /// Returns a page of records in the specified shape. - /// - /// The conditions to apply to the query. - /// The page arguments. - /// The order key selector. - /// The order direction. - /// The cancellation token. - /// The shape type. - /// A page of records. - public async Task> FindManyAsync(Action? filter, PageArgs pageArgs, string orderKey, OrderDirection orderDirection, CancellationToken cancellationToken = default) - { - return await FindManyAsync(filter, pageArgs, orderKey, orderDirection, false, cancellationToken); - } - - /// - /// Returns a page of records in the specified shape. - /// - /// The conditions to apply to the query. - /// The page arguments. - /// The order key selector. - /// The order direction. - /// Whether to ignore the tenant filter. - /// The cancellation token. - /// The shape type. - /// A page of records. - public async Task> FindManyAsync(Action? filter, PageArgs pageArgs, string orderKey, OrderDirection orderDirection, bool tenantAgnostic, CancellationToken cancellationToken = default) - { - return await FindManyAsync(filter, pageArgs, new[] - { - new OrderField(orderKey, orderDirection) - }, tenantAgnostic, cancellationToken); - } - - /// - /// Returns a page of records in the specified shape. - /// - /// The conditions to apply to the query. - /// The page arguments. - /// The fields by which to order the results. - /// The cancellation token. - /// The shape type. - /// A page of records. - public async Task> FindManyAsync(Action? filter, PageArgs pageArgs, IEnumerable orderFields, CancellationToken cancellationToken = default) - { - return await FindManyAsync(filter, pageArgs, orderFields, false, cancellationToken); - } - - /// - /// Returns a page of records in the specified shape. - /// - /// The conditions to apply to the query. - /// The page arguments. - /// The fields by which to order the results. - /// Whether to ignore the tenant filter. - /// The cancellation token. - /// The shape type. - /// A page of records. - public async Task> FindManyAsync(Action? filter, PageArgs pageArgs, IEnumerable orderFields, bool tenantAgnostic, CancellationToken cancellationToken = default) - { - var query = dbConnectionProvider.CreateQuery().From(TableName); - ApplyTenantFilter(query, tenantAgnostic); - filter?.Invoke(query); - query = query.OrderBy(orderFields.ToArray()).Page(pageArgs); - - var countQuery = dbConnectionProvider.CreateQuery().Count(TableName); - filter?.Invoke(countQuery); - - using var connection = dbConnectionProvider.GetConnection(); - var records = (await query.QueryAsync(connection)).ToList(); - var totalCount = await countQuery.SingleAsync(connection); - return Page.Of(records, totalCount); - } - - /// - /// Returns a set of records. - /// - /// The conditions to apply to the query. - /// The cancellation token. - /// A set of records. - public async Task> FindManyAsync(Action filter, CancellationToken cancellationToken = default) - { - return await FindManyAsync(filter, false, cancellationToken); - } - - /// - /// Returns a set of records. - /// - /// The conditions to apply to the query. - /// Whether to ignore the tenant filter. - /// The cancellation token. - /// A set of records. - public async Task> FindManyAsync(Action filter, bool tenantAgnostic = false, CancellationToken cancellationToken = default) - { - return await FindManyAsync(filter, tenantAgnostic, cancellationToken); - } - - /// - /// Returns a set of records in the specified shape. - /// - /// The conditions to apply to the query. - /// The cancellation token. - /// The shape type. - /// A set of records. - public async Task> FindManyAsync(Action filter, CancellationToken cancellationToken = default) - { - return await FindManyAsync(filter, false, cancellationToken); - } - - /// - /// Returns a set of records in the specified shape. - /// - /// The conditions to apply to the query. - /// Whether to ignore the tenant filter. - /// The cancellation token. - /// /// The shape type. - /// A set of records. - public async Task> FindManyAsync(Action filter, bool tenantAgnostic = false, CancellationToken cancellationToken = default) - { - using var connection = dbConnectionProvider.GetConnection(); - var query = dbConnectionProvider.CreateQuery().From(TableName); - ApplyTenantFilter(query, tenantAgnostic); - filter(query); - return await query.QueryAsync(connection); - } - - /// - /// Returns a set of records, ordered by the specified key selector in the specified direction. - /// - /// The conditions to apply to the query. - /// The order key selector. - /// The order direction. - /// The cancellation token. - /// A set of records. - public async Task> FindManyAsync(Action filter, string orderKey, OrderDirection orderDirection, CancellationToken cancellationToken = default) - { - return await FindManyAsync(filter, orderKey, orderDirection, false, cancellationToken); - } - - /// - /// Returns a set of records, ordered by the specified key selector in the specified direction. - /// - /// The conditions to apply to the query. - /// The order key selector. - /// The order direction. - /// Whether to ignore the tenant filter. - /// The cancellation token. - /// A set of records. - public async Task> FindManyAsync(Action filter, string orderKey, OrderDirection orderDirection, bool tenantAgnostic = false, CancellationToken cancellationToken = default) - { - return await FindManyAsync(filter, orderKey, orderDirection, tenantAgnostic, cancellationToken); - } - - /// - /// Returns a set of records in the specified shape, ordered by the specified key selector in the specified direction. - /// - /// The conditions to apply to the query. - /// The order key selector. - /// The order direction. - /// The cancellation token. - /// A set of records. - public async Task> FindManyAsync(Action filter, string orderKey, OrderDirection orderDirection, CancellationToken cancellationToken = default) - { - return await FindManyAsync(filter, orderKey, orderDirection, false, cancellationToken); - } - - /// - /// Returns a set of records in the specified shape, ordered by the specified key selector in the specified direction. - /// - /// The conditions to apply to the query. - /// The order key selector. - /// The order direction. - /// Whether to ignore the tenant filter. - /// The cancellation token. - /// A set of records. - public async Task> FindManyAsync(Action filter, string orderKey, OrderDirection orderDirection, bool tenantAgnostic = false, CancellationToken cancellationToken = default) - { - using var connection = dbConnectionProvider.GetConnection(); - var query = dbConnectionProvider.CreateQuery().From(TableName); - ApplyTenantFilter(query, tenantAgnostic); - filter(query); - query = query.OrderBy(orderKey, orderDirection); - return await query.QueryAsync(connection); - } - - /// - /// Adds or updates the specified record. - /// - /// The record. - /// The cancellation token. - public async Task SaveAsync(T record, CancellationToken cancellationToken = default) - { - using var connection = dbConnectionProvider.GetConnection(); - SetTenantId(record); - var query = new ParameterizedQuery(dbConnectionProvider.Dialect).Upsert(TableName, PrimaryKey, record); - await query.ExecuteAsync(connection); - } - - /// - /// Adds or updates the specified records. - /// - /// The records. - /// The cancellation token. - public async Task SaveManyAsync(IEnumerable records, CancellationToken cancellationToken = default) - { - var recordsList = records.ToList(); - - if (!recordsList.Any()) - return; - - var query = new ParameterizedQuery(dbConnectionProvider.Dialect); - var currentIndex = 0; - - foreach (var record in recordsList) - { - var index = currentIndex; - SetTenantId(record); - query.Upsert(TableName, PrimaryKey, record, field => $"{field}_{index}"); - currentIndex++; - } - - using var connection = dbConnectionProvider.GetConnection(); - await query.ExecuteAsync(connection); - } - - /// - /// Adds the specified record. - /// - /// The record. - /// The cancellation token. - public async Task AddAsync(T record, CancellationToken cancellationToken = default) - { - using var connection = dbConnectionProvider.GetConnection(); - SetTenantId(record); - var query = new ParameterizedQuery(dbConnectionProvider.Dialect).Insert(TableName, record); - await query.ExecuteAsync(connection); - } - - /// - /// Adds the specified records. - /// - /// The records. - /// The cancellation token. - public async Task AddManyAsync(IEnumerable records, CancellationToken cancellationToken = default) - { - var recordsList = records.ToList(); - - if (!recordsList.Any()) - return; - - var query = new ParameterizedQuery(dbConnectionProvider.Dialect); - var currentIndex = 0; - - foreach (var record in recordsList) - { - var index = currentIndex; - SetTenantId(record); - query.Insert(TableName, record, field => $"{field}_{index}"); - currentIndex++; - } - - using var connection = dbConnectionProvider.GetConnection(); - await query.ExecuteAsync(connection); - } - - /// - /// Updates the specified record. - /// - /// The record. - /// The cancellation token. - public async Task UpdateAsync(T record, CancellationToken cancellationToken = default) - { - using var connection = dbConnectionProvider.GetConnection(); - SetTenantId(record); - var query = new ParameterizedQuery(dbConnectionProvider.Dialect).Update(TableName, record, PrimaryKey); - await query.ExecuteAsync(connection); - } - - public async Task UpdateAsync(T record, Expression>[] props, CancellationToken cancellationToken = default) - { - using var connection = dbConnectionProvider.GetConnection(); - SetTenantId(record); - var fields = props.Select(x => x.GetPropertyName()).ToArray(); - var query = new ParameterizedQuery(dbConnectionProvider.Dialect).Update(TableName, record, PrimaryKey, fields); - await query.ExecuteAsync(connection); - } - - /// - /// Deletes all records matching the specified query. - /// - /// The conditions to apply to the query. - /// The cancellation token. - /// The number of records deleted. - public async Task DeleteAsync(Action filter, CancellationToken cancellationToken = default) - { - var query = dbConnectionProvider.CreateQuery().Delete(TableName); - filter(query); - - // If there are no conditions, we don't want to delete all records. - if (!query.Parameters.ParameterNames.Any()) - return 0; - - ApplyTenantFilter(query); - - using var connection = dbConnectionProvider.GetConnection(); - return await query.ExecuteAsync(connection); - } - - /// - /// Deletes all records matching the specified query. - /// - /// The conditions to apply to the query. - /// The page arguments. - /// The fields by which to order the results. - /// The primary key. - /// The cancellation token. - /// The number of records deleted. - public async Task DeleteAsync(Action filter, PageArgs pageArgs, IEnumerable orderFields, string primaryKey = "Id", CancellationToken cancellationToken = default) - { - var selectQuery = dbConnectionProvider.CreateQuery().From(TableName, primaryKey); - filter(selectQuery); - - // If there are no conditions, we don't want to delete all records. - if (!selectQuery.Parameters.ParameterNames.Any()) - return 0; - - ApplyTenantFilter(selectQuery, false); - selectQuery = selectQuery.OrderBy(orderFields.ToArray()).Page(pageArgs); - - var deleteQuery = dbConnectionProvider.CreateQuery().Delete(TableName, primaryKey, selectQuery); - using var connection = dbConnectionProvider.GetConnection(); - return await deleteQuery.ExecuteAsync(connection); - } - - /// - /// Returns true if any records match the specified query. - /// - /// The conditions to apply to the query. - /// The cancellation token. - /// true if any records match the specified query. - public async Task AnyAsync(Action filter, CancellationToken cancellationToken = default) - { - var query = dbConnectionProvider.CreateQuery().From(TableName, PrimaryKey); - ApplyTenantFilter(query, false); - filter(query); - using var connection = dbConnectionProvider.GetConnection(); - return await connection.QueryFirstOrDefaultAsync(query.Sql.ToString(), query.Parameters) != null; - } - - /// - /// Returns the number of records matching the specified query. - /// - /// The conditions to apply to the query. - /// The cancellation token. - /// The number of records matching the specified query. - public async Task CountAsync(Action filter, CancellationToken cancellationToken = default) - { - var countQuery = dbConnectionProvider.CreateQuery().Count(TableName); - ApplyTenantFilter(countQuery, false); - filter(countQuery); - using var connection = dbConnectionProvider.GetConnection(); - return await countQuery.SingleAsync(connection); - } - - private void ApplyTenantFilter(ParameterizedQuery query, bool tenantAgnostic = false) - { - if (tenantAgnostic) - return; - - var tenant = tenantAccessor.Tenant; - var tenantId = tenant?.Id; - query.Is(nameof(Record.TenantId), (object?)tenantId ?? DBNull.Value); - } - - private void SetTenantId(T record) - { - if (record is not Record recordWithTenant) - return; - - var tenant = tenantAccessor.Tenant; - var tenantId = tenant?.Id; - recordWithTenant.TenantId = tenantId; - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Dapper/TypeHandlers/Sqlite/DateTimeOffsetHandler.cs b/src/modules/Elsa.Dapper/TypeHandlers/Sqlite/DateTimeOffsetHandler.cs deleted file mode 100644 index 19a06395cf..0000000000 --- a/src/modules/Elsa.Dapper/TypeHandlers/Sqlite/DateTimeOffsetHandler.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace Elsa.Dapper.TypeHandlers.Sqlite; - -/// -/// Represents a SQLite type handler for . -/// -internal class DateTimeOffsetHandler : SqliteTypeHandler -{ - public override DateTimeOffset Parse(object value) => DateTimeOffset.Parse((string)value); -} \ No newline at end of file diff --git a/src/modules/Elsa.Dapper/TypeHandlers/Sqlite/GuidHandler.cs b/src/modules/Elsa.Dapper/TypeHandlers/Sqlite/GuidHandler.cs deleted file mode 100644 index c1fe5afcfa..0000000000 --- a/src/modules/Elsa.Dapper/TypeHandlers/Sqlite/GuidHandler.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace Elsa.Dapper.TypeHandlers.Sqlite; - -/// -/// Represents a SQLite type handler for . -/// -internal class GuidHandler : SqliteTypeHandler -{ - public override Guid Parse(object value) => Guid.Parse((string)value); -} \ No newline at end of file diff --git a/src/modules/Elsa.Dapper/TypeHandlers/Sqlite/SqliteTypeHandler.cs b/src/modules/Elsa.Dapper/TypeHandlers/Sqlite/SqliteTypeHandler.cs deleted file mode 100644 index ee45fb4d29..0000000000 --- a/src/modules/Elsa.Dapper/TypeHandlers/Sqlite/SqliteTypeHandler.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System.Data; -using Dapper; - -namespace Elsa.Dapper.TypeHandlers.Sqlite; - -/// -/// Represents a SQLite type handler. -/// -/// The type of the value. -internal abstract class SqliteTypeHandler : SqlMapper.TypeHandler -{ - // Parameters are converted by Microsoft.Data.Sqlite - public override void SetValue(IDbDataParameter parameter, T value) => parameter.Value = value; -} \ No newline at end of file diff --git a/src/modules/Elsa.Dapper/TypeHandlers/Sqlite/TimeSpanHandler.cs b/src/modules/Elsa.Dapper/TypeHandlers/Sqlite/TimeSpanHandler.cs deleted file mode 100644 index d03f3f6d03..0000000000 --- a/src/modules/Elsa.Dapper/TypeHandlers/Sqlite/TimeSpanHandler.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace Elsa.Dapper.TypeHandlers.Sqlite; - -/// -/// Represents a SQLite type handler for . -/// -internal class TimeSpanHandler : SqliteTypeHandler -{ - public override TimeSpan Parse(object value) => TimeSpan.Parse((string)value); -} \ No newline at end of file diff --git a/src/modules/Elsa.Dsl/FodyWeavers.xml b/src/modules/Elsa.Dsl/FodyWeavers.xml deleted file mode 100644 index 00e1d9a1c1..0000000000 --- a/src/modules/Elsa.Dsl/FodyWeavers.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/src/modules/Elsa.Elasticsearch/Common/ElasticStore.cs b/src/modules/Elsa.Elasticsearch/Common/ElasticStore.cs deleted file mode 100644 index 45cffee020..0000000000 --- a/src/modules/Elsa.Elasticsearch/Common/ElasticStore.cs +++ /dev/null @@ -1,127 +0,0 @@ -using Elastic.Clients.Elasticsearch; -using Elsa.Common.Models; -using JetBrains.Annotations; -using Microsoft.Extensions.Logging; -using Exception = System.Exception; - -namespace Elsa.Elasticsearch.Common; - -/// -/// A thin wrapper around for easy re-usability. -/// -/// The document type. -[PublicAPI] -public class ElasticStore where T : class -{ - private readonly ElasticsearchClient _elasticClient; - private readonly ILogger _logger; - - /// - /// Constructor. - /// - public ElasticStore(ElasticsearchClient elasticClient, ILogger> logger) - { - _elasticClient = elasticClient; - _logger = logger; - } - - /// - /// Searches the index using the specified search descriptor. - /// - public async Task> SearchAsync(Action> search, CancellationToken cancellationToken = default) - { - var page = PageArgs.FromPage(0, 1000); - var collectedItems = new List(); - - while(true) - { - var result = await SearchAsync(search, page, cancellationToken); - - collectedItems.AddRange(result.Items); - - if (result.Items.Count < page.PageSize) - break; - - page = page.Next(); - } - - return collectedItems; - } - - /// - /// Searches the index using the specified search descriptor. - /// - public async Task> SearchAsync(Action> search, PageArgs pageArgs, CancellationToken cancellationToken = default) - { - search += s => s.From(pageArgs.Offset); - search += s => s.Size(pageArgs.Limit); - - var response = await _elasticClient.SearchAsync(search, cancellationToken); - - if (!response.IsSuccess()) - throw new Exception(response.DebugInformation); - - return new Page(response.Hits.Select(hit => hit.Source).ToList()!, response.Total); - } - - /// - /// Counts the number of documents matching the given search descriptor. - /// - public async Task CountAsync(Action> countRequest, CancellationToken cancellationToken = default) - { - var response = await _elasticClient.CountAsync(countRequest, cancellationToken); - - if (!response.IsSuccess()) - throw new Exception($"Failed to get count from Elasticsearch: {response.DebugInformation}"); - - return response.Count; - } - - /// - /// Stores the specified document in the index. - /// - public async Task SaveAsync(T document, CancellationToken cancellationToken) - { - var response = await _elasticClient.IndexAsync(document, cancellationToken); - - if (!response.IsSuccess()) - throw new Exception($"Failed to save data in Elasticsearch: {response.ElasticsearchServerError}"); - } - - /// - /// Stores the specified documents in the index. - /// - public async Task SaveManyAsync(IEnumerable documents, CancellationToken cancellationToken) - { - var response = await _elasticClient.IndexManyAsync(documents, cancellationToken); - - if (!response.IsSuccess()) - throw new Exception($"Failed to save data in Elasticsearch: {response.ElasticsearchServerError}"); - } - - /// - /// Deletes the specified set of documents from the index. - /// - public async Task DeleteManyAsync(IEnumerable documents, CancellationToken cancellationToken) - { - var response = await _elasticClient.BulkAsync(b => b.DeleteMany(documents), cancellationToken); - - if (!response.IsSuccess()) - throw new Exception(response.DebugInformation); - - return response.Items.Count(i => i.IsValid); - } - - /// - /// Deletes the documents matching the specified query. - /// - public async Task DeleteByQueryAsync(Action> query, CancellationToken cancellationToken) - { - var response = await _elasticClient.DeleteByQueryAsync(Indices.All, query, cancellationToken); - - if (!response.IsSuccess()) - throw new Exception(response.DebugInformation); - - return response.Deleted ?? 0; - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Elasticsearch/Common/IndexConfiguration.cs b/src/modules/Elsa.Elasticsearch/Common/IndexConfiguration.cs deleted file mode 100644 index 63dd17d947..0000000000 --- a/src/modules/Elsa.Elasticsearch/Common/IndexConfiguration.cs +++ /dev/null @@ -1,23 +0,0 @@ -using Elastic.Clients.Elasticsearch; -using Elsa.Elasticsearch.Contracts; -using Elsa.Elasticsearch.Strategies; - -namespace Elsa.Elasticsearch.Common; - -/// -/// A convenience base class for document type configurations. -/// -public abstract class IndexConfiguration : IIndexConfiguration -{ - /// - public Type DocumentType => typeof(T); - - /// - public virtual IIndexNamingStrategy IndexNamingStrategy => new DefaultNaming(); - - /// - public abstract void ConfigureClientSettings(ElasticsearchClientSettings settings); - - /// - public virtual ValueTask ConfigureClientAsync(ElasticsearchClient client, CancellationToken cancellationToken) => ValueTask.CompletedTask; -} \ No newline at end of file diff --git a/src/modules/Elsa.Elasticsearch/Common/PersistenceFeatureBase.cs b/src/modules/Elsa.Elasticsearch/Common/PersistenceFeatureBase.cs deleted file mode 100644 index 5c99abdad9..0000000000 --- a/src/modules/Elsa.Elasticsearch/Common/PersistenceFeatureBase.cs +++ /dev/null @@ -1,34 +0,0 @@ -using Elsa.Elasticsearch.Contracts; -using Elsa.Features.Abstractions; -using Elsa.Features.Services; -using Microsoft.Extensions.DependencyInjection; - -namespace Elsa.Elasticsearch.Common; - -/// -/// Base class for features that configure Elasticsearch persistence. -/// -public abstract class ElasticPersistenceFeatureBase : FeatureBase -{ - /// - protected ElasticPersistenceFeatureBase(IModule module) : base(module) - { - } - - /// - /// Registers an . - /// - /// The entity type of the store. - /// The type of the store. - protected void AddStore() where TModel : class where TStore : class - { - Services - .AddScoped>() - .AddScoped(); - } - - /// - /// Registers an . - /// - protected void AddIndexConfiguration(Func> configuration) => Services.AddScoped(configuration); -} \ No newline at end of file diff --git a/src/modules/Elsa.Elasticsearch/Contracts/IIndexConfiguration.cs b/src/modules/Elsa.Elasticsearch/Contracts/IIndexConfiguration.cs deleted file mode 100644 index 02ca615a24..0000000000 --- a/src/modules/Elsa.Elasticsearch/Contracts/IIndexConfiguration.cs +++ /dev/null @@ -1,39 +0,0 @@ -using Elastic.Clients.Elasticsearch; - -namespace Elsa.Elasticsearch.Contracts; - -/// -/// Implement this interface to get a chance to configure some aspect of Elasticsearch, such as index mappings. -/// -public interface IIndexConfiguration -{ - /// - /// The document type to configure. - /// - Type DocumentType { get; } - - /// - /// The index naming strategy to use for rollovers. - /// - IIndexNamingStrategy IndexNamingStrategy { get; } - - /// - /// Invoked by the system to configure . - /// - /// The settings to configure. - void ConfigureClientSettings(ElasticsearchClientSettings settings); - - /// - /// Invoked by the system to configure the . - /// - /// The to configure. - /// A cancellation token. - ValueTask ConfigureClientAsync(ElasticsearchClient client, CancellationToken cancellationToken); -} - -/// -/// Implement this interface to get a chance to configure some aspect of Elasticsearch, such as index mappings. -/// -public interface IIndexConfiguration : IIndexConfiguration -{ -} \ No newline at end of file diff --git a/src/modules/Elsa.Elasticsearch/Contracts/IIndexNamingStrategy.cs b/src/modules/Elsa.Elasticsearch/Contracts/IIndexNamingStrategy.cs deleted file mode 100644 index d0aabec7f1..0000000000 --- a/src/modules/Elsa.Elasticsearch/Contracts/IIndexNamingStrategy.cs +++ /dev/null @@ -1,12 +0,0 @@ -namespace Elsa.Elasticsearch.Contracts; - -/// -/// Represents a naming strategy to use when creating an index name from an alias. -/// -public interface IIndexNamingStrategy -{ - /// - /// Returns an index name from the specified alias. - /// - string GenerateName(string aliasName); -} \ No newline at end of file diff --git a/src/modules/Elsa.Elasticsearch/Elsa.Elasticsearch.csproj b/src/modules/Elsa.Elasticsearch/Elsa.Elasticsearch.csproj deleted file mode 100644 index 0759c2275b..0000000000 --- a/src/modules/Elsa.Elasticsearch/Elsa.Elasticsearch.csproj +++ /dev/null @@ -1,19 +0,0 @@ - - - - - Provides Elasticsearch implementation for workflow state persistence. - - elsa module elasticsearch - - - - - - - - - - - - diff --git a/src/modules/Elsa.Elasticsearch/Extensions/ElasticExtensions.cs b/src/modules/Elsa.Elasticsearch/Extensions/ElasticExtensions.cs deleted file mode 100644 index 1dc8595f59..0000000000 --- a/src/modules/Elsa.Elasticsearch/Extensions/ElasticExtensions.cs +++ /dev/null @@ -1,18 +0,0 @@ -using Elastic.Clients.Elasticsearch; -using Elastic.Transport; -using Elsa.Elasticsearch.Options; - -namespace Elsa.Elasticsearch.Extensions; - -internal static class ElasticExtensions -{ - public static ElasticsearchClientSettings ConfigureAuthentication(this ElasticsearchClientSettings settings, ElasticsearchOptions options) - { - if (!string.IsNullOrEmpty(options.ApiKey)) - settings.Authentication(new ApiKey(options.ApiKey)); - else if (!string.IsNullOrEmpty(options.Username) && !string.IsNullOrEmpty(options.Password)) - settings.Authentication(new BasicAuthentication(options.Username, options.Password)); - - return settings; - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Elasticsearch/Extensions/ModuleExtensions.cs b/src/modules/Elsa.Elasticsearch/Extensions/ModuleExtensions.cs deleted file mode 100644 index 15718ee904..0000000000 --- a/src/modules/Elsa.Elasticsearch/Extensions/ModuleExtensions.cs +++ /dev/null @@ -1,26 +0,0 @@ -using Elsa.Elasticsearch.Features; -using Elsa.Elasticsearch.Options; -using Elsa.Features.Services; -using JetBrains.Annotations; - -namespace Elsa.Elasticsearch.Extensions; - -/// -/// Extends to configure the feature. -/// -[PublicAPI] -public static class ModuleExtensions -{ - /// - /// Enables the feature. - /// - public static IModule UseElasticsearch( - this IModule module, - Action options, - Action? configure = default) - { - configure += f => f.Options += options; - module.Configure(configure); - return module; - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Elasticsearch/Features/ElasticsearchFeature.cs b/src/modules/Elsa.Elasticsearch/Features/ElasticsearchFeature.cs deleted file mode 100644 index 9c8ed0a7b9..0000000000 --- a/src/modules/Elsa.Elasticsearch/Features/ElasticsearchFeature.cs +++ /dev/null @@ -1,48 +0,0 @@ -using Elastic.Clients.Elasticsearch; -using Elsa.Elasticsearch.Contracts; -using Elsa.Elasticsearch.Extensions; -using Elsa.Elasticsearch.Options; -using Elsa.Features.Abstractions; -using Elsa.Features.Services; -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Options; - -namespace Elsa.Elasticsearch.Features; - -/// -/// Configures Elasticsearch. -/// -public class ElasticsearchFeature : FeatureBase -{ - /// - public ElasticsearchFeature(IModule module) : base(module) - { - } - - /// - /// A delegate that configures Elasticsearch. - /// - public Action Options { get; set; } = _ => { }; - - /// - public override void Apply() - { - Services.Configure(Options); - Services.AddScoped(sp => new ElasticsearchClient(GetSettings(sp))); - } - - private static ElasticsearchClientSettings GetSettings(IServiceProvider serviceProvider) - { - var options = serviceProvider.GetRequiredService>().Value; - var configuration = serviceProvider.GetRequiredService(); - var configs = serviceProvider.GetServices(); - var url = configuration.GetConnectionString(options.Endpoint) ?? options.Endpoint; - var settings = new ElasticsearchClientSettings(new Uri(url)).ConfigureAuthentication(options); - - foreach (var config in configs) - config.ConfigureClientSettings(settings); - - return settings; - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Elasticsearch/FodyWeavers.xml b/src/modules/Elsa.Elasticsearch/FodyWeavers.xml deleted file mode 100644 index 00e1d9a1c1..0000000000 --- a/src/modules/Elsa.Elasticsearch/FodyWeavers.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/src/modules/Elsa.Elasticsearch/Modules/Management/ElasticWorkflowInstanceFeature.cs b/src/modules/Elsa.Elasticsearch/Modules/Management/ElasticWorkflowInstanceFeature.cs deleted file mode 100644 index 3c7294a175..0000000000 --- a/src/modules/Elsa.Elasticsearch/Modules/Management/ElasticWorkflowInstanceFeature.cs +++ /dev/null @@ -1,46 +0,0 @@ -using Elsa.Elasticsearch.Common; -using Elsa.Elasticsearch.Contracts; -using Elsa.Elasticsearch.Features; -using Elsa.Features.Attributes; -using Elsa.Features.Services; -using Elsa.Workflows.Management.Entities; -using Elsa.Workflows.Management.Features; -using Microsoft.Extensions.DependencyInjection; - -namespace Elsa.Elasticsearch.Modules.Management; - -/// -/// Configures the feature with Elasticsearch. -/// -[DependsOn(typeof(WorkflowManagementFeature))] -[DependsOn(typeof(ElasticsearchFeature))] -public class ElasticWorkflowInstanceFeature : ElasticPersistenceFeatureBase -{ - /// - public ElasticWorkflowInstanceFeature(IModule module) : base(module) - { - } - - /// - /// A delegate that creates an instance of a concrete implementation if for . - /// - public Func> IndexConfiguration { get; set; } = sp => ActivatorUtilities.CreateInstance(sp); - - /// - public override void Configure() - { - Module.Configure(feature => - { - feature.WorkflowInstanceStore = sp => sp.GetRequiredService(); - }); - } - - /// - public override void Apply() - { - base.Apply(); - - AddStore(); - AddIndexConfiguration(IndexConfiguration); - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Elasticsearch/Modules/Management/Extensions.cs b/src/modules/Elsa.Elasticsearch/Modules/Management/Extensions.cs deleted file mode 100644 index 93e1d58a36..0000000000 --- a/src/modules/Elsa.Elasticsearch/Modules/Management/Extensions.cs +++ /dev/null @@ -1,20 +0,0 @@ -using Elsa.Workflows.Management.Features; -using JetBrains.Annotations; - -namespace Elsa.Elasticsearch.Modules.Management; - -/// -/// Extends the feature. -/// -[PublicAPI] -public static class Extensions -{ - /// - /// Configures the to use the . - /// - public static WorkflowInstancesFeature UseElasticsearch(this WorkflowInstancesFeature feature, Action? configure = default) - { - feature.Module.Configure(configure); - return feature; - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Elasticsearch/Modules/Management/WorkflowInstanceConfiguration.cs b/src/modules/Elsa.Elasticsearch/Modules/Management/WorkflowInstanceConfiguration.cs deleted file mode 100644 index 0891cfca28..0000000000 --- a/src/modules/Elsa.Elasticsearch/Modules/Management/WorkflowInstanceConfiguration.cs +++ /dev/null @@ -1,40 +0,0 @@ -using Elastic.Clients.Elasticsearch; -using Elastic.Clients.Elasticsearch.IndexManagement; -using Elsa.Elasticsearch.Common; -using Elsa.Elasticsearch.Options; -using Elsa.Workflows.Management.Entities; -using Microsoft.Extensions.Options; - -namespace Elsa.Elasticsearch.Modules.Management; - -/// -/// Configures Elasticsearch with mappings for . -/// -public class WorkflowInstanceConfiguration : IndexConfiguration -{ - private readonly ElasticsearchOptions _options; - - /// - public WorkflowInstanceConfiguration(IOptions options) - { - _options = options.Value; - } - - /// - public override void ConfigureClientSettings(ElasticsearchClientSettings settings) - { - var alias = _options.GetIndexNameFor(); - var indexName = IndexNamingStrategy.GenerateName(alias); - settings.DefaultMappingFor(m => m.IndexName(indexName)); - } - - /// - public override async ValueTask ConfigureClientAsync(ElasticsearchClient client, CancellationToken cancellationToken) - { - var alias = _options.GetIndexNameFor(); - var indexName = IndexNamingStrategy.GenerateName(alias); - var descriptor = new CreateIndexRequestDescriptor(indexName); - descriptor.Mappings(m => m.Properties(p => p.Flattened(d => d.WorkflowState.Properties))); - await client.Indices.CreateAsync(descriptor, cancellationToken); - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Elasticsearch/Modules/Management/WorkflowInstanceStore.cs b/src/modules/Elsa.Elasticsearch/Modules/Management/WorkflowInstanceStore.cs deleted file mode 100644 index e5f345edc9..0000000000 --- a/src/modules/Elsa.Elasticsearch/Modules/Management/WorkflowInstanceStore.cs +++ /dev/null @@ -1,227 +0,0 @@ -using Elastic.Clients.Elasticsearch; -using Elastic.Clients.Elasticsearch.QueryDsl; -using Elsa.Common.Entities; -using Elsa.Common.Models; -using Elsa.Elasticsearch.Common; -using Elsa.Extensions; -using Elsa.Workflows.Management; -using Elsa.Workflows.Management.Entities; -using Elsa.Workflows.Management.Filters; -using Elsa.Workflows.Management.Models; -using Humanizer; - -namespace Elsa.Elasticsearch.Modules.Management; - -/// -/// Stores and retrieves workflow instances from Elasticsearch. -/// -public class ElasticWorkflowInstanceStore : IWorkflowInstanceStore -{ - private readonly ElasticStore _store; - - /// - /// Constructor. - /// - public ElasticWorkflowInstanceStore(ElasticStore store) - { - _store = store; - } - - /// - public async ValueTask FindAsync(WorkflowInstanceFilter filter, CancellationToken cancellationToken = default) - { - var result = await _store.SearchAsync(d => Filter(d, filter), PageArgs.FromRange(0, 1), cancellationToken); - return result.Items.FirstOrDefault(); - } - - /// - public async ValueTask> FindManyAsync(WorkflowInstanceFilter filter, PageArgs pageArgs, CancellationToken cancellationToken = default) - { - return await _store.SearchAsync(d => Filter(d, filter), pageArgs, cancellationToken); - } - - /// - public async ValueTask> FindManyAsync(WorkflowInstanceFilter filter, PageArgs pageArgs, WorkflowInstanceOrder order, CancellationToken cancellationToken = default) - { - return await _store.SearchAsync(d => Sort(Filter(d, filter), order), pageArgs, cancellationToken); - } - - /// - public async ValueTask> FindManyAsync(WorkflowInstanceFilter filter, CancellationToken cancellationToken = default) - { - return await _store.SearchAsync(d => Filter(d, filter), cancellationToken); - } - - /// - public async ValueTask> FindManyAsync(WorkflowInstanceFilter filter, WorkflowInstanceOrder order, CancellationToken cancellationToken = default) - { - return await _store.SearchAsync(d => Sort(Filter(d, filter), order), cancellationToken); - } - - /// - public async ValueTask CountAsync(WorkflowInstanceFilter filter, CancellationToken cancellationToken = default) - { - return await _store.CountAsync(d => Filter(d, filter), cancellationToken); - } - - /// - public async ValueTask> SummarizeManyAsync(WorkflowInstanceFilter filter, PageArgs pageArgs, CancellationToken cancellationToken = default) - { - var results = await _store.SearchAsync(d => Summarize(Filter(d, filter)), pageArgs, cancellationToken); - var summaries = results.Items.Select(WorkflowInstanceSummary.FromInstance).ToList(); - return new(summaries, results.TotalCount); - } - - /// - public async ValueTask> SummarizeManyAsync(WorkflowInstanceFilter filter, PageArgs pageArgs, WorkflowInstanceOrder order, CancellationToken cancellationToken = default) - { - var results = await _store.SearchAsync(d => Summarize(Sort(Filter(d, filter), order)), pageArgs, cancellationToken); - var summaries = results.Items.Select(WorkflowInstanceSummary.FromInstance).ToList(); - return new(summaries, results.TotalCount); - } - - /// - public async ValueTask> FindManyIdsAsync(WorkflowInstanceFilter filter, CancellationToken cancellationToken = default) - { - var results = await _store.SearchAsync(d => SelectId(Filter(d, filter)), cancellationToken); - return results.Select(x => x.Id).ToList(); - } - - /// - public async ValueTask> FindManyIdsAsync(WorkflowInstanceFilter filter, PageArgs pageArgs, CancellationToken cancellationToken = default) - { - var results = await _store.SearchAsync(d => SelectId(Filter(d, filter)), pageArgs, cancellationToken); - return new(results.Items.Select(x => x.Id).ToList(), results.TotalCount); - } - - /// - public async ValueTask> FindManyIdsAsync(WorkflowInstanceFilter filter, PageArgs pageArgs, WorkflowInstanceOrder order, CancellationToken cancellationToken = default) - { - var results = await _store.SearchAsync(d => SelectId(Sort(Filter(d, filter), order)), pageArgs, cancellationToken); - return new(results.Items.Select(x => x.Id).ToList(), results.TotalCount); - } - - /// - public async ValueTask> SummarizeManyAsync(WorkflowInstanceFilter filter, CancellationToken cancellationToken = default) - { - var results = await _store.SearchAsync(d => Summarize(Filter(d, filter)), cancellationToken); - return results.Select(WorkflowInstanceSummary.FromInstance).ToList(); - } - - /// - public async ValueTask> SummarizeManyAsync(WorkflowInstanceFilter filter, WorkflowInstanceOrder order, CancellationToken cancellationToken = default) - { - var results = await _store.SearchAsync(d => Summarize(Sort(Filter(d, filter), order)), cancellationToken); - return results.Select(WorkflowInstanceSummary.FromInstance).ToList(); - } - - /// - public async ValueTask SaveAsync(WorkflowInstance instance, CancellationToken cancellationToken = default) - { - await _store.SaveAsync(instance, cancellationToken); - } - - /// - public async ValueTask AddAsync(WorkflowInstance instance, CancellationToken cancellationToken = default) - { - await _store.SaveAsync(instance, cancellationToken); - } - - public async ValueTask UpdateAsync(WorkflowInstance instance, CancellationToken cancellationToken = default) - { - await _store.SaveAsync(instance, cancellationToken); - } - - /// - public async ValueTask SaveManyAsync(IEnumerable instances, CancellationToken cancellationToken = default) - { - await _store.SaveManyAsync(instances, cancellationToken); - } - - /// - public async ValueTask DeleteAsync(WorkflowInstanceFilter filter, CancellationToken cancellationToken = default) - { - return await _store.DeleteByQueryAsync(d => Filter(d, filter), cancellationToken); - } - - public Task UpdateUpdatedTimestampAsync(string workflowInstanceId, DateTimeOffset value, CancellationToken cancellationToken = default) - { - throw new NotImplementedException(); - } - - private static SearchRequestDescriptor Sort(SearchRequestDescriptor descriptor, WorkflowInstanceOrder order) - { - var sortDescriptor = new SortOptionsDescriptor(); - var propName = order.KeySelector.GetPropertyName().Camelize(); - var sortOrder = order.Direction == OrderDirection.Ascending ? SortOrder.Asc : SortOrder.Desc; - sortDescriptor.Field(propName, f => f.Order(sortOrder)); - - descriptor.Sort(sortDescriptor); - return descriptor; - } - - private static SearchRequestDescriptor Filter(SearchRequestDescriptor descriptor, WorkflowInstanceFilter filter) - { - return descriptor.Query(query => Filter(query, filter)); - } - - private static CountRequestDescriptor Filter(CountRequestDescriptor descriptor, WorkflowInstanceFilter filter) - { - return descriptor.Query(query => Filter(query, filter)); - } - - private static DeleteByQueryRequestDescriptor Filter(DeleteByQueryRequestDescriptor descriptor, WorkflowInstanceFilter filter) - { - return descriptor.Query(query => Filter(query, filter)); - } - - private static QueryDescriptor Filter(QueryDescriptor descriptor, WorkflowInstanceFilter filter) - { - if (!string.IsNullOrWhiteSpace(filter.Id)) descriptor = descriptor.Match(m => m.Field(f => f.Id).Query(filter.Id)); - if (!string.IsNullOrWhiteSpace(filter.DefinitionId)) descriptor = descriptor.Match(m => m.Field(f => f.DefinitionId).Query(filter.DefinitionId)); - if (!string.IsNullOrWhiteSpace(filter.DefinitionVersionId)) descriptor = descriptor.Match(m => m.Field(f => f.DefinitionVersionId).Query(filter.DefinitionVersionId)); - - // TODO: filter by IDs - // TODO: filter by DefinitionIDs - // TODO: filter by DefinitionVersionIDs - // TODO: filter by ParentWorkflowInstanceIds - // TODO: filter by CorrelationIDs - // TODO: filter by WorkflowStatuses - // TODO: filter by WorkflowSubStatuses - - if (filter.Version != null) descriptor = descriptor.Match(m => m.Field(f => f.Version).Query(filter.Version.ToString()!)); - if (!string.IsNullOrWhiteSpace(filter.CorrelationId)) descriptor = descriptor.Match(m => m.Field(f => f.CorrelationId).Query(filter.CorrelationId)); - if (filter.WorkflowStatus != null) descriptor = descriptor.Match(m => m.Field(f => f.Status).Query(filter.WorkflowStatus.ToString()!)); - if (filter.WorkflowSubStatus != null) descriptor = descriptor.Match(m => m.Field(f => f.SubStatus).Query(filter.WorkflowSubStatus.ToString()!)); - - if (string.IsNullOrWhiteSpace(filter.SearchTerm)) - return descriptor.MatchAll(new MatchAllQuery()); - - return descriptor - .QueryString(c => c - .Query(filter.SearchTerm)); - } - - private static SearchRequestDescriptor Summarize(SearchRequestDescriptor descriptor) - { - return descriptor.Fields( - field => field.Field(f => f.Id), - field => field.Field(f => f.DefinitionId), - field => field.Field(f => f.Status), - field => field.Field(f => f.SubStatus), - field => field.Field(f => f.Version), - field => field.Field(f => f.CorrelationId), - field => field.Field(f => f.Version), - field => field.Field(f => f.Name), - field => field.Field(f => f.CreatedAt), - field => field.Field(f => f.FinishedAt), - field => field.Field(f => f.DefinitionVersionId), - field => field.Field(f => f.UpdatedAt) - ); - } - - private static SearchRequestDescriptor SelectId(SearchRequestDescriptor descriptor) - { - return descriptor.Fields(field => field.Field(f => f.Id)); - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Elasticsearch/Modules/Runtime/ElasticExecutionLogRecordFeature.cs b/src/modules/Elsa.Elasticsearch/Modules/Runtime/ElasticExecutionLogRecordFeature.cs deleted file mode 100644 index 2ad2d6bb0f..0000000000 --- a/src/modules/Elsa.Elasticsearch/Modules/Runtime/ElasticExecutionLogRecordFeature.cs +++ /dev/null @@ -1,46 +0,0 @@ -using Elsa.Features.Attributes; -using Elsa.Features.Services; -using Elsa.Workflows.Runtime.Entities; -using Elsa.Workflows.Runtime.Features; -using Elsa.Elasticsearch.Common; -using Elsa.Elasticsearch.Contracts; -using Elsa.Elasticsearch.Features; -using Microsoft.Extensions.DependencyInjection; - -namespace Elsa.Elasticsearch.Modules.Runtime; - -/// -/// Configures the feature with Elasticsearch persistence. -/// -[DependsOn(typeof(WorkflowRuntimeFeature))] -[DependsOn(typeof(ElasticsearchFeature))] -public class ElasticExecutionLogRecordFeature : ElasticPersistenceFeatureBase -{ - /// - public ElasticExecutionLogRecordFeature(IModule module) : base(module) - { - } - - /// - /// A delegate that creates an instance of a concrete implementation if for . - /// - public Func> IndexConfiguration { get; set; } = sp => ActivatorUtilities.CreateInstance(sp); - - /// - public override void Configure() - { - Module.Configure(feature => - { - feature.WorkflowExecutionLogStore = sp => sp.GetRequiredService(); - }); - } - - /// - public override void Apply() - { - base.Apply(); - - AddStore(); - AddIndexConfiguration(IndexConfiguration); - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Elasticsearch/Modules/Runtime/ExecutionLogConfiguration.cs b/src/modules/Elsa.Elasticsearch/Modules/Runtime/ExecutionLogConfiguration.cs deleted file mode 100644 index f3e8dcc570..0000000000 --- a/src/modules/Elsa.Elasticsearch/Modules/Runtime/ExecutionLogConfiguration.cs +++ /dev/null @@ -1,23 +0,0 @@ -using Elastic.Clients.Elasticsearch; -using Elsa.Elasticsearch.Common; -using Elsa.Elasticsearch.Options; -using Elsa.Workflows.Runtime.Entities; -using Microsoft.Extensions.Options; - -namespace Elsa.Elasticsearch.Modules.Runtime; - -/// -/// Configures Elasticsearch with mappings for . -/// -public class ExecutionLogConfiguration : IndexConfiguration -{ - private readonly ElasticsearchOptions _options; - - /// - public ExecutionLogConfiguration(IOptions options) => _options = options.Value; - - /// - public override void ConfigureClientSettings(ElasticsearchClientSettings settings) => - settings.DefaultMappingFor(m => m - .IndexName(_options.GetIndexNameFor())); -} \ No newline at end of file diff --git a/src/modules/Elsa.Elasticsearch/Modules/Runtime/Extensions.cs b/src/modules/Elsa.Elasticsearch/Modules/Runtime/Extensions.cs deleted file mode 100644 index 2c92e7f57a..0000000000 --- a/src/modules/Elsa.Elasticsearch/Modules/Runtime/Extensions.cs +++ /dev/null @@ -1,18 +0,0 @@ -using Elsa.Workflows.Runtime.Features; - -namespace Elsa.Elasticsearch.Modules.Runtime; - -/// -/// Provides extensions to the feature. -/// -public static class Extensions -{ - /// - /// Configures the to use the . - /// - public static WorkflowRuntimeFeature UseElasticsearch(this WorkflowRuntimeFeature feature, Action? configure = default) - { - feature.Module.Configure(configure); - return feature; - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Elasticsearch/Modules/Runtime/WorkflowExecutionLogStore.cs b/src/modules/Elsa.Elasticsearch/Modules/Runtime/WorkflowExecutionLogStore.cs deleted file mode 100644 index 7addf88286..0000000000 --- a/src/modules/Elsa.Elasticsearch/Modules/Runtime/WorkflowExecutionLogStore.cs +++ /dev/null @@ -1,110 +0,0 @@ -using Elastic.Clients.Elasticsearch; -using Elastic.Clients.Elasticsearch.QueryDsl; -using Elsa.Common.Entities; -using Elsa.Common.Models; -using Elsa.Elasticsearch.Common; -using Elsa.Elasticsearch.Shared.Models; -using Elsa.Extensions; -using Elsa.Workflows.Runtime; -using Elsa.Workflows.Runtime.Entities; -using Elsa.Workflows.Runtime.Filters; -using Elsa.Workflows.Runtime.OrderDefinitions; -using JetBrains.Annotations; - -namespace Elsa.Elasticsearch.Modules.Runtime; - -/// -/// Store and retrieves objects from an Elasticsearch. -/// -[UsedImplicitly] -public class ElasticWorkflowExecutionLogStore(ElasticStore store) : IWorkflowExecutionLogStore -{ - /// - public async Task AddAsync(WorkflowExecutionLogRecord record, CancellationToken cancellationToken = default) - { - await store.SaveAsync(record, cancellationToken); - } - - /// - public async Task AddManyAsync(IEnumerable records, CancellationToken cancellationToken = default) - { - await store.SaveManyAsync(records, cancellationToken); - } - - /// - public async Task SaveAsync(WorkflowExecutionLogRecord record, CancellationToken cancellationToken = default) - { - await store.SaveAsync(record, cancellationToken); - } - - /// - public async Task SaveManyAsync(IEnumerable records, CancellationToken cancellationToken = default) - { - await store.SaveManyAsync(records, cancellationToken); - } - - /// - public async Task FindAsync(WorkflowExecutionLogRecordFilter filter, CancellationToken cancellationToken = default) - { - var result = await store.SearchAsync(d => Filter(d, filter), PageArgs.FromRange(0, 1), cancellationToken); - return result.Items.FirstOrDefault(); - } - - /// - public async Task FindAsync(WorkflowExecutionLogRecordFilter filter, WorkflowExecutionLogRecordOrder order, CancellationToken cancellationToken = default) - { - var result = await store.SearchAsync(d => Sort(Filter(d, filter), order), PageArgs.FromRange(0, 1), cancellationToken); - return result.Items.FirstOrDefault(); - } - - /// - public async Task> FindManyAsync(WorkflowExecutionLogRecordFilter filter, PageArgs pageArgs, CancellationToken cancellationToken = default) - { - return await store.SearchAsync(d => Filter(d, filter), pageArgs, cancellationToken); - } - - /// - public async Task> FindManyAsync(WorkflowExecutionLogRecordFilter filter, PageArgs pageArgs, WorkflowExecutionLogRecordOrder order, CancellationToken cancellationToken = default) - { - return await store.SearchAsync(d => Sort(Filter(d, filter), order), pageArgs, cancellationToken); - } - - /// - public async Task DeleteManyAsync(WorkflowExecutionLogRecordFilter filter, CancellationToken cancellationToken = default) - { - return await store.DeleteByQueryAsync(d => Filter(d, filter), cancellationToken); - } - - private static SearchRequestDescriptor Sort(SearchRequestDescriptor descriptor, WorkflowExecutionLogRecordOrder order) - { - var propName = order.KeySelector.GetProperty()!.Name; - var orderField = new OrderField(propName, order.Direction); - return Sort(descriptor, orderField); - } - - private static SearchRequestDescriptor Sort(SearchRequestDescriptor descriptor, params OrderField[] orderFields) - { - var sortDescriptor = new SortOptionsDescriptor(); - - foreach (var orderField in orderFields) - { - var sortOrder = orderField.Direction == OrderDirection.Ascending ? SortOrder.Asc : SortOrder.Desc; - sortDescriptor.Field(orderField.Field, f => f.Order(sortOrder)); - } - - descriptor.Sort(sortDescriptor); - return descriptor; - } - - private static SearchRequestDescriptor Filter(SearchRequestDescriptor descriptor, WorkflowExecutionLogRecordFilter filter) => descriptor.Query(query => Filter(query, filter)); - private static DeleteByQueryRequestDescriptor Filter(DeleteByQueryRequestDescriptor descriptor, WorkflowExecutionLogRecordFilter filter) => descriptor.Query(query => Filter(query, filter)); - - private static QueryDescriptor Filter(QueryDescriptor descriptor, WorkflowExecutionLogRecordFilter filter) - { - if (!string.IsNullOrWhiteSpace(filter.WorkflowInstanceId)) descriptor = descriptor.Match(m => m.Field(f => f.WorkflowInstanceId).Query(filter.WorkflowInstanceId)); - if (!string.IsNullOrWhiteSpace(filter.ActivityId)) descriptor = descriptor.Match(m => m.Field(f => f.ActivityId).Query(filter.ActivityId)); - if (!string.IsNullOrWhiteSpace(filter.EventName)) descriptor = descriptor.Match(m => m.Field(f => f.EventName).Query(filter.EventName)); - - return descriptor; - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Elasticsearch/Options/ElasticsearchOptions.cs b/src/modules/Elsa.Elasticsearch/Options/ElasticsearchOptions.cs deleted file mode 100644 index e7f18a6d99..0000000000 --- a/src/modules/Elsa.Elasticsearch/Options/ElasticsearchOptions.cs +++ /dev/null @@ -1,46 +0,0 @@ -using Humanizer; -using JetBrains.Annotations; - -namespace Elsa.Elasticsearch.Options; - -/// -/// Contains Elasticsearch settings. -/// -[PublicAPI] -public class ElasticsearchOptions -{ - /// - /// The URL of the Elasticsearch server or the name of a connection string that in turn stores the URL. - /// - public string Endpoint { get; set; } = default!; - - /// - /// The username to use when connecting with the Elasticsearch server. - /// - public string? Username { get; set; } - - /// - /// The password to use when connecting with the Elasticsearch server. - /// - public string? Password { get; set; } - - /// - /// The API key to use when connecting with the Elasticsearch server. - /// - public string? ApiKey { get; set; } - - /// - /// A map between type and index name to use. When no index name is configured for a given type, the name of the type is used. - /// - public IDictionary IndexNameMappings { get; set; } = new Dictionary(); - - /// - /// Returns an index name for the specified document type. If no mapping was found, the simple name of the type is used. - /// - public string GetIndexNameFor() => GetIndexNameFor(typeof(T)); - - /// - /// Returns an index name for the specified document type. If no mapping was found, the simple name of the type is used. - /// - public string GetIndexNameFor(Type documentType) => IndexNameMappings.TryGetValue(documentType, out var index) ? index : documentType.Name.Dasherize(); -} \ No newline at end of file diff --git a/src/modules/Elsa.Elasticsearch/Shared/Models/OrderField.cs b/src/modules/Elsa.Elasticsearch/Shared/Models/OrderField.cs deleted file mode 100644 index 9de28785f8..0000000000 --- a/src/modules/Elsa.Elasticsearch/Shared/Models/OrderField.cs +++ /dev/null @@ -1,10 +0,0 @@ -using Elsa.Common.Entities; - -namespace Elsa.Elasticsearch.Shared.Models; - -/// -/// Represents a field by which to order. -/// -/// The field. -/// The direction. -public record OrderField(string Field, OrderDirection Direction); \ No newline at end of file diff --git a/src/modules/Elsa.Elasticsearch/Strategies/DefaultNaming.cs b/src/modules/Elsa.Elasticsearch/Strategies/DefaultNaming.cs deleted file mode 100644 index 4736d7b3d4..0000000000 --- a/src/modules/Elsa.Elasticsearch/Strategies/DefaultNaming.cs +++ /dev/null @@ -1,13 +0,0 @@ -using Elsa.Elasticsearch.Contracts; -using Humanizer; - -namespace Elsa.Elasticsearch.Strategies; - -/// -/// Returns the alias as the name for the index. -/// -public class DefaultNaming : IIndexNamingStrategy -{ - /// - public string GenerateName(string aliasName) => aliasName.Kebaberize(); -} \ No newline at end of file diff --git a/src/modules/Elsa.Elasticsearch/Strategies/YearAndMonthNaming.cs b/src/modules/Elsa.Elasticsearch/Strategies/YearAndMonthNaming.cs deleted file mode 100644 index bcae989ea9..0000000000 --- a/src/modules/Elsa.Elasticsearch/Strategies/YearAndMonthNaming.cs +++ /dev/null @@ -1,33 +0,0 @@ -using Elsa.Common; -using Elsa.Elasticsearch.Contracts; -using Humanizer; -using JetBrains.Annotations; - -namespace Elsa.Elasticsearch.Strategies; - -/// -/// Returns an index name based on the specified alias, current year and month. -/// -[PublicAPI] -public class YearAndMonthNaming : IIndexNamingStrategy -{ - private readonly ISystemClock _systemClock; - - /// - /// Constructor. - /// - public YearAndMonthNaming(ISystemClock systemClock) - { - _systemClock = systemClock; - } - - /// - public string GenerateName(string aliasName) - { - var now = _systemClock.UtcNow; - var month = now.ToString("MM"); - var year = now.Year; - - return aliasName.Kebaberize() + "-" + year + "-" + month; - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Email/Activities/SendEmail.cs b/src/modules/Elsa.Email/Activities/SendEmail.cs deleted file mode 100644 index f761a1e827..0000000000 --- a/src/modules/Elsa.Email/Activities/SendEmail.cs +++ /dev/null @@ -1,254 +0,0 @@ -using System.Collections; -using System.Dynamic; -using System.Runtime.CompilerServices; -using System.Text; -using System.Text.Json; -using Elsa.Email.Contracts; -using Elsa.Email.Models; -using Elsa.Email.Options; -using Elsa.Extensions; -using Elsa.Workflows; -using Elsa.Workflows.Attributes; -using Elsa.Workflows.UIHints; -using Elsa.Workflows.Models; -using Microsoft.Extensions.Logging; -using Microsoft.Extensions.Options; -using MimeKit; - -namespace Elsa.Email.Activities; - -/// -/// Send an email message. -/// -[Activity("Elsa", "Email", "Send an email message.", Kind = ActivityKind.Task)] -public class SendEmail : Activity -{ - /// - public SendEmail([CallerFilePath] string? source = null, [CallerLineNumber] int? line = null) : base(source, line) - { - } - - /// - /// The sender's email address. - /// - [Input(Description = "The sender's email address.")] - public Input From { get; set; } = null!; - - /// - /// The recipients email addresses. - /// - [Input(Description = "The recipients email addresses.", UIHint = InputUIHints.MultiText)] - public Input> To { get; set; } = null!; - - /// - /// The CC recipient email addresses. - /// - [Input( - Description = "The CC recipient email addresses.", - UIHint = InputUIHints.MultiText, - Category = "More")] - public Input> Cc { get; set; } = null!; - - /// - /// The BCC recipients email addresses. - /// - [Input( - Description = "The BCC recipients email addresses.", - UIHint = InputUIHints.MultiText, - Category = "More")] - public Input> Bcc { get; set; } = null!; - - /// - /// The subject of the email message. - /// - [Input(Description = "The subject of the email message.")] - public Input Subject { get; set; } = null!; - - /// - /// The attachments to send with the email message. - /// - [Input( - Description = "The attachments to send with the email message. Can be (an array of) a fully-qualified file path, URL, stream, byte array or instances of EmailAttachment.", - UIHint = InputUIHints.MultiLine - )] - public Input Attachments { get; set; } = null!; - - /// - /// The body of the email message. - /// - [Input( - Description = "The body of the email message.", - UIHint = InputUIHints.MultiLine - )] - public Input Body { get; set; } = null!; - - /// - /// The activity to execute when an error occurs while trying to send the email. - /// - [Port] public IActivity? Error { get; set; } - - /// - protected override async ValueTask ExecuteAsync(ActivityExecutionContext context) - { - var cancellationToken = context.CancellationToken; - var message = new MimeMessage(); - var options = context.GetRequiredService>().Value; - var from = string.IsNullOrWhiteSpace(From.GetOrDefault(context)) ? options.DefaultSender : From.Get(context)!; - - message.Sender = MailboxAddress.Parse(from); - message.From.Add(MailboxAddress.Parse(from)); - message.Subject = Subject.GetOrDefault(context) ?? ""; - - var bodyBuilder = new BodyBuilder - { - HtmlBody = Body.GetOrDefault(context) - }; - await AddAttachmentsAsync(context, bodyBuilder, cancellationToken); - - message.Body = bodyBuilder.ToMessageBody(); - - SetRecipientsEmailAddresses(message.To, GetAddresses(context, To)); - SetRecipientsEmailAddresses(message.Cc, GetAddresses(context, Cc)); - SetRecipientsEmailAddresses(message.Bcc, GetAddresses(context, Bcc)); - - var smtpService = context.GetRequiredService(); - var logger = context.GetRequiredService>(); - - try - { - await smtpService.SendAsync(message, context.CancellationToken); - await context.CompleteActivityAsync(); - } - catch (Exception e) - { - logger.LogWarning(e, "Error while sending email message"); - context.AddExecutionLogEntry("Error", e.Message, payload: new - { - e.StackTrace - }); - await context.ScheduleActivityAsync(Error, OnErrorCompletedAsync); - } - } - - private async ValueTask OnErrorCompletedAsync(ActivityCompletedContext context) => await context.TargetContext.CompleteActivityAsync(); - - private static ICollection GetAddresses(ActivityExecutionContext context, Input> input) - { - return input.GetOrDefault(context) ?? new List(0); - } - - private async Task AddAttachmentsAsync(ActivityExecutionContext context, BodyBuilder bodyBuilder, CancellationToken cancellationToken) - { - var attachments = Attachments.GetOrDefault(context); - - if (attachments == null || attachments is string s && string.IsNullOrWhiteSpace(s)) - return; - - var index = 0; - var attachmentObjects = InterpretAttachmentsModel(attachments); - - foreach (var attachmentObject in attachmentObjects) - { - switch (attachmentObject) - { - case Uri url: - await AttachOnlineFileAsync(context, bodyBuilder, url, cancellationToken); - break; - case string path when path?.Contains("://") == true: - await AttachOnlineFileAsync(context, bodyBuilder, new Uri(path), cancellationToken); - break; - case string path when !string.IsNullOrWhiteSpace(path): - await AttachLocalFileAsync(bodyBuilder, path, cancellationToken); - break; - case byte[] bytes: - { - var fileName = $"Attachment-{++index}"; - bodyBuilder.Attachments.Add(fileName, bytes, ContentType.Parse("application/binary")); - break; - } - case Stream stream: - { - var fileName = $"Attachment-{++index}"; - await bodyBuilder.Attachments.AddAsync(fileName, stream, ContentType.Parse("application/binary"), cancellationToken); - break; - } - case EmailAttachment emailAttachment: - { - var fileName = emailAttachment.FileName ?? $"Attachment-{++index}"; - var contentType = emailAttachment.ContentType ?? "application/binary"; - var parsedContentType = ContentType.Parse(contentType); - - if (emailAttachment.Content is byte[] bytes) - bodyBuilder.Attachments.Add(fileName, bytes, parsedContentType); - - else if (emailAttachment.Content is Stream stream) - await bodyBuilder.Attachments.AddAsync(fileName, stream, parsedContentType, cancellationToken); - - break; - } - case ExpandoObject expandoObject: - { - var dictionary = new Dictionary(expandoObject, StringComparer.OrdinalIgnoreCase); - var fileName = dictionary.GetValue("FileName") ?? $"Attachment-{++index}"; - var contentType = dictionary.GetValue("ContentType") ?? "application/binary"; - var parsedContentType = ContentType.Parse(contentType); - var content = dictionary.GetValue("Content"); - - if (content is byte[] bytes) - bodyBuilder.Attachments.Add(fileName, bytes, parsedContentType); - - else if (content is Stream stream) - await bodyBuilder.Attachments.AddAsync(fileName, stream, parsedContentType, cancellationToken); - - break; - } - default: - { - var json = JsonSerializer.Serialize(attachmentObject); - var fileName = $"Attachment-{++index}"; - bodyBuilder.Attachments.Add(fileName, Encoding.UTF8.GetBytes(json), ContentType.Parse("application/json")); - break; - } - } - } - } - - private async Task AttachLocalFileAsync(BodyBuilder bodyBuilder, string path, CancellationToken cancellationToken) => await bodyBuilder.Attachments.AddAsync(path, cancellationToken); - - private async Task AttachOnlineFileAsync(ActivityExecutionContext context, BodyBuilder bodyBuilder, Uri url, CancellationToken cancellationToken) - { - var fileName = Path.GetFileName(url.LocalPath); - var downloader = context.GetRequiredService(); - var response = await downloader.DownloadAsync(url, cancellationToken); - var contentStream = await response.Content.ReadAsStreamAsync(cancellationToken); - var contentType = response.Content.Headers.ContentType?.MediaType ?? "application/binary"; - await bodyBuilder.Attachments.AddAsync(fileName, contentStream, ContentType.Parse(contentType), cancellationToken); - } - - private IEnumerable InterpretAttachmentsModel(object attachments) - { - if (attachments is byte[] bytes) - return new[] - { - bytes - }; - - return attachments is string text - ? new[] - { - text - } - : attachments as IEnumerable ?? new[] - { - attachments - }; - } - - private void SetRecipientsEmailAddresses(InternetAddressList list, IEnumerable? addresses) - { - if (addresses == null) - return; - - list.AddRange(addresses.Select(MailboxAddress.Parse)); - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Email/Contracts/IDownloader.cs b/src/modules/Elsa.Email/Contracts/IDownloader.cs deleted file mode 100644 index 95fef9dc31..0000000000 --- a/src/modules/Elsa.Email/Contracts/IDownloader.cs +++ /dev/null @@ -1,12 +0,0 @@ -namespace Elsa.Email.Contracts; - -/// -/// Download files from the Internet. -/// -public interface IDownloader -{ - /// - /// Download whatever is returned at the specified URL. - /// - Task DownloadAsync(Uri url, CancellationToken cancellationToken = default); -} \ No newline at end of file diff --git a/src/modules/Elsa.Email/Contracts/ISmtpService.cs b/src/modules/Elsa.Email/Contracts/ISmtpService.cs deleted file mode 100644 index ed956b801d..0000000000 --- a/src/modules/Elsa.Email/Contracts/ISmtpService.cs +++ /dev/null @@ -1,14 +0,0 @@ -using MimeKit; - -namespace Elsa.Email.Contracts; - -/// -/// Use this service to send emails. -/// -public interface ISmtpService -{ - /// - /// Send the specified . - /// - Task SendAsync(MimeMessage message, CancellationToken cancellationToken); -} \ No newline at end of file diff --git a/src/modules/Elsa.Email/Elsa.Email.csproj b/src/modules/Elsa.Email/Elsa.Email.csproj deleted file mode 100644 index 3a3c6cc375..0000000000 --- a/src/modules/Elsa.Email/Elsa.Email.csproj +++ /dev/null @@ -1,20 +0,0 @@ - - - - - Provides a SendEmail activity that lets you send emails from a workflow. - - elsa module activities email - - - - - - - - - - - - - diff --git a/src/modules/Elsa.Email/Extensions/ModuleExtensions.cs b/src/modules/Elsa.Email/Extensions/ModuleExtensions.cs deleted file mode 100644 index 0642becd1e..0000000000 --- a/src/modules/Elsa.Email/Extensions/ModuleExtensions.cs +++ /dev/null @@ -1,20 +0,0 @@ -using Elsa.Email.Features; -using Elsa.Features.Services; - -// ReSharper disable once CheckNamespace -namespace Elsa.Extensions; - -/// -/// Provides methods to install and configure email related features. -/// -public static class ModuleExtensions -{ - /// - /// Adds the feature to the system. - /// - public static IModule UseEmail(this IModule configuration, Action? configure = default) - { - configuration.Configure(configure); - return configuration; - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Email/Features/EmailFeature.cs b/src/modules/Elsa.Email/Features/EmailFeature.cs deleted file mode 100644 index c77e45e1d1..0000000000 --- a/src/modules/Elsa.Email/Features/EmailFeature.cs +++ /dev/null @@ -1,51 +0,0 @@ -using Elsa.Email.Contracts; -using Elsa.Email.Options; -using Elsa.Email.Services; -using Elsa.Extensions; -using Elsa.Features.Abstractions; -using Elsa.Features.Services; -using Microsoft.Extensions.DependencyInjection; - -namespace Elsa.Email.Features; - -/// -/// Setup email features. -/// -public class EmailFeature : FeatureBase -{ - /// - public EmailFeature(IModule module) : base(module) - { - } - - /// - /// Set a callback to configure . - /// - public Action ConfigureOptions { get; set; } = _ => { }; - - /// - /// Gets or sets a callback for configuring the implementation. - /// - public Func SmtpService { get; set; } = sp => sp.GetRequiredService(); - - /// - /// Gets or sets a callback for configuring the HTTP client use by the default implementation of . - /// - public Action ConfigureDownloaderHttpClient { get; set; } = (_, _) => { }; - - /// - public override void Configure() - { - Module.AddActivitiesFrom(); - } - - /// - public override void Apply() - { - Services - .Configure(ConfigureOptions) - .AddScoped() - .AddScoped(SmtpService) - .AddHttpClient(ConfigureDownloaderHttpClient); - } -} \ No newline at end of file diff --git a/src/modules/Elsa.Email/FodyWeavers.xml b/src/modules/Elsa.Email/FodyWeavers.xml deleted file mode 100644 index 00e1d9a1c1..0000000000 --- a/src/modules/Elsa.Email/FodyWeavers.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/src/modules/Elsa.Email/Models/EmailAttachment.cs b/src/modules/Elsa.Email/Models/EmailAttachment.cs deleted file mode 100644 index f30ab2bc57..0000000000 --- a/src/modules/Elsa.Email/Models/EmailAttachment.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace Elsa.Email.Models; - -/// -/// Represents an email attachment. -/// -/// The content of the attachment. -/// The name of the attachment. -/// The content type of the attachment. -public record EmailAttachment(object Content, string? FileName, string? ContentType); \ No newline at end of file diff --git a/src/modules/Elsa.Email/Options/SmtpEncryptionMethod.cs b/src/modules/Elsa.Email/Options/SmtpEncryptionMethod.cs deleted file mode 100644 index 053b6af57f..0000000000 --- a/src/modules/Elsa.Email/Options/SmtpEncryptionMethod.cs +++ /dev/null @@ -1,22 +0,0 @@ -namespace Elsa.Email.Options; - -/// -/// Represents the encryption method to use when connecting to an SMTP server. -/// -public enum SmtpEncryptionMethod -{ - /// - /// No encryption. - /// - None = 0, - - /// - /// SSL/TLS encryption. - /// - SslTlS = 1, - - /// - /// STARTTLS encryption. - /// - StartTls = 2 -} \ No newline at end of file diff --git a/src/modules/Elsa.Email/Options/SmtpOptions.cs b/src/modules/Elsa.Email/Options/SmtpOptions.cs deleted file mode 100644 index 4201ae00ae..0000000000 --- a/src/modules/Elsa.Email/Options/SmtpOptions.cs +++ /dev/null @@ -1,44 +0,0 @@ -using MailKit.Security; - -namespace Elsa.Email.Options; - -/// -/// Options to configure the SMTP client with. -/// -public class SmtpOptions -{ - /// - /// The default sender address when no sender is specified while sending emails. - /// - public string DefaultSender { get; set; } = default!; - - /// - /// The SMTP server IP address or hostname. - /// - public string? Host { get; set; } - - /// - /// The SMTP server port - /// - public int Port { get; set; } = 25; - - /// - /// Secure socket options. - /// - public SecureSocketOptions SecureSocketOptions { get; set; } = SecureSocketOptions.Auto; - - /// - /// True if the SMTP host requires credentials. - /// - public bool RequireCredentials { get; set; } - - /// - /// The username to authenticate with. - /// - public string? UserName { get; set; } - - /// - /// The password to authenticate with. - /// - public string? Password { get; set; } -} \ No newline at end of file diff --git a/src/modules/Elsa.Email/Services/DefaultDownloader.cs b/src/modules/Elsa.Email/Services/DefaultDownloader.cs deleted file mode 100644 index 80dfefc1ac..0000000000 --- a/src/modules/Elsa.Email/Services/DefaultDownloader.cs +++ /dev/null @@ -1,24 +0,0 @@ -using Elsa.Email.Contracts; - -namespace Elsa.Email.Services; - -/// -/// Download files from the Internet. -/// -public class DefaultDownloader : IDownloader -{ - private readonly HttpClient _httpClient; - - /// - /// Constructor. - /// - public DefaultDownloader(HttpClient httpClient) - { - _httpClient = httpClient; - } - - /// - /// Download whatever is returned at the specified URL. - /// - public async Task DownloadAsync(Uri url, CancellationToken cancellationToken = default) => await _httpClient.GetAsync(url, cancellationToken); -} \ No newline at end of file diff --git a/src/modules/Elsa.Email/Services/MailKitSmtpService.cs b/src/modules/Elsa.Email/Services/MailKitSmtpService.cs deleted file mode 100644 index d62042e839..0000000000 --- a/src/modules/Elsa.Email/Services/MailKitSmtpService.cs +++ /dev/null @@ -1,73 +0,0 @@ -using System.Net.Security; -using System.Security.Cryptography.X509Certificates; -using Elsa.Email.Contracts; -using Elsa.Email.Options; -using Microsoft.Extensions.Logging; -using Microsoft.Extensions.Options; -using MimeKit; -using SmtpClient = MailKit.Net.Smtp.SmtpClient; - -namespace Elsa.Email.Services; - -/// -/// A MailKit implementation of . -/// -public class MailKitSmtpService : ISmtpService -{ - private readonly SmtpOptions _options; - private readonly ILogger _logger; - - /// - /// Constructor. - /// - public MailKitSmtpService( - IOptions options, - ILogger logger - ) - { - _options = options.Value; - _logger = logger; - } - - /// - /// Sends the specified message. - /// - public async Task SendAsync(MimeMessage message, CancellationToken cancellationToken) => await SendMessage(message, cancellationToken); - - private async Task SendMessage(MimeMessage message, CancellationToken cancellationToken) - { - using var client = new SmtpClient(); - client.ServerCertificateValidationCallback = CertificateValidationCallback; - - await client.ConnectAsync(_options.Host, _options.Port, _options.SecureSocketOptions, cancellationToken); - - if (_options.RequireCredentials) - await client.AuthenticateAsync(_options.UserName ?? "", _options.Password ?? "", cancellationToken); - - await client.SendAsync(message, cancellationToken); - await client.DisconnectAsync(true, cancellationToken); - } - - private bool CertificateValidationCallback(object sender, X509Certificate? certificate, X509Chain? chain, SslPolicyErrors sslPolicyErrors) - { - if (sslPolicyErrors == SslPolicyErrors.None) - return true; - - _logger.LogError( - "SMTP Server's certificate {CertificateSubject} issued by {CertificateIssuer} with thumbprint {CertificateThumbprint} and expiration date {CertificateExpirationDate} is considered invalid with {SslPolicyErrors} policy errors", - certificate?.Subject, - certificate?.Issuer, - certificate?.GetCertHashString(), - certificate?.GetExpirationDateString(), - sslPolicyErrors); - - if (!sslPolicyErrors.HasFlag(SslPolicyErrors.RemoteCertificateChainErrors) || chain?.ChainStatus == null) - return false; - - foreach (var chainStatus in chain.ChainStatus) - _logger.LogError("Status: {Status} - {StatusInformation}", chainStatus.Status, chainStatus.StatusInformation); - - return false; - } - -} \ No newline at end of file diff --git a/src/modules/Elsa.EntityFrameworkCore.Common/Abstractions/DesignTimeDbContextFactoryBase.cs b/src/modules/Elsa.EntityFrameworkCore.Common/Abstractions/DesignTimeDbContextFactoryBase.cs deleted file mode 100644 index df23d655fb..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Common/Abstractions/DesignTimeDbContextFactoryBase.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System.CommandLine; -using System.CommandLine.Parsing; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Design; -using Microsoft.Extensions.DependencyInjection; - -namespace Elsa.EntityFrameworkCore.Abstractions; - -/// -/// A design-time factory base class that can be inherited from by provider-specific implementations. -/// -public abstract class DesignTimeDbContextFactoryBase : IDesignTimeDbContextFactory where TDbContext : DbContext -{ - /// - public TDbContext CreateDbContext(string[] args) - { - var builder = new DbContextOptionsBuilder(); - var connectionStringOption = new Option("--connectionString", "Specifies the connection string."); - var command = new RootCommand(); - - command.AddOption(connectionStringOption); - - var parser = new Parser(command); - var parseResult = parser.Parse(args); - var connectionString = parseResult.GetValueForOption(connectionStringOption) ?? "Data Source=local"; - var serviceProvider = new ServiceCollection().BuildServiceProvider(); - - ConfigureBuilder(builder, connectionString); - - return (TDbContext)ActivatorUtilities.CreateInstance(serviceProvider, typeof(TDbContext), builder.Options); - } - - /// - /// Implement this to configure the . - /// - protected abstract void ConfigureBuilder(DbContextOptionsBuilder builder, string connectionString); -} \ No newline at end of file diff --git a/src/modules/Elsa.EntityFrameworkCore.Common/CommonPersistenceFeature.cs b/src/modules/Elsa.EntityFrameworkCore.Common/CommonPersistenceFeature.cs deleted file mode 100644 index 835574f214..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Common/CommonPersistenceFeature.cs +++ /dev/null @@ -1,17 +0,0 @@ -using Elsa.EntityFrameworkCore.EntityHandlers; -using Elsa.Features.Abstractions; -using Elsa.Features.Services; -using Microsoft.Extensions.DependencyInjection; - -namespace Elsa.EntityFrameworkCore; - -/// -public class CommonPersistenceFeature(IModule module) : FeatureBase(module) -{ - /// - public override void Apply() - { - Services.AddScoped(); - Services.AddScoped(); - } -} \ No newline at end of file diff --git a/src/modules/Elsa.EntityFrameworkCore.Common/Constants.cs b/src/modules/Elsa.EntityFrameworkCore.Common/Constants.cs deleted file mode 100644 index a17a118253..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Common/Constants.cs +++ /dev/null @@ -1,12 +0,0 @@ -namespace Elsa.EntityFrameworkCore; - -/// -/// Constants. -/// -public class Constants -{ - /// - /// Default connection string for SQLite. - /// - public const string DefaultConnectionString = "Data Source=elsa.sqlite.db;Cache=Shared;"; -} \ No newline at end of file diff --git a/src/modules/Elsa.EntityFrameworkCore.Common/Contracts/IDbExceptionHandler.cs b/src/modules/Elsa.EntityFrameworkCore.Common/Contracts/IDbExceptionHandler.cs deleted file mode 100644 index c0dc5aec3f..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Common/Contracts/IDbExceptionHandler.cs +++ /dev/null @@ -1,15 +0,0 @@ -namespace Elsa.EntityFrameworkCore; - -/// -/// Defines the contract for an exception handler in a database context. -/// -/// -/// Implementing this interface allows for customized handling of exceptions that occur during database operations. -/// -public interface IDbExceptionHandler -{ - /// - /// Handles the given exception that occurs during database operations. - /// - public Task HandleAsync(DbUpdateExceptionContext context); -} \ No newline at end of file diff --git a/src/modules/Elsa.EntityFrameworkCore.Common/Contracts/IElsaDbContextSchema.cs b/src/modules/Elsa.EntityFrameworkCore.Common/Contracts/IElsaDbContextSchema.cs deleted file mode 100644 index 05e3987b52..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Common/Contracts/IElsaDbContextSchema.cs +++ /dev/null @@ -1,12 +0,0 @@ -namespace Elsa.EntityFrameworkCore; - -/// -/// Interface to provide custom Elsa Db Context Schema in Migration -/// -public interface IElsaDbContextSchema -{ - /// - /// Name of the Schema - /// - public string Schema { get; } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.Common/Contracts/IEntityModelCreatingHandler.cs b/src/modules/Elsa.EntityFrameworkCore.Common/Contracts/IEntityModelCreatingHandler.cs deleted file mode 100644 index ab51dd7847..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Common/Contracts/IEntityModelCreatingHandler.cs +++ /dev/null @@ -1,15 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata; - -namespace Elsa.EntityFrameworkCore; - -/// -/// Represents handler for entity model creation. -/// -public interface IEntityModelCreatingHandler -{ - /// - /// Handles the entity model being created. - /// - void Handle(ElsaDbContextBase dbContext, ModelBuilder modelBuilder, IMutableEntityType entityType); -} \ No newline at end of file diff --git a/src/modules/Elsa.EntityFrameworkCore.Common/Contracts/IEntitySavingHandler.cs b/src/modules/Elsa.EntityFrameworkCore.Common/Contracts/IEntitySavingHandler.cs deleted file mode 100644 index 0aa979b2d3..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Common/Contracts/IEntitySavingHandler.cs +++ /dev/null @@ -1,14 +0,0 @@ -using Microsoft.EntityFrameworkCore.ChangeTracking; - -namespace Elsa.EntityFrameworkCore; - -/// -/// Represents handler for entities before saving changes. -/// -public interface IEntitySavingHandler -{ - /// - /// Handles the entity before saving changes. - /// - ValueTask HandleAsync(ElsaDbContextBase dbContext, EntityEntry entry, CancellationToken cancellationToken = default); -} \ No newline at end of file diff --git a/src/modules/Elsa.EntityFrameworkCore.Common/Converters/JsonValueConverter.cs b/src/modules/Elsa.EntityFrameworkCore.Common/Converters/JsonValueConverter.cs deleted file mode 100644 index 14f8e5a1fc..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Common/Converters/JsonValueConverter.cs +++ /dev/null @@ -1,6 +0,0 @@ -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -namespace Elsa.EntityFrameworkCore.Converters; - -public class JsonValueConverter() : ValueConverter(v => JsonValueConverterHelper.Serialize(v), v => JsonValueConverterHelper.Deserialize(v)) - where T : class; \ No newline at end of file diff --git a/src/modules/Elsa.EntityFrameworkCore.Common/Converters/PrimitiveDictionaryConverter.cs b/src/modules/Elsa.EntityFrameworkCore.Common/Converters/PrimitiveDictionaryConverter.cs deleted file mode 100644 index 6f693cff85..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Common/Converters/PrimitiveDictionaryConverter.cs +++ /dev/null @@ -1,69 +0,0 @@ -using System.Text.Json; -using System.Text.Json.Serialization; - -namespace Elsa.EntityFrameworkCore.Converters; - -public class PrimitiveDictionaryConverter : JsonConverter> -{ - public override IDictionary Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) - { - if (reader.TokenType != JsonTokenType.StartObject) - throw new JsonException("Expected start of object."); - - var dictionary = new Dictionary(); - - while (reader.Read()) - { - if (reader.TokenType == JsonTokenType.EndObject) - return dictionary; - - var key = reader.GetString()!; - reader.Read(); - var value = ReadValue(ref reader, options); - dictionary.Add(key, value); - } - - throw new JsonException("Expected end of object."); - } - - private object ReadValue(ref Utf8JsonReader reader, JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case JsonTokenType.String: - return reader.GetString()!; - case JsonTokenType.Number: - if (reader.TryGetInt64(out var l)) - return l; - return reader.GetDouble(); - case JsonTokenType.True: - return true; - case JsonTokenType.False: - return false; - case JsonTokenType.Null: - return null!; - case JsonTokenType.StartObject: - return JsonSerializer.Deserialize>(ref reader, options)!; - case JsonTokenType.StartArray: - return JsonSerializer.Deserialize>(ref reader, options)!; - default: - using (var document = JsonDocument.ParseValue(ref reader)) - { - return document.RootElement.Clone().ToString(); - } - } - } - - public override void Write(Utf8JsonWriter writer, IDictionary value, JsonSerializerOptions options) - { - writer.WriteStartObject(); - - foreach (var kvp in value) - { - writer.WritePropertyName(kvp.Key); - JsonSerializer.Serialize(writer, kvp.Value, options); - } - - writer.WriteEndObject(); - } -} \ No newline at end of file diff --git a/src/modules/Elsa.EntityFrameworkCore.Common/CustomDbContextOptionsExtensionInfo.cs b/src/modules/Elsa.EntityFrameworkCore.Common/CustomDbContextOptionsExtensionInfo.cs deleted file mode 100644 index 92b461b71b..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Common/CustomDbContextOptionsExtensionInfo.cs +++ /dev/null @@ -1,39 +0,0 @@ -using Microsoft.EntityFrameworkCore.Infrastructure; - -namespace Elsa.EntityFrameworkCore; - -/// -/// Contains options for configuring Elsa's Entity Framework Core integration. -/// -public class CustomDbContextOptionsExtensionInfo : DbContextOptionsExtensionInfo -{ - /// - public CustomDbContextOptionsExtensionInfo(IDbContextOptionsExtension extension) - : base(extension) - { - } - - /// - public override bool IsDatabaseProvider => false; - - /// - public override string LogFragment => ""; - - /// - public override int GetServiceProviderHashCode() - { - // Return a unique hash code for your custom extension - return 0; - } - - /// - public override void PopulateDebugInfo(IDictionary debugInfo) - { - } - - /// - public override bool ShouldUseSameServiceProvider(DbContextOptionsExtensionInfo other) - { - return true; - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.Common/DbSchemaAwareMigrationAssembly.cs b/src/modules/Elsa.EntityFrameworkCore.Common/DbSchemaAwareMigrationAssembly.cs deleted file mode 100644 index 5e31b710e9..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Common/DbSchemaAwareMigrationAssembly.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System.Reflection; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Diagnostics; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Migrations.Internal; - -namespace Elsa.EntityFrameworkCore; - -/// -/// Class That enable Schema change for Migration -/// -public class DbSchemaAwareMigrationAssembly( - ICurrentDbContext currentContext, - IDbContextOptions options, - IMigrationsIdGenerator idGenerator, - IDiagnosticsLogger logger) - : MigrationsAssembly(currentContext, options, idGenerator, logger) -{ - private readonly DbContext _context = currentContext.Context; - - public override Migration CreateMigration(TypeInfo migrationClass, string activeProvider) - { - if (activeProvider == null) - throw new ArgumentNullException(nameof(activeProvider)); - - var hasCtorWithSchema = migrationClass.GetConstructor([typeof(IElsaDbContextSchema)]) != null; - - if (hasCtorWithSchema && _context is IElsaDbContextSchema schema) - { - var instance = (Migration)Activator.CreateInstance(migrationClass.AsType(), schema)!; - instance.ActiveProvider = activeProvider; - return instance; - } - - return base.CreateMigration(migrationClass, activeProvider); - } -} \ No newline at end of file diff --git a/src/modules/Elsa.EntityFrameworkCore.Common/DbUpdateExceptionContext.cs b/src/modules/Elsa.EntityFrameworkCore.Common/DbUpdateExceptionContext.cs deleted file mode 100644 index b9a8ffd53f..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Common/DbUpdateExceptionContext.cs +++ /dev/null @@ -1,3 +0,0 @@ -namespace Elsa.EntityFrameworkCore; - -public record DbUpdateExceptionContext(Exception Exception, CancellationToken CancellationToken); \ No newline at end of file diff --git a/src/modules/Elsa.EntityFrameworkCore.Common/Elsa.EntityFrameworkCore.Common.csproj b/src/modules/Elsa.EntityFrameworkCore.Common/Elsa.EntityFrameworkCore.Common.csproj deleted file mode 100644 index 3454db95b5..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Common/Elsa.EntityFrameworkCore.Common.csproj +++ /dev/null @@ -1,26 +0,0 @@ - - - - - Provides common Entity Framework Core types for implementing EF Core persistence of varipus ELsa modules. - - elsa module persistence efcore - Elsa.EntityFrameworkCore - - - - - - - - - - - - - - - - - - diff --git a/src/modules/Elsa.EntityFrameworkCore.Common/Elsa.EntityFrameworkCore.Common.csproj.DotSettings b/src/modules/Elsa.EntityFrameworkCore.Common/Elsa.EntityFrameworkCore.Common.csproj.DotSettings deleted file mode 100644 index 127787e895..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Common/Elsa.EntityFrameworkCore.Common.csproj.DotSettings +++ /dev/null @@ -1,2 +0,0 @@ - - True \ No newline at end of file diff --git a/src/modules/Elsa.EntityFrameworkCore.Common/ElsaDbContextBase.cs b/src/modules/Elsa.EntityFrameworkCore.Common/ElsaDbContextBase.cs deleted file mode 100644 index a1f9dcb35e..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Common/ElsaDbContextBase.cs +++ /dev/null @@ -1,101 +0,0 @@ -using Elsa.Common.Entities; -using Elsa.Common.Multitenancy; -using Elsa.Extensions; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.ChangeTracking; -using Microsoft.Extensions.DependencyInjection; - -namespace Elsa.EntityFrameworkCore; - -/// -/// An optional base class to implement with some opinions on certain converters to install for certain DB providers. -/// -public abstract class ElsaDbContextBase : DbContext, IElsaDbContextSchema -{ - private static readonly ISet ModifiedEntityStates = new HashSet - { - EntityState.Added, - EntityState.Modified, - }; - - protected IServiceProvider ServiceProvider { get; } - private readonly ElsaDbContextOptions? elsaDbContextOptions; - public string? TenantId { get; set; } - - /// - /// The default schema used by Elsa. - /// - public static string ElsaSchema { get; set; } = "Elsa"; - - /// - public string Schema { get; } - - /// - /// The table used to store the migrations history. - /// - public static string MigrationsHistoryTable { get; set; } = "__EFMigrationsHistory"; - - /// - /// Initializes a new instance of the class. - /// - protected ElsaDbContextBase(DbContextOptions options, IServiceProvider serviceProvider) : base(options) - { - ServiceProvider = serviceProvider; - elsaDbContextOptions = options.FindExtension()?.Options; - - // ReSharper disable once VirtualMemberCallInConstructor - Schema = !string.IsNullOrWhiteSpace(elsaDbContextOptions?.SchemaName) ? elsaDbContextOptions.SchemaName : ElsaSchema; - - var tenantAccessor = serviceProvider.GetService(); - var tenantId = tenantAccessor?.Tenant?.Id; - - if (!string.IsNullOrWhiteSpace(tenantId)) - TenantId = tenantId.NullIfEmpty(); - } - - /// - public override async Task SaveChangesAsync(CancellationToken cancellationToken = default) - { - await OnBeforeSavingAsync(cancellationToken); - return await base.SaveChangesAsync(cancellationToken); - } - - /// - protected override void OnModelCreating(ModelBuilder modelBuilder) - { - if (!string.IsNullOrWhiteSpace(Schema)) - modelBuilder.HasDefaultSchema(Schema); - - var additionalConfigurations = elsaDbContextOptions?.GetModelConfigurations(this); - - additionalConfigurations?.Invoke(modelBuilder); - - using var scope = ServiceProvider.CreateScope(); - var entityTypeHandlers = scope.ServiceProvider.GetServices().ToList(); - - foreach (var entityType in modelBuilder.Model.GetEntityTypes().ToList()) - { - foreach (var handler in entityTypeHandlers) - handler.Handle(this, modelBuilder, entityType); - } - } - - private async Task OnBeforeSavingAsync(CancellationToken cancellationToken) - { - using var scope = ServiceProvider.CreateScope(); - var handlers = scope.ServiceProvider.GetServices().ToList(); - foreach (var entry in ChangeTracker.Entries().Where(IsModifiedEntity)) - { - foreach (var handler in handlers) - await handler.HandleAsync(this, entry, cancellationToken); - } - } - - /// - /// Determine if an entity was modified. - /// - private bool IsModifiedEntity(EntityEntry entityEntry) - { - return ModifiedEntityStates.Contains(entityEntry.State) && entityEntry.Entity is Entity; - } -} \ No newline at end of file diff --git a/src/modules/Elsa.EntityFrameworkCore.Common/ElsaDbContextOptions.cs b/src/modules/Elsa.EntityFrameworkCore.Common/ElsaDbContextOptions.cs deleted file mode 100644 index cd6af7271a..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Common/ElsaDbContextOptions.cs +++ /dev/null @@ -1,52 +0,0 @@ -using JetBrains.Annotations; -using Microsoft.EntityFrameworkCore; - -namespace Elsa.EntityFrameworkCore; - -/// -/// Provides options for configuring Elsa's Entity Framework Core integration. -/// -[PublicAPI] -public class ElsaDbContextOptions -{ - /// - /// The schema used by Elsa. - /// - public string? SchemaName { get; set; } - - /// - /// The table used to store the migrations history. - /// - public string? MigrationsHistoryTableName { get; set; } - - /// - /// The assembly name containing the migrations. - /// - public string? MigrationsAssemblyName { get; set; } - - public IDictionary> ProviderSpecificConfigurations { get; set; } = new Dictionary>(); - - public void ConfigureModel(Action configure) where TDbContext : DbContext - { - ConfigureModel(typeof(TDbContext), configure); - } - - public void ConfigureModel(Type dbContextType, Action configure) - { - if (!ProviderSpecificConfigurations.TryGetValue(dbContextType, out var configurations)) - ProviderSpecificConfigurations[dbContextType] = configurations = _ => { }; - - configurations += configure; - ProviderSpecificConfigurations[dbContextType] = configurations; - } - - public Action GetModelConfigurations(DbContext dbContext) - { - return GetModelConfigurations(dbContext.GetType()); - } - - public Action GetModelConfigurations(Type dbContextType) - { - return ProviderSpecificConfigurations.TryGetValue(dbContextType, out var providerConfigurations) ? providerConfigurations : _ => { }; - } -} \ No newline at end of file diff --git a/src/modules/Elsa.EntityFrameworkCore.Common/ElsaDbContextOptionsExtension.cs b/src/modules/Elsa.EntityFrameworkCore.Common/ElsaDbContextOptionsExtension.cs deleted file mode 100644 index 3bd867eebe..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Common/ElsaDbContextOptionsExtension.cs +++ /dev/null @@ -1,37 +0,0 @@ -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.Extensions.DependencyInjection; - -namespace Elsa.EntityFrameworkCore; - -/// -/// Provides options for configuring Elsa's Entity Framework Core integration. -/// -public class ElsaDbContextOptionsExtension : IDbContextOptionsExtension -{ - /// - /// Initializes a new instance of the class. - /// - /// The options. - public ElsaDbContextOptionsExtension(ElsaDbContextOptions? options) - { - Options = options; - } - - /// - /// Gets the options. - /// - public ElsaDbContextOptions? Options { get; } - - /// - public DbContextOptionsExtensionInfo Info => new CustomDbContextOptionsExtensionInfo(this); - - /// - public void ApplyServices(IServiceCollection services) - { - } - - /// - public void Validate(IDbContextOptions options) - { - } -} \ No newline at end of file diff --git a/src/modules/Elsa.EntityFrameworkCore.Common/ElsaDbContextOptionsExtensions.cs b/src/modules/Elsa.EntityFrameworkCore.Common/ElsaDbContextOptionsExtensions.cs deleted file mode 100644 index c10481f2e0..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Common/ElsaDbContextOptionsExtensions.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System.Reflection; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; - -namespace Elsa.EntityFrameworkCore; - -/// -/// Provides options for configuring Elsa's Entity Framework Core integration. -/// -public static class ElsaDbContextOptionsExtensions -{ - /// - /// Installs a custom extension for Elsa's Entity Framework Core integration. - /// - /// The options builder to install the extension on. - /// The options to install. - public static DbContextOptionsBuilder UseElsaDbContextOptions(this DbContextOptionsBuilder optionsBuilder, ElsaDbContextOptions? options) - { - ((IDbContextOptionsBuilderInfrastructure)optionsBuilder).AddOrUpdateExtension(new ElsaDbContextOptionsExtension(options)); - optionsBuilder.ReplaceService(); - return optionsBuilder; - } - - public static string GetMigrationsAssemblyName(this ElsaDbContextOptions? options, Assembly migrationsAssembly) => options?.MigrationsAssemblyName ?? migrationsAssembly.GetName().Name!; - public static string GetMigrationsHistoryTableName(this ElsaDbContextOptions? options) => options?.MigrationsHistoryTableName ?? ElsaDbContextBase.MigrationsHistoryTable; - public static string GetSchemaName(this ElsaDbContextOptions? options) => options?.SchemaName ?? ElsaDbContextBase.ElsaSchema; -} diff --git a/src/modules/Elsa.EntityFrameworkCore.Common/EntityHandlers/ApplyTenantId.cs b/src/modules/Elsa.EntityFrameworkCore.Common/EntityHandlers/ApplyTenantId.cs deleted file mode 100644 index b55f9af659..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Common/EntityHandlers/ApplyTenantId.cs +++ /dev/null @@ -1,20 +0,0 @@ -using Elsa.Common.Entities; -using Elsa.Extensions; -using Microsoft.EntityFrameworkCore.ChangeTracking; - -namespace Elsa.EntityFrameworkCore.EntityHandlers; - -/// -/// Represents a handler for applying the tenant ID to an entity before saving changes. -/// -public class ApplyTenantId : IEntitySavingHandler -{ - /// - public ValueTask HandleAsync(ElsaDbContextBase dbContext, EntityEntry entry, CancellationToken cancellationToken = default) - { - if (entry.Entity is Entity entity) - entity.TenantId = dbContext.TenantId.NullIfEmpty(); - - return default; - } -} \ No newline at end of file diff --git a/src/modules/Elsa.EntityFrameworkCore.Common/EntityHandlers/SetTenantIdFilter.cs b/src/modules/Elsa.EntityFrameworkCore.Common/EntityHandlers/SetTenantIdFilter.cs deleted file mode 100644 index f4522d7d44..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Common/EntityHandlers/SetTenantIdFilter.cs +++ /dev/null @@ -1,44 +0,0 @@ -using System.Linq.Expressions; -using Elsa.Common.Entities; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata; - -namespace Elsa.EntityFrameworkCore.EntityHandlers; - -/// -/// Represents a class that applies a filter to set the TenantId for entities. -/// -public class SetTenantIdFilter : IEntityModelCreatingHandler -{ - /// - public void Handle(ElsaDbContextBase dbContext, ModelBuilder modelBuilder, IMutableEntityType entityType) - { - if (!typeof(Entity).IsAssignableFrom(entityType.ClrType)) - return; - - modelBuilder - .Entity(entityType.ClrType) - .HasQueryFilter(CreateTenantFilterExpression(dbContext, entityType.ClrType)); - } - - private LambdaExpression CreateTenantFilterExpression(ElsaDbContextBase dbContext, Type clrType) - { - var parameter = Expression.Parameter(clrType, "e"); - - // e => EF.Property(e, "TenantId") == this.TenantId - var tenantIdProperty = Expression.Call( - typeof(EF), - nameof(EF.Property), - [typeof(string)], - parameter, - Expression.Constant("TenantId")); - - var tenantIdOnContext = Expression.Property( - Expression.Constant(dbContext), - nameof(ElsaDbContextBase.TenantId)); - - var body = Expression.Equal(tenantIdProperty, tenantIdOnContext); - - return Expression.Lambda(body, parameter); - } -} \ No newline at end of file diff --git a/src/modules/Elsa.EntityFrameworkCore.Common/EntityStore.cs b/src/modules/Elsa.EntityFrameworkCore.Common/EntityStore.cs deleted file mode 100644 index 4e12d46101..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Common/EntityStore.cs +++ /dev/null @@ -1,43 +0,0 @@ -using Elsa.Common.Entities; -using Microsoft.EntityFrameworkCore; - -namespace Elsa.EntityFrameworkCore; - -/// -/// A generic repository class around EF Core for accessing entities that inherit from . -/// -/// The type of the database context. -/// The type of the entity. -public class EntityStore(IDbContextFactory dbContextFactory, IServiceProvider serviceProvider) - : Store(dbContextFactory, serviceProvider) where TDbContext : DbContext where TEntity : Entity, new() -{ - /// - /// Saves the entity. - /// - /// The entity to save. - /// The cancellation token. - public async Task SaveAsync(TEntity entity, CancellationToken cancellationToken = default) => await SaveAsync(entity, null, cancellationToken); - - /// - /// Saves the entity. - /// - /// The entity to save. - /// The callback to invoke before saving the entity. - /// The cancellation token. - public async Task SaveAsync(TEntity entity, Func? onSaving, CancellationToken cancellationToken = default) => await SaveAsync(entity, x => x.Id, onSaving, cancellationToken); - - /// - /// Saves the specified entities. - /// - /// The entities to save. - /// The cancellation token. - public async Task SaveManyAsync(IEnumerable entities, CancellationToken cancellationToken = default) => await SaveManyAsync(entities, default, cancellationToken); - - /// - /// Saves the specified entities. - /// - /// The entities to save. - /// The callback to invoke before saving the entities. - /// The cancellation token. - public async Task SaveManyAsync(IEnumerable entities, Func? onSaving = default, CancellationToken cancellationToken = default) => await SaveManyAsync(entities, x => x.Id, onSaving, cancellationToken); -} \ No newline at end of file diff --git a/src/modules/Elsa.EntityFrameworkCore.Common/Extensions/BulkUpsertExtensions.cs b/src/modules/Elsa.EntityFrameworkCore.Common/Extensions/BulkUpsertExtensions.cs deleted file mode 100644 index 076b685d3e..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Common/Extensions/BulkUpsertExtensions.cs +++ /dev/null @@ -1,403 +0,0 @@ -using System.Text; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using System.Linq.Expressions; - -// ReSharper disable once CheckNamespace -namespace Elsa.EntityFrameworkCore.Extensions; - -/// -/// Provides extension methods to perform bulk upsert operations for entities -/// in an Entity Framework Core context, supporting multiple database providers. -/// -public static class BulkUpsertExtensions -{ - /// - /// Performs a bulk upsert operation on a list of entities in the specified database context using a key selector. - /// - /// The type of the database context. - /// The type of the entity being upserted. - /// The database context where the bulk upsert operation will be executed. - /// The list of entities to be upserted. - /// An expression used to determine the key for upsert operations. - /// A token to observe while waiting for the operation to complete. - public static async Task BulkUpsertAsync( - this TDbContext dbContext, - IList entities, - Expression> keySelector, - CancellationToken cancellationToken = default) - where TDbContext : DbContext - where TEntity : class, new() - { - await BulkUpsertAsync(dbContext, entities, keySelector, 50, cancellationToken); - } - - /// - /// Performs a bulk upsert operation on a list of entities in the specified database context using a key selector and optional batch size. - /// - /// The type of the database context. - /// The type of the entity being upserted. - /// The database context where the bulk upsert operation will be executed. - /// The list of entities to be upserted. - /// An expression used to determine the key for upsert operations. - /// The size of each batch for processing the upsert operation. Defaults to 50. - /// A token to observe while waiting for the operation to complete. - /// Thrown if the database provider for the context is not supported. - public static async Task BulkUpsertAsync( - this TDbContext dbContext, - IList entities, - Expression> keySelector, - int batchSize = 50, - CancellationToken cancellationToken = default) - where TDbContext : DbContext - where TEntity : class, new() - { - if (entities.Count == 0) - return; - - // Identify the current provider (e.g., "Microsoft.EntityFrameworkCore.SqlServer") - var providerName = dbContext.Database.ProviderName?.ToLowerInvariant() ?? string.Empty; - - // Determine the method for generating SQL based on the provider - Func, Expression>, (string, object[])> generateSql = providerName switch - { - var pn when pn.Contains("sqlserver") => GenerateSqlServerUpsert, - var pn when pn.Contains("sqlite") => GenerateSqliteUpsert, - var pn when pn.Contains("postgres") => GeneratePostgresUpsert, - var pn when pn.Contains("mysql") => GenerateMySqlUpsert, - var pn when pn.Contains("oracle") => GenerateOracleUpsert, - _ => throw new NotSupportedException($"Provider '{providerName}' is not supported.") - }; - - // Loop through batched entities - foreach (var batch in entities.Chunk(batchSize)) - { - // Generate SQL and parameters - var (sql, parameters) = generateSql(dbContext, batch, keySelector); - - await dbContext.Database.ExecuteSqlRawAsync(sql, parameters, cancellationToken); - } - } - - private static (string, object[]) GenerateSqlServerUpsert( - DbContext dbContext, - IList entities, - Expression> keySelector) - where TEntity : class - { - var entityType = dbContext.Model.FindEntityType(typeof(TEntity))!; - var tableName = $"[{entityType.GetSchema()}].[{entityType.GetTableName()}]"; - var storeObject = StoreObjectIdentifier.Table(entityType.GetTableName()!, entityType.GetSchema()); - var props = entityType.GetProperties().ToList(); - var keyProp = entityType.FindProperty(keySelector.GetMemberAccess().Name)!; - var keyColumnName = $"[{keyProp.GetColumnName(storeObject)}]"; - var columnNames = props - .Select(p => $"[{p.GetColumnName(storeObject)}]") - .ToList(); - - var mergeSql = new StringBuilder(); - mergeSql.AppendLine($"MERGE {tableName} AS Target"); - mergeSql.AppendLine("USING (VALUES"); - - var parameters = new List(); - var parameterCount = 0; - - for (var i = 0; i < entities.Count; i++) - { - var entity = entities[i]; - var values = new List(); - - foreach (var property in props) - { - var paramName = $"{{{parameterCount++}}}"; - - // If it's a shadow property, retrieve value via Entry(..).Property(..) - object? value = property.IsShadowProperty() - ? dbContext.Entry(entity).Property(property.Name).CurrentValue - : property.PropertyInfo?.GetValue(entity); - - var converter = property.GetTypeMapping().Converter; - if (converter != null) - value = converter.ConvertToProvider(value)!; - - // Explicitly cast null values for varbinary columns - if (property.GetColumnType().StartsWith("varbinary", StringComparison.OrdinalIgnoreCase) && value is null) - values.Add("CAST(NULL AS varbinary(max))"); // Explicitly cast null - else - values.Add(paramName); - - parameters.Add(value!); - } - - var line = $"({string.Join(", ", values)}){(i < entities.Count - 1 ? "," : string.Empty)}"; - mergeSql.AppendLine(line); - } - - mergeSql.AppendLine($") AS Source ({string.Join(", ", columnNames)})"); - mergeSql.AppendLine($"ON Target.{keyColumnName} = Source.{keyColumnName}"); - mergeSql.AppendLine("WHEN MATCHED THEN"); - mergeSql.AppendLine($" UPDATE SET {string.Join(", ", columnNames.Where(c => c != keyColumnName).Select(c => $"Target.{c} = Source.{c}"))}"); - mergeSql.AppendLine("WHEN NOT MATCHED THEN"); - mergeSql.AppendLine($" INSERT ({string.Join(", ", columnNames)})"); - mergeSql.AppendLine($" VALUES ({string.Join(", ", columnNames.Select(c => $"Source.{c}"))});"); - - return (mergeSql.ToString(), parameters.ToArray()); - } - - private static (string, object[]) GenerateSqliteUpsert( - DbContext dbContext, - IList entities, - Expression> keySelector) - where TEntity : class - { - var entityType = dbContext.Model.FindEntityType(typeof(TEntity))!; - var tableName = entityType.GetTableName(); - var storeObject = StoreObjectIdentifier.Table(tableName!, entityType.GetSchema()); - var props = entityType.GetProperties().ToList(); - var keyProp = entityType.FindProperty(keySelector.GetMemberAccess().Name)!; - var keyColumnName = keyProp.GetColumnName(storeObject); - var columnNames = props - .Select(p => p.GetColumnName(storeObject)!) - .ToList(); - - var sb = new StringBuilder(); - var parameters = new List(); - var parameterCount = 0; - - sb.Append($"INSERT INTO \"{tableName}\" ({string.Join(", ", columnNames.Select(c => $"\"{c}\""))}) VALUES "); - - for (var i = 0; i < entities.Count; i++) - { - var entity = entities[i]; - var placeholders = new List(); - - foreach (var property in props) - { - var paramName = $"{{{parameterCount++}}}"; - - object? value = property.IsShadowProperty() - ? dbContext.Entry(entity).Property(property.Name).CurrentValue - : property.PropertyInfo?.GetValue(entity); - - var converter = property.GetTypeMapping().Converter; - if (converter != null) - value = converter.ConvertToProvider(value); - - placeholders.Add(paramName); - parameters.Add(value); - } - - sb.Append($"({string.Join(", ", placeholders)})"); - if (i < entities.Count - 1) - sb.Append(", "); - } - - sb.AppendLine(); - sb.AppendLine($"ON CONFLICT(\"{keyColumnName}\") DO UPDATE SET"); - - var updateAssignments = columnNames - .Where(c => c != keyColumnName) - .Select(c => $"\"{c}\"=excluded.\"{c}\""); - - sb.AppendLine(string.Join(", ", updateAssignments) + ";"); - - return (sb.ToString(), parameters.ToArray()); - } - - private static (string, object[]) GeneratePostgresUpsert( - DbContext dbContext, - IList entities, - Expression> keySelector) - where TEntity : class - { - var entityType = dbContext.Model.FindEntityType(typeof(TEntity))!; - var tableName = entityType.GetTableName(); - var storeObject = StoreObjectIdentifier.Table(tableName!, entityType.GetSchema()); - - var props = entityType.GetProperties().ToList(); - - var keyProp = entityType.FindProperty(keySelector.GetMemberAccess().Name)!; - var keyColumnName = keyProp.GetColumnName(storeObject); - var columnNames = props - .Select(p => p.GetColumnName(storeObject)!) - .ToList(); - - var sb = new StringBuilder(); - var parameters = new List(); - var parameterCount = 0; - - sb.Append($"INSERT INTO \"{storeObject.Schema}\".\"{storeObject.Name}\" ({string.Join(", ", columnNames.Select(c => $"\"{c}\""))}) VALUES "); - - for (var i = 0; i < entities.Count; i++) - { - var entity = entities[i]; - var placeholders = new List(); - - foreach (var property in props) - { - var paramName = $"{{{parameterCount++}}}"; - - object? value = property.IsShadowProperty() - ? dbContext.Entry(entity).Property(property.Name).CurrentValue - : property.PropertyInfo?.GetValue(entity); - - var converter = property.GetTypeMapping().Converter; - if (converter != null) - value = converter.ConvertToProvider(value); - - placeholders.Add(paramName); - parameters.Add(value); - } - - sb.Append($"({string.Join(", ", placeholders)})"); - if (i < entities.Count - 1) - sb.Append(", "); - } - - sb.AppendLine(); - sb.AppendLine($"ON CONFLICT (\"{keyColumnName}\") DO UPDATE SET"); - - var updateAssignments = columnNames - .Where(c => c != keyColumnName) - .Select(c => $"\"{c}\" = EXCLUDED.\"{c}\""); - - sb.AppendLine(string.Join(", ", updateAssignments) + ";"); - - return (sb.ToString(), parameters.ToArray()); - } - - private static (string, object[]) GenerateMySqlUpsert( - DbContext dbContext, - IList entities, - Expression> keySelector) - where TEntity : class - { - var entityType = dbContext.Model.FindEntityType(typeof(TEntity))!; - var tableName = entityType.GetTableName(); - var storeObject = StoreObjectIdentifier.Table(tableName!, entityType.GetSchema()); - - var props = entityType.GetProperties().ToList(); - - var keyProp = entityType.FindProperty(keySelector.GetMemberAccess().Name)!; - var keyColumnName = keyProp.GetColumnName(storeObject); - var columnNames = props - .Select(p => p.GetColumnName(storeObject)!) - .ToList(); - - var sb = new StringBuilder(); - var parameters = new List(); - var parameterCount = 0; - - sb.Append($"INSERT INTO `{tableName}` ({string.Join(", ", columnNames.Select(c => $"`{c}`"))}) VALUES "); - - for (var i = 0; i < entities.Count; i++) - { - var entity = entities[i]; - var placeholders = new List(); - - foreach (var property in props) - { - var paramName = $"{{{parameterCount++}}}"; - - object? value = property.IsShadowProperty() - ? dbContext.Entry(entity).Property(property.Name).CurrentValue - : property.PropertyInfo?.GetValue(entity); - - var converter = property.GetTypeMapping().Converter; - if (converter != null) - value = converter.ConvertToProvider(value); - - placeholders.Add(paramName); - parameters.Add(value); - } - - sb.Append($"({string.Join(", ", placeholders)})"); - if (i < entities.Count - 1) - sb.Append(", "); - } - - sb.AppendLine(); - sb.AppendLine("ON DUPLICATE KEY UPDATE"); - - var updateAssignments = columnNames - .Where(c => c != keyColumnName) - .Select(c => $"`{c}` = VALUES(`{c}`)"); - - sb.AppendLine(string.Join(", ", updateAssignments) + ";"); - - return (sb.ToString(), parameters.ToArray()); - } - - private static (string, object[]) GenerateOracleUpsert( - DbContext dbContext, - IList entities, - Expression> keySelector) - where TEntity : class - { - var entityType = dbContext.Model.FindEntityType(typeof(TEntity))!; - var schema = entityType.GetSchema(); - var tableName = entityType.GetTableName(); - var storeObject = StoreObjectIdentifier.Table(tableName!, schema); - var fullName = !string.IsNullOrEmpty(schema) ? $"{schema}.{tableName}" : tableName; - - var props = entityType.GetProperties().ToList(); - - var keyProp = entityType.FindProperty(keySelector.GetMemberAccess().Name)!; - var keyColumnName = keyProp.GetColumnName(storeObject); - - var columnNames = props - .Select(p => p.GetColumnName(storeObject)!) - .ToList(); - - var sb = new StringBuilder(); - var parameters = new List(); - var parameterCount = 0; - - sb.AppendLine($"MERGE INTO {fullName} Target"); - sb.AppendLine("USING (SELECT"); - - for (var i = 0; i < entities.Count; i++) - { - var entity = entities[i]; - var lineParts = new List(); - - foreach (var property in props) - { - var paramName = $"{{{parameterCount++}}}"; - - object? value = property.IsShadowProperty() - ? dbContext.Entry(entity).Property(property.Name).CurrentValue - : property.PropertyInfo?.GetValue(entity); - - var converter = property.GetTypeMapping().Converter; - if (converter != null) - value = converter.ConvertToProvider(value); - - parameters.Add(value); - - // Oracle aliases must match the column name - var alias = property.GetColumnName(storeObject); - lineParts.Add($"{paramName} AS {alias}"); - } - - // Comma if not last - var suffix = (i < entities.Count - 1) ? " FROM DUAL UNION ALL SELECT" : " FROM DUAL"; - sb.AppendLine(string.Join(", ", lineParts) + suffix); - } - - sb.AppendLine($") Source ON (Target.{keyColumnName} = Source.{keyColumnName})"); - sb.AppendLine("WHEN MATCHED THEN UPDATE SET"); - - var updateSetClauses = columnNames - .Where(c => c != keyColumnName) - .Select(c => $"Target.{c} = Source.{c}"); - - sb.AppendLine(string.Join(", ", updateSetClauses)); - sb.AppendLine("WHEN NOT MATCHED THEN"); - sb.AppendLine($"INSERT ({string.Join(", ", columnNames)})"); - sb.AppendLine($"VALUES ({string.Join(", ", columnNames.Select(c => $"Source.{c}"))});"); - - return (sb.ToString(), parameters.ToArray()); - } -} \ No newline at end of file diff --git a/src/modules/Elsa.EntityFrameworkCore.Common/Extensions/DatabaseFacadeExtensions.cs b/src/modules/Elsa.EntityFrameworkCore.Common/Extensions/DatabaseFacadeExtensions.cs deleted file mode 100644 index f4fe914a0e..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Common/Extensions/DatabaseFacadeExtensions.cs +++ /dev/null @@ -1,25 +0,0 @@ -using Microsoft.EntityFrameworkCore.Infrastructure; - -// ReSharper disable once CheckNamespace -namespace Elsa.EntityFrameworkCore.Extensions; - -/// -/// Extension methods for the DatabaseFacade class. -/// -public static class DatabaseFacadeExtensions -{ - /// - /// Returns true if the database provider is MySql. - /// - public static bool IsMySql(this DatabaseFacade database) => database.ProviderName == "Pomelo.EntityFrameworkCore.MySql"; - - /// - /// Returns true if the database provider is Oracle. - /// - public static bool IsOracle(this DatabaseFacade database) => database.ProviderName == "Oracle.EntityFrameworkCore"; - - /// - /// Returns true if the database provider is Postgres. - /// - public static bool IsPostgres(this DatabaseFacade database) => database.ProviderName == "Npgsql.EntityFrameworkCore.PostgreSQL"; -} \ No newline at end of file diff --git a/src/modules/Elsa.EntityFrameworkCore.Common/Extensions/ExpressionExtensions.cs b/src/modules/Elsa.EntityFrameworkCore.Common/Extensions/ExpressionExtensions.cs deleted file mode 100644 index d58a320a4c..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Common/Extensions/ExpressionExtensions.cs +++ /dev/null @@ -1,59 +0,0 @@ -using System.Linq.Expressions; -using Elsa.Extensions; - -// ReSharper disable once CheckNamespace -namespace Elsa.EntityFrameworkCore.Extensions; - -/// -/// Provides extension methods for objects. -/// -public static class ExpressionExtensions -{ - /// - /// Builds an expression that checks if the specified property is contained in the specified list of entities. - /// - /// The key selector. - /// The entities. - /// The type of the entity. - /// The expression. - public static Expression> BuildContainsExpression(this Expression> keySelector, IEnumerable entities) where TEntity : class - { - var compiledKeySelector = keySelector.Compile(); - var list = entities.Select(compiledKeySelector).ToList(); - var property = keySelector.GetProperty()!; - var param = Expression.Parameter(typeof(TEntity)); - - var body = Expression.Call( - typeof(Enumerable), - "Contains", - new[] {compiledKeySelector.Method.ReturnType}, - Expression.Constant(list), Expression.Property(param, property)); - - return Expression.Lambda>(body, param); - } - - /// - /// Builds an expression that checks if the specified property is equal to the specified entity's property. - /// - /// The key selector. - /// The entity. - /// The type of the entity. - /// The expression. - public static Expression> BuildEqualsExpression(this Expression> keySelector, TEntity entity) - { - var keyName = keySelector.GetProperty()!.Name; - - // Define parameters for the lambda expression - var parameter = Expression.Parameter(typeof(TEntity), "x"); - var keySelectorLambda = Expression.Lambda>(Expression.Property(parameter, keyName), parameter); - - // Build the expression that compares the keys - var entityKey = keySelectorLambda.Compile()(entity); - var comparison = Expression.Equal(keySelectorLambda.Body, Expression.Constant(entityKey)); - - // Create the final lambda expression that can be used in AnyAsync - var lambda = Expression.Lambda>(comparison, parameter); - - return lambda; - } -} \ No newline at end of file diff --git a/src/modules/Elsa.EntityFrameworkCore.Common/Extensions/PropertyBuilderExtensions.cs b/src/modules/Elsa.EntityFrameworkCore.Common/Extensions/PropertyBuilderExtensions.cs deleted file mode 100644 index 3285ae38e0..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Common/Extensions/PropertyBuilderExtensions.cs +++ /dev/null @@ -1,21 +0,0 @@ -using Elsa.EntityFrameworkCore.Converters; -using Microsoft.EntityFrameworkCore.Metadata.Builders; - -namespace Elsa.EntityFrameworkCore.Extensions; - -public static class PropertyBuilderExtensions { - - /// - /// Serializes field as JSON blob in database. - /// - public static PropertyBuilder HasJsonValueConversion(this PropertyBuilder propertyBuilder) where T : class { - - propertyBuilder - .HasConversion(new JsonValueConverter()) - .Metadata.SetValueComparer(new JsonValueComparer()); - - return propertyBuilder; - - } - -} \ No newline at end of file diff --git a/src/modules/Elsa.EntityFrameworkCore.Common/Extensions/QueryableExtensions.cs b/src/modules/Elsa.EntityFrameworkCore.Common/Extensions/QueryableExtensions.cs deleted file mode 100644 index 11171ace75..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Common/Extensions/QueryableExtensions.cs +++ /dev/null @@ -1,51 +0,0 @@ -using System.Linq.Expressions; -using Elsa.Common.Models; -using JetBrains.Annotations; -using Microsoft.EntityFrameworkCore; - -// ReSharper disable once CheckNamespace -namespace Elsa.EntityFrameworkCore.Extensions; - -/// -/// Provides extensions to . -/// -[PublicAPI] -public static class QueryableExtensions -{ - /// - /// Inserts a list of entities in bulk. - /// - public static async Task BulkInsertAsync(this TDbContext dbContext, IList entities, CancellationToken cancellationToken = default) where TDbContext : DbContext where TEntity : class, new() - { - var set = dbContext.Set(); - - if (entities.Any()) - await set.AddRangeAsync(entities, cancellationToken); - - await dbContext.SaveChangesAsync(cancellationToken); - } - - /// - /// Returns a paged result from the specified query. - /// - public static async Task> PaginateAsync(this IQueryable queryable, Expression> projection, PageArgs? pageArgs = default) - { - var count = await queryable.CountAsync(); - if (pageArgs?.Offset != null) queryable = queryable.Skip(pageArgs.Offset.Value); - if (pageArgs?.Limit != null) queryable = queryable.Take(pageArgs.Limit.Value); - var results = await queryable.Select(projection).ToListAsync(); - return Page.Of(results, count); - } - - /// - /// Returns a paged result from the specified query. - /// - public static async Task> PaginateAsync(this IQueryable queryable, PageArgs? pageArgs = default) - { - var count = await queryable.CountAsync(); - if (pageArgs?.Offset != null) queryable = queryable.Skip(pageArgs.Offset.Value); - if (pageArgs?.Limit != null) queryable = queryable.Take(pageArgs.Limit.Value); - var results = await queryable.ToListAsync(); - return Page.Of(results, count); - } -} \ No newline at end of file diff --git a/src/modules/Elsa.EntityFrameworkCore.Common/Extensions/TenantExtensions.cs b/src/modules/Elsa.EntityFrameworkCore.Common/Extensions/TenantExtensions.cs deleted file mode 100644 index 94a80365e8..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Common/Extensions/TenantExtensions.cs +++ /dev/null @@ -1,11 +0,0 @@ -using Elsa.Common.Multitenancy; - -namespace Elsa.EntityFrameworkCore.Extensions; - -public static class TenantExtensions -{ - public static string? GetConnectionString(this Tenant tenant, string name) - { - return tenant.Configuration.GetSection("ConnectionStrings")[name]; - } -} \ No newline at end of file diff --git a/src/modules/Elsa.EntityFrameworkCore.Common/FodyWeavers.xml b/src/modules/Elsa.EntityFrameworkCore.Common/FodyWeavers.xml deleted file mode 100644 index 00e1d9a1c1..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Common/FodyWeavers.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/src/modules/Elsa.EntityFrameworkCore.Common/JsonValueComparer.cs b/src/modules/Elsa.EntityFrameworkCore.Common/JsonValueComparer.cs deleted file mode 100644 index 5986d7e077..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Common/JsonValueComparer.cs +++ /dev/null @@ -1,57 +0,0 @@ -using System.Text.Json; -using Microsoft.EntityFrameworkCore.ChangeTracking; - -namespace Elsa.EntityFrameworkCore; - -/// -/// Compares two objects. -/// Required to make EF Core change tracking work for complex value converted objects. -/// -/// -/// For objects that implement and , -/// those implementations will be used for cloning and equality. -/// For plain objects, fall back to deep equality comparison using JSON serialization -/// (safe, but inefficient). -/// -public class JsonValueComparer : ValueComparer { - - private static string Json(T instance) { - return JsonSerializer.Serialize(instance); - } - - private static T DoGetSnapshot(T instance) { - - if (instance is ICloneable cloneable) - return (T)cloneable.Clone(); - - var result = (T)JsonSerializer.Deserialize(Json(instance)); - return result; - - } - - private static int DoGetHashCode(T instance) { - - if (instance is IEquatable) - return instance.GetHashCode(); - - return Json(instance).GetHashCode(); - - } - - private static bool DoEquals(T left, T right) { - - if (left is IEquatable equatable) - return equatable.Equals(right); - - var result = Json(left).Equals(Json(right)); - return result; - - } - - public JsonValueComparer() : base( - (t1, t2) => DoEquals(t1, t2), - t => DoGetHashCode(t), - t => DoGetSnapshot(t)) { - } - -} \ No newline at end of file diff --git a/src/modules/Elsa.EntityFrameworkCore.Common/JsonValueConverterHelper.cs b/src/modules/Elsa.EntityFrameworkCore.Common/JsonValueConverterHelper.cs deleted file mode 100644 index b2b69ae66d..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Common/JsonValueConverterHelper.cs +++ /dev/null @@ -1,25 +0,0 @@ -using System.Text.Json; -using Elsa.EntityFrameworkCore.Converters; -using Elsa.Extensions; - -namespace Elsa.EntityFrameworkCore; - -internal static class JsonValueConverterHelper -{ - private static readonly JsonSerializerOptions JsonSerializerOptions = CreateJsonSerializerOptions(); - - public static T Deserialize(string json) where T : class - { - return (string.IsNullOrWhiteSpace(json) ? null : JsonSerializer.Deserialize(json, JsonSerializerOptions))!; - } - - public static string Serialize(T obj) where T : class - { - return (obj == null ? null : JsonSerializer.Serialize(obj, JsonSerializerOptions))!; - } - - private static JsonSerializerOptions CreateJsonSerializerOptions() - { - return new JsonSerializerOptions().WithConverters(new PrimitiveDictionaryConverter()); - } -} \ No newline at end of file diff --git a/src/modules/Elsa.EntityFrameworkCore.Common/PersistenceFeatureBase.cs b/src/modules/Elsa.EntityFrameworkCore.Common/PersistenceFeatureBase.cs deleted file mode 100644 index 1fd3352c03..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Common/PersistenceFeatureBase.cs +++ /dev/null @@ -1,97 +0,0 @@ -using Elsa.Common.Entities; -using Elsa.Extensions; -using Elsa.Features.Abstractions; -using Elsa.Features.Attributes; -using Elsa.Features.Services; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Diagnostics; -using Microsoft.Extensions.DependencyInjection; - -namespace Elsa.EntityFrameworkCore; - -/// -/// Base class for features that require Entity Framework Core. -/// -/// The type of the database context. -/// The type of the feature. -[DependsOn(typeof(CommonPersistenceFeature))] -public abstract class PersistenceFeatureBase(IModule module) : FeatureBase(module) - where TDbContext : ElsaDbContextBase -{ - /// - /// Gets or sets a value indicating whether to use context pooling. - /// - public virtual bool UseContextPooling { get; set; } - - /// - /// Gets or sets a value indicating whether to run migrations. - /// - public virtual bool RunMigrations { get; set; } = true; - - /// - /// Gets or sets the lifetime of the . Defaults to . - /// - public ServiceLifetime DbContextFactoryLifetime { get; set; } = ServiceLifetime.Scoped; - - /// - /// Gets or sets the callback used to configure the . - /// - public virtual Action DbContextOptionsBuilder { get; set; } = null!; - - public override void ConfigureHostedServices() - { - if (RunMigrations) - ConfigureMigrations(); - } - - /// - public override void Apply() - { - if (DbContextOptionsBuilder == null) - throw new InvalidOperationException("The DbContextOptionsBuilder must be configured."); - - Action setup = (sp, opts) => - { - opts.ConfigureWarnings(w => w.Ignore(RelationalEventId.PendingModelChangesWarning)); - DbContextOptionsBuilder(sp, opts); - }; - - if (UseContextPooling) - Services.AddPooledDbContextFactory(setup); - else - Services.AddDbContextFactory(setup, DbContextFactoryLifetime); - - Services.Decorate, TenantAwareDbContextFactory>(); - } - - protected virtual void ConfigureMigrations() - { - Services.AddStartupTask>(); - } - - /// - /// Adds a store to the service collection. - /// - /// The type of the entity. - /// The type of the store. - protected void AddStore() where TEntity : class, new() where TStore : class - { - Services - .AddScoped>() - .AddScoped() - ; - } - - /// - /// Adds an entity store to the service collection. - /// - /// The type of the entity. - /// The type of the store. - protected void AddEntityStore() where TEntity : Entity, new() where TStore : class - { - Services - .AddScoped>() - .AddScoped() - ; - } -} \ No newline at end of file diff --git a/src/modules/Elsa.EntityFrameworkCore.Common/RunMigrationsHostedService.cs b/src/modules/Elsa.EntityFrameworkCore.Common/RunMigrationsHostedService.cs deleted file mode 100644 index 9bd0f1ac62..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Common/RunMigrationsHostedService.cs +++ /dev/null @@ -1,33 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Hosting; - -namespace Elsa.EntityFrameworkCore; - -/// -/// Executes EF Core migrations using the specified type. -/// -public class RunMigrationsHostedService : IHostedService where TDbContext : DbContext -{ - private readonly IServiceScopeFactory _scopeFactory; - - /// - /// Initializes a new instance of the class. - /// - public RunMigrationsHostedService(IServiceScopeFactory scopeFactory) - { - _scopeFactory = scopeFactory; - } - - /// - public async Task StartAsync(CancellationToken cancellationToken) - { - using var scope = _scopeFactory.CreateScope(); - var dbContextFactory = scope.ServiceProvider.GetRequiredService>(); - await using var dbContext = await dbContextFactory.CreateDbContextAsync(cancellationToken); - await dbContext.Database.MigrateAsync(cancellationToken); - } - - /// - public Task StopAsync(CancellationToken cancellationToken) => Task.CompletedTask; -} \ No newline at end of file diff --git a/src/modules/Elsa.EntityFrameworkCore.Common/RunMigrationsStartupTask.cs b/src/modules/Elsa.EntityFrameworkCore.Common/RunMigrationsStartupTask.cs deleted file mode 100644 index 45f9c4a5e9..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Common/RunMigrationsStartupTask.cs +++ /dev/null @@ -1,22 +0,0 @@ -using Elsa.Common; -using Elsa.Common.RecurringTasks; -using JetBrains.Annotations; -using Microsoft.EntityFrameworkCore; - -namespace Elsa.EntityFrameworkCore; - -/// -/// Executes EF Core migrations using the specified type. -/// -[UsedImplicitly] -[SingleNodeTask] -[Order(-100)] -public class RunMigrationsStartupTask(IDbContextFactory dbContextFactory) : IStartupTask where TDbContext : DbContext -{ - /// -/// A generic repository class around EF Core for accessing entities. -/// -/// The type of the database context. -/// The type of the entity. -[PublicAPI] -public class Store(IDbContextFactory dbContextFactory, IServiceProvider serviceProvider) where TDbContext : DbContext where TEntity : class, new() -{ - // ReSharper disable once StaticMemberInGenericType - // Justification: This is a static member that is used to ensure that only one thread can access the database for TEntity at a time. - private static readonly SemaphoreSlim Semaphore = new(1, 1); - - /// - /// Creates a new instance of the database context. - /// - /// The cancellation token. - /// The database context. - public async Task CreateDbContextAsync(CancellationToken cancellationToken = default) => await dbContextFactory.CreateDbContextAsync(cancellationToken); - - /// - /// Adds the specified entity. - /// - /// The entity to add. - /// The cancellation token. - public async Task AddAsync(TEntity entity, CancellationToken cancellationToken = default) - { - await AddAsync(entity, null, cancellationToken); - } - - /// - /// Adds the specified entity. - /// - /// The entity to add. - /// The callback to invoke before adding the entity. - /// The cancellation token. - public async Task AddAsync(TEntity entity, Func? onAdding, CancellationToken cancellationToken = default) - { - await using var dbContext = await CreateDbContextAsync(cancellationToken); - - if (onAdding != null) - await onAdding(dbContext, entity, cancellationToken); - - var set = dbContext.Set(); - await set.AddAsync(entity, cancellationToken); - await dbContext.SaveChangesAsync(cancellationToken); - } - - /// - /// Adds the specified entities. - /// - /// The entities to save. - /// The cancellation token. - public async Task AddManyAsync( - IEnumerable entities, - CancellationToken cancellationToken = default) - { - await AddManyAsync(entities, null, cancellationToken); - } - - /// - /// Adds the specified entities. - /// - /// The entities to save. - /// The callback to invoke before saving the entity. - /// The cancellation token. - public async Task AddManyAsync( - IEnumerable entities, - Func? onSaving = null, - CancellationToken cancellationToken = default) - { - var entityList = entities.ToList(); - - if (entityList.Count == 0) - return; - - await using var dbContext = await CreateDbContextAsync(cancellationToken); - - if (onSaving != null) - { - var savingTasks = entityList.Select(entity => onSaving(dbContext, entity, cancellationToken).AsTask()).ToList(); - await Task.WhenAll(savingTasks); - } - - await dbContext.BulkInsertAsync(entityList, cancellationToken); - } - - /// - /// Saves the entity. - /// - /// The entity to save. - /// The key selector to get the primary key property. - /// The cancellation token. - public async Task SaveAsync(TEntity entity, Expression> keySelector, CancellationToken cancellationToken = default) => await SaveAsync(entity, keySelector, null, cancellationToken); - - /// - /// Saves the entity. - /// - /// The entity to save. - /// The key selector to get the primary key property. - /// The callback to invoke before saving the entity. - /// The cancellation token. - public async Task SaveAsync(TEntity entity, Expression> keySelector, Func? onSaving, CancellationToken cancellationToken = default) - { - await Semaphore.WaitAsync(cancellationToken); // Asynchronous wait - - try - { - await using var dbContext = await CreateDbContextAsync(cancellationToken); - - if (onSaving != null) - await onSaving(dbContext, entity, cancellationToken); - - var set = dbContext.Set(); - var lambda = keySelector.BuildEqualsExpression(entity); - var exists = await set.AnyAsync(lambda, cancellationToken); - set.Entry(entity).State = exists ? EntityState.Modified : EntityState.Added; - await dbContext.SaveChangesAsync(cancellationToken); - } - catch (Exception ex) - { - var handler = serviceProvider.GetService(); - - if (handler != null) - { - var context = new DbUpdateExceptionContext(ex, cancellationToken); - await handler.HandleAsync(context); - } - - throw; - } - finally - { - Semaphore.Release(); - } - } - - /// - /// Saves the specified entities. - /// - /// The entities to save. - /// The key selector to get the primary key property. - /// The cancellation token. - public async Task SaveManyAsync(IEnumerable entities, Expression> keySelector, CancellationToken cancellationToken = default) => await SaveManyAsync(entities, keySelector, null, cancellationToken); - - /// - /// Saves the specified entities. - /// - /// The entities to save. - /// The key selector to get the primary key property. - /// The callback to invoke before saving the entity. - /// The cancellation token. - public async Task SaveManyAsync( - IEnumerable entities, - Expression> keySelector, - Func? onSaving = null, - CancellationToken cancellationToken = default) - { - var entityList = entities.ToList(); - - if (entityList.Count == 0) - return; - - await using var dbContext = await CreateDbContextAsync(cancellationToken); - - if (onSaving != null) - { - var savingTasks = entityList.Select(entity => onSaving(dbContext, entity, cancellationToken).AsTask()).ToList(); - await Task.WhenAll(savingTasks); - } - - // When doing a custom SQL query (Bulk Upsert), none of the installed query filters will be applied. Hence, we are assigning the current tenant ID explicitly. - var tenantId = serviceProvider.GetRequiredService().Tenant?.Id.NullIfEmpty(); - foreach (var entity in entityList) - { - if (entity is Entity entityWithTenant) - entityWithTenant.TenantId = tenantId; - } - - try - { - await dbContext.BulkUpsertAsync(entityList, keySelector, cancellationToken); - } - catch (Exception ex) - { - var handler = serviceProvider.GetService(); - - if (handler != null) - { - var context = new DbUpdateExceptionContext(ex, cancellationToken); - await handler.HandleAsync(context); - } - - throw; - } - } - - /// - /// Updates the entity. - /// - /// The entity to update. - /// The cancellation token. - public Task UpdateAsync(TEntity entity, CancellationToken cancellationToken = default) - { - return UpdateAsync(entity, null, cancellationToken); - } - - /// - /// Updates the entity. - /// - /// The entity to update. - /// The callback to invoke before saving the entity. - /// The cancellation token. - public async Task UpdateAsync(TEntity entity, Func? onSaving, CancellationToken cancellationToken = default) - { - await using var dbContext = await CreateDbContextAsync(cancellationToken); - - if (onSaving != null) - await onSaving(dbContext, entity, cancellationToken); - - var set = dbContext.Set(); - set.Entry(entity).State = EntityState.Modified; - await dbContext.SaveChangesAsync(cancellationToken); - } - - /// - /// Updates specific properties of an entity in the database. - /// - /// The entity to update. - /// An array of expressions indicating the properties to update. - /// The cancellation token. - /// A task that represents the asynchronous operation. - public async Task UpdatePartialAsync(TEntity entity, Expression>[] properties, CancellationToken cancellationToken = default) - { - await using var dbContext = await CreateDbContextAsync(cancellationToken); - dbContext.Attach(entity); - - foreach (var property in properties) - dbContext.Entry(entity).Property(property).IsModified = true; - - await dbContext.SaveChangesAsync(cancellationToken); - } - - /// - /// Finds the entity matching the specified predicate. - /// - /// The predicate to use. - /// The cancellation token. - /// The entity if found, otherwise null. - public async Task FindAsync(Expression> predicate, CancellationToken cancellationToken = default) => await FindAsync(predicate, null, cancellationToken); - - /// - /// Finds the entity matching the specified predicate. - /// - /// The predicate to use. - /// A callback to run after the entity is loaded - /// The cancellation token. - /// - public async Task FindAsync(Expression> predicate, Func? onLoading = null, CancellationToken cancellationToken = default) - { - await using var dbContext = await CreateDbContextAsync(cancellationToken); - var set = dbContext.Set().AsNoTracking(); - var entity = await set.FirstOrDefaultAsync(predicate, cancellationToken); - - if (entity == null) - return null; - - if (onLoading != null) - entity = onLoading.Invoke(dbContext, entity); - - return entity; - } - - /// - /// Finds a single entity using a query - /// - /// The query to use - /// A callback to run after the entity is loaded - /// The cancellation token - /// The entity if found, otherwise null - public async Task FindAsync(Func, IQueryable> query, Func? onLoading = null, CancellationToken cancellationToken = default) - { - return await FindAsync(query, onLoading, false, cancellationToken); - } - - /// - /// Finds a single entity using a query - /// - /// The query to use - /// A callback to run after the entity is loaded - /// Define is the request should be tenant agnostic or not - /// The cancellation token - /// The entity if found, otherwise null - public async Task FindAsync(Func, IQueryable> query, Func? onLoading = null, bool tenantAgnostic = false, CancellationToken cancellationToken = default) - { - return await QueryAsync(query, onLoading, tenantAgnostic, cancellationToken).FirstOrDefault(); - } - - /// - /// Finds a single entity using a query - /// - /// The query to use - /// The cancellation token - /// The entity if found, otherwise null - public async Task FindAsync(Func, IQueryable> query, CancellationToken cancellationToken = default) - { - return await FindAsync(query, false, cancellationToken); - } - - /// - /// Finds a single entity using a query - /// - /// The query to use - /// Define is the request should be tenant agnostic or not - /// The cancellation token - /// The entity if found, otherwise null - public async Task FindAsync(Func, IQueryable> query, bool tenantAgnostic = false, CancellationToken cancellationToken = default) - { - return await QueryAsync(query, tenantAgnostic, cancellationToken).FirstOrDefault(); - } - - /// - /// Finds a list of entities using a query - /// - public async Task> FindManyAsync(Expression> predicate, CancellationToken cancellationToken = default) => await FindManyAsync(predicate, null, cancellationToken); - - /// - /// Finds a list of entities using a query - /// - public async Task> FindManyAsync(Expression> predicate, Action? onLoading = null, CancellationToken cancellationToken = default) - { - await using var dbContext = await CreateDbContextAsync(cancellationToken); - var set = dbContext.Set().AsNoTracking(); - var entities = await set.Where(predicate).ToListAsync(cancellationToken); - - if (onLoading != null) - foreach (var entity in entities) - onLoading(dbContext, entity); - - return entities; - } - - /// - /// Finds a list of entities using a query - /// - public async Task> FindManyAsync( - Expression> predicate, - Expression> orderBy, - OrderDirection orderDirection = OrderDirection.Ascending, - PageArgs? pageArgs = null, - CancellationToken cancellationToken = default) => - await FindManyAsync(predicate, orderBy, orderDirection, pageArgs, null, cancellationToken); - - /// - /// Returns a list of entities using a query - /// - public async Task> FindManyAsync( - Expression>? predicate, - Expression>? orderBy, - OrderDirection orderDirection = OrderDirection.Ascending, - PageArgs? pageArgs = null, - Func? onLoading = null, - CancellationToken cancellationToken = default) - { - await using var dbContext = await CreateDbContextAsync(cancellationToken); - var set = dbContext.Set().AsNoTracking(); - - if (predicate != null) - set = set.Where(predicate); - - if (orderBy != null) - set = orderDirection switch - { - OrderDirection.Ascending => set.OrderBy(orderBy), - OrderDirection.Descending => set.OrderByDescending(orderBy), - _ => set.OrderBy(orderBy) - }; - - var page = await set.PaginateAsync(pageArgs); - - if (onLoading != null) - page = page with - { - Items = page.Items.Select(x => onLoading(dbContext, x)!).ToList() - }; - - return page; - } - - public Task> ListAsync(CancellationToken cancellationToken = default) - { - return ListAsync(null, cancellationToken); - } - - public async Task> ListAsync(Action? onLoading = null, CancellationToken cancellationToken = default) - { - await using var dbContext = await CreateDbContextAsync(cancellationToken); - var set = dbContext.Set().AsNoTracking(); - var entities = await set.ToListAsync(cancellationToken); - - if (onLoading != null) - foreach (var entity in entities) - onLoading(dbContext, entity); - - return entities; - } - - /// - /// Finds a single entity using a query. - /// - /// True if the entity was found, otherwise false. - public async Task DeleteAsync(TEntity entity, CancellationToken cancellationToken = default) - { - await using var dbContext = await CreateDbContextAsync(cancellationToken); - var set = dbContext.Set(); - set.Attach(entity).State = EntityState.Deleted; - return await dbContext.SaveChangesAsync(cancellationToken) == 1; - } - - /// - /// Deletes entities using a predicate. - /// - /// The number of entities deleted. - public async Task DeleteWhereAsync(Expression> predicate, CancellationToken cancellationToken = default) - { - await using var dbContext = await CreateDbContextAsync(cancellationToken); - var set = dbContext.Set().AsNoTracking(); - return await set.Where(predicate).ExecuteDeleteAsync(cancellationToken); - } - - /// - /// Deletes entities using a query. - /// - /// The number of entities deleted. - public async Task DeleteWhereAsync(Func, IQueryable> query, CancellationToken cancellationToken = default) - { - await using var dbContext = await CreateDbContextAsync(cancellationToken); - var set = dbContext.Set().AsNoTracking(); - var queryable = query(set.AsQueryable()); - return await queryable.ExecuteDeleteAsync(cancellationToken); - } - - /// - /// Queries the database using a query. - /// - public async Task> QueryAsync(Func, IQueryable> query, CancellationToken cancellationToken = default) - { - return await QueryAsync(query, null, false, cancellationToken); - } - - /// - /// Queries the database using a query. - /// - public async Task> QueryAsync(Func, IQueryable> query, bool tenantAgnostic, CancellationToken cancellationToken = default) - { - return await QueryAsync(query, null, tenantAgnostic, cancellationToken); - } - - /// - /// Queries the database using a query and a selector. - /// - public async Task> QueryAsync(Func, IQueryable> query, Func? onLoading = null, CancellationToken cancellationToken = default) - { - return await QueryAsync(query, onLoading, false, cancellationToken); - } - - /// - /// Queries the database using a query and a selector. - /// - public async Task> QueryAsync(Func, IQueryable> query, Func? onLoading = null, bool ignoreQueryFilters = false, CancellationToken cancellationToken = default) - { - await using var dbContext = await CreateDbContextAsync(cancellationToken); - var asNoTracking = onLoading == null; - var set = asNoTracking ? dbContext.Set().AsNoTracking() : dbContext.Set(); - var queryable = query(set.AsQueryable()); - - if (ignoreQueryFilters) - queryable = queryable.IgnoreQueryFilters(); - - var entities = await queryable.ToListAsync(cancellationToken); - - if (onLoading != null) - { - var loadingTasks = entities.Select(entity => onLoading(dbContext, entity, cancellationToken).AsTask()).ToList(); - await Task.WhenAll(loadingTasks); - } - - return entities; - } - - /// - /// Queries the database using a query and a selector. - /// - public async Task> QueryAsync(Func, IQueryable> query, Expression> selector, CancellationToken cancellationToken = default) - { - return await QueryAsync(query, selector, false, cancellationToken); - } - - /// - /// Queries the database using a query and a selector. - /// - public async Task> QueryAsync(Func, IQueryable> query, Expression> selector, bool ignoreQueryFilters = false, CancellationToken cancellationToken = default) - { - await using var dbContext = await CreateDbContextAsync(cancellationToken); - var set = dbContext.Set().AsNoTracking(); - var queryable = query(set.AsQueryable()); - - if (ignoreQueryFilters) - queryable = queryable.IgnoreQueryFilters(); - - queryable = query(queryable); - return await queryable.Select(selector).ToListAsync(cancellationToken); - } - - /// - /// Counts the number of entities matching a query. - /// - public async Task CountAsync(Func, IQueryable> query, CancellationToken cancellationToken = default) - { - return await CountAsync(query, false, cancellationToken); - } - - /// - /// Counts the number of entities matching a query. - /// - public async Task CountAsync(Func, IQueryable> query, bool ignoreQueryFilters = false, CancellationToken cancellationToken = default) - { - await using var dbContext = await CreateDbContextAsync(cancellationToken); - var set = dbContext.Set().AsNoTracking(); - var queryable = query(set.AsQueryable()); - - if (ignoreQueryFilters) - queryable = queryable.IgnoreQueryFilters(); - - queryable = query(queryable); - return await queryable.LongCountAsync(cancellationToken: cancellationToken); - } - - /// - /// Checks if any entities exist. - /// - public async Task AnyAsync(Expression> predicate, CancellationToken cancellationToken = default) - { - return await AnyAsync(predicate, false, cancellationToken); - } - - /// - /// Checks if any entities exist. - /// - public async Task AnyAsync(Expression> predicate, bool ignoreQueryFilters = false, CancellationToken cancellationToken = default) - { - await using var dbContext = await CreateDbContextAsync(cancellationToken); - var set = dbContext.Set().AsNoTracking(); - return await set.AnyAsync(predicate, cancellationToken); - } - - /// - /// Counts the number of entities matching a predicate. - /// - /// The predicate. - /// The cancellation token. - public async Task CountAsync(Expression> predicate, CancellationToken cancellationToken = default) - { - return await CountAsync(predicate, false, cancellationToken); - } - - /// - /// Counts the number of entities matching a predicate. - /// - /// The predicate. - /// Whether to ignore query filters. - /// The cancellation token. - public async Task CountAsync(Expression> predicate, bool ignoreQueryFilters = false, CancellationToken cancellationToken = default) - { - await using var dbContext = await CreateDbContextAsync(cancellationToken); - var queryable = dbContext.Set().AsNoTracking(); - - if (ignoreQueryFilters) - queryable = queryable.IgnoreQueryFilters(); - - return await queryable.CountAsync(predicate, cancellationToken); - } - - /// - /// Counts the distinct number of entities matching a predicate. - /// - /// The predicate. - /// The property selector to distinct by. - /// The cancellation token. - public async Task CountAsync(Expression> predicate, Expression> propertySelector, CancellationToken cancellationToken = default) - { - return await CountAsync(predicate, propertySelector, false, cancellationToken); - } - - /// - /// Counts the distinct number of entities matching a predicate. - /// - /// The predicate. - /// The property selector to distinct by. - /// Whether to ignore query filters. - /// The cancellation token. - public async Task CountAsync(Expression> predicate, Expression> propertySelector, bool ignoreQueryFilters = false, CancellationToken cancellationToken = default) - { - await using var dbContext = await CreateDbContextAsync(cancellationToken); - var queryable = dbContext.Set().AsNoTracking(); - - if (ignoreQueryFilters) - queryable = queryable.IgnoreQueryFilters(); - - return await queryable - .Where(predicate) - .Select(propertySelector) - .Distinct() - .CountAsync(cancellationToken); - } -} \ No newline at end of file diff --git a/src/modules/Elsa.EntityFrameworkCore.Common/TenantAwareDbContextFactory.cs b/src/modules/Elsa.EntityFrameworkCore.Common/TenantAwareDbContextFactory.cs deleted file mode 100644 index 710ae0b2d4..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Common/TenantAwareDbContextFactory.cs +++ /dev/null @@ -1,37 +0,0 @@ -using Elsa.Common.Multitenancy; -using Elsa.Extensions; -using JetBrains.Annotations; -using Microsoft.EntityFrameworkCore; - -namespace Elsa.EntityFrameworkCore; - -/// -/// A factory class that wraps and extends the functionality of an existing -/// to provide multi-tenancy support. This ensures that the created DbContext instances are aware of the current tenant context. -/// -[UsedImplicitly] -public class TenantAwareDbContextFactory( - IDbContextFactory decoratedFactory, - ITenantAccessor tenantAccessor) : IDbContextFactory - where TDbContext : DbContext -{ - public TDbContext CreateDbContext() - { - var context = decoratedFactory.CreateDbContext(); - SetTenantId(context); - return context; - } - - public async Task CreateDbContextAsync(CancellationToken cancellationToken = default) - { - var context = await decoratedFactory.CreateDbContextAsync(cancellationToken); - SetTenantId(context); - return context; - } - - private void SetTenantId(TDbContext context) - { - if (context is ElsaDbContextBase elsaContext) - elsaContext.TenantId = tenantAccessor.Tenant?.Id.NullIfEmpty(); - } -} \ No newline at end of file diff --git a/src/modules/Elsa.EntityFrameworkCore.MySql/DbContextFactories.cs b/src/modules/Elsa.EntityFrameworkCore.MySql/DbContextFactories.cs deleted file mode 100644 index 8fbca190ed..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.MySql/DbContextFactories.cs +++ /dev/null @@ -1,40 +0,0 @@ -using Elsa.EntityFrameworkCore.Abstractions; -using Elsa.EntityFrameworkCore.Extensions; -using Elsa.EntityFrameworkCore.Modules.Alterations; -using Elsa.EntityFrameworkCore.Modules.Identity; -using Elsa.EntityFrameworkCore.Modules.Labels; -using Elsa.EntityFrameworkCore.Modules.Management; -using Elsa.EntityFrameworkCore.Modules.Runtime; -using Elsa.EntityFrameworkCore.Modules.Tenants; -using JetBrains.Annotations; -using Microsoft.EntityFrameworkCore; - -#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member - -namespace Elsa.EntityFrameworkCore.MySql; - -[UsedImplicitly] -public class IdentityDbContextFactory : MySqlDesignTimeDbContextFactory; - -[UsedImplicitly] -public class ManagementDbContextFactory : MySqlDesignTimeDbContextFactory; - -[UsedImplicitly] -public class RuntimeDbContextFactory : MySqlDesignTimeDbContextFactory; - -[UsedImplicitly] -public class LabelsDbContextFactory : MySqlDesignTimeDbContextFactory; - -[UsedImplicitly] -public class AlterationsDbContextFactories : MySqlDesignTimeDbContextFactory; - -[UsedImplicitly] -public class TenantsDbContextFactories : MySqlDesignTimeDbContextFactory; - -public class MySqlDesignTimeDbContextFactory : DesignTimeDbContextFactoryBase where TDbContext : DbContext -{ - protected override void ConfigureBuilder(DbContextOptionsBuilder builder, string connectionString) - { - builder.UseElsaMySql(GetType().Assembly, connectionString, serverVersion: ServerVersion.Parse("9.0.0")); - } -} \ No newline at end of file diff --git a/src/modules/Elsa.EntityFrameworkCore.MySql/DbContextOptionsBuilder.cs b/src/modules/Elsa.EntityFrameworkCore.MySql/DbContextOptionsBuilder.cs deleted file mode 100644 index 403d09f775..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.MySql/DbContextOptionsBuilder.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System.Reflection; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Pomelo.EntityFrameworkCore.MySql.Infrastructure; - -// ReSharper disable once CheckNamespace -namespace Elsa.EntityFrameworkCore.Extensions; - -/// -/// Contains extension methods for . -/// -public static class DbContextOptionsBuilderExtensions -{ - /// - /// Configures Entity Framework Core with MySQL. - /// - public static DbContextOptionsBuilder UseElsaMySql(this DbContextOptionsBuilder builder, - Assembly migrationsAssembly, - string connectionString, - ElsaDbContextOptions? options = null, - ServerVersion? serverVersion = null, - Action? configure = null) => - builder - .UseElsaDbContextOptions(options) - .UseMySql(connectionString, serverVersion ?? ServerVersion.AutoDetect(connectionString), db => - { - db - .MigrationsAssembly(options.GetMigrationsAssemblyName(migrationsAssembly)) - .MigrationsHistoryTable(options.GetMigrationsHistoryTableName(), options.GetSchemaName()) - .SchemaBehavior(MySqlSchemaBehavior.Ignore) - .EnablePrimitiveCollectionsSupport() -#if NET9_0 - .TranslateParameterizedCollectionsToConstants() -#endif - ; - - configure?.Invoke(db); - }); -} \ No newline at end of file diff --git a/src/modules/Elsa.EntityFrameworkCore.MySql/Elsa.EntityFrameworkCore.MySql.csproj b/src/modules/Elsa.EntityFrameworkCore.MySql/Elsa.EntityFrameworkCore.MySql.csproj deleted file mode 100644 index 97efa0a73d..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.MySql/Elsa.EntityFrameworkCore.MySql.csproj +++ /dev/null @@ -1,20 +0,0 @@ - - - - net8.0;net9.0 - - Provides MySQL EF Core migrations for various modules. - - elsa module persistence efcore mysql - - - - - - - - - - - - \ No newline at end of file diff --git a/src/modules/Elsa.EntityFrameworkCore.MySql/FodyWeavers.xml b/src/modules/Elsa.EntityFrameworkCore.MySql/FodyWeavers.xml deleted file mode 100644 index 00e1d9a1c1..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.MySql/FodyWeavers.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Alterations/20231015122151_Initial.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Alterations/20231015122151_Initial.Designer.cs deleted file mode 100644 index 9dcb708d85..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Alterations/20231015122151_Initial.Designer.cs +++ /dev/null @@ -1,119 +0,0 @@ -// -using System; -using Elsa.EntityFrameworkCore.Modules.Alterations; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.MySql.Migrations.Alterations -{ - [DbContext(typeof(AlterationsElsaDbContext))] - [Migration("20231015122151_Initial")] - partial class Initial - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "7.0.11") - .HasAnnotation("Relational:MaxIdentifierLength", 64); - - modelBuilder.Entity("Elsa.Alterations.Core.Entities.AlterationJob", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("CompletedAt") - .HasColumnType("datetime(6)"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)"); - - b.Property("PlanId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("SerializedLog") - .HasColumnType("longtext"); - - b.Property("StartedAt") - .HasColumnType("datetime(6)"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("CompletedAt") - .HasDatabaseName("IX_AlterationJob_CompletedAt"); - - b.HasIndex("CreatedAt") - .HasDatabaseName("IX_AlterationJob_CreatedAt"); - - b.HasIndex("PlanId") - .HasDatabaseName("IX_AlterationJob_PlanId"); - - b.HasIndex("StartedAt") - .HasDatabaseName("IX_AlterationJob_StartedAt"); - - b.HasIndex("Status") - .HasDatabaseName("IX_AlterationJob_Status"); - - b.HasIndex("WorkflowInstanceId") - .HasDatabaseName("IX_AlterationJob_WorkflowInstanceId"); - - b.ToTable("AlterationJobs", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Alterations.Core.Entities.AlterationPlan", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("CompletedAt") - .HasColumnType("datetime(6)"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)"); - - b.Property("SerializedAlterations") - .HasColumnType("longtext"); - - b.Property("SerializedWorkflowInstanceIds") - .HasColumnType("longtext"); - - b.Property("StartedAt") - .HasColumnType("datetime(6)"); - - b.Property("Status") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CompletedAt") - .HasDatabaseName("IX_AlterationPlan_CompletedAt"); - - b.HasIndex("CreatedAt") - .HasDatabaseName("IX_AlterationPlan_CreatedAt"); - - b.HasIndex("StartedAt") - .HasDatabaseName("IX_AlterationPlan_StartedAt"); - - b.HasIndex("Status") - .HasDatabaseName("IX_AlterationPlan_Status"); - - b.ToTable("AlterationPlans", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Alterations/20231015122151_Initial.cs b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Alterations/20231015122151_Initial.cs deleted file mode 100644 index 7af01b49b7..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Alterations/20231015122151_Initial.cs +++ /dev/null @@ -1,144 +0,0 @@ - -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.MySql.Migrations.Alterations -{ - /// - public partial class Initial : Migration - { - private readonly IElsaDbContextSchema _schema; - public Initial(IElsaDbContextSchema schema) - { - _schema = schema ?? throw new ArgumentNullException(nameof(schema)); - } - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.EnsureSchema( - name: _schema.Schema); - - migrationBuilder.AlterDatabase() - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateTable( - name: "AlterationJobs", - schema: _schema.Schema, - columns: table => new - { - Id = table.Column(type: "varchar(255)", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - PlanId = table.Column(type: "varchar(255)", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - WorkflowInstanceId = table.Column(type: "varchar(255)", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - Status = table.Column(type: "int", nullable: false), - CreatedAt = table.Column(type: "datetime(6)", nullable: false), - StartedAt = table.Column(type: "datetime(6)", nullable: true), - CompletedAt = table.Column(type: "datetime(6)", nullable: true), - SerializedLog = table.Column(type: "longtext", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4") - }, - constraints: table => - { - table.PrimaryKey("PK_AlterationJobs", x => x.Id); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateTable( - name: "AlterationPlans", - schema: _schema.Schema, - columns: table => new - { - Id = table.Column(type: "varchar(255)", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - Status = table.Column(type: "int", nullable: false), - CreatedAt = table.Column(type: "datetime(6)", nullable: false), - StartedAt = table.Column(type: "datetime(6)", nullable: true), - CompletedAt = table.Column(type: "datetime(6)", nullable: true), - SerializedAlterations = table.Column(type: "longtext", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - SerializedWorkflowInstanceIds = table.Column(type: "longtext", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4") - }, - constraints: table => - { - table.PrimaryKey("PK_AlterationPlans", x => x.Id); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateIndex( - name: "IX_AlterationJob_CompletedAt", - schema: _schema.Schema, - table: "AlterationJobs", - column: "CompletedAt"); - - migrationBuilder.CreateIndex( - name: "IX_AlterationJob_CreatedAt", - schema: _schema.Schema, - table: "AlterationJobs", - column: "CreatedAt"); - - migrationBuilder.CreateIndex( - name: "IX_AlterationJob_PlanId", - schema: _schema.Schema, - table: "AlterationJobs", - column: "PlanId"); - - migrationBuilder.CreateIndex( - name: "IX_AlterationJob_StartedAt", - schema: _schema.Schema, - table: "AlterationJobs", - column: "StartedAt"); - - migrationBuilder.CreateIndex( - name: "IX_AlterationJob_Status", - schema: _schema.Schema, - table: "AlterationJobs", - column: "Status"); - - migrationBuilder.CreateIndex( - name: "IX_AlterationJob_WorkflowInstanceId", - schema: _schema.Schema, - table: "AlterationJobs", - column: "WorkflowInstanceId"); - - migrationBuilder.CreateIndex( - name: "IX_AlterationPlan_CompletedAt", - schema: _schema.Schema, - table: "AlterationPlans", - column: "CompletedAt"); - - migrationBuilder.CreateIndex( - name: "IX_AlterationPlan_CreatedAt", - schema: _schema.Schema, - table: "AlterationPlans", - column: "CreatedAt"); - - migrationBuilder.CreateIndex( - name: "IX_AlterationPlan_StartedAt", - schema: _schema.Schema, - table: "AlterationPlans", - column: "StartedAt"); - - migrationBuilder.CreateIndex( - name: "IX_AlterationPlan_Status", - schema: _schema.Schema, - table: "AlterationPlans", - column: "Status"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "AlterationJobs", - schema: _schema.Schema); - - migrationBuilder.DropTable( - name: "AlterationPlans", - schema: _schema.Schema); - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Alterations/20240329200618_V3_1.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Alterations/20240329200618_V3_1.Designer.cs deleted file mode 100644 index df3478e064..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Alterations/20240329200618_V3_1.Designer.cs +++ /dev/null @@ -1,121 +0,0 @@ -// -using System; -using Elsa.EntityFrameworkCore.Modules.Alterations; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.MySql.Migrations.Alterations -{ - [DbContext(typeof(AlterationsElsaDbContext))] - [Migration("20240329200618_V3_1")] - partial class V3_1 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "7.0.14") - .HasAnnotation("Relational:MaxIdentifierLength", 64); - - modelBuilder.Entity("Elsa.Alterations.Core.Entities.AlterationJob", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("CompletedAt") - .HasColumnType("datetime(6)"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)"); - - b.Property("PlanId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("SerializedLog") - .HasColumnType("longtext"); - - b.Property("StartedAt") - .HasColumnType("datetime(6)"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("CompletedAt") - .HasDatabaseName("IX_AlterationJob_CompletedAt"); - - b.HasIndex("CreatedAt") - .HasDatabaseName("IX_AlterationJob_CreatedAt"); - - b.HasIndex("PlanId") - .HasDatabaseName("IX_AlterationJob_PlanId"); - - b.HasIndex("StartedAt") - .HasDatabaseName("IX_AlterationJob_StartedAt"); - - b.HasIndex("Status") - .HasDatabaseName("IX_AlterationJob_Status"); - - b.HasIndex("WorkflowInstanceId") - .HasDatabaseName("IX_AlterationJob_WorkflowInstanceId"); - - b.ToTable("AlterationJobs", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Alterations.Core.Entities.AlterationPlan", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("CompletedAt") - .HasColumnType("datetime(6)"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)"); - - b.Property("SerializedAlterations") - .HasColumnType("longtext"); - - b.Property("SerializedWorkflowInstanceFilter") - .HasColumnType("longtext"); - - b.Property("StartedAt") - .HasColumnType("datetime(6)"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("CompletedAt") - .HasDatabaseName("IX_AlterationPlan_CompletedAt"); - - b.HasIndex("CreatedAt") - .HasDatabaseName("IX_AlterationPlan_CreatedAt"); - - b.HasIndex("StartedAt") - .HasDatabaseName("IX_AlterationPlan_StartedAt"); - - b.HasIndex("Status") - .HasDatabaseName("IX_AlterationPlan_Status"); - - b.ToTable("AlterationPlans", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Alterations/20240329200618_V3_1.cs b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Alterations/20240329200618_V3_1.cs deleted file mode 100644 index 56b1865c06..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Alterations/20240329200618_V3_1.cs +++ /dev/null @@ -1,78 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.MySql.Migrations.Alterations -{ - /// - public partial class V3_1 : Migration - { - private readonly IElsaDbContextSchema _schema; - - /// - public V3_1(IElsaDbContextSchema schema) - { - _schema = schema; - } - - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.RenameColumn( - name: "SerializedWorkflowInstanceIds", - schema: _schema.Schema, - table: "AlterationPlans", - newName: "SerializedWorkflowInstanceFilter"); - - migrationBuilder.AlterColumn( - name: "Status", - schema: _schema.Schema, - table: "AlterationPlans", - type: "varchar(255)", - nullable: false, - oldClrType: typeof(int), - oldType: "int") - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.AlterColumn( - name: "Status", - schema: _schema.Schema, - table: "AlterationJobs", - type: "varchar(255)", - nullable: false, - oldClrType: typeof(int), - oldType: "int") - .Annotation("MySql:CharSet", "utf8mb4"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.RenameColumn( - name: "SerializedWorkflowInstanceFilter", - schema: _schema.Schema, - table: "AlterationPlans", - newName: "SerializedWorkflowInstanceIds"); - - migrationBuilder.AlterColumn( - name: "Status", - schema: _schema.Schema, - table: "AlterationPlans", - type: "int", - nullable: false, - oldClrType: typeof(string), - oldType: "varchar(255)") - .OldAnnotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.AlterColumn( - name: "Status", - schema: _schema.Schema, - table: "AlterationJobs", - type: "int", - nullable: false, - oldClrType: typeof(string), - oldType: "varchar(255)") - .OldAnnotation("MySql:CharSet", "utf8mb4"); - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Alterations/20240610184517_V3_2.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Alterations/20240610184517_V3_2.Designer.cs deleted file mode 100644 index ed6e592156..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Alterations/20240610184517_V3_2.Designer.cs +++ /dev/null @@ -1,121 +0,0 @@ -// -using System; -using Elsa.EntityFrameworkCore.Modules.Alterations; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.MySql.Migrations.Alterations -{ - [DbContext(typeof(AlterationsElsaDbContext))] - [Migration("20240610184517_V3_2")] - partial class V3_2 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "7.0.20") - .HasAnnotation("Relational:MaxIdentifierLength", 64); - - modelBuilder.Entity("Elsa.Alterations.Core.Entities.AlterationJob", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("CompletedAt") - .HasColumnType("datetime(6)"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)"); - - b.Property("PlanId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("SerializedLog") - .HasColumnType("longtext"); - - b.Property("StartedAt") - .HasColumnType("datetime(6)"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("CompletedAt") - .HasDatabaseName("IX_AlterationJob_CompletedAt"); - - b.HasIndex("CreatedAt") - .HasDatabaseName("IX_AlterationJob_CreatedAt"); - - b.HasIndex("PlanId") - .HasDatabaseName("IX_AlterationJob_PlanId"); - - b.HasIndex("StartedAt") - .HasDatabaseName("IX_AlterationJob_StartedAt"); - - b.HasIndex("Status") - .HasDatabaseName("IX_AlterationJob_Status"); - - b.HasIndex("WorkflowInstanceId") - .HasDatabaseName("IX_AlterationJob_WorkflowInstanceId"); - - b.ToTable("AlterationJobs", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Alterations.Core.Entities.AlterationPlan", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("CompletedAt") - .HasColumnType("datetime(6)"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)"); - - b.Property("SerializedAlterations") - .HasColumnType("longtext"); - - b.Property("SerializedWorkflowInstanceFilter") - .HasColumnType("longtext"); - - b.Property("StartedAt") - .HasColumnType("datetime(6)"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("CompletedAt") - .HasDatabaseName("IX_AlterationPlan_CompletedAt"); - - b.HasIndex("CreatedAt") - .HasDatabaseName("IX_AlterationPlan_CreatedAt"); - - b.HasIndex("StartedAt") - .HasDatabaseName("IX_AlterationPlan_StartedAt"); - - b.HasIndex("Status") - .HasDatabaseName("IX_AlterationPlan_Status"); - - b.ToTable("AlterationPlans", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Alterations/20240610184517_V3_2.cs b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Alterations/20240610184517_V3_2.cs deleted file mode 100644 index ca400108fe..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Alterations/20240610184517_V3_2.cs +++ /dev/null @@ -1,30 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.MySql.Migrations.Alterations -{ - /// - public partial class V3_2 : Migration - { - private readonly IElsaDbContextSchema _schema; - - /// - public V3_2(IElsaDbContextSchema schema) - { - _schema = schema; - } - - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Alterations/20241212211458_V3_3.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Alterations/20241212211458_V3_3.Designer.cs deleted file mode 100644 index 3084a0e3b9..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Alterations/20241212211458_V3_3.Designer.cs +++ /dev/null @@ -1,133 +0,0 @@ -// -using System; -using Elsa.EntityFrameworkCore.Modules.Alterations; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.MySql.Migrations.Alterations -{ - [DbContext(typeof(AlterationsElsaDbContext))] - [Migration("20241212211458_V3_3")] - partial class V3_3 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "7.0.20") - .HasAnnotation("Relational:MaxIdentifierLength", 64); - - modelBuilder.Entity("Elsa.Alterations.Core.Entities.AlterationJob", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("CompletedAt") - .HasColumnType("datetime(6)"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)"); - - b.Property("PlanId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("SerializedLog") - .HasColumnType("longtext"); - - b.Property("StartedAt") - .HasColumnType("datetime(6)"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("TenantId") - .HasColumnType("varchar(255)"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("CompletedAt") - .HasDatabaseName("IX_AlterationJob_CompletedAt"); - - b.HasIndex("CreatedAt") - .HasDatabaseName("IX_AlterationJob_CreatedAt"); - - b.HasIndex("PlanId") - .HasDatabaseName("IX_AlterationJob_PlanId"); - - b.HasIndex("StartedAt") - .HasDatabaseName("IX_AlterationJob_StartedAt"); - - b.HasIndex("Status") - .HasDatabaseName("IX_AlterationJob_Status"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_AlterationJob_TenantId"); - - b.HasIndex("WorkflowInstanceId") - .HasDatabaseName("IX_AlterationJob_WorkflowInstanceId"); - - b.ToTable("AlterationJobs", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Alterations.Core.Entities.AlterationPlan", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("CompletedAt") - .HasColumnType("datetime(6)"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)"); - - b.Property("SerializedAlterations") - .HasColumnType("longtext"); - - b.Property("SerializedWorkflowInstanceFilter") - .HasColumnType("longtext"); - - b.Property("StartedAt") - .HasColumnType("datetime(6)"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("TenantId") - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("CompletedAt") - .HasDatabaseName("IX_AlterationPlan_CompletedAt"); - - b.HasIndex("CreatedAt") - .HasDatabaseName("IX_AlterationPlan_CreatedAt"); - - b.HasIndex("StartedAt") - .HasDatabaseName("IX_AlterationPlan_StartedAt"); - - b.HasIndex("Status") - .HasDatabaseName("IX_AlterationPlan_Status"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_AlterationPlan_TenantId"); - - b.ToTable("AlterationPlans", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Alterations/20241212211458_V3_3.cs b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Alterations/20241212211458_V3_3.cs deleted file mode 100644 index f2547a37e9..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Alterations/20241212211458_V3_3.cs +++ /dev/null @@ -1,74 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.MySql.Migrations.Alterations -{ - /// - public partial class V3_3 : Migration - { - private readonly Elsa.EntityFrameworkCore.IElsaDbContextSchema _schema; - - /// - public V3_3(Elsa.EntityFrameworkCore.IElsaDbContextSchema schema) - { - _schema = schema; - } - - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "TenantId", - schema: _schema.Schema, - table: "AlterationPlans", - type: "varchar(255)", - nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.AddColumn( - name: "TenantId", - schema: _schema.Schema, - table: "AlterationJobs", - type: "varchar(255)", - nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateIndex( - name: "IX_AlterationPlan_TenantId", - schema: _schema.Schema, - table: "AlterationPlans", - column: "TenantId"); - - migrationBuilder.CreateIndex( - name: "IX_AlterationJob_TenantId", - schema: _schema.Schema, - table: "AlterationJobs", - column: "TenantId"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropIndex( - name: "IX_AlterationPlan_TenantId", - schema: _schema.Schema, - table: "AlterationPlans"); - - migrationBuilder.DropIndex( - name: "IX_AlterationJob_TenantId", - schema: _schema.Schema, - table: "AlterationJobs"); - - migrationBuilder.DropColumn( - name: "TenantId", - schema: _schema.Schema, - table: "AlterationPlans"); - - migrationBuilder.DropColumn( - name: "TenantId", - schema: _schema.Schema, - table: "AlterationJobs"); - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Alterations/20250222190805_V3_4.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Alterations/20250222190805_V3_4.Designer.cs deleted file mode 100644 index 0ce162a488..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Alterations/20250222190805_V3_4.Designer.cs +++ /dev/null @@ -1,136 +0,0 @@ -// -using System; -using Elsa.EntityFrameworkCore.Modules.Alterations; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.MySql.Migrations.Alterations -{ - [DbContext(typeof(AlterationsElsaDbContext))] - [Migration("20250222190805_V3_4")] - partial class V3_4 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "8.0.12") - .HasAnnotation("Relational:MaxIdentifierLength", 64); - - MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder); - - modelBuilder.Entity("Elsa.Alterations.Core.Entities.AlterationJob", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("CompletedAt") - .HasColumnType("datetime(6)"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)"); - - b.Property("PlanId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("SerializedLog") - .HasColumnType("longtext"); - - b.Property("StartedAt") - .HasColumnType("datetime(6)"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("TenantId") - .HasColumnType("varchar(255)"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("CompletedAt") - .HasDatabaseName("IX_AlterationJob_CompletedAt"); - - b.HasIndex("CreatedAt") - .HasDatabaseName("IX_AlterationJob_CreatedAt"); - - b.HasIndex("PlanId") - .HasDatabaseName("IX_AlterationJob_PlanId"); - - b.HasIndex("StartedAt") - .HasDatabaseName("IX_AlterationJob_StartedAt"); - - b.HasIndex("Status") - .HasDatabaseName("IX_AlterationJob_Status"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_AlterationJob_TenantId"); - - b.HasIndex("WorkflowInstanceId") - .HasDatabaseName("IX_AlterationJob_WorkflowInstanceId"); - - b.ToTable("AlterationJobs", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Alterations.Core.Entities.AlterationPlan", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("CompletedAt") - .HasColumnType("datetime(6)"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)"); - - b.Property("SerializedAlterations") - .HasColumnType("longtext"); - - b.Property("SerializedWorkflowInstanceFilter") - .HasColumnType("longtext"); - - b.Property("StartedAt") - .HasColumnType("datetime(6)"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("TenantId") - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("CompletedAt") - .HasDatabaseName("IX_AlterationPlan_CompletedAt"); - - b.HasIndex("CreatedAt") - .HasDatabaseName("IX_AlterationPlan_CreatedAt"); - - b.HasIndex("StartedAt") - .HasDatabaseName("IX_AlterationPlan_StartedAt"); - - b.HasIndex("Status") - .HasDatabaseName("IX_AlterationPlan_Status"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_AlterationPlan_TenantId"); - - b.ToTable("AlterationPlans", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Alterations/20250222190805_V3_4.cs b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Alterations/20250222190805_V3_4.cs deleted file mode 100644 index 4d8fdcb3f3..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Alterations/20250222190805_V3_4.cs +++ /dev/null @@ -1,30 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.MySql.Migrations.Alterations -{ - /// - public partial class V3_4 : Migration - { - private readonly Elsa.EntityFrameworkCore.IElsaDbContextSchema _schema; - - /// - public V3_4(Elsa.EntityFrameworkCore.IElsaDbContextSchema schema) - { - _schema = schema; - } - - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Alterations/AlterationsElsaDbContextModelSnapshot.cs b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Alterations/AlterationsElsaDbContextModelSnapshot.cs deleted file mode 100644 index e19481adb6..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Alterations/AlterationsElsaDbContextModelSnapshot.cs +++ /dev/null @@ -1,133 +0,0 @@ -// -using System; -using Elsa.EntityFrameworkCore.Modules.Alterations; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.MySql.Migrations.Alterations -{ - [DbContext(typeof(AlterationsElsaDbContext))] - partial class AlterationsElsaDbContextModelSnapshot : ModelSnapshot - { - protected override void BuildModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "8.0.12") - .HasAnnotation("Relational:MaxIdentifierLength", 64); - - MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder); - - modelBuilder.Entity("Elsa.Alterations.Core.Entities.AlterationJob", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("CompletedAt") - .HasColumnType("datetime(6)"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)"); - - b.Property("PlanId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("SerializedLog") - .HasColumnType("longtext"); - - b.Property("StartedAt") - .HasColumnType("datetime(6)"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("TenantId") - .HasColumnType("varchar(255)"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("CompletedAt") - .HasDatabaseName("IX_AlterationJob_CompletedAt"); - - b.HasIndex("CreatedAt") - .HasDatabaseName("IX_AlterationJob_CreatedAt"); - - b.HasIndex("PlanId") - .HasDatabaseName("IX_AlterationJob_PlanId"); - - b.HasIndex("StartedAt") - .HasDatabaseName("IX_AlterationJob_StartedAt"); - - b.HasIndex("Status") - .HasDatabaseName("IX_AlterationJob_Status"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_AlterationJob_TenantId"); - - b.HasIndex("WorkflowInstanceId") - .HasDatabaseName("IX_AlterationJob_WorkflowInstanceId"); - - b.ToTable("AlterationJobs", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Alterations.Core.Entities.AlterationPlan", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("CompletedAt") - .HasColumnType("datetime(6)"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)"); - - b.Property("SerializedAlterations") - .HasColumnType("longtext"); - - b.Property("SerializedWorkflowInstanceFilter") - .HasColumnType("longtext"); - - b.Property("StartedAt") - .HasColumnType("datetime(6)"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("TenantId") - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("CompletedAt") - .HasDatabaseName("IX_AlterationPlan_CompletedAt"); - - b.HasIndex("CreatedAt") - .HasDatabaseName("IX_AlterationPlan_CreatedAt"); - - b.HasIndex("StartedAt") - .HasDatabaseName("IX_AlterationPlan_StartedAt"); - - b.HasIndex("Status") - .HasDatabaseName("IX_AlterationPlan_Status"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_AlterationPlan_TenantId"); - - b.ToTable("AlterationPlans", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Identity/20231015122238_Initial.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Identity/20231015122238_Initial.Designer.cs deleted file mode 100644 index aa2f7e6300..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Identity/20231015122238_Initial.Designer.cs +++ /dev/null @@ -1,128 +0,0 @@ -// -using Elsa.EntityFrameworkCore.Modules.Identity; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.MySql.Migrations.Identity -{ - [DbContext(typeof(IdentityElsaDbContext))] - [Migration("20231015122238_Initial")] - partial class Initial - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "7.0.11") - .HasAnnotation("Relational:MaxIdentifierLength", 64); - - modelBuilder.Entity("Elsa.Identity.Entities.Application", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("ClientId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("HashedApiKey") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("HashedApiKeySalt") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("HashedClientSecret") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("HashedClientSecretSalt") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("Roles") - .IsRequired() - .HasColumnType("longtext") - .HasColumnName("Roles"); - - b.HasKey("Id"); - - b.HasIndex("ClientId") - .IsUnique() - .HasDatabaseName("IX_Application_ClientId"); - - b.HasIndex("Name") - .IsUnique() - .HasDatabaseName("IX_Application_Name"); - - b.ToTable("Applications", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Identity.Entities.Role", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("Permissions") - .IsRequired() - .HasColumnType("longtext") - .HasColumnName("Permissions"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique() - .HasDatabaseName("IX_Role_Name"); - - b.ToTable("Roles", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Identity.Entities.User", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("HashedPassword") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("HashedPasswordSalt") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("Roles") - .IsRequired() - .HasColumnType("longtext") - .HasColumnName("Roles"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique() - .HasDatabaseName("IX_User_Name"); - - b.ToTable("Users", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Identity/20231015122238_Initial.cs b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Identity/20231015122238_Initial.cs deleted file mode 100644 index 5d4f314652..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Identity/20231015122238_Initial.cs +++ /dev/null @@ -1,138 +0,0 @@ - -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.MySql.Migrations.Identity -{ - /// - public partial class Initial : Migration - { - private readonly IElsaDbContextSchema _schema; - public Initial(IElsaDbContextSchema schema) - { - _schema = schema ?? throw new ArgumentNullException(nameof(schema)); - } - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.EnsureSchema( - name: _schema.Schema); - - migrationBuilder.AlterDatabase() - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateTable( - name: "Applications", - schema: _schema.Schema, - columns: table => new - { - Id = table.Column(type: "varchar(255)", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - ClientId = table.Column(type: "varchar(255)", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - HashedClientSecret = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - HashedClientSecretSalt = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - Name = table.Column(type: "varchar(255)", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - HashedApiKey = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - HashedApiKeySalt = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - Roles = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4") - }, - constraints: table => - { - table.PrimaryKey("PK_Applications", x => x.Id); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateTable( - name: "Roles", - schema: _schema.Schema, - columns: table => new - { - Id = table.Column(type: "varchar(255)", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - Name = table.Column(type: "varchar(255)", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - Permissions = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4") - }, - constraints: table => - { - table.PrimaryKey("PK_Roles", x => x.Id); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateTable( - name: "Users", - schema: _schema.Schema, - columns: table => new - { - Id = table.Column(type: "varchar(255)", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - Name = table.Column(type: "varchar(255)", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - HashedPassword = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - HashedPasswordSalt = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - Roles = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4") - }, - constraints: table => - { - table.PrimaryKey("PK_Users", x => x.Id); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateIndex( - name: "IX_Application_ClientId", - schema: _schema.Schema, - table: "Applications", - column: "ClientId", - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_Application_Name", - schema: _schema.Schema, - table: "Applications", - column: "Name", - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_Role_Name", - schema: _schema.Schema, - table: "Roles", - column: "Name", - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_User_Name", - schema: _schema.Schema, - table: "Users", - column: "Name", - unique: true); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "Applications", - schema: _schema.Schema); - - migrationBuilder.DropTable( - name: "Roles", - schema: _schema.Schema); - - migrationBuilder.DropTable( - name: "Users", - schema: _schema.Schema); - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Identity/20240329200746_V3_1.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Identity/20240329200746_V3_1.Designer.cs deleted file mode 100644 index faaf237893..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Identity/20240329200746_V3_1.Designer.cs +++ /dev/null @@ -1,128 +0,0 @@ -// -using Elsa.EntityFrameworkCore.Modules.Identity; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.MySql.Migrations.Identity -{ - [DbContext(typeof(IdentityElsaDbContext))] - [Migration("20240329200746_V3_1")] - partial class V3_1 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "7.0.14") - .HasAnnotation("Relational:MaxIdentifierLength", 64); - - modelBuilder.Entity("Elsa.Identity.Entities.Application", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("ClientId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("HashedApiKey") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("HashedApiKeySalt") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("HashedClientSecret") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("HashedClientSecretSalt") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("Roles") - .IsRequired() - .HasColumnType("longtext") - .HasColumnName("Roles"); - - b.HasKey("Id"); - - b.HasIndex("ClientId") - .IsUnique() - .HasDatabaseName("IX_Application_ClientId"); - - b.HasIndex("Name") - .IsUnique() - .HasDatabaseName("IX_Application_Name"); - - b.ToTable("Applications", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Identity.Entities.Role", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("Permissions") - .IsRequired() - .HasColumnType("longtext") - .HasColumnName("Permissions"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique() - .HasDatabaseName("IX_Role_Name"); - - b.ToTable("Roles", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Identity.Entities.User", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("HashedPassword") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("HashedPasswordSalt") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("Roles") - .IsRequired() - .HasColumnType("longtext") - .HasColumnName("Roles"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique() - .HasDatabaseName("IX_User_Name"); - - b.ToTable("Users", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Identity/20240329200746_V3_1.cs b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Identity/20240329200746_V3_1.cs deleted file mode 100644 index 36999aa945..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Identity/20240329200746_V3_1.cs +++ /dev/null @@ -1,30 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.MySql.Migrations.Identity -{ - /// - public partial class V3_1 : Migration - { - private readonly IElsaDbContextSchema _schema; - - /// - public V3_1(IElsaDbContextSchema schema) - { - _schema = schema; - } - - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Identity/20240610184903_V3_2.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Identity/20240610184903_V3_2.Designer.cs deleted file mode 100644 index e25e181018..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Identity/20240610184903_V3_2.Designer.cs +++ /dev/null @@ -1,128 +0,0 @@ -// -using Elsa.EntityFrameworkCore.Modules.Identity; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.MySql.Migrations.Identity -{ - [DbContext(typeof(IdentityElsaDbContext))] - [Migration("20240610184903_V3_2")] - partial class V3_2 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "7.0.20") - .HasAnnotation("Relational:MaxIdentifierLength", 64); - - modelBuilder.Entity("Elsa.Identity.Entities.Application", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("ClientId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("HashedApiKey") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("HashedApiKeySalt") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("HashedClientSecret") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("HashedClientSecretSalt") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("Roles") - .IsRequired() - .HasColumnType("longtext") - .HasColumnName("Roles"); - - b.HasKey("Id"); - - b.HasIndex("ClientId") - .IsUnique() - .HasDatabaseName("IX_Application_ClientId"); - - b.HasIndex("Name") - .IsUnique() - .HasDatabaseName("IX_Application_Name"); - - b.ToTable("Applications", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Identity.Entities.Role", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("Permissions") - .IsRequired() - .HasColumnType("longtext") - .HasColumnName("Permissions"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique() - .HasDatabaseName("IX_Role_Name"); - - b.ToTable("Roles", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Identity.Entities.User", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("HashedPassword") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("HashedPasswordSalt") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("Roles") - .IsRequired() - .HasColumnType("longtext") - .HasColumnName("Roles"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique() - .HasDatabaseName("IX_User_Name"); - - b.ToTable("Users", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Identity/20240610184903_V3_2.cs b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Identity/20240610184903_V3_2.cs deleted file mode 100644 index d514c417fb..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Identity/20240610184903_V3_2.cs +++ /dev/null @@ -1,30 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.MySql.Migrations.Identity -{ - /// - public partial class V3_2 : Migration - { - private readonly IElsaDbContextSchema _schema; - - /// - public V3_2(IElsaDbContextSchema schema) - { - _schema = schema; - } - - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Identity/20241212211827_V3_3.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Identity/20241212211827_V3_3.Designer.cs deleted file mode 100644 index b7dc0eaaed..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Identity/20241212211827_V3_3.Designer.cs +++ /dev/null @@ -1,146 +0,0 @@ -// -using Elsa.EntityFrameworkCore.Modules.Identity; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.MySql.Migrations.Identity -{ - [DbContext(typeof(IdentityElsaDbContext))] - [Migration("20241212211827_V3_3")] - partial class V3_3 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "7.0.20") - .HasAnnotation("Relational:MaxIdentifierLength", 64); - - modelBuilder.Entity("Elsa.Identity.Entities.Application", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("ClientId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("HashedApiKey") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("HashedApiKeySalt") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("HashedClientSecret") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("HashedClientSecretSalt") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("Roles") - .IsRequired() - .HasColumnType("longtext") - .HasColumnName("Roles"); - - b.Property("TenantId") - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("ClientId") - .IsUnique() - .HasDatabaseName("IX_Application_ClientId"); - - b.HasIndex("Name") - .IsUnique() - .HasDatabaseName("IX_Application_Name"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_Application_TenantId"); - - b.ToTable("Applications", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Identity.Entities.Role", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("Permissions") - .IsRequired() - .HasColumnType("longtext") - .HasColumnName("Permissions"); - - b.Property("TenantId") - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique() - .HasDatabaseName("IX_Role_Name"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_Role_TenantId"); - - b.ToTable("Roles", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Identity.Entities.User", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("HashedPassword") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("HashedPasswordSalt") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("Roles") - .IsRequired() - .HasColumnType("longtext") - .HasColumnName("Roles"); - - b.Property("TenantId") - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique() - .HasDatabaseName("IX_User_Name"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_User_TenantId"); - - b.ToTable("Users", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Identity/20241212211827_V3_3.cs b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Identity/20241212211827_V3_3.cs deleted file mode 100644 index 3c9a401485..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Identity/20241212211827_V3_3.cs +++ /dev/null @@ -1,98 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.MySql.Migrations.Identity -{ - /// - public partial class V3_3 : Migration - { - private readonly Elsa.EntityFrameworkCore.IElsaDbContextSchema _schema; - - /// - public V3_3(Elsa.EntityFrameworkCore.IElsaDbContextSchema schema) - { - _schema = schema; - } - - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "TenantId", - schema: _schema.Schema, - table: "Users", - type: "varchar(255)", - nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.AddColumn( - name: "TenantId", - schema: _schema.Schema, - table: "Roles", - type: "varchar(255)", - nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.AddColumn( - name: "TenantId", - schema: _schema.Schema, - table: "Applications", - type: "varchar(255)", - nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateIndex( - name: "IX_User_TenantId", - schema: _schema.Schema, - table: "Users", - column: "TenantId"); - - migrationBuilder.CreateIndex( - name: "IX_Role_TenantId", - schema: _schema.Schema, - table: "Roles", - column: "TenantId"); - - migrationBuilder.CreateIndex( - name: "IX_Application_TenantId", - schema: _schema.Schema, - table: "Applications", - column: "TenantId"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropIndex( - name: "IX_User_TenantId", - schema: _schema.Schema, - table: "Users"); - - migrationBuilder.DropIndex( - name: "IX_Role_TenantId", - schema: _schema.Schema, - table: "Roles"); - - migrationBuilder.DropIndex( - name: "IX_Application_TenantId", - schema: _schema.Schema, - table: "Applications"); - - migrationBuilder.DropColumn( - name: "TenantId", - schema: _schema.Schema, - table: "Users"); - - migrationBuilder.DropColumn( - name: "TenantId", - schema: _schema.Schema, - table: "Roles"); - - migrationBuilder.DropColumn( - name: "TenantId", - schema: _schema.Schema, - table: "Applications"); - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Identity/20250222190914_V3_4.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Identity/20250222190914_V3_4.Designer.cs deleted file mode 100644 index 5827398693..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Identity/20250222190914_V3_4.Designer.cs +++ /dev/null @@ -1,149 +0,0 @@ -// -using Elsa.EntityFrameworkCore.Modules.Identity; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.MySql.Migrations.Identity -{ - [DbContext(typeof(IdentityElsaDbContext))] - [Migration("20250222190914_V3_4")] - partial class V3_4 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "8.0.12") - .HasAnnotation("Relational:MaxIdentifierLength", 64); - - MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder); - - modelBuilder.Entity("Elsa.Identity.Entities.Application", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("ClientId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("HashedApiKey") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("HashedApiKeySalt") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("HashedClientSecret") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("HashedClientSecretSalt") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("Roles") - .IsRequired() - .HasColumnType("longtext") - .HasColumnName("Roles"); - - b.Property("TenantId") - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("ClientId") - .IsUnique() - .HasDatabaseName("IX_Application_ClientId"); - - b.HasIndex("Name") - .IsUnique() - .HasDatabaseName("IX_Application_Name"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_Application_TenantId"); - - b.ToTable("Applications", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Identity.Entities.Role", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("Permissions") - .IsRequired() - .HasColumnType("longtext") - .HasColumnName("Permissions"); - - b.Property("TenantId") - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique() - .HasDatabaseName("IX_Role_Name"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_Role_TenantId"); - - b.ToTable("Roles", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Identity.Entities.User", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("HashedPassword") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("HashedPasswordSalt") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("Roles") - .IsRequired() - .HasColumnType("longtext") - .HasColumnName("Roles"); - - b.Property("TenantId") - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique() - .HasDatabaseName("IX_User_Name"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_User_TenantId"); - - b.ToTable("Users", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Identity/20250222190914_V3_4.cs b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Identity/20250222190914_V3_4.cs deleted file mode 100644 index 861eb93c50..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Identity/20250222190914_V3_4.cs +++ /dev/null @@ -1,30 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.MySql.Migrations.Identity -{ - /// - public partial class V3_4 : Migration - { - private readonly Elsa.EntityFrameworkCore.IElsaDbContextSchema _schema; - - /// - public V3_4(Elsa.EntityFrameworkCore.IElsaDbContextSchema schema) - { - _schema = schema; - } - - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Identity/IdentityElsaDbContextModelSnapshot.cs b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Identity/IdentityElsaDbContextModelSnapshot.cs deleted file mode 100644 index 072a78cc68..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Identity/IdentityElsaDbContextModelSnapshot.cs +++ /dev/null @@ -1,146 +0,0 @@ -// -using Elsa.EntityFrameworkCore.Modules.Identity; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.MySql.Migrations.Identity -{ - [DbContext(typeof(IdentityElsaDbContext))] - partial class IdentityElsaDbContextModelSnapshot : ModelSnapshot - { - protected override void BuildModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "8.0.12") - .HasAnnotation("Relational:MaxIdentifierLength", 64); - - MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder); - - modelBuilder.Entity("Elsa.Identity.Entities.Application", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("ClientId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("HashedApiKey") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("HashedApiKeySalt") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("HashedClientSecret") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("HashedClientSecretSalt") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("Roles") - .IsRequired() - .HasColumnType("longtext") - .HasColumnName("Roles"); - - b.Property("TenantId") - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("ClientId") - .IsUnique() - .HasDatabaseName("IX_Application_ClientId"); - - b.HasIndex("Name") - .IsUnique() - .HasDatabaseName("IX_Application_Name"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_Application_TenantId"); - - b.ToTable("Applications", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Identity.Entities.Role", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("Permissions") - .IsRequired() - .HasColumnType("longtext") - .HasColumnName("Permissions"); - - b.Property("TenantId") - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique() - .HasDatabaseName("IX_Role_Name"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_Role_TenantId"); - - b.ToTable("Roles", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Identity.Entities.User", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("HashedPassword") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("HashedPasswordSalt") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("Roles") - .IsRequired() - .HasColumnType("longtext") - .HasColumnName("Roles"); - - b.Property("TenantId") - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique() - .HasDatabaseName("IX_User_Name"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_User_TenantId"); - - b.ToTable("Users", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Labels/20231015122253_Initial.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Labels/20231015122253_Initial.Designer.cs deleted file mode 100644 index a644c444cd..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Labels/20231015122253_Initial.Designer.cs +++ /dev/null @@ -1,82 +0,0 @@ -// -using Elsa.EntityFrameworkCore.Modules.Labels; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.MySql.Migrations.Labels -{ - [DbContext(typeof(LabelsElsaDbContext))] - [Migration("20231015122253_Initial")] - partial class Initial - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "7.0.11") - .HasAnnotation("Relational:MaxIdentifierLength", 64); - - modelBuilder.Entity("Elsa.Labels.Entities.Label", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("Color") - .HasColumnType("longtext"); - - b.Property("Description") - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("NormalizedName") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.ToTable("Labels", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Labels.Entities.WorkflowDefinitionLabel", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("LabelId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("WorkflowDefinitionId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("WorkflowDefinitionVersionId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("LabelId") - .HasDatabaseName("WorkflowDefinitionLabel_LabelId"); - - b.HasIndex("WorkflowDefinitionId") - .HasDatabaseName("WorkflowDefinitionLabel_WorkflowDefinitionId"); - - b.HasIndex("WorkflowDefinitionVersionId") - .HasDatabaseName("WorkflowDefinitionLabel_WorkflowDefinitionVersionId"); - - b.ToTable("WorkflowDefinitionLabels", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Labels/20231015122253_Initial.cs b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Labels/20231015122253_Initial.cs deleted file mode 100644 index e6a8bfef40..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Labels/20231015122253_Initial.cs +++ /dev/null @@ -1,98 +0,0 @@ - -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.MySql.Migrations.Labels -{ - /// - public partial class Initial : Migration - { - private readonly IElsaDbContextSchema _schema; - public Initial(IElsaDbContextSchema schema) - { - _schema = schema ?? throw new ArgumentNullException(nameof(schema)); - } - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.EnsureSchema( - name: _schema.Schema); - - migrationBuilder.AlterDatabase() - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateTable( - name: "Labels", - schema: _schema.Schema, - columns: table => new - { - Id = table.Column(type: "varchar(255)", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - Name = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - NormalizedName = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - Description = table.Column(type: "longtext", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - Color = table.Column(type: "longtext", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4") - }, - constraints: table => - { - table.PrimaryKey("PK_Labels", x => x.Id); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateTable( - name: "WorkflowDefinitionLabels", - schema: _schema.Schema, - columns: table => new - { - Id = table.Column(type: "varchar(255)", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - WorkflowDefinitionId = table.Column(type: "varchar(255)", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - WorkflowDefinitionVersionId = table.Column(type: "varchar(255)", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - LabelId = table.Column(type: "varchar(255)", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4") - }, - constraints: table => - { - table.PrimaryKey("PK_WorkflowDefinitionLabels", x => x.Id); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateIndex( - name: "WorkflowDefinitionLabel_LabelId", - schema: _schema.Schema, - table: "WorkflowDefinitionLabels", - column: "LabelId"); - - migrationBuilder.CreateIndex( - name: "WorkflowDefinitionLabel_WorkflowDefinitionId", - schema: _schema.Schema, - table: "WorkflowDefinitionLabels", - column: "WorkflowDefinitionId"); - - migrationBuilder.CreateIndex( - name: "WorkflowDefinitionLabel_WorkflowDefinitionVersionId", - schema: _schema.Schema, - table: "WorkflowDefinitionLabels", - column: "WorkflowDefinitionVersionId"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "Labels", - schema: _schema.Schema); - - migrationBuilder.DropTable( - name: "WorkflowDefinitionLabels", - schema: _schema.Schema); - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Labels/20240329200817_V3_1.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Labels/20240329200817_V3_1.Designer.cs deleted file mode 100644 index d1b0b49cee..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Labels/20240329200817_V3_1.Designer.cs +++ /dev/null @@ -1,82 +0,0 @@ -// -using Elsa.EntityFrameworkCore.Modules.Labels; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.MySql.Migrations.Labels -{ - [DbContext(typeof(LabelsElsaDbContext))] - [Migration("20240329200817_V3_1")] - partial class V3_1 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "7.0.14") - .HasAnnotation("Relational:MaxIdentifierLength", 64); - - modelBuilder.Entity("Elsa.Labels.Entities.Label", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("Color") - .HasColumnType("longtext"); - - b.Property("Description") - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("NormalizedName") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.ToTable("Labels", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Labels.Entities.WorkflowDefinitionLabel", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("LabelId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("WorkflowDefinitionId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("WorkflowDefinitionVersionId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("LabelId") - .HasDatabaseName("WorkflowDefinitionLabel_LabelId"); - - b.HasIndex("WorkflowDefinitionId") - .HasDatabaseName("WorkflowDefinitionLabel_WorkflowDefinitionId"); - - b.HasIndex("WorkflowDefinitionVersionId") - .HasDatabaseName("WorkflowDefinitionLabel_WorkflowDefinitionVersionId"); - - b.ToTable("WorkflowDefinitionLabels", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Labels/20240329200817_V3_1.cs b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Labels/20240329200817_V3_1.cs deleted file mode 100644 index c6ee183fe5..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Labels/20240329200817_V3_1.cs +++ /dev/null @@ -1,30 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.MySql.Migrations.Labels -{ - /// - public partial class V3_1 : Migration - { - private readonly IElsaDbContextSchema _schema; - - /// - public V3_1(IElsaDbContextSchema schema) - { - _schema = schema; - } - - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Labels/20240610184957_V3_2.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Labels/20240610184957_V3_2.Designer.cs deleted file mode 100644 index cdd9a69484..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Labels/20240610184957_V3_2.Designer.cs +++ /dev/null @@ -1,82 +0,0 @@ -// -using Elsa.EntityFrameworkCore.Modules.Labels; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.MySql.Migrations.Labels -{ - [DbContext(typeof(LabelsElsaDbContext))] - [Migration("20240610184957_V3_2")] - partial class V3_2 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "7.0.20") - .HasAnnotation("Relational:MaxIdentifierLength", 64); - - modelBuilder.Entity("Elsa.Labels.Entities.Label", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("Color") - .HasColumnType("longtext"); - - b.Property("Description") - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("NormalizedName") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.ToTable("Labels", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Labels.Entities.WorkflowDefinitionLabel", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("LabelId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("WorkflowDefinitionId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("WorkflowDefinitionVersionId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("LabelId") - .HasDatabaseName("WorkflowDefinitionLabel_LabelId"); - - b.HasIndex("WorkflowDefinitionId") - .HasDatabaseName("WorkflowDefinitionLabel_WorkflowDefinitionId"); - - b.HasIndex("WorkflowDefinitionVersionId") - .HasDatabaseName("WorkflowDefinitionLabel_WorkflowDefinitionVersionId"); - - b.ToTable("WorkflowDefinitionLabels", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Labels/20240610184957_V3_2.cs b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Labels/20240610184957_V3_2.cs deleted file mode 100644 index 290adf17a3..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Labels/20240610184957_V3_2.cs +++ /dev/null @@ -1,30 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.MySql.Migrations.Labels -{ - /// - public partial class V3_2 : Migration - { - private readonly IElsaDbContextSchema _schema; - - /// - public V3_2(IElsaDbContextSchema schema) - { - _schema = schema; - } - - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Labels/20241212211953_V3_3.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Labels/20241212211953_V3_3.Designer.cs deleted file mode 100644 index 76d0f08092..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Labels/20241212211953_V3_3.Designer.cs +++ /dev/null @@ -1,91 +0,0 @@ -// -using Elsa.EntityFrameworkCore.Modules.Labels; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.MySql.Migrations.Labels -{ - [DbContext(typeof(LabelsElsaDbContext))] - [Migration("20241212211953_V3_3")] - partial class V3_3 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "7.0.20") - .HasAnnotation("Relational:MaxIdentifierLength", 64); - - modelBuilder.Entity("Elsa.Labels.Entities.Label", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("Color") - .HasColumnType("longtext"); - - b.Property("Description") - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("NormalizedName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.ToTable("Labels", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Labels.Entities.WorkflowDefinitionLabel", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("LabelId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("TenantId") - .HasColumnType("varchar(255)"); - - b.Property("WorkflowDefinitionId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("WorkflowDefinitionVersionId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("LabelId") - .HasDatabaseName("WorkflowDefinitionLabel_LabelId"); - - b.HasIndex("TenantId") - .HasDatabaseName("WorkflowDefinitionLabel_TenantId"); - - b.HasIndex("WorkflowDefinitionId") - .HasDatabaseName("WorkflowDefinitionLabel_WorkflowDefinitionId"); - - b.HasIndex("WorkflowDefinitionVersionId") - .HasDatabaseName("WorkflowDefinitionLabel_WorkflowDefinitionVersionId"); - - b.ToTable("WorkflowDefinitionLabels", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Labels/20241212211953_V3_3.cs b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Labels/20241212211953_V3_3.cs deleted file mode 100644 index 971d8f337d..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Labels/20241212211953_V3_3.cs +++ /dev/null @@ -1,63 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.MySql.Migrations.Labels -{ - /// - public partial class V3_3 : Migration - { - private readonly Elsa.EntityFrameworkCore.IElsaDbContextSchema _schema; - - /// - public V3_3(Elsa.EntityFrameworkCore.IElsaDbContextSchema schema) - { - _schema = schema; - } - - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "TenantId", - schema: _schema.Schema, - table: "WorkflowDefinitionLabels", - type: "varchar(255)", - nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.AddColumn( - name: "TenantId", - schema: _schema.Schema, - table: "Labels", - type: "longtext", - nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateIndex( - name: "WorkflowDefinitionLabel_TenantId", - schema: _schema.Schema, - table: "WorkflowDefinitionLabels", - column: "TenantId"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropIndex( - name: "WorkflowDefinitionLabel_TenantId", - schema: _schema.Schema, - table: "WorkflowDefinitionLabels"); - - migrationBuilder.DropColumn( - name: "TenantId", - schema: _schema.Schema, - table: "WorkflowDefinitionLabels"); - - migrationBuilder.DropColumn( - name: "TenantId", - schema: _schema.Schema, - table: "Labels"); - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Labels/20250222190940_V3_4.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Labels/20250222190940_V3_4.Designer.cs deleted file mode 100644 index fb9154cdf3..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Labels/20250222190940_V3_4.Designer.cs +++ /dev/null @@ -1,94 +0,0 @@ -// -using Elsa.EntityFrameworkCore.Modules.Labels; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.MySql.Migrations.Labels -{ - [DbContext(typeof(LabelsElsaDbContext))] - [Migration("20250222190940_V3_4")] - partial class V3_4 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "8.0.12") - .HasAnnotation("Relational:MaxIdentifierLength", 64); - - MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder); - - modelBuilder.Entity("Elsa.Labels.Entities.Label", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("Color") - .HasColumnType("longtext"); - - b.Property("Description") - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("NormalizedName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.ToTable("Labels", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Labels.Entities.WorkflowDefinitionLabel", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("LabelId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("TenantId") - .HasColumnType("varchar(255)"); - - b.Property("WorkflowDefinitionId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("WorkflowDefinitionVersionId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("LabelId") - .HasDatabaseName("WorkflowDefinitionLabel_LabelId"); - - b.HasIndex("TenantId") - .HasDatabaseName("WorkflowDefinitionLabel_TenantId"); - - b.HasIndex("WorkflowDefinitionId") - .HasDatabaseName("WorkflowDefinitionLabel_WorkflowDefinitionId"); - - b.HasIndex("WorkflowDefinitionVersionId") - .HasDatabaseName("WorkflowDefinitionLabel_WorkflowDefinitionVersionId"); - - b.ToTable("WorkflowDefinitionLabels", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Labels/20250222190940_V3_4.cs b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Labels/20250222190940_V3_4.cs deleted file mode 100644 index 0ddeaf121b..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Labels/20250222190940_V3_4.cs +++ /dev/null @@ -1,30 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.MySql.Migrations.Labels -{ - /// - public partial class V3_4 : Migration - { - private readonly Elsa.EntityFrameworkCore.IElsaDbContextSchema _schema; - - /// - public V3_4(Elsa.EntityFrameworkCore.IElsaDbContextSchema schema) - { - _schema = schema; - } - - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Labels/LabelsElsaDbContextModelSnapshot.cs b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Labels/LabelsElsaDbContextModelSnapshot.cs deleted file mode 100644 index fb3703af51..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Labels/LabelsElsaDbContextModelSnapshot.cs +++ /dev/null @@ -1,91 +0,0 @@ -// -using Elsa.EntityFrameworkCore.Modules.Labels; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.MySql.Migrations.Labels -{ - [DbContext(typeof(LabelsElsaDbContext))] - partial class LabelsElsaDbContextModelSnapshot : ModelSnapshot - { - protected override void BuildModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "8.0.12") - .HasAnnotation("Relational:MaxIdentifierLength", 64); - - MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder); - - modelBuilder.Entity("Elsa.Labels.Entities.Label", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("Color") - .HasColumnType("longtext"); - - b.Property("Description") - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("NormalizedName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.ToTable("Labels", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Labels.Entities.WorkflowDefinitionLabel", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("LabelId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("TenantId") - .HasColumnType("varchar(255)"); - - b.Property("WorkflowDefinitionId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("WorkflowDefinitionVersionId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("LabelId") - .HasDatabaseName("WorkflowDefinitionLabel_LabelId"); - - b.HasIndex("TenantId") - .HasDatabaseName("WorkflowDefinitionLabel_TenantId"); - - b.HasIndex("WorkflowDefinitionId") - .HasDatabaseName("WorkflowDefinitionLabel_WorkflowDefinitionId"); - - b.HasIndex("WorkflowDefinitionVersionId") - .HasDatabaseName("WorkflowDefinitionLabel_WorkflowDefinitionVersionId"); - - b.ToTable("WorkflowDefinitionLabels", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Management/20231015122223_Initial.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Management/20231015122223_Initial.Designer.cs deleted file mode 100644 index 298abc2f61..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Management/20231015122223_Initial.Designer.cs +++ /dev/null @@ -1,193 +0,0 @@ -// -using System; -using Elsa.EntityFrameworkCore.Modules.Management; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.MySql.Migrations.Management -{ - [DbContext(typeof(ManagementElsaDbContext))] - [Migration("20231015122223_Initial")] - partial class Initial - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "7.0.11") - .HasAnnotation("Relational:MaxIdentifierLength", 64); - - modelBuilder.Entity("Elsa.Workflows.Management.Entities.WorkflowDefinition", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("BinaryData") - .HasColumnType("longblob"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)"); - - b.Property("Data") - .HasColumnType("longtext"); - - b.Property("DefinitionId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("Description") - .HasColumnType("longtext"); - - b.Property("IsLatest") - .HasColumnType("tinyint(1)"); - - b.Property("IsPublished") - .HasColumnType("tinyint(1)"); - - b.Property("IsReadonly") - .HasColumnType("tinyint(1)"); - - b.Property("MaterializerContext") - .HasColumnType("longtext"); - - b.Property("MaterializerName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Name") - .HasColumnType("varchar(255)"); - - b.Property("ProviderName") - .HasColumnType("longtext"); - - b.Property("StringData") - .HasColumnType("longtext"); - - b.Property("ToolVersion") - .HasColumnType("longtext"); - - b.Property("UsableAsActivity") - .HasColumnType("tinyint(1)"); - - b.Property("Version") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("IsLatest") - .HasDatabaseName("IX_WorkflowDefinition_IsLatest"); - - b.HasIndex("IsPublished") - .HasDatabaseName("IX_WorkflowDefinition_IsPublished"); - - b.HasIndex("Name") - .HasDatabaseName("IX_WorkflowDefinition_Name"); - - b.HasIndex("UsableAsActivity") - .HasDatabaseName("IX_WorkflowDefinition_UsableAsActivity"); - - b.HasIndex("Version") - .HasDatabaseName("IX_WorkflowDefinition_Version"); - - b.HasIndex("DefinitionId", "Version") - .IsUnique() - .HasDatabaseName("IX_WorkflowDefinition_DefinitionId_Version"); - - b.ToTable("WorkflowDefinitions", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Management.Entities.WorkflowInstance", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("CorrelationId") - .HasColumnType("varchar(255)"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)"); - - b.Property("Data") - .HasColumnType("longtext"); - - b.Property("DefinitionId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("DefinitionVersionId") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FinishedAt") - .HasColumnType("datetime(6)"); - - b.Property("IncidentCount") - .HasColumnType("int"); - - b.Property("Name") - .HasColumnType("varchar(255)"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("SubStatus") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime(6)"); - - b.Property("Version") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CorrelationId") - .HasDatabaseName("IX_WorkflowInstance_CorrelationId"); - - b.HasIndex("CreatedAt") - .HasDatabaseName("IX_WorkflowInstance_CreatedAt"); - - b.HasIndex("DefinitionId") - .HasDatabaseName("IX_WorkflowInstance_DefinitionId"); - - b.HasIndex("FinishedAt") - .HasDatabaseName("IX_WorkflowInstance_FinishedAt"); - - b.HasIndex("Name") - .HasDatabaseName("IX_WorkflowInstance_Name"); - - b.HasIndex("Status") - .HasDatabaseName("IX_WorkflowInstance_Status"); - - b.HasIndex("SubStatus") - .HasDatabaseName("IX_WorkflowInstance_SubStatus"); - - b.HasIndex("UpdatedAt") - .HasDatabaseName("IX_WorkflowInstance_UpdatedAt"); - - b.HasIndex("Status", "DefinitionId") - .HasDatabaseName("IX_WorkflowInstance_Status_DefinitionId"); - - b.HasIndex("Status", "SubStatus") - .HasDatabaseName("IX_WorkflowInstance_Status_SubStatus"); - - b.HasIndex("SubStatus", "DefinitionId") - .HasDatabaseName("IX_WorkflowInstance_SubStatus_DefinitionId"); - - b.HasIndex("Status", "SubStatus", "DefinitionId", "Version") - .HasDatabaseName("IX_WorkflowInstance_Status_SubStatus_DefinitionId_Version"); - - b.ToTable("WorkflowInstances", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Management/20231015122223_Initial.cs b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Management/20231015122223_Initial.cs deleted file mode 100644 index 9e5f3e4fb3..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Management/20231015122223_Initial.cs +++ /dev/null @@ -1,219 +0,0 @@ - -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.MySql.Migrations.Management -{ - /// - public partial class Initial : Migration - { - private readonly IElsaDbContextSchema _schema; - public Initial(IElsaDbContextSchema schema) - { - _schema = schema ?? throw new ArgumentNullException(nameof(schema)); - } - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.EnsureSchema( - name: _schema.Schema); - - migrationBuilder.AlterDatabase() - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateTable( - name: "WorkflowDefinitions", - schema: _schema.Schema, - columns: table => new - { - Id = table.Column(type: "varchar(255)", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - DefinitionId = table.Column(type: "varchar(255)", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - Name = table.Column(type: "varchar(255)", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - Description = table.Column(type: "longtext", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - ToolVersion = table.Column(type: "longtext", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - ProviderName = table.Column(type: "longtext", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - MaterializerName = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - MaterializerContext = table.Column(type: "longtext", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - StringData = table.Column(type: "longtext", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - BinaryData = table.Column(type: "longblob", nullable: true), - IsReadonly = table.Column(type: "tinyint(1)", nullable: false), - Data = table.Column(type: "longtext", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - UsableAsActivity = table.Column(type: "tinyint(1)", nullable: true), - CreatedAt = table.Column(type: "datetime(6)", nullable: false), - Version = table.Column(type: "int", nullable: false), - IsLatest = table.Column(type: "tinyint(1)", nullable: false), - IsPublished = table.Column(type: "tinyint(1)", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_WorkflowDefinitions", x => x.Id); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateTable( - name: "WorkflowInstances", - schema: _schema.Schema, - columns: table => new - { - Id = table.Column(type: "varchar(255)", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - DefinitionId = table.Column(type: "varchar(255)", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - DefinitionVersionId = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - Version = table.Column(type: "int", nullable: false), - Status = table.Column(type: "varchar(255)", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - SubStatus = table.Column(type: "varchar(255)", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - CorrelationId = table.Column(type: "varchar(255)", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - Name = table.Column(type: "varchar(255)", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - IncidentCount = table.Column(type: "int", nullable: false), - CreatedAt = table.Column(type: "datetime(6)", nullable: false), - UpdatedAt = table.Column(type: "datetime(6)", nullable: false), - FinishedAt = table.Column(type: "datetime(6)", nullable: true), - Data = table.Column(type: "longtext", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4") - }, - constraints: table => - { - table.PrimaryKey("PK_WorkflowInstances", x => x.Id); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowDefinition_DefinitionId_Version", - schema: _schema.Schema, - table: "WorkflowDefinitions", - columns: new[] { "DefinitionId", "Version" }, - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowDefinition_IsLatest", - schema: _schema.Schema, - table: "WorkflowDefinitions", - column: "IsLatest"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowDefinition_IsPublished", - schema: _schema.Schema, - table: "WorkflowDefinitions", - column: "IsPublished"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowDefinition_Name", - schema: _schema.Schema, - table: "WorkflowDefinitions", - column: "Name"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowDefinition_UsableAsActivity", - schema: _schema.Schema, - table: "WorkflowDefinitions", - column: "UsableAsActivity"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowDefinition_Version", - schema: _schema.Schema, - table: "WorkflowDefinitions", - column: "Version"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowInstance_CorrelationId", - schema: _schema.Schema, - table: "WorkflowInstances", - column: "CorrelationId"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowInstance_CreatedAt", - schema: _schema.Schema, - table: "WorkflowInstances", - column: "CreatedAt"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowInstance_DefinitionId", - schema: _schema.Schema, - table: "WorkflowInstances", - column: "DefinitionId"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowInstance_FinishedAt", - schema: _schema.Schema, - table: "WorkflowInstances", - column: "FinishedAt"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowInstance_Name", - schema: _schema.Schema, - table: "WorkflowInstances", - column: "Name"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowInstance_Status", - schema: _schema.Schema, - table: "WorkflowInstances", - column: "Status"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowInstance_Status_DefinitionId", - schema: _schema.Schema, - table: "WorkflowInstances", - columns: new[] { "Status", "DefinitionId" }); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowInstance_Status_SubStatus", - schema: _schema.Schema, - table: "WorkflowInstances", - columns: new[] { "Status", "SubStatus" }); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowInstance_Status_SubStatus_DefinitionId_Version", - schema: _schema.Schema, - table: "WorkflowInstances", - columns: new[] { "Status", "SubStatus", "DefinitionId", "Version" }); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowInstance_SubStatus", - schema: _schema.Schema, - table: "WorkflowInstances", - column: "SubStatus"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowInstance_SubStatus_DefinitionId", - schema: _schema.Schema, - table: "WorkflowInstances", - columns: new[] { "SubStatus", "DefinitionId" }); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowInstance_UpdatedAt", - schema: _schema.Schema, - table: "WorkflowInstances", - column: "UpdatedAt"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "WorkflowDefinitions", - schema: _schema.Schema); - - migrationBuilder.DropTable( - name: "WorkflowInstances", - schema: _schema.Schema); - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Management/20240329200720_V3_1.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Management/20240329200720_V3_1.Designer.cs deleted file mode 100644 index 0828c2c2fb..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Management/20240329200720_V3_1.Designer.cs +++ /dev/null @@ -1,211 +0,0 @@ -// -using System; -using Elsa.EntityFrameworkCore.Modules.Management; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.MySql.Migrations.Management -{ - [DbContext(typeof(ManagementElsaDbContext))] - [Migration("20240329200720_V3_1")] - partial class V3_1 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "7.0.14") - .HasAnnotation("Relational:MaxIdentifierLength", 64); - - modelBuilder.Entity("Elsa.Workflows.Management.Entities.WorkflowDefinition", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("BinaryData") - .HasColumnType("longblob"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)"); - - b.Property("Data") - .HasColumnType("longtext"); - - b.Property("DefinitionId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("Description") - .HasColumnType("longtext"); - - b.Property("IsLatest") - .HasColumnType("tinyint(1)"); - - b.Property("IsPublished") - .HasColumnType("tinyint(1)"); - - b.Property("IsReadonly") - .HasColumnType("tinyint(1)"); - - b.Property("IsSystem") - .HasColumnType("tinyint(1)"); - - b.Property("MaterializerContext") - .HasColumnType("longtext"); - - b.Property("MaterializerName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Name") - .HasColumnType("varchar(255)"); - - b.Property("ProviderName") - .HasColumnType("longtext"); - - b.Property("StringData") - .HasColumnType("longtext"); - - b.Property("ToolVersion") - .HasColumnType("longtext"); - - b.Property("UsableAsActivity") - .HasColumnType("tinyint(1)"); - - b.Property("Version") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("IsLatest") - .HasDatabaseName("IX_WorkflowDefinition_IsLatest"); - - b.HasIndex("IsPublished") - .HasDatabaseName("IX_WorkflowDefinition_IsPublished"); - - b.HasIndex("IsSystem") - .HasDatabaseName("IX_WorkflowDefinition_IsSystem"); - - b.HasIndex("Name") - .HasDatabaseName("IX_WorkflowDefinition_Name"); - - b.HasIndex("UsableAsActivity") - .HasDatabaseName("IX_WorkflowDefinition_UsableAsActivity"); - - b.HasIndex("Version") - .HasDatabaseName("IX_WorkflowDefinition_Version"); - - b.HasIndex("DefinitionId", "Version") - .IsUnique() - .HasDatabaseName("IX_WorkflowDefinition_DefinitionId_Version"); - - b.ToTable("WorkflowDefinitions", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Management.Entities.WorkflowInstance", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("CorrelationId") - .HasColumnType("varchar(255)"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)"); - - b.Property("Data") - .HasColumnType("longtext"); - - b.Property("DataCompressionAlgorithm") - .HasColumnType("longtext"); - - b.Property("DefinitionId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("DefinitionVersionId") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FinishedAt") - .HasColumnType("datetime(6)"); - - b.Property("IncidentCount") - .HasColumnType("int"); - - b.Property("IsSystem") - .HasColumnType("tinyint(1)"); - - b.Property("Name") - .HasColumnType("varchar(255)"); - - b.Property("ParentWorkflowInstanceId") - .HasColumnType("longtext"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("SubStatus") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime(6)"); - - b.Property("Version") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CorrelationId") - .HasDatabaseName("IX_WorkflowInstance_CorrelationId"); - - b.HasIndex("CreatedAt") - .HasDatabaseName("IX_WorkflowInstance_CreatedAt"); - - b.HasIndex("DefinitionId") - .HasDatabaseName("IX_WorkflowInstance_DefinitionId"); - - b.HasIndex("FinishedAt") - .HasDatabaseName("IX_WorkflowInstance_FinishedAt"); - - b.HasIndex("IsSystem") - .HasDatabaseName("IX_WorkflowInstance_IsSystem"); - - b.HasIndex("Name") - .HasDatabaseName("IX_WorkflowInstance_Name"); - - b.HasIndex("Status") - .HasDatabaseName("IX_WorkflowInstance_Status"); - - b.HasIndex("SubStatus") - .HasDatabaseName("IX_WorkflowInstance_SubStatus"); - - b.HasIndex("UpdatedAt") - .HasDatabaseName("IX_WorkflowInstance_UpdatedAt"); - - b.HasIndex("Status", "DefinitionId") - .HasDatabaseName("IX_WorkflowInstance_Status_DefinitionId"); - - b.HasIndex("Status", "SubStatus") - .HasDatabaseName("IX_WorkflowInstance_Status_SubStatus"); - - b.HasIndex("SubStatus", "DefinitionId") - .HasDatabaseName("IX_WorkflowInstance_SubStatus_DefinitionId"); - - b.HasIndex("Status", "SubStatus", "DefinitionId", "Version") - .HasDatabaseName("IX_WorkflowInstance_Status_SubStatus_DefinitionId_Version"); - - b.ToTable("WorkflowInstances", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Management/20240329200720_V3_1.cs b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Management/20240329200720_V3_1.cs deleted file mode 100644 index e4fa114e6d..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Management/20240329200720_V3_1.cs +++ /dev/null @@ -1,100 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.MySql.Migrations.Management -{ - /// - public partial class V3_1 : Migration - { - private readonly IElsaDbContextSchema _schema; - - /// - public V3_1(IElsaDbContextSchema schema) - { - _schema = schema; - } - - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "DataCompressionAlgorithm", - schema: _schema.Schema, - table: "WorkflowInstances", - type: "longtext", - nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.AddColumn( - name: "IsSystem", - schema: _schema.Schema, - table: "WorkflowInstances", - type: "tinyint(1)", - nullable: false, - defaultValue: false); - - migrationBuilder.AddColumn( - name: "ParentWorkflowInstanceId", - schema: _schema.Schema, - table: "WorkflowInstances", - type: "longtext", - nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.AddColumn( - name: "IsSystem", - schema: _schema.Schema, - table: "WorkflowDefinitions", - type: "tinyint(1)", - nullable: false, - defaultValue: false); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowInstance_IsSystem", - schema: _schema.Schema, - table: "WorkflowInstances", - column: "IsSystem"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowDefinition_IsSystem", - schema: _schema.Schema, - table: "WorkflowDefinitions", - column: "IsSystem"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropIndex( - name: "IX_WorkflowInstance_IsSystem", - schema: _schema.Schema, - table: "WorkflowInstances"); - - migrationBuilder.DropIndex( - name: "IX_WorkflowDefinition_IsSystem", - schema: _schema.Schema, - table: "WorkflowDefinitions"); - - migrationBuilder.DropColumn( - name: "DataCompressionAlgorithm", - schema: _schema.Schema, - table: "WorkflowInstances"); - - migrationBuilder.DropColumn( - name: "IsSystem", - schema: _schema.Schema, - table: "WorkflowInstances"); - - migrationBuilder.DropColumn( - name: "ParentWorkflowInstanceId", - schema: _schema.Schema, - table: "WorkflowInstances"); - - migrationBuilder.DropColumn( - name: "IsSystem", - schema: _schema.Schema, - table: "WorkflowDefinitions"); - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Management/20240610184802_V3_2.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Management/20240610184802_V3_2.Designer.cs deleted file mode 100644 index 164db5fe22..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Management/20240610184802_V3_2.Designer.cs +++ /dev/null @@ -1,211 +0,0 @@ -// -using System; -using Elsa.EntityFrameworkCore.Modules.Management; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.MySql.Migrations.Management -{ - [DbContext(typeof(ManagementElsaDbContext))] - [Migration("20240610184802_V3_2")] - partial class V3_2 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "7.0.20") - .HasAnnotation("Relational:MaxIdentifierLength", 64); - - modelBuilder.Entity("Elsa.Workflows.Management.Entities.WorkflowDefinition", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("BinaryData") - .HasColumnType("longblob"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)"); - - b.Property("Data") - .HasColumnType("longtext"); - - b.Property("DefinitionId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("Description") - .HasColumnType("longtext"); - - b.Property("IsLatest") - .HasColumnType("tinyint(1)"); - - b.Property("IsPublished") - .HasColumnType("tinyint(1)"); - - b.Property("IsReadonly") - .HasColumnType("tinyint(1)"); - - b.Property("IsSystem") - .HasColumnType("tinyint(1)"); - - b.Property("MaterializerContext") - .HasColumnType("longtext"); - - b.Property("MaterializerName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Name") - .HasColumnType("varchar(255)"); - - b.Property("ProviderName") - .HasColumnType("longtext"); - - b.Property("StringData") - .HasColumnType("longtext"); - - b.Property("ToolVersion") - .HasColumnType("longtext"); - - b.Property("UsableAsActivity") - .HasColumnType("tinyint(1)"); - - b.Property("Version") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("IsLatest") - .HasDatabaseName("IX_WorkflowDefinition_IsLatest"); - - b.HasIndex("IsPublished") - .HasDatabaseName("IX_WorkflowDefinition_IsPublished"); - - b.HasIndex("IsSystem") - .HasDatabaseName("IX_WorkflowDefinition_IsSystem"); - - b.HasIndex("Name") - .HasDatabaseName("IX_WorkflowDefinition_Name"); - - b.HasIndex("UsableAsActivity") - .HasDatabaseName("IX_WorkflowDefinition_UsableAsActivity"); - - b.HasIndex("Version") - .HasDatabaseName("IX_WorkflowDefinition_Version"); - - b.HasIndex("DefinitionId", "Version") - .IsUnique() - .HasDatabaseName("IX_WorkflowDefinition_DefinitionId_Version"); - - b.ToTable("WorkflowDefinitions", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Management.Entities.WorkflowInstance", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("CorrelationId") - .HasColumnType("varchar(255)"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)"); - - b.Property("Data") - .HasColumnType("longtext"); - - b.Property("DataCompressionAlgorithm") - .HasColumnType("longtext"); - - b.Property("DefinitionId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("DefinitionVersionId") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FinishedAt") - .HasColumnType("datetime(6)"); - - b.Property("IncidentCount") - .HasColumnType("int"); - - b.Property("IsSystem") - .HasColumnType("tinyint(1)"); - - b.Property("Name") - .HasColumnType("varchar(255)"); - - b.Property("ParentWorkflowInstanceId") - .HasColumnType("longtext"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("SubStatus") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime(6)"); - - b.Property("Version") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CorrelationId") - .HasDatabaseName("IX_WorkflowInstance_CorrelationId"); - - b.HasIndex("CreatedAt") - .HasDatabaseName("IX_WorkflowInstance_CreatedAt"); - - b.HasIndex("DefinitionId") - .HasDatabaseName("IX_WorkflowInstance_DefinitionId"); - - b.HasIndex("FinishedAt") - .HasDatabaseName("IX_WorkflowInstance_FinishedAt"); - - b.HasIndex("IsSystem") - .HasDatabaseName("IX_WorkflowInstance_IsSystem"); - - b.HasIndex("Name") - .HasDatabaseName("IX_WorkflowInstance_Name"); - - b.HasIndex("Status") - .HasDatabaseName("IX_WorkflowInstance_Status"); - - b.HasIndex("SubStatus") - .HasDatabaseName("IX_WorkflowInstance_SubStatus"); - - b.HasIndex("UpdatedAt") - .HasDatabaseName("IX_WorkflowInstance_UpdatedAt"); - - b.HasIndex("Status", "DefinitionId") - .HasDatabaseName("IX_WorkflowInstance_Status_DefinitionId"); - - b.HasIndex("Status", "SubStatus") - .HasDatabaseName("IX_WorkflowInstance_Status_SubStatus"); - - b.HasIndex("SubStatus", "DefinitionId") - .HasDatabaseName("IX_WorkflowInstance_SubStatus_DefinitionId"); - - b.HasIndex("Status", "SubStatus", "DefinitionId", "Version") - .HasDatabaseName("IX_WorkflowInstance_Status_SubStatus_DefinitionId_Version"); - - b.ToTable("WorkflowInstances", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Management/20240610184802_V3_2.cs b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Management/20240610184802_V3_2.cs deleted file mode 100644 index 523fc6f4ab..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Management/20240610184802_V3_2.cs +++ /dev/null @@ -1,30 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.MySql.Migrations.Management -{ - /// - public partial class V3_2 : Migration - { - private readonly IElsaDbContextSchema _schema; - - /// - public V3_2(IElsaDbContextSchema schema) - { - _schema = schema; - } - - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Management/20241212211732_V3_3.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Management/20241212211732_V3_3.Designer.cs deleted file mode 100644 index 660aba8fa2..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Management/20241212211732_V3_3.Designer.cs +++ /dev/null @@ -1,223 +0,0 @@ -// -using System; -using Elsa.EntityFrameworkCore.Modules.Management; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.MySql.Migrations.Management -{ - [DbContext(typeof(ManagementElsaDbContext))] - [Migration("20241212211732_V3_3")] - partial class V3_3 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "7.0.20") - .HasAnnotation("Relational:MaxIdentifierLength", 64); - - modelBuilder.Entity("Elsa.Workflows.Management.Entities.WorkflowDefinition", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("BinaryData") - .HasColumnType("longblob"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)"); - - b.Property("Data") - .HasColumnType("longtext"); - - b.Property("DefinitionId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("Description") - .HasColumnType("longtext"); - - b.Property("IsLatest") - .HasColumnType("tinyint(1)"); - - b.Property("IsPublished") - .HasColumnType("tinyint(1)"); - - b.Property("IsReadonly") - .HasColumnType("tinyint(1)"); - - b.Property("IsSystem") - .HasColumnType("tinyint(1)"); - - b.Property("MaterializerContext") - .HasColumnType("longtext"); - - b.Property("MaterializerName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Name") - .HasColumnType("varchar(255)"); - - b.Property("ProviderName") - .HasColumnType("longtext"); - - b.Property("StringData") - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("varchar(255)"); - - b.Property("ToolVersion") - .HasColumnType("longtext"); - - b.Property("UsableAsActivity") - .HasColumnType("tinyint(1)"); - - b.Property("Version") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("IsLatest") - .HasDatabaseName("IX_WorkflowDefinition_IsLatest"); - - b.HasIndex("IsPublished") - .HasDatabaseName("IX_WorkflowDefinition_IsPublished"); - - b.HasIndex("IsSystem") - .HasDatabaseName("IX_WorkflowDefinition_IsSystem"); - - b.HasIndex("Name") - .HasDatabaseName("IX_WorkflowDefinition_Name"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_WorkflowDefinition_TenantId"); - - b.HasIndex("UsableAsActivity") - .HasDatabaseName("IX_WorkflowDefinition_UsableAsActivity"); - - b.HasIndex("Version") - .HasDatabaseName("IX_WorkflowDefinition_Version"); - - b.HasIndex("DefinitionId", "Version") - .IsUnique() - .HasDatabaseName("IX_WorkflowDefinition_DefinitionId_Version"); - - b.ToTable("WorkflowDefinitions", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Management.Entities.WorkflowInstance", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("CorrelationId") - .HasColumnType("varchar(255)"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)"); - - b.Property("Data") - .HasColumnType("longtext"); - - b.Property("DataCompressionAlgorithm") - .HasColumnType("longtext"); - - b.Property("DefinitionId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("DefinitionVersionId") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FinishedAt") - .HasColumnType("datetime(6)"); - - b.Property("IncidentCount") - .HasColumnType("int"); - - b.Property("IsSystem") - .HasColumnType("tinyint(1)"); - - b.Property("Name") - .HasColumnType("varchar(255)"); - - b.Property("ParentWorkflowInstanceId") - .HasColumnType("longtext"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("SubStatus") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("TenantId") - .HasColumnType("varchar(255)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime(6)"); - - b.Property("Version") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CorrelationId") - .HasDatabaseName("IX_WorkflowInstance_CorrelationId"); - - b.HasIndex("CreatedAt") - .HasDatabaseName("IX_WorkflowInstance_CreatedAt"); - - b.HasIndex("DefinitionId") - .HasDatabaseName("IX_WorkflowInstance_DefinitionId"); - - b.HasIndex("FinishedAt") - .HasDatabaseName("IX_WorkflowInstance_FinishedAt"); - - b.HasIndex("IsSystem") - .HasDatabaseName("IX_WorkflowInstance_IsSystem"); - - b.HasIndex("Name") - .HasDatabaseName("IX_WorkflowInstance_Name"); - - b.HasIndex("Status") - .HasDatabaseName("IX_WorkflowInstance_Status"); - - b.HasIndex("SubStatus") - .HasDatabaseName("IX_WorkflowInstance_SubStatus"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_WorkflowInstance_TenantId"); - - b.HasIndex("UpdatedAt") - .HasDatabaseName("IX_WorkflowInstance_UpdatedAt"); - - b.HasIndex("Status", "DefinitionId") - .HasDatabaseName("IX_WorkflowInstance_Status_DefinitionId"); - - b.HasIndex("Status", "SubStatus") - .HasDatabaseName("IX_WorkflowInstance_Status_SubStatus"); - - b.HasIndex("SubStatus", "DefinitionId") - .HasDatabaseName("IX_WorkflowInstance_SubStatus_DefinitionId"); - - b.HasIndex("Status", "SubStatus", "DefinitionId", "Version") - .HasDatabaseName("IX_WorkflowInstance_Status_SubStatus_DefinitionId_Version"); - - b.ToTable("WorkflowInstances", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Management/20241212211732_V3_3.cs b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Management/20241212211732_V3_3.cs deleted file mode 100644 index 0b6c649876..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Management/20241212211732_V3_3.cs +++ /dev/null @@ -1,74 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.MySql.Migrations.Management -{ - /// - public partial class V3_3 : Migration - { - private readonly Elsa.EntityFrameworkCore.IElsaDbContextSchema _schema; - - /// - public V3_3(Elsa.EntityFrameworkCore.IElsaDbContextSchema schema) - { - _schema = schema; - } - - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "TenantId", - schema: _schema.Schema, - table: "WorkflowInstances", - type: "varchar(255)", - nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.AddColumn( - name: "TenantId", - schema: _schema.Schema, - table: "WorkflowDefinitions", - type: "varchar(255)", - nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowInstance_TenantId", - schema: _schema.Schema, - table: "WorkflowInstances", - column: "TenantId"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowDefinition_TenantId", - schema: _schema.Schema, - table: "WorkflowDefinitions", - column: "TenantId"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropIndex( - name: "IX_WorkflowInstance_TenantId", - schema: _schema.Schema, - table: "WorkflowInstances"); - - migrationBuilder.DropIndex( - name: "IX_WorkflowDefinition_TenantId", - schema: _schema.Schema, - table: "WorkflowDefinitions"); - - migrationBuilder.DropColumn( - name: "TenantId", - schema: _schema.Schema, - table: "WorkflowInstances"); - - migrationBuilder.DropColumn( - name: "TenantId", - schema: _schema.Schema, - table: "WorkflowDefinitions"); - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Management/20250222190852_V3_4.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Management/20250222190852_V3_4.Designer.cs deleted file mode 100644 index 9df8562667..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Management/20250222190852_V3_4.Designer.cs +++ /dev/null @@ -1,232 +0,0 @@ -// -using System; -using Elsa.EntityFrameworkCore.Modules.Management; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.MySql.Migrations.Management -{ - [DbContext(typeof(ManagementElsaDbContext))] - [Migration("20250222190852_V3_4")] - partial class V3_4 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "8.0.12") - .HasAnnotation("Relational:MaxIdentifierLength", 64); - - MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder); - - modelBuilder.Entity("Elsa.Workflows.Management.Entities.WorkflowDefinition", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("BinaryData") - .HasColumnType("longblob"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)"); - - b.Property("Data") - .HasColumnType("longtext"); - - b.Property("DefinitionId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("Description") - .HasColumnType("longtext"); - - b.Property("IsLatest") - .HasColumnType("tinyint(1)"); - - b.Property("IsPublished") - .HasColumnType("tinyint(1)"); - - b.Property("IsReadonly") - .HasColumnType("tinyint(1)"); - - b.Property("IsSystem") - .HasColumnType("tinyint(1)"); - - b.Property("MaterializerContext") - .HasColumnType("longtext"); - - b.Property("MaterializerName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Name") - .HasColumnType("varchar(255)"); - - b.Property("ProviderName") - .HasColumnType("longtext"); - - b.Property("StringData") - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("varchar(255)"); - - b.Property("ToolVersion") - .HasColumnType("longtext"); - - b.Property("UsableAsActivity") - .HasColumnType("tinyint(1)"); - - b.Property("Version") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("IsLatest") - .HasDatabaseName("IX_WorkflowDefinition_IsLatest"); - - b.HasIndex("IsPublished") - .HasDatabaseName("IX_WorkflowDefinition_IsPublished"); - - b.HasIndex("IsSystem") - .HasDatabaseName("IX_WorkflowDefinition_IsSystem"); - - b.HasIndex("Name") - .HasDatabaseName("IX_WorkflowDefinition_Name"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_WorkflowDefinition_TenantId"); - - b.HasIndex("UsableAsActivity") - .HasDatabaseName("IX_WorkflowDefinition_UsableAsActivity"); - - b.HasIndex("Version") - .HasDatabaseName("IX_WorkflowDefinition_Version"); - - b.HasIndex("DefinitionId", "Version") - .IsUnique() - .HasDatabaseName("IX_WorkflowDefinition_DefinitionId_Version"); - - b.ToTable("WorkflowDefinitions", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Management.Entities.WorkflowInstance", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("CorrelationId") - .HasColumnType("varchar(255)"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)"); - - b.Property("Data") - .HasColumnType("longtext"); - - b.Property("DataCompressionAlgorithm") - .HasColumnType("longtext"); - - b.Property("DefinitionId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("DefinitionVersionId") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FinishedAt") - .HasColumnType("datetime(6)"); - - b.Property("IncidentCount") - .HasColumnType("int"); - - b.Property("IsExecuting") - .HasColumnType("tinyint(1)"); - - b.Property("IsSystem") - .HasColumnType("tinyint(1)"); - - b.Property("Name") - .HasColumnType("varchar(255)"); - - b.Property("ParentWorkflowInstanceId") - .HasColumnType("longtext"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("SubStatus") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("TenantId") - .HasColumnType("varchar(255)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime(6)"); - - b.Property("Version") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CorrelationId") - .HasDatabaseName("IX_WorkflowInstance_CorrelationId"); - - b.HasIndex("CreatedAt") - .HasDatabaseName("IX_WorkflowInstance_CreatedAt"); - - b.HasIndex("DefinitionId") - .HasDatabaseName("IX_WorkflowInstance_DefinitionId"); - - b.HasIndex("FinishedAt") - .HasDatabaseName("IX_WorkflowInstance_FinishedAt"); - - b.HasIndex("IsExecuting") - .HasDatabaseName("IX_WorkflowInstance_IsExecuting"); - - b.HasIndex("IsSystem") - .HasDatabaseName("IX_WorkflowInstance_IsSystem"); - - b.HasIndex("Name") - .HasDatabaseName("IX_WorkflowInstance_Name"); - - b.HasIndex("Status") - .HasDatabaseName("IX_WorkflowInstance_Status"); - - b.HasIndex("SubStatus") - .HasDatabaseName("IX_WorkflowInstance_SubStatus"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_WorkflowInstance_TenantId"); - - b.HasIndex("UpdatedAt") - .HasDatabaseName("IX_WorkflowInstance_UpdatedAt"); - - b.HasIndex("Status", "DefinitionId") - .HasDatabaseName("IX_WorkflowInstance_Status_DefinitionId"); - - b.HasIndex("Status", "SubStatus") - .HasDatabaseName("IX_WorkflowInstance_Status_SubStatus"); - - b.HasIndex("SubStatus", "DefinitionId") - .HasDatabaseName("IX_WorkflowInstance_SubStatus_DefinitionId"); - - b.HasIndex("Status", "SubStatus", "DefinitionId", "Version") - .HasDatabaseName("IX_WorkflowInstance_Status_SubStatus_DefinitionId_Version"); - - b.ToTable("WorkflowInstances", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Management/20250222190852_V3_4.cs b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Management/20250222190852_V3_4.cs deleted file mode 100644 index f923447c93..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Management/20250222190852_V3_4.cs +++ /dev/null @@ -1,50 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.MySql.Migrations.Management -{ - /// - public partial class V3_4 : Migration - { - private readonly Elsa.EntityFrameworkCore.IElsaDbContextSchema _schema; - - /// - public V3_4(Elsa.EntityFrameworkCore.IElsaDbContextSchema schema) - { - _schema = schema; - } - - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "IsExecuting", - schema: _schema.Schema, - table: "WorkflowInstances", - type: "tinyint(1)", - nullable: false, - defaultValue: false); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowInstance_IsExecuting", - schema: _schema.Schema, - table: "WorkflowInstances", - column: "IsExecuting"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropIndex( - name: "IX_WorkflowInstance_IsExecuting", - schema: _schema.Schema, - table: "WorkflowInstances"); - - migrationBuilder.DropColumn( - name: "IsExecuting", - schema: _schema.Schema, - table: "WorkflowInstances"); - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Management/ManagementElsaDbContextModelSnapshot.cs b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Management/ManagementElsaDbContextModelSnapshot.cs deleted file mode 100644 index 80dfe245ea..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Management/ManagementElsaDbContextModelSnapshot.cs +++ /dev/null @@ -1,229 +0,0 @@ -// -using System; -using Elsa.EntityFrameworkCore.Modules.Management; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.MySql.Migrations.Management -{ - [DbContext(typeof(ManagementElsaDbContext))] - partial class ManagementElsaDbContextModelSnapshot : ModelSnapshot - { - protected override void BuildModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "8.0.12") - .HasAnnotation("Relational:MaxIdentifierLength", 64); - - MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder); - - modelBuilder.Entity("Elsa.Workflows.Management.Entities.WorkflowDefinition", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("BinaryData") - .HasColumnType("longblob"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)"); - - b.Property("Data") - .HasColumnType("longtext"); - - b.Property("DefinitionId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("Description") - .HasColumnType("longtext"); - - b.Property("IsLatest") - .HasColumnType("tinyint(1)"); - - b.Property("IsPublished") - .HasColumnType("tinyint(1)"); - - b.Property("IsReadonly") - .HasColumnType("tinyint(1)"); - - b.Property("IsSystem") - .HasColumnType("tinyint(1)"); - - b.Property("MaterializerContext") - .HasColumnType("longtext"); - - b.Property("MaterializerName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Name") - .HasColumnType("varchar(255)"); - - b.Property("ProviderName") - .HasColumnType("longtext"); - - b.Property("StringData") - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("varchar(255)"); - - b.Property("ToolVersion") - .HasColumnType("longtext"); - - b.Property("UsableAsActivity") - .HasColumnType("tinyint(1)"); - - b.Property("Version") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("IsLatest") - .HasDatabaseName("IX_WorkflowDefinition_IsLatest"); - - b.HasIndex("IsPublished") - .HasDatabaseName("IX_WorkflowDefinition_IsPublished"); - - b.HasIndex("IsSystem") - .HasDatabaseName("IX_WorkflowDefinition_IsSystem"); - - b.HasIndex("Name") - .HasDatabaseName("IX_WorkflowDefinition_Name"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_WorkflowDefinition_TenantId"); - - b.HasIndex("UsableAsActivity") - .HasDatabaseName("IX_WorkflowDefinition_UsableAsActivity"); - - b.HasIndex("Version") - .HasDatabaseName("IX_WorkflowDefinition_Version"); - - b.HasIndex("DefinitionId", "Version") - .IsUnique() - .HasDatabaseName("IX_WorkflowDefinition_DefinitionId_Version"); - - b.ToTable("WorkflowDefinitions", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Management.Entities.WorkflowInstance", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("CorrelationId") - .HasColumnType("varchar(255)"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)"); - - b.Property("Data") - .HasColumnType("longtext"); - - b.Property("DataCompressionAlgorithm") - .HasColumnType("longtext"); - - b.Property("DefinitionId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("DefinitionVersionId") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FinishedAt") - .HasColumnType("datetime(6)"); - - b.Property("IncidentCount") - .HasColumnType("int"); - - b.Property("IsExecuting") - .HasColumnType("tinyint(1)"); - - b.Property("IsSystem") - .HasColumnType("tinyint(1)"); - - b.Property("Name") - .HasColumnType("varchar(255)"); - - b.Property("ParentWorkflowInstanceId") - .HasColumnType("longtext"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("SubStatus") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("TenantId") - .HasColumnType("varchar(255)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime(6)"); - - b.Property("Version") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CorrelationId") - .HasDatabaseName("IX_WorkflowInstance_CorrelationId"); - - b.HasIndex("CreatedAt") - .HasDatabaseName("IX_WorkflowInstance_CreatedAt"); - - b.HasIndex("DefinitionId") - .HasDatabaseName("IX_WorkflowInstance_DefinitionId"); - - b.HasIndex("FinishedAt") - .HasDatabaseName("IX_WorkflowInstance_FinishedAt"); - - b.HasIndex("IsExecuting") - .HasDatabaseName("IX_WorkflowInstance_IsExecuting"); - - b.HasIndex("IsSystem") - .HasDatabaseName("IX_WorkflowInstance_IsSystem"); - - b.HasIndex("Name") - .HasDatabaseName("IX_WorkflowInstance_Name"); - - b.HasIndex("Status") - .HasDatabaseName("IX_WorkflowInstance_Status"); - - b.HasIndex("SubStatus") - .HasDatabaseName("IX_WorkflowInstance_SubStatus"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_WorkflowInstance_TenantId"); - - b.HasIndex("UpdatedAt") - .HasDatabaseName("IX_WorkflowInstance_UpdatedAt"); - - b.HasIndex("Status", "DefinitionId") - .HasDatabaseName("IX_WorkflowInstance_Status_DefinitionId"); - - b.HasIndex("Status", "SubStatus") - .HasDatabaseName("IX_WorkflowInstance_Status_SubStatus"); - - b.HasIndex("SubStatus", "DefinitionId") - .HasDatabaseName("IX_WorkflowInstance_SubStatus_DefinitionId"); - - b.HasIndex("Status", "SubStatus", "DefinitionId", "Version") - .HasDatabaseName("IX_WorkflowInstance_Status_SubStatus_DefinitionId_Version"); - - b.ToTable("WorkflowInstances", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Runtime/20231024160940_Initial.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Runtime/20231024160940_Initial.Designer.cs deleted file mode 100644 index 3760de166f..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Runtime/20231024160940_Initial.Designer.cs +++ /dev/null @@ -1,385 +0,0 @@ -// -using System; -using Elsa.EntityFrameworkCore.Modules.Runtime; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.MySql.Migrations.Runtime -{ - [DbContext(typeof(RuntimeElsaDbContext))] - [Migration("20231024160940_Initial")] - partial class Initial - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "7.0.11") - .HasAnnotation("Relational:MaxIdentifierLength", 64); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.ActivityExecutionRecord", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("ActivityId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("ActivityName") - .HasColumnType("varchar(255)"); - - b.Property("ActivityNodeId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("ActivityType") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("ActivityTypeVersion") - .HasColumnType("int"); - - b.Property("CompletedAt") - .HasColumnType("datetime(6)"); - - b.Property("HasBookmarks") - .HasColumnType("tinyint(1)"); - - b.Property("SerializedActivityState") - .HasColumnType("longtext"); - - b.Property("SerializedException") - .HasColumnType("longtext"); - - b.Property("SerializedOutputs") - .HasColumnType("longtext"); - - b.Property("SerializedPayload") - .HasColumnType("longtext"); - - b.Property("StartedAt") - .HasColumnType("datetime(6)"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("ActivityId") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityId"); - - b.HasIndex("ActivityName") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityName"); - - b.HasIndex("ActivityNodeId") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityNodeId"); - - b.HasIndex("ActivityType") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityType"); - - b.HasIndex("ActivityTypeVersion") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityTypeVersion"); - - b.HasIndex("CompletedAt") - .HasDatabaseName("IX_ActivityExecutionRecord_CompletedAt"); - - b.HasIndex("HasBookmarks") - .HasDatabaseName("IX_ActivityExecutionRecord_HasBookmarks"); - - b.HasIndex("StartedAt") - .HasDatabaseName("IX_ActivityExecutionRecord_StartedAt"); - - b.HasIndex("Status") - .HasDatabaseName("IX_ActivityExecutionRecord_Status"); - - b.HasIndex("WorkflowInstanceId") - .HasDatabaseName("IX_ActivityExecutionRecord_WorkflowInstanceId"); - - b.HasIndex("ActivityType", "ActivityTypeVersion") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityType_ActivityTypeVersion"); - - b.ToTable("ActivityExecutionRecords", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.StoredBookmark", b => - { - b.Property("BookmarkId") - .HasColumnType("varchar(255)"); - - b.Property("ActivityInstanceId") - .HasColumnType("varchar(255)"); - - b.Property("ActivityTypeName") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("CorrelationId") - .HasColumnType("longtext"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)"); - - b.Property("Hash") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("SerializedMetadata") - .HasColumnType("longtext"); - - b.Property("SerializedPayload") - .HasColumnType("longtext"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("BookmarkId"); - - b.HasIndex(new[] { "ActivityInstanceId" }, "IX_StoredBookmark_ActivityInstanceId"); - - b.HasIndex(new[] { "ActivityTypeName" }, "IX_StoredBookmark_ActivityTypeName"); - - b.HasIndex(new[] { "ActivityTypeName", "Hash" }, "IX_StoredBookmark_ActivityTypeName_Hash"); - - b.HasIndex(new[] { "ActivityTypeName", "Hash", "WorkflowInstanceId" }, "IX_StoredBookmark_ActivityTypeName_Hash_WorkflowInstanceId"); - - b.HasIndex(new[] { "CreatedAt" }, "IX_StoredBookmark_CreatedAt"); - - b.HasIndex(new[] { "Hash" }, "IX_StoredBookmark_Hash"); - - b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_StoredBookmark_WorkflowInstanceId"); - - b.ToTable("Bookmarks", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.StoredTrigger", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("ActivityId") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Hash") - .HasColumnType("varchar(255)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("SerializedPayload") - .HasColumnType("longtext"); - - b.Property("WorkflowDefinitionId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("WorkflowDefinitionVersionId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("Hash") - .HasDatabaseName("IX_StoredTrigger_Hash"); - - b.HasIndex("Name") - .HasDatabaseName("IX_StoredTrigger_Name"); - - b.HasIndex("WorkflowDefinitionId") - .HasDatabaseName("IX_StoredTrigger_WorkflowDefinitionId"); - - b.HasIndex("WorkflowDefinitionVersionId") - .HasDatabaseName("IX_StoredTrigger_WorkflowDefinitionVersionId"); - - b.ToTable("Triggers", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.WorkflowExecutionLogRecord", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("ActivityId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("ActivityInstanceId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("ActivityName") - .HasColumnType("varchar(255)"); - - b.Property("ActivityNodeId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("ActivityType") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("ActivityTypeVersion") - .HasColumnType("int"); - - b.Property("EventName") - .HasColumnType("varchar(255)"); - - b.Property("Message") - .HasColumnType("longtext"); - - b.Property("ParentActivityInstanceId") - .HasColumnType("varchar(255)"); - - b.Property("Sequence") - .HasColumnType("bigint"); - - b.Property("SerializedActivityState") - .HasColumnType("longtext"); - - b.Property("SerializedPayload") - .HasColumnType("longtext"); - - b.Property("Source") - .HasColumnType("longtext"); - - b.Property("Timestamp") - .HasColumnType("datetime(6)"); - - b.Property("WorkflowDefinitionId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("WorkflowDefinitionVersionId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("WorkflowVersion") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("ActivityId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityId"); - - b.HasIndex("ActivityInstanceId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityInstanceId"); - - b.HasIndex("ActivityName") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityName"); - - b.HasIndex("ActivityNodeId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityNodeId"); - - b.HasIndex("ActivityType") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityType"); - - b.HasIndex("ActivityTypeVersion") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityTypeVersion"); - - b.HasIndex("EventName") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_EventName"); - - b.HasIndex("ParentActivityInstanceId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ParentActivityInstanceId"); - - b.HasIndex("Sequence") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_Sequence"); - - b.HasIndex("Timestamp") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_Timestamp"); - - b.HasIndex("WorkflowDefinitionId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowDefinitionId"); - - b.HasIndex("WorkflowDefinitionVersionId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowDefinitionVersionId"); - - b.HasIndex("WorkflowInstanceId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowInstanceId"); - - b.HasIndex("WorkflowVersion") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowVersion"); - - b.HasIndex("ActivityType", "ActivityTypeVersion") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityType_ActivityTypeVersion"); - - b.HasIndex("Timestamp", "Sequence") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_Timestamp_Sequence"); - - b.ToTable("WorkflowExecutionLogRecords", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.WorkflowInboxMessage", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("ActivityInstanceId") - .HasColumnType("varchar(255)"); - - b.Property("ActivityTypeName") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("CorrelationId") - .HasColumnType("varchar(255)"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)"); - - b.Property("ExpiresAt") - .HasColumnType("datetime(6)"); - - b.Property("Hash") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("SerializedBookmarkPayload") - .HasColumnType("longtext"); - - b.Property("SerializedInput") - .HasColumnType("longtext"); - - b.Property("WorkflowInstanceId") - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "ActivityInstanceId" }, "IX_WorkflowInboxMessage_ActivityInstanceId"); - - b.HasIndex(new[] { "ActivityTypeName" }, "IX_WorkflowInboxMessage_ActivityTypeName"); - - b.HasIndex(new[] { "CorrelationId" }, "IX_WorkflowInboxMessage_CorrelationId"); - - b.HasIndex(new[] { "CreatedAt" }, "IX_WorkflowInboxMessage_CreatedAt"); - - b.HasIndex(new[] { "ExpiresAt" }, "IX_WorkflowInboxMessage_ExpiresAt"); - - b.HasIndex(new[] { "Hash" }, "IX_WorkflowInboxMessage_Hash"); - - b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_WorkflowInboxMessage_WorkflowInstanceId"); - - b.ToTable("WorkflowInboxMessages", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Runtime/20231024160940_Initial.cs b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Runtime/20231024160940_Initial.cs deleted file mode 100644 index cf3eb698a8..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Runtime/20231024160940_Initial.cs +++ /dev/null @@ -1,489 +0,0 @@ -using Elsa.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.MySql.Migrations.Runtime -{ - /// - public partial class Initial : Migration - { - private readonly IElsaDbContextSchema _schema; - public Initial(IElsaDbContextSchema schema) - { - _schema = schema ?? throw new ArgumentNullException(nameof(schema)); - } - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.EnsureSchema( - name: _schema.Schema); - - migrationBuilder.AlterDatabase() - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateTable( - name: "ActivityExecutionRecords", - schema: _schema.Schema, - columns: table => new - { - Id = table.Column(type: "varchar(255)", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - WorkflowInstanceId = table.Column(type: "varchar(255)", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - ActivityId = table.Column(type: "varchar(255)", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - ActivityNodeId = table.Column(type: "varchar(255)", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - ActivityType = table.Column(type: "varchar(255)", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - ActivityTypeVersion = table.Column(type: "int", nullable: false), - ActivityName = table.Column(type: "varchar(255)", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - StartedAt = table.Column(type: "datetime(6)", nullable: false), - HasBookmarks = table.Column(type: "tinyint(1)", nullable: false), - Status = table.Column(type: "varchar(255)", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - CompletedAt = table.Column(type: "datetime(6)", nullable: true), - SerializedActivityState = table.Column(type: "longtext", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - SerializedException = table.Column(type: "longtext", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - SerializedOutputs = table.Column(type: "longtext", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - SerializedPayload = table.Column(type: "longtext", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4") - }, - constraints: table => - { - table.PrimaryKey("PK_ActivityExecutionRecords", x => x.Id); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateTable( - name: "Bookmarks", - schema: _schema.Schema, - columns: table => new - { - BookmarkId = table.Column(type: "varchar(255)", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - ActivityTypeName = table.Column(type: "varchar(255)", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - Hash = table.Column(type: "varchar(255)", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - WorkflowInstanceId = table.Column(type: "varchar(255)", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - ActivityInstanceId = table.Column(type: "varchar(255)", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - CorrelationId = table.Column(type: "longtext", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - CreatedAt = table.Column(type: "datetime(6)", nullable: false), - SerializedMetadata = table.Column(type: "longtext", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - SerializedPayload = table.Column(type: "longtext", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4") - }, - constraints: table => - { - table.PrimaryKey("PK_Bookmarks", x => x.BookmarkId); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateTable( - name: "Triggers", - schema: _schema.Schema, - columns: table => new - { - Id = table.Column(type: "varchar(255)", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - WorkflowDefinitionId = table.Column(type: "varchar(255)", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - WorkflowDefinitionVersionId = table.Column(type: "varchar(255)", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - Name = table.Column(type: "varchar(255)", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - ActivityId = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - Hash = table.Column(type: "varchar(255)", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - SerializedPayload = table.Column(type: "longtext", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4") - }, - constraints: table => - { - table.PrimaryKey("PK_Triggers", x => x.Id); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateTable( - name: "WorkflowExecutionLogRecords", - schema: _schema.Schema, - columns: table => new - { - Id = table.Column(type: "varchar(255)", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - WorkflowDefinitionId = table.Column(type: "varchar(255)", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - WorkflowDefinitionVersionId = table.Column(type: "varchar(255)", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - WorkflowInstanceId = table.Column(type: "varchar(255)", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - WorkflowVersion = table.Column(type: "int", nullable: false), - ActivityInstanceId = table.Column(type: "varchar(255)", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - ParentActivityInstanceId = table.Column(type: "varchar(255)", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - ActivityId = table.Column(type: "varchar(255)", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - ActivityType = table.Column(type: "varchar(255)", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - ActivityTypeVersion = table.Column(type: "int", nullable: false), - ActivityName = table.Column(type: "varchar(255)", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - ActivityNodeId = table.Column(type: "varchar(255)", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - Timestamp = table.Column(type: "datetime(6)", nullable: false), - Sequence = table.Column(type: "bigint", nullable: false), - EventName = table.Column(type: "varchar(255)", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - Message = table.Column(type: "longtext", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - Source = table.Column(type: "longtext", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - SerializedActivityState = table.Column(type: "longtext", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - SerializedPayload = table.Column(type: "longtext", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4") - }, - constraints: table => - { - table.PrimaryKey("PK_WorkflowExecutionLogRecords", x => x.Id); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateTable( - name: "WorkflowInboxMessages", - schema: _schema.Schema, - columns: table => new - { - Id = table.Column(type: "varchar(255)", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - ActivityTypeName = table.Column(type: "varchar(255)", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - Hash = table.Column(type: "varchar(255)", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - WorkflowInstanceId = table.Column(type: "varchar(255)", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - CorrelationId = table.Column(type: "varchar(255)", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - ActivityInstanceId = table.Column(type: "varchar(255)", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - CreatedAt = table.Column(type: "datetime(6)", nullable: false), - ExpiresAt = table.Column(type: "datetime(6)", nullable: false), - SerializedBookmarkPayload = table.Column(type: "longtext", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - SerializedInput = table.Column(type: "longtext", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4") - }, - constraints: table => - { - table.PrimaryKey("PK_WorkflowInboxMessages", x => x.Id); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateIndex( - name: "IX_ActivityExecutionRecord_ActivityId", - schema: _schema.Schema, - table: "ActivityExecutionRecords", - column: "ActivityId"); - - migrationBuilder.CreateIndex( - name: "IX_ActivityExecutionRecord_ActivityName", - schema: _schema.Schema, - table: "ActivityExecutionRecords", - column: "ActivityName"); - - migrationBuilder.CreateIndex( - name: "IX_ActivityExecutionRecord_ActivityNodeId", - schema: _schema.Schema, - table: "ActivityExecutionRecords", - column: "ActivityNodeId"); - - migrationBuilder.CreateIndex( - name: "IX_ActivityExecutionRecord_ActivityType", - schema: _schema.Schema, - table: "ActivityExecutionRecords", - column: "ActivityType"); - - migrationBuilder.CreateIndex( - name: "IX_ActivityExecutionRecord_ActivityType_ActivityTypeVersion", - schema: _schema.Schema, - table: "ActivityExecutionRecords", - columns: new[] { "ActivityType", "ActivityTypeVersion" }); - - migrationBuilder.CreateIndex( - name: "IX_ActivityExecutionRecord_ActivityTypeVersion", - schema: _schema.Schema, - table: "ActivityExecutionRecords", - column: "ActivityTypeVersion"); - - migrationBuilder.CreateIndex( - name: "IX_ActivityExecutionRecord_CompletedAt", - schema: _schema.Schema, - table: "ActivityExecutionRecords", - column: "CompletedAt"); - - migrationBuilder.CreateIndex( - name: "IX_ActivityExecutionRecord_HasBookmarks", - schema: _schema.Schema, - table: "ActivityExecutionRecords", - column: "HasBookmarks"); - - migrationBuilder.CreateIndex( - name: "IX_ActivityExecutionRecord_StartedAt", - schema: _schema.Schema, - table: "ActivityExecutionRecords", - column: "StartedAt"); - - migrationBuilder.CreateIndex( - name: "IX_ActivityExecutionRecord_Status", - schema: _schema.Schema, - table: "ActivityExecutionRecords", - column: "Status"); - - migrationBuilder.CreateIndex( - name: "IX_ActivityExecutionRecord_WorkflowInstanceId", - schema: _schema.Schema, - table: "ActivityExecutionRecords", - column: "WorkflowInstanceId"); - - migrationBuilder.CreateIndex( - name: "IX_StoredBookmark_ActivityInstanceId", - schema: _schema.Schema, - table: "Bookmarks", - column: "ActivityInstanceId"); - - migrationBuilder.CreateIndex( - name: "IX_StoredBookmark_ActivityTypeName", - schema: _schema.Schema, - table: "Bookmarks", - column: "ActivityTypeName"); - - migrationBuilder.CreateIndex( - name: "IX_StoredBookmark_ActivityTypeName_Hash", - schema: _schema.Schema, - table: "Bookmarks", - columns: new[] { "ActivityTypeName", "Hash" }); - - migrationBuilder.CreateIndex( - name: "IX_StoredBookmark_ActivityTypeName_Hash_WorkflowInstanceId", - schema: _schema.Schema, - table: "Bookmarks", - columns: new[] { "ActivityTypeName", "Hash", "WorkflowInstanceId" }); - - migrationBuilder.CreateIndex( - name: "IX_StoredBookmark_CreatedAt", - schema: _schema.Schema, - table: "Bookmarks", - column: "CreatedAt"); - - migrationBuilder.CreateIndex( - name: "IX_StoredBookmark_Hash", - schema: _schema.Schema, - table: "Bookmarks", - column: "Hash"); - - migrationBuilder.CreateIndex( - name: "IX_StoredBookmark_WorkflowInstanceId", - schema: _schema.Schema, - table: "Bookmarks", - column: "WorkflowInstanceId"); - - migrationBuilder.CreateIndex( - name: "IX_StoredTrigger_Hash", - schema: _schema.Schema, - table: "Triggers", - column: "Hash"); - - migrationBuilder.CreateIndex( - name: "IX_StoredTrigger_Name", - schema: _schema.Schema, - table: "Triggers", - column: "Name"); - - migrationBuilder.CreateIndex( - name: "IX_StoredTrigger_WorkflowDefinitionId", - schema: _schema.Schema, - table: "Triggers", - column: "WorkflowDefinitionId"); - - migrationBuilder.CreateIndex( - name: "IX_StoredTrigger_WorkflowDefinitionVersionId", - schema: _schema.Schema, - table: "Triggers", - column: "WorkflowDefinitionVersionId"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowExecutionLogRecord_ActivityId", - schema: _schema.Schema, - table: "WorkflowExecutionLogRecords", - column: "ActivityId"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowExecutionLogRecord_ActivityInstanceId", - schema: _schema.Schema, - table: "WorkflowExecutionLogRecords", - column: "ActivityInstanceId"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowExecutionLogRecord_ActivityName", - schema: _schema.Schema, - table: "WorkflowExecutionLogRecords", - column: "ActivityName"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowExecutionLogRecord_ActivityNodeId", - schema: _schema.Schema, - table: "WorkflowExecutionLogRecords", - column: "ActivityNodeId"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowExecutionLogRecord_ActivityType", - schema: _schema.Schema, - table: "WorkflowExecutionLogRecords", - column: "ActivityType"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowExecutionLogRecord_ActivityType_ActivityTypeVersion", - schema: _schema.Schema, - table: "WorkflowExecutionLogRecords", - columns: new[] { "ActivityType", "ActivityTypeVersion" }); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowExecutionLogRecord_ActivityTypeVersion", - schema: _schema.Schema, - table: "WorkflowExecutionLogRecords", - column: "ActivityTypeVersion"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowExecutionLogRecord_EventName", - schema: _schema.Schema, - table: "WorkflowExecutionLogRecords", - column: "EventName"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowExecutionLogRecord_ParentActivityInstanceId", - schema: _schema.Schema, - table: "WorkflowExecutionLogRecords", - column: "ParentActivityInstanceId"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowExecutionLogRecord_Sequence", - schema: _schema.Schema, - table: "WorkflowExecutionLogRecords", - column: "Sequence"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowExecutionLogRecord_Timestamp", - schema: _schema.Schema, - table: "WorkflowExecutionLogRecords", - column: "Timestamp"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowExecutionLogRecord_Timestamp_Sequence", - schema: _schema.Schema, - table: "WorkflowExecutionLogRecords", - columns: new[] { "Timestamp", "Sequence" }); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowExecutionLogRecord_WorkflowDefinitionId", - schema: _schema.Schema, - table: "WorkflowExecutionLogRecords", - column: "WorkflowDefinitionId"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowExecutionLogRecord_WorkflowDefinitionVersionId", - schema: _schema.Schema, - table: "WorkflowExecutionLogRecords", - column: "WorkflowDefinitionVersionId"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowExecutionLogRecord_WorkflowInstanceId", - schema: _schema.Schema, - table: "WorkflowExecutionLogRecords", - column: "WorkflowInstanceId"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowExecutionLogRecord_WorkflowVersion", - schema: _schema.Schema, - table: "WorkflowExecutionLogRecords", - column: "WorkflowVersion"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowInboxMessage_ActivityInstanceId", - schema: _schema.Schema, - table: "WorkflowInboxMessages", - column: "ActivityInstanceId"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowInboxMessage_ActivityTypeName", - schema: _schema.Schema, - table: "WorkflowInboxMessages", - column: "ActivityTypeName"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowInboxMessage_CorrelationId", - schema: _schema.Schema, - table: "WorkflowInboxMessages", - column: "CorrelationId"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowInboxMessage_CreatedAt", - schema: _schema.Schema, - table: "WorkflowInboxMessages", - column: "CreatedAt"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowInboxMessage_ExpiresAt", - schema: _schema.Schema, - table: "WorkflowInboxMessages", - column: "ExpiresAt"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowInboxMessage_Hash", - schema: _schema.Schema, - table: "WorkflowInboxMessages", - column: "Hash"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowInboxMessage_WorkflowInstanceId", - schema: _schema.Schema, - table: "WorkflowInboxMessages", - column: "WorkflowInstanceId"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "ActivityExecutionRecords", - schema: _schema.Schema); - - migrationBuilder.DropTable( - name: "Bookmarks", - schema: _schema.Schema); - - migrationBuilder.DropTable( - name: "Triggers", - schema: _schema.Schema); - - migrationBuilder.DropTable( - name: "WorkflowExecutionLogRecords", - schema: _schema.Schema); - - migrationBuilder.DropTable( - name: "WorkflowInboxMessages", - schema: _schema.Schema); - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Runtime/20240329200651_V3_1.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Runtime/20240329200651_V3_1.Designer.cs deleted file mode 100644 index 128d958ffc..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Runtime/20240329200651_V3_1.Designer.cs +++ /dev/null @@ -1,405 +0,0 @@ -// -using System; -using Elsa.EntityFrameworkCore.Modules.Runtime; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.MySql.Migrations.Runtime -{ - [DbContext(typeof(RuntimeElsaDbContext))] - [Migration("20240329200651_V3_1")] - partial class V3_1 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "7.0.14") - .HasAnnotation("Relational:MaxIdentifierLength", 64); - - modelBuilder.Entity("Elsa.KeyValues.Entities.SerializedKeyValuePair", b => - { - b.Property("Key") - .HasColumnType("varchar(255)"); - - b.Property("SerializedValue") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Key"); - - b.ToTable("KeyValuePairs", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.ActivityExecutionRecord", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("ActivityId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("ActivityName") - .HasColumnType("varchar(255)"); - - b.Property("ActivityNodeId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("ActivityType") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("ActivityTypeVersion") - .HasColumnType("int"); - - b.Property("CompletedAt") - .HasColumnType("datetime(6)"); - - b.Property("HasBookmarks") - .HasColumnType("tinyint(1)"); - - b.Property("SerializedActivityState") - .HasColumnType("longtext"); - - b.Property("SerializedActivityStateCompressionAlgorithm") - .HasColumnType("longtext"); - - b.Property("SerializedException") - .HasColumnType("longtext"); - - b.Property("SerializedOutputs") - .HasColumnType("longtext"); - - b.Property("SerializedPayload") - .HasColumnType("longtext"); - - b.Property("SerializedProperties") - .HasColumnType("longtext"); - - b.Property("StartedAt") - .HasColumnType("datetime(6)"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("ActivityId") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityId"); - - b.HasIndex("ActivityName") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityName"); - - b.HasIndex("ActivityNodeId") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityNodeId"); - - b.HasIndex("ActivityType") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityType"); - - b.HasIndex("ActivityTypeVersion") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityTypeVersion"); - - b.HasIndex("CompletedAt") - .HasDatabaseName("IX_ActivityExecutionRecord_CompletedAt"); - - b.HasIndex("HasBookmarks") - .HasDatabaseName("IX_ActivityExecutionRecord_HasBookmarks"); - - b.HasIndex("StartedAt") - .HasDatabaseName("IX_ActivityExecutionRecord_StartedAt"); - - b.HasIndex("Status") - .HasDatabaseName("IX_ActivityExecutionRecord_Status"); - - b.HasIndex("WorkflowInstanceId") - .HasDatabaseName("IX_ActivityExecutionRecord_WorkflowInstanceId"); - - b.HasIndex("ActivityType", "ActivityTypeVersion") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityType_ActivityTypeVersion"); - - b.ToTable("ActivityExecutionRecords", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.StoredBookmark", b => - { - b.Property("BookmarkId") - .HasColumnType("varchar(255)"); - - b.Property("ActivityInstanceId") - .HasColumnType("varchar(255)"); - - b.Property("ActivityTypeName") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("CorrelationId") - .HasColumnType("longtext"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)"); - - b.Property("Hash") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("SerializedMetadata") - .HasColumnType("longtext"); - - b.Property("SerializedPayload") - .HasColumnType("longtext"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("BookmarkId"); - - b.HasIndex(new[] { "ActivityInstanceId" }, "IX_StoredBookmark_ActivityInstanceId"); - - b.HasIndex(new[] { "ActivityTypeName" }, "IX_StoredBookmark_ActivityTypeName"); - - b.HasIndex(new[] { "ActivityTypeName", "Hash" }, "IX_StoredBookmark_ActivityTypeName_Hash"); - - b.HasIndex(new[] { "ActivityTypeName", "Hash", "WorkflowInstanceId" }, "IX_StoredBookmark_ActivityTypeName_Hash_WorkflowInstanceId"); - - b.HasIndex(new[] { "CreatedAt" }, "IX_StoredBookmark_CreatedAt"); - - b.HasIndex(new[] { "Hash" }, "IX_StoredBookmark_Hash"); - - b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_StoredBookmark_WorkflowInstanceId"); - - b.ToTable("Bookmarks", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.StoredTrigger", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("ActivityId") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Hash") - .HasColumnType("varchar(255)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("SerializedPayload") - .HasColumnType("longtext"); - - b.Property("WorkflowDefinitionId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("WorkflowDefinitionVersionId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("Hash") - .HasDatabaseName("IX_StoredTrigger_Hash"); - - b.HasIndex("Name") - .HasDatabaseName("IX_StoredTrigger_Name"); - - b.HasIndex("WorkflowDefinitionId") - .HasDatabaseName("IX_StoredTrigger_WorkflowDefinitionId"); - - b.HasIndex("WorkflowDefinitionVersionId") - .HasDatabaseName("IX_StoredTrigger_WorkflowDefinitionVersionId"); - - b.ToTable("Triggers", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.WorkflowExecutionLogRecord", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("ActivityId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("ActivityInstanceId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("ActivityName") - .HasColumnType("varchar(255)"); - - b.Property("ActivityNodeId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("ActivityType") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("ActivityTypeVersion") - .HasColumnType("int"); - - b.Property("EventName") - .HasColumnType("varchar(255)"); - - b.Property("Message") - .HasColumnType("longtext"); - - b.Property("ParentActivityInstanceId") - .HasColumnType("varchar(255)"); - - b.Property("Sequence") - .HasColumnType("bigint"); - - b.Property("SerializedActivityState") - .HasColumnType("longtext"); - - b.Property("SerializedPayload") - .HasColumnType("longtext"); - - b.Property("Source") - .HasColumnType("longtext"); - - b.Property("Timestamp") - .HasColumnType("datetime(6)"); - - b.Property("WorkflowDefinitionId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("WorkflowDefinitionVersionId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("WorkflowVersion") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("ActivityId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityId"); - - b.HasIndex("ActivityInstanceId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityInstanceId"); - - b.HasIndex("ActivityName") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityName"); - - b.HasIndex("ActivityNodeId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityNodeId"); - - b.HasIndex("ActivityType") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityType"); - - b.HasIndex("ActivityTypeVersion") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityTypeVersion"); - - b.HasIndex("EventName") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_EventName"); - - b.HasIndex("ParentActivityInstanceId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ParentActivityInstanceId"); - - b.HasIndex("Sequence") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_Sequence"); - - b.HasIndex("Timestamp") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_Timestamp"); - - b.HasIndex("WorkflowDefinitionId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowDefinitionId"); - - b.HasIndex("WorkflowDefinitionVersionId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowDefinitionVersionId"); - - b.HasIndex("WorkflowInstanceId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowInstanceId"); - - b.HasIndex("WorkflowVersion") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowVersion"); - - b.HasIndex("ActivityType", "ActivityTypeVersion") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityType_ActivityTypeVersion"); - - b.HasIndex("Timestamp", "Sequence") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_Timestamp_Sequence"); - - b.ToTable("WorkflowExecutionLogRecords", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.WorkflowInboxMessage", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("ActivityInstanceId") - .HasColumnType("varchar(255)"); - - b.Property("ActivityTypeName") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("CorrelationId") - .HasColumnType("varchar(255)"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)"); - - b.Property("ExpiresAt") - .HasColumnType("datetime(6)"); - - b.Property("Hash") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("SerializedBookmarkPayload") - .HasColumnType("longtext"); - - b.Property("SerializedInput") - .HasColumnType("longtext"); - - b.Property("WorkflowInstanceId") - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "ActivityInstanceId" }, "IX_WorkflowInboxMessage_ActivityInstanceId"); - - b.HasIndex(new[] { "ActivityTypeName" }, "IX_WorkflowInboxMessage_ActivityTypeName"); - - b.HasIndex(new[] { "CorrelationId" }, "IX_WorkflowInboxMessage_CorrelationId"); - - b.HasIndex(new[] { "CreatedAt" }, "IX_WorkflowInboxMessage_CreatedAt"); - - b.HasIndex(new[] { "ExpiresAt" }, "IX_WorkflowInboxMessage_ExpiresAt"); - - b.HasIndex(new[] { "Hash" }, "IX_WorkflowInboxMessage_Hash"); - - b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_WorkflowInboxMessage_WorkflowInstanceId"); - - b.ToTable("WorkflowInboxMessages", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Runtime/20240329200651_V3_1.cs b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Runtime/20240329200651_V3_1.cs deleted file mode 100644 index 0092d23c18..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Runtime/20240329200651_V3_1.cs +++ /dev/null @@ -1,72 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.MySql.Migrations.Runtime -{ - /// - public partial class V3_1 : Migration - { - private readonly Elsa.EntityFrameworkCore.IElsaDbContextSchema _schema; - - /// - public V3_1(Elsa.EntityFrameworkCore.IElsaDbContextSchema schema) - { - _schema = schema; - } - - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "SerializedActivityStateCompressionAlgorithm", - schema: _schema.Schema, - table: "ActivityExecutionRecords", - type: "longtext", - nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.AddColumn( - name: "SerializedProperties", - schema: _schema.Schema, - table: "ActivityExecutionRecords", - type: "longtext", - nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateTable( - name: "KeyValuePairs", - schema: _schema.Schema, - columns: table => new - { - Key = table.Column(type: "varchar(255)", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - SerializedValue = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4") - }, - constraints: table => - { - table.PrimaryKey("PK_KeyValuePairs", x => x.Key); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "KeyValuePairs", - schema: _schema.Schema); - - migrationBuilder.DropColumn( - name: "SerializedActivityStateCompressionAlgorithm", - schema: _schema.Schema, - table: "ActivityExecutionRecords"); - - migrationBuilder.DropColumn( - name: "SerializedProperties", - schema: _schema.Schema, - table: "ActivityExecutionRecords"); - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Runtime/20240610184652_V3_2.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Runtime/20240610184652_V3_2.Designer.cs deleted file mode 100644 index 112124942e..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Runtime/20240610184652_V3_2.Designer.cs +++ /dev/null @@ -1,405 +0,0 @@ -// -using System; -using Elsa.EntityFrameworkCore.Modules.Runtime; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.MySql.Migrations.Runtime -{ - [DbContext(typeof(RuntimeElsaDbContext))] - [Migration("20240610184652_V3_2")] - partial class V3_2 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "7.0.20") - .HasAnnotation("Relational:MaxIdentifierLength", 64); - - modelBuilder.Entity("Elsa.KeyValues.Entities.SerializedKeyValuePair", b => - { - b.Property("Key") - .HasColumnType("varchar(255)"); - - b.Property("SerializedValue") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Key"); - - b.ToTable("KeyValuePairs", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.ActivityExecutionRecord", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("ActivityId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("ActivityName") - .HasColumnType("varchar(255)"); - - b.Property("ActivityNodeId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("ActivityType") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("ActivityTypeVersion") - .HasColumnType("int"); - - b.Property("CompletedAt") - .HasColumnType("datetime(6)"); - - b.Property("HasBookmarks") - .HasColumnType("tinyint(1)"); - - b.Property("SerializedActivityState") - .HasColumnType("longtext"); - - b.Property("SerializedActivityStateCompressionAlgorithm") - .HasColumnType("longtext"); - - b.Property("SerializedException") - .HasColumnType("longtext"); - - b.Property("SerializedOutputs") - .HasColumnType("longtext"); - - b.Property("SerializedPayload") - .HasColumnType("longtext"); - - b.Property("SerializedProperties") - .HasColumnType("longtext"); - - b.Property("StartedAt") - .HasColumnType("datetime(6)"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("ActivityId") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityId"); - - b.HasIndex("ActivityName") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityName"); - - b.HasIndex("ActivityNodeId") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityNodeId"); - - b.HasIndex("ActivityType") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityType"); - - b.HasIndex("ActivityTypeVersion") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityTypeVersion"); - - b.HasIndex("CompletedAt") - .HasDatabaseName("IX_ActivityExecutionRecord_CompletedAt"); - - b.HasIndex("HasBookmarks") - .HasDatabaseName("IX_ActivityExecutionRecord_HasBookmarks"); - - b.HasIndex("StartedAt") - .HasDatabaseName("IX_ActivityExecutionRecord_StartedAt"); - - b.HasIndex("Status") - .HasDatabaseName("IX_ActivityExecutionRecord_Status"); - - b.HasIndex("WorkflowInstanceId") - .HasDatabaseName("IX_ActivityExecutionRecord_WorkflowInstanceId"); - - b.HasIndex("ActivityType", "ActivityTypeVersion") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityType_ActivityTypeVersion"); - - b.ToTable("ActivityExecutionRecords", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.StoredBookmark", b => - { - b.Property("BookmarkId") - .HasColumnType("varchar(255)"); - - b.Property("ActivityInstanceId") - .HasColumnType("varchar(255)"); - - b.Property("ActivityTypeName") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("CorrelationId") - .HasColumnType("longtext"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)"); - - b.Property("Hash") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("SerializedMetadata") - .HasColumnType("longtext"); - - b.Property("SerializedPayload") - .HasColumnType("longtext"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("BookmarkId"); - - b.HasIndex(new[] { "ActivityInstanceId" }, "IX_StoredBookmark_ActivityInstanceId"); - - b.HasIndex(new[] { "ActivityTypeName" }, "IX_StoredBookmark_ActivityTypeName"); - - b.HasIndex(new[] { "ActivityTypeName", "Hash" }, "IX_StoredBookmark_ActivityTypeName_Hash"); - - b.HasIndex(new[] { "ActivityTypeName", "Hash", "WorkflowInstanceId" }, "IX_StoredBookmark_ActivityTypeName_Hash_WorkflowInstanceId"); - - b.HasIndex(new[] { "CreatedAt" }, "IX_StoredBookmark_CreatedAt"); - - b.HasIndex(new[] { "Hash" }, "IX_StoredBookmark_Hash"); - - b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_StoredBookmark_WorkflowInstanceId"); - - b.ToTable("Bookmarks", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.StoredTrigger", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("ActivityId") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Hash") - .HasColumnType("varchar(255)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("SerializedPayload") - .HasColumnType("longtext"); - - b.Property("WorkflowDefinitionId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("WorkflowDefinitionVersionId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("Hash") - .HasDatabaseName("IX_StoredTrigger_Hash"); - - b.HasIndex("Name") - .HasDatabaseName("IX_StoredTrigger_Name"); - - b.HasIndex("WorkflowDefinitionId") - .HasDatabaseName("IX_StoredTrigger_WorkflowDefinitionId"); - - b.HasIndex("WorkflowDefinitionVersionId") - .HasDatabaseName("IX_StoredTrigger_WorkflowDefinitionVersionId"); - - b.ToTable("Triggers", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.WorkflowExecutionLogRecord", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("ActivityId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("ActivityInstanceId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("ActivityName") - .HasColumnType("varchar(255)"); - - b.Property("ActivityNodeId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("ActivityType") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("ActivityTypeVersion") - .HasColumnType("int"); - - b.Property("EventName") - .HasColumnType("varchar(255)"); - - b.Property("Message") - .HasColumnType("longtext"); - - b.Property("ParentActivityInstanceId") - .HasColumnType("varchar(255)"); - - b.Property("Sequence") - .HasColumnType("bigint"); - - b.Property("SerializedActivityState") - .HasColumnType("longtext"); - - b.Property("SerializedPayload") - .HasColumnType("longtext"); - - b.Property("Source") - .HasColumnType("longtext"); - - b.Property("Timestamp") - .HasColumnType("datetime(6)"); - - b.Property("WorkflowDefinitionId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("WorkflowDefinitionVersionId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("WorkflowVersion") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("ActivityId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityId"); - - b.HasIndex("ActivityInstanceId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityInstanceId"); - - b.HasIndex("ActivityName") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityName"); - - b.HasIndex("ActivityNodeId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityNodeId"); - - b.HasIndex("ActivityType") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityType"); - - b.HasIndex("ActivityTypeVersion") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityTypeVersion"); - - b.HasIndex("EventName") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_EventName"); - - b.HasIndex("ParentActivityInstanceId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ParentActivityInstanceId"); - - b.HasIndex("Sequence") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_Sequence"); - - b.HasIndex("Timestamp") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_Timestamp"); - - b.HasIndex("WorkflowDefinitionId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowDefinitionId"); - - b.HasIndex("WorkflowDefinitionVersionId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowDefinitionVersionId"); - - b.HasIndex("WorkflowInstanceId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowInstanceId"); - - b.HasIndex("WorkflowVersion") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowVersion"); - - b.HasIndex("ActivityType", "ActivityTypeVersion") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityType_ActivityTypeVersion"); - - b.HasIndex("Timestamp", "Sequence") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_Timestamp_Sequence"); - - b.ToTable("WorkflowExecutionLogRecords", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.WorkflowInboxMessage", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("ActivityInstanceId") - .HasColumnType("varchar(255)"); - - b.Property("ActivityTypeName") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("CorrelationId") - .HasColumnType("varchar(255)"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)"); - - b.Property("ExpiresAt") - .HasColumnType("datetime(6)"); - - b.Property("Hash") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("SerializedBookmarkPayload") - .HasColumnType("longtext"); - - b.Property("SerializedInput") - .HasColumnType("longtext"); - - b.Property("WorkflowInstanceId") - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "ActivityInstanceId" }, "IX_WorkflowInboxMessage_ActivityInstanceId"); - - b.HasIndex(new[] { "ActivityTypeName" }, "IX_WorkflowInboxMessage_ActivityTypeName"); - - b.HasIndex(new[] { "CorrelationId" }, "IX_WorkflowInboxMessage_CorrelationId"); - - b.HasIndex(new[] { "CreatedAt" }, "IX_WorkflowInboxMessage_CreatedAt"); - - b.HasIndex(new[] { "ExpiresAt" }, "IX_WorkflowInboxMessage_ExpiresAt"); - - b.HasIndex(new[] { "Hash" }, "IX_WorkflowInboxMessage_Hash"); - - b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_WorkflowInboxMessage_WorkflowInstanceId"); - - b.ToTable("WorkflowInboxMessages", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Runtime/20240610184652_V3_2.cs b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Runtime/20240610184652_V3_2.cs deleted file mode 100644 index 9787836155..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Runtime/20240610184652_V3_2.cs +++ /dev/null @@ -1,30 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.MySql.Migrations.Runtime -{ - /// - public partial class V3_2 : Migration - { - private readonly Elsa.EntityFrameworkCore.IElsaDbContextSchema _schema; - - /// - public V3_2(Elsa.EntityFrameworkCore.IElsaDbContextSchema schema) - { - _schema = schema; - } - - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Runtime/20250116192733_V3_3.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Runtime/20250116192733_V3_3.Designer.cs deleted file mode 100644 index cd2cae34e6..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Runtime/20250116192733_V3_3.Designer.cs +++ /dev/null @@ -1,492 +0,0 @@ -// -using System; -using Elsa.EntityFrameworkCore.Modules.Runtime; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.MySql.Migrations.Runtime -{ - [DbContext(typeof(RuntimeElsaDbContext))] - [Migration("20250116192733_V3_3")] - partial class V3_3 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "8.0.11") - .HasAnnotation("Relational:MaxIdentifierLength", 64); - - MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder); - - modelBuilder.Entity("Elsa.KeyValues.Entities.SerializedKeyValuePair", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("SerializedValue") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "TenantId" }, "IX_SerializedKeyValuePair_TenantId"); - - b.ToTable("KeyValuePairs", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.ActivityExecutionRecord", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("ActivityId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("ActivityName") - .HasColumnType("varchar(255)"); - - b.Property("ActivityNodeId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("ActivityType") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("ActivityTypeVersion") - .HasColumnType("int"); - - b.Property("CompletedAt") - .HasColumnType("datetime(6)"); - - b.Property("HasBookmarks") - .HasColumnType("tinyint(1)"); - - b.Property("SerializedActivityState") - .HasColumnType("longtext"); - - b.Property("SerializedActivityStateCompressionAlgorithm") - .HasColumnType("longtext"); - - b.Property("SerializedException") - .HasColumnType("longtext"); - - b.Property("SerializedOutputs") - .HasColumnType("longtext"); - - b.Property("SerializedPayload") - .HasColumnType("longtext"); - - b.Property("SerializedProperties") - .HasColumnType("longtext"); - - b.Property("StartedAt") - .HasColumnType("datetime(6)"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("TenantId") - .HasColumnType("varchar(255)"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("ActivityId") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityId"); - - b.HasIndex("ActivityName") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityName"); - - b.HasIndex("ActivityNodeId") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityNodeId"); - - b.HasIndex("ActivityType") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityType"); - - b.HasIndex("ActivityTypeVersion") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityTypeVersion"); - - b.HasIndex("CompletedAt") - .HasDatabaseName("IX_ActivityExecutionRecord_CompletedAt"); - - b.HasIndex("HasBookmarks") - .HasDatabaseName("IX_ActivityExecutionRecord_HasBookmarks"); - - b.HasIndex("StartedAt") - .HasDatabaseName("IX_ActivityExecutionRecord_StartedAt"); - - b.HasIndex("Status") - .HasDatabaseName("IX_ActivityExecutionRecord_Status"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_ActivityExecutionRecord_TenantId"); - - b.HasIndex("WorkflowInstanceId") - .HasDatabaseName("IX_ActivityExecutionRecord_WorkflowInstanceId"); - - b.HasIndex("ActivityType", "ActivityTypeVersion") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityType_ActivityTypeVersion"); - - b.ToTable("ActivityExecutionRecords", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.BookmarkQueueItem", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("ActivityInstanceId") - .HasColumnType("varchar(255)"); - - b.Property("ActivityTypeName") - .HasColumnType("varchar(255)"); - - b.Property("BookmarkId") - .HasColumnType("varchar(255)"); - - b.Property("CorrelationId") - .HasColumnType("varchar(255)"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)"); - - b.Property("SerializedOptions") - .HasColumnType("longtext"); - - b.Property("StimulusHash") - .HasColumnType("varchar(255)"); - - b.Property("TenantId") - .HasColumnType("varchar(255)"); - - b.Property("WorkflowInstanceId") - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "ActivityInstanceId" }, "IX_BookmarkQueueItem_ActivityInstanceId"); - - b.HasIndex(new[] { "ActivityTypeName" }, "IX_BookmarkQueueItem_ActivityTypeName"); - - b.HasIndex(new[] { "BookmarkId" }, "IX_BookmarkQueueItem_BookmarkId"); - - b.HasIndex(new[] { "CorrelationId" }, "IX_BookmarkQueueItem_CorrelationId"); - - b.HasIndex(new[] { "CreatedAt" }, "IX_BookmarkQueueItem_CreatedAt"); - - b.HasIndex(new[] { "StimulusHash" }, "IX_BookmarkQueueItem_StimulusHash"); - - b.HasIndex(new[] { "TenantId" }, "IX_BookmarkQueueItem_TenantId"); - - b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_BookmarkQueueItem_WorkflowInstanceId"); - - b.ToTable("BookmarkQueueItems", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.StoredBookmark", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("ActivityInstanceId") - .HasColumnType("varchar(255)"); - - b.Property("ActivityTypeName") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("CorrelationId") - .HasColumnType("longtext"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)"); - - b.Property("Hash") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("SerializedMetadata") - .HasColumnType("longtext"); - - b.Property("SerializedPayload") - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("varchar(255)"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "ActivityInstanceId" }, "IX_StoredBookmark_ActivityInstanceId"); - - b.HasIndex(new[] { "ActivityTypeName" }, "IX_StoredBookmark_ActivityTypeName"); - - b.HasIndex(new[] { "ActivityTypeName", "Hash" }, "IX_StoredBookmark_ActivityTypeName_Hash"); - - b.HasIndex(new[] { "ActivityTypeName", "Hash", "WorkflowInstanceId" }, "IX_StoredBookmark_ActivityTypeName_Hash_WorkflowInstanceId"); - - b.HasIndex(new[] { "CreatedAt" }, "IX_StoredBookmark_CreatedAt"); - - b.HasIndex(new[] { "Hash" }, "IX_StoredBookmark_Hash"); - - b.HasIndex(new[] { "TenantId" }, "IX_StoredBookmark_TenantId"); - - b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_StoredBookmark_WorkflowInstanceId"); - - b.ToTable("Bookmarks", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.StoredTrigger", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("ActivityId") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Hash") - .HasColumnType("varchar(255)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("SerializedPayload") - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("varchar(255)"); - - b.Property("WorkflowDefinitionId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("WorkflowDefinitionVersionId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("Hash") - .HasDatabaseName("IX_StoredTrigger_Hash"); - - b.HasIndex("Name") - .HasDatabaseName("IX_StoredTrigger_Name"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_StoredTrigger_TenantId"); - - b.HasIndex("WorkflowDefinitionId") - .HasDatabaseName("IX_StoredTrigger_WorkflowDefinitionId"); - - b.HasIndex("WorkflowDefinitionVersionId") - .HasDatabaseName("IX_StoredTrigger_WorkflowDefinitionVersionId"); - - b.ToTable("Triggers", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.WorkflowExecutionLogRecord", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("ActivityId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("ActivityInstanceId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("ActivityName") - .HasColumnType("varchar(255)"); - - b.Property("ActivityNodeId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("ActivityType") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("ActivityTypeVersion") - .HasColumnType("int"); - - b.Property("EventName") - .HasColumnType("varchar(255)"); - - b.Property("Message") - .HasColumnType("longtext"); - - b.Property("ParentActivityInstanceId") - .HasColumnType("varchar(255)"); - - b.Property("Sequence") - .HasColumnType("bigint"); - - b.Property("SerializedActivityState") - .HasColumnType("longtext"); - - b.Property("SerializedPayload") - .HasColumnType("longtext"); - - b.Property("Source") - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("varchar(255)"); - - b.Property("Timestamp") - .HasColumnType("datetime(6)"); - - b.Property("WorkflowDefinitionId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("WorkflowDefinitionVersionId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("WorkflowVersion") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("ActivityId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityId"); - - b.HasIndex("ActivityInstanceId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityInstanceId"); - - b.HasIndex("ActivityName") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityName"); - - b.HasIndex("ActivityNodeId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityNodeId"); - - b.HasIndex("ActivityType") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityType"); - - b.HasIndex("ActivityTypeVersion") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityTypeVersion"); - - b.HasIndex("EventName") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_EventName"); - - b.HasIndex("ParentActivityInstanceId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ParentActivityInstanceId"); - - b.HasIndex("Sequence") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_Sequence"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_TenantId"); - - b.HasIndex("Timestamp") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_Timestamp"); - - b.HasIndex("WorkflowDefinitionId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowDefinitionId"); - - b.HasIndex("WorkflowDefinitionVersionId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowDefinitionVersionId"); - - b.HasIndex("WorkflowInstanceId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowInstanceId"); - - b.HasIndex("WorkflowVersion") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowVersion"); - - b.HasIndex("ActivityType", "ActivityTypeVersion") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityType_ActivityTypeVersion"); - - b.HasIndex("Timestamp", "Sequence") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_Timestamp_Sequence"); - - b.ToTable("WorkflowExecutionLogRecords", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.WorkflowInboxMessage", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("ActivityInstanceId") - .HasColumnType("varchar(255)"); - - b.Property("ActivityTypeName") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("CorrelationId") - .HasColumnType("varchar(255)"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)"); - - b.Property("ExpiresAt") - .HasColumnType("datetime(6)"); - - b.Property("Hash") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("SerializedBookmarkPayload") - .HasColumnType("longtext"); - - b.Property("SerializedInput") - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("longtext"); - - b.Property("WorkflowInstanceId") - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "ActivityInstanceId" }, "IX_WorkflowInboxMessage_ActivityInstanceId"); - - b.HasIndex(new[] { "ActivityTypeName" }, "IX_WorkflowInboxMessage_ActivityTypeName"); - - b.HasIndex(new[] { "CorrelationId" }, "IX_WorkflowInboxMessage_CorrelationId"); - - b.HasIndex(new[] { "CreatedAt" }, "IX_WorkflowInboxMessage_CreatedAt"); - - b.HasIndex(new[] { "ExpiresAt" }, "IX_WorkflowInboxMessage_ExpiresAt"); - - b.HasIndex(new[] { "Hash" }, "IX_WorkflowInboxMessage_Hash"); - - b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_WorkflowInboxMessage_WorkflowInstanceId"); - - b.ToTable("WorkflowInboxMessages", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Runtime/20250116192733_V3_3.cs b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Runtime/20250116192733_V3_3.cs deleted file mode 100644 index d1dc13b38f..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Runtime/20250116192733_V3_3.cs +++ /dev/null @@ -1,267 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.MySql.Migrations.Runtime -{ - /// - public partial class V3_3 : Migration - { - private readonly Elsa.EntityFrameworkCore.IElsaDbContextSchema _schema; - - /// - public V3_3(Elsa.EntityFrameworkCore.IElsaDbContextSchema schema) - { - _schema = schema; - } - - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.RenameColumn( - name: "Key", - schema: _schema.Schema, - table: "KeyValuePairs", - newName: "Id"); - - migrationBuilder.RenameColumn( - name: "BookmarkId", - schema: _schema.Schema, - table: "Bookmarks", - newName: "Id"); - - migrationBuilder.AddColumn( - name: "TenantId", - schema: _schema.Schema, - table: "WorkflowInboxMessages", - type: "longtext", - nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.AddColumn( - name: "TenantId", - schema: _schema.Schema, - table: "WorkflowExecutionLogRecords", - type: "varchar(255)", - nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.AddColumn( - name: "TenantId", - schema: _schema.Schema, - table: "Triggers", - type: "varchar(255)", - nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.AddColumn( - name: "TenantId", - schema: _schema.Schema, - table: "KeyValuePairs", - type: "varchar(255)", - nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.AddColumn( - name: "TenantId", - schema: _schema.Schema, - table: "Bookmarks", - type: "varchar(255)", - nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.AddColumn( - name: "TenantId", - schema: _schema.Schema, - table: "ActivityExecutionRecords", - type: "varchar(255)", - nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateTable( - name: "BookmarkQueueItems", - schema: _schema.Schema, - columns: table => new - { - Id = table.Column(type: "varchar(255)", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - WorkflowInstanceId = table.Column(type: "varchar(255)", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - CorrelationId = table.Column(type: "varchar(255)", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - BookmarkId = table.Column(type: "varchar(255)", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - StimulusHash = table.Column(type: "varchar(255)", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - ActivityInstanceId = table.Column(type: "varchar(255)", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - ActivityTypeName = table.Column(type: "varchar(255)", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - CreatedAt = table.Column(type: "datetime(6)", nullable: false), - SerializedOptions = table.Column(type: "longtext", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - TenantId = table.Column(type: "varchar(255)", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4") - }, - constraints: table => - { - table.PrimaryKey("PK_BookmarkQueueItems", x => x.Id); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowExecutionLogRecord_TenantId", - schema: _schema.Schema, - table: "WorkflowExecutionLogRecords", - column: "TenantId"); - - migrationBuilder.CreateIndex( - name: "IX_StoredTrigger_TenantId", - schema: _schema.Schema, - table: "Triggers", - column: "TenantId"); - - migrationBuilder.CreateIndex( - name: "IX_SerializedKeyValuePair_TenantId", - schema: _schema.Schema, - table: "KeyValuePairs", - column: "TenantId"); - - migrationBuilder.CreateIndex( - name: "IX_StoredBookmark_TenantId", - schema: _schema.Schema, - table: "Bookmarks", - column: "TenantId"); - - migrationBuilder.CreateIndex( - name: "IX_ActivityExecutionRecord_TenantId", - schema: _schema.Schema, - table: "ActivityExecutionRecords", - column: "TenantId"); - - migrationBuilder.CreateIndex( - name: "IX_BookmarkQueueItem_ActivityInstanceId", - schema: _schema.Schema, - table: "BookmarkQueueItems", - column: "ActivityInstanceId"); - - migrationBuilder.CreateIndex( - name: "IX_BookmarkQueueItem_ActivityTypeName", - schema: _schema.Schema, - table: "BookmarkQueueItems", - column: "ActivityTypeName"); - - migrationBuilder.CreateIndex( - name: "IX_BookmarkQueueItem_BookmarkId", - schema: _schema.Schema, - table: "BookmarkQueueItems", - column: "BookmarkId"); - - migrationBuilder.CreateIndex( - name: "IX_BookmarkQueueItem_CorrelationId", - schema: _schema.Schema, - table: "BookmarkQueueItems", - column: "CorrelationId"); - - migrationBuilder.CreateIndex( - name: "IX_BookmarkQueueItem_CreatedAt", - schema: _schema.Schema, - table: "BookmarkQueueItems", - column: "CreatedAt"); - - migrationBuilder.CreateIndex( - name: "IX_BookmarkQueueItem_StimulusHash", - schema: _schema.Schema, - table: "BookmarkQueueItems", - column: "StimulusHash"); - - migrationBuilder.CreateIndex( - name: "IX_BookmarkQueueItem_TenantId", - schema: _schema.Schema, - table: "BookmarkQueueItems", - column: "TenantId"); - - migrationBuilder.CreateIndex( - name: "IX_BookmarkQueueItem_WorkflowInstanceId", - schema: _schema.Schema, - table: "BookmarkQueueItems", - column: "WorkflowInstanceId"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "BookmarkQueueItems", - schema: _schema.Schema); - - migrationBuilder.DropIndex( - name: "IX_WorkflowExecutionLogRecord_TenantId", - schema: _schema.Schema, - table: "WorkflowExecutionLogRecords"); - - migrationBuilder.DropIndex( - name: "IX_StoredTrigger_TenantId", - schema: _schema.Schema, - table: "Triggers"); - - migrationBuilder.DropIndex( - name: "IX_SerializedKeyValuePair_TenantId", - schema: _schema.Schema, - table: "KeyValuePairs"); - - migrationBuilder.DropIndex( - name: "IX_StoredBookmark_TenantId", - schema: _schema.Schema, - table: "Bookmarks"); - - migrationBuilder.DropIndex( - name: "IX_ActivityExecutionRecord_TenantId", - schema: _schema.Schema, - table: "ActivityExecutionRecords"); - - migrationBuilder.DropColumn( - name: "TenantId", - schema: _schema.Schema, - table: "WorkflowInboxMessages"); - - migrationBuilder.DropColumn( - name: "TenantId", - schema: _schema.Schema, - table: "WorkflowExecutionLogRecords"); - - migrationBuilder.DropColumn( - name: "TenantId", - schema: _schema.Schema, - table: "Triggers"); - - migrationBuilder.DropColumn( - name: "TenantId", - schema: _schema.Schema, - table: "KeyValuePairs"); - - migrationBuilder.DropColumn( - name: "TenantId", - schema: _schema.Schema, - table: "Bookmarks"); - - migrationBuilder.DropColumn( - name: "TenantId", - schema: _schema.Schema, - table: "ActivityExecutionRecords"); - - migrationBuilder.RenameColumn( - name: "Id", - schema: _schema.Schema, - table: "KeyValuePairs", - newName: "Key"); - - migrationBuilder.RenameColumn( - name: "Id", - schema: _schema.Schema, - table: "Bookmarks", - newName: "BookmarkId"); - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Runtime/20250222190829_V3_4.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Runtime/20250222190829_V3_4.Designer.cs deleted file mode 100644 index 30bd34012f..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Runtime/20250222190829_V3_4.Designer.cs +++ /dev/null @@ -1,492 +0,0 @@ -// -using System; -using Elsa.EntityFrameworkCore.Modules.Runtime; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.MySql.Migrations.Runtime -{ - [DbContext(typeof(RuntimeElsaDbContext))] - [Migration("20250222190829_V3_4")] - partial class V3_4 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "8.0.12") - .HasAnnotation("Relational:MaxIdentifierLength", 64); - - MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder); - - modelBuilder.Entity("Elsa.KeyValues.Entities.SerializedKeyValuePair", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("SerializedValue") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "TenantId" }, "IX_SerializedKeyValuePair_TenantId"); - - b.ToTable("KeyValuePairs", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.ActivityExecutionRecord", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("ActivityId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("ActivityName") - .HasColumnType("varchar(255)"); - - b.Property("ActivityNodeId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("ActivityType") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("ActivityTypeVersion") - .HasColumnType("int"); - - b.Property("CompletedAt") - .HasColumnType("datetime(6)"); - - b.Property("HasBookmarks") - .HasColumnType("tinyint(1)"); - - b.Property("SerializedActivityState") - .HasColumnType("longtext"); - - b.Property("SerializedActivityStateCompressionAlgorithm") - .HasColumnType("longtext"); - - b.Property("SerializedException") - .HasColumnType("longtext"); - - b.Property("SerializedOutputs") - .HasColumnType("longtext"); - - b.Property("SerializedPayload") - .HasColumnType("longtext"); - - b.Property("SerializedProperties") - .HasColumnType("longtext"); - - b.Property("StartedAt") - .HasColumnType("datetime(6)"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("TenantId") - .HasColumnType("varchar(255)"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("ActivityId") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityId"); - - b.HasIndex("ActivityName") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityName"); - - b.HasIndex("ActivityNodeId") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityNodeId"); - - b.HasIndex("ActivityType") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityType"); - - b.HasIndex("ActivityTypeVersion") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityTypeVersion"); - - b.HasIndex("CompletedAt") - .HasDatabaseName("IX_ActivityExecutionRecord_CompletedAt"); - - b.HasIndex("HasBookmarks") - .HasDatabaseName("IX_ActivityExecutionRecord_HasBookmarks"); - - b.HasIndex("StartedAt") - .HasDatabaseName("IX_ActivityExecutionRecord_StartedAt"); - - b.HasIndex("Status") - .HasDatabaseName("IX_ActivityExecutionRecord_Status"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_ActivityExecutionRecord_TenantId"); - - b.HasIndex("WorkflowInstanceId") - .HasDatabaseName("IX_ActivityExecutionRecord_WorkflowInstanceId"); - - b.HasIndex("ActivityType", "ActivityTypeVersion") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityType_ActivityTypeVersion"); - - b.ToTable("ActivityExecutionRecords", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.BookmarkQueueItem", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("ActivityInstanceId") - .HasColumnType("varchar(255)"); - - b.Property("ActivityTypeName") - .HasColumnType("varchar(255)"); - - b.Property("BookmarkId") - .HasColumnType("varchar(255)"); - - b.Property("CorrelationId") - .HasColumnType("varchar(255)"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)"); - - b.Property("SerializedOptions") - .HasColumnType("longtext"); - - b.Property("StimulusHash") - .HasColumnType("varchar(255)"); - - b.Property("TenantId") - .HasColumnType("varchar(255)"); - - b.Property("WorkflowInstanceId") - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "ActivityInstanceId" }, "IX_BookmarkQueueItem_ActivityInstanceId"); - - b.HasIndex(new[] { "ActivityTypeName" }, "IX_BookmarkQueueItem_ActivityTypeName"); - - b.HasIndex(new[] { "BookmarkId" }, "IX_BookmarkQueueItem_BookmarkId"); - - b.HasIndex(new[] { "CorrelationId" }, "IX_BookmarkQueueItem_CorrelationId"); - - b.HasIndex(new[] { "CreatedAt" }, "IX_BookmarkQueueItem_CreatedAt"); - - b.HasIndex(new[] { "StimulusHash" }, "IX_BookmarkQueueItem_StimulusHash"); - - b.HasIndex(new[] { "TenantId" }, "IX_BookmarkQueueItem_TenantId"); - - b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_BookmarkQueueItem_WorkflowInstanceId"); - - b.ToTable("BookmarkQueueItems", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.StoredBookmark", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("ActivityInstanceId") - .HasColumnType("varchar(255)"); - - b.Property("ActivityTypeName") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("CorrelationId") - .HasColumnType("longtext"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)"); - - b.Property("Hash") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("SerializedMetadata") - .HasColumnType("longtext"); - - b.Property("SerializedPayload") - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("varchar(255)"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "ActivityInstanceId" }, "IX_StoredBookmark_ActivityInstanceId"); - - b.HasIndex(new[] { "ActivityTypeName" }, "IX_StoredBookmark_ActivityTypeName"); - - b.HasIndex(new[] { "ActivityTypeName", "Hash" }, "IX_StoredBookmark_ActivityTypeName_Hash"); - - b.HasIndex(new[] { "ActivityTypeName", "Hash", "WorkflowInstanceId" }, "IX_StoredBookmark_ActivityTypeName_Hash_WorkflowInstanceId"); - - b.HasIndex(new[] { "CreatedAt" }, "IX_StoredBookmark_CreatedAt"); - - b.HasIndex(new[] { "Hash" }, "IX_StoredBookmark_Hash"); - - b.HasIndex(new[] { "TenantId" }, "IX_StoredBookmark_TenantId"); - - b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_StoredBookmark_WorkflowInstanceId"); - - b.ToTable("Bookmarks", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.StoredTrigger", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("ActivityId") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Hash") - .HasColumnType("varchar(255)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("SerializedPayload") - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("varchar(255)"); - - b.Property("WorkflowDefinitionId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("WorkflowDefinitionVersionId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("Hash") - .HasDatabaseName("IX_StoredTrigger_Hash"); - - b.HasIndex("Name") - .HasDatabaseName("IX_StoredTrigger_Name"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_StoredTrigger_TenantId"); - - b.HasIndex("WorkflowDefinitionId") - .HasDatabaseName("IX_StoredTrigger_WorkflowDefinitionId"); - - b.HasIndex("WorkflowDefinitionVersionId") - .HasDatabaseName("IX_StoredTrigger_WorkflowDefinitionVersionId"); - - b.ToTable("Triggers", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.WorkflowExecutionLogRecord", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("ActivityId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("ActivityInstanceId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("ActivityName") - .HasColumnType("varchar(255)"); - - b.Property("ActivityNodeId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("ActivityType") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("ActivityTypeVersion") - .HasColumnType("int"); - - b.Property("EventName") - .HasColumnType("varchar(255)"); - - b.Property("Message") - .HasColumnType("longtext"); - - b.Property("ParentActivityInstanceId") - .HasColumnType("varchar(255)"); - - b.Property("Sequence") - .HasColumnType("bigint"); - - b.Property("SerializedActivityState") - .HasColumnType("longtext"); - - b.Property("SerializedPayload") - .HasColumnType("longtext"); - - b.Property("Source") - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("varchar(255)"); - - b.Property("Timestamp") - .HasColumnType("datetime(6)"); - - b.Property("WorkflowDefinitionId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("WorkflowDefinitionVersionId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("WorkflowVersion") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("ActivityId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityId"); - - b.HasIndex("ActivityInstanceId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityInstanceId"); - - b.HasIndex("ActivityName") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityName"); - - b.HasIndex("ActivityNodeId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityNodeId"); - - b.HasIndex("ActivityType") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityType"); - - b.HasIndex("ActivityTypeVersion") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityTypeVersion"); - - b.HasIndex("EventName") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_EventName"); - - b.HasIndex("ParentActivityInstanceId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ParentActivityInstanceId"); - - b.HasIndex("Sequence") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_Sequence"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_TenantId"); - - b.HasIndex("Timestamp") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_Timestamp"); - - b.HasIndex("WorkflowDefinitionId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowDefinitionId"); - - b.HasIndex("WorkflowDefinitionVersionId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowDefinitionVersionId"); - - b.HasIndex("WorkflowInstanceId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowInstanceId"); - - b.HasIndex("WorkflowVersion") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowVersion"); - - b.HasIndex("ActivityType", "ActivityTypeVersion") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityType_ActivityTypeVersion"); - - b.HasIndex("Timestamp", "Sequence") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_Timestamp_Sequence"); - - b.ToTable("WorkflowExecutionLogRecords", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.WorkflowInboxMessage", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("ActivityInstanceId") - .HasColumnType("varchar(255)"); - - b.Property("ActivityTypeName") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("CorrelationId") - .HasColumnType("varchar(255)"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)"); - - b.Property("ExpiresAt") - .HasColumnType("datetime(6)"); - - b.Property("Hash") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("SerializedBookmarkPayload") - .HasColumnType("longtext"); - - b.Property("SerializedInput") - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("longtext"); - - b.Property("WorkflowInstanceId") - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "ActivityInstanceId" }, "IX_WorkflowInboxMessage_ActivityInstanceId"); - - b.HasIndex(new[] { "ActivityTypeName" }, "IX_WorkflowInboxMessage_ActivityTypeName"); - - b.HasIndex(new[] { "CorrelationId" }, "IX_WorkflowInboxMessage_CorrelationId"); - - b.HasIndex(new[] { "CreatedAt" }, "IX_WorkflowInboxMessage_CreatedAt"); - - b.HasIndex(new[] { "ExpiresAt" }, "IX_WorkflowInboxMessage_ExpiresAt"); - - b.HasIndex(new[] { "Hash" }, "IX_WorkflowInboxMessage_Hash"); - - b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_WorkflowInboxMessage_WorkflowInstanceId"); - - b.ToTable("WorkflowInboxMessages", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Runtime/20250222190829_V3_4.cs b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Runtime/20250222190829_V3_4.cs deleted file mode 100644 index 6ffc46930c..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Runtime/20250222190829_V3_4.cs +++ /dev/null @@ -1,30 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.MySql.Migrations.Runtime -{ - /// - public partial class V3_4 : Migration - { - private readonly Elsa.EntityFrameworkCore.IElsaDbContextSchema _schema; - - /// - public V3_4(Elsa.EntityFrameworkCore.IElsaDbContextSchema schema) - { - _schema = schema; - } - - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Runtime/20250401201339_V3_5.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Runtime/20250401201339_V3_5.Designer.cs deleted file mode 100644 index 653eed2a9d..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Runtime/20250401201339_V3_5.Designer.cs +++ /dev/null @@ -1,503 +0,0 @@ -// -using System; -using Elsa.EntityFrameworkCore.Modules.Runtime; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.MySql.Migrations.Runtime -{ - [DbContext(typeof(RuntimeElsaDbContext))] - [Migration("20250401201339_V3_5")] - partial class V3_5 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "9.0.3") - .HasAnnotation("Relational:MaxIdentifierLength", 64); - - MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder); - - modelBuilder.Entity("Elsa.KeyValues.Entities.SerializedKeyValuePair", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("SerializedValue") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "TenantId" }, "IX_SerializedKeyValuePair_TenantId"); - - b.ToTable("KeyValuePairs", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.ActivityExecutionRecord", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("ActivityId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("ActivityName") - .HasColumnType("varchar(255)"); - - b.Property("ActivityNodeId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("ActivityType") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("ActivityTypeVersion") - .HasColumnType("int"); - - b.Property("AggregateFaultCount") - .HasColumnType("int"); - - b.Property("CompletedAt") - .HasColumnType("datetime(6)"); - - b.Property("HasBookmarks") - .HasColumnType("tinyint(1)"); - - b.Property("SerializedActivityState") - .HasColumnType("longtext"); - - b.Property("SerializedActivityStateCompressionAlgorithm") - .HasColumnType("longtext"); - - b.Property("SerializedException") - .HasColumnType("longtext"); - - b.Property("SerializedOutputs") - .HasColumnType("longtext"); - - b.Property("SerializedPayload") - .HasColumnType("longtext"); - - b.Property("SerializedProperties") - .HasColumnType("longtext"); - - b.Property("StartedAt") - .HasColumnType("datetime(6)"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("TenantId") - .HasColumnType("varchar(255)"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("ActivityId") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityId"); - - b.HasIndex("ActivityName") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityName"); - - b.HasIndex("ActivityNodeId") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityNodeId"); - - b.HasIndex("ActivityType") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityType"); - - b.HasIndex("ActivityTypeVersion") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityTypeVersion"); - - b.HasIndex("CompletedAt") - .HasDatabaseName("IX_ActivityExecutionRecord_CompletedAt"); - - b.HasIndex("HasBookmarks") - .HasDatabaseName("IX_ActivityExecutionRecord_HasBookmarks"); - - b.HasIndex("StartedAt") - .HasDatabaseName("IX_ActivityExecutionRecord_StartedAt"); - - b.HasIndex("Status") - .HasDatabaseName("IX_ActivityExecutionRecord_Status"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_ActivityExecutionRecord_TenantId"); - - b.HasIndex("WorkflowInstanceId") - .HasDatabaseName("IX_ActivityExecutionRecord_WorkflowInstanceId"); - - b.HasIndex("ActivityType", "ActivityTypeVersion") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityType_ActivityTypeVersion"); - - b.ToTable("ActivityExecutionRecords", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.BookmarkQueueItem", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("ActivityInstanceId") - .HasColumnType("varchar(255)"); - - b.Property("ActivityTypeName") - .HasColumnType("varchar(255)"); - - b.Property("BookmarkId") - .HasColumnType("varchar(255)"); - - b.Property("CorrelationId") - .HasColumnType("varchar(255)"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)"); - - b.Property("SerializedOptions") - .HasColumnType("longtext"); - - b.Property("StimulusHash") - .HasColumnType("varchar(255)"); - - b.Property("TenantId") - .HasColumnType("varchar(255)"); - - b.Property("WorkflowInstanceId") - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "ActivityInstanceId" }, "IX_BookmarkQueueItem_ActivityInstanceId"); - - b.HasIndex(new[] { "ActivityTypeName" }, "IX_BookmarkQueueItem_ActivityTypeName"); - - b.HasIndex(new[] { "BookmarkId" }, "IX_BookmarkQueueItem_BookmarkId"); - - b.HasIndex(new[] { "CorrelationId" }, "IX_BookmarkQueueItem_CorrelationId"); - - b.HasIndex(new[] { "CreatedAt" }, "IX_BookmarkQueueItem_CreatedAt"); - - b.HasIndex(new[] { "StimulusHash" }, "IX_BookmarkQueueItem_StimulusHash"); - - b.HasIndex(new[] { "TenantId" }, "IX_BookmarkQueueItem_TenantId"); - - b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_BookmarkQueueItem_WorkflowInstanceId"); - - b.ToTable("BookmarkQueueItems", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.StoredBookmark", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("ActivityInstanceId") - .HasColumnType("varchar(255)"); - - b.Property("ActivityTypeName") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("CorrelationId") - .HasColumnType("longtext"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)"); - - b.Property("Hash") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("Name") - .HasColumnType("varchar(255)"); - - b.Property("SerializedMetadata") - .HasColumnType("longtext"); - - b.Property("SerializedPayload") - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("varchar(255)"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "ActivityInstanceId" }, "IX_StoredBookmark_ActivityInstanceId"); - - b.HasIndex(new[] { "ActivityTypeName" }, "IX_StoredBookmark_ActivityTypeName"); - - b.HasIndex(new[] { "ActivityTypeName", "Hash" }, "IX_StoredBookmark_ActivityTypeName_Hash"); - - b.HasIndex(new[] { "ActivityTypeName", "Hash", "WorkflowInstanceId" }, "IX_StoredBookmark_ActivityTypeName_Hash_WorkflowInstanceId"); - - b.HasIndex(new[] { "CreatedAt" }, "IX_StoredBookmark_CreatedAt"); - - b.HasIndex(new[] { "Hash" }, "IX_StoredBookmark_Hash"); - - b.HasIndex(new[] { "Name" }, "IX_StoredBookmark_Name"); - - b.HasIndex(new[] { "Name", "Hash" }, "IX_StoredBookmark_Name_Hash"); - - b.HasIndex(new[] { "Name", "Hash", "WorkflowInstanceId" }, "IX_StoredBookmark_Name_Hash_WorkflowInstanceId"); - - b.HasIndex(new[] { "TenantId" }, "IX_StoredBookmark_TenantId"); - - b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_StoredBookmark_WorkflowInstanceId"); - - b.ToTable("Bookmarks", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.StoredTrigger", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("ActivityId") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Hash") - .HasColumnType("varchar(255)"); - - b.Property("Name") - .HasColumnType("varchar(255)"); - - b.Property("SerializedPayload") - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("varchar(255)"); - - b.Property("WorkflowDefinitionId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("WorkflowDefinitionVersionId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("Hash") - .HasDatabaseName("IX_StoredTrigger_Hash"); - - b.HasIndex("Name") - .HasDatabaseName("IX_StoredTrigger_Name"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_StoredTrigger_TenantId"); - - b.HasIndex("WorkflowDefinitionId") - .HasDatabaseName("IX_StoredTrigger_WorkflowDefinitionId"); - - b.HasIndex("WorkflowDefinitionVersionId") - .HasDatabaseName("IX_StoredTrigger_WorkflowDefinitionVersionId"); - - b.ToTable("Triggers", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.WorkflowExecutionLogRecord", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("ActivityId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("ActivityInstanceId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("ActivityName") - .HasColumnType("varchar(255)"); - - b.Property("ActivityNodeId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("ActivityType") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("ActivityTypeVersion") - .HasColumnType("int"); - - b.Property("EventName") - .HasColumnType("varchar(255)"); - - b.Property("Message") - .HasColumnType("longtext"); - - b.Property("ParentActivityInstanceId") - .HasColumnType("varchar(255)"); - - b.Property("Sequence") - .HasColumnType("bigint"); - - b.Property("SerializedActivityState") - .HasColumnType("longtext"); - - b.Property("SerializedPayload") - .HasColumnType("longtext"); - - b.Property("Source") - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("varchar(255)"); - - b.Property("Timestamp") - .HasColumnType("datetime(6)"); - - b.Property("WorkflowDefinitionId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("WorkflowDefinitionVersionId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("WorkflowVersion") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("ActivityId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityId"); - - b.HasIndex("ActivityInstanceId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityInstanceId"); - - b.HasIndex("ActivityName") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityName"); - - b.HasIndex("ActivityNodeId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityNodeId"); - - b.HasIndex("ActivityType") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityType"); - - b.HasIndex("ActivityTypeVersion") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityTypeVersion"); - - b.HasIndex("EventName") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_EventName"); - - b.HasIndex("ParentActivityInstanceId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ParentActivityInstanceId"); - - b.HasIndex("Sequence") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_Sequence"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_TenantId"); - - b.HasIndex("Timestamp") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_Timestamp"); - - b.HasIndex("WorkflowDefinitionId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowDefinitionId"); - - b.HasIndex("WorkflowDefinitionVersionId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowDefinitionVersionId"); - - b.HasIndex("WorkflowInstanceId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowInstanceId"); - - b.HasIndex("WorkflowVersion") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowVersion"); - - b.HasIndex("ActivityType", "ActivityTypeVersion") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityType_ActivityTypeVersion"); - - b.HasIndex("Timestamp", "Sequence") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_Timestamp_Sequence"); - - b.ToTable("WorkflowExecutionLogRecords", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.WorkflowInboxMessage", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("ActivityInstanceId") - .HasColumnType("varchar(255)"); - - b.Property("ActivityTypeName") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("CorrelationId") - .HasColumnType("varchar(255)"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)"); - - b.Property("ExpiresAt") - .HasColumnType("datetime(6)"); - - b.Property("Hash") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("SerializedBookmarkPayload") - .HasColumnType("longtext"); - - b.Property("SerializedInput") - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("longtext"); - - b.Property("WorkflowInstanceId") - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "ActivityInstanceId" }, "IX_WorkflowInboxMessage_ActivityInstanceId"); - - b.HasIndex(new[] { "ActivityTypeName" }, "IX_WorkflowInboxMessage_ActivityTypeName"); - - b.HasIndex(new[] { "CorrelationId" }, "IX_WorkflowInboxMessage_CorrelationId"); - - b.HasIndex(new[] { "CreatedAt" }, "IX_WorkflowInboxMessage_CreatedAt"); - - b.HasIndex(new[] { "ExpiresAt" }, "IX_WorkflowInboxMessage_ExpiresAt"); - - b.HasIndex(new[] { "Hash" }, "IX_WorkflowInboxMessage_Hash"); - - b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_WorkflowInboxMessage_WorkflowInstanceId"); - - b.ToTable("WorkflowInboxMessages", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Runtime/20250401201339_V3_5.cs b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Runtime/20250401201339_V3_5.cs deleted file mode 100644 index 330933ca64..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Runtime/20250401201339_V3_5.cs +++ /dev/null @@ -1,116 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.MySql.Migrations.Runtime -{ - /// - public partial class V3_5 : Migration - { - private readonly Elsa.EntityFrameworkCore.IElsaDbContextSchema _schema; - - /// - public V3_5(Elsa.EntityFrameworkCore.IElsaDbContextSchema schema) - { - _schema = schema; - } - - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AlterColumn( - name: "Name", - schema: _schema.Schema, - table: "Triggers", - type: "varchar(255)", - nullable: true, - oldClrType: typeof(string), - oldType: "varchar(255)") - .Annotation("MySql:CharSet", "utf8mb4") - .OldAnnotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.AddColumn( - name: "Name", - schema: _schema.Schema, - table: "Bookmarks", - type: "varchar(255)", - nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.AddColumn( - name: "AggregateFaultCount", - schema: _schema.Schema, - table: "ActivityExecutionRecords", - type: "int", - nullable: false, - defaultValue: 0); - - migrationBuilder.CreateIndex( - name: "IX_StoredBookmark_Name", - schema: _schema.Schema, - table: "Bookmarks", - column: "Name"); - - migrationBuilder.CreateIndex( - name: "IX_StoredBookmark_Name_Hash", - schema: _schema.Schema, - table: "Bookmarks", - columns: new[] { "Name", "Hash" }); - - migrationBuilder.CreateIndex( - name: "IX_StoredBookmark_Name_Hash_WorkflowInstanceId", - schema: _schema.Schema, - table: "Bookmarks", - columns: new[] { "Name", "Hash", "WorkflowInstanceId" }); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropIndex( - name: "IX_StoredBookmark_Name", - schema: _schema.Schema, - table: "Bookmarks"); - - migrationBuilder.DropIndex( - name: "IX_StoredBookmark_Name_Hash", - schema: _schema.Schema, - table: "Bookmarks"); - - migrationBuilder.DropIndex( - name: "IX_StoredBookmark_Name_Hash_WorkflowInstanceId", - schema: _schema.Schema, - table: "Bookmarks"); - - migrationBuilder.DropColumn( - name: "Name", - schema: _schema.Schema, - table: "Bookmarks"); - - migrationBuilder.DropColumn( - name: "AggregateFaultCount", - schema: _schema.Schema, - table: "ActivityExecutionRecords"); - - migrationBuilder.UpdateData( - schema: _schema.Schema, - table: "Triggers", - keyColumn: "Name", - keyValue: null, - column: "Name", - value: ""); - - migrationBuilder.AlterColumn( - name: "Name", - schema: _schema.Schema, - table: "Triggers", - type: "varchar(255)", - nullable: false, - oldClrType: typeof(string), - oldType: "varchar(255)", - oldNullable: true) - .Annotation("MySql:CharSet", "utf8mb4") - .OldAnnotation("MySql:CharSet", "utf8mb4"); - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Runtime/RuntimeElsaDbContextModelSnapshot.cs b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Runtime/RuntimeElsaDbContextModelSnapshot.cs deleted file mode 100644 index a2a433bd31..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Runtime/RuntimeElsaDbContextModelSnapshot.cs +++ /dev/null @@ -1,500 +0,0 @@ -// -using System; -using Elsa.EntityFrameworkCore.Modules.Runtime; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.MySql.Migrations.Runtime -{ - [DbContext(typeof(RuntimeElsaDbContext))] - partial class RuntimeElsaDbContextModelSnapshot : ModelSnapshot - { - protected override void BuildModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "9.0.3") - .HasAnnotation("Relational:MaxIdentifierLength", 64); - - MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder); - - modelBuilder.Entity("Elsa.KeyValues.Entities.SerializedKeyValuePair", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("SerializedValue") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "TenantId" }, "IX_SerializedKeyValuePair_TenantId"); - - b.ToTable("KeyValuePairs", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.ActivityExecutionRecord", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("ActivityId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("ActivityName") - .HasColumnType("varchar(255)"); - - b.Property("ActivityNodeId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("ActivityType") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("ActivityTypeVersion") - .HasColumnType("int"); - - b.Property("AggregateFaultCount") - .HasColumnType("int"); - - b.Property("CompletedAt") - .HasColumnType("datetime(6)"); - - b.Property("HasBookmarks") - .HasColumnType("tinyint(1)"); - - b.Property("SerializedActivityState") - .HasColumnType("longtext"); - - b.Property("SerializedActivityStateCompressionAlgorithm") - .HasColumnType("longtext"); - - b.Property("SerializedException") - .HasColumnType("longtext"); - - b.Property("SerializedOutputs") - .HasColumnType("longtext"); - - b.Property("SerializedPayload") - .HasColumnType("longtext"); - - b.Property("SerializedProperties") - .HasColumnType("longtext"); - - b.Property("StartedAt") - .HasColumnType("datetime(6)"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("TenantId") - .HasColumnType("varchar(255)"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("ActivityId") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityId"); - - b.HasIndex("ActivityName") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityName"); - - b.HasIndex("ActivityNodeId") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityNodeId"); - - b.HasIndex("ActivityType") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityType"); - - b.HasIndex("ActivityTypeVersion") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityTypeVersion"); - - b.HasIndex("CompletedAt") - .HasDatabaseName("IX_ActivityExecutionRecord_CompletedAt"); - - b.HasIndex("HasBookmarks") - .HasDatabaseName("IX_ActivityExecutionRecord_HasBookmarks"); - - b.HasIndex("StartedAt") - .HasDatabaseName("IX_ActivityExecutionRecord_StartedAt"); - - b.HasIndex("Status") - .HasDatabaseName("IX_ActivityExecutionRecord_Status"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_ActivityExecutionRecord_TenantId"); - - b.HasIndex("WorkflowInstanceId") - .HasDatabaseName("IX_ActivityExecutionRecord_WorkflowInstanceId"); - - b.HasIndex("ActivityType", "ActivityTypeVersion") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityType_ActivityTypeVersion"); - - b.ToTable("ActivityExecutionRecords", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.BookmarkQueueItem", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("ActivityInstanceId") - .HasColumnType("varchar(255)"); - - b.Property("ActivityTypeName") - .HasColumnType("varchar(255)"); - - b.Property("BookmarkId") - .HasColumnType("varchar(255)"); - - b.Property("CorrelationId") - .HasColumnType("varchar(255)"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)"); - - b.Property("SerializedOptions") - .HasColumnType("longtext"); - - b.Property("StimulusHash") - .HasColumnType("varchar(255)"); - - b.Property("TenantId") - .HasColumnType("varchar(255)"); - - b.Property("WorkflowInstanceId") - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "ActivityInstanceId" }, "IX_BookmarkQueueItem_ActivityInstanceId"); - - b.HasIndex(new[] { "ActivityTypeName" }, "IX_BookmarkQueueItem_ActivityTypeName"); - - b.HasIndex(new[] { "BookmarkId" }, "IX_BookmarkQueueItem_BookmarkId"); - - b.HasIndex(new[] { "CorrelationId" }, "IX_BookmarkQueueItem_CorrelationId"); - - b.HasIndex(new[] { "CreatedAt" }, "IX_BookmarkQueueItem_CreatedAt"); - - b.HasIndex(new[] { "StimulusHash" }, "IX_BookmarkQueueItem_StimulusHash"); - - b.HasIndex(new[] { "TenantId" }, "IX_BookmarkQueueItem_TenantId"); - - b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_BookmarkQueueItem_WorkflowInstanceId"); - - b.ToTable("BookmarkQueueItems", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.StoredBookmark", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("ActivityInstanceId") - .HasColumnType("varchar(255)"); - - b.Property("ActivityTypeName") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("CorrelationId") - .HasColumnType("longtext"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)"); - - b.Property("Hash") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("Name") - .HasColumnType("varchar(255)"); - - b.Property("SerializedMetadata") - .HasColumnType("longtext"); - - b.Property("SerializedPayload") - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("varchar(255)"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "ActivityInstanceId" }, "IX_StoredBookmark_ActivityInstanceId"); - - b.HasIndex(new[] { "ActivityTypeName" }, "IX_StoredBookmark_ActivityTypeName"); - - b.HasIndex(new[] { "ActivityTypeName", "Hash" }, "IX_StoredBookmark_ActivityTypeName_Hash"); - - b.HasIndex(new[] { "ActivityTypeName", "Hash", "WorkflowInstanceId" }, "IX_StoredBookmark_ActivityTypeName_Hash_WorkflowInstanceId"); - - b.HasIndex(new[] { "CreatedAt" }, "IX_StoredBookmark_CreatedAt"); - - b.HasIndex(new[] { "Hash" }, "IX_StoredBookmark_Hash"); - - b.HasIndex(new[] { "Name" }, "IX_StoredBookmark_Name"); - - b.HasIndex(new[] { "Name", "Hash" }, "IX_StoredBookmark_Name_Hash"); - - b.HasIndex(new[] { "Name", "Hash", "WorkflowInstanceId" }, "IX_StoredBookmark_Name_Hash_WorkflowInstanceId"); - - b.HasIndex(new[] { "TenantId" }, "IX_StoredBookmark_TenantId"); - - b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_StoredBookmark_WorkflowInstanceId"); - - b.ToTable("Bookmarks", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.StoredTrigger", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("ActivityId") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Hash") - .HasColumnType("varchar(255)"); - - b.Property("Name") - .HasColumnType("varchar(255)"); - - b.Property("SerializedPayload") - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("varchar(255)"); - - b.Property("WorkflowDefinitionId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("WorkflowDefinitionVersionId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("Hash") - .HasDatabaseName("IX_StoredTrigger_Hash"); - - b.HasIndex("Name") - .HasDatabaseName("IX_StoredTrigger_Name"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_StoredTrigger_TenantId"); - - b.HasIndex("WorkflowDefinitionId") - .HasDatabaseName("IX_StoredTrigger_WorkflowDefinitionId"); - - b.HasIndex("WorkflowDefinitionVersionId") - .HasDatabaseName("IX_StoredTrigger_WorkflowDefinitionVersionId"); - - b.ToTable("Triggers", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.WorkflowExecutionLogRecord", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("ActivityId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("ActivityInstanceId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("ActivityName") - .HasColumnType("varchar(255)"); - - b.Property("ActivityNodeId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("ActivityType") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("ActivityTypeVersion") - .HasColumnType("int"); - - b.Property("EventName") - .HasColumnType("varchar(255)"); - - b.Property("Message") - .HasColumnType("longtext"); - - b.Property("ParentActivityInstanceId") - .HasColumnType("varchar(255)"); - - b.Property("Sequence") - .HasColumnType("bigint"); - - b.Property("SerializedActivityState") - .HasColumnType("longtext"); - - b.Property("SerializedPayload") - .HasColumnType("longtext"); - - b.Property("Source") - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("varchar(255)"); - - b.Property("Timestamp") - .HasColumnType("datetime(6)"); - - b.Property("WorkflowDefinitionId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("WorkflowDefinitionVersionId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("WorkflowVersion") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("ActivityId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityId"); - - b.HasIndex("ActivityInstanceId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityInstanceId"); - - b.HasIndex("ActivityName") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityName"); - - b.HasIndex("ActivityNodeId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityNodeId"); - - b.HasIndex("ActivityType") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityType"); - - b.HasIndex("ActivityTypeVersion") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityTypeVersion"); - - b.HasIndex("EventName") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_EventName"); - - b.HasIndex("ParentActivityInstanceId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ParentActivityInstanceId"); - - b.HasIndex("Sequence") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_Sequence"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_TenantId"); - - b.HasIndex("Timestamp") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_Timestamp"); - - b.HasIndex("WorkflowDefinitionId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowDefinitionId"); - - b.HasIndex("WorkflowDefinitionVersionId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowDefinitionVersionId"); - - b.HasIndex("WorkflowInstanceId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowInstanceId"); - - b.HasIndex("WorkflowVersion") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowVersion"); - - b.HasIndex("ActivityType", "ActivityTypeVersion") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityType_ActivityTypeVersion"); - - b.HasIndex("Timestamp", "Sequence") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_Timestamp_Sequence"); - - b.ToTable("WorkflowExecutionLogRecords", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.WorkflowInboxMessage", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("ActivityInstanceId") - .HasColumnType("varchar(255)"); - - b.Property("ActivityTypeName") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("CorrelationId") - .HasColumnType("varchar(255)"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)"); - - b.Property("ExpiresAt") - .HasColumnType("datetime(6)"); - - b.Property("Hash") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("SerializedBookmarkPayload") - .HasColumnType("longtext"); - - b.Property("SerializedInput") - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("longtext"); - - b.Property("WorkflowInstanceId") - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "ActivityInstanceId" }, "IX_WorkflowInboxMessage_ActivityInstanceId"); - - b.HasIndex(new[] { "ActivityTypeName" }, "IX_WorkflowInboxMessage_ActivityTypeName"); - - b.HasIndex(new[] { "CorrelationId" }, "IX_WorkflowInboxMessage_CorrelationId"); - - b.HasIndex(new[] { "CreatedAt" }, "IX_WorkflowInboxMessage_CreatedAt"); - - b.HasIndex(new[] { "ExpiresAt" }, "IX_WorkflowInboxMessage_ExpiresAt"); - - b.HasIndex(new[] { "Hash" }, "IX_WorkflowInboxMessage_Hash"); - - b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_WorkflowInboxMessage_WorkflowInstanceId"); - - b.ToTable("WorkflowInboxMessages", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Tenants/20241212212121_V3_3.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Tenants/20241212212121_V3_3.Designer.cs deleted file mode 100644 index 0b4a1b4d75..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Tenants/20241212212121_V3_3.Designer.cs +++ /dev/null @@ -1,54 +0,0 @@ -// -using Elsa.EntityFrameworkCore.Modules.Tenants; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.MySql.Migrations.Tenants -{ - [DbContext(typeof(TenantsElsaDbContext))] - [Migration("20241212212121_V3_3")] - partial class V3_3 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "7.0.20") - .HasAnnotation("Relational:MaxIdentifierLength", 64); - - modelBuilder.Entity("Elsa.Common.Multitenancy.Tenant", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("Configuration") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("TenantId") - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .HasDatabaseName("IX_Tenant_Name"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_Tenant_TenantId"); - - b.ToTable("Tenants", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Tenants/20241212212121_V3_3.cs b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Tenants/20241212212121_V3_3.cs deleted file mode 100644 index a33332d75c..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Tenants/20241212212121_V3_3.cs +++ /dev/null @@ -1,68 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.MySql.Migrations.Tenants -{ - /// - public partial class V3_3 : Migration - { - private readonly Elsa.EntityFrameworkCore.IElsaDbContextSchema _schema; - - /// - public V3_3(Elsa.EntityFrameworkCore.IElsaDbContextSchema schema) - { - _schema = schema; - } - - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.EnsureSchema( - name: "Elsa"); - - migrationBuilder.AlterDatabase() - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateTable( - name: "Tenants", - schema: _schema.Schema, - columns: table => new - { - Id = table.Column(type: "varchar(255)", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - Name = table.Column(type: "varchar(255)", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - Configuration = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - TenantId = table.Column(type: "varchar(255)", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4") - }, - constraints: table => - { - table.PrimaryKey("PK_Tenants", x => x.Id); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateIndex( - name: "IX_Tenant_Name", - schema: _schema.Schema, - table: "Tenants", - column: "Name"); - - migrationBuilder.CreateIndex( - name: "IX_Tenant_TenantId", - schema: _schema.Schema, - table: "Tenants", - column: "TenantId"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "Tenants", - schema: _schema.Schema); - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Tenants/20250222191006_V3_4.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Tenants/20250222191006_V3_4.Designer.cs deleted file mode 100644 index e9659240d0..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Tenants/20250222191006_V3_4.Designer.cs +++ /dev/null @@ -1,57 +0,0 @@ -// -using Elsa.EntityFrameworkCore.Modules.Tenants; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.MySql.Migrations.Tenants -{ - [DbContext(typeof(TenantsElsaDbContext))] - [Migration("20250222191006_V3_4")] - partial class V3_4 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "8.0.12") - .HasAnnotation("Relational:MaxIdentifierLength", 64); - - MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder); - - modelBuilder.Entity("Elsa.Common.Multitenancy.Tenant", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("Configuration") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("TenantId") - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .HasDatabaseName("IX_Tenant_Name"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_Tenant_TenantId"); - - b.ToTable("Tenants", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Tenants/20250222191006_V3_4.cs b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Tenants/20250222191006_V3_4.cs deleted file mode 100644 index b66b5f13fd..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Tenants/20250222191006_V3_4.cs +++ /dev/null @@ -1,30 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.MySql.Migrations.Tenants -{ - /// - public partial class V3_4 : Migration - { - private readonly Elsa.EntityFrameworkCore.IElsaDbContextSchema _schema; - - /// - public V3_4(Elsa.EntityFrameworkCore.IElsaDbContextSchema schema) - { - _schema = schema; - } - - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Tenants/TenantsElsaDbContextModelSnapshot.cs b/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Tenants/TenantsElsaDbContextModelSnapshot.cs deleted file mode 100644 index cec5ae083b..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.MySql/Migrations/Tenants/TenantsElsaDbContextModelSnapshot.cs +++ /dev/null @@ -1,54 +0,0 @@ -// -using Elsa.EntityFrameworkCore.Modules.Tenants; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.MySql.Migrations.Tenants -{ - [DbContext(typeof(TenantsElsaDbContext))] - partial class TenantsElsaDbContextModelSnapshot : ModelSnapshot - { - protected override void BuildModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "8.0.12") - .HasAnnotation("Relational:MaxIdentifierLength", 64); - - MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder); - - modelBuilder.Entity("Elsa.Common.Multitenancy.Tenant", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("Configuration") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("TenantId") - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .HasDatabaseName("IX_Tenant_Name"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_Tenant_TenantId"); - - b.ToTable("Tenants", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.MySql/MySqlProvidersExtensions.cs b/src/modules/Elsa.EntityFrameworkCore.MySql/MySqlProvidersExtensions.cs deleted file mode 100644 index 09ee321e29..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.MySql/MySqlProvidersExtensions.cs +++ /dev/null @@ -1,59 +0,0 @@ -using System.Reflection; -using Microsoft.EntityFrameworkCore.Infrastructure; - -// ReSharper disable once CheckNamespace -namespace Elsa.EntityFrameworkCore.Extensions; - -/// -/// Provides extensions to configure EF Core to use MySQL. -/// -public static class MySqlProvidersExtensions -{ - private static Assembly Assembly => typeof(MySqlProvidersExtensions).Assembly; - - public static TFeature UseMySql(this PersistenceFeatureBase feature, - string connectionString, - ElsaDbContextOptions? options = null, - Action? configure = null) - where TDbContext : ElsaDbContextBase - where TFeature : PersistenceFeatureBase - { - return feature.UseMySql(Assembly, connectionString, options, configure); - } - - public static TFeature UseMySql(this PersistenceFeatureBase feature, - Func connectionStringFunc, - ElsaDbContextOptions? options = null, - Action? configure = null - ) - where TDbContext : ElsaDbContextBase - where TFeature : PersistenceFeatureBase - { - return feature.UseMySql(Assembly, connectionStringFunc, options, configure); - } - - public static TFeature UseMySql(this PersistenceFeatureBase feature, - Assembly migrationsAssembly, - string connectionString, - ElsaDbContextOptions? options = null, - Action? configure = null - ) - where TDbContext : ElsaDbContextBase - where TFeature : PersistenceFeatureBase - { - return feature.UseMySql(migrationsAssembly, _ => connectionString, options, configure); - } - - public static TFeature UseMySql(this PersistenceFeatureBase feature, - Assembly migrationsAssembly, - Func connectionStringFunc, - ElsaDbContextOptions? options = null, - Action? configure = null - ) - where TDbContext : ElsaDbContextBase - where TFeature : PersistenceFeatureBase - { - feature.DbContextOptionsBuilder = (sp, db) => db.UseElsaMySql(migrationsAssembly, connectionStringFunc(sp), options, configure: configure); - return (TFeature)feature; - } -} \ No newline at end of file diff --git a/src/modules/Elsa.EntityFrameworkCore.Oracle/Configurations/Management.cs b/src/modules/Elsa.EntityFrameworkCore.Oracle/Configurations/Management.cs deleted file mode 100644 index 6f9d6e1950..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Oracle/Configurations/Management.cs +++ /dev/null @@ -1,26 +0,0 @@ -using Elsa.Workflows.Management.Entities; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; - -namespace Elsa.EntityFrameworkCore.Oracle.Configurations; - -internal class Management : IEntityTypeConfiguration, IEntityTypeConfiguration -{ - public void Configure(EntityTypeBuilder builder) - { - // In order to use data more than 2000 char we have to use NCLOB. - // In Oracle, we have to explicitly say the column is NCLOB otherwise it would be considered nvarchar(2000). - builder.Property("StringData").HasColumnType("NCLOB"); - builder.Property("Data").HasColumnType("NCLOB"); - builder.Property(x => x.Description).HasColumnType("NCLOB"); - builder.Property(x => x.MaterializerContext).HasColumnType("NCLOB"); - builder.Property(x => x.BinaryData).HasColumnType("BLOB"); - } - - public void Configure(EntityTypeBuilder builder) - { - // In order to use data more than 2000 char we have to use NCLOB. - // In Oracle, we have to explicitly say the column is NCLOB otherwise it would be considered nvarchar(2000). - builder.Property("Data").HasColumnType("NCLOB"); - } -} \ No newline at end of file diff --git a/src/modules/Elsa.EntityFrameworkCore.Oracle/Configurations/Runtime.cs b/src/modules/Elsa.EntityFrameworkCore.Oracle/Configurations/Runtime.cs deleted file mode 100644 index 20eecc6f5f..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Oracle/Configurations/Runtime.cs +++ /dev/null @@ -1,63 +0,0 @@ -using Elsa.Workflows.Runtime.Entities; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; - -namespace Elsa.EntityFrameworkCore.Oracle.Configurations; - -public class Runtime : - IEntityTypeConfiguration, - IEntityTypeConfiguration, - IEntityTypeConfiguration, - IEntityTypeConfiguration, - IEntityTypeConfiguration -{ - /// - public void Configure(EntityTypeBuilder builder) - { - // To use data more than 2000 char we have to use NCLOB. - // In Oracle, we have to explicitly say the column is NCLOB otherwise it would be considered nvarchar(2000). - builder.Property("SerializedActivityState").HasColumnType("NCLOB"); - builder.Property("SerializedException").HasColumnType("NCLOB"); - builder.Property("SerializedPayload").HasColumnType("NCLOB"); - builder.Property("SerializedOutputs").HasColumnType("NCLOB"); - builder.Property("SerializedProperties").HasColumnType("NCLOB"); - } - - /// - public void Configure(EntityTypeBuilder builder) - { - // To use data more than 2000 char we have to use NCLOB. - // In Oracle, we have to explicitly say the column is NCLOB otherwise it would be considered nvarchar(2000). - // modelBuilder.Entity().Ignore(x => x.Payload); - // modelBuilder.Entity().Ignore(x => x.Metadata); - builder.Property("SerializedPayload").HasColumnType("NCLOB"); - builder.Property("SerializedMetadata").HasColumnType("NCLOB"); - } - - /// - public void Configure(EntityTypeBuilder builder) - { - // To use data more than 2000 char we have to use NCLOB. - // In Oracle, we have to explicitly say the column is NCLOB otherwise it would be considered nvarchar(2000). - builder.Property("SerializedPayload").HasColumnType("NCLOB"); - } - - /// - public void Configure(EntityTypeBuilder builder) - { - // To use data more than 2000 char we have to use NCLOB. - // In Oracle, we have to explicitly say the column is NCLOB otherwise it would be considered nvarchar(2000). - builder.Property("SerializedActivityState").HasColumnType("NCLOB"); - builder.Property("SerializedPayload").HasColumnType("NCLOB"); - } - - public void Configure(EntityTypeBuilder builder) - { - // To use data more than 2000 char we have to use NCLOB. - // In Oracle, we have to explicitly say the column is NCLOB otherwise it would be considered nvarchar(2000). - builder.Ignore(x => x.Input); - builder.Ignore(x => x.BookmarkPayload); - builder.Property("SerializedInput").HasColumnType("NCLOB"); - builder.Property("SerializedBookmarkPayload").HasColumnType("NCLOB"); - } -} \ No newline at end of file diff --git a/src/modules/Elsa.EntityFrameworkCore.Oracle/DbContextFactories.cs b/src/modules/Elsa.EntityFrameworkCore.Oracle/DbContextFactories.cs deleted file mode 100644 index d2fa8f28f5..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Oracle/DbContextFactories.cs +++ /dev/null @@ -1,41 +0,0 @@ -using Elsa.EntityFrameworkCore.Abstractions; -using Elsa.EntityFrameworkCore.Extensions; -using Elsa.EntityFrameworkCore.Modules.Alterations; -using Elsa.EntityFrameworkCore.Modules.Identity; -using Elsa.EntityFrameworkCore.Modules.Labels; -using Elsa.EntityFrameworkCore.Modules.Management; -using Elsa.EntityFrameworkCore.Modules.Runtime; -using Elsa.EntityFrameworkCore.Modules.Tenants; -using JetBrains.Annotations; -using Microsoft.EntityFrameworkCore; - -#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member - -namespace Elsa.EntityFrameworkCore.Oracle; - -[UsedImplicitly] -public class IdentityDbContextFactory : OracleDesignTimeDbContextFactory; - -[UsedImplicitly] -public class ManagementDbContextFactory : OracleDesignTimeDbContextFactory; - -[UsedImplicitly] -public class RuntimeDbContextFactory : OracleDesignTimeDbContextFactory; - -[UsedImplicitly] -public class LabelsDbContextFactory : OracleDesignTimeDbContextFactory; - -[UsedImplicitly] -public class AlterationsDbContextFactories : OracleDesignTimeDbContextFactory; - -[UsedImplicitly] -public class TenantsDbContextFactories : OracleDesignTimeDbContextFactory; - -public class OracleDesignTimeDbContextFactory : DesignTimeDbContextFactoryBase where TDbContext : DbContext -{ - protected override void ConfigureBuilder(DbContextOptionsBuilder builder, string connectionString) - { - var options = new ElsaDbContextOptions().Configure(); - builder.UseElsaOracle(GetType().Assembly, connectionString, options); - } -} \ No newline at end of file diff --git a/src/modules/Elsa.EntityFrameworkCore.Oracle/DbContextOptionsBuilder.cs b/src/modules/Elsa.EntityFrameworkCore.Oracle/DbContextOptionsBuilder.cs deleted file mode 100644 index f351339105..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Oracle/DbContextOptionsBuilder.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System.Reflection; -using Microsoft.EntityFrameworkCore; -using Oracle.EntityFrameworkCore.Infrastructure; - -// ReSharper disable once CheckNamespace -namespace Elsa.EntityFrameworkCore.Extensions; - -/// -/// Contains extension methods for . -/// -public static class DbContextOptionsBuilderExtensions -{ - /// - /// Configures Entity Framework Core with Oracle. - /// - public static DbContextOptionsBuilder UseElsaOracle(this DbContextOptionsBuilder builder, Assembly migrationsAssembly, string connectionString, ElsaDbContextOptions? options = null, Action? configure = null) => - builder - .UseElsaDbContextOptions(options) - .UseOracle(connectionString, db => - { - db - .MigrationsAssembly(options.GetMigrationsAssemblyName(migrationsAssembly)) - .MigrationsHistoryTable(options.GetMigrationsHistoryTableName(), options.GetSchemaName()); - - configure?.Invoke(db); - }); -} \ No newline at end of file diff --git a/src/modules/Elsa.EntityFrameworkCore.Oracle/Elsa.EntityFrameworkCore.Oracle.csproj b/src/modules/Elsa.EntityFrameworkCore.Oracle/Elsa.EntityFrameworkCore.Oracle.csproj deleted file mode 100644 index c4ecf6716d..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Oracle/Elsa.EntityFrameworkCore.Oracle.csproj +++ /dev/null @@ -1,24 +0,0 @@ - - - - - Provides Oracle EF Core migrations for various modules. - - elsa module persistence efcore oracle - - - - - - - - - - - - - - - - - diff --git a/src/modules/Elsa.EntityFrameworkCore.Oracle/FodyWeavers.xml b/src/modules/Elsa.EntityFrameworkCore.Oracle/FodyWeavers.xml deleted file mode 100644 index 00e1d9a1c1..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Oracle/FodyWeavers.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/src/modules/Elsa.EntityFrameworkCore.Oracle/Migrations/Alterations/20250131233442_V3_3.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.Oracle/Migrations/Alterations/20250131233442_V3_3.Designer.cs deleted file mode 100644 index c16d8aac2f..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Oracle/Migrations/Alterations/20250131233442_V3_3.Designer.cs +++ /dev/null @@ -1,136 +0,0 @@ -// -using System; -using Elsa.EntityFrameworkCore.Modules.Alterations; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Oracle.EntityFrameworkCore.Metadata; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.Oracle.Migrations.Alterations -{ - [DbContext(typeof(AlterationsElsaDbContext))] - [Migration("20250131233442_V3_3")] - partial class V3_3 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "8.0.12") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - OracleModelBuilderExtensions.UseIdentityColumns(modelBuilder); - - modelBuilder.Entity("Elsa.Alterations.Core.Entities.AlterationJob", b => - { - b.Property("Id") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("CompletedAt") - .HasColumnType("TIMESTAMP(7) WITH TIME ZONE"); - - b.Property("CreatedAt") - .HasColumnType("TIMESTAMP(7) WITH TIME ZONE"); - - b.Property("PlanId") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("SerializedLog") - .HasColumnType("NVARCHAR2(2000)"); - - b.Property("StartedAt") - .HasColumnType("TIMESTAMP(7) WITH TIME ZONE"); - - b.Property("Status") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("TenantId") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.HasKey("Id"); - - b.HasIndex("CompletedAt") - .HasDatabaseName("IX_AlterationJob_CompletedAt"); - - b.HasIndex("CreatedAt") - .HasDatabaseName("IX_AlterationJob_CreatedAt"); - - b.HasIndex("PlanId") - .HasDatabaseName("IX_AlterationJob_PlanId"); - - b.HasIndex("StartedAt") - .HasDatabaseName("IX_AlterationJob_StartedAt"); - - b.HasIndex("Status") - .HasDatabaseName("IX_AlterationJob_Status"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_AlterationJob_TenantId"); - - b.HasIndex("WorkflowInstanceId") - .HasDatabaseName("IX_AlterationJob_WorkflowInstanceId"); - - b.ToTable("AlterationJobs", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Alterations.Core.Entities.AlterationPlan", b => - { - b.Property("Id") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("CompletedAt") - .HasColumnType("TIMESTAMP(7) WITH TIME ZONE"); - - b.Property("CreatedAt") - .HasColumnType("TIMESTAMP(7) WITH TIME ZONE"); - - b.Property("SerializedAlterations") - .HasColumnType("NVARCHAR2(2000)"); - - b.Property("SerializedWorkflowInstanceFilter") - .HasColumnType("NVARCHAR2(2000)"); - - b.Property("StartedAt") - .HasColumnType("TIMESTAMP(7) WITH TIME ZONE"); - - b.Property("Status") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("TenantId") - .HasColumnType("NVARCHAR2(450)"); - - b.HasKey("Id"); - - b.HasIndex("CompletedAt") - .HasDatabaseName("IX_AlterationPlan_CompletedAt"); - - b.HasIndex("CreatedAt") - .HasDatabaseName("IX_AlterationPlan_CreatedAt"); - - b.HasIndex("StartedAt") - .HasDatabaseName("IX_AlterationPlan_StartedAt"); - - b.HasIndex("Status") - .HasDatabaseName("IX_AlterationPlan_Status"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_AlterationPlan_TenantId"); - - b.ToTable("AlterationPlans", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.Oracle/Migrations/Alterations/20250131233442_V3_3.cs b/src/modules/Elsa.EntityFrameworkCore.Oracle/Migrations/Alterations/20250131233442_V3_3.cs deleted file mode 100644 index fb7daa451c..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Oracle/Migrations/Alterations/20250131233442_V3_3.cs +++ /dev/null @@ -1,149 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.Oracle.Migrations.Alterations -{ - /// - public partial class V3_3 : Migration - { - private readonly Elsa.EntityFrameworkCore.IElsaDbContextSchema _schema; - - /// - public V3_3(Elsa.EntityFrameworkCore.IElsaDbContextSchema schema) - { - _schema = schema; - } - - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.EnsureSchema( - name: _schema.Schema); - - migrationBuilder.CreateTable( - name: "AlterationJobs", - schema: _schema.Schema, - columns: table => new - { - Id = table.Column(type: "NVARCHAR2(450)", nullable: false), - PlanId = table.Column(type: "NVARCHAR2(450)", nullable: false), - WorkflowInstanceId = table.Column(type: "NVARCHAR2(450)", nullable: false), - Status = table.Column(type: "NVARCHAR2(450)", nullable: false), - CreatedAt = table.Column(type: "TIMESTAMP(7) WITH TIME ZONE", nullable: false), - StartedAt = table.Column(type: "TIMESTAMP(7) WITH TIME ZONE", nullable: true), - CompletedAt = table.Column(type: "TIMESTAMP(7) WITH TIME ZONE", nullable: true), - SerializedLog = table.Column(type: "NVARCHAR2(2000)", nullable: true), - TenantId = table.Column(type: "NVARCHAR2(450)", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_AlterationJobs", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "AlterationPlans", - schema: _schema.Schema, - columns: table => new - { - Id = table.Column(type: "NVARCHAR2(450)", nullable: false), - Status = table.Column(type: "NVARCHAR2(450)", nullable: false), - CreatedAt = table.Column(type: "TIMESTAMP(7) WITH TIME ZONE", nullable: false), - StartedAt = table.Column(type: "TIMESTAMP(7) WITH TIME ZONE", nullable: true), - CompletedAt = table.Column(type: "TIMESTAMP(7) WITH TIME ZONE", nullable: true), - SerializedAlterations = table.Column(type: "NVARCHAR2(2000)", nullable: true), - SerializedWorkflowInstanceFilter = table.Column(type: "NVARCHAR2(2000)", nullable: true), - TenantId = table.Column(type: "NVARCHAR2(450)", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_AlterationPlans", x => x.Id); - }); - - migrationBuilder.CreateIndex( - name: "IX_AlterationJob_CompletedAt", - schema: _schema.Schema, - table: "AlterationJobs", - column: "CompletedAt"); - - migrationBuilder.CreateIndex( - name: "IX_AlterationJob_CreatedAt", - schema: _schema.Schema, - table: "AlterationJobs", - column: "CreatedAt"); - - migrationBuilder.CreateIndex( - name: "IX_AlterationJob_PlanId", - schema: _schema.Schema, - table: "AlterationJobs", - column: "PlanId"); - - migrationBuilder.CreateIndex( - name: "IX_AlterationJob_StartedAt", - schema: _schema.Schema, - table: "AlterationJobs", - column: "StartedAt"); - - migrationBuilder.CreateIndex( - name: "IX_AlterationJob_Status", - schema: _schema.Schema, - table: "AlterationJobs", - column: "Status"); - - migrationBuilder.CreateIndex( - name: "IX_AlterationJob_TenantId", - schema: _schema.Schema, - table: "AlterationJobs", - column: "TenantId"); - - migrationBuilder.CreateIndex( - name: "IX_AlterationJob_WorkflowInstanceId", - schema: _schema.Schema, - table: "AlterationJobs", - column: "WorkflowInstanceId"); - - migrationBuilder.CreateIndex( - name: "IX_AlterationPlan_CompletedAt", - schema: _schema.Schema, - table: "AlterationPlans", - column: "CompletedAt"); - - migrationBuilder.CreateIndex( - name: "IX_AlterationPlan_CreatedAt", - schema: _schema.Schema, - table: "AlterationPlans", - column: "CreatedAt"); - - migrationBuilder.CreateIndex( - name: "IX_AlterationPlan_StartedAt", - schema: _schema.Schema, - table: "AlterationPlans", - column: "StartedAt"); - - migrationBuilder.CreateIndex( - name: "IX_AlterationPlan_Status", - schema: _schema.Schema, - table: "AlterationPlans", - column: "Status"); - - migrationBuilder.CreateIndex( - name: "IX_AlterationPlan_TenantId", - schema: _schema.Schema, - table: "AlterationPlans", - column: "TenantId"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "AlterationJobs", - schema: _schema.Schema); - - migrationBuilder.DropTable( - name: "AlterationPlans", - schema: _schema.Schema); - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.Oracle/Migrations/Alterations/20250222190824_V3_4.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.Oracle/Migrations/Alterations/20250222190824_V3_4.Designer.cs deleted file mode 100644 index 0acce6a46e..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Oracle/Migrations/Alterations/20250222190824_V3_4.Designer.cs +++ /dev/null @@ -1,136 +0,0 @@ -// -using System; -using Elsa.EntityFrameworkCore.Modules.Alterations; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Oracle.EntityFrameworkCore.Metadata; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.Oracle.Migrations.Alterations -{ - [DbContext(typeof(AlterationsElsaDbContext))] - [Migration("20250222190824_V3_4")] - partial class V3_4 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "8.0.12") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - OracleModelBuilderExtensions.UseIdentityColumns(modelBuilder); - - modelBuilder.Entity("Elsa.Alterations.Core.Entities.AlterationJob", b => - { - b.Property("Id") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("CompletedAt") - .HasColumnType("TIMESTAMP(7) WITH TIME ZONE"); - - b.Property("CreatedAt") - .HasColumnType("TIMESTAMP(7) WITH TIME ZONE"); - - b.Property("PlanId") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("SerializedLog") - .HasColumnType("NVARCHAR2(2000)"); - - b.Property("StartedAt") - .HasColumnType("TIMESTAMP(7) WITH TIME ZONE"); - - b.Property("Status") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("TenantId") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.HasKey("Id"); - - b.HasIndex("CompletedAt") - .HasDatabaseName("IX_AlterationJob_CompletedAt"); - - b.HasIndex("CreatedAt") - .HasDatabaseName("IX_AlterationJob_CreatedAt"); - - b.HasIndex("PlanId") - .HasDatabaseName("IX_AlterationJob_PlanId"); - - b.HasIndex("StartedAt") - .HasDatabaseName("IX_AlterationJob_StartedAt"); - - b.HasIndex("Status") - .HasDatabaseName("IX_AlterationJob_Status"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_AlterationJob_TenantId"); - - b.HasIndex("WorkflowInstanceId") - .HasDatabaseName("IX_AlterationJob_WorkflowInstanceId"); - - b.ToTable("AlterationJobs", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Alterations.Core.Entities.AlterationPlan", b => - { - b.Property("Id") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("CompletedAt") - .HasColumnType("TIMESTAMP(7) WITH TIME ZONE"); - - b.Property("CreatedAt") - .HasColumnType("TIMESTAMP(7) WITH TIME ZONE"); - - b.Property("SerializedAlterations") - .HasColumnType("NVARCHAR2(2000)"); - - b.Property("SerializedWorkflowInstanceFilter") - .HasColumnType("NVARCHAR2(2000)"); - - b.Property("StartedAt") - .HasColumnType("TIMESTAMP(7) WITH TIME ZONE"); - - b.Property("Status") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("TenantId") - .HasColumnType("NVARCHAR2(450)"); - - b.HasKey("Id"); - - b.HasIndex("CompletedAt") - .HasDatabaseName("IX_AlterationPlan_CompletedAt"); - - b.HasIndex("CreatedAt") - .HasDatabaseName("IX_AlterationPlan_CreatedAt"); - - b.HasIndex("StartedAt") - .HasDatabaseName("IX_AlterationPlan_StartedAt"); - - b.HasIndex("Status") - .HasDatabaseName("IX_AlterationPlan_Status"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_AlterationPlan_TenantId"); - - b.ToTable("AlterationPlans", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.Oracle/Migrations/Alterations/20250222190824_V3_4.cs b/src/modules/Elsa.EntityFrameworkCore.Oracle/Migrations/Alterations/20250222190824_V3_4.cs deleted file mode 100644 index f3ddbfae1e..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Oracle/Migrations/Alterations/20250222190824_V3_4.cs +++ /dev/null @@ -1,30 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.Oracle.Migrations.Alterations -{ - /// - public partial class V3_4 : Migration - { - private readonly Elsa.EntityFrameworkCore.IElsaDbContextSchema _schema; - - /// - public V3_4(Elsa.EntityFrameworkCore.IElsaDbContextSchema schema) - { - _schema = schema; - } - - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.Oracle/Migrations/Alterations/AlterationsElsaDbContextModelSnapshot.cs b/src/modules/Elsa.EntityFrameworkCore.Oracle/Migrations/Alterations/AlterationsElsaDbContextModelSnapshot.cs deleted file mode 100644 index 617db12826..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Oracle/Migrations/Alterations/AlterationsElsaDbContextModelSnapshot.cs +++ /dev/null @@ -1,133 +0,0 @@ -// -using System; -using Elsa.EntityFrameworkCore.Modules.Alterations; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Oracle.EntityFrameworkCore.Metadata; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.Oracle.Migrations.Alterations -{ - [DbContext(typeof(AlterationsElsaDbContext))] - partial class AlterationsElsaDbContextModelSnapshot : ModelSnapshot - { - protected override void BuildModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "8.0.12") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - OracleModelBuilderExtensions.UseIdentityColumns(modelBuilder); - - modelBuilder.Entity("Elsa.Alterations.Core.Entities.AlterationJob", b => - { - b.Property("Id") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("CompletedAt") - .HasColumnType("TIMESTAMP(7) WITH TIME ZONE"); - - b.Property("CreatedAt") - .HasColumnType("TIMESTAMP(7) WITH TIME ZONE"); - - b.Property("PlanId") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("SerializedLog") - .HasColumnType("NVARCHAR2(2000)"); - - b.Property("StartedAt") - .HasColumnType("TIMESTAMP(7) WITH TIME ZONE"); - - b.Property("Status") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("TenantId") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.HasKey("Id"); - - b.HasIndex("CompletedAt") - .HasDatabaseName("IX_AlterationJob_CompletedAt"); - - b.HasIndex("CreatedAt") - .HasDatabaseName("IX_AlterationJob_CreatedAt"); - - b.HasIndex("PlanId") - .HasDatabaseName("IX_AlterationJob_PlanId"); - - b.HasIndex("StartedAt") - .HasDatabaseName("IX_AlterationJob_StartedAt"); - - b.HasIndex("Status") - .HasDatabaseName("IX_AlterationJob_Status"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_AlterationJob_TenantId"); - - b.HasIndex("WorkflowInstanceId") - .HasDatabaseName("IX_AlterationJob_WorkflowInstanceId"); - - b.ToTable("AlterationJobs", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Alterations.Core.Entities.AlterationPlan", b => - { - b.Property("Id") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("CompletedAt") - .HasColumnType("TIMESTAMP(7) WITH TIME ZONE"); - - b.Property("CreatedAt") - .HasColumnType("TIMESTAMP(7) WITH TIME ZONE"); - - b.Property("SerializedAlterations") - .HasColumnType("NVARCHAR2(2000)"); - - b.Property("SerializedWorkflowInstanceFilter") - .HasColumnType("NVARCHAR2(2000)"); - - b.Property("StartedAt") - .HasColumnType("TIMESTAMP(7) WITH TIME ZONE"); - - b.Property("Status") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("TenantId") - .HasColumnType("NVARCHAR2(450)"); - - b.HasKey("Id"); - - b.HasIndex("CompletedAt") - .HasDatabaseName("IX_AlterationPlan_CompletedAt"); - - b.HasIndex("CreatedAt") - .HasDatabaseName("IX_AlterationPlan_CreatedAt"); - - b.HasIndex("StartedAt") - .HasDatabaseName("IX_AlterationPlan_StartedAt"); - - b.HasIndex("Status") - .HasDatabaseName("IX_AlterationPlan_Status"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_AlterationPlan_TenantId"); - - b.ToTable("AlterationPlans", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.Oracle/Migrations/Identity/20250131233455_V3_3.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.Oracle/Migrations/Identity/20250131233455_V3_3.Designer.cs deleted file mode 100644 index 9b9a8c12df..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Oracle/Migrations/Identity/20250131233455_V3_3.Designer.cs +++ /dev/null @@ -1,149 +0,0 @@ -// -using Elsa.EntityFrameworkCore.Modules.Identity; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Oracle.EntityFrameworkCore.Metadata; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.Oracle.Migrations.Identity -{ - [DbContext(typeof(IdentityElsaDbContext))] - [Migration("20250131233455_V3_3")] - partial class V3_3 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "8.0.12") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - OracleModelBuilderExtensions.UseIdentityColumns(modelBuilder); - - modelBuilder.Entity("Elsa.Identity.Entities.Application", b => - { - b.Property("Id") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("ClientId") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("HashedApiKey") - .IsRequired() - .HasColumnType("NVARCHAR2(2000)"); - - b.Property("HashedApiKeySalt") - .IsRequired() - .HasColumnType("NVARCHAR2(2000)"); - - b.Property("HashedClientSecret") - .IsRequired() - .HasColumnType("NVARCHAR2(2000)"); - - b.Property("HashedClientSecretSalt") - .IsRequired() - .HasColumnType("NVARCHAR2(2000)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("Roles") - .IsRequired() - .HasColumnType("NVARCHAR2(2000)") - .HasColumnName("Roles"); - - b.Property("TenantId") - .HasColumnType("NVARCHAR2(450)"); - - b.HasKey("Id"); - - b.HasIndex("ClientId") - .IsUnique() - .HasDatabaseName("IX_Application_ClientId"); - - b.HasIndex("Name") - .IsUnique() - .HasDatabaseName("IX_Application_Name"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_Application_TenantId"); - - b.ToTable("Applications", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Identity.Entities.Role", b => - { - b.Property("Id") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("Permissions") - .IsRequired() - .HasColumnType("NVARCHAR2(2000)") - .HasColumnName("Permissions"); - - b.Property("TenantId") - .HasColumnType("NVARCHAR2(450)"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique() - .HasDatabaseName("IX_Role_Name"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_Role_TenantId"); - - b.ToTable("Roles", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Identity.Entities.User", b => - { - b.Property("Id") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("HashedPassword") - .IsRequired() - .HasColumnType("NVARCHAR2(2000)"); - - b.Property("HashedPasswordSalt") - .IsRequired() - .HasColumnType("NVARCHAR2(2000)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("Roles") - .IsRequired() - .HasColumnType("NVARCHAR2(2000)") - .HasColumnName("Roles"); - - b.Property("TenantId") - .HasColumnType("NVARCHAR2(450)"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique() - .HasDatabaseName("IX_User_Name"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_User_TenantId"); - - b.ToTable("Users", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.Oracle/Migrations/Identity/20250131233455_V3_3.cs b/src/modules/Elsa.EntityFrameworkCore.Oracle/Migrations/Identity/20250131233455_V3_3.cs deleted file mode 100644 index 37d23e3294..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Oracle/Migrations/Identity/20250131233455_V3_3.cs +++ /dev/null @@ -1,139 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.Oracle.Migrations.Identity -{ - /// - public partial class V3_3 : Migration - { - private readonly Elsa.EntityFrameworkCore.IElsaDbContextSchema _schema; - - /// - public V3_3(Elsa.EntityFrameworkCore.IElsaDbContextSchema schema) - { - _schema = schema; - } - - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.EnsureSchema( - _schema.Schema); - - migrationBuilder.CreateTable( - name: "Applications", - schema: _schema.Schema, - columns: table => new - { - Id = table.Column(type: "NVARCHAR2(450)", nullable: false), - ClientId = table.Column(type: "NVARCHAR2(450)", nullable: false), - HashedClientSecret = table.Column(type: "NVARCHAR2(2000)", nullable: false), - HashedClientSecretSalt = table.Column(type: "NVARCHAR2(2000)", nullable: false), - Name = table.Column(type: "NVARCHAR2(450)", nullable: false), - HashedApiKey = table.Column(type: "NVARCHAR2(2000)", nullable: false), - HashedApiKeySalt = table.Column(type: "NVARCHAR2(2000)", nullable: false), - Roles = table.Column(type: "NVARCHAR2(2000)", nullable: false), - TenantId = table.Column(type: "NVARCHAR2(450)", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Applications", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "Roles", - schema: _schema.Schema, - columns: table => new - { - Id = table.Column(type: "NVARCHAR2(450)", nullable: false), - Name = table.Column(type: "NVARCHAR2(450)", nullable: false), - Permissions = table.Column(type: "NVARCHAR2(2000)", nullable: false), - TenantId = table.Column(type: "NVARCHAR2(450)", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Roles", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "Users", - schema: _schema.Schema, - columns: table => new - { - Id = table.Column(type: "NVARCHAR2(450)", nullable: false), - Name = table.Column(type: "NVARCHAR2(450)", nullable: false), - HashedPassword = table.Column(type: "NVARCHAR2(2000)", nullable: false), - HashedPasswordSalt = table.Column(type: "NVARCHAR2(2000)", nullable: false), - Roles = table.Column(type: "NVARCHAR2(2000)", nullable: false), - TenantId = table.Column(type: "NVARCHAR2(450)", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Users", x => x.Id); - }); - - migrationBuilder.CreateIndex( - name: "IX_Application_ClientId", - schema: _schema.Schema, - table: "Applications", - column: "ClientId", - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_Application_Name", - schema: _schema.Schema, - table: "Applications", - column: "Name", - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_Application_TenantId", - schema: _schema.Schema, - table: "Applications", - column: "TenantId"); - - migrationBuilder.CreateIndex( - name: "IX_Role_Name", - schema: _schema.Schema, - table: "Roles", - column: "Name", - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_Role_TenantId", - schema: _schema.Schema, - table: "Roles", - column: "TenantId"); - - migrationBuilder.CreateIndex( - name: "IX_User_Name", - schema: _schema.Schema, - table: "Users", - column: "Name", - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_User_TenantId", - schema: _schema.Schema, - table: "Users", - column: "TenantId"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "Applications", - schema: _schema.Schema); - - migrationBuilder.DropTable( - name: "Roles", - schema: _schema.Schema); - - migrationBuilder.DropTable( - name: "Users", - schema: _schema.Schema); - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.Oracle/Migrations/Identity/20250222190935_V3_4.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.Oracle/Migrations/Identity/20250222190935_V3_4.Designer.cs deleted file mode 100644 index ba2eb71547..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Oracle/Migrations/Identity/20250222190935_V3_4.Designer.cs +++ /dev/null @@ -1,149 +0,0 @@ -// -using Elsa.EntityFrameworkCore.Modules.Identity; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Oracle.EntityFrameworkCore.Metadata; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.Oracle.Migrations.Identity -{ - [DbContext(typeof(IdentityElsaDbContext))] - [Migration("20250222190935_V3_4")] - partial class V3_4 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "8.0.12") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - OracleModelBuilderExtensions.UseIdentityColumns(modelBuilder); - - modelBuilder.Entity("Elsa.Identity.Entities.Application", b => - { - b.Property("Id") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("ClientId") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("HashedApiKey") - .IsRequired() - .HasColumnType("NVARCHAR2(2000)"); - - b.Property("HashedApiKeySalt") - .IsRequired() - .HasColumnType("NVARCHAR2(2000)"); - - b.Property("HashedClientSecret") - .IsRequired() - .HasColumnType("NVARCHAR2(2000)"); - - b.Property("HashedClientSecretSalt") - .IsRequired() - .HasColumnType("NVARCHAR2(2000)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("Roles") - .IsRequired() - .HasColumnType("NVARCHAR2(2000)") - .HasColumnName("Roles"); - - b.Property("TenantId") - .HasColumnType("NVARCHAR2(450)"); - - b.HasKey("Id"); - - b.HasIndex("ClientId") - .IsUnique() - .HasDatabaseName("IX_Application_ClientId"); - - b.HasIndex("Name") - .IsUnique() - .HasDatabaseName("IX_Application_Name"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_Application_TenantId"); - - b.ToTable("Applications", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Identity.Entities.Role", b => - { - b.Property("Id") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("Permissions") - .IsRequired() - .HasColumnType("NVARCHAR2(2000)") - .HasColumnName("Permissions"); - - b.Property("TenantId") - .HasColumnType("NVARCHAR2(450)"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique() - .HasDatabaseName("IX_Role_Name"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_Role_TenantId"); - - b.ToTable("Roles", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Identity.Entities.User", b => - { - b.Property("Id") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("HashedPassword") - .IsRequired() - .HasColumnType("NVARCHAR2(2000)"); - - b.Property("HashedPasswordSalt") - .IsRequired() - .HasColumnType("NVARCHAR2(2000)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("Roles") - .IsRequired() - .HasColumnType("NVARCHAR2(2000)") - .HasColumnName("Roles"); - - b.Property("TenantId") - .HasColumnType("NVARCHAR2(450)"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique() - .HasDatabaseName("IX_User_Name"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_User_TenantId"); - - b.ToTable("Users", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.Oracle/Migrations/Identity/20250222190935_V3_4.cs b/src/modules/Elsa.EntityFrameworkCore.Oracle/Migrations/Identity/20250222190935_V3_4.cs deleted file mode 100644 index 8ccbf8717c..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Oracle/Migrations/Identity/20250222190935_V3_4.cs +++ /dev/null @@ -1,30 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.Oracle.Migrations.Identity -{ - /// - public partial class V3_4 : Migration - { - private readonly Elsa.EntityFrameworkCore.IElsaDbContextSchema _schema; - - /// - public V3_4(Elsa.EntityFrameworkCore.IElsaDbContextSchema schema) - { - _schema = schema; - } - - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.Oracle/Migrations/Identity/IdentityElsaDbContextModelSnapshot.cs b/src/modules/Elsa.EntityFrameworkCore.Oracle/Migrations/Identity/IdentityElsaDbContextModelSnapshot.cs deleted file mode 100644 index aabcce6cb7..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Oracle/Migrations/Identity/IdentityElsaDbContextModelSnapshot.cs +++ /dev/null @@ -1,146 +0,0 @@ -// -using Elsa.EntityFrameworkCore.Modules.Identity; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Oracle.EntityFrameworkCore.Metadata; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.Oracle.Migrations.Identity -{ - [DbContext(typeof(IdentityElsaDbContext))] - partial class IdentityElsaDbContextModelSnapshot : ModelSnapshot - { - protected override void BuildModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "8.0.12") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - OracleModelBuilderExtensions.UseIdentityColumns(modelBuilder); - - modelBuilder.Entity("Elsa.Identity.Entities.Application", b => - { - b.Property("Id") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("ClientId") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("HashedApiKey") - .IsRequired() - .HasColumnType("NVARCHAR2(2000)"); - - b.Property("HashedApiKeySalt") - .IsRequired() - .HasColumnType("NVARCHAR2(2000)"); - - b.Property("HashedClientSecret") - .IsRequired() - .HasColumnType("NVARCHAR2(2000)"); - - b.Property("HashedClientSecretSalt") - .IsRequired() - .HasColumnType("NVARCHAR2(2000)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("Roles") - .IsRequired() - .HasColumnType("NVARCHAR2(2000)") - .HasColumnName("Roles"); - - b.Property("TenantId") - .HasColumnType("NVARCHAR2(450)"); - - b.HasKey("Id"); - - b.HasIndex("ClientId") - .IsUnique() - .HasDatabaseName("IX_Application_ClientId"); - - b.HasIndex("Name") - .IsUnique() - .HasDatabaseName("IX_Application_Name"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_Application_TenantId"); - - b.ToTable("Applications", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Identity.Entities.Role", b => - { - b.Property("Id") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("Permissions") - .IsRequired() - .HasColumnType("NVARCHAR2(2000)") - .HasColumnName("Permissions"); - - b.Property("TenantId") - .HasColumnType("NVARCHAR2(450)"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique() - .HasDatabaseName("IX_Role_Name"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_Role_TenantId"); - - b.ToTable("Roles", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Identity.Entities.User", b => - { - b.Property("Id") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("HashedPassword") - .IsRequired() - .HasColumnType("NVARCHAR2(2000)"); - - b.Property("HashedPasswordSalt") - .IsRequired() - .HasColumnType("NVARCHAR2(2000)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("Roles") - .IsRequired() - .HasColumnType("NVARCHAR2(2000)") - .HasColumnName("Roles"); - - b.Property("TenantId") - .HasColumnType("NVARCHAR2(450)"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique() - .HasDatabaseName("IX_User_Name"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_User_TenantId"); - - b.ToTable("Users", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.Oracle/Migrations/Labels/20250131233459_V3_3.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.Oracle/Migrations/Labels/20250131233459_V3_3.Designer.cs deleted file mode 100644 index 8f95ac0677..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Oracle/Migrations/Labels/20250131233459_V3_3.Designer.cs +++ /dev/null @@ -1,94 +0,0 @@ -// -using Elsa.EntityFrameworkCore.Modules.Labels; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Oracle.EntityFrameworkCore.Metadata; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.Oracle.Migrations.Labels -{ - [DbContext(typeof(LabelsElsaDbContext))] - [Migration("20250131233459_V3_3")] - partial class V3_3 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "8.0.12") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - OracleModelBuilderExtensions.UseIdentityColumns(modelBuilder); - - modelBuilder.Entity("Elsa.Labels.Entities.Label", b => - { - b.Property("Id") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("Color") - .HasColumnType("NVARCHAR2(2000)"); - - b.Property("Description") - .HasColumnType("NVARCHAR2(2000)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("NVARCHAR2(2000)"); - - b.Property("NormalizedName") - .IsRequired() - .HasColumnType("NVARCHAR2(2000)"); - - b.Property("TenantId") - .HasColumnType("NVARCHAR2(2000)"); - - b.HasKey("Id"); - - b.ToTable("Labels", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Labels.Entities.WorkflowDefinitionLabel", b => - { - b.Property("Id") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("LabelId") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("TenantId") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("WorkflowDefinitionId") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("WorkflowDefinitionVersionId") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.HasKey("Id"); - - b.HasIndex("LabelId") - .HasDatabaseName("WorkflowDefinitionLabel_LabelId"); - - b.HasIndex("TenantId") - .HasDatabaseName("WorkflowDefinitionLabel_TenantId"); - - b.HasIndex("WorkflowDefinitionId") - .HasDatabaseName("WorkflowDefinitionLabel_WorkflowDefinitionId"); - - b.HasIndex("WorkflowDefinitionVersionId") - .HasDatabaseName("WorkflowDefinitionLabel_WorkflowDefinitionVersionId"); - - b.ToTable("WorkflowDefinitionLabels", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.Oracle/Migrations/Labels/20250131233459_V3_3.cs b/src/modules/Elsa.EntityFrameworkCore.Oracle/Migrations/Labels/20250131233459_V3_3.cs deleted file mode 100644 index 414471594b..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Oracle/Migrations/Labels/20250131233459_V3_3.cs +++ /dev/null @@ -1,94 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.Oracle.Migrations.Labels -{ - /// - public partial class V3_3 : Migration - { - private readonly Elsa.EntityFrameworkCore.IElsaDbContextSchema _schema; - - /// - public V3_3(Elsa.EntityFrameworkCore.IElsaDbContextSchema schema) - { - _schema = schema; - } - - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.EnsureSchema( - _schema.Schema); - - migrationBuilder.CreateTable( - name: "Labels", - schema: _schema.Schema, - columns: table => new - { - Id = table.Column(type: "NVARCHAR2(450)", nullable: false), - Name = table.Column(type: "NVARCHAR2(2000)", nullable: false), - NormalizedName = table.Column(type: "NVARCHAR2(2000)", nullable: false), - Description = table.Column(type: "NVARCHAR2(2000)", nullable: true), - Color = table.Column(type: "NVARCHAR2(2000)", nullable: true), - TenantId = table.Column(type: "NVARCHAR2(2000)", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Labels", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "WorkflowDefinitionLabels", - schema: _schema.Schema, - columns: table => new - { - Id = table.Column(type: "NVARCHAR2(450)", nullable: false), - WorkflowDefinitionId = table.Column(type: "NVARCHAR2(450)", nullable: false), - WorkflowDefinitionVersionId = table.Column(type: "NVARCHAR2(450)", nullable: false), - LabelId = table.Column(type: "NVARCHAR2(450)", nullable: false), - TenantId = table.Column(type: "NVARCHAR2(450)", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_WorkflowDefinitionLabels", x => x.Id); - }); - - migrationBuilder.CreateIndex( - name: "WorkflowDefinitionLabel_LabelId", - schema: _schema.Schema, - table: "WorkflowDefinitionLabels", - column: "LabelId"); - - migrationBuilder.CreateIndex( - name: "WorkflowDefinitionLabel_TenantId", - schema: _schema.Schema, - table: "WorkflowDefinitionLabels", - column: "TenantId"); - - migrationBuilder.CreateIndex( - name: "WorkflowDefinitionLabel_WorkflowDefinitionId", - schema: _schema.Schema, - table: "WorkflowDefinitionLabels", - column: "WorkflowDefinitionId"); - - migrationBuilder.CreateIndex( - name: "WorkflowDefinitionLabel_WorkflowDefinitionVersionId", - schema: _schema.Schema, - table: "WorkflowDefinitionLabels", - column: "WorkflowDefinitionVersionId"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "Labels", - schema: _schema.Schema); - - migrationBuilder.DropTable( - name: "WorkflowDefinitionLabels", - schema: _schema.Schema); - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.Oracle/Migrations/Labels/20250222191001_V3_4.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.Oracle/Migrations/Labels/20250222191001_V3_4.Designer.cs deleted file mode 100644 index 506067231d..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Oracle/Migrations/Labels/20250222191001_V3_4.Designer.cs +++ /dev/null @@ -1,94 +0,0 @@ -// -using Elsa.EntityFrameworkCore.Modules.Labels; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Oracle.EntityFrameworkCore.Metadata; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.Oracle.Migrations.Labels -{ - [DbContext(typeof(LabelsElsaDbContext))] - [Migration("20250222191001_V3_4")] - partial class V3_4 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "8.0.12") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - OracleModelBuilderExtensions.UseIdentityColumns(modelBuilder); - - modelBuilder.Entity("Elsa.Labels.Entities.Label", b => - { - b.Property("Id") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("Color") - .HasColumnType("NVARCHAR2(2000)"); - - b.Property("Description") - .HasColumnType("NVARCHAR2(2000)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("NVARCHAR2(2000)"); - - b.Property("NormalizedName") - .IsRequired() - .HasColumnType("NVARCHAR2(2000)"); - - b.Property("TenantId") - .HasColumnType("NVARCHAR2(2000)"); - - b.HasKey("Id"); - - b.ToTable("Labels", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Labels.Entities.WorkflowDefinitionLabel", b => - { - b.Property("Id") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("LabelId") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("TenantId") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("WorkflowDefinitionId") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("WorkflowDefinitionVersionId") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.HasKey("Id"); - - b.HasIndex("LabelId") - .HasDatabaseName("WorkflowDefinitionLabel_LabelId"); - - b.HasIndex("TenantId") - .HasDatabaseName("WorkflowDefinitionLabel_TenantId"); - - b.HasIndex("WorkflowDefinitionId") - .HasDatabaseName("WorkflowDefinitionLabel_WorkflowDefinitionId"); - - b.HasIndex("WorkflowDefinitionVersionId") - .HasDatabaseName("WorkflowDefinitionLabel_WorkflowDefinitionVersionId"); - - b.ToTable("WorkflowDefinitionLabels", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.Oracle/Migrations/Labels/20250222191001_V3_4.cs b/src/modules/Elsa.EntityFrameworkCore.Oracle/Migrations/Labels/20250222191001_V3_4.cs deleted file mode 100644 index 353c995817..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Oracle/Migrations/Labels/20250222191001_V3_4.cs +++ /dev/null @@ -1,30 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.Oracle.Migrations.Labels -{ - /// - public partial class V3_4 : Migration - { - private readonly Elsa.EntityFrameworkCore.IElsaDbContextSchema _schema; - - /// - public V3_4(Elsa.EntityFrameworkCore.IElsaDbContextSchema schema) - { - _schema = schema; - } - - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.Oracle/Migrations/Labels/LabelsElsaDbContextModelSnapshot.cs b/src/modules/Elsa.EntityFrameworkCore.Oracle/Migrations/Labels/LabelsElsaDbContextModelSnapshot.cs deleted file mode 100644 index 6d050f7c28..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Oracle/Migrations/Labels/LabelsElsaDbContextModelSnapshot.cs +++ /dev/null @@ -1,91 +0,0 @@ -// -using Elsa.EntityFrameworkCore.Modules.Labels; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Oracle.EntityFrameworkCore.Metadata; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.Oracle.Migrations.Labels -{ - [DbContext(typeof(LabelsElsaDbContext))] - partial class LabelsElsaDbContextModelSnapshot : ModelSnapshot - { - protected override void BuildModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "8.0.12") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - OracleModelBuilderExtensions.UseIdentityColumns(modelBuilder); - - modelBuilder.Entity("Elsa.Labels.Entities.Label", b => - { - b.Property("Id") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("Color") - .HasColumnType("NVARCHAR2(2000)"); - - b.Property("Description") - .HasColumnType("NVARCHAR2(2000)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("NVARCHAR2(2000)"); - - b.Property("NormalizedName") - .IsRequired() - .HasColumnType("NVARCHAR2(2000)"); - - b.Property("TenantId") - .HasColumnType("NVARCHAR2(2000)"); - - b.HasKey("Id"); - - b.ToTable("Labels", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Labels.Entities.WorkflowDefinitionLabel", b => - { - b.Property("Id") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("LabelId") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("TenantId") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("WorkflowDefinitionId") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("WorkflowDefinitionVersionId") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.HasKey("Id"); - - b.HasIndex("LabelId") - .HasDatabaseName("WorkflowDefinitionLabel_LabelId"); - - b.HasIndex("TenantId") - .HasDatabaseName("WorkflowDefinitionLabel_TenantId"); - - b.HasIndex("WorkflowDefinitionId") - .HasDatabaseName("WorkflowDefinitionLabel_WorkflowDefinitionId"); - - b.HasIndex("WorkflowDefinitionVersionId") - .HasDatabaseName("WorkflowDefinitionLabel_WorkflowDefinitionVersionId"); - - b.ToTable("WorkflowDefinitionLabels", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.Oracle/Migrations/Management/20250131233451_V3_3.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.Oracle/Migrations/Management/20250131233451_V3_3.Designer.cs deleted file mode 100644 index 1e05309c4a..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Oracle/Migrations/Management/20250131233451_V3_3.Designer.cs +++ /dev/null @@ -1,226 +0,0 @@ -// -using System; -using Elsa.EntityFrameworkCore.Modules.Management; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Oracle.EntityFrameworkCore.Metadata; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.Oracle.Migrations.Management -{ - [DbContext(typeof(ManagementElsaDbContext))] - [Migration("20250131233451_V3_3")] - partial class V3_3 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "8.0.12") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - OracleModelBuilderExtensions.UseIdentityColumns(modelBuilder); - - modelBuilder.Entity("Elsa.Workflows.Management.Entities.WorkflowDefinition", b => - { - b.Property("Id") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("BinaryData") - .HasColumnType("BLOB"); - - b.Property("CreatedAt") - .HasColumnType("TIMESTAMP(7) WITH TIME ZONE"); - - b.Property("Data") - .HasColumnType("NCLOB"); - - b.Property("DefinitionId") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("Description") - .HasColumnType("NCLOB"); - - b.Property("IsLatest") - .HasColumnType("BOOLEAN"); - - b.Property("IsPublished") - .HasColumnType("BOOLEAN"); - - b.Property("IsReadonly") - .HasColumnType("BOOLEAN"); - - b.Property("IsSystem") - .HasColumnType("BOOLEAN"); - - b.Property("MaterializerContext") - .HasColumnType("NCLOB"); - - b.Property("MaterializerName") - .IsRequired() - .HasColumnType("NVARCHAR2(2000)"); - - b.Property("Name") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("ProviderName") - .HasColumnType("NVARCHAR2(2000)"); - - b.Property("StringData") - .HasColumnType("NCLOB"); - - b.Property("TenantId") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("ToolVersion") - .HasColumnType("NVARCHAR2(2000)"); - - b.Property("UsableAsActivity") - .HasColumnType("BOOLEAN"); - - b.Property("Version") - .HasColumnType("NUMBER(10)"); - - b.HasKey("Id"); - - b.HasIndex("IsLatest") - .HasDatabaseName("IX_WorkflowDefinition_IsLatest"); - - b.HasIndex("IsPublished") - .HasDatabaseName("IX_WorkflowDefinition_IsPublished"); - - b.HasIndex("IsSystem") - .HasDatabaseName("IX_WorkflowDefinition_IsSystem"); - - b.HasIndex("Name") - .HasDatabaseName("IX_WorkflowDefinition_Name"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_WorkflowDefinition_TenantId"); - - b.HasIndex("UsableAsActivity") - .HasDatabaseName("IX_WorkflowDefinition_UsableAsActivity"); - - b.HasIndex("Version") - .HasDatabaseName("IX_WorkflowDefinition_Version"); - - b.HasIndex("DefinitionId", "Version") - .IsUnique() - .HasDatabaseName("IX_WorkflowDefinition_DefinitionId_Version"); - - b.ToTable("WorkflowDefinitions", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Management.Entities.WorkflowInstance", b => - { - b.Property("Id") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("CorrelationId") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("CreatedAt") - .HasColumnType("TIMESTAMP(7) WITH TIME ZONE"); - - b.Property("Data") - .HasColumnType("NCLOB"); - - b.Property("DataCompressionAlgorithm") - .HasColumnType("NVARCHAR2(2000)"); - - b.Property("DefinitionId") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("DefinitionVersionId") - .IsRequired() - .HasColumnType("NVARCHAR2(2000)"); - - b.Property("FinishedAt") - .HasColumnType("TIMESTAMP(7) WITH TIME ZONE"); - - b.Property("IncidentCount") - .HasColumnType("NUMBER(10)"); - - b.Property("IsSystem") - .HasColumnType("BOOLEAN"); - - b.Property("Name") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("ParentWorkflowInstanceId") - .HasColumnType("NVARCHAR2(2000)"); - - b.Property("Status") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("SubStatus") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("TenantId") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("UpdatedAt") - .HasColumnType("TIMESTAMP(7) WITH TIME ZONE"); - - b.Property("Version") - .HasColumnType("NUMBER(10)"); - - b.HasKey("Id"); - - b.HasIndex("CorrelationId") - .HasDatabaseName("IX_WorkflowInstance_CorrelationId"); - - b.HasIndex("CreatedAt") - .HasDatabaseName("IX_WorkflowInstance_CreatedAt"); - - b.HasIndex("DefinitionId") - .HasDatabaseName("IX_WorkflowInstance_DefinitionId"); - - b.HasIndex("FinishedAt") - .HasDatabaseName("IX_WorkflowInstance_FinishedAt"); - - b.HasIndex("IsSystem") - .HasDatabaseName("IX_WorkflowInstance_IsSystem"); - - b.HasIndex("Name") - .HasDatabaseName("IX_WorkflowInstance_Name"); - - b.HasIndex("Status") - .HasDatabaseName("IX_WorkflowInstance_Status"); - - b.HasIndex("SubStatus") - .HasDatabaseName("IX_WorkflowInstance_SubStatus"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_WorkflowInstance_TenantId"); - - b.HasIndex("UpdatedAt") - .HasDatabaseName("IX_WorkflowInstance_UpdatedAt"); - - b.HasIndex("Status", "DefinitionId") - .HasDatabaseName("IX_WorkflowInstance_Status_DefinitionId"); - - b.HasIndex("Status", "SubStatus") - .HasDatabaseName("IX_WorkflowInstance_Status_SubStatus"); - - b.HasIndex("SubStatus", "DefinitionId") - .HasDatabaseName("IX_WorkflowInstance_SubStatus_DefinitionId"); - - b.HasIndex("Status", "SubStatus", "DefinitionId", "Version") - .HasDatabaseName("IX_WorkflowInstance_Status_SubStatus_DefinitionId_Version"); - - b.ToTable("WorkflowInstances", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.Oracle/Migrations/Management/20250131233451_V3_3.cs b/src/modules/Elsa.EntityFrameworkCore.Oracle/Migrations/Management/20250131233451_V3_3.cs deleted file mode 100644 index aa899af2c8..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Oracle/Migrations/Management/20250131233451_V3_3.cs +++ /dev/null @@ -1,229 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.Oracle.Migrations.Management -{ - /// - public partial class V3_3 : Migration - { - private readonly Elsa.EntityFrameworkCore.IElsaDbContextSchema _schema; - - /// - public V3_3(Elsa.EntityFrameworkCore.IElsaDbContextSchema schema) - { - _schema = schema; - } - - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.EnsureSchema( - name: _schema.Schema); - - migrationBuilder.CreateTable( - name: "WorkflowDefinitions", - schema: _schema.Schema, - columns: table => new - { - Id = table.Column(type: "NVARCHAR2(450)", nullable: false), - DefinitionId = table.Column(type: "NVARCHAR2(450)", nullable: false), - Name = table.Column(type: "NVARCHAR2(450)", nullable: true), - Description = table.Column(type: "NCLOB", nullable: true), - ToolVersion = table.Column(type: "NVARCHAR2(2000)", nullable: true), - ProviderName = table.Column(type: "NVARCHAR2(2000)", nullable: true), - MaterializerName = table.Column(type: "NVARCHAR2(2000)", nullable: false), - MaterializerContext = table.Column(type: "NCLOB", nullable: true), - StringData = table.Column(type: "NCLOB", nullable: true), - BinaryData = table.Column(type: "BLOB", nullable: true), - IsReadonly = table.Column(type: "BOOLEAN", nullable: false), - IsSystem = table.Column(type: "BOOLEAN", nullable: false), - Data = table.Column(type: "NCLOB", nullable: true), - UsableAsActivity = table.Column(type: "BOOLEAN", nullable: true), - TenantId = table.Column(type: "NVARCHAR2(450)", nullable: true), - CreatedAt = table.Column(type: "TIMESTAMP(7) WITH TIME ZONE", nullable: false), - Version = table.Column(type: "NUMBER(10)", nullable: false), - IsLatest = table.Column(type: "BOOLEAN", nullable: false), - IsPublished = table.Column(type: "BOOLEAN", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_WorkflowDefinitions", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "WorkflowInstances", - schema: _schema.Schema, - columns: table => new - { - Id = table.Column(type: "NVARCHAR2(450)", nullable: false), - DefinitionId = table.Column(type: "NVARCHAR2(450)", nullable: false), - DefinitionVersionId = table.Column(type: "NVARCHAR2(2000)", nullable: false), - Version = table.Column(type: "NUMBER(10)", nullable: false), - ParentWorkflowInstanceId = table.Column(type: "NVARCHAR2(2000)", nullable: true), - Status = table.Column(type: "NVARCHAR2(450)", nullable: false), - SubStatus = table.Column(type: "NVARCHAR2(450)", nullable: false), - CorrelationId = table.Column(type: "NVARCHAR2(450)", nullable: true), - Name = table.Column(type: "NVARCHAR2(450)", nullable: true), - IncidentCount = table.Column(type: "NUMBER(10)", nullable: false), - IsSystem = table.Column(type: "BOOLEAN", nullable: false), - CreatedAt = table.Column(type: "TIMESTAMP(7) WITH TIME ZONE", nullable: false), - UpdatedAt = table.Column(type: "TIMESTAMP(7) WITH TIME ZONE", nullable: false), - FinishedAt = table.Column(type: "TIMESTAMP(7) WITH TIME ZONE", nullable: true), - Data = table.Column(type: "NCLOB", nullable: true), - DataCompressionAlgorithm = table.Column(type: "NVARCHAR2(2000)", nullable: true), - TenantId = table.Column(type: "NVARCHAR2(450)", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_WorkflowInstances", x => x.Id); - }); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowDefinition_DefinitionId_Version", - schema: _schema.Schema, - table: "WorkflowDefinitions", - columns: new[] { "DefinitionId", "Version" }, - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowDefinition_IsLatest", - schema: _schema.Schema, - table: "WorkflowDefinitions", - column: "IsLatest"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowDefinition_IsPublished", - schema: _schema.Schema, - table: "WorkflowDefinitions", - column: "IsPublished"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowDefinition_IsSystem", - schema: _schema.Schema, - table: "WorkflowDefinitions", - column: "IsSystem"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowDefinition_Name", - schema: _schema.Schema, - table: "WorkflowDefinitions", - column: "Name"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowDefinition_TenantId", - schema: _schema.Schema, - table: "WorkflowDefinitions", - column: "TenantId"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowDefinition_UsableAsActivity", - schema: _schema.Schema, - table: "WorkflowDefinitions", - column: "UsableAsActivity"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowDefinition_Version", - schema: _schema.Schema, - table: "WorkflowDefinitions", - column: "Version"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowInstance_CorrelationId", - schema: _schema.Schema, - table: "WorkflowInstances", - column: "CorrelationId"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowInstance_CreatedAt", - schema: _schema.Schema, - table: "WorkflowInstances", - column: "CreatedAt"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowInstance_DefinitionId", - schema: _schema.Schema, - table: "WorkflowInstances", - column: "DefinitionId"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowInstance_FinishedAt", - schema: _schema.Schema, - table: "WorkflowInstances", - column: "FinishedAt"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowInstance_IsSystem", - schema: _schema.Schema, - table: "WorkflowInstances", - column: "IsSystem"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowInstance_Name", - schema: _schema.Schema, - table: "WorkflowInstances", - column: "Name"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowInstance_Status", - schema: _schema.Schema, - table: "WorkflowInstances", - column: "Status"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowInstance_Status_DefinitionId", - schema: _schema.Schema, - table: "WorkflowInstances", - columns: new[] { "Status", "DefinitionId" }); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowInstance_Status_SubStatus", - schema: _schema.Schema, - table: "WorkflowInstances", - columns: new[] { "Status", "SubStatus" }); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowInstance_Status_SubStatus_DefinitionId_Version", - schema: _schema.Schema, - table: "WorkflowInstances", - columns: new[] { "Status", "SubStatus", "DefinitionId", "Version" }); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowInstance_SubStatus", - schema: _schema.Schema, - table: "WorkflowInstances", - column: "SubStatus"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowInstance_SubStatus_DefinitionId", - schema: _schema.Schema, - table: "WorkflowInstances", - columns: new[] { "SubStatus", "DefinitionId" }); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowInstance_TenantId", - schema: _schema.Schema, - table: "WorkflowInstances", - column: "TenantId"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowInstance_UpdatedAt", - schema: _schema.Schema, - table: "WorkflowInstances", - column: "UpdatedAt"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "WorkflowDefinitions", - schema: _schema.Schema); - - migrationBuilder.DropTable( - name: "WorkflowInstances", - schema: _schema.Schema); - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.Oracle/Migrations/Management/20250222190910_V3_4.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.Oracle/Migrations/Management/20250222190910_V3_4.Designer.cs deleted file mode 100644 index a3df0a8423..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Oracle/Migrations/Management/20250222190910_V3_4.Designer.cs +++ /dev/null @@ -1,232 +0,0 @@ -// -using System; -using Elsa.EntityFrameworkCore.Modules.Management; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Oracle.EntityFrameworkCore.Metadata; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.Oracle.Migrations.Management -{ - [DbContext(typeof(ManagementElsaDbContext))] - [Migration("20250222190910_V3_4")] - partial class V3_4 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "8.0.12") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - OracleModelBuilderExtensions.UseIdentityColumns(modelBuilder); - - modelBuilder.Entity("Elsa.Workflows.Management.Entities.WorkflowDefinition", b => - { - b.Property("Id") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("BinaryData") - .HasColumnType("BLOB"); - - b.Property("CreatedAt") - .HasColumnType("TIMESTAMP(7) WITH TIME ZONE"); - - b.Property("Data") - .HasColumnType("NCLOB"); - - b.Property("DefinitionId") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("Description") - .HasColumnType("NCLOB"); - - b.Property("IsLatest") - .HasColumnType("BOOLEAN"); - - b.Property("IsPublished") - .HasColumnType("BOOLEAN"); - - b.Property("IsReadonly") - .HasColumnType("BOOLEAN"); - - b.Property("IsSystem") - .HasColumnType("BOOLEAN"); - - b.Property("MaterializerContext") - .HasColumnType("NCLOB"); - - b.Property("MaterializerName") - .IsRequired() - .HasColumnType("NVARCHAR2(2000)"); - - b.Property("Name") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("ProviderName") - .HasColumnType("NVARCHAR2(2000)"); - - b.Property("StringData") - .HasColumnType("NCLOB"); - - b.Property("TenantId") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("ToolVersion") - .HasColumnType("NVARCHAR2(2000)"); - - b.Property("UsableAsActivity") - .HasColumnType("BOOLEAN"); - - b.Property("Version") - .HasColumnType("NUMBER(10)"); - - b.HasKey("Id"); - - b.HasIndex("IsLatest") - .HasDatabaseName("IX_WorkflowDefinition_IsLatest"); - - b.HasIndex("IsPublished") - .HasDatabaseName("IX_WorkflowDefinition_IsPublished"); - - b.HasIndex("IsSystem") - .HasDatabaseName("IX_WorkflowDefinition_IsSystem"); - - b.HasIndex("Name") - .HasDatabaseName("IX_WorkflowDefinition_Name"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_WorkflowDefinition_TenantId"); - - b.HasIndex("UsableAsActivity") - .HasDatabaseName("IX_WorkflowDefinition_UsableAsActivity"); - - b.HasIndex("Version") - .HasDatabaseName("IX_WorkflowDefinition_Version"); - - b.HasIndex("DefinitionId", "Version") - .IsUnique() - .HasDatabaseName("IX_WorkflowDefinition_DefinitionId_Version"); - - b.ToTable("WorkflowDefinitions", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Management.Entities.WorkflowInstance", b => - { - b.Property("Id") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("CorrelationId") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("CreatedAt") - .HasColumnType("TIMESTAMP(7) WITH TIME ZONE"); - - b.Property("Data") - .HasColumnType("NCLOB"); - - b.Property("DataCompressionAlgorithm") - .HasColumnType("NVARCHAR2(2000)"); - - b.Property("DefinitionId") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("DefinitionVersionId") - .IsRequired() - .HasColumnType("NVARCHAR2(2000)"); - - b.Property("FinishedAt") - .HasColumnType("TIMESTAMP(7) WITH TIME ZONE"); - - b.Property("IncidentCount") - .HasColumnType("NUMBER(10)"); - - b.Property("IsExecuting") - .HasColumnType("BOOLEAN"); - - b.Property("IsSystem") - .HasColumnType("BOOLEAN"); - - b.Property("Name") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("ParentWorkflowInstanceId") - .HasColumnType("NVARCHAR2(2000)"); - - b.Property("Status") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("SubStatus") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("TenantId") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("UpdatedAt") - .HasColumnType("TIMESTAMP(7) WITH TIME ZONE"); - - b.Property("Version") - .HasColumnType("NUMBER(10)"); - - b.HasKey("Id"); - - b.HasIndex("CorrelationId") - .HasDatabaseName("IX_WorkflowInstance_CorrelationId"); - - b.HasIndex("CreatedAt") - .HasDatabaseName("IX_WorkflowInstance_CreatedAt"); - - b.HasIndex("DefinitionId") - .HasDatabaseName("IX_WorkflowInstance_DefinitionId"); - - b.HasIndex("FinishedAt") - .HasDatabaseName("IX_WorkflowInstance_FinishedAt"); - - b.HasIndex("IsExecuting") - .HasDatabaseName("IX_WorkflowInstance_IsExecuting"); - - b.HasIndex("IsSystem") - .HasDatabaseName("IX_WorkflowInstance_IsSystem"); - - b.HasIndex("Name") - .HasDatabaseName("IX_WorkflowInstance_Name"); - - b.HasIndex("Status") - .HasDatabaseName("IX_WorkflowInstance_Status"); - - b.HasIndex("SubStatus") - .HasDatabaseName("IX_WorkflowInstance_SubStatus"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_WorkflowInstance_TenantId"); - - b.HasIndex("UpdatedAt") - .HasDatabaseName("IX_WorkflowInstance_UpdatedAt"); - - b.HasIndex("Status", "DefinitionId") - .HasDatabaseName("IX_WorkflowInstance_Status_DefinitionId"); - - b.HasIndex("Status", "SubStatus") - .HasDatabaseName("IX_WorkflowInstance_Status_SubStatus"); - - b.HasIndex("SubStatus", "DefinitionId") - .HasDatabaseName("IX_WorkflowInstance_SubStatus_DefinitionId"); - - b.HasIndex("Status", "SubStatus", "DefinitionId", "Version") - .HasDatabaseName("IX_WorkflowInstance_Status_SubStatus_DefinitionId_Version"); - - b.ToTable("WorkflowInstances", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.Oracle/Migrations/Management/20250222190910_V3_4.cs b/src/modules/Elsa.EntityFrameworkCore.Oracle/Migrations/Management/20250222190910_V3_4.cs deleted file mode 100644 index 8cda7f47f7..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Oracle/Migrations/Management/20250222190910_V3_4.cs +++ /dev/null @@ -1,50 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.Oracle.Migrations.Management -{ - /// - public partial class V3_4 : Migration - { - private readonly Elsa.EntityFrameworkCore.IElsaDbContextSchema _schema; - - /// - public V3_4(Elsa.EntityFrameworkCore.IElsaDbContextSchema schema) - { - _schema = schema; - } - - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "IsExecuting", - schema: _schema.Schema, - table: "WorkflowInstances", - type: "BOOLEAN", - nullable: false, - defaultValue: false); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowInstance_IsExecuting", - schema: _schema.Schema, - table: "WorkflowInstances", - column: "IsExecuting"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropIndex( - name: "IX_WorkflowInstance_IsExecuting", - schema: _schema.Schema, - table: "WorkflowInstances"); - - migrationBuilder.DropColumn( - name: "IsExecuting", - schema: _schema.Schema, - table: "WorkflowInstances"); - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.Oracle/Migrations/Management/ManagementElsaDbContextModelSnapshot.cs b/src/modules/Elsa.EntityFrameworkCore.Oracle/Migrations/Management/ManagementElsaDbContextModelSnapshot.cs deleted file mode 100644 index e4d7a7bedb..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Oracle/Migrations/Management/ManagementElsaDbContextModelSnapshot.cs +++ /dev/null @@ -1,229 +0,0 @@ -// -using System; -using Elsa.EntityFrameworkCore.Modules.Management; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Oracle.EntityFrameworkCore.Metadata; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.Oracle.Migrations.Management -{ - [DbContext(typeof(ManagementElsaDbContext))] - partial class ManagementElsaDbContextModelSnapshot : ModelSnapshot - { - protected override void BuildModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "8.0.12") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - OracleModelBuilderExtensions.UseIdentityColumns(modelBuilder); - - modelBuilder.Entity("Elsa.Workflows.Management.Entities.WorkflowDefinition", b => - { - b.Property("Id") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("BinaryData") - .HasColumnType("BLOB"); - - b.Property("CreatedAt") - .HasColumnType("TIMESTAMP(7) WITH TIME ZONE"); - - b.Property("Data") - .HasColumnType("NCLOB"); - - b.Property("DefinitionId") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("Description") - .HasColumnType("NCLOB"); - - b.Property("IsLatest") - .HasColumnType("BOOLEAN"); - - b.Property("IsPublished") - .HasColumnType("BOOLEAN"); - - b.Property("IsReadonly") - .HasColumnType("BOOLEAN"); - - b.Property("IsSystem") - .HasColumnType("BOOLEAN"); - - b.Property("MaterializerContext") - .HasColumnType("NCLOB"); - - b.Property("MaterializerName") - .IsRequired() - .HasColumnType("NVARCHAR2(2000)"); - - b.Property("Name") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("ProviderName") - .HasColumnType("NVARCHAR2(2000)"); - - b.Property("StringData") - .HasColumnType("NCLOB"); - - b.Property("TenantId") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("ToolVersion") - .HasColumnType("NVARCHAR2(2000)"); - - b.Property("UsableAsActivity") - .HasColumnType("BOOLEAN"); - - b.Property("Version") - .HasColumnType("NUMBER(10)"); - - b.HasKey("Id"); - - b.HasIndex("IsLatest") - .HasDatabaseName("IX_WorkflowDefinition_IsLatest"); - - b.HasIndex("IsPublished") - .HasDatabaseName("IX_WorkflowDefinition_IsPublished"); - - b.HasIndex("IsSystem") - .HasDatabaseName("IX_WorkflowDefinition_IsSystem"); - - b.HasIndex("Name") - .HasDatabaseName("IX_WorkflowDefinition_Name"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_WorkflowDefinition_TenantId"); - - b.HasIndex("UsableAsActivity") - .HasDatabaseName("IX_WorkflowDefinition_UsableAsActivity"); - - b.HasIndex("Version") - .HasDatabaseName("IX_WorkflowDefinition_Version"); - - b.HasIndex("DefinitionId", "Version") - .IsUnique() - .HasDatabaseName("IX_WorkflowDefinition_DefinitionId_Version"); - - b.ToTable("WorkflowDefinitions", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Management.Entities.WorkflowInstance", b => - { - b.Property("Id") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("CorrelationId") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("CreatedAt") - .HasColumnType("TIMESTAMP(7) WITH TIME ZONE"); - - b.Property("Data") - .HasColumnType("NCLOB"); - - b.Property("DataCompressionAlgorithm") - .HasColumnType("NVARCHAR2(2000)"); - - b.Property("DefinitionId") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("DefinitionVersionId") - .IsRequired() - .HasColumnType("NVARCHAR2(2000)"); - - b.Property("FinishedAt") - .HasColumnType("TIMESTAMP(7) WITH TIME ZONE"); - - b.Property("IncidentCount") - .HasColumnType("NUMBER(10)"); - - b.Property("IsExecuting") - .HasColumnType("BOOLEAN"); - - b.Property("IsSystem") - .HasColumnType("BOOLEAN"); - - b.Property("Name") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("ParentWorkflowInstanceId") - .HasColumnType("NVARCHAR2(2000)"); - - b.Property("Status") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("SubStatus") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("TenantId") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("UpdatedAt") - .HasColumnType("TIMESTAMP(7) WITH TIME ZONE"); - - b.Property("Version") - .HasColumnType("NUMBER(10)"); - - b.HasKey("Id"); - - b.HasIndex("CorrelationId") - .HasDatabaseName("IX_WorkflowInstance_CorrelationId"); - - b.HasIndex("CreatedAt") - .HasDatabaseName("IX_WorkflowInstance_CreatedAt"); - - b.HasIndex("DefinitionId") - .HasDatabaseName("IX_WorkflowInstance_DefinitionId"); - - b.HasIndex("FinishedAt") - .HasDatabaseName("IX_WorkflowInstance_FinishedAt"); - - b.HasIndex("IsExecuting") - .HasDatabaseName("IX_WorkflowInstance_IsExecuting"); - - b.HasIndex("IsSystem") - .HasDatabaseName("IX_WorkflowInstance_IsSystem"); - - b.HasIndex("Name") - .HasDatabaseName("IX_WorkflowInstance_Name"); - - b.HasIndex("Status") - .HasDatabaseName("IX_WorkflowInstance_Status"); - - b.HasIndex("SubStatus") - .HasDatabaseName("IX_WorkflowInstance_SubStatus"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_WorkflowInstance_TenantId"); - - b.HasIndex("UpdatedAt") - .HasDatabaseName("IX_WorkflowInstance_UpdatedAt"); - - b.HasIndex("Status", "DefinitionId") - .HasDatabaseName("IX_WorkflowInstance_Status_DefinitionId"); - - b.HasIndex("Status", "SubStatus") - .HasDatabaseName("IX_WorkflowInstance_Status_SubStatus"); - - b.HasIndex("SubStatus", "DefinitionId") - .HasDatabaseName("IX_WorkflowInstance_SubStatus_DefinitionId"); - - b.HasIndex("Status", "SubStatus", "DefinitionId", "Version") - .HasDatabaseName("IX_WorkflowInstance_Status_SubStatus_DefinitionId_Version"); - - b.ToTable("WorkflowInstances", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.Oracle/Migrations/Runtime/20250131233446_V3_3.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.Oracle/Migrations/Runtime/20250131233446_V3_3.Designer.cs deleted file mode 100644 index d7fd0359e6..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Oracle/Migrations/Runtime/20250131233446_V3_3.Designer.cs +++ /dev/null @@ -1,492 +0,0 @@ -// -using System; -using Elsa.EntityFrameworkCore.Modules.Runtime; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Oracle.EntityFrameworkCore.Metadata; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.Oracle.Migrations.Runtime -{ - [DbContext(typeof(RuntimeElsaDbContext))] - [Migration("20250131233446_V3_3")] - partial class V3_3 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "8.0.12") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - OracleModelBuilderExtensions.UseIdentityColumns(modelBuilder); - - modelBuilder.Entity("Elsa.KeyValues.Entities.SerializedKeyValuePair", b => - { - b.Property("Id") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("SerializedValue") - .IsRequired() - .HasColumnType("NVARCHAR2(2000)"); - - b.Property("TenantId") - .HasColumnType("NVARCHAR2(450)"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "TenantId" }, "IX_SerializedKeyValuePair_TenantId"); - - b.ToTable("KeyValuePairs", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.ActivityExecutionRecord", b => - { - b.Property("Id") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("ActivityId") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("ActivityName") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("ActivityNodeId") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("ActivityType") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("ActivityTypeVersion") - .HasColumnType("NUMBER(10)"); - - b.Property("CompletedAt") - .HasColumnType("TIMESTAMP(7) WITH TIME ZONE"); - - b.Property("HasBookmarks") - .HasColumnType("BOOLEAN"); - - b.Property("SerializedActivityState") - .HasColumnType("NCLOB"); - - b.Property("SerializedActivityStateCompressionAlgorithm") - .HasColumnType("NVARCHAR2(2000)"); - - b.Property("SerializedException") - .HasColumnType("NCLOB"); - - b.Property("SerializedOutputs") - .HasColumnType("NCLOB"); - - b.Property("SerializedPayload") - .HasColumnType("NCLOB"); - - b.Property("SerializedProperties") - .HasColumnType("NCLOB"); - - b.Property("StartedAt") - .HasColumnType("TIMESTAMP(7) WITH TIME ZONE"); - - b.Property("Status") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("TenantId") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.HasKey("Id"); - - b.HasIndex("ActivityId") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityId"); - - b.HasIndex("ActivityName") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityName"); - - b.HasIndex("ActivityNodeId") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityNodeId"); - - b.HasIndex("ActivityType") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityType"); - - b.HasIndex("ActivityTypeVersion") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityTypeVersion"); - - b.HasIndex("CompletedAt") - .HasDatabaseName("IX_ActivityExecutionRecord_CompletedAt"); - - b.HasIndex("HasBookmarks") - .HasDatabaseName("IX_ActivityExecutionRecord_HasBookmarks"); - - b.HasIndex("StartedAt") - .HasDatabaseName("IX_ActivityExecutionRecord_StartedAt"); - - b.HasIndex("Status") - .HasDatabaseName("IX_ActivityExecutionRecord_Status"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_ActivityExecutionRecord_TenantId"); - - b.HasIndex("WorkflowInstanceId") - .HasDatabaseName("IX_ActivityExecutionRecord_WorkflowInstanceId"); - - b.HasIndex("ActivityType", "ActivityTypeVersion") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityType_ActivityTypeVersion"); - - b.ToTable("ActivityExecutionRecords", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.BookmarkQueueItem", b => - { - b.Property("Id") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("ActivityInstanceId") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("ActivityTypeName") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("BookmarkId") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("CorrelationId") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("CreatedAt") - .HasColumnType("TIMESTAMP(7) WITH TIME ZONE"); - - b.Property("SerializedOptions") - .HasColumnType("NVARCHAR2(2000)"); - - b.Property("StimulusHash") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("TenantId") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("WorkflowInstanceId") - .HasColumnType("NVARCHAR2(450)"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "ActivityInstanceId" }, "IX_BookmarkQueueItem_ActivityInstanceId"); - - b.HasIndex(new[] { "ActivityTypeName" }, "IX_BookmarkQueueItem_ActivityTypeName"); - - b.HasIndex(new[] { "BookmarkId" }, "IX_BookmarkQueueItem_BookmarkId"); - - b.HasIndex(new[] { "CorrelationId" }, "IX_BookmarkQueueItem_CorrelationId"); - - b.HasIndex(new[] { "CreatedAt" }, "IX_BookmarkQueueItem_CreatedAt"); - - b.HasIndex(new[] { "StimulusHash" }, "IX_BookmarkQueueItem_StimulusHash"); - - b.HasIndex(new[] { "TenantId" }, "IX_BookmarkQueueItem_TenantId"); - - b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_BookmarkQueueItem_WorkflowInstanceId"); - - b.ToTable("BookmarkQueueItems", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.StoredBookmark", b => - { - b.Property("Id") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("ActivityInstanceId") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("ActivityTypeName") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("CorrelationId") - .HasColumnType("NVARCHAR2(2000)"); - - b.Property("CreatedAt") - .HasColumnType("TIMESTAMP(7) WITH TIME ZONE"); - - b.Property("Hash") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("SerializedMetadata") - .HasColumnType("NCLOB"); - - b.Property("SerializedPayload") - .HasColumnType("NCLOB"); - - b.Property("TenantId") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "ActivityInstanceId" }, "IX_StoredBookmark_ActivityInstanceId"); - - b.HasIndex(new[] { "ActivityTypeName" }, "IX_StoredBookmark_ActivityTypeName"); - - b.HasIndex(new[] { "ActivityTypeName", "Hash" }, "IX_StoredBookmark_ActivityTypeName_Hash"); - - b.HasIndex(new[] { "ActivityTypeName", "Hash", "WorkflowInstanceId" }, "IX_StoredBookmark_ActivityTypeName_Hash_WorkflowInstanceId"); - - b.HasIndex(new[] { "CreatedAt" }, "IX_StoredBookmark_CreatedAt"); - - b.HasIndex(new[] { "Hash" }, "IX_StoredBookmark_Hash"); - - b.HasIndex(new[] { "TenantId" }, "IX_StoredBookmark_TenantId"); - - b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_StoredBookmark_WorkflowInstanceId"); - - b.ToTable("Bookmarks", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.StoredTrigger", b => - { - b.Property("Id") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("ActivityId") - .IsRequired() - .HasColumnType("NVARCHAR2(2000)"); - - b.Property("Hash") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("SerializedPayload") - .HasColumnType("NCLOB"); - - b.Property("TenantId") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("WorkflowDefinitionId") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("WorkflowDefinitionVersionId") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.HasKey("Id"); - - b.HasIndex("Hash") - .HasDatabaseName("IX_StoredTrigger_Hash"); - - b.HasIndex("Name") - .HasDatabaseName("IX_StoredTrigger_Name"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_StoredTrigger_TenantId"); - - b.HasIndex("WorkflowDefinitionId") - .HasDatabaseName("IX_StoredTrigger_WorkflowDefinitionId"); - - b.HasIndex("WorkflowDefinitionVersionId") - .HasDatabaseName("IX_StoredTrigger_WorkflowDefinitionVersionId"); - - b.ToTable("Triggers", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.WorkflowExecutionLogRecord", b => - { - b.Property("Id") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("ActivityId") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("ActivityInstanceId") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("ActivityName") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("ActivityNodeId") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("ActivityType") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("ActivityTypeVersion") - .HasColumnType("NUMBER(10)"); - - b.Property("EventName") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("Message") - .HasColumnType("NVARCHAR2(2000)"); - - b.Property("ParentActivityInstanceId") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("Sequence") - .HasColumnType("NUMBER(19)"); - - b.Property("SerializedActivityState") - .HasColumnType("NCLOB"); - - b.Property("SerializedPayload") - .HasColumnType("NCLOB"); - - b.Property("Source") - .HasColumnType("NVARCHAR2(2000)"); - - b.Property("TenantId") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("Timestamp") - .HasColumnType("TIMESTAMP(7) WITH TIME ZONE"); - - b.Property("WorkflowDefinitionId") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("WorkflowDefinitionVersionId") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("WorkflowVersion") - .HasColumnType("NUMBER(10)"); - - b.HasKey("Id"); - - b.HasIndex("ActivityId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityId"); - - b.HasIndex("ActivityInstanceId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityInstanceId"); - - b.HasIndex("ActivityName") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityName"); - - b.HasIndex("ActivityNodeId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityNodeId"); - - b.HasIndex("ActivityType") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityType"); - - b.HasIndex("ActivityTypeVersion") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityTypeVersion"); - - b.HasIndex("EventName") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_EventName"); - - b.HasIndex("ParentActivityInstanceId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ParentActivityInstanceId"); - - b.HasIndex("Sequence") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_Sequence"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_TenantId"); - - b.HasIndex("Timestamp") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_Timestamp"); - - b.HasIndex("WorkflowDefinitionId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowDefinitionId"); - - b.HasIndex("WorkflowDefinitionVersionId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowDefinitionVersionId"); - - b.HasIndex("WorkflowInstanceId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowInstanceId"); - - b.HasIndex("WorkflowVersion") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowVersion"); - - b.HasIndex("ActivityType", "ActivityTypeVersion") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityType_ActivityTypeVersion"); - - b.HasIndex("Timestamp", "Sequence") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_Timestamp_Sequence"); - - b.ToTable("WorkflowExecutionLogRecords", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.WorkflowInboxMessage", b => - { - b.Property("Id") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("ActivityInstanceId") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("ActivityTypeName") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("CorrelationId") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("CreatedAt") - .HasColumnType("TIMESTAMP(7) WITH TIME ZONE"); - - b.Property("ExpiresAt") - .HasColumnType("TIMESTAMP(7) WITH TIME ZONE"); - - b.Property("Hash") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("SerializedBookmarkPayload") - .HasColumnType("NCLOB"); - - b.Property("SerializedInput") - .HasColumnType("NCLOB"); - - b.Property("TenantId") - .HasColumnType("NVARCHAR2(2000)"); - - b.Property("WorkflowInstanceId") - .HasColumnType("NVARCHAR2(450)"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "ActivityInstanceId" }, "IX_WorkflowInboxMessage_ActivityInstanceId"); - - b.HasIndex(new[] { "ActivityTypeName" }, "IX_WorkflowInboxMessage_ActivityTypeName"); - - b.HasIndex(new[] { "CorrelationId" }, "IX_WorkflowInboxMessage_CorrelationId"); - - b.HasIndex(new[] { "CreatedAt" }, "IX_WorkflowInboxMessage_CreatedAt"); - - b.HasIndex(new[] { "ExpiresAt" }, "IX_WorkflowInboxMessage_ExpiresAt"); - - b.HasIndex(new[] { "Hash" }, "IX_WorkflowInboxMessage_Hash"); - - b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_WorkflowInboxMessage_WorkflowInstanceId"); - - b.ToTable("WorkflowInboxMessages", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.Oracle/Migrations/Runtime/20250131233446_V3_3.cs b/src/modules/Elsa.EntityFrameworkCore.Oracle/Migrations/Runtime/20250131233446_V3_3.cs deleted file mode 100644 index c470348e09..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Oracle/Migrations/Runtime/20250131233446_V3_3.cs +++ /dev/null @@ -1,563 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.Oracle.Migrations.Runtime -{ - /// - public partial class V3_3 : Migration - { - private readonly Elsa.EntityFrameworkCore.IElsaDbContextSchema _schema; - - /// - public V3_3(Elsa.EntityFrameworkCore.IElsaDbContextSchema schema) - { - _schema = schema; - } - - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.EnsureSchema( - name: _schema.Schema); - - migrationBuilder.CreateTable( - name: "ActivityExecutionRecords", - schema: _schema.Schema, - columns: table => new - { - Id = table.Column(type: "NVARCHAR2(450)", nullable: false), - WorkflowInstanceId = table.Column(type: "NVARCHAR2(450)", nullable: false), - ActivityId = table.Column(type: "NVARCHAR2(450)", nullable: false), - ActivityNodeId = table.Column(type: "NVARCHAR2(450)", nullable: false), - ActivityType = table.Column(type: "NVARCHAR2(450)", nullable: false), - ActivityTypeVersion = table.Column(type: "NUMBER(10)", nullable: false), - ActivityName = table.Column(type: "NVARCHAR2(450)", nullable: true), - StartedAt = table.Column(type: "TIMESTAMP(7) WITH TIME ZONE", nullable: false), - HasBookmarks = table.Column(type: "BOOLEAN", nullable: false), - Status = table.Column(type: "NVARCHAR2(450)", nullable: false), - CompletedAt = table.Column(type: "TIMESTAMP(7) WITH TIME ZONE", nullable: true), - SerializedActivityState = table.Column(type: "NCLOB", nullable: true), - SerializedActivityStateCompressionAlgorithm = table.Column(type: "NVARCHAR2(2000)", nullable: true), - SerializedException = table.Column(type: "NCLOB", nullable: true), - SerializedOutputs = table.Column(type: "NCLOB", nullable: true), - SerializedPayload = table.Column(type: "NCLOB", nullable: true), - SerializedProperties = table.Column(type: "NCLOB", nullable: true), - TenantId = table.Column(type: "NVARCHAR2(450)", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_ActivityExecutionRecords", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "BookmarkQueueItems", - schema: _schema.Schema, - columns: table => new - { - Id = table.Column(type: "NVARCHAR2(450)", nullable: false), - WorkflowInstanceId = table.Column(type: "NVARCHAR2(450)", nullable: true), - CorrelationId = table.Column(type: "NVARCHAR2(450)", nullable: true), - BookmarkId = table.Column(type: "NVARCHAR2(450)", nullable: true), - StimulusHash = table.Column(type: "NVARCHAR2(450)", nullable: true), - ActivityInstanceId = table.Column(type: "NVARCHAR2(450)", nullable: true), - ActivityTypeName = table.Column(type: "NVARCHAR2(450)", nullable: true), - CreatedAt = table.Column(type: "TIMESTAMP(7) WITH TIME ZONE", nullable: false), - SerializedOptions = table.Column(type: "NVARCHAR2(2000)", nullable: true), - TenantId = table.Column(type: "NVARCHAR2(450)", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_BookmarkQueueItems", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "Bookmarks", - schema: _schema.Schema, - columns: table => new - { - Id = table.Column(type: "NVARCHAR2(450)", nullable: false), - ActivityTypeName = table.Column(type: "NVARCHAR2(450)", nullable: false), - Hash = table.Column(type: "NVARCHAR2(450)", nullable: false), - WorkflowInstanceId = table.Column(type: "NVARCHAR2(450)", nullable: false), - ActivityInstanceId = table.Column(type: "NVARCHAR2(450)", nullable: true), - CorrelationId = table.Column(type: "NVARCHAR2(2000)", nullable: true), - CreatedAt = table.Column(type: "TIMESTAMP(7) WITH TIME ZONE", nullable: false), - SerializedMetadata = table.Column(type: "NCLOB", nullable: true), - SerializedPayload = table.Column(type: "NCLOB", nullable: true), - TenantId = table.Column(type: "NVARCHAR2(450)", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Bookmarks", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "KeyValuePairs", - schema: _schema.Schema, - columns: table => new - { - Id = table.Column(type: "NVARCHAR2(450)", nullable: false), - SerializedValue = table.Column(type: "NVARCHAR2(2000)", nullable: false), - TenantId = table.Column(type: "NVARCHAR2(450)", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_KeyValuePairs", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "Triggers", - schema: _schema.Schema, - columns: table => new - { - Id = table.Column(type: "NVARCHAR2(450)", nullable: false), - WorkflowDefinitionId = table.Column(type: "NVARCHAR2(450)", nullable: false), - WorkflowDefinitionVersionId = table.Column(type: "NVARCHAR2(450)", nullable: false), - Name = table.Column(type: "NVARCHAR2(450)", nullable: false), - ActivityId = table.Column(type: "NVARCHAR2(2000)", nullable: false), - Hash = table.Column(type: "NVARCHAR2(450)", nullable: true), - SerializedPayload = table.Column(type: "NCLOB", nullable: true), - TenantId = table.Column(type: "NVARCHAR2(450)", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Triggers", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "WorkflowExecutionLogRecords", - schema: _schema.Schema, - columns: table => new - { - Id = table.Column(type: "NVARCHAR2(450)", nullable: false), - WorkflowDefinitionId = table.Column(type: "NVARCHAR2(450)", nullable: false), - WorkflowDefinitionVersionId = table.Column(type: "NVARCHAR2(450)", nullable: false), - WorkflowInstanceId = table.Column(type: "NVARCHAR2(450)", nullable: false), - WorkflowVersion = table.Column(type: "NUMBER(10)", nullable: false), - ActivityInstanceId = table.Column(type: "NVARCHAR2(450)", nullable: false), - ParentActivityInstanceId = table.Column(type: "NVARCHAR2(450)", nullable: true), - ActivityId = table.Column(type: "NVARCHAR2(450)", nullable: false), - ActivityType = table.Column(type: "NVARCHAR2(450)", nullable: false), - ActivityTypeVersion = table.Column(type: "NUMBER(10)", nullable: false), - ActivityName = table.Column(type: "NVARCHAR2(450)", nullable: true), - ActivityNodeId = table.Column(type: "NVARCHAR2(450)", nullable: false), - Timestamp = table.Column(type: "TIMESTAMP(7) WITH TIME ZONE", nullable: false), - Sequence = table.Column(type: "NUMBER(19)", nullable: false), - EventName = table.Column(type: "NVARCHAR2(450)", nullable: true), - Message = table.Column(type: "NVARCHAR2(2000)", nullable: true), - Source = table.Column(type: "NVARCHAR2(2000)", nullable: true), - SerializedActivityState = table.Column(type: "NCLOB", nullable: true), - SerializedPayload = table.Column(type: "NCLOB", nullable: true), - TenantId = table.Column(type: "NVARCHAR2(450)", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_WorkflowExecutionLogRecords", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "WorkflowInboxMessages", - schema: _schema.Schema, - columns: table => new - { - Id = table.Column(type: "NVARCHAR2(450)", nullable: false), - ActivityTypeName = table.Column(type: "NVARCHAR2(450)", nullable: false), - Hash = table.Column(type: "NVARCHAR2(450)", nullable: false), - WorkflowInstanceId = table.Column(type: "NVARCHAR2(450)", nullable: true), - CorrelationId = table.Column(type: "NVARCHAR2(450)", nullable: true), - ActivityInstanceId = table.Column(type: "NVARCHAR2(450)", nullable: true), - CreatedAt = table.Column(type: "TIMESTAMP(7) WITH TIME ZONE", nullable: false), - ExpiresAt = table.Column(type: "TIMESTAMP(7) WITH TIME ZONE", nullable: false), - SerializedBookmarkPayload = table.Column(type: "NCLOB", nullable: true), - SerializedInput = table.Column(type: "NCLOB", nullable: true), - TenantId = table.Column(type: "NVARCHAR2(2000)", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_WorkflowInboxMessages", x => x.Id); - }); - - migrationBuilder.CreateIndex( - name: "IX_ActivityExecutionRecord_ActivityId", - schema: _schema.Schema, - table: "ActivityExecutionRecords", - column: "ActivityId"); - - migrationBuilder.CreateIndex( - name: "IX_ActivityExecutionRecord_ActivityName", - schema: _schema.Schema, - table: "ActivityExecutionRecords", - column: "ActivityName"); - - migrationBuilder.CreateIndex( - name: "IX_ActivityExecutionRecord_ActivityNodeId", - schema: _schema.Schema, - table: "ActivityExecutionRecords", - column: "ActivityNodeId"); - - migrationBuilder.CreateIndex( - name: "IX_ActivityExecutionRecord_ActivityType", - schema: _schema.Schema, - table: "ActivityExecutionRecords", - column: "ActivityType"); - - migrationBuilder.CreateIndex( - name: "IX_ActivityExecutionRecord_ActivityType_ActivityTypeVersion", - schema: _schema.Schema, - table: "ActivityExecutionRecords", - columns: new[] { "ActivityType", "ActivityTypeVersion" }); - - migrationBuilder.CreateIndex( - name: "IX_ActivityExecutionRecord_ActivityTypeVersion", - schema: _schema.Schema, - table: "ActivityExecutionRecords", - column: "ActivityTypeVersion"); - - migrationBuilder.CreateIndex( - name: "IX_ActivityExecutionRecord_CompletedAt", - schema: _schema.Schema, - table: "ActivityExecutionRecords", - column: "CompletedAt"); - - migrationBuilder.CreateIndex( - name: "IX_ActivityExecutionRecord_HasBookmarks", - schema: _schema.Schema, - table: "ActivityExecutionRecords", - column: "HasBookmarks"); - - migrationBuilder.CreateIndex( - name: "IX_ActivityExecutionRecord_StartedAt", - schema: _schema.Schema, - table: "ActivityExecutionRecords", - column: "StartedAt"); - - migrationBuilder.CreateIndex( - name: "IX_ActivityExecutionRecord_Status", - schema: _schema.Schema, - table: "ActivityExecutionRecords", - column: "Status"); - - migrationBuilder.CreateIndex( - name: "IX_ActivityExecutionRecord_TenantId", - schema: _schema.Schema, - table: "ActivityExecutionRecords", - column: "TenantId"); - - migrationBuilder.CreateIndex( - name: "IX_ActivityExecutionRecord_WorkflowInstanceId", - schema: _schema.Schema, - table: "ActivityExecutionRecords", - column: "WorkflowInstanceId"); - - migrationBuilder.CreateIndex( - name: "IX_BookmarkQueueItem_ActivityInstanceId", - schema: _schema.Schema, - table: "BookmarkQueueItems", - column: "ActivityInstanceId"); - - migrationBuilder.CreateIndex( - name: "IX_BookmarkQueueItem_ActivityTypeName", - schema: _schema.Schema, - table: "BookmarkQueueItems", - column: "ActivityTypeName"); - - migrationBuilder.CreateIndex( - name: "IX_BookmarkQueueItem_BookmarkId", - schema: _schema.Schema, - table: "BookmarkQueueItems", - column: "BookmarkId"); - - migrationBuilder.CreateIndex( - name: "IX_BookmarkQueueItem_CorrelationId", - schema: _schema.Schema, - table: "BookmarkQueueItems", - column: "CorrelationId"); - - migrationBuilder.CreateIndex( - name: "IX_BookmarkQueueItem_CreatedAt", - schema: _schema.Schema, - table: "BookmarkQueueItems", - column: "CreatedAt"); - - migrationBuilder.CreateIndex( - name: "IX_BookmarkQueueItem_StimulusHash", - schema: _schema.Schema, - table: "BookmarkQueueItems", - column: "StimulusHash"); - - migrationBuilder.CreateIndex( - name: "IX_BookmarkQueueItem_TenantId", - schema: _schema.Schema, - table: "BookmarkQueueItems", - column: "TenantId"); - - migrationBuilder.CreateIndex( - name: "IX_BookmarkQueueItem_WorkflowInstanceId", - schema: _schema.Schema, - table: "BookmarkQueueItems", - column: "WorkflowInstanceId"); - - migrationBuilder.CreateIndex( - name: "IX_StoredBookmark_ActivityInstanceId", - schema: _schema.Schema, - table: "Bookmarks", - column: "ActivityInstanceId"); - - migrationBuilder.CreateIndex( - name: "IX_StoredBookmark_ActivityTypeName", - schema: _schema.Schema, - table: "Bookmarks", - column: "ActivityTypeName"); - - migrationBuilder.CreateIndex( - name: "IX_StoredBookmark_ActivityTypeName_Hash", - schema: _schema.Schema, - table: "Bookmarks", - columns: new[] { "ActivityTypeName", "Hash" }); - - migrationBuilder.CreateIndex( - name: "IX_StoredBookmark_ActivityTypeName_Hash_WorkflowInstanceId", - schema: _schema.Schema, - table: "Bookmarks", - columns: new[] { "ActivityTypeName", "Hash", "WorkflowInstanceId" }); - - migrationBuilder.CreateIndex( - name: "IX_StoredBookmark_CreatedAt", - schema: _schema.Schema, - table: "Bookmarks", - column: "CreatedAt"); - - migrationBuilder.CreateIndex( - name: "IX_StoredBookmark_Hash", - schema: _schema.Schema, - table: "Bookmarks", - column: "Hash"); - - migrationBuilder.CreateIndex( - name: "IX_StoredBookmark_TenantId", - schema: _schema.Schema, - table: "Bookmarks", - column: "TenantId"); - - migrationBuilder.CreateIndex( - name: "IX_StoredBookmark_WorkflowInstanceId", - schema: _schema.Schema, - table: "Bookmarks", - column: "WorkflowInstanceId"); - - migrationBuilder.CreateIndex( - name: "IX_SerializedKeyValuePair_TenantId", - schema: _schema.Schema, - table: "KeyValuePairs", - column: "TenantId"); - - migrationBuilder.CreateIndex( - name: "IX_StoredTrigger_Hash", - schema: _schema.Schema, - table: "Triggers", - column: "Hash"); - - migrationBuilder.CreateIndex( - name: "IX_StoredTrigger_Name", - schema: _schema.Schema, - table: "Triggers", - column: "Name"); - - migrationBuilder.CreateIndex( - name: "IX_StoredTrigger_TenantId", - schema: _schema.Schema, - table: "Triggers", - column: "TenantId"); - - migrationBuilder.CreateIndex( - name: "IX_StoredTrigger_WorkflowDefinitionId", - schema: _schema.Schema, - table: "Triggers", - column: "WorkflowDefinitionId"); - - migrationBuilder.CreateIndex( - name: "IX_StoredTrigger_WorkflowDefinitionVersionId", - schema: _schema.Schema, - table: "Triggers", - column: "WorkflowDefinitionVersionId"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowExecutionLogRecord_ActivityId", - schema: _schema.Schema, - table: "WorkflowExecutionLogRecords", - column: "ActivityId"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowExecutionLogRecord_ActivityInstanceId", - schema: _schema.Schema, - table: "WorkflowExecutionLogRecords", - column: "ActivityInstanceId"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowExecutionLogRecord_ActivityName", - schema: _schema.Schema, - table: "WorkflowExecutionLogRecords", - column: "ActivityName"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowExecutionLogRecord_ActivityNodeId", - schema: _schema.Schema, - table: "WorkflowExecutionLogRecords", - column: "ActivityNodeId"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowExecutionLogRecord_ActivityType", - schema: _schema.Schema, - table: "WorkflowExecutionLogRecords", - column: "ActivityType"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowExecutionLogRecord_ActivityType_ActivityTypeVersion", - schema: _schema.Schema, - table: "WorkflowExecutionLogRecords", - columns: new[] { "ActivityType", "ActivityTypeVersion" }); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowExecutionLogRecord_ActivityTypeVersion", - schema: _schema.Schema, - table: "WorkflowExecutionLogRecords", - column: "ActivityTypeVersion"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowExecutionLogRecord_EventName", - schema: _schema.Schema, - table: "WorkflowExecutionLogRecords", - column: "EventName"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowExecutionLogRecord_ParentActivityInstanceId", - schema: _schema.Schema, - table: "WorkflowExecutionLogRecords", - column: "ParentActivityInstanceId"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowExecutionLogRecord_Sequence", - schema: _schema.Schema, - table: "WorkflowExecutionLogRecords", - column: "Sequence"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowExecutionLogRecord_TenantId", - schema: _schema.Schema, - table: "WorkflowExecutionLogRecords", - column: "TenantId"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowExecutionLogRecord_Timestamp", - schema: _schema.Schema, - table: "WorkflowExecutionLogRecords", - column: "Timestamp"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowExecutionLogRecord_Timestamp_Sequence", - schema: _schema.Schema, - table: "WorkflowExecutionLogRecords", - columns: new[] { "Timestamp", "Sequence" }); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowExecutionLogRecord_WorkflowDefinitionId", - schema: _schema.Schema, - table: "WorkflowExecutionLogRecords", - column: "WorkflowDefinitionId"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowExecutionLogRecord_WorkflowDefinitionVersionId", - schema: _schema.Schema, - table: "WorkflowExecutionLogRecords", - column: "WorkflowDefinitionVersionId"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowExecutionLogRecord_WorkflowInstanceId", - schema: _schema.Schema, - table: "WorkflowExecutionLogRecords", - column: "WorkflowInstanceId"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowExecutionLogRecord_WorkflowVersion", - schema: _schema.Schema, - table: "WorkflowExecutionLogRecords", - column: "WorkflowVersion"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowInboxMessage_ActivityInstanceId", - schema: _schema.Schema, - table: "WorkflowInboxMessages", - column: "ActivityInstanceId"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowInboxMessage_ActivityTypeName", - schema: _schema.Schema, - table: "WorkflowInboxMessages", - column: "ActivityTypeName"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowInboxMessage_CorrelationId", - schema: _schema.Schema, - table: "WorkflowInboxMessages", - column: "CorrelationId"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowInboxMessage_CreatedAt", - schema: _schema.Schema, - table: "WorkflowInboxMessages", - column: "CreatedAt"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowInboxMessage_ExpiresAt", - schema: _schema.Schema, - table: "WorkflowInboxMessages", - column: "ExpiresAt"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowInboxMessage_Hash", - schema: _schema.Schema, - table: "WorkflowInboxMessages", - column: "Hash"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowInboxMessage_WorkflowInstanceId", - schema: _schema.Schema, - table: "WorkflowInboxMessages", - column: "WorkflowInstanceId"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "ActivityExecutionRecords", - schema: _schema.Schema); - - migrationBuilder.DropTable( - name: "BookmarkQueueItems", - schema: _schema.Schema); - - migrationBuilder.DropTable( - name: "Bookmarks", - schema: _schema.Schema); - - migrationBuilder.DropTable( - name: "KeyValuePairs", - schema: _schema.Schema); - - migrationBuilder.DropTable( - name: "Triggers", - schema: _schema.Schema); - - migrationBuilder.DropTable( - name: "WorkflowExecutionLogRecords", - schema: _schema.Schema); - - migrationBuilder.DropTable( - name: "WorkflowInboxMessages", - schema: _schema.Schema); - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.Oracle/Migrations/Runtime/20250222190848_V3_4.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.Oracle/Migrations/Runtime/20250222190848_V3_4.Designer.cs deleted file mode 100644 index cdc6ccbfd7..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Oracle/Migrations/Runtime/20250222190848_V3_4.Designer.cs +++ /dev/null @@ -1,492 +0,0 @@ -// -using System; -using Elsa.EntityFrameworkCore.Modules.Runtime; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Oracle.EntityFrameworkCore.Metadata; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.Oracle.Migrations.Runtime -{ - [DbContext(typeof(RuntimeElsaDbContext))] - [Migration("20250222190848_V3_4")] - partial class V3_4 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "8.0.12") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - OracleModelBuilderExtensions.UseIdentityColumns(modelBuilder); - - modelBuilder.Entity("Elsa.KeyValues.Entities.SerializedKeyValuePair", b => - { - b.Property("Id") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("SerializedValue") - .IsRequired() - .HasColumnType("NVARCHAR2(2000)"); - - b.Property("TenantId") - .HasColumnType("NVARCHAR2(450)"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "TenantId" }, "IX_SerializedKeyValuePair_TenantId"); - - b.ToTable("KeyValuePairs", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.ActivityExecutionRecord", b => - { - b.Property("Id") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("ActivityId") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("ActivityName") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("ActivityNodeId") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("ActivityType") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("ActivityTypeVersion") - .HasColumnType("NUMBER(10)"); - - b.Property("CompletedAt") - .HasColumnType("TIMESTAMP(7) WITH TIME ZONE"); - - b.Property("HasBookmarks") - .HasColumnType("BOOLEAN"); - - b.Property("SerializedActivityState") - .HasColumnType("NCLOB"); - - b.Property("SerializedActivityStateCompressionAlgorithm") - .HasColumnType("NVARCHAR2(2000)"); - - b.Property("SerializedException") - .HasColumnType("NCLOB"); - - b.Property("SerializedOutputs") - .HasColumnType("NCLOB"); - - b.Property("SerializedPayload") - .HasColumnType("NCLOB"); - - b.Property("SerializedProperties") - .HasColumnType("NCLOB"); - - b.Property("StartedAt") - .HasColumnType("TIMESTAMP(7) WITH TIME ZONE"); - - b.Property("Status") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("TenantId") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.HasKey("Id"); - - b.HasIndex("ActivityId") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityId"); - - b.HasIndex("ActivityName") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityName"); - - b.HasIndex("ActivityNodeId") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityNodeId"); - - b.HasIndex("ActivityType") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityType"); - - b.HasIndex("ActivityTypeVersion") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityTypeVersion"); - - b.HasIndex("CompletedAt") - .HasDatabaseName("IX_ActivityExecutionRecord_CompletedAt"); - - b.HasIndex("HasBookmarks") - .HasDatabaseName("IX_ActivityExecutionRecord_HasBookmarks"); - - b.HasIndex("StartedAt") - .HasDatabaseName("IX_ActivityExecutionRecord_StartedAt"); - - b.HasIndex("Status") - .HasDatabaseName("IX_ActivityExecutionRecord_Status"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_ActivityExecutionRecord_TenantId"); - - b.HasIndex("WorkflowInstanceId") - .HasDatabaseName("IX_ActivityExecutionRecord_WorkflowInstanceId"); - - b.HasIndex("ActivityType", "ActivityTypeVersion") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityType_ActivityTypeVersion"); - - b.ToTable("ActivityExecutionRecords", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.BookmarkQueueItem", b => - { - b.Property("Id") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("ActivityInstanceId") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("ActivityTypeName") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("BookmarkId") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("CorrelationId") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("CreatedAt") - .HasColumnType("TIMESTAMP(7) WITH TIME ZONE"); - - b.Property("SerializedOptions") - .HasColumnType("NVARCHAR2(2000)"); - - b.Property("StimulusHash") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("TenantId") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("WorkflowInstanceId") - .HasColumnType("NVARCHAR2(450)"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "ActivityInstanceId" }, "IX_BookmarkQueueItem_ActivityInstanceId"); - - b.HasIndex(new[] { "ActivityTypeName" }, "IX_BookmarkQueueItem_ActivityTypeName"); - - b.HasIndex(new[] { "BookmarkId" }, "IX_BookmarkQueueItem_BookmarkId"); - - b.HasIndex(new[] { "CorrelationId" }, "IX_BookmarkQueueItem_CorrelationId"); - - b.HasIndex(new[] { "CreatedAt" }, "IX_BookmarkQueueItem_CreatedAt"); - - b.HasIndex(new[] { "StimulusHash" }, "IX_BookmarkQueueItem_StimulusHash"); - - b.HasIndex(new[] { "TenantId" }, "IX_BookmarkQueueItem_TenantId"); - - b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_BookmarkQueueItem_WorkflowInstanceId"); - - b.ToTable("BookmarkQueueItems", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.StoredBookmark", b => - { - b.Property("Id") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("ActivityInstanceId") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("ActivityTypeName") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("CorrelationId") - .HasColumnType("NVARCHAR2(2000)"); - - b.Property("CreatedAt") - .HasColumnType("TIMESTAMP(7) WITH TIME ZONE"); - - b.Property("Hash") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("SerializedMetadata") - .HasColumnType("NCLOB"); - - b.Property("SerializedPayload") - .HasColumnType("NCLOB"); - - b.Property("TenantId") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "ActivityInstanceId" }, "IX_StoredBookmark_ActivityInstanceId"); - - b.HasIndex(new[] { "ActivityTypeName" }, "IX_StoredBookmark_ActivityTypeName"); - - b.HasIndex(new[] { "ActivityTypeName", "Hash" }, "IX_StoredBookmark_ActivityTypeName_Hash"); - - b.HasIndex(new[] { "ActivityTypeName", "Hash", "WorkflowInstanceId" }, "IX_StoredBookmark_ActivityTypeName_Hash_WorkflowInstanceId"); - - b.HasIndex(new[] { "CreatedAt" }, "IX_StoredBookmark_CreatedAt"); - - b.HasIndex(new[] { "Hash" }, "IX_StoredBookmark_Hash"); - - b.HasIndex(new[] { "TenantId" }, "IX_StoredBookmark_TenantId"); - - b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_StoredBookmark_WorkflowInstanceId"); - - b.ToTable("Bookmarks", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.StoredTrigger", b => - { - b.Property("Id") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("ActivityId") - .IsRequired() - .HasColumnType("NVARCHAR2(2000)"); - - b.Property("Hash") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("SerializedPayload") - .HasColumnType("NCLOB"); - - b.Property("TenantId") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("WorkflowDefinitionId") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("WorkflowDefinitionVersionId") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.HasKey("Id"); - - b.HasIndex("Hash") - .HasDatabaseName("IX_StoredTrigger_Hash"); - - b.HasIndex("Name") - .HasDatabaseName("IX_StoredTrigger_Name"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_StoredTrigger_TenantId"); - - b.HasIndex("WorkflowDefinitionId") - .HasDatabaseName("IX_StoredTrigger_WorkflowDefinitionId"); - - b.HasIndex("WorkflowDefinitionVersionId") - .HasDatabaseName("IX_StoredTrigger_WorkflowDefinitionVersionId"); - - b.ToTable("Triggers", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.WorkflowExecutionLogRecord", b => - { - b.Property("Id") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("ActivityId") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("ActivityInstanceId") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("ActivityName") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("ActivityNodeId") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("ActivityType") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("ActivityTypeVersion") - .HasColumnType("NUMBER(10)"); - - b.Property("EventName") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("Message") - .HasColumnType("NVARCHAR2(2000)"); - - b.Property("ParentActivityInstanceId") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("Sequence") - .HasColumnType("NUMBER(19)"); - - b.Property("SerializedActivityState") - .HasColumnType("NCLOB"); - - b.Property("SerializedPayload") - .HasColumnType("NCLOB"); - - b.Property("Source") - .HasColumnType("NVARCHAR2(2000)"); - - b.Property("TenantId") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("Timestamp") - .HasColumnType("TIMESTAMP(7) WITH TIME ZONE"); - - b.Property("WorkflowDefinitionId") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("WorkflowDefinitionVersionId") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("WorkflowVersion") - .HasColumnType("NUMBER(10)"); - - b.HasKey("Id"); - - b.HasIndex("ActivityId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityId"); - - b.HasIndex("ActivityInstanceId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityInstanceId"); - - b.HasIndex("ActivityName") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityName"); - - b.HasIndex("ActivityNodeId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityNodeId"); - - b.HasIndex("ActivityType") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityType"); - - b.HasIndex("ActivityTypeVersion") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityTypeVersion"); - - b.HasIndex("EventName") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_EventName"); - - b.HasIndex("ParentActivityInstanceId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ParentActivityInstanceId"); - - b.HasIndex("Sequence") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_Sequence"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_TenantId"); - - b.HasIndex("Timestamp") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_Timestamp"); - - b.HasIndex("WorkflowDefinitionId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowDefinitionId"); - - b.HasIndex("WorkflowDefinitionVersionId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowDefinitionVersionId"); - - b.HasIndex("WorkflowInstanceId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowInstanceId"); - - b.HasIndex("WorkflowVersion") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowVersion"); - - b.HasIndex("ActivityType", "ActivityTypeVersion") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityType_ActivityTypeVersion"); - - b.HasIndex("Timestamp", "Sequence") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_Timestamp_Sequence"); - - b.ToTable("WorkflowExecutionLogRecords", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.WorkflowInboxMessage", b => - { - b.Property("Id") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("ActivityInstanceId") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("ActivityTypeName") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("CorrelationId") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("CreatedAt") - .HasColumnType("TIMESTAMP(7) WITH TIME ZONE"); - - b.Property("ExpiresAt") - .HasColumnType("TIMESTAMP(7) WITH TIME ZONE"); - - b.Property("Hash") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("SerializedBookmarkPayload") - .HasColumnType("NCLOB"); - - b.Property("SerializedInput") - .HasColumnType("NCLOB"); - - b.Property("TenantId") - .HasColumnType("NVARCHAR2(2000)"); - - b.Property("WorkflowInstanceId") - .HasColumnType("NVARCHAR2(450)"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "ActivityInstanceId" }, "IX_WorkflowInboxMessage_ActivityInstanceId"); - - b.HasIndex(new[] { "ActivityTypeName" }, "IX_WorkflowInboxMessage_ActivityTypeName"); - - b.HasIndex(new[] { "CorrelationId" }, "IX_WorkflowInboxMessage_CorrelationId"); - - b.HasIndex(new[] { "CreatedAt" }, "IX_WorkflowInboxMessage_CreatedAt"); - - b.HasIndex(new[] { "ExpiresAt" }, "IX_WorkflowInboxMessage_ExpiresAt"); - - b.HasIndex(new[] { "Hash" }, "IX_WorkflowInboxMessage_Hash"); - - b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_WorkflowInboxMessage_WorkflowInstanceId"); - - b.ToTable("WorkflowInboxMessages", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.Oracle/Migrations/Runtime/20250222190848_V3_4.cs b/src/modules/Elsa.EntityFrameworkCore.Oracle/Migrations/Runtime/20250222190848_V3_4.cs deleted file mode 100644 index bc4564061e..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Oracle/Migrations/Runtime/20250222190848_V3_4.cs +++ /dev/null @@ -1,30 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.Oracle.Migrations.Runtime -{ - /// - public partial class V3_4 : Migration - { - private readonly Elsa.EntityFrameworkCore.IElsaDbContextSchema _schema; - - /// - public V3_4(Elsa.EntityFrameworkCore.IElsaDbContextSchema schema) - { - _schema = schema; - } - - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.Oracle/Migrations/Runtime/20250401201436_V3_5.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.Oracle/Migrations/Runtime/20250401201436_V3_5.Designer.cs deleted file mode 100644 index 0e013e8905..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Oracle/Migrations/Runtime/20250401201436_V3_5.Designer.cs +++ /dev/null @@ -1,503 +0,0 @@ -// -using System; -using Elsa.EntityFrameworkCore.Modules.Runtime; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Oracle.EntityFrameworkCore.Metadata; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.Oracle.Migrations.Runtime -{ - [DbContext(typeof(RuntimeElsaDbContext))] - [Migration("20250401201436_V3_5")] - partial class V3_5 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "9.0.3") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - OracleModelBuilderExtensions.UseIdentityColumns(modelBuilder); - - modelBuilder.Entity("Elsa.KeyValues.Entities.SerializedKeyValuePair", b => - { - b.Property("Id") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("SerializedValue") - .IsRequired() - .HasColumnType("NVARCHAR2(2000)"); - - b.Property("TenantId") - .HasColumnType("NVARCHAR2(450)"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "TenantId" }, "IX_SerializedKeyValuePair_TenantId"); - - b.ToTable("KeyValuePairs", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.ActivityExecutionRecord", b => - { - b.Property("Id") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("ActivityId") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("ActivityName") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("ActivityNodeId") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("ActivityType") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("ActivityTypeVersion") - .HasColumnType("NUMBER(10)"); - - b.Property("AggregateFaultCount") - .HasColumnType("NUMBER(10)"); - - b.Property("CompletedAt") - .HasColumnType("TIMESTAMP(7) WITH TIME ZONE"); - - b.Property("HasBookmarks") - .HasColumnType("BOOLEAN"); - - b.Property("SerializedActivityState") - .HasColumnType("NCLOB"); - - b.Property("SerializedActivityStateCompressionAlgorithm") - .HasColumnType("NVARCHAR2(2000)"); - - b.Property("SerializedException") - .HasColumnType("NCLOB"); - - b.Property("SerializedOutputs") - .HasColumnType("NCLOB"); - - b.Property("SerializedPayload") - .HasColumnType("NCLOB"); - - b.Property("SerializedProperties") - .HasColumnType("NCLOB"); - - b.Property("StartedAt") - .HasColumnType("TIMESTAMP(7) WITH TIME ZONE"); - - b.Property("Status") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("TenantId") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.HasKey("Id"); - - b.HasIndex("ActivityId") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityId"); - - b.HasIndex("ActivityName") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityName"); - - b.HasIndex("ActivityNodeId") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityNodeId"); - - b.HasIndex("ActivityType") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityType"); - - b.HasIndex("ActivityTypeVersion") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityTypeVersion"); - - b.HasIndex("CompletedAt") - .HasDatabaseName("IX_ActivityExecutionRecord_CompletedAt"); - - b.HasIndex("HasBookmarks") - .HasDatabaseName("IX_ActivityExecutionRecord_HasBookmarks"); - - b.HasIndex("StartedAt") - .HasDatabaseName("IX_ActivityExecutionRecord_StartedAt"); - - b.HasIndex("Status") - .HasDatabaseName("IX_ActivityExecutionRecord_Status"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_ActivityExecutionRecord_TenantId"); - - b.HasIndex("WorkflowInstanceId") - .HasDatabaseName("IX_ActivityExecutionRecord_WorkflowInstanceId"); - - b.HasIndex("ActivityType", "ActivityTypeVersion") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityType_ActivityTypeVersion"); - - b.ToTable("ActivityExecutionRecords", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.BookmarkQueueItem", b => - { - b.Property("Id") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("ActivityInstanceId") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("ActivityTypeName") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("BookmarkId") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("CorrelationId") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("CreatedAt") - .HasColumnType("TIMESTAMP(7) WITH TIME ZONE"); - - b.Property("SerializedOptions") - .HasColumnType("NVARCHAR2(2000)"); - - b.Property("StimulusHash") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("TenantId") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("WorkflowInstanceId") - .HasColumnType("NVARCHAR2(450)"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "ActivityInstanceId" }, "IX_BookmarkQueueItem_ActivityInstanceId"); - - b.HasIndex(new[] { "ActivityTypeName" }, "IX_BookmarkQueueItem_ActivityTypeName"); - - b.HasIndex(new[] { "BookmarkId" }, "IX_BookmarkQueueItem_BookmarkId"); - - b.HasIndex(new[] { "CorrelationId" }, "IX_BookmarkQueueItem_CorrelationId"); - - b.HasIndex(new[] { "CreatedAt" }, "IX_BookmarkQueueItem_CreatedAt"); - - b.HasIndex(new[] { "StimulusHash" }, "IX_BookmarkQueueItem_StimulusHash"); - - b.HasIndex(new[] { "TenantId" }, "IX_BookmarkQueueItem_TenantId"); - - b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_BookmarkQueueItem_WorkflowInstanceId"); - - b.ToTable("BookmarkQueueItems", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.StoredBookmark", b => - { - b.Property("Id") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("ActivityInstanceId") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("ActivityTypeName") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("CorrelationId") - .HasColumnType("NVARCHAR2(2000)"); - - b.Property("CreatedAt") - .HasColumnType("TIMESTAMP(7) WITH TIME ZONE"); - - b.Property("Hash") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("Name") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("SerializedMetadata") - .HasColumnType("NCLOB"); - - b.Property("SerializedPayload") - .HasColumnType("NCLOB"); - - b.Property("TenantId") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "ActivityInstanceId" }, "IX_StoredBookmark_ActivityInstanceId"); - - b.HasIndex(new[] { "ActivityTypeName" }, "IX_StoredBookmark_ActivityTypeName"); - - b.HasIndex(new[] { "ActivityTypeName", "Hash" }, "IX_StoredBookmark_ActivityTypeName_Hash"); - - b.HasIndex(new[] { "ActivityTypeName", "Hash", "WorkflowInstanceId" }, "IX_StoredBookmark_ActivityTypeName_Hash_WorkflowInstanceId"); - - b.HasIndex(new[] { "CreatedAt" }, "IX_StoredBookmark_CreatedAt"); - - b.HasIndex(new[] { "Hash" }, "IX_StoredBookmark_Hash"); - - b.HasIndex(new[] { "Name" }, "IX_StoredBookmark_Name"); - - b.HasIndex(new[] { "Name", "Hash" }, "IX_StoredBookmark_Name_Hash"); - - b.HasIndex(new[] { "Name", "Hash", "WorkflowInstanceId" }, "IX_StoredBookmark_Name_Hash_WorkflowInstanceId"); - - b.HasIndex(new[] { "TenantId" }, "IX_StoredBookmark_TenantId"); - - b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_StoredBookmark_WorkflowInstanceId"); - - b.ToTable("Bookmarks", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.StoredTrigger", b => - { - b.Property("Id") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("ActivityId") - .IsRequired() - .HasColumnType("NVARCHAR2(2000)"); - - b.Property("Hash") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("Name") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("SerializedPayload") - .HasColumnType("NCLOB"); - - b.Property("TenantId") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("WorkflowDefinitionId") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("WorkflowDefinitionVersionId") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.HasKey("Id"); - - b.HasIndex("Hash") - .HasDatabaseName("IX_StoredTrigger_Hash"); - - b.HasIndex("Name") - .HasDatabaseName("IX_StoredTrigger_Name"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_StoredTrigger_TenantId"); - - b.HasIndex("WorkflowDefinitionId") - .HasDatabaseName("IX_StoredTrigger_WorkflowDefinitionId"); - - b.HasIndex("WorkflowDefinitionVersionId") - .HasDatabaseName("IX_StoredTrigger_WorkflowDefinitionVersionId"); - - b.ToTable("Triggers", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.WorkflowExecutionLogRecord", b => - { - b.Property("Id") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("ActivityId") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("ActivityInstanceId") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("ActivityName") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("ActivityNodeId") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("ActivityType") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("ActivityTypeVersion") - .HasColumnType("NUMBER(10)"); - - b.Property("EventName") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("Message") - .HasColumnType("NVARCHAR2(2000)"); - - b.Property("ParentActivityInstanceId") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("Sequence") - .HasColumnType("NUMBER(19)"); - - b.Property("SerializedActivityState") - .HasColumnType("NCLOB"); - - b.Property("SerializedPayload") - .HasColumnType("NCLOB"); - - b.Property("Source") - .HasColumnType("NVARCHAR2(2000)"); - - b.Property("TenantId") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("Timestamp") - .HasColumnType("TIMESTAMP(7) WITH TIME ZONE"); - - b.Property("WorkflowDefinitionId") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("WorkflowDefinitionVersionId") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("WorkflowVersion") - .HasColumnType("NUMBER(10)"); - - b.HasKey("Id"); - - b.HasIndex("ActivityId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityId"); - - b.HasIndex("ActivityInstanceId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityInstanceId"); - - b.HasIndex("ActivityName") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityName"); - - b.HasIndex("ActivityNodeId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityNodeId"); - - b.HasIndex("ActivityType") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityType"); - - b.HasIndex("ActivityTypeVersion") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityTypeVersion"); - - b.HasIndex("EventName") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_EventName"); - - b.HasIndex("ParentActivityInstanceId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ParentActivityInstanceId"); - - b.HasIndex("Sequence") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_Sequence"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_TenantId"); - - b.HasIndex("Timestamp") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_Timestamp"); - - b.HasIndex("WorkflowDefinitionId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowDefinitionId"); - - b.HasIndex("WorkflowDefinitionVersionId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowDefinitionVersionId"); - - b.HasIndex("WorkflowInstanceId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowInstanceId"); - - b.HasIndex("WorkflowVersion") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowVersion"); - - b.HasIndex("ActivityType", "ActivityTypeVersion") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityType_ActivityTypeVersion"); - - b.HasIndex("Timestamp", "Sequence") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_Timestamp_Sequence"); - - b.ToTable("WorkflowExecutionLogRecords", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.WorkflowInboxMessage", b => - { - b.Property("Id") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("ActivityInstanceId") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("ActivityTypeName") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("CorrelationId") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("CreatedAt") - .HasColumnType("TIMESTAMP(7) WITH TIME ZONE"); - - b.Property("ExpiresAt") - .HasColumnType("TIMESTAMP(7) WITH TIME ZONE"); - - b.Property("Hash") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("SerializedBookmarkPayload") - .HasColumnType("NCLOB"); - - b.Property("SerializedInput") - .HasColumnType("NCLOB"); - - b.Property("TenantId") - .HasColumnType("NVARCHAR2(2000)"); - - b.Property("WorkflowInstanceId") - .HasColumnType("NVARCHAR2(450)"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "ActivityInstanceId" }, "IX_WorkflowInboxMessage_ActivityInstanceId"); - - b.HasIndex(new[] { "ActivityTypeName" }, "IX_WorkflowInboxMessage_ActivityTypeName"); - - b.HasIndex(new[] { "CorrelationId" }, "IX_WorkflowInboxMessage_CorrelationId"); - - b.HasIndex(new[] { "CreatedAt" }, "IX_WorkflowInboxMessage_CreatedAt"); - - b.HasIndex(new[] { "ExpiresAt" }, "IX_WorkflowInboxMessage_ExpiresAt"); - - b.HasIndex(new[] { "Hash" }, "IX_WorkflowInboxMessage_Hash"); - - b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_WorkflowInboxMessage_WorkflowInstanceId"); - - b.ToTable("WorkflowInboxMessages", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.Oracle/Migrations/Runtime/20250401201436_V3_5.cs b/src/modules/Elsa.EntityFrameworkCore.Oracle/Migrations/Runtime/20250401201436_V3_5.cs deleted file mode 100644 index 961ca95c0f..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Oracle/Migrations/Runtime/20250401201436_V3_5.cs +++ /dev/null @@ -1,104 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.Oracle.Migrations.Runtime -{ - /// - public partial class V3_5 : Migration - { - private readonly Elsa.EntityFrameworkCore.IElsaDbContextSchema _schema; - - /// - public V3_5(Elsa.EntityFrameworkCore.IElsaDbContextSchema schema) - { - _schema = schema; - } - - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AlterColumn( - name: "Name", - schema: _schema.Schema, - table: "Triggers", - type: "NVARCHAR2(450)", - nullable: true, - oldClrType: typeof(string), - oldType: "NVARCHAR2(450)"); - - migrationBuilder.AddColumn( - name: "Name", - schema: _schema.Schema, - table: "Bookmarks", - type: "NVARCHAR2(450)", - nullable: true); - - migrationBuilder.AddColumn( - name: "AggregateFaultCount", - schema: _schema.Schema, - table: "ActivityExecutionRecords", - type: "NUMBER(10)", - nullable: false, - defaultValue: 0); - - migrationBuilder.CreateIndex( - name: "IX_StoredBookmark_Name", - schema: _schema.Schema, - table: "Bookmarks", - column: "Name"); - - migrationBuilder.CreateIndex( - name: "IX_StoredBookmark_Name_Hash", - schema: _schema.Schema, - table: "Bookmarks", - columns: new[] { "Name", "Hash" }); - - migrationBuilder.CreateIndex( - name: "IX_StoredBookmark_Name_Hash_WorkflowInstanceId", - schema: _schema.Schema, - table: "Bookmarks", - columns: new[] { "Name", "Hash", "WorkflowInstanceId" }); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropIndex( - name: "IX_StoredBookmark_Name", - schema: _schema.Schema, - table: "Bookmarks"); - - migrationBuilder.DropIndex( - name: "IX_StoredBookmark_Name_Hash", - schema: _schema.Schema, - table: "Bookmarks"); - - migrationBuilder.DropIndex( - name: "IX_StoredBookmark_Name_Hash_WorkflowInstanceId", - schema: _schema.Schema, - table: "Bookmarks"); - - migrationBuilder.DropColumn( - name: "Name", - schema: _schema.Schema, - table: "Bookmarks"); - - migrationBuilder.DropColumn( - name: "AggregateFaultCount", - schema: _schema.Schema, - table: "ActivityExecutionRecords"); - - migrationBuilder.AlterColumn( - name: "Name", - schema: _schema.Schema, - table: "Triggers", - type: "NVARCHAR2(450)", - nullable: false, - defaultValue: "", - oldClrType: typeof(string), - oldType: "NVARCHAR2(450)", - oldNullable: true); - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.Oracle/Migrations/Runtime/RuntimeElsaDbContextModelSnapshot.cs b/src/modules/Elsa.EntityFrameworkCore.Oracle/Migrations/Runtime/RuntimeElsaDbContextModelSnapshot.cs deleted file mode 100644 index 201722eb66..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Oracle/Migrations/Runtime/RuntimeElsaDbContextModelSnapshot.cs +++ /dev/null @@ -1,500 +0,0 @@ -// -using System; -using Elsa.EntityFrameworkCore.Modules.Runtime; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Oracle.EntityFrameworkCore.Metadata; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.Oracle.Migrations.Runtime -{ - [DbContext(typeof(RuntimeElsaDbContext))] - partial class RuntimeElsaDbContextModelSnapshot : ModelSnapshot - { - protected override void BuildModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "9.0.3") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - OracleModelBuilderExtensions.UseIdentityColumns(modelBuilder); - - modelBuilder.Entity("Elsa.KeyValues.Entities.SerializedKeyValuePair", b => - { - b.Property("Id") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("SerializedValue") - .IsRequired() - .HasColumnType("NVARCHAR2(2000)"); - - b.Property("TenantId") - .HasColumnType("NVARCHAR2(450)"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "TenantId" }, "IX_SerializedKeyValuePair_TenantId"); - - b.ToTable("KeyValuePairs", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.ActivityExecutionRecord", b => - { - b.Property("Id") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("ActivityId") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("ActivityName") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("ActivityNodeId") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("ActivityType") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("ActivityTypeVersion") - .HasColumnType("NUMBER(10)"); - - b.Property("AggregateFaultCount") - .HasColumnType("NUMBER(10)"); - - b.Property("CompletedAt") - .HasColumnType("TIMESTAMP(7) WITH TIME ZONE"); - - b.Property("HasBookmarks") - .HasColumnType("BOOLEAN"); - - b.Property("SerializedActivityState") - .HasColumnType("NCLOB"); - - b.Property("SerializedActivityStateCompressionAlgorithm") - .HasColumnType("NVARCHAR2(2000)"); - - b.Property("SerializedException") - .HasColumnType("NCLOB"); - - b.Property("SerializedOutputs") - .HasColumnType("NCLOB"); - - b.Property("SerializedPayload") - .HasColumnType("NCLOB"); - - b.Property("SerializedProperties") - .HasColumnType("NCLOB"); - - b.Property("StartedAt") - .HasColumnType("TIMESTAMP(7) WITH TIME ZONE"); - - b.Property("Status") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("TenantId") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.HasKey("Id"); - - b.HasIndex("ActivityId") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityId"); - - b.HasIndex("ActivityName") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityName"); - - b.HasIndex("ActivityNodeId") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityNodeId"); - - b.HasIndex("ActivityType") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityType"); - - b.HasIndex("ActivityTypeVersion") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityTypeVersion"); - - b.HasIndex("CompletedAt") - .HasDatabaseName("IX_ActivityExecutionRecord_CompletedAt"); - - b.HasIndex("HasBookmarks") - .HasDatabaseName("IX_ActivityExecutionRecord_HasBookmarks"); - - b.HasIndex("StartedAt") - .HasDatabaseName("IX_ActivityExecutionRecord_StartedAt"); - - b.HasIndex("Status") - .HasDatabaseName("IX_ActivityExecutionRecord_Status"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_ActivityExecutionRecord_TenantId"); - - b.HasIndex("WorkflowInstanceId") - .HasDatabaseName("IX_ActivityExecutionRecord_WorkflowInstanceId"); - - b.HasIndex("ActivityType", "ActivityTypeVersion") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityType_ActivityTypeVersion"); - - b.ToTable("ActivityExecutionRecords", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.BookmarkQueueItem", b => - { - b.Property("Id") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("ActivityInstanceId") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("ActivityTypeName") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("BookmarkId") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("CorrelationId") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("CreatedAt") - .HasColumnType("TIMESTAMP(7) WITH TIME ZONE"); - - b.Property("SerializedOptions") - .HasColumnType("NVARCHAR2(2000)"); - - b.Property("StimulusHash") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("TenantId") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("WorkflowInstanceId") - .HasColumnType("NVARCHAR2(450)"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "ActivityInstanceId" }, "IX_BookmarkQueueItem_ActivityInstanceId"); - - b.HasIndex(new[] { "ActivityTypeName" }, "IX_BookmarkQueueItem_ActivityTypeName"); - - b.HasIndex(new[] { "BookmarkId" }, "IX_BookmarkQueueItem_BookmarkId"); - - b.HasIndex(new[] { "CorrelationId" }, "IX_BookmarkQueueItem_CorrelationId"); - - b.HasIndex(new[] { "CreatedAt" }, "IX_BookmarkQueueItem_CreatedAt"); - - b.HasIndex(new[] { "StimulusHash" }, "IX_BookmarkQueueItem_StimulusHash"); - - b.HasIndex(new[] { "TenantId" }, "IX_BookmarkQueueItem_TenantId"); - - b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_BookmarkQueueItem_WorkflowInstanceId"); - - b.ToTable("BookmarkQueueItems", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.StoredBookmark", b => - { - b.Property("Id") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("ActivityInstanceId") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("ActivityTypeName") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("CorrelationId") - .HasColumnType("NVARCHAR2(2000)"); - - b.Property("CreatedAt") - .HasColumnType("TIMESTAMP(7) WITH TIME ZONE"); - - b.Property("Hash") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("Name") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("SerializedMetadata") - .HasColumnType("NCLOB"); - - b.Property("SerializedPayload") - .HasColumnType("NCLOB"); - - b.Property("TenantId") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "ActivityInstanceId" }, "IX_StoredBookmark_ActivityInstanceId"); - - b.HasIndex(new[] { "ActivityTypeName" }, "IX_StoredBookmark_ActivityTypeName"); - - b.HasIndex(new[] { "ActivityTypeName", "Hash" }, "IX_StoredBookmark_ActivityTypeName_Hash"); - - b.HasIndex(new[] { "ActivityTypeName", "Hash", "WorkflowInstanceId" }, "IX_StoredBookmark_ActivityTypeName_Hash_WorkflowInstanceId"); - - b.HasIndex(new[] { "CreatedAt" }, "IX_StoredBookmark_CreatedAt"); - - b.HasIndex(new[] { "Hash" }, "IX_StoredBookmark_Hash"); - - b.HasIndex(new[] { "Name" }, "IX_StoredBookmark_Name"); - - b.HasIndex(new[] { "Name", "Hash" }, "IX_StoredBookmark_Name_Hash"); - - b.HasIndex(new[] { "Name", "Hash", "WorkflowInstanceId" }, "IX_StoredBookmark_Name_Hash_WorkflowInstanceId"); - - b.HasIndex(new[] { "TenantId" }, "IX_StoredBookmark_TenantId"); - - b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_StoredBookmark_WorkflowInstanceId"); - - b.ToTable("Bookmarks", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.StoredTrigger", b => - { - b.Property("Id") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("ActivityId") - .IsRequired() - .HasColumnType("NVARCHAR2(2000)"); - - b.Property("Hash") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("Name") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("SerializedPayload") - .HasColumnType("NCLOB"); - - b.Property("TenantId") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("WorkflowDefinitionId") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("WorkflowDefinitionVersionId") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.HasKey("Id"); - - b.HasIndex("Hash") - .HasDatabaseName("IX_StoredTrigger_Hash"); - - b.HasIndex("Name") - .HasDatabaseName("IX_StoredTrigger_Name"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_StoredTrigger_TenantId"); - - b.HasIndex("WorkflowDefinitionId") - .HasDatabaseName("IX_StoredTrigger_WorkflowDefinitionId"); - - b.HasIndex("WorkflowDefinitionVersionId") - .HasDatabaseName("IX_StoredTrigger_WorkflowDefinitionVersionId"); - - b.ToTable("Triggers", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.WorkflowExecutionLogRecord", b => - { - b.Property("Id") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("ActivityId") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("ActivityInstanceId") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("ActivityName") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("ActivityNodeId") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("ActivityType") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("ActivityTypeVersion") - .HasColumnType("NUMBER(10)"); - - b.Property("EventName") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("Message") - .HasColumnType("NVARCHAR2(2000)"); - - b.Property("ParentActivityInstanceId") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("Sequence") - .HasColumnType("NUMBER(19)"); - - b.Property("SerializedActivityState") - .HasColumnType("NCLOB"); - - b.Property("SerializedPayload") - .HasColumnType("NCLOB"); - - b.Property("Source") - .HasColumnType("NVARCHAR2(2000)"); - - b.Property("TenantId") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("Timestamp") - .HasColumnType("TIMESTAMP(7) WITH TIME ZONE"); - - b.Property("WorkflowDefinitionId") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("WorkflowDefinitionVersionId") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("WorkflowVersion") - .HasColumnType("NUMBER(10)"); - - b.HasKey("Id"); - - b.HasIndex("ActivityId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityId"); - - b.HasIndex("ActivityInstanceId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityInstanceId"); - - b.HasIndex("ActivityName") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityName"); - - b.HasIndex("ActivityNodeId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityNodeId"); - - b.HasIndex("ActivityType") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityType"); - - b.HasIndex("ActivityTypeVersion") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityTypeVersion"); - - b.HasIndex("EventName") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_EventName"); - - b.HasIndex("ParentActivityInstanceId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ParentActivityInstanceId"); - - b.HasIndex("Sequence") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_Sequence"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_TenantId"); - - b.HasIndex("Timestamp") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_Timestamp"); - - b.HasIndex("WorkflowDefinitionId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowDefinitionId"); - - b.HasIndex("WorkflowDefinitionVersionId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowDefinitionVersionId"); - - b.HasIndex("WorkflowInstanceId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowInstanceId"); - - b.HasIndex("WorkflowVersion") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowVersion"); - - b.HasIndex("ActivityType", "ActivityTypeVersion") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityType_ActivityTypeVersion"); - - b.HasIndex("Timestamp", "Sequence") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_Timestamp_Sequence"); - - b.ToTable("WorkflowExecutionLogRecords", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.WorkflowInboxMessage", b => - { - b.Property("Id") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("ActivityInstanceId") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("ActivityTypeName") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("CorrelationId") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("CreatedAt") - .HasColumnType("TIMESTAMP(7) WITH TIME ZONE"); - - b.Property("ExpiresAt") - .HasColumnType("TIMESTAMP(7) WITH TIME ZONE"); - - b.Property("Hash") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("SerializedBookmarkPayload") - .HasColumnType("NCLOB"); - - b.Property("SerializedInput") - .HasColumnType("NCLOB"); - - b.Property("TenantId") - .HasColumnType("NVARCHAR2(2000)"); - - b.Property("WorkflowInstanceId") - .HasColumnType("NVARCHAR2(450)"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "ActivityInstanceId" }, "IX_WorkflowInboxMessage_ActivityInstanceId"); - - b.HasIndex(new[] { "ActivityTypeName" }, "IX_WorkflowInboxMessage_ActivityTypeName"); - - b.HasIndex(new[] { "CorrelationId" }, "IX_WorkflowInboxMessage_CorrelationId"); - - b.HasIndex(new[] { "CreatedAt" }, "IX_WorkflowInboxMessage_CreatedAt"); - - b.HasIndex(new[] { "ExpiresAt" }, "IX_WorkflowInboxMessage_ExpiresAt"); - - b.HasIndex(new[] { "Hash" }, "IX_WorkflowInboxMessage_Hash"); - - b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_WorkflowInboxMessage_WorkflowInstanceId"); - - b.ToTable("WorkflowInboxMessages", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.Oracle/Migrations/Tenants/20250131233503_V3_3.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.Oracle/Migrations/Tenants/20250131233503_V3_3.Designer.cs deleted file mode 100644 index 447cd1eacf..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Oracle/Migrations/Tenants/20250131233503_V3_3.Designer.cs +++ /dev/null @@ -1,57 +0,0 @@ -// -using Elsa.EntityFrameworkCore.Modules.Tenants; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Oracle.EntityFrameworkCore.Metadata; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.Oracle.Migrations.Tenants -{ - [DbContext(typeof(TenantsElsaDbContext))] - [Migration("20250131233503_V3_3")] - partial class V3_3 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "8.0.12") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - OracleModelBuilderExtensions.UseIdentityColumns(modelBuilder); - - modelBuilder.Entity("Elsa.Common.Multitenancy.Tenant", b => - { - b.Property("Id") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("Configuration") - .IsRequired() - .HasColumnType("NVARCHAR2(2000)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("TenantId") - .HasColumnType("NVARCHAR2(450)"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .HasDatabaseName("IX_Tenant_Name"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_Tenant_TenantId"); - - b.ToTable("Tenants", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.Oracle/Migrations/Tenants/20250131233503_V3_3.cs b/src/modules/Elsa.EntityFrameworkCore.Oracle/Migrations/Tenants/20250131233503_V3_3.cs deleted file mode 100644 index 1860609acb..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Oracle/Migrations/Tenants/20250131233503_V3_3.cs +++ /dev/null @@ -1,60 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.Oracle.Migrations.Tenants -{ - /// - public partial class V3_3 : Migration - { - private readonly Elsa.EntityFrameworkCore.IElsaDbContextSchema _schema; - - /// - public V3_3(Elsa.EntityFrameworkCore.IElsaDbContextSchema schema) - { - _schema = schema; - } - - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.EnsureSchema( - name: _schema.Schema); - - migrationBuilder.CreateTable( - name: "Tenants", - schema: _schema.Schema, - columns: table => new - { - Id = table.Column(type: "NVARCHAR2(450)", nullable: false), - Name = table.Column(type: "NVARCHAR2(450)", nullable: false), - Configuration = table.Column(type: "NVARCHAR2(2000)", nullable: false), - TenantId = table.Column(type: "NVARCHAR2(450)", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Tenants", x => x.Id); - }); - - migrationBuilder.CreateIndex( - name: "IX_Tenant_Name", - schema: _schema.Schema, - table: "Tenants", - column: "Name"); - - migrationBuilder.CreateIndex( - name: "IX_Tenant_TenantId", - schema: _schema.Schema, - table: "Tenants", - column: "TenantId"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "Tenants", - schema: _schema.Schema); - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.Oracle/Migrations/Tenants/20250222191027_V3_4.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.Oracle/Migrations/Tenants/20250222191027_V3_4.Designer.cs deleted file mode 100644 index 9c775606b3..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Oracle/Migrations/Tenants/20250222191027_V3_4.Designer.cs +++ /dev/null @@ -1,57 +0,0 @@ -// -using Elsa.EntityFrameworkCore.Modules.Tenants; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Oracle.EntityFrameworkCore.Metadata; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.Oracle.Migrations.Tenants -{ - [DbContext(typeof(TenantsElsaDbContext))] - [Migration("20250222191027_V3_4")] - partial class V3_4 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "8.0.12") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - OracleModelBuilderExtensions.UseIdentityColumns(modelBuilder); - - modelBuilder.Entity("Elsa.Common.Multitenancy.Tenant", b => - { - b.Property("Id") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("Configuration") - .IsRequired() - .HasColumnType("NVARCHAR2(2000)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("TenantId") - .HasColumnType("NVARCHAR2(450)"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .HasDatabaseName("IX_Tenant_Name"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_Tenant_TenantId"); - - b.ToTable("Tenants", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.Oracle/Migrations/Tenants/20250222191027_V3_4.cs b/src/modules/Elsa.EntityFrameworkCore.Oracle/Migrations/Tenants/20250222191027_V3_4.cs deleted file mode 100644 index d5d0cbc718..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Oracle/Migrations/Tenants/20250222191027_V3_4.cs +++ /dev/null @@ -1,30 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.Oracle.Migrations.Tenants -{ - /// - public partial class V3_4 : Migration - { - private readonly Elsa.EntityFrameworkCore.IElsaDbContextSchema _schema; - - /// - public V3_4(Elsa.EntityFrameworkCore.IElsaDbContextSchema schema) - { - _schema = schema; - } - - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.Oracle/Migrations/Tenants/TenantsElsaDbContextModelSnapshot.cs b/src/modules/Elsa.EntityFrameworkCore.Oracle/Migrations/Tenants/TenantsElsaDbContextModelSnapshot.cs deleted file mode 100644 index 79041524c0..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Oracle/Migrations/Tenants/TenantsElsaDbContextModelSnapshot.cs +++ /dev/null @@ -1,54 +0,0 @@ -// -using Elsa.EntityFrameworkCore.Modules.Tenants; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Oracle.EntityFrameworkCore.Metadata; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.Oracle.Migrations.Tenants -{ - [DbContext(typeof(TenantsElsaDbContext))] - partial class TenantsElsaDbContextModelSnapshot : ModelSnapshot - { - protected override void BuildModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "8.0.12") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - OracleModelBuilderExtensions.UseIdentityColumns(modelBuilder); - - modelBuilder.Entity("Elsa.Common.Multitenancy.Tenant", b => - { - b.Property("Id") - .HasColumnType("NVARCHAR2(450)"); - - b.Property("Configuration") - .IsRequired() - .HasColumnType("NVARCHAR2(2000)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("NVARCHAR2(450)"); - - b.Property("TenantId") - .HasColumnType("NVARCHAR2(450)"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .HasDatabaseName("IX_Tenant_Name"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_Tenant_TenantId"); - - b.ToTable("Tenants", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.Oracle/OracleProvidersExtensions.cs b/src/modules/Elsa.EntityFrameworkCore.Oracle/OracleProvidersExtensions.cs deleted file mode 100644 index 8d800c577e..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Oracle/OracleProvidersExtensions.cs +++ /dev/null @@ -1,87 +0,0 @@ -using System.Reflection; -using Elsa.EntityFrameworkCore.Modules.Management; -using Elsa.EntityFrameworkCore.Modules.Runtime; -using Elsa.EntityFrameworkCore.Oracle.Configurations; -using Elsa.Workflows.Management.Entities; -using Elsa.Workflows.Runtime.Entities; -using JetBrains.Annotations; -using Oracle.EntityFrameworkCore.Infrastructure; - -// ReSharper disable once CheckNamespace -namespace Elsa.EntityFrameworkCore.Extensions; - -/// -/// Provides extensions to configure EF Core to use Oracle. -/// -[PublicAPI] -public static class OracleProvidersExtensions -{ - private static Assembly Assembly => typeof(OracleProvidersExtensions).Assembly; - - public static TFeature UseOracle(this PersistenceFeatureBase feature, - string connectionString, - ElsaDbContextOptions? options = null, - Action? configure = null) - where TDbContext : ElsaDbContextBase - where TFeature : PersistenceFeatureBase - { - return feature.UseOracle(Assembly, connectionString, options, configure); - } - - public static TFeature UseOracle(this PersistenceFeatureBase feature, - Func connectionStringFunc, - ElsaDbContextOptions? options = null, - Action? configure = null - ) - where TDbContext : ElsaDbContextBase - where TFeature : PersistenceFeatureBase - { - return feature.UseOracle(Assembly, connectionStringFunc, options, configure); - } - - public static TFeature UseOracle(this PersistenceFeatureBase feature, - Assembly migrationsAssembly, - string connectionString, - ElsaDbContextOptions? options = null, - Action? configure = null - ) - where TDbContext : ElsaDbContextBase - where TFeature : PersistenceFeatureBase - { - return feature.UseOracle(migrationsAssembly, _ => connectionString, options, configure); - } - - public static TFeature UseOracle(this PersistenceFeatureBase feature, - Assembly migrationsAssembly, - Func connectionStringFunc, - ElsaDbContextOptions? options = null, - Action? configure = null - ) - where TDbContext : ElsaDbContextBase - where TFeature : PersistenceFeatureBase - { - options ??= new(); - options.Configure(); - feature.DbContextOptionsBuilder = (sp, db) => db.UseElsaOracle(migrationsAssembly, connectionStringFunc(sp), options, configure: configure); - return (TFeature)feature; - } - - public static ElsaDbContextOptions Configure(this ElsaDbContextOptions options) - { - var management = new Management(); - var runtime = new Runtime(); - - options.ConfigureModel(modelBuilder => modelBuilder - .ApplyConfiguration(management) - .ApplyConfiguration(management)); - - options.ConfigureModel(modelBuilder => modelBuilder - .ApplyConfiguration(runtime) - .ApplyConfiguration(runtime) - .ApplyConfiguration(runtime) - .ApplyConfiguration(runtime) - .ApplyConfiguration(runtime)); - - return options; - } -} \ No newline at end of file diff --git a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/DbContextFactories.cs b/src/modules/Elsa.EntityFrameworkCore.PostgreSql/DbContextFactories.cs deleted file mode 100644 index dfe77cf437..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/DbContextFactories.cs +++ /dev/null @@ -1,40 +0,0 @@ -using Elsa.EntityFrameworkCore.Abstractions; -using Elsa.EntityFrameworkCore.Extensions; -using Elsa.EntityFrameworkCore.Modules.Alterations; -using Elsa.EntityFrameworkCore.Modules.Identity; -using Elsa.EntityFrameworkCore.Modules.Labels; -using Elsa.EntityFrameworkCore.Modules.Management; -using Elsa.EntityFrameworkCore.Modules.Runtime; -using Elsa.EntityFrameworkCore.Modules.Tenants; -using JetBrains.Annotations; -using Microsoft.EntityFrameworkCore; - -#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member - -namespace Elsa.EntityFrameworkCore.PostgreSql; - -[UsedImplicitly] -public class IdentityDbContextFactory : PostgreSqlDesignTimeDbContextFactory; - -[UsedImplicitly] -public class ManagementDbContextFactory : PostgreSqlDesignTimeDbContextFactory; - -[UsedImplicitly] -public class RuntimeDbContextFactory : PostgreSqlDesignTimeDbContextFactory; - -[UsedImplicitly] -public class LabelsDbContextFactory : PostgreSqlDesignTimeDbContextFactory; - -[UsedImplicitly] -public class AlterationsDbContextFactories : PostgreSqlDesignTimeDbContextFactory; - -[UsedImplicitly] -public class TenantsDbContextFactories : PostgreSqlDesignTimeDbContextFactory; - -public class PostgreSqlDesignTimeDbContextFactory : DesignTimeDbContextFactoryBase where TDbContext : DbContext -{ - protected override void ConfigureBuilder(DbContextOptionsBuilder builder, string connectionString) - { - builder.UseElsaPostgreSql(GetType().Assembly, connectionString); - } -} \ No newline at end of file diff --git a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/DbContextOptionsBuilder.cs b/src/modules/Elsa.EntityFrameworkCore.PostgreSql/DbContextOptionsBuilder.cs deleted file mode 100644 index 20d2fd27e3..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/DbContextOptionsBuilder.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System.Reflection; -using Microsoft.EntityFrameworkCore; -using Npgsql.EntityFrameworkCore.PostgreSQL.Infrastructure; - -// ReSharper disable once CheckNamespace -namespace Elsa.EntityFrameworkCore.Extensions; - -/// -/// Contains extension methods for . -/// -public static class DbContextOptionsBuilderExtensions -{ - /// - /// Configures Entity Framework Core with PostgreSQL. - /// - public static DbContextOptionsBuilder UseElsaPostgreSql(this DbContextOptionsBuilder builder, Assembly migrationsAssembly, string connectionString, ElsaDbContextOptions? options = default, Action? configure = default) => - builder - .UseElsaDbContextOptions(options) - .UseNpgsql(connectionString, db => - { - db - .MigrationsAssembly(options.GetMigrationsAssemblyName(migrationsAssembly)) - .MigrationsHistoryTable(options.GetMigrationsHistoryTableName(), options.GetSchemaName()); - - configure?.Invoke(db); - }); - -} \ No newline at end of file diff --git a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Elsa.EntityFrameworkCore.PostgreSql.csproj b/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Elsa.EntityFrameworkCore.PostgreSql.csproj deleted file mode 100644 index e0f1c22ece..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Elsa.EntityFrameworkCore.PostgreSql.csproj +++ /dev/null @@ -1,19 +0,0 @@ - - - - - Provides PostgreSQL EF Core migrations for various modules. - - elsa module persistence efcore postgresql - - - - - - - - - - - - \ No newline at end of file diff --git a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/FodyWeavers.xml b/src/modules/Elsa.EntityFrameworkCore.PostgreSql/FodyWeavers.xml deleted file mode 100644 index 00e1d9a1c1..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/FodyWeavers.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Handlers/DbExceptionTransformer.cs b/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Handlers/DbExceptionTransformer.cs deleted file mode 100644 index ea78b50433..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Handlers/DbExceptionTransformer.cs +++ /dev/null @@ -1,22 +0,0 @@ -using Elsa.Workflows.Exceptions; -using JetBrains.Annotations; -using Npgsql; - -namespace Elsa.EntityFrameworkCore.PostgreSql.Handlers; - -/// -/// Transforms database exceptions encountered when using a postgreSQL database into more generic exceptions. -/// -[UsedImplicitly] -public class DbExceptionTransformer : IDbExceptionHandler -{ - public Task HandleAsync(DbUpdateExceptionContext context) - { - var exception = context.Exception; - - if (exception.InnerException is PostgresException { SqlState: "23505" }) - throw new UniqueKeyConstraintViolationException("Unable to save data", exception); - - throw new DataProcessingException("Unable to save data", exception); - } -} \ No newline at end of file diff --git a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/MigrationHelper.cs b/src/modules/Elsa.EntityFrameworkCore.PostgreSql/MigrationHelper.cs deleted file mode 100644 index 3bf44d140b..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/MigrationHelper.cs +++ /dev/null @@ -1,85 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -namespace Elsa.EntityFrameworkCore.PostgreSql; - -public static class MigrationHelper -{ - public static void AlterColumnDateTime(MigrationBuilder migrationBuilder, IElsaDbContextSchema schema, string tableName, string columnName, bool nullable) - { - migrationBuilder.AddColumn( - name: $"{columnName}Temp", - schema: schema.Schema, - table: tableName, - type: "timestamptz", - nullable: true); - - migrationBuilder.Sql( - $""" - UPDATE "{schema.Schema}"."{tableName}" - SET "{columnName}Temp" = to_timestamp("{columnName}", 'YYYY-MM-DD HH24:MI:SS.US') AT TIME ZONE 'UTC' - WHERE "{columnName}" IS NOT NULL - """); - - migrationBuilder.DropColumn( - name: columnName, - schema: schema.Schema, - table: tableName); - - migrationBuilder.RenameColumn( - name: $"{columnName}Temp", - schema: schema.Schema, - table: tableName, - newName: columnName); - - migrationBuilder.AlterColumn( - name: columnName, - schema: schema.Schema, - table: tableName, - type: "timestamptz", - nullable: nullable, - oldClrType: typeof(DateTimeOffset), - oldNullable: nullable); - } - - public static void AlterColumnBoolean(MigrationBuilder migrationBuilder, IElsaDbContextSchema schema, string tableName, string columnName, bool nullable) - { - // Step 1: Add a new temporary nullable column - migrationBuilder.AddColumn( - name: $"{columnName}Temp", - schema: schema.Schema, - table: tableName, - type: "boolean", - nullable: nullable); - - // Step 2: Update the temporary column with converted values from the original column - migrationBuilder.Sql( - $""" - UPDATE "{schema.Schema}"."{tableName}" - SET "{columnName}Temp" = CASE WHEN "{columnName}" = 1 THEN TRUE ELSE FALSE END - WHERE "{columnName}" IS NOT NULL - """); - - // Step 3: Drop the original column - migrationBuilder.DropColumn( - name: columnName, - schema: schema.Schema, - table: tableName); - - // Step 4: Rename the temporary column to the original column name - migrationBuilder.RenameColumn( - name: $"{columnName}Temp", - schema: schema.Schema, - table: tableName, - newName: columnName); - - // Step 5: Alter the new column to be non-nullable - migrationBuilder.AlterColumn( - name: columnName, - schema: schema.Schema, - table: tableName, - type: "boolean", - nullable: nullable, - oldClrType: typeof(bool), - oldNullable: true); - } -} \ No newline at end of file diff --git a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Alterations/20231015122203_Initial.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Alterations/20231015122203_Initial.Designer.cs deleted file mode 100644 index 1680ce79a9..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Alterations/20231015122203_Initial.Designer.cs +++ /dev/null @@ -1,122 +0,0 @@ -// -using System; -using Elsa.EntityFrameworkCore.Modules.Alterations; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.PostgreSql.Migrations.Alterations -{ - [DbContext(typeof(AlterationsElsaDbContext))] - [Migration("20231015122203_Initial")] - partial class Initial - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "7.0.11") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("Elsa.Alterations.Core.Entities.AlterationJob", b => - { - b.Property("Id") - .HasColumnType("text"); - - b.Property("CompletedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("PlanId") - .IsRequired() - .HasColumnType("text"); - - b.Property("SerializedLog") - .HasColumnType("text"); - - b.Property("StartedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .HasColumnType("integer"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("CompletedAt") - .HasDatabaseName("IX_AlterationJob_CompletedAt"); - - b.HasIndex("CreatedAt") - .HasDatabaseName("IX_AlterationJob_CreatedAt"); - - b.HasIndex("PlanId") - .HasDatabaseName("IX_AlterationJob_PlanId"); - - b.HasIndex("StartedAt") - .HasDatabaseName("IX_AlterationJob_StartedAt"); - - b.HasIndex("Status") - .HasDatabaseName("IX_AlterationJob_Status"); - - b.HasIndex("WorkflowInstanceId") - .HasDatabaseName("IX_AlterationJob_WorkflowInstanceId"); - - b.ToTable("AlterationJobs", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Alterations.Core.Entities.AlterationPlan", b => - { - b.Property("Id") - .HasColumnType("text"); - - b.Property("CompletedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("SerializedAlterations") - .HasColumnType("text"); - - b.Property("SerializedWorkflowInstanceIds") - .HasColumnType("text"); - - b.Property("StartedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("CompletedAt") - .HasDatabaseName("IX_AlterationPlan_CompletedAt"); - - b.HasIndex("CreatedAt") - .HasDatabaseName("IX_AlterationPlan_CreatedAt"); - - b.HasIndex("StartedAt") - .HasDatabaseName("IX_AlterationPlan_StartedAt"); - - b.HasIndex("Status") - .HasDatabaseName("IX_AlterationPlan_Status"); - - b.ToTable("AlterationPlans", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Alterations/20231015122203_Initial.cs b/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Alterations/20231015122203_Initial.cs deleted file mode 100644 index 56afae701d..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Alterations/20231015122203_Initial.cs +++ /dev/null @@ -1,132 +0,0 @@ - -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.PostgreSql.Migrations.Alterations -{ - /// - public partial class Initial : Migration - { - private readonly IElsaDbContextSchema _schema; - public Initial(IElsaDbContextSchema schema) - { - _schema = schema ?? throw new ArgumentNullException(nameof(schema)); - } - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.EnsureSchema( - name: _schema.Schema); - - migrationBuilder.CreateTable( - name: "AlterationJobs", - schema: _schema.Schema, - columns: table => new - { - Id = table.Column(type: "text", nullable: false), - PlanId = table.Column(type: "text", nullable: false), - WorkflowInstanceId = table.Column(type: "text", nullable: false), - Status = table.Column(type: "integer", nullable: false), - CreatedAt = table.Column(type: "timestamp with time zone", nullable: false), - StartedAt = table.Column(type: "timestamp with time zone", nullable: true), - CompletedAt = table.Column(type: "timestamp with time zone", nullable: true), - SerializedLog = table.Column(type: "text", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_AlterationJobs", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "AlterationPlans", - schema: _schema.Schema, - columns: table => new - { - Id = table.Column(type: "text", nullable: false), - Status = table.Column(type: "integer", nullable: false), - CreatedAt = table.Column(type: "timestamp with time zone", nullable: false), - StartedAt = table.Column(type: "timestamp with time zone", nullable: true), - CompletedAt = table.Column(type: "timestamp with time zone", nullable: true), - SerializedAlterations = table.Column(type: "text", nullable: true), - SerializedWorkflowInstanceIds = table.Column(type: "text", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_AlterationPlans", x => x.Id); - }); - - migrationBuilder.CreateIndex( - name: "IX_AlterationJob_CompletedAt", - schema: _schema.Schema, - table: "AlterationJobs", - column: "CompletedAt"); - - migrationBuilder.CreateIndex( - name: "IX_AlterationJob_CreatedAt", - schema: _schema.Schema, - table: "AlterationJobs", - column: "CreatedAt"); - - migrationBuilder.CreateIndex( - name: "IX_AlterationJob_PlanId", - schema: _schema.Schema, - table: "AlterationJobs", - column: "PlanId"); - - migrationBuilder.CreateIndex( - name: "IX_AlterationJob_StartedAt", - schema: _schema.Schema, - table: "AlterationJobs", - column: "StartedAt"); - - migrationBuilder.CreateIndex( - name: "IX_AlterationJob_Status", - schema: _schema.Schema, - table: "AlterationJobs", - column: "Status"); - - migrationBuilder.CreateIndex( - name: "IX_AlterationJob_WorkflowInstanceId", - schema: _schema.Schema, - table: "AlterationJobs", - column: "WorkflowInstanceId"); - - migrationBuilder.CreateIndex( - name: "IX_AlterationPlan_CompletedAt", - schema: _schema.Schema, - table: "AlterationPlans", - column: "CompletedAt"); - - migrationBuilder.CreateIndex( - name: "IX_AlterationPlan_CreatedAt", - schema: _schema.Schema, - table: "AlterationPlans", - column: "CreatedAt"); - - migrationBuilder.CreateIndex( - name: "IX_AlterationPlan_StartedAt", - schema: _schema.Schema, - table: "AlterationPlans", - column: "StartedAt"); - - migrationBuilder.CreateIndex( - name: "IX_AlterationPlan_Status", - schema: _schema.Schema, - table: "AlterationPlans", - column: "Status"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "AlterationJobs", - schema: _schema.Schema); - - migrationBuilder.DropTable( - name: "AlterationPlans", - schema: _schema.Schema); - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Alterations/20240329200643_V3_1.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Alterations/20240329200643_V3_1.Designer.cs deleted file mode 100644 index 337987fe20..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Alterations/20240329200643_V3_1.Designer.cs +++ /dev/null @@ -1,124 +0,0 @@ -// -using System; -using Elsa.EntityFrameworkCore.Modules.Alterations; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.PostgreSql.Migrations.Alterations -{ - [DbContext(typeof(AlterationsElsaDbContext))] - [Migration("20240329200643_V3_1")] - partial class V3_1 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "7.0.14") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("Elsa.Alterations.Core.Entities.AlterationJob", b => - { - b.Property("Id") - .HasColumnType("text"); - - b.Property("CompletedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("PlanId") - .IsRequired() - .HasColumnType("text"); - - b.Property("SerializedLog") - .HasColumnType("text"); - - b.Property("StartedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("CompletedAt") - .HasDatabaseName("IX_AlterationJob_CompletedAt"); - - b.HasIndex("CreatedAt") - .HasDatabaseName("IX_AlterationJob_CreatedAt"); - - b.HasIndex("PlanId") - .HasDatabaseName("IX_AlterationJob_PlanId"); - - b.HasIndex("StartedAt") - .HasDatabaseName("IX_AlterationJob_StartedAt"); - - b.HasIndex("Status") - .HasDatabaseName("IX_AlterationJob_Status"); - - b.HasIndex("WorkflowInstanceId") - .HasDatabaseName("IX_AlterationJob_WorkflowInstanceId"); - - b.ToTable("AlterationJobs", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Alterations.Core.Entities.AlterationPlan", b => - { - b.Property("Id") - .HasColumnType("text"); - - b.Property("CompletedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("SerializedAlterations") - .HasColumnType("text"); - - b.Property("SerializedWorkflowInstanceFilter") - .HasColumnType("text"); - - b.Property("StartedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("CompletedAt") - .HasDatabaseName("IX_AlterationPlan_CompletedAt"); - - b.HasIndex("CreatedAt") - .HasDatabaseName("IX_AlterationPlan_CreatedAt"); - - b.HasIndex("StartedAt") - .HasDatabaseName("IX_AlterationPlan_StartedAt"); - - b.HasIndex("Status") - .HasDatabaseName("IX_AlterationPlan_Status"); - - b.ToTable("AlterationPlans", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Alterations/20240329200643_V3_1.cs b/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Alterations/20240329200643_V3_1.cs deleted file mode 100644 index ccb181c7b9..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Alterations/20240329200643_V3_1.cs +++ /dev/null @@ -1,74 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.PostgreSql.Migrations.Alterations -{ - /// - public partial class V3_1 : Migration - { - private readonly IElsaDbContextSchema _schema; - - /// - public V3_1(IElsaDbContextSchema schema) - { - _schema = schema; - } - - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.RenameColumn( - name: "SerializedWorkflowInstanceIds", - schema: _schema.Schema, - table: "AlterationPlans", - newName: "SerializedWorkflowInstanceFilter"); - - migrationBuilder.AlterColumn( - name: "Status", - schema: _schema.Schema, - table: "AlterationPlans", - type: "text", - nullable: false, - oldClrType: typeof(int), - oldType: "integer"); - - migrationBuilder.AlterColumn( - name: "Status", - schema: _schema.Schema, - table: "AlterationJobs", - type: "text", - nullable: false, - oldClrType: typeof(int), - oldType: "integer"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.RenameColumn( - name: "SerializedWorkflowInstanceFilter", - schema: _schema.Schema, - table: "AlterationPlans", - newName: "SerializedWorkflowInstanceIds"); - - migrationBuilder.AlterColumn( - name: "Status", - schema: _schema.Schema, - table: "AlterationPlans", - type: "integer", - nullable: false, - oldClrType: typeof(string), - oldType: "text"); - - migrationBuilder.AlterColumn( - name: "Status", - schema: _schema.Schema, - table: "AlterationJobs", - type: "integer", - nullable: false, - oldClrType: typeof(string), - oldType: "text"); - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Alterations/20240610184626_V3_2.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Alterations/20240610184626_V3_2.Designer.cs deleted file mode 100644 index 19292f0429..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Alterations/20240610184626_V3_2.Designer.cs +++ /dev/null @@ -1,124 +0,0 @@ -// -using System; -using Elsa.EntityFrameworkCore.Modules.Alterations; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.PostgreSql.Migrations.Alterations -{ - [DbContext(typeof(AlterationsElsaDbContext))] - [Migration("20240610184626_V3_2")] - partial class V3_2 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "7.0.20") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("Elsa.Alterations.Core.Entities.AlterationJob", b => - { - b.Property("Id") - .HasColumnType("text"); - - b.Property("CompletedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("PlanId") - .IsRequired() - .HasColumnType("text"); - - b.Property("SerializedLog") - .HasColumnType("text"); - - b.Property("StartedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("CompletedAt") - .HasDatabaseName("IX_AlterationJob_CompletedAt"); - - b.HasIndex("CreatedAt") - .HasDatabaseName("IX_AlterationJob_CreatedAt"); - - b.HasIndex("PlanId") - .HasDatabaseName("IX_AlterationJob_PlanId"); - - b.HasIndex("StartedAt") - .HasDatabaseName("IX_AlterationJob_StartedAt"); - - b.HasIndex("Status") - .HasDatabaseName("IX_AlterationJob_Status"); - - b.HasIndex("WorkflowInstanceId") - .HasDatabaseName("IX_AlterationJob_WorkflowInstanceId"); - - b.ToTable("AlterationJobs", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Alterations.Core.Entities.AlterationPlan", b => - { - b.Property("Id") - .HasColumnType("text"); - - b.Property("CompletedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("SerializedAlterations") - .HasColumnType("text"); - - b.Property("SerializedWorkflowInstanceFilter") - .HasColumnType("text"); - - b.Property("StartedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("CompletedAt") - .HasDatabaseName("IX_AlterationPlan_CompletedAt"); - - b.HasIndex("CreatedAt") - .HasDatabaseName("IX_AlterationPlan_CreatedAt"); - - b.HasIndex("StartedAt") - .HasDatabaseName("IX_AlterationPlan_StartedAt"); - - b.HasIndex("Status") - .HasDatabaseName("IX_AlterationPlan_Status"); - - b.ToTable("AlterationPlans", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Alterations/20240610184626_V3_2.cs b/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Alterations/20240610184626_V3_2.cs deleted file mode 100644 index 28f51ffffe..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Alterations/20240610184626_V3_2.cs +++ /dev/null @@ -1,30 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.PostgreSql.Migrations.Alterations -{ - /// - public partial class V3_2 : Migration - { - private readonly IElsaDbContextSchema _schema; - - /// - public V3_2(IElsaDbContextSchema schema) - { - _schema = schema; - } - - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Alterations/20241212211604_V3_3.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Alterations/20241212211604_V3_3.Designer.cs deleted file mode 100644 index 7637559663..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Alterations/20241212211604_V3_3.Designer.cs +++ /dev/null @@ -1,136 +0,0 @@ -// -using System; -using Elsa.EntityFrameworkCore.Modules.Alterations; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.PostgreSql.Migrations.Alterations -{ - [DbContext(typeof(AlterationsElsaDbContext))] - [Migration("20241212211604_V3_3")] - partial class V3_3 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "7.0.20") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("Elsa.Alterations.Core.Entities.AlterationJob", b => - { - b.Property("Id") - .HasColumnType("text"); - - b.Property("CompletedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("PlanId") - .IsRequired() - .HasColumnType("text"); - - b.Property("SerializedLog") - .HasColumnType("text"); - - b.Property("StartedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("TenantId") - .HasColumnType("text"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("CompletedAt") - .HasDatabaseName("IX_AlterationJob_CompletedAt"); - - b.HasIndex("CreatedAt") - .HasDatabaseName("IX_AlterationJob_CreatedAt"); - - b.HasIndex("PlanId") - .HasDatabaseName("IX_AlterationJob_PlanId"); - - b.HasIndex("StartedAt") - .HasDatabaseName("IX_AlterationJob_StartedAt"); - - b.HasIndex("Status") - .HasDatabaseName("IX_AlterationJob_Status"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_AlterationJob_TenantId"); - - b.HasIndex("WorkflowInstanceId") - .HasDatabaseName("IX_AlterationJob_WorkflowInstanceId"); - - b.ToTable("AlterationJobs", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Alterations.Core.Entities.AlterationPlan", b => - { - b.Property("Id") - .HasColumnType("text"); - - b.Property("CompletedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("SerializedAlterations") - .HasColumnType("text"); - - b.Property("SerializedWorkflowInstanceFilter") - .HasColumnType("text"); - - b.Property("StartedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("TenantId") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("CompletedAt") - .HasDatabaseName("IX_AlterationPlan_CompletedAt"); - - b.HasIndex("CreatedAt") - .HasDatabaseName("IX_AlterationPlan_CreatedAt"); - - b.HasIndex("StartedAt") - .HasDatabaseName("IX_AlterationPlan_StartedAt"); - - b.HasIndex("Status") - .HasDatabaseName("IX_AlterationPlan_Status"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_AlterationPlan_TenantId"); - - b.ToTable("AlterationPlans", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Alterations/20241212211604_V3_3.cs b/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Alterations/20241212211604_V3_3.cs deleted file mode 100644 index 1569247acc..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Alterations/20241212211604_V3_3.cs +++ /dev/null @@ -1,72 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.PostgreSql.Migrations.Alterations -{ - /// - public partial class V3_3 : Migration - { - private readonly Elsa.EntityFrameworkCore.IElsaDbContextSchema _schema; - - /// - public V3_3(Elsa.EntityFrameworkCore.IElsaDbContextSchema schema) - { - _schema = schema; - } - - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "TenantId", - schema: _schema.Schema, - table: "AlterationPlans", - type: "text", - nullable: true); - - migrationBuilder.AddColumn( - name: "TenantId", - schema: _schema.Schema, - table: "AlterationJobs", - type: "text", - nullable: true); - - migrationBuilder.CreateIndex( - name: "IX_AlterationPlan_TenantId", - schema: _schema.Schema, - table: "AlterationPlans", - column: "TenantId"); - - migrationBuilder.CreateIndex( - name: "IX_AlterationJob_TenantId", - schema: _schema.Schema, - table: "AlterationJobs", - column: "TenantId"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropIndex( - name: "IX_AlterationPlan_TenantId", - schema: _schema.Schema, - table: "AlterationPlans"); - - migrationBuilder.DropIndex( - name: "IX_AlterationJob_TenantId", - schema: _schema.Schema, - table: "AlterationJobs"); - - migrationBuilder.DropColumn( - name: "TenantId", - schema: _schema.Schema, - table: "AlterationPlans"); - - migrationBuilder.DropColumn( - name: "TenantId", - schema: _schema.Schema, - table: "AlterationJobs"); - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Alterations/20250222190820_V3_4.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Alterations/20250222190820_V3_4.Designer.cs deleted file mode 100644 index 04e5d997d4..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Alterations/20250222190820_V3_4.Designer.cs +++ /dev/null @@ -1,136 +0,0 @@ -// -using System; -using Elsa.EntityFrameworkCore.Modules.Alterations; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.PostgreSql.Migrations.Alterations -{ - [DbContext(typeof(AlterationsElsaDbContext))] - [Migration("20250222190820_V3_4")] - partial class V3_4 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "8.0.12") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("Elsa.Alterations.Core.Entities.AlterationJob", b => - { - b.Property("Id") - .HasColumnType("text"); - - b.Property("CompletedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("PlanId") - .IsRequired() - .HasColumnType("text"); - - b.Property("SerializedLog") - .HasColumnType("text"); - - b.Property("StartedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("TenantId") - .HasColumnType("text"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("CompletedAt") - .HasDatabaseName("IX_AlterationJob_CompletedAt"); - - b.HasIndex("CreatedAt") - .HasDatabaseName("IX_AlterationJob_CreatedAt"); - - b.HasIndex("PlanId") - .HasDatabaseName("IX_AlterationJob_PlanId"); - - b.HasIndex("StartedAt") - .HasDatabaseName("IX_AlterationJob_StartedAt"); - - b.HasIndex("Status") - .HasDatabaseName("IX_AlterationJob_Status"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_AlterationJob_TenantId"); - - b.HasIndex("WorkflowInstanceId") - .HasDatabaseName("IX_AlterationJob_WorkflowInstanceId"); - - b.ToTable("AlterationJobs", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Alterations.Core.Entities.AlterationPlan", b => - { - b.Property("Id") - .HasColumnType("text"); - - b.Property("CompletedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("SerializedAlterations") - .HasColumnType("text"); - - b.Property("SerializedWorkflowInstanceFilter") - .HasColumnType("text"); - - b.Property("StartedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("TenantId") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("CompletedAt") - .HasDatabaseName("IX_AlterationPlan_CompletedAt"); - - b.HasIndex("CreatedAt") - .HasDatabaseName("IX_AlterationPlan_CreatedAt"); - - b.HasIndex("StartedAt") - .HasDatabaseName("IX_AlterationPlan_StartedAt"); - - b.HasIndex("Status") - .HasDatabaseName("IX_AlterationPlan_Status"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_AlterationPlan_TenantId"); - - b.ToTable("AlterationPlans", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Alterations/20250222190820_V3_4.cs b/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Alterations/20250222190820_V3_4.cs deleted file mode 100644 index 1856fbfa75..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Alterations/20250222190820_V3_4.cs +++ /dev/null @@ -1,30 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.PostgreSql.Migrations.Alterations -{ - /// - public partial class V3_4 : Migration - { - private readonly Elsa.EntityFrameworkCore.IElsaDbContextSchema _schema; - - /// - public V3_4(Elsa.EntityFrameworkCore.IElsaDbContextSchema schema) - { - _schema = schema; - } - - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Alterations/AlterationsElsaDbContextModelSnapshot.cs b/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Alterations/AlterationsElsaDbContextModelSnapshot.cs deleted file mode 100644 index f77b90cdf8..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Alterations/AlterationsElsaDbContextModelSnapshot.cs +++ /dev/null @@ -1,133 +0,0 @@ -// -using System; -using Elsa.EntityFrameworkCore.Modules.Alterations; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.PostgreSql.Migrations.Alterations -{ - [DbContext(typeof(AlterationsElsaDbContext))] - partial class AlterationsElsaDbContextModelSnapshot : ModelSnapshot - { - protected override void BuildModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "8.0.12") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("Elsa.Alterations.Core.Entities.AlterationJob", b => - { - b.Property("Id") - .HasColumnType("text"); - - b.Property("CompletedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("PlanId") - .IsRequired() - .HasColumnType("text"); - - b.Property("SerializedLog") - .HasColumnType("text"); - - b.Property("StartedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("TenantId") - .HasColumnType("text"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("CompletedAt") - .HasDatabaseName("IX_AlterationJob_CompletedAt"); - - b.HasIndex("CreatedAt") - .HasDatabaseName("IX_AlterationJob_CreatedAt"); - - b.HasIndex("PlanId") - .HasDatabaseName("IX_AlterationJob_PlanId"); - - b.HasIndex("StartedAt") - .HasDatabaseName("IX_AlterationJob_StartedAt"); - - b.HasIndex("Status") - .HasDatabaseName("IX_AlterationJob_Status"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_AlterationJob_TenantId"); - - b.HasIndex("WorkflowInstanceId") - .HasDatabaseName("IX_AlterationJob_WorkflowInstanceId"); - - b.ToTable("AlterationJobs", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Alterations.Core.Entities.AlterationPlan", b => - { - b.Property("Id") - .HasColumnType("text"); - - b.Property("CompletedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("SerializedAlterations") - .HasColumnType("text"); - - b.Property("SerializedWorkflowInstanceFilter") - .HasColumnType("text"); - - b.Property("StartedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("TenantId") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("CompletedAt") - .HasDatabaseName("IX_AlterationPlan_CompletedAt"); - - b.HasIndex("CreatedAt") - .HasDatabaseName("IX_AlterationPlan_CreatedAt"); - - b.HasIndex("StartedAt") - .HasDatabaseName("IX_AlterationPlan_StartedAt"); - - b.HasIndex("Status") - .HasDatabaseName("IX_AlterationPlan_Status"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_AlterationPlan_TenantId"); - - b.ToTable("AlterationPlans", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Identity/20231015122250_Initial.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Identity/20231015122250_Initial.Designer.cs deleted file mode 100644 index c180e5415a..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Identity/20231015122250_Initial.Designer.cs +++ /dev/null @@ -1,131 +0,0 @@ -// -using Elsa.EntityFrameworkCore.Modules.Identity; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.PostgreSql.Migrations.Identity -{ - [DbContext(typeof(IdentityElsaDbContext))] - [Migration("20231015122250_Initial")] - partial class Initial - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "7.0.11") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("Elsa.Identity.Entities.Application", b => - { - b.Property("Id") - .HasColumnType("text"); - - b.Property("ClientId") - .IsRequired() - .HasColumnType("text"); - - b.Property("HashedApiKey") - .IsRequired() - .HasColumnType("text"); - - b.Property("HashedApiKeySalt") - .IsRequired() - .HasColumnType("text"); - - b.Property("HashedClientSecret") - .IsRequired() - .HasColumnType("text"); - - b.Property("HashedClientSecretSalt") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Roles") - .IsRequired() - .HasColumnType("text") - .HasColumnName("Roles"); - - b.HasKey("Id"); - - b.HasIndex("ClientId") - .IsUnique() - .HasDatabaseName("IX_Application_ClientId"); - - b.HasIndex("Name") - .IsUnique() - .HasDatabaseName("IX_Application_Name"); - - b.ToTable("Applications", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Identity.Entities.Role", b => - { - b.Property("Id") - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Permissions") - .IsRequired() - .HasColumnType("text") - .HasColumnName("Permissions"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique() - .HasDatabaseName("IX_Role_Name"); - - b.ToTable("Roles", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Identity.Entities.User", b => - { - b.Property("Id") - .HasColumnType("text"); - - b.Property("HashedPassword") - .IsRequired() - .HasColumnType("text"); - - b.Property("HashedPasswordSalt") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Roles") - .IsRequired() - .HasColumnType("text") - .HasColumnName("Roles"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique() - .HasDatabaseName("IX_User_Name"); - - b.ToTable("Users", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Identity/20231015122250_Initial.cs b/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Identity/20231015122250_Initial.cs deleted file mode 100644 index 67020c9cd7..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Identity/20231015122250_Initial.cs +++ /dev/null @@ -1,116 +0,0 @@ - -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.PostgreSql.Migrations.Identity -{ - /// - public partial class Initial : Migration - { - private readonly IElsaDbContextSchema _schema; - public Initial(IElsaDbContextSchema schema) - { - _schema = schema ?? throw new ArgumentNullException(nameof(schema)); - } - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.EnsureSchema( - name: _schema.Schema); - - migrationBuilder.CreateTable( - name: "Applications", - schema: _schema.Schema, - columns: table => new - { - Id = table.Column(type: "text", nullable: false), - ClientId = table.Column(type: "text", nullable: false), - HashedClientSecret = table.Column(type: "text", nullable: false), - HashedClientSecretSalt = table.Column(type: "text", nullable: false), - Name = table.Column(type: "text", nullable: false), - HashedApiKey = table.Column(type: "text", nullable: false), - HashedApiKeySalt = table.Column(type: "text", nullable: false), - Roles = table.Column(type: "text", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Applications", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "Roles", - schema: _schema.Schema, - columns: table => new - { - Id = table.Column(type: "text", nullable: false), - Name = table.Column(type: "text", nullable: false), - Permissions = table.Column(type: "text", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Roles", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "Users", - schema: _schema.Schema, - columns: table => new - { - Id = table.Column(type: "text", nullable: false), - Name = table.Column(type: "text", nullable: false), - HashedPassword = table.Column(type: "text", nullable: false), - HashedPasswordSalt = table.Column(type: "text", nullable: false), - Roles = table.Column(type: "text", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Users", x => x.Id); - }); - - migrationBuilder.CreateIndex( - name: "IX_Application_ClientId", - schema: _schema.Schema, - table: "Applications", - column: "ClientId", - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_Application_Name", - schema: _schema.Schema, - table: "Applications", - column: "Name", - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_Role_Name", - schema: _schema.Schema, - table: "Roles", - column: "Name", - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_User_Name", - schema: _schema.Schema, - table: "Users", - column: "Name", - unique: true); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "Applications", - schema: _schema.Schema); - - migrationBuilder.DropTable( - name: "Roles", - schema: _schema.Schema); - - migrationBuilder.DropTable( - name: "Users", - schema: _schema.Schema); - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Identity/20240329200810_V3_1.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Identity/20240329200810_V3_1.Designer.cs deleted file mode 100644 index d287259bcc..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Identity/20240329200810_V3_1.Designer.cs +++ /dev/null @@ -1,131 +0,0 @@ -// -using Elsa.EntityFrameworkCore.Modules.Identity; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.PostgreSql.Migrations.Identity -{ - [DbContext(typeof(IdentityElsaDbContext))] - [Migration("20240329200810_V3_1")] - partial class V3_1 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "7.0.14") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("Elsa.Identity.Entities.Application", b => - { - b.Property("Id") - .HasColumnType("text"); - - b.Property("ClientId") - .IsRequired() - .HasColumnType("text"); - - b.Property("HashedApiKey") - .IsRequired() - .HasColumnType("text"); - - b.Property("HashedApiKeySalt") - .IsRequired() - .HasColumnType("text"); - - b.Property("HashedClientSecret") - .IsRequired() - .HasColumnType("text"); - - b.Property("HashedClientSecretSalt") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Roles") - .IsRequired() - .HasColumnType("text") - .HasColumnName("Roles"); - - b.HasKey("Id"); - - b.HasIndex("ClientId") - .IsUnique() - .HasDatabaseName("IX_Application_ClientId"); - - b.HasIndex("Name") - .IsUnique() - .HasDatabaseName("IX_Application_Name"); - - b.ToTable("Applications", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Identity.Entities.Role", b => - { - b.Property("Id") - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Permissions") - .IsRequired() - .HasColumnType("text") - .HasColumnName("Permissions"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique() - .HasDatabaseName("IX_Role_Name"); - - b.ToTable("Roles", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Identity.Entities.User", b => - { - b.Property("Id") - .HasColumnType("text"); - - b.Property("HashedPassword") - .IsRequired() - .HasColumnType("text"); - - b.Property("HashedPasswordSalt") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Roles") - .IsRequired() - .HasColumnType("text") - .HasColumnName("Roles"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique() - .HasDatabaseName("IX_User_Name"); - - b.ToTable("Users", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Identity/20240329200810_V3_1.cs b/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Identity/20240329200810_V3_1.cs deleted file mode 100644 index f6f30f7dcf..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Identity/20240329200810_V3_1.cs +++ /dev/null @@ -1,30 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.PostgreSql.Migrations.Identity -{ - /// - public partial class V3_1 : Migration - { - private readonly IElsaDbContextSchema _schema; - - /// - public V3_1(IElsaDbContextSchema schema) - { - _schema = schema; - } - - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Identity/20240610184941_V3_2.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Identity/20240610184941_V3_2.Designer.cs deleted file mode 100644 index 1b341e0844..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Identity/20240610184941_V3_2.Designer.cs +++ /dev/null @@ -1,131 +0,0 @@ -// -using Elsa.EntityFrameworkCore.Modules.Identity; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.PostgreSql.Migrations.Identity -{ - [DbContext(typeof(IdentityElsaDbContext))] - [Migration("20240610184941_V3_2")] - partial class V3_2 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "7.0.20") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("Elsa.Identity.Entities.Application", b => - { - b.Property("Id") - .HasColumnType("text"); - - b.Property("ClientId") - .IsRequired() - .HasColumnType("text"); - - b.Property("HashedApiKey") - .IsRequired() - .HasColumnType("text"); - - b.Property("HashedApiKeySalt") - .IsRequired() - .HasColumnType("text"); - - b.Property("HashedClientSecret") - .IsRequired() - .HasColumnType("text"); - - b.Property("HashedClientSecretSalt") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Roles") - .IsRequired() - .HasColumnType("text") - .HasColumnName("Roles"); - - b.HasKey("Id"); - - b.HasIndex("ClientId") - .IsUnique() - .HasDatabaseName("IX_Application_ClientId"); - - b.HasIndex("Name") - .IsUnique() - .HasDatabaseName("IX_Application_Name"); - - b.ToTable("Applications", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Identity.Entities.Role", b => - { - b.Property("Id") - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Permissions") - .IsRequired() - .HasColumnType("text") - .HasColumnName("Permissions"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique() - .HasDatabaseName("IX_Role_Name"); - - b.ToTable("Roles", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Identity.Entities.User", b => - { - b.Property("Id") - .HasColumnType("text"); - - b.Property("HashedPassword") - .IsRequired() - .HasColumnType("text"); - - b.Property("HashedPasswordSalt") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Roles") - .IsRequired() - .HasColumnType("text") - .HasColumnName("Roles"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique() - .HasDatabaseName("IX_User_Name"); - - b.ToTable("Users", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Identity/20240610184941_V3_2.cs b/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Identity/20240610184941_V3_2.cs deleted file mode 100644 index d06fe1bca5..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Identity/20240610184941_V3_2.cs +++ /dev/null @@ -1,30 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.PostgreSql.Migrations.Identity -{ - /// - public partial class V3_2 : Migration - { - private readonly IElsaDbContextSchema _schema; - - /// - public V3_2(IElsaDbContextSchema schema) - { - _schema = schema; - } - - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Identity/20241212211900_V3_3.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Identity/20241212211900_V3_3.Designer.cs deleted file mode 100644 index 29c5e3aeca..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Identity/20241212211900_V3_3.Designer.cs +++ /dev/null @@ -1,149 +0,0 @@ -// -using Elsa.EntityFrameworkCore.Modules.Identity; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.PostgreSql.Migrations.Identity -{ - [DbContext(typeof(IdentityElsaDbContext))] - [Migration("20241212211900_V3_3")] - partial class V3_3 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "7.0.20") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("Elsa.Identity.Entities.Application", b => - { - b.Property("Id") - .HasColumnType("text"); - - b.Property("ClientId") - .IsRequired() - .HasColumnType("text"); - - b.Property("HashedApiKey") - .IsRequired() - .HasColumnType("text"); - - b.Property("HashedApiKeySalt") - .IsRequired() - .HasColumnType("text"); - - b.Property("HashedClientSecret") - .IsRequired() - .HasColumnType("text"); - - b.Property("HashedClientSecretSalt") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Roles") - .IsRequired() - .HasColumnType("text") - .HasColumnName("Roles"); - - b.Property("TenantId") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("ClientId") - .IsUnique() - .HasDatabaseName("IX_Application_ClientId"); - - b.HasIndex("Name") - .IsUnique() - .HasDatabaseName("IX_Application_Name"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_Application_TenantId"); - - b.ToTable("Applications", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Identity.Entities.Role", b => - { - b.Property("Id") - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Permissions") - .IsRequired() - .HasColumnType("text") - .HasColumnName("Permissions"); - - b.Property("TenantId") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique() - .HasDatabaseName("IX_Role_Name"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_Role_TenantId"); - - b.ToTable("Roles", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Identity.Entities.User", b => - { - b.Property("Id") - .HasColumnType("text"); - - b.Property("HashedPassword") - .IsRequired() - .HasColumnType("text"); - - b.Property("HashedPasswordSalt") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Roles") - .IsRequired() - .HasColumnType("text") - .HasColumnName("Roles"); - - b.Property("TenantId") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique() - .HasDatabaseName("IX_User_Name"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_User_TenantId"); - - b.ToTable("Users", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Identity/20241212211900_V3_3.cs b/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Identity/20241212211900_V3_3.cs deleted file mode 100644 index 67cc99740c..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Identity/20241212211900_V3_3.cs +++ /dev/null @@ -1,95 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.PostgreSql.Migrations.Identity -{ - /// - public partial class V3_3 : Migration - { - private readonly Elsa.EntityFrameworkCore.IElsaDbContextSchema _schema; - - /// - public V3_3(Elsa.EntityFrameworkCore.IElsaDbContextSchema schema) - { - _schema = schema; - } - - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "TenantId", - schema: _schema.Schema, - table: "Users", - type: "text", - nullable: true); - - migrationBuilder.AddColumn( - name: "TenantId", - schema: _schema.Schema, - table: "Roles", - type: "text", - nullable: true); - - migrationBuilder.AddColumn( - name: "TenantId", - schema: _schema.Schema, - table: "Applications", - type: "text", - nullable: true); - - migrationBuilder.CreateIndex( - name: "IX_User_TenantId", - schema: _schema.Schema, - table: "Users", - column: "TenantId"); - - migrationBuilder.CreateIndex( - name: "IX_Role_TenantId", - schema: _schema.Schema, - table: "Roles", - column: "TenantId"); - - migrationBuilder.CreateIndex( - name: "IX_Application_TenantId", - schema: _schema.Schema, - table: "Applications", - column: "TenantId"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropIndex( - name: "IX_User_TenantId", - schema: _schema.Schema, - table: "Users"); - - migrationBuilder.DropIndex( - name: "IX_Role_TenantId", - schema: _schema.Schema, - table: "Roles"); - - migrationBuilder.DropIndex( - name: "IX_Application_TenantId", - schema: _schema.Schema, - table: "Applications"); - - migrationBuilder.DropColumn( - name: "TenantId", - schema: _schema.Schema, - table: "Users"); - - migrationBuilder.DropColumn( - name: "TenantId", - schema: _schema.Schema, - table: "Roles"); - - migrationBuilder.DropColumn( - name: "TenantId", - schema: _schema.Schema, - table: "Applications"); - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Identity/20250222190930_V3_4.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Identity/20250222190930_V3_4.Designer.cs deleted file mode 100644 index 99defc052d..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Identity/20250222190930_V3_4.Designer.cs +++ /dev/null @@ -1,149 +0,0 @@ -// -using Elsa.EntityFrameworkCore.Modules.Identity; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.PostgreSql.Migrations.Identity -{ - [DbContext(typeof(IdentityElsaDbContext))] - [Migration("20250222190930_V3_4")] - partial class V3_4 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "8.0.12") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("Elsa.Identity.Entities.Application", b => - { - b.Property("Id") - .HasColumnType("text"); - - b.Property("ClientId") - .IsRequired() - .HasColumnType("text"); - - b.Property("HashedApiKey") - .IsRequired() - .HasColumnType("text"); - - b.Property("HashedApiKeySalt") - .IsRequired() - .HasColumnType("text"); - - b.Property("HashedClientSecret") - .IsRequired() - .HasColumnType("text"); - - b.Property("HashedClientSecretSalt") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Roles") - .IsRequired() - .HasColumnType("text") - .HasColumnName("Roles"); - - b.Property("TenantId") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("ClientId") - .IsUnique() - .HasDatabaseName("IX_Application_ClientId"); - - b.HasIndex("Name") - .IsUnique() - .HasDatabaseName("IX_Application_Name"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_Application_TenantId"); - - b.ToTable("Applications", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Identity.Entities.Role", b => - { - b.Property("Id") - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Permissions") - .IsRequired() - .HasColumnType("text") - .HasColumnName("Permissions"); - - b.Property("TenantId") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique() - .HasDatabaseName("IX_Role_Name"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_Role_TenantId"); - - b.ToTable("Roles", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Identity.Entities.User", b => - { - b.Property("Id") - .HasColumnType("text"); - - b.Property("HashedPassword") - .IsRequired() - .HasColumnType("text"); - - b.Property("HashedPasswordSalt") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Roles") - .IsRequired() - .HasColumnType("text") - .HasColumnName("Roles"); - - b.Property("TenantId") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique() - .HasDatabaseName("IX_User_Name"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_User_TenantId"); - - b.ToTable("Users", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Identity/20250222190930_V3_4.cs b/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Identity/20250222190930_V3_4.cs deleted file mode 100644 index 74e6d8ab4d..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Identity/20250222190930_V3_4.cs +++ /dev/null @@ -1,30 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.PostgreSql.Migrations.Identity -{ - /// - public partial class V3_4 : Migration - { - private readonly Elsa.EntityFrameworkCore.IElsaDbContextSchema _schema; - - /// - public V3_4(Elsa.EntityFrameworkCore.IElsaDbContextSchema schema) - { - _schema = schema; - } - - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Identity/IdentityElsaDbContextModelSnapshot.cs b/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Identity/IdentityElsaDbContextModelSnapshot.cs deleted file mode 100644 index 9b7328ec48..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Identity/IdentityElsaDbContextModelSnapshot.cs +++ /dev/null @@ -1,146 +0,0 @@ -// -using Elsa.EntityFrameworkCore.Modules.Identity; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.PostgreSql.Migrations.Identity -{ - [DbContext(typeof(IdentityElsaDbContext))] - partial class IdentityElsaDbContextModelSnapshot : ModelSnapshot - { - protected override void BuildModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "8.0.12") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("Elsa.Identity.Entities.Application", b => - { - b.Property("Id") - .HasColumnType("text"); - - b.Property("ClientId") - .IsRequired() - .HasColumnType("text"); - - b.Property("HashedApiKey") - .IsRequired() - .HasColumnType("text"); - - b.Property("HashedApiKeySalt") - .IsRequired() - .HasColumnType("text"); - - b.Property("HashedClientSecret") - .IsRequired() - .HasColumnType("text"); - - b.Property("HashedClientSecretSalt") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Roles") - .IsRequired() - .HasColumnType("text") - .HasColumnName("Roles"); - - b.Property("TenantId") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("ClientId") - .IsUnique() - .HasDatabaseName("IX_Application_ClientId"); - - b.HasIndex("Name") - .IsUnique() - .HasDatabaseName("IX_Application_Name"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_Application_TenantId"); - - b.ToTable("Applications", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Identity.Entities.Role", b => - { - b.Property("Id") - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Permissions") - .IsRequired() - .HasColumnType("text") - .HasColumnName("Permissions"); - - b.Property("TenantId") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique() - .HasDatabaseName("IX_Role_Name"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_Role_TenantId"); - - b.ToTable("Roles", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Identity.Entities.User", b => - { - b.Property("Id") - .HasColumnType("text"); - - b.Property("HashedPassword") - .IsRequired() - .HasColumnType("text"); - - b.Property("HashedPasswordSalt") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Roles") - .IsRequired() - .HasColumnType("text") - .HasColumnName("Roles"); - - b.Property("TenantId") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique() - .HasDatabaseName("IX_User_Name"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_User_TenantId"); - - b.ToTable("Users", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Labels/20231015122304_Initial.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Labels/20231015122304_Initial.Designer.cs deleted file mode 100644 index c16ca367e4..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Labels/20231015122304_Initial.Designer.cs +++ /dev/null @@ -1,85 +0,0 @@ -// -using Elsa.EntityFrameworkCore.Modules.Labels; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.PostgreSql.Migrations.Labels -{ - [DbContext(typeof(LabelsElsaDbContext))] - [Migration("20231015122304_Initial")] - partial class Initial - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "7.0.11") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("Elsa.Labels.Entities.Label", b => - { - b.Property("Id") - .HasColumnType("text"); - - b.Property("Color") - .HasColumnType("text"); - - b.Property("Description") - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("NormalizedName") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.ToTable("Labels", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Labels.Entities.WorkflowDefinitionLabel", b => - { - b.Property("Id") - .HasColumnType("text"); - - b.Property("LabelId") - .IsRequired() - .HasColumnType("text"); - - b.Property("WorkflowDefinitionId") - .IsRequired() - .HasColumnType("text"); - - b.Property("WorkflowDefinitionVersionId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("LabelId") - .HasDatabaseName("WorkflowDefinitionLabel_LabelId"); - - b.HasIndex("WorkflowDefinitionId") - .HasDatabaseName("WorkflowDefinitionLabel_WorkflowDefinitionId"); - - b.HasIndex("WorkflowDefinitionVersionId") - .HasDatabaseName("WorkflowDefinitionLabel_WorkflowDefinitionVersionId"); - - b.ToTable("WorkflowDefinitionLabels", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Labels/20231015122304_Initial.cs b/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Labels/20231015122304_Initial.cs deleted file mode 100644 index e49d4cae75..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Labels/20231015122304_Initial.cs +++ /dev/null @@ -1,84 +0,0 @@ - -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.PostgreSql.Migrations.Labels -{ - /// - public partial class Initial : Migration - { - private readonly IElsaDbContextSchema _schema; - public Initial(IElsaDbContextSchema schema) - { - _schema = schema ?? throw new ArgumentNullException(nameof(schema)); - } - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.EnsureSchema( - name: _schema.Schema); - - migrationBuilder.CreateTable( - name: "Labels", - schema: _schema.Schema, - columns: table => new - { - Id = table.Column(type: "text", nullable: false), - Name = table.Column(type: "text", nullable: false), - NormalizedName = table.Column(type: "text", nullable: false), - Description = table.Column(type: "text", nullable: true), - Color = table.Column(type: "text", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Labels", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "WorkflowDefinitionLabels", - schema: _schema.Schema, - columns: table => new - { - Id = table.Column(type: "text", nullable: false), - WorkflowDefinitionId = table.Column(type: "text", nullable: false), - WorkflowDefinitionVersionId = table.Column(type: "text", nullable: false), - LabelId = table.Column(type: "text", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_WorkflowDefinitionLabels", x => x.Id); - }); - - migrationBuilder.CreateIndex( - name: "WorkflowDefinitionLabel_LabelId", - schema: _schema.Schema, - table: "WorkflowDefinitionLabels", - column: "LabelId"); - - migrationBuilder.CreateIndex( - name: "WorkflowDefinitionLabel_WorkflowDefinitionId", - schema: _schema.Schema, - table: "WorkflowDefinitionLabels", - column: "WorkflowDefinitionId"); - - migrationBuilder.CreateIndex( - name: "WorkflowDefinitionLabel_WorkflowDefinitionVersionId", - schema: _schema.Schema, - table: "WorkflowDefinitionLabels", - column: "WorkflowDefinitionVersionId"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "Labels", - schema: _schema.Schema); - - migrationBuilder.DropTable( - name: "WorkflowDefinitionLabels", - schema: _schema.Schema); - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Labels/20240329200841_V3_1.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Labels/20240329200841_V3_1.Designer.cs deleted file mode 100644 index 4d06c6a81c..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Labels/20240329200841_V3_1.Designer.cs +++ /dev/null @@ -1,85 +0,0 @@ -// -using Elsa.EntityFrameworkCore.Modules.Labels; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.PostgreSql.Migrations.Labels -{ - [DbContext(typeof(LabelsElsaDbContext))] - [Migration("20240329200841_V3_1")] - partial class V3_1 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "7.0.14") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("Elsa.Labels.Entities.Label", b => - { - b.Property("Id") - .HasColumnType("text"); - - b.Property("Color") - .HasColumnType("text"); - - b.Property("Description") - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("NormalizedName") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.ToTable("Labels", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Labels.Entities.WorkflowDefinitionLabel", b => - { - b.Property("Id") - .HasColumnType("text"); - - b.Property("LabelId") - .IsRequired() - .HasColumnType("text"); - - b.Property("WorkflowDefinitionId") - .IsRequired() - .HasColumnType("text"); - - b.Property("WorkflowDefinitionVersionId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("LabelId") - .HasDatabaseName("WorkflowDefinitionLabel_LabelId"); - - b.HasIndex("WorkflowDefinitionId") - .HasDatabaseName("WorkflowDefinitionLabel_WorkflowDefinitionId"); - - b.HasIndex("WorkflowDefinitionVersionId") - .HasDatabaseName("WorkflowDefinitionLabel_WorkflowDefinitionVersionId"); - - b.ToTable("WorkflowDefinitionLabels", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Labels/20240329200841_V3_1.cs b/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Labels/20240329200841_V3_1.cs deleted file mode 100644 index 84c472bdda..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Labels/20240329200841_V3_1.cs +++ /dev/null @@ -1,30 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.PostgreSql.Migrations.Labels -{ - /// - public partial class V3_1 : Migration - { - private readonly IElsaDbContextSchema _schema; - - /// - public V3_1(IElsaDbContextSchema schema) - { - _schema = schema; - } - - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Labels/20240610185037_V3_2.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Labels/20240610185037_V3_2.Designer.cs deleted file mode 100644 index 280ac5e3f9..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Labels/20240610185037_V3_2.Designer.cs +++ /dev/null @@ -1,85 +0,0 @@ -// -using Elsa.EntityFrameworkCore.Modules.Labels; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.PostgreSql.Migrations.Labels -{ - [DbContext(typeof(LabelsElsaDbContext))] - [Migration("20240610185037_V3_2")] - partial class V3_2 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "7.0.20") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("Elsa.Labels.Entities.Label", b => - { - b.Property("Id") - .HasColumnType("text"); - - b.Property("Color") - .HasColumnType("text"); - - b.Property("Description") - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("NormalizedName") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.ToTable("Labels", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Labels.Entities.WorkflowDefinitionLabel", b => - { - b.Property("Id") - .HasColumnType("text"); - - b.Property("LabelId") - .IsRequired() - .HasColumnType("text"); - - b.Property("WorkflowDefinitionId") - .IsRequired() - .HasColumnType("text"); - - b.Property("WorkflowDefinitionVersionId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("LabelId") - .HasDatabaseName("WorkflowDefinitionLabel_LabelId"); - - b.HasIndex("WorkflowDefinitionId") - .HasDatabaseName("WorkflowDefinitionLabel_WorkflowDefinitionId"); - - b.HasIndex("WorkflowDefinitionVersionId") - .HasDatabaseName("WorkflowDefinitionLabel_WorkflowDefinitionVersionId"); - - b.ToTable("WorkflowDefinitionLabels", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Labels/20240610185037_V3_2.cs b/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Labels/20240610185037_V3_2.cs deleted file mode 100644 index e41d8e45d1..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Labels/20240610185037_V3_2.cs +++ /dev/null @@ -1,30 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.PostgreSql.Migrations.Labels -{ - /// - public partial class V3_2 : Migration - { - private readonly IElsaDbContextSchema _schema; - - /// - public V3_2(IElsaDbContextSchema schema) - { - _schema = schema; - } - - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Labels/20241212212046_V3_3.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Labels/20241212212046_V3_3.Designer.cs deleted file mode 100644 index 73348b8b7c..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Labels/20241212212046_V3_3.Designer.cs +++ /dev/null @@ -1,94 +0,0 @@ -// -using Elsa.EntityFrameworkCore.Modules.Labels; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.PostgreSql.Migrations.Labels -{ - [DbContext(typeof(LabelsElsaDbContext))] - [Migration("20241212212046_V3_3")] - partial class V3_3 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "7.0.20") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("Elsa.Labels.Entities.Label", b => - { - b.Property("Id") - .HasColumnType("text"); - - b.Property("Color") - .HasColumnType("text"); - - b.Property("Description") - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("NormalizedName") - .IsRequired() - .HasColumnType("text"); - - b.Property("TenantId") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.ToTable("Labels", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Labels.Entities.WorkflowDefinitionLabel", b => - { - b.Property("Id") - .HasColumnType("text"); - - b.Property("LabelId") - .IsRequired() - .HasColumnType("text"); - - b.Property("TenantId") - .HasColumnType("text"); - - b.Property("WorkflowDefinitionId") - .IsRequired() - .HasColumnType("text"); - - b.Property("WorkflowDefinitionVersionId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("LabelId") - .HasDatabaseName("WorkflowDefinitionLabel_LabelId"); - - b.HasIndex("TenantId") - .HasDatabaseName("WorkflowDefinitionLabel_TenantId"); - - b.HasIndex("WorkflowDefinitionId") - .HasDatabaseName("WorkflowDefinitionLabel_WorkflowDefinitionId"); - - b.HasIndex("WorkflowDefinitionVersionId") - .HasDatabaseName("WorkflowDefinitionLabel_WorkflowDefinitionVersionId"); - - b.ToTable("WorkflowDefinitionLabels", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Labels/20241212212046_V3_3.cs b/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Labels/20241212212046_V3_3.cs deleted file mode 100644 index 0f84786b4b..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Labels/20241212212046_V3_3.cs +++ /dev/null @@ -1,61 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.PostgreSql.Migrations.Labels -{ - /// - public partial class V3_3 : Migration - { - private readonly Elsa.EntityFrameworkCore.IElsaDbContextSchema _schema; - - /// - public V3_3(Elsa.EntityFrameworkCore.IElsaDbContextSchema schema) - { - _schema = schema; - } - - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "TenantId", - schema: _schema.Schema, - table: "WorkflowDefinitionLabels", - type: "text", - nullable: true); - - migrationBuilder.AddColumn( - name: "TenantId", - schema: _schema.Schema, - table: "Labels", - type: "text", - nullable: true); - - migrationBuilder.CreateIndex( - name: "WorkflowDefinitionLabel_TenantId", - schema: _schema.Schema, - table: "WorkflowDefinitionLabels", - column: "TenantId"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropIndex( - name: "WorkflowDefinitionLabel_TenantId", - schema: _schema.Schema, - table: "WorkflowDefinitionLabels"); - - migrationBuilder.DropColumn( - name: "TenantId", - schema: _schema.Schema, - table: "WorkflowDefinitionLabels"); - - migrationBuilder.DropColumn( - name: "TenantId", - schema: _schema.Schema, - table: "Labels"); - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Labels/20250222190956_V3_4.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Labels/20250222190956_V3_4.Designer.cs deleted file mode 100644 index c9675b537e..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Labels/20250222190956_V3_4.Designer.cs +++ /dev/null @@ -1,94 +0,0 @@ -// -using Elsa.EntityFrameworkCore.Modules.Labels; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.PostgreSql.Migrations.Labels -{ - [DbContext(typeof(LabelsElsaDbContext))] - [Migration("20250222190956_V3_4")] - partial class V3_4 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "8.0.12") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("Elsa.Labels.Entities.Label", b => - { - b.Property("Id") - .HasColumnType("text"); - - b.Property("Color") - .HasColumnType("text"); - - b.Property("Description") - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("NormalizedName") - .IsRequired() - .HasColumnType("text"); - - b.Property("TenantId") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.ToTable("Labels", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Labels.Entities.WorkflowDefinitionLabel", b => - { - b.Property("Id") - .HasColumnType("text"); - - b.Property("LabelId") - .IsRequired() - .HasColumnType("text"); - - b.Property("TenantId") - .HasColumnType("text"); - - b.Property("WorkflowDefinitionId") - .IsRequired() - .HasColumnType("text"); - - b.Property("WorkflowDefinitionVersionId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("LabelId") - .HasDatabaseName("WorkflowDefinitionLabel_LabelId"); - - b.HasIndex("TenantId") - .HasDatabaseName("WorkflowDefinitionLabel_TenantId"); - - b.HasIndex("WorkflowDefinitionId") - .HasDatabaseName("WorkflowDefinitionLabel_WorkflowDefinitionId"); - - b.HasIndex("WorkflowDefinitionVersionId") - .HasDatabaseName("WorkflowDefinitionLabel_WorkflowDefinitionVersionId"); - - b.ToTable("WorkflowDefinitionLabels", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Labels/20250222190956_V3_4.cs b/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Labels/20250222190956_V3_4.cs deleted file mode 100644 index a7981cad85..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Labels/20250222190956_V3_4.cs +++ /dev/null @@ -1,30 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.PostgreSql.Migrations.Labels -{ - /// - public partial class V3_4 : Migration - { - private readonly Elsa.EntityFrameworkCore.IElsaDbContextSchema _schema; - - /// - public V3_4(Elsa.EntityFrameworkCore.IElsaDbContextSchema schema) - { - _schema = schema; - } - - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Labels/LabelsElsaDbContextModelSnapshot.cs b/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Labels/LabelsElsaDbContextModelSnapshot.cs deleted file mode 100644 index 325f9fe8f8..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Labels/LabelsElsaDbContextModelSnapshot.cs +++ /dev/null @@ -1,91 +0,0 @@ -// -using Elsa.EntityFrameworkCore.Modules.Labels; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.PostgreSql.Migrations.Labels -{ - [DbContext(typeof(LabelsElsaDbContext))] - partial class LabelsElsaDbContextModelSnapshot : ModelSnapshot - { - protected override void BuildModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "8.0.12") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("Elsa.Labels.Entities.Label", b => - { - b.Property("Id") - .HasColumnType("text"); - - b.Property("Color") - .HasColumnType("text"); - - b.Property("Description") - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("NormalizedName") - .IsRequired() - .HasColumnType("text"); - - b.Property("TenantId") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.ToTable("Labels", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Labels.Entities.WorkflowDefinitionLabel", b => - { - b.Property("Id") - .HasColumnType("text"); - - b.Property("LabelId") - .IsRequired() - .HasColumnType("text"); - - b.Property("TenantId") - .HasColumnType("text"); - - b.Property("WorkflowDefinitionId") - .IsRequired() - .HasColumnType("text"); - - b.Property("WorkflowDefinitionVersionId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("LabelId") - .HasDatabaseName("WorkflowDefinitionLabel_LabelId"); - - b.HasIndex("TenantId") - .HasDatabaseName("WorkflowDefinitionLabel_TenantId"); - - b.HasIndex("WorkflowDefinitionId") - .HasDatabaseName("WorkflowDefinitionLabel_WorkflowDefinitionId"); - - b.HasIndex("WorkflowDefinitionVersionId") - .HasDatabaseName("WorkflowDefinitionLabel_WorkflowDefinitionVersionId"); - - b.ToTable("WorkflowDefinitionLabels", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Management/20231015122234_Initial.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Management/20231015122234_Initial.Designer.cs deleted file mode 100644 index d6beea710a..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Management/20231015122234_Initial.Designer.cs +++ /dev/null @@ -1,196 +0,0 @@ -// -using System; -using Elsa.EntityFrameworkCore.Modules.Management; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.PostgreSql.Migrations.Management -{ - [DbContext(typeof(ManagementElsaDbContext))] - [Migration("20231015122234_Initial")] - partial class Initial - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "7.0.11") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("Elsa.Workflows.Management.Entities.WorkflowDefinition", b => - { - b.Property("Id") - .HasColumnType("text"); - - b.Property("BinaryData") - .HasColumnType("bytea"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("Data") - .HasColumnType("text"); - - b.Property("DefinitionId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Description") - .HasColumnType("text"); - - b.Property("IsLatest") - .HasColumnType("boolean"); - - b.Property("IsPublished") - .HasColumnType("boolean"); - - b.Property("IsReadonly") - .HasColumnType("boolean"); - - b.Property("MaterializerContext") - .HasColumnType("text"); - - b.Property("MaterializerName") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .HasColumnType("text"); - - b.Property("ProviderName") - .HasColumnType("text"); - - b.Property("StringData") - .HasColumnType("text"); - - b.Property("ToolVersion") - .HasColumnType("text"); - - b.Property("UsableAsActivity") - .HasColumnType("boolean"); - - b.Property("Version") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("IsLatest") - .HasDatabaseName("IX_WorkflowDefinition_IsLatest"); - - b.HasIndex("IsPublished") - .HasDatabaseName("IX_WorkflowDefinition_IsPublished"); - - b.HasIndex("Name") - .HasDatabaseName("IX_WorkflowDefinition_Name"); - - b.HasIndex("UsableAsActivity") - .HasDatabaseName("IX_WorkflowDefinition_UsableAsActivity"); - - b.HasIndex("Version") - .HasDatabaseName("IX_WorkflowDefinition_Version"); - - b.HasIndex("DefinitionId", "Version") - .IsUnique() - .HasDatabaseName("IX_WorkflowDefinition_DefinitionId_Version"); - - b.ToTable("WorkflowDefinitions", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Management.Entities.WorkflowInstance", b => - { - b.Property("Id") - .HasColumnType("text"); - - b.Property("CorrelationId") - .HasColumnType("text"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("Data") - .HasColumnType("text"); - - b.Property("DefinitionId") - .IsRequired() - .HasColumnType("text"); - - b.Property("DefinitionVersionId") - .IsRequired() - .HasColumnType("text"); - - b.Property("FinishedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("IncidentCount") - .HasColumnType("integer"); - - b.Property("Name") - .HasColumnType("text"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("SubStatus") - .IsRequired() - .HasColumnType("text"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("Version") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("CorrelationId") - .HasDatabaseName("IX_WorkflowInstance_CorrelationId"); - - b.HasIndex("CreatedAt") - .HasDatabaseName("IX_WorkflowInstance_CreatedAt"); - - b.HasIndex("DefinitionId") - .HasDatabaseName("IX_WorkflowInstance_DefinitionId"); - - b.HasIndex("FinishedAt") - .HasDatabaseName("IX_WorkflowInstance_FinishedAt"); - - b.HasIndex("Name") - .HasDatabaseName("IX_WorkflowInstance_Name"); - - b.HasIndex("Status") - .HasDatabaseName("IX_WorkflowInstance_Status"); - - b.HasIndex("SubStatus") - .HasDatabaseName("IX_WorkflowInstance_SubStatus"); - - b.HasIndex("UpdatedAt") - .HasDatabaseName("IX_WorkflowInstance_UpdatedAt"); - - b.HasIndex("Status", "DefinitionId") - .HasDatabaseName("IX_WorkflowInstance_Status_DefinitionId"); - - b.HasIndex("Status", "SubStatus") - .HasDatabaseName("IX_WorkflowInstance_Status_SubStatus"); - - b.HasIndex("SubStatus", "DefinitionId") - .HasDatabaseName("IX_WorkflowInstance_SubStatus_DefinitionId"); - - b.HasIndex("Status", "SubStatus", "DefinitionId", "Version") - .HasDatabaseName("IX_WorkflowInstance_Status_SubStatus_DefinitionId_Version"); - - b.ToTable("WorkflowInstances", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Management/20231015122234_Initial.cs b/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Management/20231015122234_Initial.cs deleted file mode 100644 index 70940f2be0..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Management/20231015122234_Initial.cs +++ /dev/null @@ -1,196 +0,0 @@ - -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.PostgreSql.Migrations.Management -{ - /// - public partial class Initial : Migration - { - private readonly IElsaDbContextSchema _schema; - public Initial(IElsaDbContextSchema schema) - { - _schema = schema ?? throw new ArgumentNullException(nameof(schema)); - } - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.EnsureSchema( - name: _schema.Schema); - - migrationBuilder.CreateTable( - name: "WorkflowDefinitions", - schema: _schema.Schema, - columns: table => new - { - Id = table.Column(type: "text", nullable: false), - DefinitionId = table.Column(type: "text", nullable: false), - Name = table.Column(type: "text", nullable: true), - Description = table.Column(type: "text", nullable: true), - ToolVersion = table.Column(type: "text", nullable: true), - ProviderName = table.Column(type: "text", nullable: true), - MaterializerName = table.Column(type: "text", nullable: false), - MaterializerContext = table.Column(type: "text", nullable: true), - StringData = table.Column(type: "text", nullable: true), - BinaryData = table.Column(type: "bytea", nullable: true), - IsReadonly = table.Column(type: "boolean", nullable: false), - Data = table.Column(type: "text", nullable: true), - UsableAsActivity = table.Column(type: "boolean", nullable: true), - CreatedAt = table.Column(type: "timestamp with time zone", nullable: false), - Version = table.Column(type: "integer", nullable: false), - IsLatest = table.Column(type: "boolean", nullable: false), - IsPublished = table.Column(type: "boolean", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_WorkflowDefinitions", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "WorkflowInstances", - schema: _schema.Schema, - columns: table => new - { - Id = table.Column(type: "text", nullable: false), - DefinitionId = table.Column(type: "text", nullable: false), - DefinitionVersionId = table.Column(type: "text", nullable: false), - Version = table.Column(type: "integer", nullable: false), - Status = table.Column(type: "text", nullable: false), - SubStatus = table.Column(type: "text", nullable: false), - CorrelationId = table.Column(type: "text", nullable: true), - Name = table.Column(type: "text", nullable: true), - IncidentCount = table.Column(type: "integer", nullable: false), - CreatedAt = table.Column(type: "timestamp with time zone", nullable: false), - UpdatedAt = table.Column(type: "timestamp with time zone", nullable: false), - FinishedAt = table.Column(type: "timestamp with time zone", nullable: true), - Data = table.Column(type: "text", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_WorkflowInstances", x => x.Id); - }); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowDefinition_DefinitionId_Version", - schema: _schema.Schema, - table: "WorkflowDefinitions", - columns: new[] { "DefinitionId", "Version" }, - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowDefinition_IsLatest", - schema: _schema.Schema, - table: "WorkflowDefinitions", - column: "IsLatest"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowDefinition_IsPublished", - schema: _schema.Schema, - table: "WorkflowDefinitions", - column: "IsPublished"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowDefinition_Name", - schema: _schema.Schema, - table: "WorkflowDefinitions", - column: "Name"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowDefinition_UsableAsActivity", - schema: _schema.Schema, - table: "WorkflowDefinitions", - column: "UsableAsActivity"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowDefinition_Version", - schema: _schema.Schema, - table: "WorkflowDefinitions", - column: "Version"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowInstance_CorrelationId", - schema: _schema.Schema, - table: "WorkflowInstances", - column: "CorrelationId"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowInstance_CreatedAt", - schema: _schema.Schema, - table: "WorkflowInstances", - column: "CreatedAt"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowInstance_DefinitionId", - schema: _schema.Schema, - table: "WorkflowInstances", - column: "DefinitionId"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowInstance_FinishedAt", - schema: _schema.Schema, - table: "WorkflowInstances", - column: "FinishedAt"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowInstance_Name", - schema: _schema.Schema, - table: "WorkflowInstances", - column: "Name"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowInstance_Status", - schema: _schema.Schema, - table: "WorkflowInstances", - column: "Status"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowInstance_Status_DefinitionId", - schema: _schema.Schema, - table: "WorkflowInstances", - columns: new[] { "Status", "DefinitionId" }); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowInstance_Status_SubStatus", - schema: _schema.Schema, - table: "WorkflowInstances", - columns: new[] { "Status", "SubStatus" }); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowInstance_Status_SubStatus_DefinitionId_Version", - schema: _schema.Schema, - table: "WorkflowInstances", - columns: new[] { "Status", "SubStatus", "DefinitionId", "Version" }); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowInstance_SubStatus", - schema: _schema.Schema, - table: "WorkflowInstances", - column: "SubStatus"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowInstance_SubStatus_DefinitionId", - schema: _schema.Schema, - table: "WorkflowInstances", - columns: new[] { "SubStatus", "DefinitionId" }); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowInstance_UpdatedAt", - schema: _schema.Schema, - table: "WorkflowInstances", - column: "UpdatedAt"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "WorkflowDefinitions", - schema: _schema.Schema); - - migrationBuilder.DropTable( - name: "WorkflowInstances", - schema: _schema.Schema); - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Management/20240329200740_V3_1.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Management/20240329200740_V3_1.Designer.cs deleted file mode 100644 index 2aee77f547..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Management/20240329200740_V3_1.Designer.cs +++ /dev/null @@ -1,214 +0,0 @@ -// -using System; -using Elsa.EntityFrameworkCore.Modules.Management; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.PostgreSql.Migrations.Management -{ - [DbContext(typeof(ManagementElsaDbContext))] - [Migration("20240329200740_V3_1")] - partial class V3_1 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "7.0.14") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("Elsa.Workflows.Management.Entities.WorkflowDefinition", b => - { - b.Property("Id") - .HasColumnType("text"); - - b.Property("BinaryData") - .HasColumnType("bytea"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("Data") - .HasColumnType("text"); - - b.Property("DefinitionId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Description") - .HasColumnType("text"); - - b.Property("IsLatest") - .HasColumnType("boolean"); - - b.Property("IsPublished") - .HasColumnType("boolean"); - - b.Property("IsReadonly") - .HasColumnType("boolean"); - - b.Property("IsSystem") - .HasColumnType("boolean"); - - b.Property("MaterializerContext") - .HasColumnType("text"); - - b.Property("MaterializerName") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .HasColumnType("text"); - - b.Property("ProviderName") - .HasColumnType("text"); - - b.Property("StringData") - .HasColumnType("text"); - - b.Property("ToolVersion") - .HasColumnType("text"); - - b.Property("UsableAsActivity") - .HasColumnType("boolean"); - - b.Property("Version") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("IsLatest") - .HasDatabaseName("IX_WorkflowDefinition_IsLatest"); - - b.HasIndex("IsPublished") - .HasDatabaseName("IX_WorkflowDefinition_IsPublished"); - - b.HasIndex("IsSystem") - .HasDatabaseName("IX_WorkflowDefinition_IsSystem"); - - b.HasIndex("Name") - .HasDatabaseName("IX_WorkflowDefinition_Name"); - - b.HasIndex("UsableAsActivity") - .HasDatabaseName("IX_WorkflowDefinition_UsableAsActivity"); - - b.HasIndex("Version") - .HasDatabaseName("IX_WorkflowDefinition_Version"); - - b.HasIndex("DefinitionId", "Version") - .IsUnique() - .HasDatabaseName("IX_WorkflowDefinition_DefinitionId_Version"); - - b.ToTable("WorkflowDefinitions", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Management.Entities.WorkflowInstance", b => - { - b.Property("Id") - .HasColumnType("text"); - - b.Property("CorrelationId") - .HasColumnType("text"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("Data") - .HasColumnType("text"); - - b.Property("DataCompressionAlgorithm") - .HasColumnType("text"); - - b.Property("DefinitionId") - .IsRequired() - .HasColumnType("text"); - - b.Property("DefinitionVersionId") - .IsRequired() - .HasColumnType("text"); - - b.Property("FinishedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("IncidentCount") - .HasColumnType("integer"); - - b.Property("IsSystem") - .HasColumnType("boolean"); - - b.Property("Name") - .HasColumnType("text"); - - b.Property("ParentWorkflowInstanceId") - .HasColumnType("text"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("SubStatus") - .IsRequired() - .HasColumnType("text"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("Version") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("CorrelationId") - .HasDatabaseName("IX_WorkflowInstance_CorrelationId"); - - b.HasIndex("CreatedAt") - .HasDatabaseName("IX_WorkflowInstance_CreatedAt"); - - b.HasIndex("DefinitionId") - .HasDatabaseName("IX_WorkflowInstance_DefinitionId"); - - b.HasIndex("FinishedAt") - .HasDatabaseName("IX_WorkflowInstance_FinishedAt"); - - b.HasIndex("IsSystem") - .HasDatabaseName("IX_WorkflowInstance_IsSystem"); - - b.HasIndex("Name") - .HasDatabaseName("IX_WorkflowInstance_Name"); - - b.HasIndex("Status") - .HasDatabaseName("IX_WorkflowInstance_Status"); - - b.HasIndex("SubStatus") - .HasDatabaseName("IX_WorkflowInstance_SubStatus"); - - b.HasIndex("UpdatedAt") - .HasDatabaseName("IX_WorkflowInstance_UpdatedAt"); - - b.HasIndex("Status", "DefinitionId") - .HasDatabaseName("IX_WorkflowInstance_Status_DefinitionId"); - - b.HasIndex("Status", "SubStatus") - .HasDatabaseName("IX_WorkflowInstance_Status_SubStatus"); - - b.HasIndex("SubStatus", "DefinitionId") - .HasDatabaseName("IX_WorkflowInstance_SubStatus_DefinitionId"); - - b.HasIndex("Status", "SubStatus", "DefinitionId", "Version") - .HasDatabaseName("IX_WorkflowInstance_Status_SubStatus_DefinitionId_Version"); - - b.ToTable("WorkflowInstances", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Management/20240329200740_V3_1.cs b/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Management/20240329200740_V3_1.cs deleted file mode 100644 index dcc4b0e75d..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Management/20240329200740_V3_1.cs +++ /dev/null @@ -1,98 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.PostgreSql.Migrations.Management -{ - /// - public partial class V3_1 : Migration - { - private readonly IElsaDbContextSchema _schema; - - /// - public V3_1(IElsaDbContextSchema schema) - { - _schema = schema; - } - - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "DataCompressionAlgorithm", - schema: _schema.Schema, - table: "WorkflowInstances", - type: "text", - nullable: true); - - migrationBuilder.AddColumn( - name: "IsSystem", - schema: _schema.Schema, - table: "WorkflowInstances", - type: "boolean", - nullable: false, - defaultValue: false); - - migrationBuilder.AddColumn( - name: "ParentWorkflowInstanceId", - schema: _schema.Schema, - table: "WorkflowInstances", - type: "text", - nullable: true); - - migrationBuilder.AddColumn( - name: "IsSystem", - schema: _schema.Schema, - table: "WorkflowDefinitions", - type: "boolean", - nullable: false, - defaultValue: false); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowInstance_IsSystem", - schema: _schema.Schema, - table: "WorkflowInstances", - column: "IsSystem"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowDefinition_IsSystem", - schema: _schema.Schema, - table: "WorkflowDefinitions", - column: "IsSystem"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropIndex( - name: "IX_WorkflowInstance_IsSystem", - schema: _schema.Schema, - table: "WorkflowInstances"); - - migrationBuilder.DropIndex( - name: "IX_WorkflowDefinition_IsSystem", - schema: _schema.Schema, - table: "WorkflowDefinitions"); - - migrationBuilder.DropColumn( - name: "DataCompressionAlgorithm", - schema: _schema.Schema, - table: "WorkflowInstances"); - - migrationBuilder.DropColumn( - name: "IsSystem", - schema: _schema.Schema, - table: "WorkflowInstances"); - - migrationBuilder.DropColumn( - name: "ParentWorkflowInstanceId", - schema: _schema.Schema, - table: "WorkflowInstances"); - - migrationBuilder.DropColumn( - name: "IsSystem", - schema: _schema.Schema, - table: "WorkflowDefinitions"); - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Management/20240610184839_V3_2.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Management/20240610184839_V3_2.Designer.cs deleted file mode 100644 index 8484325d55..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Management/20240610184839_V3_2.Designer.cs +++ /dev/null @@ -1,214 +0,0 @@ -// -using System; -using Elsa.EntityFrameworkCore.Modules.Management; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.PostgreSql.Migrations.Management -{ - [DbContext(typeof(ManagementElsaDbContext))] - [Migration("20240610184839_V3_2")] - partial class V3_2 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "7.0.20") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("Elsa.Workflows.Management.Entities.WorkflowDefinition", b => - { - b.Property("Id") - .HasColumnType("text"); - - b.Property("BinaryData") - .HasColumnType("bytea"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("Data") - .HasColumnType("text"); - - b.Property("DefinitionId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Description") - .HasColumnType("text"); - - b.Property("IsLatest") - .HasColumnType("boolean"); - - b.Property("IsPublished") - .HasColumnType("boolean"); - - b.Property("IsReadonly") - .HasColumnType("boolean"); - - b.Property("IsSystem") - .HasColumnType("boolean"); - - b.Property("MaterializerContext") - .HasColumnType("text"); - - b.Property("MaterializerName") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .HasColumnType("text"); - - b.Property("ProviderName") - .HasColumnType("text"); - - b.Property("StringData") - .HasColumnType("text"); - - b.Property("ToolVersion") - .HasColumnType("text"); - - b.Property("UsableAsActivity") - .HasColumnType("boolean"); - - b.Property("Version") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("IsLatest") - .HasDatabaseName("IX_WorkflowDefinition_IsLatest"); - - b.HasIndex("IsPublished") - .HasDatabaseName("IX_WorkflowDefinition_IsPublished"); - - b.HasIndex("IsSystem") - .HasDatabaseName("IX_WorkflowDefinition_IsSystem"); - - b.HasIndex("Name") - .HasDatabaseName("IX_WorkflowDefinition_Name"); - - b.HasIndex("UsableAsActivity") - .HasDatabaseName("IX_WorkflowDefinition_UsableAsActivity"); - - b.HasIndex("Version") - .HasDatabaseName("IX_WorkflowDefinition_Version"); - - b.HasIndex("DefinitionId", "Version") - .IsUnique() - .HasDatabaseName("IX_WorkflowDefinition_DefinitionId_Version"); - - b.ToTable("WorkflowDefinitions", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Management.Entities.WorkflowInstance", b => - { - b.Property("Id") - .HasColumnType("text"); - - b.Property("CorrelationId") - .HasColumnType("text"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("Data") - .HasColumnType("text"); - - b.Property("DataCompressionAlgorithm") - .HasColumnType("text"); - - b.Property("DefinitionId") - .IsRequired() - .HasColumnType("text"); - - b.Property("DefinitionVersionId") - .IsRequired() - .HasColumnType("text"); - - b.Property("FinishedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("IncidentCount") - .HasColumnType("integer"); - - b.Property("IsSystem") - .HasColumnType("boolean"); - - b.Property("Name") - .HasColumnType("text"); - - b.Property("ParentWorkflowInstanceId") - .HasColumnType("text"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("SubStatus") - .IsRequired() - .HasColumnType("text"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("Version") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("CorrelationId") - .HasDatabaseName("IX_WorkflowInstance_CorrelationId"); - - b.HasIndex("CreatedAt") - .HasDatabaseName("IX_WorkflowInstance_CreatedAt"); - - b.HasIndex("DefinitionId") - .HasDatabaseName("IX_WorkflowInstance_DefinitionId"); - - b.HasIndex("FinishedAt") - .HasDatabaseName("IX_WorkflowInstance_FinishedAt"); - - b.HasIndex("IsSystem") - .HasDatabaseName("IX_WorkflowInstance_IsSystem"); - - b.HasIndex("Name") - .HasDatabaseName("IX_WorkflowInstance_Name"); - - b.HasIndex("Status") - .HasDatabaseName("IX_WorkflowInstance_Status"); - - b.HasIndex("SubStatus") - .HasDatabaseName("IX_WorkflowInstance_SubStatus"); - - b.HasIndex("UpdatedAt") - .HasDatabaseName("IX_WorkflowInstance_UpdatedAt"); - - b.HasIndex("Status", "DefinitionId") - .HasDatabaseName("IX_WorkflowInstance_Status_DefinitionId"); - - b.HasIndex("Status", "SubStatus") - .HasDatabaseName("IX_WorkflowInstance_Status_SubStatus"); - - b.HasIndex("SubStatus", "DefinitionId") - .HasDatabaseName("IX_WorkflowInstance_SubStatus_DefinitionId"); - - b.HasIndex("Status", "SubStatus", "DefinitionId", "Version") - .HasDatabaseName("IX_WorkflowInstance_Status_SubStatus_DefinitionId_Version"); - - b.ToTable("WorkflowInstances", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Management/20240610184839_V3_2.cs b/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Management/20240610184839_V3_2.cs deleted file mode 100644 index 5ca565daa2..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Management/20240610184839_V3_2.cs +++ /dev/null @@ -1,30 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.PostgreSql.Migrations.Management -{ - /// - public partial class V3_2 : Migration - { - private readonly IElsaDbContextSchema _schema; - - /// - public V3_2(IElsaDbContextSchema schema) - { - _schema = schema; - } - - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Management/20241212211805_V3_3.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Management/20241212211805_V3_3.Designer.cs deleted file mode 100644 index b24d6416c3..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Management/20241212211805_V3_3.Designer.cs +++ /dev/null @@ -1,226 +0,0 @@ -// -using System; -using Elsa.EntityFrameworkCore.Modules.Management; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.PostgreSql.Migrations.Management -{ - [DbContext(typeof(ManagementElsaDbContext))] - [Migration("20241212211805_V3_3")] - partial class V3_3 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "7.0.20") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("Elsa.Workflows.Management.Entities.WorkflowDefinition", b => - { - b.Property("Id") - .HasColumnType("text"); - - b.Property("BinaryData") - .HasColumnType("bytea"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("Data") - .HasColumnType("text"); - - b.Property("DefinitionId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Description") - .HasColumnType("text"); - - b.Property("IsLatest") - .HasColumnType("boolean"); - - b.Property("IsPublished") - .HasColumnType("boolean"); - - b.Property("IsReadonly") - .HasColumnType("boolean"); - - b.Property("IsSystem") - .HasColumnType("boolean"); - - b.Property("MaterializerContext") - .HasColumnType("text"); - - b.Property("MaterializerName") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .HasColumnType("text"); - - b.Property("ProviderName") - .HasColumnType("text"); - - b.Property("StringData") - .HasColumnType("text"); - - b.Property("TenantId") - .HasColumnType("text"); - - b.Property("ToolVersion") - .HasColumnType("text"); - - b.Property("UsableAsActivity") - .HasColumnType("boolean"); - - b.Property("Version") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("IsLatest") - .HasDatabaseName("IX_WorkflowDefinition_IsLatest"); - - b.HasIndex("IsPublished") - .HasDatabaseName("IX_WorkflowDefinition_IsPublished"); - - b.HasIndex("IsSystem") - .HasDatabaseName("IX_WorkflowDefinition_IsSystem"); - - b.HasIndex("Name") - .HasDatabaseName("IX_WorkflowDefinition_Name"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_WorkflowDefinition_TenantId"); - - b.HasIndex("UsableAsActivity") - .HasDatabaseName("IX_WorkflowDefinition_UsableAsActivity"); - - b.HasIndex("Version") - .HasDatabaseName("IX_WorkflowDefinition_Version"); - - b.HasIndex("DefinitionId", "Version") - .IsUnique() - .HasDatabaseName("IX_WorkflowDefinition_DefinitionId_Version"); - - b.ToTable("WorkflowDefinitions", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Management.Entities.WorkflowInstance", b => - { - b.Property("Id") - .HasColumnType("text"); - - b.Property("CorrelationId") - .HasColumnType("text"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("Data") - .HasColumnType("text"); - - b.Property("DataCompressionAlgorithm") - .HasColumnType("text"); - - b.Property("DefinitionId") - .IsRequired() - .HasColumnType("text"); - - b.Property("DefinitionVersionId") - .IsRequired() - .HasColumnType("text"); - - b.Property("FinishedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("IncidentCount") - .HasColumnType("integer"); - - b.Property("IsSystem") - .HasColumnType("boolean"); - - b.Property("Name") - .HasColumnType("text"); - - b.Property("ParentWorkflowInstanceId") - .HasColumnType("text"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("SubStatus") - .IsRequired() - .HasColumnType("text"); - - b.Property("TenantId") - .HasColumnType("text"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("Version") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("CorrelationId") - .HasDatabaseName("IX_WorkflowInstance_CorrelationId"); - - b.HasIndex("CreatedAt") - .HasDatabaseName("IX_WorkflowInstance_CreatedAt"); - - b.HasIndex("DefinitionId") - .HasDatabaseName("IX_WorkflowInstance_DefinitionId"); - - b.HasIndex("FinishedAt") - .HasDatabaseName("IX_WorkflowInstance_FinishedAt"); - - b.HasIndex("IsSystem") - .HasDatabaseName("IX_WorkflowInstance_IsSystem"); - - b.HasIndex("Name") - .HasDatabaseName("IX_WorkflowInstance_Name"); - - b.HasIndex("Status") - .HasDatabaseName("IX_WorkflowInstance_Status"); - - b.HasIndex("SubStatus") - .HasDatabaseName("IX_WorkflowInstance_SubStatus"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_WorkflowInstance_TenantId"); - - b.HasIndex("UpdatedAt") - .HasDatabaseName("IX_WorkflowInstance_UpdatedAt"); - - b.HasIndex("Status", "DefinitionId") - .HasDatabaseName("IX_WorkflowInstance_Status_DefinitionId"); - - b.HasIndex("Status", "SubStatus") - .HasDatabaseName("IX_WorkflowInstance_Status_SubStatus"); - - b.HasIndex("SubStatus", "DefinitionId") - .HasDatabaseName("IX_WorkflowInstance_SubStatus_DefinitionId"); - - b.HasIndex("Status", "SubStatus", "DefinitionId", "Version") - .HasDatabaseName("IX_WorkflowInstance_Status_SubStatus_DefinitionId_Version"); - - b.ToTable("WorkflowInstances", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Management/20241212211805_V3_3.cs b/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Management/20241212211805_V3_3.cs deleted file mode 100644 index c423fd74eb..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Management/20241212211805_V3_3.cs +++ /dev/null @@ -1,72 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.PostgreSql.Migrations.Management -{ - /// - public partial class V3_3 : Migration - { - private readonly Elsa.EntityFrameworkCore.IElsaDbContextSchema _schema; - - /// - public V3_3(Elsa.EntityFrameworkCore.IElsaDbContextSchema schema) - { - _schema = schema; - } - - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "TenantId", - schema: _schema.Schema, - table: "WorkflowInstances", - type: "text", - nullable: true); - - migrationBuilder.AddColumn( - name: "TenantId", - schema: _schema.Schema, - table: "WorkflowDefinitions", - type: "text", - nullable: true); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowInstance_TenantId", - schema: _schema.Schema, - table: "WorkflowInstances", - column: "TenantId"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowDefinition_TenantId", - schema: _schema.Schema, - table: "WorkflowDefinitions", - column: "TenantId"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropIndex( - name: "IX_WorkflowInstance_TenantId", - schema: _schema.Schema, - table: "WorkflowInstances"); - - migrationBuilder.DropIndex( - name: "IX_WorkflowDefinition_TenantId", - schema: _schema.Schema, - table: "WorkflowDefinitions"); - - migrationBuilder.DropColumn( - name: "TenantId", - schema: _schema.Schema, - table: "WorkflowInstances"); - - migrationBuilder.DropColumn( - name: "TenantId", - schema: _schema.Schema, - table: "WorkflowDefinitions"); - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Management/20250222190906_V3_4.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Management/20250222190906_V3_4.Designer.cs deleted file mode 100644 index 663e348dd1..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Management/20250222190906_V3_4.Designer.cs +++ /dev/null @@ -1,232 +0,0 @@ -// -using System; -using Elsa.EntityFrameworkCore.Modules.Management; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.PostgreSql.Migrations.Management -{ - [DbContext(typeof(ManagementElsaDbContext))] - [Migration("20250222190906_V3_4")] - partial class V3_4 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "8.0.12") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("Elsa.Workflows.Management.Entities.WorkflowDefinition", b => - { - b.Property("Id") - .HasColumnType("text"); - - b.Property("BinaryData") - .HasColumnType("bytea"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("Data") - .HasColumnType("text"); - - b.Property("DefinitionId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Description") - .HasColumnType("text"); - - b.Property("IsLatest") - .HasColumnType("boolean"); - - b.Property("IsPublished") - .HasColumnType("boolean"); - - b.Property("IsReadonly") - .HasColumnType("boolean"); - - b.Property("IsSystem") - .HasColumnType("boolean"); - - b.Property("MaterializerContext") - .HasColumnType("text"); - - b.Property("MaterializerName") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .HasColumnType("text"); - - b.Property("ProviderName") - .HasColumnType("text"); - - b.Property("StringData") - .HasColumnType("text"); - - b.Property("TenantId") - .HasColumnType("text"); - - b.Property("ToolVersion") - .HasColumnType("text"); - - b.Property("UsableAsActivity") - .HasColumnType("boolean"); - - b.Property("Version") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("IsLatest") - .HasDatabaseName("IX_WorkflowDefinition_IsLatest"); - - b.HasIndex("IsPublished") - .HasDatabaseName("IX_WorkflowDefinition_IsPublished"); - - b.HasIndex("IsSystem") - .HasDatabaseName("IX_WorkflowDefinition_IsSystem"); - - b.HasIndex("Name") - .HasDatabaseName("IX_WorkflowDefinition_Name"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_WorkflowDefinition_TenantId"); - - b.HasIndex("UsableAsActivity") - .HasDatabaseName("IX_WorkflowDefinition_UsableAsActivity"); - - b.HasIndex("Version") - .HasDatabaseName("IX_WorkflowDefinition_Version"); - - b.HasIndex("DefinitionId", "Version") - .IsUnique() - .HasDatabaseName("IX_WorkflowDefinition_DefinitionId_Version"); - - b.ToTable("WorkflowDefinitions", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Management.Entities.WorkflowInstance", b => - { - b.Property("Id") - .HasColumnType("text"); - - b.Property("CorrelationId") - .HasColumnType("text"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("Data") - .HasColumnType("text"); - - b.Property("DataCompressionAlgorithm") - .HasColumnType("text"); - - b.Property("DefinitionId") - .IsRequired() - .HasColumnType("text"); - - b.Property("DefinitionVersionId") - .IsRequired() - .HasColumnType("text"); - - b.Property("FinishedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("IncidentCount") - .HasColumnType("integer"); - - b.Property("IsExecuting") - .HasColumnType("boolean"); - - b.Property("IsSystem") - .HasColumnType("boolean"); - - b.Property("Name") - .HasColumnType("text"); - - b.Property("ParentWorkflowInstanceId") - .HasColumnType("text"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("SubStatus") - .IsRequired() - .HasColumnType("text"); - - b.Property("TenantId") - .HasColumnType("text"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("Version") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("CorrelationId") - .HasDatabaseName("IX_WorkflowInstance_CorrelationId"); - - b.HasIndex("CreatedAt") - .HasDatabaseName("IX_WorkflowInstance_CreatedAt"); - - b.HasIndex("DefinitionId") - .HasDatabaseName("IX_WorkflowInstance_DefinitionId"); - - b.HasIndex("FinishedAt") - .HasDatabaseName("IX_WorkflowInstance_FinishedAt"); - - b.HasIndex("IsExecuting") - .HasDatabaseName("IX_WorkflowInstance_IsExecuting"); - - b.HasIndex("IsSystem") - .HasDatabaseName("IX_WorkflowInstance_IsSystem"); - - b.HasIndex("Name") - .HasDatabaseName("IX_WorkflowInstance_Name"); - - b.HasIndex("Status") - .HasDatabaseName("IX_WorkflowInstance_Status"); - - b.HasIndex("SubStatus") - .HasDatabaseName("IX_WorkflowInstance_SubStatus"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_WorkflowInstance_TenantId"); - - b.HasIndex("UpdatedAt") - .HasDatabaseName("IX_WorkflowInstance_UpdatedAt"); - - b.HasIndex("Status", "DefinitionId") - .HasDatabaseName("IX_WorkflowInstance_Status_DefinitionId"); - - b.HasIndex("Status", "SubStatus") - .HasDatabaseName("IX_WorkflowInstance_Status_SubStatus"); - - b.HasIndex("SubStatus", "DefinitionId") - .HasDatabaseName("IX_WorkflowInstance_SubStatus_DefinitionId"); - - b.HasIndex("Status", "SubStatus", "DefinitionId", "Version") - .HasDatabaseName("IX_WorkflowInstance_Status_SubStatus_DefinitionId_Version"); - - b.ToTable("WorkflowInstances", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Management/20250222190906_V3_4.cs b/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Management/20250222190906_V3_4.cs deleted file mode 100644 index c9038ff86c..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Management/20250222190906_V3_4.cs +++ /dev/null @@ -1,50 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.PostgreSql.Migrations.Management -{ - /// - public partial class V3_4 : Migration - { - private readonly Elsa.EntityFrameworkCore.IElsaDbContextSchema _schema; - - /// - public V3_4(Elsa.EntityFrameworkCore.IElsaDbContextSchema schema) - { - _schema = schema; - } - - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "IsExecuting", - schema: _schema.Schema, - table: "WorkflowInstances", - type: "boolean", - nullable: false, - defaultValue: false); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowInstance_IsExecuting", - schema: _schema.Schema, - table: "WorkflowInstances", - column: "IsExecuting"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropIndex( - name: "IX_WorkflowInstance_IsExecuting", - schema: _schema.Schema, - table: "WorkflowInstances"); - - migrationBuilder.DropColumn( - name: "IsExecuting", - schema: _schema.Schema, - table: "WorkflowInstances"); - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Management/ManagementElsaDbContextModelSnapshot.cs b/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Management/ManagementElsaDbContextModelSnapshot.cs deleted file mode 100644 index 41be03c36a..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Management/ManagementElsaDbContextModelSnapshot.cs +++ /dev/null @@ -1,229 +0,0 @@ -// -using System; -using Elsa.EntityFrameworkCore.Modules.Management; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.PostgreSql.Migrations.Management -{ - [DbContext(typeof(ManagementElsaDbContext))] - partial class ManagementElsaDbContextModelSnapshot : ModelSnapshot - { - protected override void BuildModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "8.0.12") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("Elsa.Workflows.Management.Entities.WorkflowDefinition", b => - { - b.Property("Id") - .HasColumnType("text"); - - b.Property("BinaryData") - .HasColumnType("bytea"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("Data") - .HasColumnType("text"); - - b.Property("DefinitionId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Description") - .HasColumnType("text"); - - b.Property("IsLatest") - .HasColumnType("boolean"); - - b.Property("IsPublished") - .HasColumnType("boolean"); - - b.Property("IsReadonly") - .HasColumnType("boolean"); - - b.Property("IsSystem") - .HasColumnType("boolean"); - - b.Property("MaterializerContext") - .HasColumnType("text"); - - b.Property("MaterializerName") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .HasColumnType("text"); - - b.Property("ProviderName") - .HasColumnType("text"); - - b.Property("StringData") - .HasColumnType("text"); - - b.Property("TenantId") - .HasColumnType("text"); - - b.Property("ToolVersion") - .HasColumnType("text"); - - b.Property("UsableAsActivity") - .HasColumnType("boolean"); - - b.Property("Version") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("IsLatest") - .HasDatabaseName("IX_WorkflowDefinition_IsLatest"); - - b.HasIndex("IsPublished") - .HasDatabaseName("IX_WorkflowDefinition_IsPublished"); - - b.HasIndex("IsSystem") - .HasDatabaseName("IX_WorkflowDefinition_IsSystem"); - - b.HasIndex("Name") - .HasDatabaseName("IX_WorkflowDefinition_Name"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_WorkflowDefinition_TenantId"); - - b.HasIndex("UsableAsActivity") - .HasDatabaseName("IX_WorkflowDefinition_UsableAsActivity"); - - b.HasIndex("Version") - .HasDatabaseName("IX_WorkflowDefinition_Version"); - - b.HasIndex("DefinitionId", "Version") - .IsUnique() - .HasDatabaseName("IX_WorkflowDefinition_DefinitionId_Version"); - - b.ToTable("WorkflowDefinitions", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Management.Entities.WorkflowInstance", b => - { - b.Property("Id") - .HasColumnType("text"); - - b.Property("CorrelationId") - .HasColumnType("text"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("Data") - .HasColumnType("text"); - - b.Property("DataCompressionAlgorithm") - .HasColumnType("text"); - - b.Property("DefinitionId") - .IsRequired() - .HasColumnType("text"); - - b.Property("DefinitionVersionId") - .IsRequired() - .HasColumnType("text"); - - b.Property("FinishedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("IncidentCount") - .HasColumnType("integer"); - - b.Property("IsExecuting") - .HasColumnType("boolean"); - - b.Property("IsSystem") - .HasColumnType("boolean"); - - b.Property("Name") - .HasColumnType("text"); - - b.Property("ParentWorkflowInstanceId") - .HasColumnType("text"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("SubStatus") - .IsRequired() - .HasColumnType("text"); - - b.Property("TenantId") - .HasColumnType("text"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("Version") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("CorrelationId") - .HasDatabaseName("IX_WorkflowInstance_CorrelationId"); - - b.HasIndex("CreatedAt") - .HasDatabaseName("IX_WorkflowInstance_CreatedAt"); - - b.HasIndex("DefinitionId") - .HasDatabaseName("IX_WorkflowInstance_DefinitionId"); - - b.HasIndex("FinishedAt") - .HasDatabaseName("IX_WorkflowInstance_FinishedAt"); - - b.HasIndex("IsExecuting") - .HasDatabaseName("IX_WorkflowInstance_IsExecuting"); - - b.HasIndex("IsSystem") - .HasDatabaseName("IX_WorkflowInstance_IsSystem"); - - b.HasIndex("Name") - .HasDatabaseName("IX_WorkflowInstance_Name"); - - b.HasIndex("Status") - .HasDatabaseName("IX_WorkflowInstance_Status"); - - b.HasIndex("SubStatus") - .HasDatabaseName("IX_WorkflowInstance_SubStatus"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_WorkflowInstance_TenantId"); - - b.HasIndex("UpdatedAt") - .HasDatabaseName("IX_WorkflowInstance_UpdatedAt"); - - b.HasIndex("Status", "DefinitionId") - .HasDatabaseName("IX_WorkflowInstance_Status_DefinitionId"); - - b.HasIndex("Status", "SubStatus") - .HasDatabaseName("IX_WorkflowInstance_Status_SubStatus"); - - b.HasIndex("SubStatus", "DefinitionId") - .HasDatabaseName("IX_WorkflowInstance_SubStatus_DefinitionId"); - - b.HasIndex("Status", "SubStatus", "DefinitionId", "Version") - .HasDatabaseName("IX_WorkflowInstance_Status_SubStatus_DefinitionId_Version"); - - b.ToTable("WorkflowInstances", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Runtime/20231024160952_Initial.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Runtime/20231024160952_Initial.Designer.cs deleted file mode 100644 index 8f3674159f..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Runtime/20231024160952_Initial.Designer.cs +++ /dev/null @@ -1,388 +0,0 @@ -// -using System; -using Elsa.EntityFrameworkCore.Modules.Runtime; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.PostgreSql.Migrations.Runtime -{ - [DbContext(typeof(RuntimeElsaDbContext))] - [Migration("20231024160952_Initial")] - partial class Initial - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "7.0.11") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.ActivityExecutionRecord", b => - { - b.Property("Id") - .HasColumnType("text"); - - b.Property("ActivityId") - .IsRequired() - .HasColumnType("text"); - - b.Property("ActivityName") - .HasColumnType("text"); - - b.Property("ActivityNodeId") - .IsRequired() - .HasColumnType("text"); - - b.Property("ActivityType") - .IsRequired() - .HasColumnType("text"); - - b.Property("ActivityTypeVersion") - .HasColumnType("integer"); - - b.Property("CompletedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("HasBookmarks") - .HasColumnType("boolean"); - - b.Property("SerializedActivityState") - .HasColumnType("text"); - - b.Property("SerializedException") - .HasColumnType("text"); - - b.Property("SerializedOutputs") - .HasColumnType("text"); - - b.Property("SerializedPayload") - .HasColumnType("text"); - - b.Property("StartedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("ActivityId") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityId"); - - b.HasIndex("ActivityName") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityName"); - - b.HasIndex("ActivityNodeId") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityNodeId"); - - b.HasIndex("ActivityType") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityType"); - - b.HasIndex("ActivityTypeVersion") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityTypeVersion"); - - b.HasIndex("CompletedAt") - .HasDatabaseName("IX_ActivityExecutionRecord_CompletedAt"); - - b.HasIndex("HasBookmarks") - .HasDatabaseName("IX_ActivityExecutionRecord_HasBookmarks"); - - b.HasIndex("StartedAt") - .HasDatabaseName("IX_ActivityExecutionRecord_StartedAt"); - - b.HasIndex("Status") - .HasDatabaseName("IX_ActivityExecutionRecord_Status"); - - b.HasIndex("WorkflowInstanceId") - .HasDatabaseName("IX_ActivityExecutionRecord_WorkflowInstanceId"); - - b.HasIndex("ActivityType", "ActivityTypeVersion") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityType_ActivityTypeVersion"); - - b.ToTable("ActivityExecutionRecords", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.StoredBookmark", b => - { - b.Property("BookmarkId") - .HasColumnType("text"); - - b.Property("ActivityInstanceId") - .HasColumnType("text"); - - b.Property("ActivityTypeName") - .IsRequired() - .HasColumnType("text"); - - b.Property("CorrelationId") - .HasColumnType("text"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("Hash") - .IsRequired() - .HasColumnType("text"); - - b.Property("SerializedMetadata") - .HasColumnType("text"); - - b.Property("SerializedPayload") - .HasColumnType("text"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("BookmarkId"); - - b.HasIndex(new[] { "ActivityInstanceId" }, "IX_StoredBookmark_ActivityInstanceId"); - - b.HasIndex(new[] { "ActivityTypeName" }, "IX_StoredBookmark_ActivityTypeName"); - - b.HasIndex(new[] { "ActivityTypeName", "Hash" }, "IX_StoredBookmark_ActivityTypeName_Hash"); - - b.HasIndex(new[] { "ActivityTypeName", "Hash", "WorkflowInstanceId" }, "IX_StoredBookmark_ActivityTypeName_Hash_WorkflowInstanceId"); - - b.HasIndex(new[] { "CreatedAt" }, "IX_StoredBookmark_CreatedAt"); - - b.HasIndex(new[] { "Hash" }, "IX_StoredBookmark_Hash"); - - b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_StoredBookmark_WorkflowInstanceId"); - - b.ToTable("Bookmarks", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.StoredTrigger", b => - { - b.Property("Id") - .HasColumnType("text"); - - b.Property("ActivityId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Hash") - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("SerializedPayload") - .HasColumnType("text"); - - b.Property("WorkflowDefinitionId") - .IsRequired() - .HasColumnType("text"); - - b.Property("WorkflowDefinitionVersionId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("Hash") - .HasDatabaseName("IX_StoredTrigger_Hash"); - - b.HasIndex("Name") - .HasDatabaseName("IX_StoredTrigger_Name"); - - b.HasIndex("WorkflowDefinitionId") - .HasDatabaseName("IX_StoredTrigger_WorkflowDefinitionId"); - - b.HasIndex("WorkflowDefinitionVersionId") - .HasDatabaseName("IX_StoredTrigger_WorkflowDefinitionVersionId"); - - b.ToTable("Triggers", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.WorkflowExecutionLogRecord", b => - { - b.Property("Id") - .HasColumnType("text"); - - b.Property("ActivityId") - .IsRequired() - .HasColumnType("text"); - - b.Property("ActivityInstanceId") - .IsRequired() - .HasColumnType("text"); - - b.Property("ActivityName") - .HasColumnType("text"); - - b.Property("ActivityNodeId") - .IsRequired() - .HasColumnType("text"); - - b.Property("ActivityType") - .IsRequired() - .HasColumnType("text"); - - b.Property("ActivityTypeVersion") - .HasColumnType("integer"); - - b.Property("EventName") - .HasColumnType("text"); - - b.Property("Message") - .HasColumnType("text"); - - b.Property("ParentActivityInstanceId") - .HasColumnType("text"); - - b.Property("Sequence") - .HasColumnType("bigint"); - - b.Property("SerializedActivityState") - .HasColumnType("text"); - - b.Property("SerializedPayload") - .HasColumnType("text"); - - b.Property("Source") - .HasColumnType("text"); - - b.Property("Timestamp") - .HasColumnType("timestamp with time zone"); - - b.Property("WorkflowDefinitionId") - .IsRequired() - .HasColumnType("text"); - - b.Property("WorkflowDefinitionVersionId") - .IsRequired() - .HasColumnType("text"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("text"); - - b.Property("WorkflowVersion") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("ActivityId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityId"); - - b.HasIndex("ActivityInstanceId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityInstanceId"); - - b.HasIndex("ActivityName") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityName"); - - b.HasIndex("ActivityNodeId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityNodeId"); - - b.HasIndex("ActivityType") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityType"); - - b.HasIndex("ActivityTypeVersion") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityTypeVersion"); - - b.HasIndex("EventName") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_EventName"); - - b.HasIndex("ParentActivityInstanceId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ParentActivityInstanceId"); - - b.HasIndex("Sequence") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_Sequence"); - - b.HasIndex("Timestamp") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_Timestamp"); - - b.HasIndex("WorkflowDefinitionId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowDefinitionId"); - - b.HasIndex("WorkflowDefinitionVersionId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowDefinitionVersionId"); - - b.HasIndex("WorkflowInstanceId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowInstanceId"); - - b.HasIndex("WorkflowVersion") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowVersion"); - - b.HasIndex("ActivityType", "ActivityTypeVersion") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityType_ActivityTypeVersion"); - - b.HasIndex("Timestamp", "Sequence") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_Timestamp_Sequence"); - - b.ToTable("WorkflowExecutionLogRecords", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.WorkflowInboxMessage", b => - { - b.Property("Id") - .HasColumnType("text"); - - b.Property("ActivityInstanceId") - .HasColumnType("text"); - - b.Property("ActivityTypeName") - .IsRequired() - .HasColumnType("text"); - - b.Property("CorrelationId") - .HasColumnType("text"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("ExpiresAt") - .HasColumnType("timestamp with time zone"); - - b.Property("Hash") - .IsRequired() - .HasColumnType("text"); - - b.Property("SerializedBookmarkPayload") - .HasColumnType("text"); - - b.Property("SerializedInput") - .HasColumnType("text"); - - b.Property("WorkflowInstanceId") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "ActivityInstanceId" }, "IX_WorkflowInboxMessage_ActivityInstanceId"); - - b.HasIndex(new[] { "ActivityTypeName" }, "IX_WorkflowInboxMessage_ActivityTypeName"); - - b.HasIndex(new[] { "CorrelationId" }, "IX_WorkflowInboxMessage_CorrelationId"); - - b.HasIndex(new[] { "CreatedAt" }, "IX_WorkflowInboxMessage_CreatedAt"); - - b.HasIndex(new[] { "ExpiresAt" }, "IX_WorkflowInboxMessage_ExpiresAt"); - - b.HasIndex(new[] { "Hash" }, "IX_WorkflowInboxMessage_Hash"); - - b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_WorkflowInboxMessage_WorkflowInstanceId"); - - b.ToTable("WorkflowInboxMessages", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Runtime/20231024160952_Initial.cs b/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Runtime/20231024160952_Initial.cs deleted file mode 100644 index 8412c641bb..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Runtime/20231024160952_Initial.cs +++ /dev/null @@ -1,432 +0,0 @@ -using Elsa.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.PostgreSql.Migrations.Runtime -{ - /// - public partial class Initial : Migration - { - private readonly IElsaDbContextSchema _schema; - public Initial(IElsaDbContextSchema schema) - { - _schema = schema ?? throw new ArgumentNullException(nameof(schema)); - } - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.EnsureSchema( - name: _schema.Schema); - - migrationBuilder.CreateTable( - name: "ActivityExecutionRecords", - schema: _schema.Schema, - columns: table => new - { - Id = table.Column(type: "text", nullable: false), - WorkflowInstanceId = table.Column(type: "text", nullable: false), - ActivityId = table.Column(type: "text", nullable: false), - ActivityNodeId = table.Column(type: "text", nullable: false), - ActivityType = table.Column(type: "text", nullable: false), - ActivityTypeVersion = table.Column(type: "integer", nullable: false), - ActivityName = table.Column(type: "text", nullable: true), - StartedAt = table.Column(type: "timestamp with time zone", nullable: false), - HasBookmarks = table.Column(type: "boolean", nullable: false), - Status = table.Column(type: "text", nullable: false), - CompletedAt = table.Column(type: "timestamp with time zone", nullable: true), - SerializedActivityState = table.Column(type: "text", nullable: true), - SerializedException = table.Column(type: "text", nullable: true), - SerializedOutputs = table.Column(type: "text", nullable: true), - SerializedPayload = table.Column(type: "text", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_ActivityExecutionRecords", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "Bookmarks", - schema: _schema.Schema, - columns: table => new - { - BookmarkId = table.Column(type: "text", nullable: false), - ActivityTypeName = table.Column(type: "text", nullable: false), - Hash = table.Column(type: "text", nullable: false), - WorkflowInstanceId = table.Column(type: "text", nullable: false), - ActivityInstanceId = table.Column(type: "text", nullable: true), - CorrelationId = table.Column(type: "text", nullable: true), - CreatedAt = table.Column(type: "timestamp with time zone", nullable: false), - SerializedMetadata = table.Column(type: "text", nullable: true), - SerializedPayload = table.Column(type: "text", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Bookmarks", x => x.BookmarkId); - }); - - migrationBuilder.CreateTable( - name: "Triggers", - schema: _schema.Schema, - columns: table => new - { - Id = table.Column(type: "text", nullable: false), - WorkflowDefinitionId = table.Column(type: "text", nullable: false), - WorkflowDefinitionVersionId = table.Column(type: "text", nullable: false), - Name = table.Column(type: "text", nullable: false), - ActivityId = table.Column(type: "text", nullable: false), - Hash = table.Column(type: "text", nullable: true), - SerializedPayload = table.Column(type: "text", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Triggers", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "WorkflowExecutionLogRecords", - schema: _schema.Schema, - columns: table => new - { - Id = table.Column(type: "text", nullable: false), - WorkflowDefinitionId = table.Column(type: "text", nullable: false), - WorkflowDefinitionVersionId = table.Column(type: "text", nullable: false), - WorkflowInstanceId = table.Column(type: "text", nullable: false), - WorkflowVersion = table.Column(type: "integer", nullable: false), - ActivityInstanceId = table.Column(type: "text", nullable: false), - ParentActivityInstanceId = table.Column(type: "text", nullable: true), - ActivityId = table.Column(type: "text", nullable: false), - ActivityType = table.Column(type: "text", nullable: false), - ActivityTypeVersion = table.Column(type: "integer", nullable: false), - ActivityName = table.Column(type: "text", nullable: true), - ActivityNodeId = table.Column(type: "text", nullable: false), - Timestamp = table.Column(type: "timestamp with time zone", nullable: false), - Sequence = table.Column(type: "bigint", nullable: false), - EventName = table.Column(type: "text", nullable: true), - Message = table.Column(type: "text", nullable: true), - Source = table.Column(type: "text", nullable: true), - SerializedActivityState = table.Column(type: "text", nullable: true), - SerializedPayload = table.Column(type: "text", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_WorkflowExecutionLogRecords", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "WorkflowInboxMessages", - schema: _schema.Schema, - columns: table => new - { - Id = table.Column(type: "text", nullable: false), - ActivityTypeName = table.Column(type: "text", nullable: false), - Hash = table.Column(type: "text", nullable: false), - WorkflowInstanceId = table.Column(type: "text", nullable: true), - CorrelationId = table.Column(type: "text", nullable: true), - ActivityInstanceId = table.Column(type: "text", nullable: true), - CreatedAt = table.Column(type: "timestamp with time zone", nullable: false), - ExpiresAt = table.Column(type: "timestamp with time zone", nullable: false), - SerializedBookmarkPayload = table.Column(type: "text", nullable: true), - SerializedInput = table.Column(type: "text", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_WorkflowInboxMessages", x => x.Id); - }); - - migrationBuilder.CreateIndex( - name: "IX_ActivityExecutionRecord_ActivityId", - schema: _schema.Schema, - table: "ActivityExecutionRecords", - column: "ActivityId"); - - migrationBuilder.CreateIndex( - name: "IX_ActivityExecutionRecord_ActivityName", - schema: _schema.Schema, - table: "ActivityExecutionRecords", - column: "ActivityName"); - - migrationBuilder.CreateIndex( - name: "IX_ActivityExecutionRecord_ActivityNodeId", - schema: _schema.Schema, - table: "ActivityExecutionRecords", - column: "ActivityNodeId"); - - migrationBuilder.CreateIndex( - name: "IX_ActivityExecutionRecord_ActivityType", - schema: _schema.Schema, - table: "ActivityExecutionRecords", - column: "ActivityType"); - - migrationBuilder.CreateIndex( - name: "IX_ActivityExecutionRecord_ActivityType_ActivityTypeVersion", - schema: _schema.Schema, - table: "ActivityExecutionRecords", - columns: new[] { "ActivityType", "ActivityTypeVersion" }); - - migrationBuilder.CreateIndex( - name: "IX_ActivityExecutionRecord_ActivityTypeVersion", - schema: _schema.Schema, - table: "ActivityExecutionRecords", - column: "ActivityTypeVersion"); - - migrationBuilder.CreateIndex( - name: "IX_ActivityExecutionRecord_CompletedAt", - schema: _schema.Schema, - table: "ActivityExecutionRecords", - column: "CompletedAt"); - - migrationBuilder.CreateIndex( - name: "IX_ActivityExecutionRecord_HasBookmarks", - schema: _schema.Schema, - table: "ActivityExecutionRecords", - column: "HasBookmarks"); - - migrationBuilder.CreateIndex( - name: "IX_ActivityExecutionRecord_StartedAt", - schema: _schema.Schema, - table: "ActivityExecutionRecords", - column: "StartedAt"); - - migrationBuilder.CreateIndex( - name: "IX_ActivityExecutionRecord_Status", - schema: _schema.Schema, - table: "ActivityExecutionRecords", - column: "Status"); - - migrationBuilder.CreateIndex( - name: "IX_ActivityExecutionRecord_WorkflowInstanceId", - schema: _schema.Schema, - table: "ActivityExecutionRecords", - column: "WorkflowInstanceId"); - - migrationBuilder.CreateIndex( - name: "IX_StoredBookmark_ActivityInstanceId", - schema: _schema.Schema, - table: "Bookmarks", - column: "ActivityInstanceId"); - - migrationBuilder.CreateIndex( - name: "IX_StoredBookmark_ActivityTypeName", - schema: _schema.Schema, - table: "Bookmarks", - column: "ActivityTypeName"); - - migrationBuilder.CreateIndex( - name: "IX_StoredBookmark_ActivityTypeName_Hash", - schema: _schema.Schema, - table: "Bookmarks", - columns: new[] { "ActivityTypeName", "Hash" }); - - migrationBuilder.CreateIndex( - name: "IX_StoredBookmark_ActivityTypeName_Hash_WorkflowInstanceId", - schema: _schema.Schema, - table: "Bookmarks", - columns: new[] { "ActivityTypeName", "Hash", "WorkflowInstanceId" }); - - migrationBuilder.CreateIndex( - name: "IX_StoredBookmark_CreatedAt", - schema: _schema.Schema, - table: "Bookmarks", - column: "CreatedAt"); - - migrationBuilder.CreateIndex( - name: "IX_StoredBookmark_Hash", - schema: _schema.Schema, - table: "Bookmarks", - column: "Hash"); - - migrationBuilder.CreateIndex( - name: "IX_StoredBookmark_WorkflowInstanceId", - schema: _schema.Schema, - table: "Bookmarks", - column: "WorkflowInstanceId"); - - migrationBuilder.CreateIndex( - name: "IX_StoredTrigger_Hash", - schema: _schema.Schema, - table: "Triggers", - column: "Hash"); - - migrationBuilder.CreateIndex( - name: "IX_StoredTrigger_Name", - schema: _schema.Schema, - table: "Triggers", - column: "Name"); - - migrationBuilder.CreateIndex( - name: "IX_StoredTrigger_WorkflowDefinitionId", - schema: _schema.Schema, - table: "Triggers", - column: "WorkflowDefinitionId"); - - migrationBuilder.CreateIndex( - name: "IX_StoredTrigger_WorkflowDefinitionVersionId", - schema: _schema.Schema, - table: "Triggers", - column: "WorkflowDefinitionVersionId"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowExecutionLogRecord_ActivityId", - schema: _schema.Schema, - table: "WorkflowExecutionLogRecords", - column: "ActivityId"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowExecutionLogRecord_ActivityInstanceId", - schema: _schema.Schema, - table: "WorkflowExecutionLogRecords", - column: "ActivityInstanceId"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowExecutionLogRecord_ActivityName", - schema: _schema.Schema, - table: "WorkflowExecutionLogRecords", - column: "ActivityName"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowExecutionLogRecord_ActivityNodeId", - schema: _schema.Schema, - table: "WorkflowExecutionLogRecords", - column: "ActivityNodeId"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowExecutionLogRecord_ActivityType", - schema: _schema.Schema, - table: "WorkflowExecutionLogRecords", - column: "ActivityType"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowExecutionLogRecord_ActivityType_ActivityTypeVersion", - schema: _schema.Schema, - table: "WorkflowExecutionLogRecords", - columns: new[] { "ActivityType", "ActivityTypeVersion" }); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowExecutionLogRecord_ActivityTypeVersion", - schema: _schema.Schema, - table: "WorkflowExecutionLogRecords", - column: "ActivityTypeVersion"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowExecutionLogRecord_EventName", - schema: _schema.Schema, - table: "WorkflowExecutionLogRecords", - column: "EventName"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowExecutionLogRecord_ParentActivityInstanceId", - schema: _schema.Schema, - table: "WorkflowExecutionLogRecords", - column: "ParentActivityInstanceId"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowExecutionLogRecord_Sequence", - schema: _schema.Schema, - table: "WorkflowExecutionLogRecords", - column: "Sequence"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowExecutionLogRecord_Timestamp", - schema: _schema.Schema, - table: "WorkflowExecutionLogRecords", - column: "Timestamp"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowExecutionLogRecord_Timestamp_Sequence", - schema: _schema.Schema, - table: "WorkflowExecutionLogRecords", - columns: new[] { "Timestamp", "Sequence" }); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowExecutionLogRecord_WorkflowDefinitionId", - schema: _schema.Schema, - table: "WorkflowExecutionLogRecords", - column: "WorkflowDefinitionId"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowExecutionLogRecord_WorkflowDefinitionVersionId", - schema: _schema.Schema, - table: "WorkflowExecutionLogRecords", - column: "WorkflowDefinitionVersionId"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowExecutionLogRecord_WorkflowInstanceId", - schema: _schema.Schema, - table: "WorkflowExecutionLogRecords", - column: "WorkflowInstanceId"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowExecutionLogRecord_WorkflowVersion", - schema: _schema.Schema, - table: "WorkflowExecutionLogRecords", - column: "WorkflowVersion"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowInboxMessage_ActivityInstanceId", - schema: _schema.Schema, - table: "WorkflowInboxMessages", - column: "ActivityInstanceId"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowInboxMessage_ActivityTypeName", - schema: _schema.Schema, - table: "WorkflowInboxMessages", - column: "ActivityTypeName"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowInboxMessage_CorrelationId", - schema: _schema.Schema, - table: "WorkflowInboxMessages", - column: "CorrelationId"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowInboxMessage_CreatedAt", - schema: _schema.Schema, - table: "WorkflowInboxMessages", - column: "CreatedAt"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowInboxMessage_ExpiresAt", - schema: _schema.Schema, - table: "WorkflowInboxMessages", - column: "ExpiresAt"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowInboxMessage_Hash", - schema: _schema.Schema, - table: "WorkflowInboxMessages", - column: "Hash"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowInboxMessage_WorkflowInstanceId", - schema: _schema.Schema, - table: "WorkflowInboxMessages", - column: "WorkflowInstanceId"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "ActivityExecutionRecords", - schema: _schema.Schema); - - migrationBuilder.DropTable( - name: "Bookmarks", - schema: _schema.Schema); - - migrationBuilder.DropTable( - name: "Triggers", - schema: _schema.Schema); - - migrationBuilder.DropTable( - name: "WorkflowExecutionLogRecords", - schema: _schema.Schema); - - migrationBuilder.DropTable( - name: "WorkflowInboxMessages", - schema: _schema.Schema); - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Runtime/20240329200711_V3_1.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Runtime/20240329200711_V3_1.Designer.cs deleted file mode 100644 index ff9ba2df0c..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Runtime/20240329200711_V3_1.Designer.cs +++ /dev/null @@ -1,408 +0,0 @@ -// -using System; -using Elsa.EntityFrameworkCore.Modules.Runtime; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.PostgreSql.Migrations.Runtime -{ - [DbContext(typeof(RuntimeElsaDbContext))] - [Migration("20240329200711_V3_1")] - partial class V3_1 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "7.0.14") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("Elsa.KeyValues.Entities.SerializedKeyValuePair", b => - { - b.Property("Key") - .HasColumnType("text"); - - b.Property("SerializedValue") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Key"); - - b.ToTable("KeyValuePairs", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.ActivityExecutionRecord", b => - { - b.Property("Id") - .HasColumnType("text"); - - b.Property("ActivityId") - .IsRequired() - .HasColumnType("text"); - - b.Property("ActivityName") - .HasColumnType("text"); - - b.Property("ActivityNodeId") - .IsRequired() - .HasColumnType("text"); - - b.Property("ActivityType") - .IsRequired() - .HasColumnType("text"); - - b.Property("ActivityTypeVersion") - .HasColumnType("integer"); - - b.Property("CompletedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("HasBookmarks") - .HasColumnType("boolean"); - - b.Property("SerializedActivityState") - .HasColumnType("text"); - - b.Property("SerializedActivityStateCompressionAlgorithm") - .HasColumnType("text"); - - b.Property("SerializedException") - .HasColumnType("text"); - - b.Property("SerializedOutputs") - .HasColumnType("text"); - - b.Property("SerializedPayload") - .HasColumnType("text"); - - b.Property("SerializedProperties") - .HasColumnType("text"); - - b.Property("StartedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("ActivityId") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityId"); - - b.HasIndex("ActivityName") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityName"); - - b.HasIndex("ActivityNodeId") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityNodeId"); - - b.HasIndex("ActivityType") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityType"); - - b.HasIndex("ActivityTypeVersion") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityTypeVersion"); - - b.HasIndex("CompletedAt") - .HasDatabaseName("IX_ActivityExecutionRecord_CompletedAt"); - - b.HasIndex("HasBookmarks") - .HasDatabaseName("IX_ActivityExecutionRecord_HasBookmarks"); - - b.HasIndex("StartedAt") - .HasDatabaseName("IX_ActivityExecutionRecord_StartedAt"); - - b.HasIndex("Status") - .HasDatabaseName("IX_ActivityExecutionRecord_Status"); - - b.HasIndex("WorkflowInstanceId") - .HasDatabaseName("IX_ActivityExecutionRecord_WorkflowInstanceId"); - - b.HasIndex("ActivityType", "ActivityTypeVersion") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityType_ActivityTypeVersion"); - - b.ToTable("ActivityExecutionRecords", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.StoredBookmark", b => - { - b.Property("BookmarkId") - .HasColumnType("text"); - - b.Property("ActivityInstanceId") - .HasColumnType("text"); - - b.Property("ActivityTypeName") - .IsRequired() - .HasColumnType("text"); - - b.Property("CorrelationId") - .HasColumnType("text"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("Hash") - .IsRequired() - .HasColumnType("text"); - - b.Property("SerializedMetadata") - .HasColumnType("text"); - - b.Property("SerializedPayload") - .HasColumnType("text"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("BookmarkId"); - - b.HasIndex(new[] { "ActivityInstanceId" }, "IX_StoredBookmark_ActivityInstanceId"); - - b.HasIndex(new[] { "ActivityTypeName" }, "IX_StoredBookmark_ActivityTypeName"); - - b.HasIndex(new[] { "ActivityTypeName", "Hash" }, "IX_StoredBookmark_ActivityTypeName_Hash"); - - b.HasIndex(new[] { "ActivityTypeName", "Hash", "WorkflowInstanceId" }, "IX_StoredBookmark_ActivityTypeName_Hash_WorkflowInstanceId"); - - b.HasIndex(new[] { "CreatedAt" }, "IX_StoredBookmark_CreatedAt"); - - b.HasIndex(new[] { "Hash" }, "IX_StoredBookmark_Hash"); - - b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_StoredBookmark_WorkflowInstanceId"); - - b.ToTable("Bookmarks", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.StoredTrigger", b => - { - b.Property("Id") - .HasColumnType("text"); - - b.Property("ActivityId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Hash") - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("SerializedPayload") - .HasColumnType("text"); - - b.Property("WorkflowDefinitionId") - .IsRequired() - .HasColumnType("text"); - - b.Property("WorkflowDefinitionVersionId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("Hash") - .HasDatabaseName("IX_StoredTrigger_Hash"); - - b.HasIndex("Name") - .HasDatabaseName("IX_StoredTrigger_Name"); - - b.HasIndex("WorkflowDefinitionId") - .HasDatabaseName("IX_StoredTrigger_WorkflowDefinitionId"); - - b.HasIndex("WorkflowDefinitionVersionId") - .HasDatabaseName("IX_StoredTrigger_WorkflowDefinitionVersionId"); - - b.ToTable("Triggers", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.WorkflowExecutionLogRecord", b => - { - b.Property("Id") - .HasColumnType("text"); - - b.Property("ActivityId") - .IsRequired() - .HasColumnType("text"); - - b.Property("ActivityInstanceId") - .IsRequired() - .HasColumnType("text"); - - b.Property("ActivityName") - .HasColumnType("text"); - - b.Property("ActivityNodeId") - .IsRequired() - .HasColumnType("text"); - - b.Property("ActivityType") - .IsRequired() - .HasColumnType("text"); - - b.Property("ActivityTypeVersion") - .HasColumnType("integer"); - - b.Property("EventName") - .HasColumnType("text"); - - b.Property("Message") - .HasColumnType("text"); - - b.Property("ParentActivityInstanceId") - .HasColumnType("text"); - - b.Property("Sequence") - .HasColumnType("bigint"); - - b.Property("SerializedActivityState") - .HasColumnType("text"); - - b.Property("SerializedPayload") - .HasColumnType("text"); - - b.Property("Source") - .HasColumnType("text"); - - b.Property("Timestamp") - .HasColumnType("timestamp with time zone"); - - b.Property("WorkflowDefinitionId") - .IsRequired() - .HasColumnType("text"); - - b.Property("WorkflowDefinitionVersionId") - .IsRequired() - .HasColumnType("text"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("text"); - - b.Property("WorkflowVersion") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("ActivityId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityId"); - - b.HasIndex("ActivityInstanceId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityInstanceId"); - - b.HasIndex("ActivityName") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityName"); - - b.HasIndex("ActivityNodeId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityNodeId"); - - b.HasIndex("ActivityType") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityType"); - - b.HasIndex("ActivityTypeVersion") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityTypeVersion"); - - b.HasIndex("EventName") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_EventName"); - - b.HasIndex("ParentActivityInstanceId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ParentActivityInstanceId"); - - b.HasIndex("Sequence") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_Sequence"); - - b.HasIndex("Timestamp") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_Timestamp"); - - b.HasIndex("WorkflowDefinitionId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowDefinitionId"); - - b.HasIndex("WorkflowDefinitionVersionId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowDefinitionVersionId"); - - b.HasIndex("WorkflowInstanceId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowInstanceId"); - - b.HasIndex("WorkflowVersion") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowVersion"); - - b.HasIndex("ActivityType", "ActivityTypeVersion") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityType_ActivityTypeVersion"); - - b.HasIndex("Timestamp", "Sequence") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_Timestamp_Sequence"); - - b.ToTable("WorkflowExecutionLogRecords", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.WorkflowInboxMessage", b => - { - b.Property("Id") - .HasColumnType("text"); - - b.Property("ActivityInstanceId") - .HasColumnType("text"); - - b.Property("ActivityTypeName") - .IsRequired() - .HasColumnType("text"); - - b.Property("CorrelationId") - .HasColumnType("text"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("ExpiresAt") - .HasColumnType("timestamp with time zone"); - - b.Property("Hash") - .IsRequired() - .HasColumnType("text"); - - b.Property("SerializedBookmarkPayload") - .HasColumnType("text"); - - b.Property("SerializedInput") - .HasColumnType("text"); - - b.Property("WorkflowInstanceId") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "ActivityInstanceId" }, "IX_WorkflowInboxMessage_ActivityInstanceId"); - - b.HasIndex(new[] { "ActivityTypeName" }, "IX_WorkflowInboxMessage_ActivityTypeName"); - - b.HasIndex(new[] { "CorrelationId" }, "IX_WorkflowInboxMessage_CorrelationId"); - - b.HasIndex(new[] { "CreatedAt" }, "IX_WorkflowInboxMessage_CreatedAt"); - - b.HasIndex(new[] { "ExpiresAt" }, "IX_WorkflowInboxMessage_ExpiresAt"); - - b.HasIndex(new[] { "Hash" }, "IX_WorkflowInboxMessage_Hash"); - - b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_WorkflowInboxMessage_WorkflowInstanceId"); - - b.ToTable("WorkflowInboxMessages", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Runtime/20240329200711_V3_1.cs b/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Runtime/20240329200711_V3_1.cs deleted file mode 100644 index 821d29f2e5..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Runtime/20240329200711_V3_1.cs +++ /dev/null @@ -1,67 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.PostgreSql.Migrations.Runtime -{ - /// - public partial class V3_1 : Migration - { - private readonly Elsa.EntityFrameworkCore.IElsaDbContextSchema _schema; - - /// - public V3_1(Elsa.EntityFrameworkCore.IElsaDbContextSchema schema) - { - _schema = schema; - } - - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "SerializedActivityStateCompressionAlgorithm", - schema: _schema.Schema, - table: "ActivityExecutionRecords", - type: "text", - nullable: true); - - migrationBuilder.AddColumn( - name: "SerializedProperties", - schema: _schema.Schema, - table: "ActivityExecutionRecords", - type: "text", - nullable: true); - - migrationBuilder.CreateTable( - name: "KeyValuePairs", - schema: _schema.Schema, - columns: table => new - { - Key = table.Column(type: "text", nullable: false), - SerializedValue = table.Column(type: "text", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_KeyValuePairs", x => x.Key); - }); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "KeyValuePairs", - schema: _schema.Schema); - - migrationBuilder.DropColumn( - name: "SerializedActivityStateCompressionAlgorithm", - schema: _schema.Schema, - table: "ActivityExecutionRecords"); - - migrationBuilder.DropColumn( - name: "SerializedProperties", - schema: _schema.Schema, - table: "ActivityExecutionRecords"); - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Runtime/20240610184748_V3_2.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Runtime/20240610184748_V3_2.Designer.cs deleted file mode 100644 index c9cd11aba7..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Runtime/20240610184748_V3_2.Designer.cs +++ /dev/null @@ -1,408 +0,0 @@ -// -using System; -using Elsa.EntityFrameworkCore.Modules.Runtime; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.PostgreSql.Migrations.Runtime -{ - [DbContext(typeof(RuntimeElsaDbContext))] - [Migration("20240610184748_V3_2")] - partial class V3_2 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "7.0.20") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("Elsa.KeyValues.Entities.SerializedKeyValuePair", b => - { - b.Property("Key") - .HasColumnType("text"); - - b.Property("SerializedValue") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Key"); - - b.ToTable("KeyValuePairs", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.ActivityExecutionRecord", b => - { - b.Property("Id") - .HasColumnType("text"); - - b.Property("ActivityId") - .IsRequired() - .HasColumnType("text"); - - b.Property("ActivityName") - .HasColumnType("text"); - - b.Property("ActivityNodeId") - .IsRequired() - .HasColumnType("text"); - - b.Property("ActivityType") - .IsRequired() - .HasColumnType("text"); - - b.Property("ActivityTypeVersion") - .HasColumnType("integer"); - - b.Property("CompletedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("HasBookmarks") - .HasColumnType("boolean"); - - b.Property("SerializedActivityState") - .HasColumnType("text"); - - b.Property("SerializedActivityStateCompressionAlgorithm") - .HasColumnType("text"); - - b.Property("SerializedException") - .HasColumnType("text"); - - b.Property("SerializedOutputs") - .HasColumnType("text"); - - b.Property("SerializedPayload") - .HasColumnType("text"); - - b.Property("SerializedProperties") - .HasColumnType("text"); - - b.Property("StartedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("ActivityId") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityId"); - - b.HasIndex("ActivityName") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityName"); - - b.HasIndex("ActivityNodeId") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityNodeId"); - - b.HasIndex("ActivityType") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityType"); - - b.HasIndex("ActivityTypeVersion") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityTypeVersion"); - - b.HasIndex("CompletedAt") - .HasDatabaseName("IX_ActivityExecutionRecord_CompletedAt"); - - b.HasIndex("HasBookmarks") - .HasDatabaseName("IX_ActivityExecutionRecord_HasBookmarks"); - - b.HasIndex("StartedAt") - .HasDatabaseName("IX_ActivityExecutionRecord_StartedAt"); - - b.HasIndex("Status") - .HasDatabaseName("IX_ActivityExecutionRecord_Status"); - - b.HasIndex("WorkflowInstanceId") - .HasDatabaseName("IX_ActivityExecutionRecord_WorkflowInstanceId"); - - b.HasIndex("ActivityType", "ActivityTypeVersion") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityType_ActivityTypeVersion"); - - b.ToTable("ActivityExecutionRecords", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.StoredBookmark", b => - { - b.Property("BookmarkId") - .HasColumnType("text"); - - b.Property("ActivityInstanceId") - .HasColumnType("text"); - - b.Property("ActivityTypeName") - .IsRequired() - .HasColumnType("text"); - - b.Property("CorrelationId") - .HasColumnType("text"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("Hash") - .IsRequired() - .HasColumnType("text"); - - b.Property("SerializedMetadata") - .HasColumnType("text"); - - b.Property("SerializedPayload") - .HasColumnType("text"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("BookmarkId"); - - b.HasIndex(new[] { "ActivityInstanceId" }, "IX_StoredBookmark_ActivityInstanceId"); - - b.HasIndex(new[] { "ActivityTypeName" }, "IX_StoredBookmark_ActivityTypeName"); - - b.HasIndex(new[] { "ActivityTypeName", "Hash" }, "IX_StoredBookmark_ActivityTypeName_Hash"); - - b.HasIndex(new[] { "ActivityTypeName", "Hash", "WorkflowInstanceId" }, "IX_StoredBookmark_ActivityTypeName_Hash_WorkflowInstanceId"); - - b.HasIndex(new[] { "CreatedAt" }, "IX_StoredBookmark_CreatedAt"); - - b.HasIndex(new[] { "Hash" }, "IX_StoredBookmark_Hash"); - - b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_StoredBookmark_WorkflowInstanceId"); - - b.ToTable("Bookmarks", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.StoredTrigger", b => - { - b.Property("Id") - .HasColumnType("text"); - - b.Property("ActivityId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Hash") - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("SerializedPayload") - .HasColumnType("text"); - - b.Property("WorkflowDefinitionId") - .IsRequired() - .HasColumnType("text"); - - b.Property("WorkflowDefinitionVersionId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("Hash") - .HasDatabaseName("IX_StoredTrigger_Hash"); - - b.HasIndex("Name") - .HasDatabaseName("IX_StoredTrigger_Name"); - - b.HasIndex("WorkflowDefinitionId") - .HasDatabaseName("IX_StoredTrigger_WorkflowDefinitionId"); - - b.HasIndex("WorkflowDefinitionVersionId") - .HasDatabaseName("IX_StoredTrigger_WorkflowDefinitionVersionId"); - - b.ToTable("Triggers", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.WorkflowExecutionLogRecord", b => - { - b.Property("Id") - .HasColumnType("text"); - - b.Property("ActivityId") - .IsRequired() - .HasColumnType("text"); - - b.Property("ActivityInstanceId") - .IsRequired() - .HasColumnType("text"); - - b.Property("ActivityName") - .HasColumnType("text"); - - b.Property("ActivityNodeId") - .IsRequired() - .HasColumnType("text"); - - b.Property("ActivityType") - .IsRequired() - .HasColumnType("text"); - - b.Property("ActivityTypeVersion") - .HasColumnType("integer"); - - b.Property("EventName") - .HasColumnType("text"); - - b.Property("Message") - .HasColumnType("text"); - - b.Property("ParentActivityInstanceId") - .HasColumnType("text"); - - b.Property("Sequence") - .HasColumnType("bigint"); - - b.Property("SerializedActivityState") - .HasColumnType("text"); - - b.Property("SerializedPayload") - .HasColumnType("text"); - - b.Property("Source") - .HasColumnType("text"); - - b.Property("Timestamp") - .HasColumnType("timestamp with time zone"); - - b.Property("WorkflowDefinitionId") - .IsRequired() - .HasColumnType("text"); - - b.Property("WorkflowDefinitionVersionId") - .IsRequired() - .HasColumnType("text"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("text"); - - b.Property("WorkflowVersion") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("ActivityId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityId"); - - b.HasIndex("ActivityInstanceId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityInstanceId"); - - b.HasIndex("ActivityName") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityName"); - - b.HasIndex("ActivityNodeId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityNodeId"); - - b.HasIndex("ActivityType") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityType"); - - b.HasIndex("ActivityTypeVersion") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityTypeVersion"); - - b.HasIndex("EventName") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_EventName"); - - b.HasIndex("ParentActivityInstanceId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ParentActivityInstanceId"); - - b.HasIndex("Sequence") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_Sequence"); - - b.HasIndex("Timestamp") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_Timestamp"); - - b.HasIndex("WorkflowDefinitionId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowDefinitionId"); - - b.HasIndex("WorkflowDefinitionVersionId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowDefinitionVersionId"); - - b.HasIndex("WorkflowInstanceId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowInstanceId"); - - b.HasIndex("WorkflowVersion") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowVersion"); - - b.HasIndex("ActivityType", "ActivityTypeVersion") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityType_ActivityTypeVersion"); - - b.HasIndex("Timestamp", "Sequence") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_Timestamp_Sequence"); - - b.ToTable("WorkflowExecutionLogRecords", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.WorkflowInboxMessage", b => - { - b.Property("Id") - .HasColumnType("text"); - - b.Property("ActivityInstanceId") - .HasColumnType("text"); - - b.Property("ActivityTypeName") - .IsRequired() - .HasColumnType("text"); - - b.Property("CorrelationId") - .HasColumnType("text"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("ExpiresAt") - .HasColumnType("timestamp with time zone"); - - b.Property("Hash") - .IsRequired() - .HasColumnType("text"); - - b.Property("SerializedBookmarkPayload") - .HasColumnType("text"); - - b.Property("SerializedInput") - .HasColumnType("text"); - - b.Property("WorkflowInstanceId") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "ActivityInstanceId" }, "IX_WorkflowInboxMessage_ActivityInstanceId"); - - b.HasIndex(new[] { "ActivityTypeName" }, "IX_WorkflowInboxMessage_ActivityTypeName"); - - b.HasIndex(new[] { "CorrelationId" }, "IX_WorkflowInboxMessage_CorrelationId"); - - b.HasIndex(new[] { "CreatedAt" }, "IX_WorkflowInboxMessage_CreatedAt"); - - b.HasIndex(new[] { "ExpiresAt" }, "IX_WorkflowInboxMessage_ExpiresAt"); - - b.HasIndex(new[] { "Hash" }, "IX_WorkflowInboxMessage_Hash"); - - b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_WorkflowInboxMessage_WorkflowInstanceId"); - - b.ToTable("WorkflowInboxMessages", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Runtime/20240610184748_V3_2.cs b/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Runtime/20240610184748_V3_2.cs deleted file mode 100644 index d61e4aec46..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Runtime/20240610184748_V3_2.cs +++ /dev/null @@ -1,30 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.PostgreSql.Migrations.Runtime -{ - /// - public partial class V3_2 : Migration - { - private readonly Elsa.EntityFrameworkCore.IElsaDbContextSchema _schema; - - /// - public V3_2(Elsa.EntityFrameworkCore.IElsaDbContextSchema schema) - { - _schema = schema; - } - - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Runtime/20250116192950_V3_3.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Runtime/20250116192950_V3_3.Designer.cs deleted file mode 100644 index 05fe774308..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Runtime/20250116192950_V3_3.Designer.cs +++ /dev/null @@ -1,492 +0,0 @@ -// -using System; -using Elsa.EntityFrameworkCore.Modules.Runtime; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.PostgreSql.Migrations.Runtime -{ - [DbContext(typeof(RuntimeElsaDbContext))] - [Migration("20250116192950_V3_3")] - partial class V3_3 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "8.0.11") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("Elsa.KeyValues.Entities.SerializedKeyValuePair", b => - { - b.Property("Id") - .HasColumnType("text"); - - b.Property("SerializedValue") - .IsRequired() - .HasColumnType("text"); - - b.Property("TenantId") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "TenantId" }, "IX_SerializedKeyValuePair_TenantId"); - - b.ToTable("KeyValuePairs", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.ActivityExecutionRecord", b => - { - b.Property("Id") - .HasColumnType("text"); - - b.Property("ActivityId") - .IsRequired() - .HasColumnType("text"); - - b.Property("ActivityName") - .HasColumnType("text"); - - b.Property("ActivityNodeId") - .IsRequired() - .HasColumnType("text"); - - b.Property("ActivityType") - .IsRequired() - .HasColumnType("text"); - - b.Property("ActivityTypeVersion") - .HasColumnType("integer"); - - b.Property("CompletedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("HasBookmarks") - .HasColumnType("boolean"); - - b.Property("SerializedActivityState") - .HasColumnType("text"); - - b.Property("SerializedActivityStateCompressionAlgorithm") - .HasColumnType("text"); - - b.Property("SerializedException") - .HasColumnType("text"); - - b.Property("SerializedOutputs") - .HasColumnType("text"); - - b.Property("SerializedPayload") - .HasColumnType("text"); - - b.Property("SerializedProperties") - .HasColumnType("text"); - - b.Property("StartedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("TenantId") - .HasColumnType("text"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("ActivityId") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityId"); - - b.HasIndex("ActivityName") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityName"); - - b.HasIndex("ActivityNodeId") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityNodeId"); - - b.HasIndex("ActivityType") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityType"); - - b.HasIndex("ActivityTypeVersion") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityTypeVersion"); - - b.HasIndex("CompletedAt") - .HasDatabaseName("IX_ActivityExecutionRecord_CompletedAt"); - - b.HasIndex("HasBookmarks") - .HasDatabaseName("IX_ActivityExecutionRecord_HasBookmarks"); - - b.HasIndex("StartedAt") - .HasDatabaseName("IX_ActivityExecutionRecord_StartedAt"); - - b.HasIndex("Status") - .HasDatabaseName("IX_ActivityExecutionRecord_Status"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_ActivityExecutionRecord_TenantId"); - - b.HasIndex("WorkflowInstanceId") - .HasDatabaseName("IX_ActivityExecutionRecord_WorkflowInstanceId"); - - b.HasIndex("ActivityType", "ActivityTypeVersion") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityType_ActivityTypeVersion"); - - b.ToTable("ActivityExecutionRecords", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.BookmarkQueueItem", b => - { - b.Property("Id") - .HasColumnType("text"); - - b.Property("ActivityInstanceId") - .HasColumnType("text"); - - b.Property("ActivityTypeName") - .HasColumnType("text"); - - b.Property("BookmarkId") - .HasColumnType("text"); - - b.Property("CorrelationId") - .HasColumnType("text"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("SerializedOptions") - .HasColumnType("text"); - - b.Property("StimulusHash") - .HasColumnType("text"); - - b.Property("TenantId") - .HasColumnType("text"); - - b.Property("WorkflowInstanceId") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "ActivityInstanceId" }, "IX_BookmarkQueueItem_ActivityInstanceId"); - - b.HasIndex(new[] { "ActivityTypeName" }, "IX_BookmarkQueueItem_ActivityTypeName"); - - b.HasIndex(new[] { "BookmarkId" }, "IX_BookmarkQueueItem_BookmarkId"); - - b.HasIndex(new[] { "CorrelationId" }, "IX_BookmarkQueueItem_CorrelationId"); - - b.HasIndex(new[] { "CreatedAt" }, "IX_BookmarkQueueItem_CreatedAt"); - - b.HasIndex(new[] { "StimulusHash" }, "IX_BookmarkQueueItem_StimulusHash"); - - b.HasIndex(new[] { "TenantId" }, "IX_BookmarkQueueItem_TenantId"); - - b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_BookmarkQueueItem_WorkflowInstanceId"); - - b.ToTable("BookmarkQueueItems", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.StoredBookmark", b => - { - b.Property("Id") - .HasColumnType("text"); - - b.Property("ActivityInstanceId") - .HasColumnType("text"); - - b.Property("ActivityTypeName") - .IsRequired() - .HasColumnType("text"); - - b.Property("CorrelationId") - .HasColumnType("text"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("Hash") - .IsRequired() - .HasColumnType("text"); - - b.Property("SerializedMetadata") - .HasColumnType("text"); - - b.Property("SerializedPayload") - .HasColumnType("text"); - - b.Property("TenantId") - .HasColumnType("text"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "ActivityInstanceId" }, "IX_StoredBookmark_ActivityInstanceId"); - - b.HasIndex(new[] { "ActivityTypeName" }, "IX_StoredBookmark_ActivityTypeName"); - - b.HasIndex(new[] { "ActivityTypeName", "Hash" }, "IX_StoredBookmark_ActivityTypeName_Hash"); - - b.HasIndex(new[] { "ActivityTypeName", "Hash", "WorkflowInstanceId" }, "IX_StoredBookmark_ActivityTypeName_Hash_WorkflowInstanceId"); - - b.HasIndex(new[] { "CreatedAt" }, "IX_StoredBookmark_CreatedAt"); - - b.HasIndex(new[] { "Hash" }, "IX_StoredBookmark_Hash"); - - b.HasIndex(new[] { "TenantId" }, "IX_StoredBookmark_TenantId"); - - b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_StoredBookmark_WorkflowInstanceId"); - - b.ToTable("Bookmarks", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.StoredTrigger", b => - { - b.Property("Id") - .HasColumnType("text"); - - b.Property("ActivityId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Hash") - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("SerializedPayload") - .HasColumnType("text"); - - b.Property("TenantId") - .HasColumnType("text"); - - b.Property("WorkflowDefinitionId") - .IsRequired() - .HasColumnType("text"); - - b.Property("WorkflowDefinitionVersionId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("Hash") - .HasDatabaseName("IX_StoredTrigger_Hash"); - - b.HasIndex("Name") - .HasDatabaseName("IX_StoredTrigger_Name"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_StoredTrigger_TenantId"); - - b.HasIndex("WorkflowDefinitionId") - .HasDatabaseName("IX_StoredTrigger_WorkflowDefinitionId"); - - b.HasIndex("WorkflowDefinitionVersionId") - .HasDatabaseName("IX_StoredTrigger_WorkflowDefinitionVersionId"); - - b.ToTable("Triggers", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.WorkflowExecutionLogRecord", b => - { - b.Property("Id") - .HasColumnType("text"); - - b.Property("ActivityId") - .IsRequired() - .HasColumnType("text"); - - b.Property("ActivityInstanceId") - .IsRequired() - .HasColumnType("text"); - - b.Property("ActivityName") - .HasColumnType("text"); - - b.Property("ActivityNodeId") - .IsRequired() - .HasColumnType("text"); - - b.Property("ActivityType") - .IsRequired() - .HasColumnType("text"); - - b.Property("ActivityTypeVersion") - .HasColumnType("integer"); - - b.Property("EventName") - .HasColumnType("text"); - - b.Property("Message") - .HasColumnType("text"); - - b.Property("ParentActivityInstanceId") - .HasColumnType("text"); - - b.Property("Sequence") - .HasColumnType("bigint"); - - b.Property("SerializedActivityState") - .HasColumnType("text"); - - b.Property("SerializedPayload") - .HasColumnType("text"); - - b.Property("Source") - .HasColumnType("text"); - - b.Property("TenantId") - .HasColumnType("text"); - - b.Property("Timestamp") - .HasColumnType("timestamp with time zone"); - - b.Property("WorkflowDefinitionId") - .IsRequired() - .HasColumnType("text"); - - b.Property("WorkflowDefinitionVersionId") - .IsRequired() - .HasColumnType("text"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("text"); - - b.Property("WorkflowVersion") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("ActivityId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityId"); - - b.HasIndex("ActivityInstanceId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityInstanceId"); - - b.HasIndex("ActivityName") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityName"); - - b.HasIndex("ActivityNodeId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityNodeId"); - - b.HasIndex("ActivityType") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityType"); - - b.HasIndex("ActivityTypeVersion") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityTypeVersion"); - - b.HasIndex("EventName") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_EventName"); - - b.HasIndex("ParentActivityInstanceId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ParentActivityInstanceId"); - - b.HasIndex("Sequence") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_Sequence"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_TenantId"); - - b.HasIndex("Timestamp") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_Timestamp"); - - b.HasIndex("WorkflowDefinitionId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowDefinitionId"); - - b.HasIndex("WorkflowDefinitionVersionId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowDefinitionVersionId"); - - b.HasIndex("WorkflowInstanceId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowInstanceId"); - - b.HasIndex("WorkflowVersion") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowVersion"); - - b.HasIndex("ActivityType", "ActivityTypeVersion") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityType_ActivityTypeVersion"); - - b.HasIndex("Timestamp", "Sequence") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_Timestamp_Sequence"); - - b.ToTable("WorkflowExecutionLogRecords", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.WorkflowInboxMessage", b => - { - b.Property("Id") - .HasColumnType("text"); - - b.Property("ActivityInstanceId") - .HasColumnType("text"); - - b.Property("ActivityTypeName") - .IsRequired() - .HasColumnType("text"); - - b.Property("CorrelationId") - .HasColumnType("text"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("ExpiresAt") - .HasColumnType("timestamp with time zone"); - - b.Property("Hash") - .IsRequired() - .HasColumnType("text"); - - b.Property("SerializedBookmarkPayload") - .HasColumnType("text"); - - b.Property("SerializedInput") - .HasColumnType("text"); - - b.Property("TenantId") - .HasColumnType("text"); - - b.Property("WorkflowInstanceId") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "ActivityInstanceId" }, "IX_WorkflowInboxMessage_ActivityInstanceId"); - - b.HasIndex(new[] { "ActivityTypeName" }, "IX_WorkflowInboxMessage_ActivityTypeName"); - - b.HasIndex(new[] { "CorrelationId" }, "IX_WorkflowInboxMessage_CorrelationId"); - - b.HasIndex(new[] { "CreatedAt" }, "IX_WorkflowInboxMessage_CreatedAt"); - - b.HasIndex(new[] { "ExpiresAt" }, "IX_WorkflowInboxMessage_ExpiresAt"); - - b.HasIndex(new[] { "Hash" }, "IX_WorkflowInboxMessage_Hash"); - - b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_WorkflowInboxMessage_WorkflowInstanceId"); - - b.ToTable("WorkflowInboxMessages", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Runtime/20250116192950_V3_3.cs b/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Runtime/20250116192950_V3_3.cs deleted file mode 100644 index f9b793865a..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Runtime/20250116192950_V3_3.cs +++ /dev/null @@ -1,251 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.PostgreSql.Migrations.Runtime -{ - /// - public partial class V3_3 : Migration - { - private readonly Elsa.EntityFrameworkCore.IElsaDbContextSchema _schema; - - /// - public V3_3(Elsa.EntityFrameworkCore.IElsaDbContextSchema schema) - { - _schema = schema; - } - - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.RenameColumn( - name: "Key", - schema: _schema.Schema, - table: "KeyValuePairs", - newName: "Id"); - - migrationBuilder.RenameColumn( - name: "BookmarkId", - schema: _schema.Schema, - table: "Bookmarks", - newName: "Id"); - - migrationBuilder.AddColumn( - name: "TenantId", - schema: _schema.Schema, - table: "WorkflowInboxMessages", - type: "text", - nullable: true); - - migrationBuilder.AddColumn( - name: "TenantId", - schema: _schema.Schema, - table: "WorkflowExecutionLogRecords", - type: "text", - nullable: true); - - migrationBuilder.AddColumn( - name: "TenantId", - schema: _schema.Schema, - table: "Triggers", - type: "text", - nullable: true); - - migrationBuilder.AddColumn( - name: "TenantId", - schema: _schema.Schema, - table: "KeyValuePairs", - type: "text", - nullable: true); - - migrationBuilder.AddColumn( - name: "TenantId", - schema: _schema.Schema, - table: "Bookmarks", - type: "text", - nullable: true); - - migrationBuilder.AddColumn( - name: "TenantId", - schema: _schema.Schema, - table: "ActivityExecutionRecords", - type: "text", - nullable: true); - - migrationBuilder.CreateTable( - name: "BookmarkQueueItems", - schema: _schema.Schema, - columns: table => new - { - Id = table.Column(type: "text", nullable: false), - WorkflowInstanceId = table.Column(type: "text", nullable: true), - CorrelationId = table.Column(type: "text", nullable: true), - BookmarkId = table.Column(type: "text", nullable: true), - StimulusHash = table.Column(type: "text", nullable: true), - ActivityInstanceId = table.Column(type: "text", nullable: true), - ActivityTypeName = table.Column(type: "text", nullable: true), - CreatedAt = table.Column(type: "timestamp with time zone", nullable: false), - SerializedOptions = table.Column(type: "text", nullable: true), - TenantId = table.Column(type: "text", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_BookmarkQueueItems", x => x.Id); - }); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowExecutionLogRecord_TenantId", - schema: _schema.Schema, - table: "WorkflowExecutionLogRecords", - column: "TenantId"); - - migrationBuilder.CreateIndex( - name: "IX_StoredTrigger_TenantId", - schema: _schema.Schema, - table: "Triggers", - column: "TenantId"); - - migrationBuilder.CreateIndex( - name: "IX_SerializedKeyValuePair_TenantId", - schema: _schema.Schema, - table: "KeyValuePairs", - column: "TenantId"); - - migrationBuilder.CreateIndex( - name: "IX_StoredBookmark_TenantId", - schema: _schema.Schema, - table: "Bookmarks", - column: "TenantId"); - - migrationBuilder.CreateIndex( - name: "IX_ActivityExecutionRecord_TenantId", - schema: _schema.Schema, - table: "ActivityExecutionRecords", - column: "TenantId"); - - migrationBuilder.CreateIndex( - name: "IX_BookmarkQueueItem_ActivityInstanceId", - schema: _schema.Schema, - table: "BookmarkQueueItems", - column: "ActivityInstanceId"); - - migrationBuilder.CreateIndex( - name: "IX_BookmarkQueueItem_ActivityTypeName", - schema: _schema.Schema, - table: "BookmarkQueueItems", - column: "ActivityTypeName"); - - migrationBuilder.CreateIndex( - name: "IX_BookmarkQueueItem_BookmarkId", - schema: _schema.Schema, - table: "BookmarkQueueItems", - column: "BookmarkId"); - - migrationBuilder.CreateIndex( - name: "IX_BookmarkQueueItem_CorrelationId", - schema: _schema.Schema, - table: "BookmarkQueueItems", - column: "CorrelationId"); - - migrationBuilder.CreateIndex( - name: "IX_BookmarkQueueItem_CreatedAt", - schema: _schema.Schema, - table: "BookmarkQueueItems", - column: "CreatedAt"); - - migrationBuilder.CreateIndex( - name: "IX_BookmarkQueueItem_StimulusHash", - schema: _schema.Schema, - table: "BookmarkQueueItems", - column: "StimulusHash"); - - migrationBuilder.CreateIndex( - name: "IX_BookmarkQueueItem_TenantId", - schema: _schema.Schema, - table: "BookmarkQueueItems", - column: "TenantId"); - - migrationBuilder.CreateIndex( - name: "IX_BookmarkQueueItem_WorkflowInstanceId", - schema: _schema.Schema, - table: "BookmarkQueueItems", - column: "WorkflowInstanceId"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "BookmarkQueueItems", - schema: _schema.Schema); - - migrationBuilder.DropIndex( - name: "IX_WorkflowExecutionLogRecord_TenantId", - schema: _schema.Schema, - table: "WorkflowExecutionLogRecords"); - - migrationBuilder.DropIndex( - name: "IX_StoredTrigger_TenantId", - schema: _schema.Schema, - table: "Triggers"); - - migrationBuilder.DropIndex( - name: "IX_SerializedKeyValuePair_TenantId", - schema: _schema.Schema, - table: "KeyValuePairs"); - - migrationBuilder.DropIndex( - name: "IX_StoredBookmark_TenantId", - schema: _schema.Schema, - table: "Bookmarks"); - - migrationBuilder.DropIndex( - name: "IX_ActivityExecutionRecord_TenantId", - schema: _schema.Schema, - table: "ActivityExecutionRecords"); - - migrationBuilder.DropColumn( - name: "TenantId", - schema: _schema.Schema, - table: "WorkflowInboxMessages"); - - migrationBuilder.DropColumn( - name: "TenantId", - schema: _schema.Schema, - table: "WorkflowExecutionLogRecords"); - - migrationBuilder.DropColumn( - name: "TenantId", - schema: _schema.Schema, - table: "Triggers"); - - migrationBuilder.DropColumn( - name: "TenantId", - schema: _schema.Schema, - table: "KeyValuePairs"); - - migrationBuilder.DropColumn( - name: "TenantId", - schema: _schema.Schema, - table: "Bookmarks"); - - migrationBuilder.DropColumn( - name: "TenantId", - schema: _schema.Schema, - table: "ActivityExecutionRecords"); - - migrationBuilder.RenameColumn( - name: "Id", - schema: _schema.Schema, - table: "KeyValuePairs", - newName: "Key"); - - migrationBuilder.RenameColumn( - name: "Id", - schema: _schema.Schema, - table: "Bookmarks", - newName: "BookmarkId"); - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Runtime/20250222190844_V3_4.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Runtime/20250222190844_V3_4.Designer.cs deleted file mode 100644 index 16e0b57170..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Runtime/20250222190844_V3_4.Designer.cs +++ /dev/null @@ -1,492 +0,0 @@ -// -using System; -using Elsa.EntityFrameworkCore.Modules.Runtime; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.PostgreSql.Migrations.Runtime -{ - [DbContext(typeof(RuntimeElsaDbContext))] - [Migration("20250222190844_V3_4")] - partial class V3_4 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "8.0.12") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("Elsa.KeyValues.Entities.SerializedKeyValuePair", b => - { - b.Property("Id") - .HasColumnType("text"); - - b.Property("SerializedValue") - .IsRequired() - .HasColumnType("text"); - - b.Property("TenantId") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "TenantId" }, "IX_SerializedKeyValuePair_TenantId"); - - b.ToTable("KeyValuePairs", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.ActivityExecutionRecord", b => - { - b.Property("Id") - .HasColumnType("text"); - - b.Property("ActivityId") - .IsRequired() - .HasColumnType("text"); - - b.Property("ActivityName") - .HasColumnType("text"); - - b.Property("ActivityNodeId") - .IsRequired() - .HasColumnType("text"); - - b.Property("ActivityType") - .IsRequired() - .HasColumnType("text"); - - b.Property("ActivityTypeVersion") - .HasColumnType("integer"); - - b.Property("CompletedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("HasBookmarks") - .HasColumnType("boolean"); - - b.Property("SerializedActivityState") - .HasColumnType("text"); - - b.Property("SerializedActivityStateCompressionAlgorithm") - .HasColumnType("text"); - - b.Property("SerializedException") - .HasColumnType("text"); - - b.Property("SerializedOutputs") - .HasColumnType("text"); - - b.Property("SerializedPayload") - .HasColumnType("text"); - - b.Property("SerializedProperties") - .HasColumnType("text"); - - b.Property("StartedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("TenantId") - .HasColumnType("text"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("ActivityId") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityId"); - - b.HasIndex("ActivityName") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityName"); - - b.HasIndex("ActivityNodeId") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityNodeId"); - - b.HasIndex("ActivityType") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityType"); - - b.HasIndex("ActivityTypeVersion") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityTypeVersion"); - - b.HasIndex("CompletedAt") - .HasDatabaseName("IX_ActivityExecutionRecord_CompletedAt"); - - b.HasIndex("HasBookmarks") - .HasDatabaseName("IX_ActivityExecutionRecord_HasBookmarks"); - - b.HasIndex("StartedAt") - .HasDatabaseName("IX_ActivityExecutionRecord_StartedAt"); - - b.HasIndex("Status") - .HasDatabaseName("IX_ActivityExecutionRecord_Status"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_ActivityExecutionRecord_TenantId"); - - b.HasIndex("WorkflowInstanceId") - .HasDatabaseName("IX_ActivityExecutionRecord_WorkflowInstanceId"); - - b.HasIndex("ActivityType", "ActivityTypeVersion") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityType_ActivityTypeVersion"); - - b.ToTable("ActivityExecutionRecords", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.BookmarkQueueItem", b => - { - b.Property("Id") - .HasColumnType("text"); - - b.Property("ActivityInstanceId") - .HasColumnType("text"); - - b.Property("ActivityTypeName") - .HasColumnType("text"); - - b.Property("BookmarkId") - .HasColumnType("text"); - - b.Property("CorrelationId") - .HasColumnType("text"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("SerializedOptions") - .HasColumnType("text"); - - b.Property("StimulusHash") - .HasColumnType("text"); - - b.Property("TenantId") - .HasColumnType("text"); - - b.Property("WorkflowInstanceId") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "ActivityInstanceId" }, "IX_BookmarkQueueItem_ActivityInstanceId"); - - b.HasIndex(new[] { "ActivityTypeName" }, "IX_BookmarkQueueItem_ActivityTypeName"); - - b.HasIndex(new[] { "BookmarkId" }, "IX_BookmarkQueueItem_BookmarkId"); - - b.HasIndex(new[] { "CorrelationId" }, "IX_BookmarkQueueItem_CorrelationId"); - - b.HasIndex(new[] { "CreatedAt" }, "IX_BookmarkQueueItem_CreatedAt"); - - b.HasIndex(new[] { "StimulusHash" }, "IX_BookmarkQueueItem_StimulusHash"); - - b.HasIndex(new[] { "TenantId" }, "IX_BookmarkQueueItem_TenantId"); - - b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_BookmarkQueueItem_WorkflowInstanceId"); - - b.ToTable("BookmarkQueueItems", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.StoredBookmark", b => - { - b.Property("Id") - .HasColumnType("text"); - - b.Property("ActivityInstanceId") - .HasColumnType("text"); - - b.Property("ActivityTypeName") - .IsRequired() - .HasColumnType("text"); - - b.Property("CorrelationId") - .HasColumnType("text"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("Hash") - .IsRequired() - .HasColumnType("text"); - - b.Property("SerializedMetadata") - .HasColumnType("text"); - - b.Property("SerializedPayload") - .HasColumnType("text"); - - b.Property("TenantId") - .HasColumnType("text"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "ActivityInstanceId" }, "IX_StoredBookmark_ActivityInstanceId"); - - b.HasIndex(new[] { "ActivityTypeName" }, "IX_StoredBookmark_ActivityTypeName"); - - b.HasIndex(new[] { "ActivityTypeName", "Hash" }, "IX_StoredBookmark_ActivityTypeName_Hash"); - - b.HasIndex(new[] { "ActivityTypeName", "Hash", "WorkflowInstanceId" }, "IX_StoredBookmark_ActivityTypeName_Hash_WorkflowInstanceId"); - - b.HasIndex(new[] { "CreatedAt" }, "IX_StoredBookmark_CreatedAt"); - - b.HasIndex(new[] { "Hash" }, "IX_StoredBookmark_Hash"); - - b.HasIndex(new[] { "TenantId" }, "IX_StoredBookmark_TenantId"); - - b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_StoredBookmark_WorkflowInstanceId"); - - b.ToTable("Bookmarks", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.StoredTrigger", b => - { - b.Property("Id") - .HasColumnType("text"); - - b.Property("ActivityId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Hash") - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("SerializedPayload") - .HasColumnType("text"); - - b.Property("TenantId") - .HasColumnType("text"); - - b.Property("WorkflowDefinitionId") - .IsRequired() - .HasColumnType("text"); - - b.Property("WorkflowDefinitionVersionId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("Hash") - .HasDatabaseName("IX_StoredTrigger_Hash"); - - b.HasIndex("Name") - .HasDatabaseName("IX_StoredTrigger_Name"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_StoredTrigger_TenantId"); - - b.HasIndex("WorkflowDefinitionId") - .HasDatabaseName("IX_StoredTrigger_WorkflowDefinitionId"); - - b.HasIndex("WorkflowDefinitionVersionId") - .HasDatabaseName("IX_StoredTrigger_WorkflowDefinitionVersionId"); - - b.ToTable("Triggers", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.WorkflowExecutionLogRecord", b => - { - b.Property("Id") - .HasColumnType("text"); - - b.Property("ActivityId") - .IsRequired() - .HasColumnType("text"); - - b.Property("ActivityInstanceId") - .IsRequired() - .HasColumnType("text"); - - b.Property("ActivityName") - .HasColumnType("text"); - - b.Property("ActivityNodeId") - .IsRequired() - .HasColumnType("text"); - - b.Property("ActivityType") - .IsRequired() - .HasColumnType("text"); - - b.Property("ActivityTypeVersion") - .HasColumnType("integer"); - - b.Property("EventName") - .HasColumnType("text"); - - b.Property("Message") - .HasColumnType("text"); - - b.Property("ParentActivityInstanceId") - .HasColumnType("text"); - - b.Property("Sequence") - .HasColumnType("bigint"); - - b.Property("SerializedActivityState") - .HasColumnType("text"); - - b.Property("SerializedPayload") - .HasColumnType("text"); - - b.Property("Source") - .HasColumnType("text"); - - b.Property("TenantId") - .HasColumnType("text"); - - b.Property("Timestamp") - .HasColumnType("timestamp with time zone"); - - b.Property("WorkflowDefinitionId") - .IsRequired() - .HasColumnType("text"); - - b.Property("WorkflowDefinitionVersionId") - .IsRequired() - .HasColumnType("text"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("text"); - - b.Property("WorkflowVersion") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("ActivityId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityId"); - - b.HasIndex("ActivityInstanceId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityInstanceId"); - - b.HasIndex("ActivityName") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityName"); - - b.HasIndex("ActivityNodeId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityNodeId"); - - b.HasIndex("ActivityType") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityType"); - - b.HasIndex("ActivityTypeVersion") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityTypeVersion"); - - b.HasIndex("EventName") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_EventName"); - - b.HasIndex("ParentActivityInstanceId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ParentActivityInstanceId"); - - b.HasIndex("Sequence") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_Sequence"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_TenantId"); - - b.HasIndex("Timestamp") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_Timestamp"); - - b.HasIndex("WorkflowDefinitionId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowDefinitionId"); - - b.HasIndex("WorkflowDefinitionVersionId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowDefinitionVersionId"); - - b.HasIndex("WorkflowInstanceId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowInstanceId"); - - b.HasIndex("WorkflowVersion") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowVersion"); - - b.HasIndex("ActivityType", "ActivityTypeVersion") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityType_ActivityTypeVersion"); - - b.HasIndex("Timestamp", "Sequence") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_Timestamp_Sequence"); - - b.ToTable("WorkflowExecutionLogRecords", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.WorkflowInboxMessage", b => - { - b.Property("Id") - .HasColumnType("text"); - - b.Property("ActivityInstanceId") - .HasColumnType("text"); - - b.Property("ActivityTypeName") - .IsRequired() - .HasColumnType("text"); - - b.Property("CorrelationId") - .HasColumnType("text"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("ExpiresAt") - .HasColumnType("timestamp with time zone"); - - b.Property("Hash") - .IsRequired() - .HasColumnType("text"); - - b.Property("SerializedBookmarkPayload") - .HasColumnType("text"); - - b.Property("SerializedInput") - .HasColumnType("text"); - - b.Property("TenantId") - .HasColumnType("text"); - - b.Property("WorkflowInstanceId") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "ActivityInstanceId" }, "IX_WorkflowInboxMessage_ActivityInstanceId"); - - b.HasIndex(new[] { "ActivityTypeName" }, "IX_WorkflowInboxMessage_ActivityTypeName"); - - b.HasIndex(new[] { "CorrelationId" }, "IX_WorkflowInboxMessage_CorrelationId"); - - b.HasIndex(new[] { "CreatedAt" }, "IX_WorkflowInboxMessage_CreatedAt"); - - b.HasIndex(new[] { "ExpiresAt" }, "IX_WorkflowInboxMessage_ExpiresAt"); - - b.HasIndex(new[] { "Hash" }, "IX_WorkflowInboxMessage_Hash"); - - b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_WorkflowInboxMessage_WorkflowInstanceId"); - - b.ToTable("WorkflowInboxMessages", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Runtime/20250222190844_V3_4.cs b/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Runtime/20250222190844_V3_4.cs deleted file mode 100644 index 6c834fa3de..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Runtime/20250222190844_V3_4.cs +++ /dev/null @@ -1,30 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.PostgreSql.Migrations.Runtime -{ - /// - public partial class V3_4 : Migration - { - private readonly Elsa.EntityFrameworkCore.IElsaDbContextSchema _schema; - - /// - public V3_4(Elsa.EntityFrameworkCore.IElsaDbContextSchema schema) - { - _schema = schema; - } - - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Runtime/20250401201425_V3_5.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Runtime/20250401201425_V3_5.Designer.cs deleted file mode 100644 index eda09e5422..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Runtime/20250401201425_V3_5.Designer.cs +++ /dev/null @@ -1,503 +0,0 @@ -// -using System; -using Elsa.EntityFrameworkCore.Modules.Runtime; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.PostgreSql.Migrations.Runtime -{ - [DbContext(typeof(RuntimeElsaDbContext))] - [Migration("20250401201425_V3_5")] - partial class V3_5 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "9.0.3") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("Elsa.KeyValues.Entities.SerializedKeyValuePair", b => - { - b.Property("Id") - .HasColumnType("text"); - - b.Property("SerializedValue") - .IsRequired() - .HasColumnType("text"); - - b.Property("TenantId") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "TenantId" }, "IX_SerializedKeyValuePair_TenantId"); - - b.ToTable("KeyValuePairs", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.ActivityExecutionRecord", b => - { - b.Property("Id") - .HasColumnType("text"); - - b.Property("ActivityId") - .IsRequired() - .HasColumnType("text"); - - b.Property("ActivityName") - .HasColumnType("text"); - - b.Property("ActivityNodeId") - .IsRequired() - .HasColumnType("text"); - - b.Property("ActivityType") - .IsRequired() - .HasColumnType("text"); - - b.Property("ActivityTypeVersion") - .HasColumnType("integer"); - - b.Property("AggregateFaultCount") - .HasColumnType("integer"); - - b.Property("CompletedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("HasBookmarks") - .HasColumnType("boolean"); - - b.Property("SerializedActivityState") - .HasColumnType("text"); - - b.Property("SerializedActivityStateCompressionAlgorithm") - .HasColumnType("text"); - - b.Property("SerializedException") - .HasColumnType("text"); - - b.Property("SerializedOutputs") - .HasColumnType("text"); - - b.Property("SerializedPayload") - .HasColumnType("text"); - - b.Property("SerializedProperties") - .HasColumnType("text"); - - b.Property("StartedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("TenantId") - .HasColumnType("text"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("ActivityId") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityId"); - - b.HasIndex("ActivityName") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityName"); - - b.HasIndex("ActivityNodeId") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityNodeId"); - - b.HasIndex("ActivityType") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityType"); - - b.HasIndex("ActivityTypeVersion") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityTypeVersion"); - - b.HasIndex("CompletedAt") - .HasDatabaseName("IX_ActivityExecutionRecord_CompletedAt"); - - b.HasIndex("HasBookmarks") - .HasDatabaseName("IX_ActivityExecutionRecord_HasBookmarks"); - - b.HasIndex("StartedAt") - .HasDatabaseName("IX_ActivityExecutionRecord_StartedAt"); - - b.HasIndex("Status") - .HasDatabaseName("IX_ActivityExecutionRecord_Status"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_ActivityExecutionRecord_TenantId"); - - b.HasIndex("WorkflowInstanceId") - .HasDatabaseName("IX_ActivityExecutionRecord_WorkflowInstanceId"); - - b.HasIndex("ActivityType", "ActivityTypeVersion") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityType_ActivityTypeVersion"); - - b.ToTable("ActivityExecutionRecords", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.BookmarkQueueItem", b => - { - b.Property("Id") - .HasColumnType("text"); - - b.Property("ActivityInstanceId") - .HasColumnType("text"); - - b.Property("ActivityTypeName") - .HasColumnType("text"); - - b.Property("BookmarkId") - .HasColumnType("text"); - - b.Property("CorrelationId") - .HasColumnType("text"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("SerializedOptions") - .HasColumnType("text"); - - b.Property("StimulusHash") - .HasColumnType("text"); - - b.Property("TenantId") - .HasColumnType("text"); - - b.Property("WorkflowInstanceId") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "ActivityInstanceId" }, "IX_BookmarkQueueItem_ActivityInstanceId"); - - b.HasIndex(new[] { "ActivityTypeName" }, "IX_BookmarkQueueItem_ActivityTypeName"); - - b.HasIndex(new[] { "BookmarkId" }, "IX_BookmarkQueueItem_BookmarkId"); - - b.HasIndex(new[] { "CorrelationId" }, "IX_BookmarkQueueItem_CorrelationId"); - - b.HasIndex(new[] { "CreatedAt" }, "IX_BookmarkQueueItem_CreatedAt"); - - b.HasIndex(new[] { "StimulusHash" }, "IX_BookmarkQueueItem_StimulusHash"); - - b.HasIndex(new[] { "TenantId" }, "IX_BookmarkQueueItem_TenantId"); - - b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_BookmarkQueueItem_WorkflowInstanceId"); - - b.ToTable("BookmarkQueueItems", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.StoredBookmark", b => - { - b.Property("Id") - .HasColumnType("text"); - - b.Property("ActivityInstanceId") - .HasColumnType("text"); - - b.Property("ActivityTypeName") - .IsRequired() - .HasColumnType("text"); - - b.Property("CorrelationId") - .HasColumnType("text"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("Hash") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .HasColumnType("text"); - - b.Property("SerializedMetadata") - .HasColumnType("text"); - - b.Property("SerializedPayload") - .HasColumnType("text"); - - b.Property("TenantId") - .HasColumnType("text"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "ActivityInstanceId" }, "IX_StoredBookmark_ActivityInstanceId"); - - b.HasIndex(new[] { "ActivityTypeName" }, "IX_StoredBookmark_ActivityTypeName"); - - b.HasIndex(new[] { "ActivityTypeName", "Hash" }, "IX_StoredBookmark_ActivityTypeName_Hash"); - - b.HasIndex(new[] { "ActivityTypeName", "Hash", "WorkflowInstanceId" }, "IX_StoredBookmark_ActivityTypeName_Hash_WorkflowInstanceId"); - - b.HasIndex(new[] { "CreatedAt" }, "IX_StoredBookmark_CreatedAt"); - - b.HasIndex(new[] { "Hash" }, "IX_StoredBookmark_Hash"); - - b.HasIndex(new[] { "Name" }, "IX_StoredBookmark_Name"); - - b.HasIndex(new[] { "Name", "Hash" }, "IX_StoredBookmark_Name_Hash"); - - b.HasIndex(new[] { "Name", "Hash", "WorkflowInstanceId" }, "IX_StoredBookmark_Name_Hash_WorkflowInstanceId"); - - b.HasIndex(new[] { "TenantId" }, "IX_StoredBookmark_TenantId"); - - b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_StoredBookmark_WorkflowInstanceId"); - - b.ToTable("Bookmarks", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.StoredTrigger", b => - { - b.Property("Id") - .HasColumnType("text"); - - b.Property("ActivityId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Hash") - .HasColumnType("text"); - - b.Property("Name") - .HasColumnType("text"); - - b.Property("SerializedPayload") - .HasColumnType("text"); - - b.Property("TenantId") - .HasColumnType("text"); - - b.Property("WorkflowDefinitionId") - .IsRequired() - .HasColumnType("text"); - - b.Property("WorkflowDefinitionVersionId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("Hash") - .HasDatabaseName("IX_StoredTrigger_Hash"); - - b.HasIndex("Name") - .HasDatabaseName("IX_StoredTrigger_Name"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_StoredTrigger_TenantId"); - - b.HasIndex("WorkflowDefinitionId") - .HasDatabaseName("IX_StoredTrigger_WorkflowDefinitionId"); - - b.HasIndex("WorkflowDefinitionVersionId") - .HasDatabaseName("IX_StoredTrigger_WorkflowDefinitionVersionId"); - - b.ToTable("Triggers", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.WorkflowExecutionLogRecord", b => - { - b.Property("Id") - .HasColumnType("text"); - - b.Property("ActivityId") - .IsRequired() - .HasColumnType("text"); - - b.Property("ActivityInstanceId") - .IsRequired() - .HasColumnType("text"); - - b.Property("ActivityName") - .HasColumnType("text"); - - b.Property("ActivityNodeId") - .IsRequired() - .HasColumnType("text"); - - b.Property("ActivityType") - .IsRequired() - .HasColumnType("text"); - - b.Property("ActivityTypeVersion") - .HasColumnType("integer"); - - b.Property("EventName") - .HasColumnType("text"); - - b.Property("Message") - .HasColumnType("text"); - - b.Property("ParentActivityInstanceId") - .HasColumnType("text"); - - b.Property("Sequence") - .HasColumnType("bigint"); - - b.Property("SerializedActivityState") - .HasColumnType("text"); - - b.Property("SerializedPayload") - .HasColumnType("text"); - - b.Property("Source") - .HasColumnType("text"); - - b.Property("TenantId") - .HasColumnType("text"); - - b.Property("Timestamp") - .HasColumnType("timestamp with time zone"); - - b.Property("WorkflowDefinitionId") - .IsRequired() - .HasColumnType("text"); - - b.Property("WorkflowDefinitionVersionId") - .IsRequired() - .HasColumnType("text"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("text"); - - b.Property("WorkflowVersion") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("ActivityId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityId"); - - b.HasIndex("ActivityInstanceId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityInstanceId"); - - b.HasIndex("ActivityName") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityName"); - - b.HasIndex("ActivityNodeId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityNodeId"); - - b.HasIndex("ActivityType") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityType"); - - b.HasIndex("ActivityTypeVersion") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityTypeVersion"); - - b.HasIndex("EventName") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_EventName"); - - b.HasIndex("ParentActivityInstanceId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ParentActivityInstanceId"); - - b.HasIndex("Sequence") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_Sequence"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_TenantId"); - - b.HasIndex("Timestamp") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_Timestamp"); - - b.HasIndex("WorkflowDefinitionId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowDefinitionId"); - - b.HasIndex("WorkflowDefinitionVersionId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowDefinitionVersionId"); - - b.HasIndex("WorkflowInstanceId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowInstanceId"); - - b.HasIndex("WorkflowVersion") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowVersion"); - - b.HasIndex("ActivityType", "ActivityTypeVersion") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityType_ActivityTypeVersion"); - - b.HasIndex("Timestamp", "Sequence") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_Timestamp_Sequence"); - - b.ToTable("WorkflowExecutionLogRecords", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.WorkflowInboxMessage", b => - { - b.Property("Id") - .HasColumnType("text"); - - b.Property("ActivityInstanceId") - .HasColumnType("text"); - - b.Property("ActivityTypeName") - .IsRequired() - .HasColumnType("text"); - - b.Property("CorrelationId") - .HasColumnType("text"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("ExpiresAt") - .HasColumnType("timestamp with time zone"); - - b.Property("Hash") - .IsRequired() - .HasColumnType("text"); - - b.Property("SerializedBookmarkPayload") - .HasColumnType("text"); - - b.Property("SerializedInput") - .HasColumnType("text"); - - b.Property("TenantId") - .HasColumnType("text"); - - b.Property("WorkflowInstanceId") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "ActivityInstanceId" }, "IX_WorkflowInboxMessage_ActivityInstanceId"); - - b.HasIndex(new[] { "ActivityTypeName" }, "IX_WorkflowInboxMessage_ActivityTypeName"); - - b.HasIndex(new[] { "CorrelationId" }, "IX_WorkflowInboxMessage_CorrelationId"); - - b.HasIndex(new[] { "CreatedAt" }, "IX_WorkflowInboxMessage_CreatedAt"); - - b.HasIndex(new[] { "ExpiresAt" }, "IX_WorkflowInboxMessage_ExpiresAt"); - - b.HasIndex(new[] { "Hash" }, "IX_WorkflowInboxMessage_Hash"); - - b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_WorkflowInboxMessage_WorkflowInstanceId"); - - b.ToTable("WorkflowInboxMessages", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Runtime/20250401201425_V3_5.cs b/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Runtime/20250401201425_V3_5.cs deleted file mode 100644 index 317b48ac9f..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Runtime/20250401201425_V3_5.cs +++ /dev/null @@ -1,104 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.PostgreSql.Migrations.Runtime -{ - /// - public partial class V3_5 : Migration - { - private readonly Elsa.EntityFrameworkCore.IElsaDbContextSchema _schema; - - /// - public V3_5(Elsa.EntityFrameworkCore.IElsaDbContextSchema schema) - { - _schema = schema; - } - - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AlterColumn( - name: "Name", - schema: _schema.Schema, - table: "Triggers", - type: "text", - nullable: true, - oldClrType: typeof(string), - oldType: "text"); - - migrationBuilder.AddColumn( - name: "Name", - schema: _schema.Schema, - table: "Bookmarks", - type: "text", - nullable: true); - - migrationBuilder.AddColumn( - name: "AggregateFaultCount", - schema: _schema.Schema, - table: "ActivityExecutionRecords", - type: "integer", - nullable: false, - defaultValue: 0); - - migrationBuilder.CreateIndex( - name: "IX_StoredBookmark_Name", - schema: _schema.Schema, - table: "Bookmarks", - column: "Name"); - - migrationBuilder.CreateIndex( - name: "IX_StoredBookmark_Name_Hash", - schema: _schema.Schema, - table: "Bookmarks", - columns: new[] { "Name", "Hash" }); - - migrationBuilder.CreateIndex( - name: "IX_StoredBookmark_Name_Hash_WorkflowInstanceId", - schema: _schema.Schema, - table: "Bookmarks", - columns: new[] { "Name", "Hash", "WorkflowInstanceId" }); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropIndex( - name: "IX_StoredBookmark_Name", - schema: _schema.Schema, - table: "Bookmarks"); - - migrationBuilder.DropIndex( - name: "IX_StoredBookmark_Name_Hash", - schema: _schema.Schema, - table: "Bookmarks"); - - migrationBuilder.DropIndex( - name: "IX_StoredBookmark_Name_Hash_WorkflowInstanceId", - schema: _schema.Schema, - table: "Bookmarks"); - - migrationBuilder.DropColumn( - name: "Name", - schema: _schema.Schema, - table: "Bookmarks"); - - migrationBuilder.DropColumn( - name: "AggregateFaultCount", - schema: _schema.Schema, - table: "ActivityExecutionRecords"); - - migrationBuilder.AlterColumn( - name: "Name", - schema: _schema.Schema, - table: "Triggers", - type: "text", - nullable: false, - defaultValue: "", - oldClrType: typeof(string), - oldType: "text", - oldNullable: true); - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Runtime/RuntimeElsaDbContextModelSnapshot.cs b/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Runtime/RuntimeElsaDbContextModelSnapshot.cs deleted file mode 100644 index 376e012254..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Runtime/RuntimeElsaDbContextModelSnapshot.cs +++ /dev/null @@ -1,500 +0,0 @@ -// -using System; -using Elsa.EntityFrameworkCore.Modules.Runtime; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.PostgreSql.Migrations.Runtime -{ - [DbContext(typeof(RuntimeElsaDbContext))] - partial class RuntimeElsaDbContextModelSnapshot : ModelSnapshot - { - protected override void BuildModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "9.0.3") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("Elsa.KeyValues.Entities.SerializedKeyValuePair", b => - { - b.Property("Id") - .HasColumnType("text"); - - b.Property("SerializedValue") - .IsRequired() - .HasColumnType("text"); - - b.Property("TenantId") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "TenantId" }, "IX_SerializedKeyValuePair_TenantId"); - - b.ToTable("KeyValuePairs", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.ActivityExecutionRecord", b => - { - b.Property("Id") - .HasColumnType("text"); - - b.Property("ActivityId") - .IsRequired() - .HasColumnType("text"); - - b.Property("ActivityName") - .HasColumnType("text"); - - b.Property("ActivityNodeId") - .IsRequired() - .HasColumnType("text"); - - b.Property("ActivityType") - .IsRequired() - .HasColumnType("text"); - - b.Property("ActivityTypeVersion") - .HasColumnType("integer"); - - b.Property("AggregateFaultCount") - .HasColumnType("integer"); - - b.Property("CompletedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("HasBookmarks") - .HasColumnType("boolean"); - - b.Property("SerializedActivityState") - .HasColumnType("text"); - - b.Property("SerializedActivityStateCompressionAlgorithm") - .HasColumnType("text"); - - b.Property("SerializedException") - .HasColumnType("text"); - - b.Property("SerializedOutputs") - .HasColumnType("text"); - - b.Property("SerializedPayload") - .HasColumnType("text"); - - b.Property("SerializedProperties") - .HasColumnType("text"); - - b.Property("StartedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .IsRequired() - .HasColumnType("text"); - - b.Property("TenantId") - .HasColumnType("text"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("ActivityId") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityId"); - - b.HasIndex("ActivityName") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityName"); - - b.HasIndex("ActivityNodeId") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityNodeId"); - - b.HasIndex("ActivityType") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityType"); - - b.HasIndex("ActivityTypeVersion") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityTypeVersion"); - - b.HasIndex("CompletedAt") - .HasDatabaseName("IX_ActivityExecutionRecord_CompletedAt"); - - b.HasIndex("HasBookmarks") - .HasDatabaseName("IX_ActivityExecutionRecord_HasBookmarks"); - - b.HasIndex("StartedAt") - .HasDatabaseName("IX_ActivityExecutionRecord_StartedAt"); - - b.HasIndex("Status") - .HasDatabaseName("IX_ActivityExecutionRecord_Status"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_ActivityExecutionRecord_TenantId"); - - b.HasIndex("WorkflowInstanceId") - .HasDatabaseName("IX_ActivityExecutionRecord_WorkflowInstanceId"); - - b.HasIndex("ActivityType", "ActivityTypeVersion") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityType_ActivityTypeVersion"); - - b.ToTable("ActivityExecutionRecords", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.BookmarkQueueItem", b => - { - b.Property("Id") - .HasColumnType("text"); - - b.Property("ActivityInstanceId") - .HasColumnType("text"); - - b.Property("ActivityTypeName") - .HasColumnType("text"); - - b.Property("BookmarkId") - .HasColumnType("text"); - - b.Property("CorrelationId") - .HasColumnType("text"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("SerializedOptions") - .HasColumnType("text"); - - b.Property("StimulusHash") - .HasColumnType("text"); - - b.Property("TenantId") - .HasColumnType("text"); - - b.Property("WorkflowInstanceId") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "ActivityInstanceId" }, "IX_BookmarkQueueItem_ActivityInstanceId"); - - b.HasIndex(new[] { "ActivityTypeName" }, "IX_BookmarkQueueItem_ActivityTypeName"); - - b.HasIndex(new[] { "BookmarkId" }, "IX_BookmarkQueueItem_BookmarkId"); - - b.HasIndex(new[] { "CorrelationId" }, "IX_BookmarkQueueItem_CorrelationId"); - - b.HasIndex(new[] { "CreatedAt" }, "IX_BookmarkQueueItem_CreatedAt"); - - b.HasIndex(new[] { "StimulusHash" }, "IX_BookmarkQueueItem_StimulusHash"); - - b.HasIndex(new[] { "TenantId" }, "IX_BookmarkQueueItem_TenantId"); - - b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_BookmarkQueueItem_WorkflowInstanceId"); - - b.ToTable("BookmarkQueueItems", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.StoredBookmark", b => - { - b.Property("Id") - .HasColumnType("text"); - - b.Property("ActivityInstanceId") - .HasColumnType("text"); - - b.Property("ActivityTypeName") - .IsRequired() - .HasColumnType("text"); - - b.Property("CorrelationId") - .HasColumnType("text"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("Hash") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .HasColumnType("text"); - - b.Property("SerializedMetadata") - .HasColumnType("text"); - - b.Property("SerializedPayload") - .HasColumnType("text"); - - b.Property("TenantId") - .HasColumnType("text"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "ActivityInstanceId" }, "IX_StoredBookmark_ActivityInstanceId"); - - b.HasIndex(new[] { "ActivityTypeName" }, "IX_StoredBookmark_ActivityTypeName"); - - b.HasIndex(new[] { "ActivityTypeName", "Hash" }, "IX_StoredBookmark_ActivityTypeName_Hash"); - - b.HasIndex(new[] { "ActivityTypeName", "Hash", "WorkflowInstanceId" }, "IX_StoredBookmark_ActivityTypeName_Hash_WorkflowInstanceId"); - - b.HasIndex(new[] { "CreatedAt" }, "IX_StoredBookmark_CreatedAt"); - - b.HasIndex(new[] { "Hash" }, "IX_StoredBookmark_Hash"); - - b.HasIndex(new[] { "Name" }, "IX_StoredBookmark_Name"); - - b.HasIndex(new[] { "Name", "Hash" }, "IX_StoredBookmark_Name_Hash"); - - b.HasIndex(new[] { "Name", "Hash", "WorkflowInstanceId" }, "IX_StoredBookmark_Name_Hash_WorkflowInstanceId"); - - b.HasIndex(new[] { "TenantId" }, "IX_StoredBookmark_TenantId"); - - b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_StoredBookmark_WorkflowInstanceId"); - - b.ToTable("Bookmarks", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.StoredTrigger", b => - { - b.Property("Id") - .HasColumnType("text"); - - b.Property("ActivityId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Hash") - .HasColumnType("text"); - - b.Property("Name") - .HasColumnType("text"); - - b.Property("SerializedPayload") - .HasColumnType("text"); - - b.Property("TenantId") - .HasColumnType("text"); - - b.Property("WorkflowDefinitionId") - .IsRequired() - .HasColumnType("text"); - - b.Property("WorkflowDefinitionVersionId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("Hash") - .HasDatabaseName("IX_StoredTrigger_Hash"); - - b.HasIndex("Name") - .HasDatabaseName("IX_StoredTrigger_Name"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_StoredTrigger_TenantId"); - - b.HasIndex("WorkflowDefinitionId") - .HasDatabaseName("IX_StoredTrigger_WorkflowDefinitionId"); - - b.HasIndex("WorkflowDefinitionVersionId") - .HasDatabaseName("IX_StoredTrigger_WorkflowDefinitionVersionId"); - - b.ToTable("Triggers", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.WorkflowExecutionLogRecord", b => - { - b.Property("Id") - .HasColumnType("text"); - - b.Property("ActivityId") - .IsRequired() - .HasColumnType("text"); - - b.Property("ActivityInstanceId") - .IsRequired() - .HasColumnType("text"); - - b.Property("ActivityName") - .HasColumnType("text"); - - b.Property("ActivityNodeId") - .IsRequired() - .HasColumnType("text"); - - b.Property("ActivityType") - .IsRequired() - .HasColumnType("text"); - - b.Property("ActivityTypeVersion") - .HasColumnType("integer"); - - b.Property("EventName") - .HasColumnType("text"); - - b.Property("Message") - .HasColumnType("text"); - - b.Property("ParentActivityInstanceId") - .HasColumnType("text"); - - b.Property("Sequence") - .HasColumnType("bigint"); - - b.Property("SerializedActivityState") - .HasColumnType("text"); - - b.Property("SerializedPayload") - .HasColumnType("text"); - - b.Property("Source") - .HasColumnType("text"); - - b.Property("TenantId") - .HasColumnType("text"); - - b.Property("Timestamp") - .HasColumnType("timestamp with time zone"); - - b.Property("WorkflowDefinitionId") - .IsRequired() - .HasColumnType("text"); - - b.Property("WorkflowDefinitionVersionId") - .IsRequired() - .HasColumnType("text"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("text"); - - b.Property("WorkflowVersion") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("ActivityId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityId"); - - b.HasIndex("ActivityInstanceId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityInstanceId"); - - b.HasIndex("ActivityName") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityName"); - - b.HasIndex("ActivityNodeId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityNodeId"); - - b.HasIndex("ActivityType") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityType"); - - b.HasIndex("ActivityTypeVersion") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityTypeVersion"); - - b.HasIndex("EventName") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_EventName"); - - b.HasIndex("ParentActivityInstanceId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ParentActivityInstanceId"); - - b.HasIndex("Sequence") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_Sequence"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_TenantId"); - - b.HasIndex("Timestamp") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_Timestamp"); - - b.HasIndex("WorkflowDefinitionId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowDefinitionId"); - - b.HasIndex("WorkflowDefinitionVersionId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowDefinitionVersionId"); - - b.HasIndex("WorkflowInstanceId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowInstanceId"); - - b.HasIndex("WorkflowVersion") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowVersion"); - - b.HasIndex("ActivityType", "ActivityTypeVersion") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityType_ActivityTypeVersion"); - - b.HasIndex("Timestamp", "Sequence") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_Timestamp_Sequence"); - - b.ToTable("WorkflowExecutionLogRecords", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.WorkflowInboxMessage", b => - { - b.Property("Id") - .HasColumnType("text"); - - b.Property("ActivityInstanceId") - .HasColumnType("text"); - - b.Property("ActivityTypeName") - .IsRequired() - .HasColumnType("text"); - - b.Property("CorrelationId") - .HasColumnType("text"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("ExpiresAt") - .HasColumnType("timestamp with time zone"); - - b.Property("Hash") - .IsRequired() - .HasColumnType("text"); - - b.Property("SerializedBookmarkPayload") - .HasColumnType("text"); - - b.Property("SerializedInput") - .HasColumnType("text"); - - b.Property("TenantId") - .HasColumnType("text"); - - b.Property("WorkflowInstanceId") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "ActivityInstanceId" }, "IX_WorkflowInboxMessage_ActivityInstanceId"); - - b.HasIndex(new[] { "ActivityTypeName" }, "IX_WorkflowInboxMessage_ActivityTypeName"); - - b.HasIndex(new[] { "CorrelationId" }, "IX_WorkflowInboxMessage_CorrelationId"); - - b.HasIndex(new[] { "CreatedAt" }, "IX_WorkflowInboxMessage_CreatedAt"); - - b.HasIndex(new[] { "ExpiresAt" }, "IX_WorkflowInboxMessage_ExpiresAt"); - - b.HasIndex(new[] { "Hash" }, "IX_WorkflowInboxMessage_Hash"); - - b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_WorkflowInboxMessage_WorkflowInstanceId"); - - b.ToTable("WorkflowInboxMessages", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Tenants/20241212212210_V3_3.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Tenants/20241212212210_V3_3.Designer.cs deleted file mode 100644 index 6dc5140b28..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Tenants/20241212212210_V3_3.Designer.cs +++ /dev/null @@ -1,57 +0,0 @@ -// -using Elsa.EntityFrameworkCore.Modules.Tenants; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.PostgreSql.Migrations.Tenants -{ - [DbContext(typeof(TenantsElsaDbContext))] - [Migration("20241212212210_V3_3")] - partial class V3_3 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "7.0.20") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("Elsa.Common.Multitenancy.Tenant", b => - { - b.Property("Id") - .HasColumnType("text"); - - b.Property("Configuration") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("TenantId") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .HasDatabaseName("IX_Tenant_Name"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_Tenant_TenantId"); - - b.ToTable("Tenants", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Tenants/20241212212210_V3_3.cs b/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Tenants/20241212212210_V3_3.cs deleted file mode 100644 index 6b0ed9d5ed..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Tenants/20241212212210_V3_3.cs +++ /dev/null @@ -1,60 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.PostgreSql.Migrations.Tenants -{ - /// - public partial class V3_3 : Migration - { - private readonly Elsa.EntityFrameworkCore.IElsaDbContextSchema _schema; - - /// - public V3_3(Elsa.EntityFrameworkCore.IElsaDbContextSchema schema) - { - _schema = schema; - } - - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.EnsureSchema( - name: "Elsa"); - - migrationBuilder.CreateTable( - name: "Tenants", - schema: _schema.Schema, - columns: table => new - { - Id = table.Column(type: "text", nullable: false), - Name = table.Column(type: "text", nullable: false), - Configuration = table.Column(type: "text", nullable: false), - TenantId = table.Column(type: "text", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Tenants", x => x.Id); - }); - - migrationBuilder.CreateIndex( - name: "IX_Tenant_Name", - schema: _schema.Schema, - table: "Tenants", - column: "Name"); - - migrationBuilder.CreateIndex( - name: "IX_Tenant_TenantId", - schema: _schema.Schema, - table: "Tenants", - column: "TenantId"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "Tenants", - schema: _schema.Schema); - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Tenants/20250222191022_V3_4.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Tenants/20250222191022_V3_4.Designer.cs deleted file mode 100644 index 690ac42377..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Tenants/20250222191022_V3_4.Designer.cs +++ /dev/null @@ -1,57 +0,0 @@ -// -using Elsa.EntityFrameworkCore.Modules.Tenants; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.PostgreSql.Migrations.Tenants -{ - [DbContext(typeof(TenantsElsaDbContext))] - [Migration("20250222191022_V3_4")] - partial class V3_4 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "8.0.12") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("Elsa.Common.Multitenancy.Tenant", b => - { - b.Property("Id") - .HasColumnType("text"); - - b.Property("Configuration") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("TenantId") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .HasDatabaseName("IX_Tenant_Name"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_Tenant_TenantId"); - - b.ToTable("Tenants", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Tenants/20250222191022_V3_4.cs b/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Tenants/20250222191022_V3_4.cs deleted file mode 100644 index 8974eaa773..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Tenants/20250222191022_V3_4.cs +++ /dev/null @@ -1,30 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.PostgreSql.Migrations.Tenants -{ - /// - public partial class V3_4 : Migration - { - private readonly Elsa.EntityFrameworkCore.IElsaDbContextSchema _schema; - - /// - public V3_4(Elsa.EntityFrameworkCore.IElsaDbContextSchema schema) - { - _schema = schema; - } - - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Tenants/TenantsElsaDbContextModelSnapshot.cs b/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Tenants/TenantsElsaDbContextModelSnapshot.cs deleted file mode 100644 index 4c78037376..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Migrations/Tenants/TenantsElsaDbContextModelSnapshot.cs +++ /dev/null @@ -1,54 +0,0 @@ -// -using Elsa.EntityFrameworkCore.Modules.Tenants; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.PostgreSql.Migrations.Tenants -{ - [DbContext(typeof(TenantsElsaDbContext))] - partial class TenantsElsaDbContextModelSnapshot : ModelSnapshot - { - protected override void BuildModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "8.0.12") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("Elsa.Common.Multitenancy.Tenant", b => - { - b.Property("Id") - .HasColumnType("text"); - - b.Property("Configuration") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("TenantId") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .HasDatabaseName("IX_Tenant_Name"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_Tenant_TenantId"); - - b.ToTable("Tenants", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/PostgreSqlProvidersExtensions.cs b/src/modules/Elsa.EntityFrameworkCore.PostgreSql/PostgreSqlProvidersExtensions.cs deleted file mode 100644 index 713860fd08..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/PostgreSqlProvidersExtensions.cs +++ /dev/null @@ -1,56 +0,0 @@ -using System.Reflection; -using Npgsql.EntityFrameworkCore.PostgreSQL.Infrastructure; - -// ReSharper disable once CheckNamespace -namespace Elsa.EntityFrameworkCore.Extensions; - -/// -/// Provides extensions to configure EF Core to use PostgreSQL. -/// -public static class PostgreSqlProvidersExtensions -{ - private static Assembly Assembly => typeof(PostgreSqlProvidersExtensions).Assembly; - - public static TFeature UsePostgreSql(this PersistenceFeatureBase feature, - string connectionString, - ElsaDbContextOptions? options = null, - Action? configure = null) - where TDbContext : ElsaDbContextBase - where TFeature : PersistenceFeatureBase - { - return feature.UsePostgreSql(Assembly, connectionString, options, configure); - } - - public static TFeature UsePostgreSql(this PersistenceFeatureBase feature, - Func connectionStringFunc, - ElsaDbContextOptions? options = null, - Action? configure = null) - where TDbContext : ElsaDbContextBase - where TFeature : PersistenceFeatureBase - { - return feature.UsePostgreSql(Assembly, connectionStringFunc, options, configure); - } - - public static TFeature UsePostgreSql(this PersistenceFeatureBase feature, - Assembly migrationsAssembly, - string connectionString, - ElsaDbContextOptions? options = null, - Action? configure = null) - where TDbContext : ElsaDbContextBase - where TFeature : PersistenceFeatureBase - { - return feature.UsePostgreSql(migrationsAssembly, _ => connectionString, options, configure); - } - - public static TFeature UsePostgreSql(this PersistenceFeatureBase feature, - Assembly migrationsAssembly, - Func connectionStringFunc, - ElsaDbContextOptions? options = null, - Action? configure = null) - where TDbContext : ElsaDbContextBase - where TFeature : PersistenceFeatureBase - { - feature.DbContextOptionsBuilder = (sp, db) => db.UseElsaPostgreSql(migrationsAssembly, connectionStringFunc(sp), options, configure: configure); - return (TFeature)feature; - } -} \ No newline at end of file diff --git a/src/modules/Elsa.EntityFrameworkCore.SqlServer/DbContextFactories.cs b/src/modules/Elsa.EntityFrameworkCore.SqlServer/DbContextFactories.cs deleted file mode 100644 index 389dfea6a8..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.SqlServer/DbContextFactories.cs +++ /dev/null @@ -1,40 +0,0 @@ -using Elsa.EntityFrameworkCore.Abstractions; -using Elsa.EntityFrameworkCore.Extensions; -using Elsa.EntityFrameworkCore.Modules.Alterations; -using Elsa.EntityFrameworkCore.Modules.Identity; -using Elsa.EntityFrameworkCore.Modules.Labels; -using Elsa.EntityFrameworkCore.Modules.Management; -using Elsa.EntityFrameworkCore.Modules.Runtime; -using Elsa.EntityFrameworkCore.Modules.Tenants; -using JetBrains.Annotations; -using Microsoft.EntityFrameworkCore; - -#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member - -namespace Elsa.EntityFrameworkCore.SqlServer; - -[UsedImplicitly] -public class IdentityDbContextFactory : SqlServerDesignTimeDbContextFactory; - -[UsedImplicitly] -public class ManagementDbContextFactory : SqlServerDesignTimeDbContextFactory; - -[UsedImplicitly] -public class RuntimeDbContextFactory : SqlServerDesignTimeDbContextFactory; - -[UsedImplicitly] -public class LabelsDbContextFactory : SqlServerDesignTimeDbContextFactory; - -[UsedImplicitly] -public class AlterationsDbContextFactories : SqlServerDesignTimeDbContextFactory; - -[UsedImplicitly] -public class TenantsDbContextFactories : SqlServerDesignTimeDbContextFactory; - -public class SqlServerDesignTimeDbContextFactory : DesignTimeDbContextFactoryBase where TDbContext : DbContext -{ - protected override void ConfigureBuilder(DbContextOptionsBuilder builder, string connectionString) - { - builder.UseElsaSqlServer(GetType().Assembly, connectionString); - } -} \ No newline at end of file diff --git a/src/modules/Elsa.EntityFrameworkCore.SqlServer/DbContextOptionsBuilderExtensions.cs b/src/modules/Elsa.EntityFrameworkCore.SqlServer/DbContextOptionsBuilderExtensions.cs deleted file mode 100644 index 437a7e0a25..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.SqlServer/DbContextOptionsBuilderExtensions.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System.Reflection; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; - -// ReSharper disable once CheckNamespace -namespace Elsa.EntityFrameworkCore.Extensions; - -/// -/// Contains extension methods for . -/// -public static class DbContextOptionsBuilderExtensions -{ - /// - /// Configures Entity Framework Core with SQL Server. - /// - public static DbContextOptionsBuilder UseElsaSqlServer(this DbContextOptionsBuilder builder, Assembly migrationsAssembly, string connectionString, ElsaDbContextOptions? options = default, Action? configure = default) => - builder - .UseElsaDbContextOptions(options) - .UseSqlServer(connectionString, db => - { - db - .MigrationsAssembly(options.GetMigrationsAssemblyName(migrationsAssembly)) - .MigrationsHistoryTable(options.GetMigrationsHistoryTableName(), options.GetSchemaName()); - - configure?.Invoke(db); - }); -} \ No newline at end of file diff --git a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Elsa.EntityFrameworkCore.SqlServer.csproj b/src/modules/Elsa.EntityFrameworkCore.SqlServer/Elsa.EntityFrameworkCore.SqlServer.csproj deleted file mode 100644 index 6ef2fdb1e0..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Elsa.EntityFrameworkCore.SqlServer.csproj +++ /dev/null @@ -1,19 +0,0 @@ - - - - - Provides SQL Server EF Core migrations for various modules. - - elsa module persistence efcore sqlserver - - - - - - - - - - - - \ No newline at end of file diff --git a/src/modules/Elsa.EntityFrameworkCore.SqlServer/FodyWeavers.xml b/src/modules/Elsa.EntityFrameworkCore.SqlServer/FodyWeavers.xml deleted file mode 100644 index 00e1d9a1c1..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.SqlServer/FodyWeavers.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Alterations/20231015122155_Initial.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Alterations/20231015122155_Initial.Designer.cs deleted file mode 100644 index 84e0a385e3..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Alterations/20231015122155_Initial.Designer.cs +++ /dev/null @@ -1,122 +0,0 @@ -// -using System; -using Elsa.EntityFrameworkCore.Modules.Alterations; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.SqlServer.Migrations.Alterations -{ - [DbContext(typeof(AlterationsElsaDbContext))] - [Migration("20231015122155_Initial")] - partial class Initial - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "7.0.11") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); - - modelBuilder.Entity("Elsa.Alterations.Core.Entities.AlterationJob", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("CompletedAt") - .HasColumnType("datetimeoffset"); - - b.Property("CreatedAt") - .HasColumnType("datetimeoffset"); - - b.Property("PlanId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("SerializedLog") - .HasColumnType("nvarchar(max)"); - - b.Property("StartedAt") - .HasColumnType("datetimeoffset"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("CompletedAt") - .HasDatabaseName("IX_AlterationJob_CompletedAt"); - - b.HasIndex("CreatedAt") - .HasDatabaseName("IX_AlterationJob_CreatedAt"); - - b.HasIndex("PlanId") - .HasDatabaseName("IX_AlterationJob_PlanId"); - - b.HasIndex("StartedAt") - .HasDatabaseName("IX_AlterationJob_StartedAt"); - - b.HasIndex("Status") - .HasDatabaseName("IX_AlterationJob_Status"); - - b.HasIndex("WorkflowInstanceId") - .HasDatabaseName("IX_AlterationJob_WorkflowInstanceId"); - - b.ToTable("AlterationJobs", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Alterations.Core.Entities.AlterationPlan", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("CompletedAt") - .HasColumnType("datetimeoffset"); - - b.Property("CreatedAt") - .HasColumnType("datetimeoffset"); - - b.Property("SerializedAlterations") - .HasColumnType("nvarchar(max)"); - - b.Property("SerializedWorkflowInstanceIds") - .HasColumnType("nvarchar(max)"); - - b.Property("StartedAt") - .HasColumnType("datetimeoffset"); - - b.Property("Status") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CompletedAt") - .HasDatabaseName("IX_AlterationPlan_CompletedAt"); - - b.HasIndex("CreatedAt") - .HasDatabaseName("IX_AlterationPlan_CreatedAt"); - - b.HasIndex("StartedAt") - .HasDatabaseName("IX_AlterationPlan_StartedAt"); - - b.HasIndex("Status") - .HasDatabaseName("IX_AlterationPlan_Status"); - - b.ToTable("AlterationPlans", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Alterations/20231015122155_Initial.cs b/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Alterations/20231015122155_Initial.cs deleted file mode 100644 index 704f26e3ef..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Alterations/20231015122155_Initial.cs +++ /dev/null @@ -1,132 +0,0 @@ - -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.SqlServer.Migrations.Alterations -{ - /// - public partial class Initial : Migration - { - private readonly IElsaDbContextSchema _schema; - public Initial(IElsaDbContextSchema schema) - { - _schema = schema ?? throw new ArgumentNullException(nameof(schema)); - } - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.EnsureSchema( - name: _schema.Schema); - - migrationBuilder.CreateTable( - name: "AlterationJobs", - schema: _schema.Schema, - columns: table => new - { - Id = table.Column(type: "nvarchar(450)", nullable: false), - PlanId = table.Column(type: "nvarchar(450)", nullable: false), - WorkflowInstanceId = table.Column(type: "nvarchar(450)", nullable: false), - Status = table.Column(type: "int", nullable: false), - CreatedAt = table.Column(type: "datetimeoffset", nullable: false), - StartedAt = table.Column(type: "datetimeoffset", nullable: true), - CompletedAt = table.Column(type: "datetimeoffset", nullable: true), - SerializedLog = table.Column(type: "nvarchar(max)", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_AlterationJobs", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "AlterationPlans", - schema: _schema.Schema, - columns: table => new - { - Id = table.Column(type: "nvarchar(450)", nullable: false), - Status = table.Column(type: "int", nullable: false), - CreatedAt = table.Column(type: "datetimeoffset", nullable: false), - StartedAt = table.Column(type: "datetimeoffset", nullable: true), - CompletedAt = table.Column(type: "datetimeoffset", nullable: true), - SerializedAlterations = table.Column(type: "nvarchar(max)", nullable: true), - SerializedWorkflowInstanceIds = table.Column(type: "nvarchar(max)", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_AlterationPlans", x => x.Id); - }); - - migrationBuilder.CreateIndex( - name: "IX_AlterationJob_CompletedAt", - schema: _schema.Schema, - table: "AlterationJobs", - column: "CompletedAt"); - - migrationBuilder.CreateIndex( - name: "IX_AlterationJob_CreatedAt", - schema: _schema.Schema, - table: "AlterationJobs", - column: "CreatedAt"); - - migrationBuilder.CreateIndex( - name: "IX_AlterationJob_PlanId", - schema: _schema.Schema, - table: "AlterationJobs", - column: "PlanId"); - - migrationBuilder.CreateIndex( - name: "IX_AlterationJob_StartedAt", - schema: _schema.Schema, - table: "AlterationJobs", - column: "StartedAt"); - - migrationBuilder.CreateIndex( - name: "IX_AlterationJob_Status", - schema: _schema.Schema, - table: "AlterationJobs", - column: "Status"); - - migrationBuilder.CreateIndex( - name: "IX_AlterationJob_WorkflowInstanceId", - schema: _schema.Schema, - table: "AlterationJobs", - column: "WorkflowInstanceId"); - - migrationBuilder.CreateIndex( - name: "IX_AlterationPlan_CompletedAt", - schema: _schema.Schema, - table: "AlterationPlans", - column: "CompletedAt"); - - migrationBuilder.CreateIndex( - name: "IX_AlterationPlan_CreatedAt", - schema: _schema.Schema, - table: "AlterationPlans", - column: "CreatedAt"); - - migrationBuilder.CreateIndex( - name: "IX_AlterationPlan_StartedAt", - schema: _schema.Schema, - table: "AlterationPlans", - column: "StartedAt"); - - migrationBuilder.CreateIndex( - name: "IX_AlterationPlan_Status", - schema: _schema.Schema, - table: "AlterationPlans", - column: "Status"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "AlterationJobs", - schema: _schema.Schema); - - migrationBuilder.DropTable( - name: "AlterationPlans", - schema: _schema.Schema); - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Alterations/20240329200626_V3_1.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Alterations/20240329200626_V3_1.Designer.cs deleted file mode 100644 index 4d9c32aefc..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Alterations/20240329200626_V3_1.Designer.cs +++ /dev/null @@ -1,124 +0,0 @@ -// -using System; -using Elsa.EntityFrameworkCore.Modules.Alterations; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.SqlServer.Migrations.Alterations -{ - [DbContext(typeof(AlterationsElsaDbContext))] - [Migration("20240329200626_V3_1")] - partial class V3_1 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "7.0.14") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); - - modelBuilder.Entity("Elsa.Alterations.Core.Entities.AlterationJob", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("CompletedAt") - .HasColumnType("datetimeoffset"); - - b.Property("CreatedAt") - .HasColumnType("datetimeoffset"); - - b.Property("PlanId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("SerializedLog") - .HasColumnType("nvarchar(max)"); - - b.Property("StartedAt") - .HasColumnType("datetimeoffset"); - - b.Property("Status") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("CompletedAt") - .HasDatabaseName("IX_AlterationJob_CompletedAt"); - - b.HasIndex("CreatedAt") - .HasDatabaseName("IX_AlterationJob_CreatedAt"); - - b.HasIndex("PlanId") - .HasDatabaseName("IX_AlterationJob_PlanId"); - - b.HasIndex("StartedAt") - .HasDatabaseName("IX_AlterationJob_StartedAt"); - - b.HasIndex("Status") - .HasDatabaseName("IX_AlterationJob_Status"); - - b.HasIndex("WorkflowInstanceId") - .HasDatabaseName("IX_AlterationJob_WorkflowInstanceId"); - - b.ToTable("AlterationJobs", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Alterations.Core.Entities.AlterationPlan", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("CompletedAt") - .HasColumnType("datetimeoffset"); - - b.Property("CreatedAt") - .HasColumnType("datetimeoffset"); - - b.Property("SerializedAlterations") - .HasColumnType("nvarchar(max)"); - - b.Property("SerializedWorkflowInstanceFilter") - .HasColumnType("nvarchar(max)"); - - b.Property("StartedAt") - .HasColumnType("datetimeoffset"); - - b.Property("Status") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("CompletedAt") - .HasDatabaseName("IX_AlterationPlan_CompletedAt"); - - b.HasIndex("CreatedAt") - .HasDatabaseName("IX_AlterationPlan_CreatedAt"); - - b.HasIndex("StartedAt") - .HasDatabaseName("IX_AlterationPlan_StartedAt"); - - b.HasIndex("Status") - .HasDatabaseName("IX_AlterationPlan_Status"); - - b.ToTable("AlterationPlans", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Alterations/20240329200626_V3_1.cs b/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Alterations/20240329200626_V3_1.cs deleted file mode 100644 index 6da00c13d0..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Alterations/20240329200626_V3_1.cs +++ /dev/null @@ -1,74 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.SqlServer.Migrations.Alterations -{ - /// - public partial class V3_1 : Migration - { - private readonly IElsaDbContextSchema _schema; - - /// - public V3_1(IElsaDbContextSchema schema) - { - _schema = schema; - } - - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.RenameColumn( - name: "SerializedWorkflowInstanceIds", - schema: _schema.Schema, - table: "AlterationPlans", - newName: "SerializedWorkflowInstanceFilter"); - - migrationBuilder.AlterColumn( - name: "Status", - schema: _schema.Schema, - table: "AlterationPlans", - type: "nvarchar(450)", - nullable: false, - oldClrType: typeof(int), - oldType: "int"); - - migrationBuilder.AlterColumn( - name: "Status", - schema: _schema.Schema, - table: "AlterationJobs", - type: "nvarchar(450)", - nullable: false, - oldClrType: typeof(int), - oldType: "int"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.RenameColumn( - name: "SerializedWorkflowInstanceFilter", - schema: _schema.Schema, - table: "AlterationPlans", - newName: "SerializedWorkflowInstanceIds"); - - migrationBuilder.AlterColumn( - name: "Status", - schema: _schema.Schema, - table: "AlterationPlans", - type: "int", - nullable: false, - oldClrType: typeof(string), - oldType: "nvarchar(450)"); - - migrationBuilder.AlterColumn( - name: "Status", - schema: _schema.Schema, - table: "AlterationJobs", - type: "int", - nullable: false, - oldClrType: typeof(string), - oldType: "nvarchar(450)"); - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Alterations/20240610184545_V3_2.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Alterations/20240610184545_V3_2.Designer.cs deleted file mode 100644 index bc6ee01d2f..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Alterations/20240610184545_V3_2.Designer.cs +++ /dev/null @@ -1,124 +0,0 @@ -// -using System; -using Elsa.EntityFrameworkCore.Modules.Alterations; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.SqlServer.Migrations.Alterations -{ - [DbContext(typeof(AlterationsElsaDbContext))] - [Migration("20240610184545_V3_2")] - partial class V3_2 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "7.0.20") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); - - modelBuilder.Entity("Elsa.Alterations.Core.Entities.AlterationJob", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("CompletedAt") - .HasColumnType("datetimeoffset"); - - b.Property("CreatedAt") - .HasColumnType("datetimeoffset"); - - b.Property("PlanId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("SerializedLog") - .HasColumnType("nvarchar(max)"); - - b.Property("StartedAt") - .HasColumnType("datetimeoffset"); - - b.Property("Status") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("CompletedAt") - .HasDatabaseName("IX_AlterationJob_CompletedAt"); - - b.HasIndex("CreatedAt") - .HasDatabaseName("IX_AlterationJob_CreatedAt"); - - b.HasIndex("PlanId") - .HasDatabaseName("IX_AlterationJob_PlanId"); - - b.HasIndex("StartedAt") - .HasDatabaseName("IX_AlterationJob_StartedAt"); - - b.HasIndex("Status") - .HasDatabaseName("IX_AlterationJob_Status"); - - b.HasIndex("WorkflowInstanceId") - .HasDatabaseName("IX_AlterationJob_WorkflowInstanceId"); - - b.ToTable("AlterationJobs", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Alterations.Core.Entities.AlterationPlan", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("CompletedAt") - .HasColumnType("datetimeoffset"); - - b.Property("CreatedAt") - .HasColumnType("datetimeoffset"); - - b.Property("SerializedAlterations") - .HasColumnType("nvarchar(max)"); - - b.Property("SerializedWorkflowInstanceFilter") - .HasColumnType("nvarchar(max)"); - - b.Property("StartedAt") - .HasColumnType("datetimeoffset"); - - b.Property("Status") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("CompletedAt") - .HasDatabaseName("IX_AlterationPlan_CompletedAt"); - - b.HasIndex("CreatedAt") - .HasDatabaseName("IX_AlterationPlan_CreatedAt"); - - b.HasIndex("StartedAt") - .HasDatabaseName("IX_AlterationPlan_StartedAt"); - - b.HasIndex("Status") - .HasDatabaseName("IX_AlterationPlan_Status"); - - b.ToTable("AlterationPlans", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Alterations/20240610184545_V3_2.cs b/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Alterations/20240610184545_V3_2.cs deleted file mode 100644 index 7aa2f7e996..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Alterations/20240610184545_V3_2.cs +++ /dev/null @@ -1,30 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.SqlServer.Migrations.Alterations -{ - /// - public partial class V3_2 : Migration - { - private readonly IElsaDbContextSchema _schema; - - /// - public V3_2(IElsaDbContextSchema schema) - { - _schema = schema; - } - - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Alterations/20241212211525_V3_3.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Alterations/20241212211525_V3_3.Designer.cs deleted file mode 100644 index afe651ce82..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Alterations/20241212211525_V3_3.Designer.cs +++ /dev/null @@ -1,136 +0,0 @@ -// -using System; -using Elsa.EntityFrameworkCore.Modules.Alterations; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.SqlServer.Migrations.Alterations -{ - [DbContext(typeof(AlterationsElsaDbContext))] - [Migration("20241212211525_V3_3")] - partial class V3_3 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "7.0.20") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); - - modelBuilder.Entity("Elsa.Alterations.Core.Entities.AlterationJob", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("CompletedAt") - .HasColumnType("datetimeoffset"); - - b.Property("CreatedAt") - .HasColumnType("datetimeoffset"); - - b.Property("PlanId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("SerializedLog") - .HasColumnType("nvarchar(max)"); - - b.Property("StartedAt") - .HasColumnType("datetimeoffset"); - - b.Property("Status") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("TenantId") - .HasColumnType("nvarchar(450)"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("CompletedAt") - .HasDatabaseName("IX_AlterationJob_CompletedAt"); - - b.HasIndex("CreatedAt") - .HasDatabaseName("IX_AlterationJob_CreatedAt"); - - b.HasIndex("PlanId") - .HasDatabaseName("IX_AlterationJob_PlanId"); - - b.HasIndex("StartedAt") - .HasDatabaseName("IX_AlterationJob_StartedAt"); - - b.HasIndex("Status") - .HasDatabaseName("IX_AlterationJob_Status"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_AlterationJob_TenantId"); - - b.HasIndex("WorkflowInstanceId") - .HasDatabaseName("IX_AlterationJob_WorkflowInstanceId"); - - b.ToTable("AlterationJobs", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Alterations.Core.Entities.AlterationPlan", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("CompletedAt") - .HasColumnType("datetimeoffset"); - - b.Property("CreatedAt") - .HasColumnType("datetimeoffset"); - - b.Property("SerializedAlterations") - .HasColumnType("nvarchar(max)"); - - b.Property("SerializedWorkflowInstanceFilter") - .HasColumnType("nvarchar(max)"); - - b.Property("StartedAt") - .HasColumnType("datetimeoffset"); - - b.Property("Status") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("TenantId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("CompletedAt") - .HasDatabaseName("IX_AlterationPlan_CompletedAt"); - - b.HasIndex("CreatedAt") - .HasDatabaseName("IX_AlterationPlan_CreatedAt"); - - b.HasIndex("StartedAt") - .HasDatabaseName("IX_AlterationPlan_StartedAt"); - - b.HasIndex("Status") - .HasDatabaseName("IX_AlterationPlan_Status"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_AlterationPlan_TenantId"); - - b.ToTable("AlterationPlans", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Alterations/20241212211525_V3_3.cs b/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Alterations/20241212211525_V3_3.cs deleted file mode 100644 index 02d8ae97fa..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Alterations/20241212211525_V3_3.cs +++ /dev/null @@ -1,72 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.SqlServer.Migrations.Alterations -{ - /// - public partial class V3_3 : Migration - { - private readonly Elsa.EntityFrameworkCore.IElsaDbContextSchema _schema; - - /// - public V3_3(Elsa.EntityFrameworkCore.IElsaDbContextSchema schema) - { - _schema = schema; - } - - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "TenantId", - schema: _schema.Schema, - table: "AlterationPlans", - type: "nvarchar(450)", - nullable: true); - - migrationBuilder.AddColumn( - name: "TenantId", - schema: _schema.Schema, - table: "AlterationJobs", - type: "nvarchar(450)", - nullable: true); - - migrationBuilder.CreateIndex( - name: "IX_AlterationPlan_TenantId", - schema: _schema.Schema, - table: "AlterationPlans", - column: "TenantId"); - - migrationBuilder.CreateIndex( - name: "IX_AlterationJob_TenantId", - schema: _schema.Schema, - table: "AlterationJobs", - column: "TenantId"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropIndex( - name: "IX_AlterationPlan_TenantId", - schema: _schema.Schema, - table: "AlterationPlans"); - - migrationBuilder.DropIndex( - name: "IX_AlterationJob_TenantId", - schema: _schema.Schema, - table: "AlterationJobs"); - - migrationBuilder.DropColumn( - name: "TenantId", - schema: _schema.Schema, - table: "AlterationPlans"); - - migrationBuilder.DropColumn( - name: "TenantId", - schema: _schema.Schema, - table: "AlterationJobs"); - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Alterations/20250222190810_V3_4.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Alterations/20250222190810_V3_4.Designer.cs deleted file mode 100644 index fa0c59babd..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Alterations/20250222190810_V3_4.Designer.cs +++ /dev/null @@ -1,136 +0,0 @@ -// -using System; -using Elsa.EntityFrameworkCore.Modules.Alterations; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.SqlServer.Migrations.Alterations -{ - [DbContext(typeof(AlterationsElsaDbContext))] - [Migration("20250222190810_V3_4")] - partial class V3_4 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "8.0.12") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); - - modelBuilder.Entity("Elsa.Alterations.Core.Entities.AlterationJob", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("CompletedAt") - .HasColumnType("datetimeoffset"); - - b.Property("CreatedAt") - .HasColumnType("datetimeoffset"); - - b.Property("PlanId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("SerializedLog") - .HasColumnType("nvarchar(max)"); - - b.Property("StartedAt") - .HasColumnType("datetimeoffset"); - - b.Property("Status") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("TenantId") - .HasColumnType("nvarchar(450)"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("CompletedAt") - .HasDatabaseName("IX_AlterationJob_CompletedAt"); - - b.HasIndex("CreatedAt") - .HasDatabaseName("IX_AlterationJob_CreatedAt"); - - b.HasIndex("PlanId") - .HasDatabaseName("IX_AlterationJob_PlanId"); - - b.HasIndex("StartedAt") - .HasDatabaseName("IX_AlterationJob_StartedAt"); - - b.HasIndex("Status") - .HasDatabaseName("IX_AlterationJob_Status"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_AlterationJob_TenantId"); - - b.HasIndex("WorkflowInstanceId") - .HasDatabaseName("IX_AlterationJob_WorkflowInstanceId"); - - b.ToTable("AlterationJobs", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Alterations.Core.Entities.AlterationPlan", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("CompletedAt") - .HasColumnType("datetimeoffset"); - - b.Property("CreatedAt") - .HasColumnType("datetimeoffset"); - - b.Property("SerializedAlterations") - .HasColumnType("nvarchar(max)"); - - b.Property("SerializedWorkflowInstanceFilter") - .HasColumnType("nvarchar(max)"); - - b.Property("StartedAt") - .HasColumnType("datetimeoffset"); - - b.Property("Status") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("TenantId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("CompletedAt") - .HasDatabaseName("IX_AlterationPlan_CompletedAt"); - - b.HasIndex("CreatedAt") - .HasDatabaseName("IX_AlterationPlan_CreatedAt"); - - b.HasIndex("StartedAt") - .HasDatabaseName("IX_AlterationPlan_StartedAt"); - - b.HasIndex("Status") - .HasDatabaseName("IX_AlterationPlan_Status"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_AlterationPlan_TenantId"); - - b.ToTable("AlterationPlans", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Alterations/20250222190810_V3_4.cs b/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Alterations/20250222190810_V3_4.cs deleted file mode 100644 index 6d0ee82585..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Alterations/20250222190810_V3_4.cs +++ /dev/null @@ -1,30 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.SqlServer.Migrations.Alterations -{ - /// - public partial class V3_4 : Migration - { - private readonly Elsa.EntityFrameworkCore.IElsaDbContextSchema _schema; - - /// - public V3_4(Elsa.EntityFrameworkCore.IElsaDbContextSchema schema) - { - _schema = schema; - } - - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Alterations/AlterationsElsaDbContextModelSnapshot.cs b/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Alterations/AlterationsElsaDbContextModelSnapshot.cs deleted file mode 100644 index 1f215540ba..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Alterations/AlterationsElsaDbContextModelSnapshot.cs +++ /dev/null @@ -1,133 +0,0 @@ -// -using System; -using Elsa.EntityFrameworkCore.Modules.Alterations; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.SqlServer.Migrations.Alterations -{ - [DbContext(typeof(AlterationsElsaDbContext))] - partial class AlterationsElsaDbContextModelSnapshot : ModelSnapshot - { - protected override void BuildModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "8.0.12") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); - - modelBuilder.Entity("Elsa.Alterations.Core.Entities.AlterationJob", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("CompletedAt") - .HasColumnType("datetimeoffset"); - - b.Property("CreatedAt") - .HasColumnType("datetimeoffset"); - - b.Property("PlanId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("SerializedLog") - .HasColumnType("nvarchar(max)"); - - b.Property("StartedAt") - .HasColumnType("datetimeoffset"); - - b.Property("Status") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("TenantId") - .HasColumnType("nvarchar(450)"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("CompletedAt") - .HasDatabaseName("IX_AlterationJob_CompletedAt"); - - b.HasIndex("CreatedAt") - .HasDatabaseName("IX_AlterationJob_CreatedAt"); - - b.HasIndex("PlanId") - .HasDatabaseName("IX_AlterationJob_PlanId"); - - b.HasIndex("StartedAt") - .HasDatabaseName("IX_AlterationJob_StartedAt"); - - b.HasIndex("Status") - .HasDatabaseName("IX_AlterationJob_Status"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_AlterationJob_TenantId"); - - b.HasIndex("WorkflowInstanceId") - .HasDatabaseName("IX_AlterationJob_WorkflowInstanceId"); - - b.ToTable("AlterationJobs", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Alterations.Core.Entities.AlterationPlan", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("CompletedAt") - .HasColumnType("datetimeoffset"); - - b.Property("CreatedAt") - .HasColumnType("datetimeoffset"); - - b.Property("SerializedAlterations") - .HasColumnType("nvarchar(max)"); - - b.Property("SerializedWorkflowInstanceFilter") - .HasColumnType("nvarchar(max)"); - - b.Property("StartedAt") - .HasColumnType("datetimeoffset"); - - b.Property("Status") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("TenantId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("CompletedAt") - .HasDatabaseName("IX_AlterationPlan_CompletedAt"); - - b.HasIndex("CreatedAt") - .HasDatabaseName("IX_AlterationPlan_CreatedAt"); - - b.HasIndex("StartedAt") - .HasDatabaseName("IX_AlterationPlan_StartedAt"); - - b.HasIndex("Status") - .HasDatabaseName("IX_AlterationPlan_Status"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_AlterationPlan_TenantId"); - - b.ToTable("AlterationPlans", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Identity/20231015122242_Initial.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Identity/20231015122242_Initial.Designer.cs deleted file mode 100644 index 5eb6352130..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Identity/20231015122242_Initial.Designer.cs +++ /dev/null @@ -1,131 +0,0 @@ -// -using Elsa.EntityFrameworkCore.Modules.Identity; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.SqlServer.Migrations.Identity -{ - [DbContext(typeof(IdentityElsaDbContext))] - [Migration("20231015122242_Initial")] - partial class Initial - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "7.0.11") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); - - modelBuilder.Entity("Elsa.Identity.Entities.Application", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("ClientId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("HashedApiKey") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("HashedApiKeySalt") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("HashedClientSecret") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("HashedClientSecretSalt") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("Roles") - .IsRequired() - .HasColumnType("nvarchar(max)") - .HasColumnName("Roles"); - - b.HasKey("Id"); - - b.HasIndex("ClientId") - .IsUnique() - .HasDatabaseName("IX_Application_ClientId"); - - b.HasIndex("Name") - .IsUnique() - .HasDatabaseName("IX_Application_Name"); - - b.ToTable("Applications", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Identity.Entities.Role", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("Permissions") - .IsRequired() - .HasColumnType("nvarchar(max)") - .HasColumnName("Permissions"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique() - .HasDatabaseName("IX_Role_Name"); - - b.ToTable("Roles", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Identity.Entities.User", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("HashedPassword") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("HashedPasswordSalt") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("Roles") - .IsRequired() - .HasColumnType("nvarchar(max)") - .HasColumnName("Roles"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique() - .HasDatabaseName("IX_User_Name"); - - b.ToTable("Users", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Identity/20231015122242_Initial.cs b/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Identity/20231015122242_Initial.cs deleted file mode 100644 index 9f559f2a6c..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Identity/20231015122242_Initial.cs +++ /dev/null @@ -1,116 +0,0 @@ - -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.SqlServer.Migrations.Identity -{ - /// - public partial class Initial : Migration - { - private readonly IElsaDbContextSchema _schema; - public Initial(IElsaDbContextSchema schema) - { - _schema = schema ?? throw new ArgumentNullException(nameof(schema)); - } - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.EnsureSchema( - name: _schema.Schema); - - migrationBuilder.CreateTable( - name: "Applications", - schema: _schema.Schema, - columns: table => new - { - Id = table.Column(type: "nvarchar(450)", nullable: false), - ClientId = table.Column(type: "nvarchar(450)", nullable: false), - HashedClientSecret = table.Column(type: "nvarchar(max)", nullable: false), - HashedClientSecretSalt = table.Column(type: "nvarchar(max)", nullable: false), - Name = table.Column(type: "nvarchar(450)", nullable: false), - HashedApiKey = table.Column(type: "nvarchar(max)", nullable: false), - HashedApiKeySalt = table.Column(type: "nvarchar(max)", nullable: false), - Roles = table.Column(type: "nvarchar(max)", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Applications", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "Roles", - schema: _schema.Schema, - columns: table => new - { - Id = table.Column(type: "nvarchar(450)", nullable: false), - Name = table.Column(type: "nvarchar(450)", nullable: false), - Permissions = table.Column(type: "nvarchar(max)", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Roles", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "Users", - schema: _schema.Schema, - columns: table => new - { - Id = table.Column(type: "nvarchar(450)", nullable: false), - Name = table.Column(type: "nvarchar(450)", nullable: false), - HashedPassword = table.Column(type: "nvarchar(max)", nullable: false), - HashedPasswordSalt = table.Column(type: "nvarchar(max)", nullable: false), - Roles = table.Column(type: "nvarchar(max)", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Users", x => x.Id); - }); - - migrationBuilder.CreateIndex( - name: "IX_Application_ClientId", - schema: _schema.Schema, - table: "Applications", - column: "ClientId", - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_Application_Name", - schema: _schema.Schema, - table: "Applications", - column: "Name", - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_Role_Name", - schema: _schema.Schema, - table: "Roles", - column: "Name", - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_User_Name", - schema: _schema.Schema, - table: "Users", - column: "Name", - unique: true); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "Applications", - schema: _schema.Schema); - - migrationBuilder.DropTable( - name: "Roles", - schema: _schema.Schema); - - migrationBuilder.DropTable( - name: "Users", - schema: _schema.Schema); - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Identity/20240329200753_V3_1.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Identity/20240329200753_V3_1.Designer.cs deleted file mode 100644 index 0322db1ab3..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Identity/20240329200753_V3_1.Designer.cs +++ /dev/null @@ -1,131 +0,0 @@ -// -using Elsa.EntityFrameworkCore.Modules.Identity; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.SqlServer.Migrations.Identity -{ - [DbContext(typeof(IdentityElsaDbContext))] - [Migration("20240329200753_V3_1")] - partial class V3_1 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "7.0.14") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); - - modelBuilder.Entity("Elsa.Identity.Entities.Application", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("ClientId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("HashedApiKey") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("HashedApiKeySalt") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("HashedClientSecret") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("HashedClientSecretSalt") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("Roles") - .IsRequired() - .HasColumnType("nvarchar(max)") - .HasColumnName("Roles"); - - b.HasKey("Id"); - - b.HasIndex("ClientId") - .IsUnique() - .HasDatabaseName("IX_Application_ClientId"); - - b.HasIndex("Name") - .IsUnique() - .HasDatabaseName("IX_Application_Name"); - - b.ToTable("Applications", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Identity.Entities.Role", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("Permissions") - .IsRequired() - .HasColumnType("nvarchar(max)") - .HasColumnName("Permissions"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique() - .HasDatabaseName("IX_Role_Name"); - - b.ToTable("Roles", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Identity.Entities.User", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("HashedPassword") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("HashedPasswordSalt") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("Roles") - .IsRequired() - .HasColumnType("nvarchar(max)") - .HasColumnName("Roles"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique() - .HasDatabaseName("IX_User_Name"); - - b.ToTable("Users", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Identity/20240329200753_V3_1.cs b/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Identity/20240329200753_V3_1.cs deleted file mode 100644 index 651a17c81f..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Identity/20240329200753_V3_1.cs +++ /dev/null @@ -1,30 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.SqlServer.Migrations.Identity -{ - /// - public partial class V3_1 : Migration - { - private readonly IElsaDbContextSchema _schema; - - /// - public V3_1(IElsaDbContextSchema schema) - { - _schema = schema; - } - - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Identity/20240610184919_V3_2.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Identity/20240610184919_V3_2.Designer.cs deleted file mode 100644 index 0ba11aa949..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Identity/20240610184919_V3_2.Designer.cs +++ /dev/null @@ -1,131 +0,0 @@ -// -using Elsa.EntityFrameworkCore.Modules.Identity; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.SqlServer.Migrations.Identity -{ - [DbContext(typeof(IdentityElsaDbContext))] - [Migration("20240610184919_V3_2")] - partial class V3_2 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "7.0.20") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); - - modelBuilder.Entity("Elsa.Identity.Entities.Application", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("ClientId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("HashedApiKey") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("HashedApiKeySalt") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("HashedClientSecret") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("HashedClientSecretSalt") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("Roles") - .IsRequired() - .HasColumnType("nvarchar(max)") - .HasColumnName("Roles"); - - b.HasKey("Id"); - - b.HasIndex("ClientId") - .IsUnique() - .HasDatabaseName("IX_Application_ClientId"); - - b.HasIndex("Name") - .IsUnique() - .HasDatabaseName("IX_Application_Name"); - - b.ToTable("Applications", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Identity.Entities.Role", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("Permissions") - .IsRequired() - .HasColumnType("nvarchar(max)") - .HasColumnName("Permissions"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique() - .HasDatabaseName("IX_Role_Name"); - - b.ToTable("Roles", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Identity.Entities.User", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("HashedPassword") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("HashedPasswordSalt") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("Roles") - .IsRequired() - .HasColumnType("nvarchar(max)") - .HasColumnName("Roles"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique() - .HasDatabaseName("IX_User_Name"); - - b.ToTable("Users", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Identity/20240610184919_V3_2.cs b/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Identity/20240610184919_V3_2.cs deleted file mode 100644 index f174820f57..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Identity/20240610184919_V3_2.cs +++ /dev/null @@ -1,30 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.SqlServer.Migrations.Identity -{ - /// - public partial class V3_2 : Migration - { - private readonly IElsaDbContextSchema _schema; - - /// - public V3_2(IElsaDbContextSchema schema) - { - _schema = schema; - } - - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Identity/20241212211838_V3_3.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Identity/20241212211838_V3_3.Designer.cs deleted file mode 100644 index 1e25ad180e..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Identity/20241212211838_V3_3.Designer.cs +++ /dev/null @@ -1,149 +0,0 @@ -// -using Elsa.EntityFrameworkCore.Modules.Identity; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.SqlServer.Migrations.Identity -{ - [DbContext(typeof(IdentityElsaDbContext))] - [Migration("20241212211838_V3_3")] - partial class V3_3 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "7.0.20") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); - - modelBuilder.Entity("Elsa.Identity.Entities.Application", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("ClientId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("HashedApiKey") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("HashedApiKeySalt") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("HashedClientSecret") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("HashedClientSecretSalt") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("Roles") - .IsRequired() - .HasColumnType("nvarchar(max)") - .HasColumnName("Roles"); - - b.Property("TenantId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("ClientId") - .IsUnique() - .HasDatabaseName("IX_Application_ClientId"); - - b.HasIndex("Name") - .IsUnique() - .HasDatabaseName("IX_Application_Name"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_Application_TenantId"); - - b.ToTable("Applications", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Identity.Entities.Role", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("Permissions") - .IsRequired() - .HasColumnType("nvarchar(max)") - .HasColumnName("Permissions"); - - b.Property("TenantId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique() - .HasDatabaseName("IX_Role_Name"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_Role_TenantId"); - - b.ToTable("Roles", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Identity.Entities.User", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("HashedPassword") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("HashedPasswordSalt") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("Roles") - .IsRequired() - .HasColumnType("nvarchar(max)") - .HasColumnName("Roles"); - - b.Property("TenantId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique() - .HasDatabaseName("IX_User_Name"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_User_TenantId"); - - b.ToTable("Users", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Identity/20241212211838_V3_3.cs b/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Identity/20241212211838_V3_3.cs deleted file mode 100644 index 52d7f27ead..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Identity/20241212211838_V3_3.cs +++ /dev/null @@ -1,95 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.SqlServer.Migrations.Identity -{ - /// - public partial class V3_3 : Migration - { - private readonly Elsa.EntityFrameworkCore.IElsaDbContextSchema _schema; - - /// - public V3_3(Elsa.EntityFrameworkCore.IElsaDbContextSchema schema) - { - _schema = schema; - } - - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "TenantId", - schema: _schema.Schema, - table: "Users", - type: "nvarchar(450)", - nullable: true); - - migrationBuilder.AddColumn( - name: "TenantId", - schema: _schema.Schema, - table: "Roles", - type: "nvarchar(450)", - nullable: true); - - migrationBuilder.AddColumn( - name: "TenantId", - schema: _schema.Schema, - table: "Applications", - type: "nvarchar(450)", - nullable: true); - - migrationBuilder.CreateIndex( - name: "IX_User_TenantId", - schema: _schema.Schema, - table: "Users", - column: "TenantId"); - - migrationBuilder.CreateIndex( - name: "IX_Role_TenantId", - schema: _schema.Schema, - table: "Roles", - column: "TenantId"); - - migrationBuilder.CreateIndex( - name: "IX_Application_TenantId", - schema: _schema.Schema, - table: "Applications", - column: "TenantId"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropIndex( - name: "IX_User_TenantId", - schema: _schema.Schema, - table: "Users"); - - migrationBuilder.DropIndex( - name: "IX_Role_TenantId", - schema: _schema.Schema, - table: "Roles"); - - migrationBuilder.DropIndex( - name: "IX_Application_TenantId", - schema: _schema.Schema, - table: "Applications"); - - migrationBuilder.DropColumn( - name: "TenantId", - schema: _schema.Schema, - table: "Users"); - - migrationBuilder.DropColumn( - name: "TenantId", - schema: _schema.Schema, - table: "Roles"); - - migrationBuilder.DropColumn( - name: "TenantId", - schema: _schema.Schema, - table: "Applications"); - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Identity/20250222190919_V3_4.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Identity/20250222190919_V3_4.Designer.cs deleted file mode 100644 index f5e7d9efd5..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Identity/20250222190919_V3_4.Designer.cs +++ /dev/null @@ -1,149 +0,0 @@ -// -using Elsa.EntityFrameworkCore.Modules.Identity; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.SqlServer.Migrations.Identity -{ - [DbContext(typeof(IdentityElsaDbContext))] - [Migration("20250222190919_V3_4")] - partial class V3_4 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "8.0.12") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); - - modelBuilder.Entity("Elsa.Identity.Entities.Application", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("ClientId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("HashedApiKey") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("HashedApiKeySalt") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("HashedClientSecret") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("HashedClientSecretSalt") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("Roles") - .IsRequired() - .HasColumnType("nvarchar(max)") - .HasColumnName("Roles"); - - b.Property("TenantId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("ClientId") - .IsUnique() - .HasDatabaseName("IX_Application_ClientId"); - - b.HasIndex("Name") - .IsUnique() - .HasDatabaseName("IX_Application_Name"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_Application_TenantId"); - - b.ToTable("Applications", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Identity.Entities.Role", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("Permissions") - .IsRequired() - .HasColumnType("nvarchar(max)") - .HasColumnName("Permissions"); - - b.Property("TenantId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique() - .HasDatabaseName("IX_Role_Name"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_Role_TenantId"); - - b.ToTable("Roles", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Identity.Entities.User", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("HashedPassword") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("HashedPasswordSalt") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("Roles") - .IsRequired() - .HasColumnType("nvarchar(max)") - .HasColumnName("Roles"); - - b.Property("TenantId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique() - .HasDatabaseName("IX_User_Name"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_User_TenantId"); - - b.ToTable("Users", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Identity/20250222190919_V3_4.cs b/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Identity/20250222190919_V3_4.cs deleted file mode 100644 index b904555056..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Identity/20250222190919_V3_4.cs +++ /dev/null @@ -1,30 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.SqlServer.Migrations.Identity -{ - /// - public partial class V3_4 : Migration - { - private readonly Elsa.EntityFrameworkCore.IElsaDbContextSchema _schema; - - /// - public V3_4(Elsa.EntityFrameworkCore.IElsaDbContextSchema schema) - { - _schema = schema; - } - - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Identity/IdentityElsaDbContextModelSnapshot.cs b/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Identity/IdentityElsaDbContextModelSnapshot.cs deleted file mode 100644 index 5e2d202a32..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Identity/IdentityElsaDbContextModelSnapshot.cs +++ /dev/null @@ -1,146 +0,0 @@ -// -using Elsa.EntityFrameworkCore.Modules.Identity; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.SqlServer.Migrations.Identity -{ - [DbContext(typeof(IdentityElsaDbContext))] - partial class IdentityElsaDbContextModelSnapshot : ModelSnapshot - { - protected override void BuildModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "8.0.12") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); - - modelBuilder.Entity("Elsa.Identity.Entities.Application", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("ClientId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("HashedApiKey") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("HashedApiKeySalt") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("HashedClientSecret") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("HashedClientSecretSalt") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("Roles") - .IsRequired() - .HasColumnType("nvarchar(max)") - .HasColumnName("Roles"); - - b.Property("TenantId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("ClientId") - .IsUnique() - .HasDatabaseName("IX_Application_ClientId"); - - b.HasIndex("Name") - .IsUnique() - .HasDatabaseName("IX_Application_Name"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_Application_TenantId"); - - b.ToTable("Applications", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Identity.Entities.Role", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("Permissions") - .IsRequired() - .HasColumnType("nvarchar(max)") - .HasColumnName("Permissions"); - - b.Property("TenantId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique() - .HasDatabaseName("IX_Role_Name"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_Role_TenantId"); - - b.ToTable("Roles", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Identity.Entities.User", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("HashedPassword") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("HashedPasswordSalt") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("Roles") - .IsRequired() - .HasColumnType("nvarchar(max)") - .HasColumnName("Roles"); - - b.Property("TenantId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique() - .HasDatabaseName("IX_User_Name"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_User_TenantId"); - - b.ToTable("Users", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Labels/20231015122257_Initial.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Labels/20231015122257_Initial.Designer.cs deleted file mode 100644 index a6ab2f4615..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Labels/20231015122257_Initial.Designer.cs +++ /dev/null @@ -1,85 +0,0 @@ -// -using Elsa.EntityFrameworkCore.Modules.Labels; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.SqlServer.Migrations.Labels -{ - [DbContext(typeof(LabelsElsaDbContext))] - [Migration("20231015122257_Initial")] - partial class Initial - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "7.0.11") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); - - modelBuilder.Entity("Elsa.Labels.Entities.Label", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("Color") - .HasColumnType("nvarchar(max)"); - - b.Property("Description") - .HasColumnType("nvarchar(max)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("NormalizedName") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Labels", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Labels.Entities.WorkflowDefinitionLabel", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("LabelId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("WorkflowDefinitionId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("WorkflowDefinitionVersionId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("LabelId") - .HasDatabaseName("WorkflowDefinitionLabel_LabelId"); - - b.HasIndex("WorkflowDefinitionId") - .HasDatabaseName("WorkflowDefinitionLabel_WorkflowDefinitionId"); - - b.HasIndex("WorkflowDefinitionVersionId") - .HasDatabaseName("WorkflowDefinitionLabel_WorkflowDefinitionVersionId"); - - b.ToTable("WorkflowDefinitionLabels", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Labels/20231015122257_Initial.cs b/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Labels/20231015122257_Initial.cs deleted file mode 100644 index a92d858f0e..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Labels/20231015122257_Initial.cs +++ /dev/null @@ -1,84 +0,0 @@ - -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.SqlServer.Migrations.Labels -{ - /// - public partial class Initial : Migration - { - private readonly IElsaDbContextSchema _schema; - public Initial(IElsaDbContextSchema schema) - { - _schema = schema ?? throw new ArgumentNullException(nameof(schema)); - } - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.EnsureSchema( - name: _schema.Schema); - - migrationBuilder.CreateTable( - name: "Labels", - schema: _schema.Schema, - columns: table => new - { - Id = table.Column(type: "nvarchar(450)", nullable: false), - Name = table.Column(type: "nvarchar(max)", nullable: false), - NormalizedName = table.Column(type: "nvarchar(max)", nullable: false), - Description = table.Column(type: "nvarchar(max)", nullable: true), - Color = table.Column(type: "nvarchar(max)", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Labels", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "WorkflowDefinitionLabels", - schema: _schema.Schema, - columns: table => new - { - Id = table.Column(type: "nvarchar(450)", nullable: false), - WorkflowDefinitionId = table.Column(type: "nvarchar(450)", nullable: false), - WorkflowDefinitionVersionId = table.Column(type: "nvarchar(450)", nullable: false), - LabelId = table.Column(type: "nvarchar(450)", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_WorkflowDefinitionLabels", x => x.Id); - }); - - migrationBuilder.CreateIndex( - name: "WorkflowDefinitionLabel_LabelId", - schema: _schema.Schema, - table: "WorkflowDefinitionLabels", - column: "LabelId"); - - migrationBuilder.CreateIndex( - name: "WorkflowDefinitionLabel_WorkflowDefinitionId", - schema: _schema.Schema, - table: "WorkflowDefinitionLabels", - column: "WorkflowDefinitionId"); - - migrationBuilder.CreateIndex( - name: "WorkflowDefinitionLabel_WorkflowDefinitionVersionId", - schema: _schema.Schema, - table: "WorkflowDefinitionLabels", - column: "WorkflowDefinitionVersionId"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "Labels", - schema: _schema.Schema); - - migrationBuilder.DropTable( - name: "WorkflowDefinitionLabels", - schema: _schema.Schema); - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Labels/20240329200825_V3_1.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Labels/20240329200825_V3_1.Designer.cs deleted file mode 100644 index 33710032b2..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Labels/20240329200825_V3_1.Designer.cs +++ /dev/null @@ -1,85 +0,0 @@ -// -using Elsa.EntityFrameworkCore.Modules.Labels; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.SqlServer.Migrations.Labels -{ - [DbContext(typeof(LabelsElsaDbContext))] - [Migration("20240329200825_V3_1")] - partial class V3_1 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "7.0.14") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); - - modelBuilder.Entity("Elsa.Labels.Entities.Label", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("Color") - .HasColumnType("nvarchar(max)"); - - b.Property("Description") - .HasColumnType("nvarchar(max)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("NormalizedName") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Labels", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Labels.Entities.WorkflowDefinitionLabel", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("LabelId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("WorkflowDefinitionId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("WorkflowDefinitionVersionId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("LabelId") - .HasDatabaseName("WorkflowDefinitionLabel_LabelId"); - - b.HasIndex("WorkflowDefinitionId") - .HasDatabaseName("WorkflowDefinitionLabel_WorkflowDefinitionId"); - - b.HasIndex("WorkflowDefinitionVersionId") - .HasDatabaseName("WorkflowDefinitionLabel_WorkflowDefinitionVersionId"); - - b.ToTable("WorkflowDefinitionLabels", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Labels/20240329200825_V3_1.cs b/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Labels/20240329200825_V3_1.cs deleted file mode 100644 index d7253cb7a4..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Labels/20240329200825_V3_1.cs +++ /dev/null @@ -1,30 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.SqlServer.Migrations.Labels -{ - /// - public partial class V3_1 : Migration - { - private readonly IElsaDbContextSchema _schema; - - /// - public V3_1(IElsaDbContextSchema schema) - { - _schema = schema; - } - - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Labels/20240610185009_V3_2.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Labels/20240610185009_V3_2.Designer.cs deleted file mode 100644 index 0667dd0d95..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Labels/20240610185009_V3_2.Designer.cs +++ /dev/null @@ -1,85 +0,0 @@ -// -using Elsa.EntityFrameworkCore.Modules.Labels; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.SqlServer.Migrations.Labels -{ - [DbContext(typeof(LabelsElsaDbContext))] - [Migration("20240610185009_V3_2")] - partial class V3_2 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "7.0.20") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); - - modelBuilder.Entity("Elsa.Labels.Entities.Label", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("Color") - .HasColumnType("nvarchar(max)"); - - b.Property("Description") - .HasColumnType("nvarchar(max)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("NormalizedName") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Labels", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Labels.Entities.WorkflowDefinitionLabel", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("LabelId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("WorkflowDefinitionId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("WorkflowDefinitionVersionId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("LabelId") - .HasDatabaseName("WorkflowDefinitionLabel_LabelId"); - - b.HasIndex("WorkflowDefinitionId") - .HasDatabaseName("WorkflowDefinitionLabel_WorkflowDefinitionId"); - - b.HasIndex("WorkflowDefinitionVersionId") - .HasDatabaseName("WorkflowDefinitionLabel_WorkflowDefinitionVersionId"); - - b.ToTable("WorkflowDefinitionLabels", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Labels/20240610185009_V3_2.cs b/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Labels/20240610185009_V3_2.cs deleted file mode 100644 index ef6e41cbed..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Labels/20240610185009_V3_2.cs +++ /dev/null @@ -1,30 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.SqlServer.Migrations.Labels -{ - /// - public partial class V3_2 : Migration - { - private readonly IElsaDbContextSchema _schema; - - /// - public V3_2(IElsaDbContextSchema schema) - { - _schema = schema; - } - - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Labels/20241212212012_V3_3.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Labels/20241212212012_V3_3.Designer.cs deleted file mode 100644 index 56bff0bbda..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Labels/20241212212012_V3_3.Designer.cs +++ /dev/null @@ -1,94 +0,0 @@ -// -using Elsa.EntityFrameworkCore.Modules.Labels; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.SqlServer.Migrations.Labels -{ - [DbContext(typeof(LabelsElsaDbContext))] - [Migration("20241212212012_V3_3")] - partial class V3_3 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "7.0.20") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); - - modelBuilder.Entity("Elsa.Labels.Entities.Label", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("Color") - .HasColumnType("nvarchar(max)"); - - b.Property("Description") - .HasColumnType("nvarchar(max)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("NormalizedName") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("TenantId") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Labels", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Labels.Entities.WorkflowDefinitionLabel", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("LabelId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("TenantId") - .HasColumnType("nvarchar(450)"); - - b.Property("WorkflowDefinitionId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("WorkflowDefinitionVersionId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("LabelId") - .HasDatabaseName("WorkflowDefinitionLabel_LabelId"); - - b.HasIndex("TenantId") - .HasDatabaseName("WorkflowDefinitionLabel_TenantId"); - - b.HasIndex("WorkflowDefinitionId") - .HasDatabaseName("WorkflowDefinitionLabel_WorkflowDefinitionId"); - - b.HasIndex("WorkflowDefinitionVersionId") - .HasDatabaseName("WorkflowDefinitionLabel_WorkflowDefinitionVersionId"); - - b.ToTable("WorkflowDefinitionLabels", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Labels/20241212212012_V3_3.cs b/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Labels/20241212212012_V3_3.cs deleted file mode 100644 index 9458058b9a..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Labels/20241212212012_V3_3.cs +++ /dev/null @@ -1,61 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.SqlServer.Migrations.Labels -{ - /// - public partial class V3_3 : Migration - { - private readonly Elsa.EntityFrameworkCore.IElsaDbContextSchema _schema; - - /// - public V3_3(Elsa.EntityFrameworkCore.IElsaDbContextSchema schema) - { - _schema = schema; - } - - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "TenantId", - schema: _schema.Schema, - table: "WorkflowDefinitionLabels", - type: "nvarchar(450)", - nullable: true); - - migrationBuilder.AddColumn( - name: "TenantId", - schema: _schema.Schema, - table: "Labels", - type: "nvarchar(max)", - nullable: true); - - migrationBuilder.CreateIndex( - name: "WorkflowDefinitionLabel_TenantId", - schema: _schema.Schema, - table: "WorkflowDefinitionLabels", - column: "TenantId"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropIndex( - name: "WorkflowDefinitionLabel_TenantId", - schema: _schema.Schema, - table: "WorkflowDefinitionLabels"); - - migrationBuilder.DropColumn( - name: "TenantId", - schema: _schema.Schema, - table: "WorkflowDefinitionLabels"); - - migrationBuilder.DropColumn( - name: "TenantId", - schema: _schema.Schema, - table: "Labels"); - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Labels/20250222190946_V3_4.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Labels/20250222190946_V3_4.Designer.cs deleted file mode 100644 index 23bf0ba30f..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Labels/20250222190946_V3_4.Designer.cs +++ /dev/null @@ -1,94 +0,0 @@ -// -using Elsa.EntityFrameworkCore.Modules.Labels; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.SqlServer.Migrations.Labels -{ - [DbContext(typeof(LabelsElsaDbContext))] - [Migration("20250222190946_V3_4")] - partial class V3_4 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "8.0.12") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); - - modelBuilder.Entity("Elsa.Labels.Entities.Label", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("Color") - .HasColumnType("nvarchar(max)"); - - b.Property("Description") - .HasColumnType("nvarchar(max)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("NormalizedName") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("TenantId") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Labels", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Labels.Entities.WorkflowDefinitionLabel", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("LabelId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("TenantId") - .HasColumnType("nvarchar(450)"); - - b.Property("WorkflowDefinitionId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("WorkflowDefinitionVersionId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("LabelId") - .HasDatabaseName("WorkflowDefinitionLabel_LabelId"); - - b.HasIndex("TenantId") - .HasDatabaseName("WorkflowDefinitionLabel_TenantId"); - - b.HasIndex("WorkflowDefinitionId") - .HasDatabaseName("WorkflowDefinitionLabel_WorkflowDefinitionId"); - - b.HasIndex("WorkflowDefinitionVersionId") - .HasDatabaseName("WorkflowDefinitionLabel_WorkflowDefinitionVersionId"); - - b.ToTable("WorkflowDefinitionLabels", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Labels/20250222190946_V3_4.cs b/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Labels/20250222190946_V3_4.cs deleted file mode 100644 index ff83e290a8..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Labels/20250222190946_V3_4.cs +++ /dev/null @@ -1,30 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.SqlServer.Migrations.Labels -{ - /// - public partial class V3_4 : Migration - { - private readonly Elsa.EntityFrameworkCore.IElsaDbContextSchema _schema; - - /// - public V3_4(Elsa.EntityFrameworkCore.IElsaDbContextSchema schema) - { - _schema = schema; - } - - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Labels/LabelsElsaDbContextModelSnapshot.cs b/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Labels/LabelsElsaDbContextModelSnapshot.cs deleted file mode 100644 index b648cd2ebd..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Labels/LabelsElsaDbContextModelSnapshot.cs +++ /dev/null @@ -1,91 +0,0 @@ -// -using Elsa.EntityFrameworkCore.Modules.Labels; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.SqlServer.Migrations.Labels -{ - [DbContext(typeof(LabelsElsaDbContext))] - partial class LabelsElsaDbContextModelSnapshot : ModelSnapshot - { - protected override void BuildModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "8.0.12") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); - - modelBuilder.Entity("Elsa.Labels.Entities.Label", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("Color") - .HasColumnType("nvarchar(max)"); - - b.Property("Description") - .HasColumnType("nvarchar(max)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("NormalizedName") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("TenantId") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Labels", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Labels.Entities.WorkflowDefinitionLabel", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("LabelId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("TenantId") - .HasColumnType("nvarchar(450)"); - - b.Property("WorkflowDefinitionId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("WorkflowDefinitionVersionId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("LabelId") - .HasDatabaseName("WorkflowDefinitionLabel_LabelId"); - - b.HasIndex("TenantId") - .HasDatabaseName("WorkflowDefinitionLabel_TenantId"); - - b.HasIndex("WorkflowDefinitionId") - .HasDatabaseName("WorkflowDefinitionLabel_WorkflowDefinitionId"); - - b.HasIndex("WorkflowDefinitionVersionId") - .HasDatabaseName("WorkflowDefinitionLabel_WorkflowDefinitionVersionId"); - - b.ToTable("WorkflowDefinitionLabels", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Management/20231015122227_Initial.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Management/20231015122227_Initial.Designer.cs deleted file mode 100644 index cc99eca0a5..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Management/20231015122227_Initial.Designer.cs +++ /dev/null @@ -1,196 +0,0 @@ -// -using System; -using Elsa.EntityFrameworkCore.Modules.Management; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.SqlServer.Migrations.Management -{ - [DbContext(typeof(ManagementElsaDbContext))] - [Migration("20231015122227_Initial")] - partial class Initial - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "7.0.11") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); - - modelBuilder.Entity("Elsa.Workflows.Management.Entities.WorkflowDefinition", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("BinaryData") - .HasColumnType("varbinary(max)"); - - b.Property("CreatedAt") - .HasColumnType("datetimeoffset"); - - b.Property("Data") - .HasColumnType("nvarchar(max)"); - - b.Property("DefinitionId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("Description") - .HasColumnType("nvarchar(max)"); - - b.Property("IsLatest") - .HasColumnType("bit"); - - b.Property("IsPublished") - .HasColumnType("bit"); - - b.Property("IsReadonly") - .HasColumnType("bit"); - - b.Property("MaterializerContext") - .HasColumnType("nvarchar(max)"); - - b.Property("MaterializerName") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Name") - .HasColumnType("nvarchar(450)"); - - b.Property("ProviderName") - .HasColumnType("nvarchar(max)"); - - b.Property("StringData") - .HasColumnType("nvarchar(max)"); - - b.Property("ToolVersion") - .HasColumnType("nvarchar(max)"); - - b.Property("UsableAsActivity") - .HasColumnType("bit"); - - b.Property("Version") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("IsLatest") - .HasDatabaseName("IX_WorkflowDefinition_IsLatest"); - - b.HasIndex("IsPublished") - .HasDatabaseName("IX_WorkflowDefinition_IsPublished"); - - b.HasIndex("Name") - .HasDatabaseName("IX_WorkflowDefinition_Name"); - - b.HasIndex("UsableAsActivity") - .HasDatabaseName("IX_WorkflowDefinition_UsableAsActivity"); - - b.HasIndex("Version") - .HasDatabaseName("IX_WorkflowDefinition_Version"); - - b.HasIndex("DefinitionId", "Version") - .IsUnique() - .HasDatabaseName("IX_WorkflowDefinition_DefinitionId_Version"); - - b.ToTable("WorkflowDefinitions", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Management.Entities.WorkflowInstance", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("CorrelationId") - .HasColumnType("nvarchar(450)"); - - b.Property("CreatedAt") - .HasColumnType("datetimeoffset"); - - b.Property("Data") - .HasColumnType("nvarchar(max)"); - - b.Property("DefinitionId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("DefinitionVersionId") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("FinishedAt") - .HasColumnType("datetimeoffset"); - - b.Property("IncidentCount") - .HasColumnType("int"); - - b.Property("Name") - .HasColumnType("nvarchar(450)"); - - b.Property("Status") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("SubStatus") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("UpdatedAt") - .HasColumnType("datetimeoffset"); - - b.Property("Version") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CorrelationId") - .HasDatabaseName("IX_WorkflowInstance_CorrelationId"); - - b.HasIndex("CreatedAt") - .HasDatabaseName("IX_WorkflowInstance_CreatedAt"); - - b.HasIndex("DefinitionId") - .HasDatabaseName("IX_WorkflowInstance_DefinitionId"); - - b.HasIndex("FinishedAt") - .HasDatabaseName("IX_WorkflowInstance_FinishedAt"); - - b.HasIndex("Name") - .HasDatabaseName("IX_WorkflowInstance_Name"); - - b.HasIndex("Status") - .HasDatabaseName("IX_WorkflowInstance_Status"); - - b.HasIndex("SubStatus") - .HasDatabaseName("IX_WorkflowInstance_SubStatus"); - - b.HasIndex("UpdatedAt") - .HasDatabaseName("IX_WorkflowInstance_UpdatedAt"); - - b.HasIndex("Status", "DefinitionId") - .HasDatabaseName("IX_WorkflowInstance_Status_DefinitionId"); - - b.HasIndex("Status", "SubStatus") - .HasDatabaseName("IX_WorkflowInstance_Status_SubStatus"); - - b.HasIndex("SubStatus", "DefinitionId") - .HasDatabaseName("IX_WorkflowInstance_SubStatus_DefinitionId"); - - b.HasIndex("Status", "SubStatus", "DefinitionId", "Version") - .HasDatabaseName("IX_WorkflowInstance_Status_SubStatus_DefinitionId_Version"); - - b.ToTable("WorkflowInstances", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Management/20231015122227_Initial.cs b/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Management/20231015122227_Initial.cs deleted file mode 100644 index cf5234c555..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Management/20231015122227_Initial.cs +++ /dev/null @@ -1,196 +0,0 @@ - -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.SqlServer.Migrations.Management -{ - /// - public partial class Initial : Migration - { - private readonly IElsaDbContextSchema _schema; - public Initial(IElsaDbContextSchema schema) - { - _schema = schema ?? throw new ArgumentNullException(nameof(schema)); - } - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.EnsureSchema( - name: _schema.Schema); - - migrationBuilder.CreateTable( - name: "WorkflowDefinitions", - schema: _schema.Schema , - columns: table => new - { - Id = table.Column(type: "nvarchar(450)", nullable: false), - DefinitionId = table.Column(type: "nvarchar(450)", nullable: false), - Name = table.Column(type: "nvarchar(450)", nullable: true), - Description = table.Column(type: "nvarchar(max)", nullable: true), - ToolVersion = table.Column(type: "nvarchar(max)", nullable: true), - ProviderName = table.Column(type: "nvarchar(max)", nullable: true), - MaterializerName = table.Column(type: "nvarchar(max)", nullable: false), - MaterializerContext = table.Column(type: "nvarchar(max)", nullable: true), - StringData = table.Column(type: "nvarchar(max)", nullable: true), - BinaryData = table.Column(type: "varbinary(max)", nullable: true), - IsReadonly = table.Column(type: "bit", nullable: false), - Data = table.Column(type: "nvarchar(max)", nullable: true), - UsableAsActivity = table.Column(type: "bit", nullable: true), - CreatedAt = table.Column(type: "datetimeoffset", nullable: false), - Version = table.Column(type: "int", nullable: false), - IsLatest = table.Column(type: "bit", nullable: false), - IsPublished = table.Column(type: "bit", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_WorkflowDefinitions", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "WorkflowInstances", - schema: _schema.Schema, - columns: table => new - { - Id = table.Column(type: "nvarchar(450)", nullable: false), - DefinitionId = table.Column(type: "nvarchar(450)", nullable: false), - DefinitionVersionId = table.Column(type: "nvarchar(max)", nullable: false), - Version = table.Column(type: "int", nullable: false), - Status = table.Column(type: "nvarchar(450)", nullable: false), - SubStatus = table.Column(type: "nvarchar(450)", nullable: false), - CorrelationId = table.Column(type: "nvarchar(450)", nullable: true), - Name = table.Column(type: "nvarchar(450)", nullable: true), - IncidentCount = table.Column(type: "int", nullable: false), - CreatedAt = table.Column(type: "datetimeoffset", nullable: false), - UpdatedAt = table.Column(type: "datetimeoffset", nullable: false), - FinishedAt = table.Column(type: "datetimeoffset", nullable: true), - Data = table.Column(type: "nvarchar(max)", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_WorkflowInstances", x => x.Id); - }); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowDefinition_DefinitionId_Version", - schema: _schema.Schema, - table: "WorkflowDefinitions", - columns: new[] { "DefinitionId", "Version" }, - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowDefinition_IsLatest", - schema: _schema.Schema, - table: "WorkflowDefinitions", - column: "IsLatest"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowDefinition_IsPublished", - schema: _schema.Schema, - table: "WorkflowDefinitions", - column: "IsPublished"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowDefinition_Name", - schema: _schema.Schema, - table: "WorkflowDefinitions", - column: "Name"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowDefinition_UsableAsActivity", - schema: _schema.Schema, - table: "WorkflowDefinitions", - column: "UsableAsActivity"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowDefinition_Version", - schema: _schema.Schema, - table: "WorkflowDefinitions", - column: "Version"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowInstance_CorrelationId", - schema: _schema.Schema, - table: "WorkflowInstances", - column: "CorrelationId"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowInstance_CreatedAt", - schema: _schema.Schema, - table: "WorkflowInstances", - column: "CreatedAt"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowInstance_DefinitionId", - schema: _schema.Schema, - table: "WorkflowInstances", - column: "DefinitionId"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowInstance_FinishedAt", - schema: _schema.Schema, - table: "WorkflowInstances", - column: "FinishedAt"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowInstance_Name", - schema: _schema.Schema, - table: "WorkflowInstances", - column: "Name"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowInstance_Status", - schema: _schema.Schema, - table: "WorkflowInstances", - column: "Status"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowInstance_Status_DefinitionId", - schema: _schema.Schema, - table: "WorkflowInstances", - columns: new[] { "Status", "DefinitionId" }); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowInstance_Status_SubStatus", - schema: _schema.Schema, - table: "WorkflowInstances", - columns: new[] { "Status", "SubStatus" }); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowInstance_Status_SubStatus_DefinitionId_Version", - schema: _schema.Schema, - table: "WorkflowInstances", - columns: new[] { "Status", "SubStatus", "DefinitionId", "Version" }); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowInstance_SubStatus", - schema: _schema.Schema, - table: "WorkflowInstances", - column: "SubStatus"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowInstance_SubStatus_DefinitionId", - schema: _schema.Schema, - table: "WorkflowInstances", - columns: new[] { "SubStatus", "DefinitionId" }); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowInstance_UpdatedAt", - schema: _schema.Schema, - table: "WorkflowInstances", - column: "UpdatedAt"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "WorkflowDefinitions", - schema: _schema.Schema); - - migrationBuilder.DropTable( - name: "WorkflowInstances", - schema: _schema.Schema); - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Management/20240329200727_V3_1.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Management/20240329200727_V3_1.Designer.cs deleted file mode 100644 index a23cc5bd78..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Management/20240329200727_V3_1.Designer.cs +++ /dev/null @@ -1,214 +0,0 @@ -// -using System; -using Elsa.EntityFrameworkCore.Modules.Management; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.SqlServer.Migrations.Management -{ - [DbContext(typeof(ManagementElsaDbContext))] - [Migration("20240329200727_V3_1")] - partial class V3_1 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "7.0.14") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); - - modelBuilder.Entity("Elsa.Workflows.Management.Entities.WorkflowDefinition", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("BinaryData") - .HasColumnType("varbinary(max)"); - - b.Property("CreatedAt") - .HasColumnType("datetimeoffset"); - - b.Property("Data") - .HasColumnType("nvarchar(max)"); - - b.Property("DefinitionId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("Description") - .HasColumnType("nvarchar(max)"); - - b.Property("IsLatest") - .HasColumnType("bit"); - - b.Property("IsPublished") - .HasColumnType("bit"); - - b.Property("IsReadonly") - .HasColumnType("bit"); - - b.Property("IsSystem") - .HasColumnType("bit"); - - b.Property("MaterializerContext") - .HasColumnType("nvarchar(max)"); - - b.Property("MaterializerName") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Name") - .HasColumnType("nvarchar(450)"); - - b.Property("ProviderName") - .HasColumnType("nvarchar(max)"); - - b.Property("StringData") - .HasColumnType("nvarchar(max)"); - - b.Property("ToolVersion") - .HasColumnType("nvarchar(max)"); - - b.Property("UsableAsActivity") - .HasColumnType("bit"); - - b.Property("Version") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("IsLatest") - .HasDatabaseName("IX_WorkflowDefinition_IsLatest"); - - b.HasIndex("IsPublished") - .HasDatabaseName("IX_WorkflowDefinition_IsPublished"); - - b.HasIndex("IsSystem") - .HasDatabaseName("IX_WorkflowDefinition_IsSystem"); - - b.HasIndex("Name") - .HasDatabaseName("IX_WorkflowDefinition_Name"); - - b.HasIndex("UsableAsActivity") - .HasDatabaseName("IX_WorkflowDefinition_UsableAsActivity"); - - b.HasIndex("Version") - .HasDatabaseName("IX_WorkflowDefinition_Version"); - - b.HasIndex("DefinitionId", "Version") - .IsUnique() - .HasDatabaseName("IX_WorkflowDefinition_DefinitionId_Version"); - - b.ToTable("WorkflowDefinitions", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Management.Entities.WorkflowInstance", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("CorrelationId") - .HasColumnType("nvarchar(450)"); - - b.Property("CreatedAt") - .HasColumnType("datetimeoffset"); - - b.Property("Data") - .HasColumnType("nvarchar(max)"); - - b.Property("DataCompressionAlgorithm") - .HasColumnType("nvarchar(max)"); - - b.Property("DefinitionId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("DefinitionVersionId") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("FinishedAt") - .HasColumnType("datetimeoffset"); - - b.Property("IncidentCount") - .HasColumnType("int"); - - b.Property("IsSystem") - .HasColumnType("bit"); - - b.Property("Name") - .HasColumnType("nvarchar(450)"); - - b.Property("ParentWorkflowInstanceId") - .HasColumnType("nvarchar(max)"); - - b.Property("Status") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("SubStatus") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("UpdatedAt") - .HasColumnType("datetimeoffset"); - - b.Property("Version") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CorrelationId") - .HasDatabaseName("IX_WorkflowInstance_CorrelationId"); - - b.HasIndex("CreatedAt") - .HasDatabaseName("IX_WorkflowInstance_CreatedAt"); - - b.HasIndex("DefinitionId") - .HasDatabaseName("IX_WorkflowInstance_DefinitionId"); - - b.HasIndex("FinishedAt") - .HasDatabaseName("IX_WorkflowInstance_FinishedAt"); - - b.HasIndex("IsSystem") - .HasDatabaseName("IX_WorkflowInstance_IsSystem"); - - b.HasIndex("Name") - .HasDatabaseName("IX_WorkflowInstance_Name"); - - b.HasIndex("Status") - .HasDatabaseName("IX_WorkflowInstance_Status"); - - b.HasIndex("SubStatus") - .HasDatabaseName("IX_WorkflowInstance_SubStatus"); - - b.HasIndex("UpdatedAt") - .HasDatabaseName("IX_WorkflowInstance_UpdatedAt"); - - b.HasIndex("Status", "DefinitionId") - .HasDatabaseName("IX_WorkflowInstance_Status_DefinitionId"); - - b.HasIndex("Status", "SubStatus") - .HasDatabaseName("IX_WorkflowInstance_Status_SubStatus"); - - b.HasIndex("SubStatus", "DefinitionId") - .HasDatabaseName("IX_WorkflowInstance_SubStatus_DefinitionId"); - - b.HasIndex("Status", "SubStatus", "DefinitionId", "Version") - .HasDatabaseName("IX_WorkflowInstance_Status_SubStatus_DefinitionId_Version"); - - b.ToTable("WorkflowInstances", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Management/20240329200727_V3_1.cs b/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Management/20240329200727_V3_1.cs deleted file mode 100644 index 4ab3277127..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Management/20240329200727_V3_1.cs +++ /dev/null @@ -1,98 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.SqlServer.Migrations.Management -{ - /// - public partial class V3_1 : Migration - { - private readonly IElsaDbContextSchema _schema; - - /// - public V3_1(IElsaDbContextSchema schema) - { - _schema = schema; - } - - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "DataCompressionAlgorithm", - schema: _schema.Schema, - table: "WorkflowInstances", - type: "nvarchar(max)", - nullable: true); - - migrationBuilder.AddColumn( - name: "IsSystem", - schema: _schema.Schema, - table: "WorkflowInstances", - type: "bit", - nullable: false, - defaultValue: false); - - migrationBuilder.AddColumn( - name: "ParentWorkflowInstanceId", - schema: _schema.Schema, - table: "WorkflowInstances", - type: "nvarchar(max)", - nullable: true); - - migrationBuilder.AddColumn( - name: "IsSystem", - schema: _schema.Schema, - table: "WorkflowDefinitions", - type: "bit", - nullable: false, - defaultValue: false); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowInstance_IsSystem", - schema: _schema.Schema, - table: "WorkflowInstances", - column: "IsSystem"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowDefinition_IsSystem", - schema: _schema.Schema, - table: "WorkflowDefinitions", - column: "IsSystem"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropIndex( - name: "IX_WorkflowInstance_IsSystem", - schema: _schema.Schema, - table: "WorkflowInstances"); - - migrationBuilder.DropIndex( - name: "IX_WorkflowDefinition_IsSystem", - schema: _schema.Schema, - table: "WorkflowDefinitions"); - - migrationBuilder.DropColumn( - name: "DataCompressionAlgorithm", - schema: _schema.Schema, - table: "WorkflowInstances"); - - migrationBuilder.DropColumn( - name: "IsSystem", - schema: _schema.Schema, - table: "WorkflowInstances"); - - migrationBuilder.DropColumn( - name: "ParentWorkflowInstanceId", - schema: _schema.Schema, - table: "WorkflowInstances"); - - migrationBuilder.DropColumn( - name: "IsSystem", - schema: _schema.Schema, - table: "WorkflowDefinitions"); - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Management/20240610184814_V3_2.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Management/20240610184814_V3_2.Designer.cs deleted file mode 100644 index fd6cb595b1..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Management/20240610184814_V3_2.Designer.cs +++ /dev/null @@ -1,214 +0,0 @@ -// -using System; -using Elsa.EntityFrameworkCore.Modules.Management; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.SqlServer.Migrations.Management -{ - [DbContext(typeof(ManagementElsaDbContext))] - [Migration("20240610184814_V3_2")] - partial class V3_2 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "7.0.20") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); - - modelBuilder.Entity("Elsa.Workflows.Management.Entities.WorkflowDefinition", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("BinaryData") - .HasColumnType("varbinary(max)"); - - b.Property("CreatedAt") - .HasColumnType("datetimeoffset"); - - b.Property("Data") - .HasColumnType("nvarchar(max)"); - - b.Property("DefinitionId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("Description") - .HasColumnType("nvarchar(max)"); - - b.Property("IsLatest") - .HasColumnType("bit"); - - b.Property("IsPublished") - .HasColumnType("bit"); - - b.Property("IsReadonly") - .HasColumnType("bit"); - - b.Property("IsSystem") - .HasColumnType("bit"); - - b.Property("MaterializerContext") - .HasColumnType("nvarchar(max)"); - - b.Property("MaterializerName") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Name") - .HasColumnType("nvarchar(450)"); - - b.Property("ProviderName") - .HasColumnType("nvarchar(max)"); - - b.Property("StringData") - .HasColumnType("nvarchar(max)"); - - b.Property("ToolVersion") - .HasColumnType("nvarchar(max)"); - - b.Property("UsableAsActivity") - .HasColumnType("bit"); - - b.Property("Version") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("IsLatest") - .HasDatabaseName("IX_WorkflowDefinition_IsLatest"); - - b.HasIndex("IsPublished") - .HasDatabaseName("IX_WorkflowDefinition_IsPublished"); - - b.HasIndex("IsSystem") - .HasDatabaseName("IX_WorkflowDefinition_IsSystem"); - - b.HasIndex("Name") - .HasDatabaseName("IX_WorkflowDefinition_Name"); - - b.HasIndex("UsableAsActivity") - .HasDatabaseName("IX_WorkflowDefinition_UsableAsActivity"); - - b.HasIndex("Version") - .HasDatabaseName("IX_WorkflowDefinition_Version"); - - b.HasIndex("DefinitionId", "Version") - .IsUnique() - .HasDatabaseName("IX_WorkflowDefinition_DefinitionId_Version"); - - b.ToTable("WorkflowDefinitions", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Management.Entities.WorkflowInstance", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("CorrelationId") - .HasColumnType("nvarchar(450)"); - - b.Property("CreatedAt") - .HasColumnType("datetimeoffset"); - - b.Property("Data") - .HasColumnType("nvarchar(max)"); - - b.Property("DataCompressionAlgorithm") - .HasColumnType("nvarchar(max)"); - - b.Property("DefinitionId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("DefinitionVersionId") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("FinishedAt") - .HasColumnType("datetimeoffset"); - - b.Property("IncidentCount") - .HasColumnType("int"); - - b.Property("IsSystem") - .HasColumnType("bit"); - - b.Property("Name") - .HasColumnType("nvarchar(450)"); - - b.Property("ParentWorkflowInstanceId") - .HasColumnType("nvarchar(max)"); - - b.Property("Status") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("SubStatus") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("UpdatedAt") - .HasColumnType("datetimeoffset"); - - b.Property("Version") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CorrelationId") - .HasDatabaseName("IX_WorkflowInstance_CorrelationId"); - - b.HasIndex("CreatedAt") - .HasDatabaseName("IX_WorkflowInstance_CreatedAt"); - - b.HasIndex("DefinitionId") - .HasDatabaseName("IX_WorkflowInstance_DefinitionId"); - - b.HasIndex("FinishedAt") - .HasDatabaseName("IX_WorkflowInstance_FinishedAt"); - - b.HasIndex("IsSystem") - .HasDatabaseName("IX_WorkflowInstance_IsSystem"); - - b.HasIndex("Name") - .HasDatabaseName("IX_WorkflowInstance_Name"); - - b.HasIndex("Status") - .HasDatabaseName("IX_WorkflowInstance_Status"); - - b.HasIndex("SubStatus") - .HasDatabaseName("IX_WorkflowInstance_SubStatus"); - - b.HasIndex("UpdatedAt") - .HasDatabaseName("IX_WorkflowInstance_UpdatedAt"); - - b.HasIndex("Status", "DefinitionId") - .HasDatabaseName("IX_WorkflowInstance_Status_DefinitionId"); - - b.HasIndex("Status", "SubStatus") - .HasDatabaseName("IX_WorkflowInstance_Status_SubStatus"); - - b.HasIndex("SubStatus", "DefinitionId") - .HasDatabaseName("IX_WorkflowInstance_SubStatus_DefinitionId"); - - b.HasIndex("Status", "SubStatus", "DefinitionId", "Version") - .HasDatabaseName("IX_WorkflowInstance_Status_SubStatus_DefinitionId_Version"); - - b.ToTable("WorkflowInstances", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Management/20240610184814_V3_2.cs b/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Management/20240610184814_V3_2.cs deleted file mode 100644 index a2bab765bf..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Management/20240610184814_V3_2.cs +++ /dev/null @@ -1,30 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.SqlServer.Migrations.Management -{ - /// - public partial class V3_2 : Migration - { - private readonly IElsaDbContextSchema _schema; - - /// - public V3_2(IElsaDbContextSchema schema) - { - _schema = schema; - } - - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Management/20241212211744_V3_3.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Management/20241212211744_V3_3.Designer.cs deleted file mode 100644 index 9f8d0cb200..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Management/20241212211744_V3_3.Designer.cs +++ /dev/null @@ -1,226 +0,0 @@ -// -using System; -using Elsa.EntityFrameworkCore.Modules.Management; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.SqlServer.Migrations.Management -{ - [DbContext(typeof(ManagementElsaDbContext))] - [Migration("20241212211744_V3_3")] - partial class V3_3 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "7.0.20") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); - - modelBuilder.Entity("Elsa.Workflows.Management.Entities.WorkflowDefinition", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("BinaryData") - .HasColumnType("varbinary(max)"); - - b.Property("CreatedAt") - .HasColumnType("datetimeoffset"); - - b.Property("Data") - .HasColumnType("nvarchar(max)"); - - b.Property("DefinitionId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("Description") - .HasColumnType("nvarchar(max)"); - - b.Property("IsLatest") - .HasColumnType("bit"); - - b.Property("IsPublished") - .HasColumnType("bit"); - - b.Property("IsReadonly") - .HasColumnType("bit"); - - b.Property("IsSystem") - .HasColumnType("bit"); - - b.Property("MaterializerContext") - .HasColumnType("nvarchar(max)"); - - b.Property("MaterializerName") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Name") - .HasColumnType("nvarchar(450)"); - - b.Property("ProviderName") - .HasColumnType("nvarchar(max)"); - - b.Property("StringData") - .HasColumnType("nvarchar(max)"); - - b.Property("TenantId") - .HasColumnType("nvarchar(450)"); - - b.Property("ToolVersion") - .HasColumnType("nvarchar(max)"); - - b.Property("UsableAsActivity") - .HasColumnType("bit"); - - b.Property("Version") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("IsLatest") - .HasDatabaseName("IX_WorkflowDefinition_IsLatest"); - - b.HasIndex("IsPublished") - .HasDatabaseName("IX_WorkflowDefinition_IsPublished"); - - b.HasIndex("IsSystem") - .HasDatabaseName("IX_WorkflowDefinition_IsSystem"); - - b.HasIndex("Name") - .HasDatabaseName("IX_WorkflowDefinition_Name"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_WorkflowDefinition_TenantId"); - - b.HasIndex("UsableAsActivity") - .HasDatabaseName("IX_WorkflowDefinition_UsableAsActivity"); - - b.HasIndex("Version") - .HasDatabaseName("IX_WorkflowDefinition_Version"); - - b.HasIndex("DefinitionId", "Version") - .IsUnique() - .HasDatabaseName("IX_WorkflowDefinition_DefinitionId_Version"); - - b.ToTable("WorkflowDefinitions", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Management.Entities.WorkflowInstance", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("CorrelationId") - .HasColumnType("nvarchar(450)"); - - b.Property("CreatedAt") - .HasColumnType("datetimeoffset"); - - b.Property("Data") - .HasColumnType("nvarchar(max)"); - - b.Property("DataCompressionAlgorithm") - .HasColumnType("nvarchar(max)"); - - b.Property("DefinitionId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("DefinitionVersionId") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("FinishedAt") - .HasColumnType("datetimeoffset"); - - b.Property("IncidentCount") - .HasColumnType("int"); - - b.Property("IsSystem") - .HasColumnType("bit"); - - b.Property("Name") - .HasColumnType("nvarchar(450)"); - - b.Property("ParentWorkflowInstanceId") - .HasColumnType("nvarchar(max)"); - - b.Property("Status") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("SubStatus") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("TenantId") - .HasColumnType("nvarchar(450)"); - - b.Property("UpdatedAt") - .HasColumnType("datetimeoffset"); - - b.Property("Version") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CorrelationId") - .HasDatabaseName("IX_WorkflowInstance_CorrelationId"); - - b.HasIndex("CreatedAt") - .HasDatabaseName("IX_WorkflowInstance_CreatedAt"); - - b.HasIndex("DefinitionId") - .HasDatabaseName("IX_WorkflowInstance_DefinitionId"); - - b.HasIndex("FinishedAt") - .HasDatabaseName("IX_WorkflowInstance_FinishedAt"); - - b.HasIndex("IsSystem") - .HasDatabaseName("IX_WorkflowInstance_IsSystem"); - - b.HasIndex("Name") - .HasDatabaseName("IX_WorkflowInstance_Name"); - - b.HasIndex("Status") - .HasDatabaseName("IX_WorkflowInstance_Status"); - - b.HasIndex("SubStatus") - .HasDatabaseName("IX_WorkflowInstance_SubStatus"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_WorkflowInstance_TenantId"); - - b.HasIndex("UpdatedAt") - .HasDatabaseName("IX_WorkflowInstance_UpdatedAt"); - - b.HasIndex("Status", "DefinitionId") - .HasDatabaseName("IX_WorkflowInstance_Status_DefinitionId"); - - b.HasIndex("Status", "SubStatus") - .HasDatabaseName("IX_WorkflowInstance_Status_SubStatus"); - - b.HasIndex("SubStatus", "DefinitionId") - .HasDatabaseName("IX_WorkflowInstance_SubStatus_DefinitionId"); - - b.HasIndex("Status", "SubStatus", "DefinitionId", "Version") - .HasDatabaseName("IX_WorkflowInstance_Status_SubStatus_DefinitionId_Version"); - - b.ToTable("WorkflowInstances", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Management/20241212211744_V3_3.cs b/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Management/20241212211744_V3_3.cs deleted file mode 100644 index 48d2062d0b..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Management/20241212211744_V3_3.cs +++ /dev/null @@ -1,72 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.SqlServer.Migrations.Management -{ - /// - public partial class V3_3 : Migration - { - private readonly Elsa.EntityFrameworkCore.IElsaDbContextSchema _schema; - - /// - public V3_3(Elsa.EntityFrameworkCore.IElsaDbContextSchema schema) - { - _schema = schema; - } - - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "TenantId", - schema: _schema.Schema, - table: "WorkflowInstances", - type: "nvarchar(450)", - nullable: true); - - migrationBuilder.AddColumn( - name: "TenantId", - schema: _schema.Schema, - table: "WorkflowDefinitions", - type: "nvarchar(450)", - nullable: true); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowInstance_TenantId", - schema: _schema.Schema, - table: "WorkflowInstances", - column: "TenantId"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowDefinition_TenantId", - schema: _schema.Schema, - table: "WorkflowDefinitions", - column: "TenantId"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropIndex( - name: "IX_WorkflowInstance_TenantId", - schema: _schema.Schema, - table: "WorkflowInstances"); - - migrationBuilder.DropIndex( - name: "IX_WorkflowDefinition_TenantId", - schema: _schema.Schema, - table: "WorkflowDefinitions"); - - migrationBuilder.DropColumn( - name: "TenantId", - schema: _schema.Schema, - table: "WorkflowInstances"); - - migrationBuilder.DropColumn( - name: "TenantId", - schema: _schema.Schema, - table: "WorkflowDefinitions"); - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Management/20250222190857_V3_4.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Management/20250222190857_V3_4.Designer.cs deleted file mode 100644 index e46a734a3a..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Management/20250222190857_V3_4.Designer.cs +++ /dev/null @@ -1,232 +0,0 @@ -// -using System; -using Elsa.EntityFrameworkCore.Modules.Management; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.SqlServer.Migrations.Management -{ - [DbContext(typeof(ManagementElsaDbContext))] - [Migration("20250222190857_V3_4")] - partial class V3_4 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "8.0.12") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); - - modelBuilder.Entity("Elsa.Workflows.Management.Entities.WorkflowDefinition", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("BinaryData") - .HasColumnType("varbinary(max)"); - - b.Property("CreatedAt") - .HasColumnType("datetimeoffset"); - - b.Property("Data") - .HasColumnType("nvarchar(max)"); - - b.Property("DefinitionId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("Description") - .HasColumnType("nvarchar(max)"); - - b.Property("IsLatest") - .HasColumnType("bit"); - - b.Property("IsPublished") - .HasColumnType("bit"); - - b.Property("IsReadonly") - .HasColumnType("bit"); - - b.Property("IsSystem") - .HasColumnType("bit"); - - b.Property("MaterializerContext") - .HasColumnType("nvarchar(max)"); - - b.Property("MaterializerName") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Name") - .HasColumnType("nvarchar(450)"); - - b.Property("ProviderName") - .HasColumnType("nvarchar(max)"); - - b.Property("StringData") - .HasColumnType("nvarchar(max)"); - - b.Property("TenantId") - .HasColumnType("nvarchar(450)"); - - b.Property("ToolVersion") - .HasColumnType("nvarchar(max)"); - - b.Property("UsableAsActivity") - .HasColumnType("bit"); - - b.Property("Version") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("IsLatest") - .HasDatabaseName("IX_WorkflowDefinition_IsLatest"); - - b.HasIndex("IsPublished") - .HasDatabaseName("IX_WorkflowDefinition_IsPublished"); - - b.HasIndex("IsSystem") - .HasDatabaseName("IX_WorkflowDefinition_IsSystem"); - - b.HasIndex("Name") - .HasDatabaseName("IX_WorkflowDefinition_Name"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_WorkflowDefinition_TenantId"); - - b.HasIndex("UsableAsActivity") - .HasDatabaseName("IX_WorkflowDefinition_UsableAsActivity"); - - b.HasIndex("Version") - .HasDatabaseName("IX_WorkflowDefinition_Version"); - - b.HasIndex("DefinitionId", "Version") - .IsUnique() - .HasDatabaseName("IX_WorkflowDefinition_DefinitionId_Version"); - - b.ToTable("WorkflowDefinitions", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Management.Entities.WorkflowInstance", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("CorrelationId") - .HasColumnType("nvarchar(450)"); - - b.Property("CreatedAt") - .HasColumnType("datetimeoffset"); - - b.Property("Data") - .HasColumnType("nvarchar(max)"); - - b.Property("DataCompressionAlgorithm") - .HasColumnType("nvarchar(max)"); - - b.Property("DefinitionId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("DefinitionVersionId") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("FinishedAt") - .HasColumnType("datetimeoffset"); - - b.Property("IncidentCount") - .HasColumnType("int"); - - b.Property("IsExecuting") - .HasColumnType("bit"); - - b.Property("IsSystem") - .HasColumnType("bit"); - - b.Property("Name") - .HasColumnType("nvarchar(450)"); - - b.Property("ParentWorkflowInstanceId") - .HasColumnType("nvarchar(max)"); - - b.Property("Status") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("SubStatus") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("TenantId") - .HasColumnType("nvarchar(450)"); - - b.Property("UpdatedAt") - .HasColumnType("datetimeoffset"); - - b.Property("Version") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CorrelationId") - .HasDatabaseName("IX_WorkflowInstance_CorrelationId"); - - b.HasIndex("CreatedAt") - .HasDatabaseName("IX_WorkflowInstance_CreatedAt"); - - b.HasIndex("DefinitionId") - .HasDatabaseName("IX_WorkflowInstance_DefinitionId"); - - b.HasIndex("FinishedAt") - .HasDatabaseName("IX_WorkflowInstance_FinishedAt"); - - b.HasIndex("IsExecuting") - .HasDatabaseName("IX_WorkflowInstance_IsExecuting"); - - b.HasIndex("IsSystem") - .HasDatabaseName("IX_WorkflowInstance_IsSystem"); - - b.HasIndex("Name") - .HasDatabaseName("IX_WorkflowInstance_Name"); - - b.HasIndex("Status") - .HasDatabaseName("IX_WorkflowInstance_Status"); - - b.HasIndex("SubStatus") - .HasDatabaseName("IX_WorkflowInstance_SubStatus"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_WorkflowInstance_TenantId"); - - b.HasIndex("UpdatedAt") - .HasDatabaseName("IX_WorkflowInstance_UpdatedAt"); - - b.HasIndex("Status", "DefinitionId") - .HasDatabaseName("IX_WorkflowInstance_Status_DefinitionId"); - - b.HasIndex("Status", "SubStatus") - .HasDatabaseName("IX_WorkflowInstance_Status_SubStatus"); - - b.HasIndex("SubStatus", "DefinitionId") - .HasDatabaseName("IX_WorkflowInstance_SubStatus_DefinitionId"); - - b.HasIndex("Status", "SubStatus", "DefinitionId", "Version") - .HasDatabaseName("IX_WorkflowInstance_Status_SubStatus_DefinitionId_Version"); - - b.ToTable("WorkflowInstances", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Management/20250222190857_V3_4.cs b/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Management/20250222190857_V3_4.cs deleted file mode 100644 index e09db23abd..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Management/20250222190857_V3_4.cs +++ /dev/null @@ -1,50 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.SqlServer.Migrations.Management -{ - /// - public partial class V3_4 : Migration - { - private readonly Elsa.EntityFrameworkCore.IElsaDbContextSchema _schema; - - /// - public V3_4(Elsa.EntityFrameworkCore.IElsaDbContextSchema schema) - { - _schema = schema; - } - - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "IsExecuting", - schema: _schema.Schema, - table: "WorkflowInstances", - type: "bit", - nullable: false, - defaultValue: false); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowInstance_IsExecuting", - schema: _schema.Schema, - table: "WorkflowInstances", - column: "IsExecuting"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropIndex( - name: "IX_WorkflowInstance_IsExecuting", - schema: _schema.Schema, - table: "WorkflowInstances"); - - migrationBuilder.DropColumn( - name: "IsExecuting", - schema: _schema.Schema, - table: "WorkflowInstances"); - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Management/ManagementElsaDbContextModelSnapshot.cs b/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Management/ManagementElsaDbContextModelSnapshot.cs deleted file mode 100644 index 5bbe0d3396..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Management/ManagementElsaDbContextModelSnapshot.cs +++ /dev/null @@ -1,229 +0,0 @@ -// -using System; -using Elsa.EntityFrameworkCore.Modules.Management; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.SqlServer.Migrations.Management -{ - [DbContext(typeof(ManagementElsaDbContext))] - partial class ManagementElsaDbContextModelSnapshot : ModelSnapshot - { - protected override void BuildModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "8.0.12") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); - - modelBuilder.Entity("Elsa.Workflows.Management.Entities.WorkflowDefinition", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("BinaryData") - .HasColumnType("varbinary(max)"); - - b.Property("CreatedAt") - .HasColumnType("datetimeoffset"); - - b.Property("Data") - .HasColumnType("nvarchar(max)"); - - b.Property("DefinitionId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("Description") - .HasColumnType("nvarchar(max)"); - - b.Property("IsLatest") - .HasColumnType("bit"); - - b.Property("IsPublished") - .HasColumnType("bit"); - - b.Property("IsReadonly") - .HasColumnType("bit"); - - b.Property("IsSystem") - .HasColumnType("bit"); - - b.Property("MaterializerContext") - .HasColumnType("nvarchar(max)"); - - b.Property("MaterializerName") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Name") - .HasColumnType("nvarchar(450)"); - - b.Property("ProviderName") - .HasColumnType("nvarchar(max)"); - - b.Property("StringData") - .HasColumnType("nvarchar(max)"); - - b.Property("TenantId") - .HasColumnType("nvarchar(450)"); - - b.Property("ToolVersion") - .HasColumnType("nvarchar(max)"); - - b.Property("UsableAsActivity") - .HasColumnType("bit"); - - b.Property("Version") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("IsLatest") - .HasDatabaseName("IX_WorkflowDefinition_IsLatest"); - - b.HasIndex("IsPublished") - .HasDatabaseName("IX_WorkflowDefinition_IsPublished"); - - b.HasIndex("IsSystem") - .HasDatabaseName("IX_WorkflowDefinition_IsSystem"); - - b.HasIndex("Name") - .HasDatabaseName("IX_WorkflowDefinition_Name"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_WorkflowDefinition_TenantId"); - - b.HasIndex("UsableAsActivity") - .HasDatabaseName("IX_WorkflowDefinition_UsableAsActivity"); - - b.HasIndex("Version") - .HasDatabaseName("IX_WorkflowDefinition_Version"); - - b.HasIndex("DefinitionId", "Version") - .IsUnique() - .HasDatabaseName("IX_WorkflowDefinition_DefinitionId_Version"); - - b.ToTable("WorkflowDefinitions", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Management.Entities.WorkflowInstance", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("CorrelationId") - .HasColumnType("nvarchar(450)"); - - b.Property("CreatedAt") - .HasColumnType("datetimeoffset"); - - b.Property("Data") - .HasColumnType("nvarchar(max)"); - - b.Property("DataCompressionAlgorithm") - .HasColumnType("nvarchar(max)"); - - b.Property("DefinitionId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("DefinitionVersionId") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("FinishedAt") - .HasColumnType("datetimeoffset"); - - b.Property("IncidentCount") - .HasColumnType("int"); - - b.Property("IsExecuting") - .HasColumnType("bit"); - - b.Property("IsSystem") - .HasColumnType("bit"); - - b.Property("Name") - .HasColumnType("nvarchar(450)"); - - b.Property("ParentWorkflowInstanceId") - .HasColumnType("nvarchar(max)"); - - b.Property("Status") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("SubStatus") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("TenantId") - .HasColumnType("nvarchar(450)"); - - b.Property("UpdatedAt") - .HasColumnType("datetimeoffset"); - - b.Property("Version") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CorrelationId") - .HasDatabaseName("IX_WorkflowInstance_CorrelationId"); - - b.HasIndex("CreatedAt") - .HasDatabaseName("IX_WorkflowInstance_CreatedAt"); - - b.HasIndex("DefinitionId") - .HasDatabaseName("IX_WorkflowInstance_DefinitionId"); - - b.HasIndex("FinishedAt") - .HasDatabaseName("IX_WorkflowInstance_FinishedAt"); - - b.HasIndex("IsExecuting") - .HasDatabaseName("IX_WorkflowInstance_IsExecuting"); - - b.HasIndex("IsSystem") - .HasDatabaseName("IX_WorkflowInstance_IsSystem"); - - b.HasIndex("Name") - .HasDatabaseName("IX_WorkflowInstance_Name"); - - b.HasIndex("Status") - .HasDatabaseName("IX_WorkflowInstance_Status"); - - b.HasIndex("SubStatus") - .HasDatabaseName("IX_WorkflowInstance_SubStatus"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_WorkflowInstance_TenantId"); - - b.HasIndex("UpdatedAt") - .HasDatabaseName("IX_WorkflowInstance_UpdatedAt"); - - b.HasIndex("Status", "DefinitionId") - .HasDatabaseName("IX_WorkflowInstance_Status_DefinitionId"); - - b.HasIndex("Status", "SubStatus") - .HasDatabaseName("IX_WorkflowInstance_Status_SubStatus"); - - b.HasIndex("SubStatus", "DefinitionId") - .HasDatabaseName("IX_WorkflowInstance_SubStatus_DefinitionId"); - - b.HasIndex("Status", "SubStatus", "DefinitionId", "Version") - .HasDatabaseName("IX_WorkflowInstance_Status_SubStatus_DefinitionId_Version"); - - b.ToTable("WorkflowInstances", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Runtime/20231024160944_Initial.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Runtime/20231024160944_Initial.Designer.cs deleted file mode 100644 index fc51ee6819..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Runtime/20231024160944_Initial.Designer.cs +++ /dev/null @@ -1,388 +0,0 @@ -// -using System; -using Elsa.EntityFrameworkCore.Modules.Runtime; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.SqlServer.Migrations.Runtime -{ - [DbContext(typeof(RuntimeElsaDbContext))] - [Migration("20231024160944_Initial")] - partial class Initial - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "7.0.11") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.ActivityExecutionRecord", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityName") - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityNodeId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityType") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityTypeVersion") - .HasColumnType("int"); - - b.Property("CompletedAt") - .HasColumnType("datetimeoffset"); - - b.Property("HasBookmarks") - .HasColumnType("bit"); - - b.Property("SerializedActivityState") - .HasColumnType("nvarchar(max)"); - - b.Property("SerializedException") - .HasColumnType("nvarchar(max)"); - - b.Property("SerializedOutputs") - .HasColumnType("nvarchar(max)"); - - b.Property("SerializedPayload") - .HasColumnType("nvarchar(max)"); - - b.Property("StartedAt") - .HasColumnType("datetimeoffset"); - - b.Property("Status") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("ActivityId") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityId"); - - b.HasIndex("ActivityName") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityName"); - - b.HasIndex("ActivityNodeId") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityNodeId"); - - b.HasIndex("ActivityType") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityType"); - - b.HasIndex("ActivityTypeVersion") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityTypeVersion"); - - b.HasIndex("CompletedAt") - .HasDatabaseName("IX_ActivityExecutionRecord_CompletedAt"); - - b.HasIndex("HasBookmarks") - .HasDatabaseName("IX_ActivityExecutionRecord_HasBookmarks"); - - b.HasIndex("StartedAt") - .HasDatabaseName("IX_ActivityExecutionRecord_StartedAt"); - - b.HasIndex("Status") - .HasDatabaseName("IX_ActivityExecutionRecord_Status"); - - b.HasIndex("WorkflowInstanceId") - .HasDatabaseName("IX_ActivityExecutionRecord_WorkflowInstanceId"); - - b.HasIndex("ActivityType", "ActivityTypeVersion") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityType_ActivityTypeVersion"); - - b.ToTable("ActivityExecutionRecords", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.StoredBookmark", b => - { - b.Property("BookmarkId") - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityInstanceId") - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityTypeName") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("CorrelationId") - .HasColumnType("nvarchar(max)"); - - b.Property("CreatedAt") - .HasColumnType("datetimeoffset"); - - b.Property("Hash") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("SerializedMetadata") - .HasColumnType("nvarchar(max)"); - - b.Property("SerializedPayload") - .HasColumnType("nvarchar(max)"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("BookmarkId"); - - b.HasIndex(new[] { "ActivityInstanceId" }, "IX_StoredBookmark_ActivityInstanceId"); - - b.HasIndex(new[] { "ActivityTypeName" }, "IX_StoredBookmark_ActivityTypeName"); - - b.HasIndex(new[] { "ActivityTypeName", "Hash" }, "IX_StoredBookmark_ActivityTypeName_Hash"); - - b.HasIndex(new[] { "ActivityTypeName", "Hash", "WorkflowInstanceId" }, "IX_StoredBookmark_ActivityTypeName_Hash_WorkflowInstanceId"); - - b.HasIndex(new[] { "CreatedAt" }, "IX_StoredBookmark_CreatedAt"); - - b.HasIndex(new[] { "Hash" }, "IX_StoredBookmark_Hash"); - - b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_StoredBookmark_WorkflowInstanceId"); - - b.ToTable("Bookmarks", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.StoredTrigger", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityId") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Hash") - .HasColumnType("nvarchar(450)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("SerializedPayload") - .HasColumnType("nvarchar(max)"); - - b.Property("WorkflowDefinitionId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("WorkflowDefinitionVersionId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("Hash") - .HasDatabaseName("IX_StoredTrigger_Hash"); - - b.HasIndex("Name") - .HasDatabaseName("IX_StoredTrigger_Name"); - - b.HasIndex("WorkflowDefinitionId") - .HasDatabaseName("IX_StoredTrigger_WorkflowDefinitionId"); - - b.HasIndex("WorkflowDefinitionVersionId") - .HasDatabaseName("IX_StoredTrigger_WorkflowDefinitionVersionId"); - - b.ToTable("Triggers", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.WorkflowExecutionLogRecord", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityInstanceId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityName") - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityNodeId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityType") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityTypeVersion") - .HasColumnType("int"); - - b.Property("EventName") - .HasColumnType("nvarchar(450)"); - - b.Property("Message") - .HasColumnType("nvarchar(max)"); - - b.Property("ParentActivityInstanceId") - .HasColumnType("nvarchar(450)"); - - b.Property("Sequence") - .HasColumnType("bigint"); - - b.Property("SerializedActivityState") - .HasColumnType("nvarchar(max)"); - - b.Property("SerializedPayload") - .HasColumnType("nvarchar(max)"); - - b.Property("Source") - .HasColumnType("nvarchar(max)"); - - b.Property("Timestamp") - .HasColumnType("datetimeoffset"); - - b.Property("WorkflowDefinitionId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("WorkflowDefinitionVersionId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("WorkflowVersion") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("ActivityId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityId"); - - b.HasIndex("ActivityInstanceId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityInstanceId"); - - b.HasIndex("ActivityName") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityName"); - - b.HasIndex("ActivityNodeId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityNodeId"); - - b.HasIndex("ActivityType") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityType"); - - b.HasIndex("ActivityTypeVersion") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityTypeVersion"); - - b.HasIndex("EventName") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_EventName"); - - b.HasIndex("ParentActivityInstanceId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ParentActivityInstanceId"); - - b.HasIndex("Sequence") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_Sequence"); - - b.HasIndex("Timestamp") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_Timestamp"); - - b.HasIndex("WorkflowDefinitionId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowDefinitionId"); - - b.HasIndex("WorkflowDefinitionVersionId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowDefinitionVersionId"); - - b.HasIndex("WorkflowInstanceId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowInstanceId"); - - b.HasIndex("WorkflowVersion") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowVersion"); - - b.HasIndex("ActivityType", "ActivityTypeVersion") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityType_ActivityTypeVersion"); - - b.HasIndex("Timestamp", "Sequence") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_Timestamp_Sequence"); - - b.ToTable("WorkflowExecutionLogRecords", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.WorkflowInboxMessage", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityInstanceId") - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityTypeName") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("CorrelationId") - .HasColumnType("nvarchar(450)"); - - b.Property("CreatedAt") - .HasColumnType("datetimeoffset"); - - b.Property("ExpiresAt") - .HasColumnType("datetimeoffset"); - - b.Property("Hash") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("SerializedBookmarkPayload") - .HasColumnType("nvarchar(max)"); - - b.Property("SerializedInput") - .HasColumnType("nvarchar(max)"); - - b.Property("WorkflowInstanceId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "ActivityInstanceId" }, "IX_WorkflowInboxMessage_ActivityInstanceId"); - - b.HasIndex(new[] { "ActivityTypeName" }, "IX_WorkflowInboxMessage_ActivityTypeName"); - - b.HasIndex(new[] { "CorrelationId" }, "IX_WorkflowInboxMessage_CorrelationId"); - - b.HasIndex(new[] { "CreatedAt" }, "IX_WorkflowInboxMessage_CreatedAt"); - - b.HasIndex(new[] { "ExpiresAt" }, "IX_WorkflowInboxMessage_ExpiresAt"); - - b.HasIndex(new[] { "Hash" }, "IX_WorkflowInboxMessage_Hash"); - - b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_WorkflowInboxMessage_WorkflowInstanceId"); - - b.ToTable("WorkflowInboxMessages", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Runtime/20231024160944_Initial.cs b/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Runtime/20231024160944_Initial.cs deleted file mode 100644 index 85ae54f441..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Runtime/20231024160944_Initial.cs +++ /dev/null @@ -1,432 +0,0 @@ -using Elsa.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.SqlServer.Migrations.Runtime -{ - /// - public partial class Initial : Migration - { - private readonly IElsaDbContextSchema _schema; - public Initial(IElsaDbContextSchema schema) - { - _schema = schema ?? throw new ArgumentNullException(nameof(schema)); - } - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.EnsureSchema( - name: _schema.Schema); - - migrationBuilder.CreateTable( - name: "ActivityExecutionRecords", - schema: _schema.Schema, - columns: table => new - { - Id = table.Column(type: "nvarchar(450)", nullable: false), - WorkflowInstanceId = table.Column(type: "nvarchar(450)", nullable: false), - ActivityId = table.Column(type: "nvarchar(450)", nullable: false), - ActivityNodeId = table.Column(type: "nvarchar(450)", nullable: false), - ActivityType = table.Column(type: "nvarchar(450)", nullable: false), - ActivityTypeVersion = table.Column(type: "int", nullable: false), - ActivityName = table.Column(type: "nvarchar(450)", nullable: true), - StartedAt = table.Column(type: "datetimeoffset", nullable: false), - HasBookmarks = table.Column(type: "bit", nullable: false), - Status = table.Column(type: "nvarchar(450)", nullable: false), - CompletedAt = table.Column(type: "datetimeoffset", nullable: true), - SerializedActivityState = table.Column(type: "nvarchar(max)", nullable: true), - SerializedException = table.Column(type: "nvarchar(max)", nullable: true), - SerializedOutputs = table.Column(type: "nvarchar(max)", nullable: true), - SerializedPayload = table.Column(type: "nvarchar(max)", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_ActivityExecutionRecords", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "Bookmarks", - schema: _schema.Schema, - columns: table => new - { - BookmarkId = table.Column(type: "nvarchar(450)", nullable: false), - ActivityTypeName = table.Column(type: "nvarchar(450)", nullable: false), - Hash = table.Column(type: "nvarchar(450)", nullable: false), - WorkflowInstanceId = table.Column(type: "nvarchar(450)", nullable: false), - ActivityInstanceId = table.Column(type: "nvarchar(450)", nullable: true), - CorrelationId = table.Column(type: "nvarchar(max)", nullable: true), - CreatedAt = table.Column(type: "datetimeoffset", nullable: false), - SerializedMetadata = table.Column(type: "nvarchar(max)", nullable: true), - SerializedPayload = table.Column(type: "nvarchar(max)", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Bookmarks", x => x.BookmarkId); - }); - - migrationBuilder.CreateTable( - name: "Triggers", - schema: _schema.Schema, - columns: table => new - { - Id = table.Column(type: "nvarchar(450)", nullable: false), - WorkflowDefinitionId = table.Column(type: "nvarchar(450)", nullable: false), - WorkflowDefinitionVersionId = table.Column(type: "nvarchar(450)", nullable: false), - Name = table.Column(type: "nvarchar(450)", nullable: false), - ActivityId = table.Column(type: "nvarchar(max)", nullable: false), - Hash = table.Column(type: "nvarchar(450)", nullable: true), - SerializedPayload = table.Column(type: "nvarchar(max)", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Triggers", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "WorkflowExecutionLogRecords", - schema: _schema.Schema, - columns: table => new - { - Id = table.Column(type: "nvarchar(450)", nullable: false), - WorkflowDefinitionId = table.Column(type: "nvarchar(450)", nullable: false), - WorkflowDefinitionVersionId = table.Column(type: "nvarchar(450)", nullable: false), - WorkflowInstanceId = table.Column(type: "nvarchar(450)", nullable: false), - WorkflowVersion = table.Column(type: "int", nullable: false), - ActivityInstanceId = table.Column(type: "nvarchar(450)", nullable: false), - ParentActivityInstanceId = table.Column(type: "nvarchar(450)", nullable: true), - ActivityId = table.Column(type: "nvarchar(450)", nullable: false), - ActivityType = table.Column(type: "nvarchar(450)", nullable: false), - ActivityTypeVersion = table.Column(type: "int", nullable: false), - ActivityName = table.Column(type: "nvarchar(450)", nullable: true), - ActivityNodeId = table.Column(type: "nvarchar(450)", nullable: false), - Timestamp = table.Column(type: "datetimeoffset", nullable: false), - Sequence = table.Column(type: "bigint", nullable: false), - EventName = table.Column(type: "nvarchar(450)", nullable: true), - Message = table.Column(type: "nvarchar(max)", nullable: true), - Source = table.Column(type: "nvarchar(max)", nullable: true), - SerializedActivityState = table.Column(type: "nvarchar(max)", nullable: true), - SerializedPayload = table.Column(type: "nvarchar(max)", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_WorkflowExecutionLogRecords", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "WorkflowInboxMessages", - schema: _schema.Schema, - columns: table => new - { - Id = table.Column(type: "nvarchar(450)", nullable: false), - ActivityTypeName = table.Column(type: "nvarchar(450)", nullable: false), - Hash = table.Column(type: "nvarchar(450)", nullable: false), - WorkflowInstanceId = table.Column(type: "nvarchar(450)", nullable: true), - CorrelationId = table.Column(type: "nvarchar(450)", nullable: true), - ActivityInstanceId = table.Column(type: "nvarchar(450)", nullable: true), - CreatedAt = table.Column(type: "datetimeoffset", nullable: false), - ExpiresAt = table.Column(type: "datetimeoffset", nullable: false), - SerializedBookmarkPayload = table.Column(type: "nvarchar(max)", nullable: true), - SerializedInput = table.Column(type: "nvarchar(max)", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_WorkflowInboxMessages", x => x.Id); - }); - - migrationBuilder.CreateIndex( - name: "IX_ActivityExecutionRecord_ActivityId", - schema: _schema.Schema, - table: "ActivityExecutionRecords", - column: "ActivityId"); - - migrationBuilder.CreateIndex( - name: "IX_ActivityExecutionRecord_ActivityName", - schema: _schema.Schema, - table: "ActivityExecutionRecords", - column: "ActivityName"); - - migrationBuilder.CreateIndex( - name: "IX_ActivityExecutionRecord_ActivityNodeId", - schema: _schema.Schema, - table: "ActivityExecutionRecords", - column: "ActivityNodeId"); - - migrationBuilder.CreateIndex( - name: "IX_ActivityExecutionRecord_ActivityType", - schema: _schema.Schema, - table: "ActivityExecutionRecords", - column: "ActivityType"); - - migrationBuilder.CreateIndex( - name: "IX_ActivityExecutionRecord_ActivityType_ActivityTypeVersion", - schema: _schema.Schema, - table: "ActivityExecutionRecords", - columns: new[] { "ActivityType", "ActivityTypeVersion" }); - - migrationBuilder.CreateIndex( - name: "IX_ActivityExecutionRecord_ActivityTypeVersion", - schema: _schema.Schema, - table: "ActivityExecutionRecords", - column: "ActivityTypeVersion"); - - migrationBuilder.CreateIndex( - name: "IX_ActivityExecutionRecord_CompletedAt", - schema: _schema.Schema, - table: "ActivityExecutionRecords", - column: "CompletedAt"); - - migrationBuilder.CreateIndex( - name: "IX_ActivityExecutionRecord_HasBookmarks", - schema: _schema.Schema, - table: "ActivityExecutionRecords", - column: "HasBookmarks"); - - migrationBuilder.CreateIndex( - name: "IX_ActivityExecutionRecord_StartedAt", - schema: _schema.Schema, - table: "ActivityExecutionRecords", - column: "StartedAt"); - - migrationBuilder.CreateIndex( - name: "IX_ActivityExecutionRecord_Status", - schema: _schema.Schema, - table: "ActivityExecutionRecords", - column: "Status"); - - migrationBuilder.CreateIndex( - name: "IX_ActivityExecutionRecord_WorkflowInstanceId", - schema: _schema.Schema, - table: "ActivityExecutionRecords", - column: "WorkflowInstanceId"); - - migrationBuilder.CreateIndex( - name: "IX_StoredBookmark_ActivityInstanceId", - schema: _schema.Schema, - table: "Bookmarks", - column: "ActivityInstanceId"); - - migrationBuilder.CreateIndex( - name: "IX_StoredBookmark_ActivityTypeName", - schema: _schema.Schema, - table: "Bookmarks", - column: "ActivityTypeName"); - - migrationBuilder.CreateIndex( - name: "IX_StoredBookmark_ActivityTypeName_Hash", - schema: _schema.Schema, - table: "Bookmarks", - columns: new[] { "ActivityTypeName", "Hash" }); - - migrationBuilder.CreateIndex( - name: "IX_StoredBookmark_ActivityTypeName_Hash_WorkflowInstanceId", - schema: _schema.Schema, - table: "Bookmarks", - columns: new[] { "ActivityTypeName", "Hash", "WorkflowInstanceId" }); - - migrationBuilder.CreateIndex( - name: "IX_StoredBookmark_CreatedAt", - schema: _schema.Schema, - table: "Bookmarks", - column: "CreatedAt"); - - migrationBuilder.CreateIndex( - name: "IX_StoredBookmark_Hash", - schema: _schema.Schema, - table: "Bookmarks", - column: "Hash"); - - migrationBuilder.CreateIndex( - name: "IX_StoredBookmark_WorkflowInstanceId", - schema: _schema.Schema, - table: "Bookmarks", - column: "WorkflowInstanceId"); - - migrationBuilder.CreateIndex( - name: "IX_StoredTrigger_Hash", - schema: _schema.Schema, - table: "Triggers", - column: "Hash"); - - migrationBuilder.CreateIndex( - name: "IX_StoredTrigger_Name", - schema: _schema.Schema, - table: "Triggers", - column: "Name"); - - migrationBuilder.CreateIndex( - name: "IX_StoredTrigger_WorkflowDefinitionId", - schema: _schema.Schema, - table: "Triggers", - column: "WorkflowDefinitionId"); - - migrationBuilder.CreateIndex( - name: "IX_StoredTrigger_WorkflowDefinitionVersionId", - schema: _schema.Schema, - table: "Triggers", - column: "WorkflowDefinitionVersionId"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowExecutionLogRecord_ActivityId", - schema: _schema.Schema, - table: "WorkflowExecutionLogRecords", - column: "ActivityId"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowExecutionLogRecord_ActivityInstanceId", - schema: _schema.Schema, - table: "WorkflowExecutionLogRecords", - column: "ActivityInstanceId"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowExecutionLogRecord_ActivityName", - schema: _schema.Schema, - table: "WorkflowExecutionLogRecords", - column: "ActivityName"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowExecutionLogRecord_ActivityNodeId", - schema: _schema.Schema, - table: "WorkflowExecutionLogRecords", - column: "ActivityNodeId"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowExecutionLogRecord_ActivityType", - schema: _schema.Schema, - table: "WorkflowExecutionLogRecords", - column: "ActivityType"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowExecutionLogRecord_ActivityType_ActivityTypeVersion", - schema: _schema.Schema, - table: "WorkflowExecutionLogRecords", - columns: new[] { "ActivityType", "ActivityTypeVersion" }); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowExecutionLogRecord_ActivityTypeVersion", - schema: _schema.Schema, - table: "WorkflowExecutionLogRecords", - column: "ActivityTypeVersion"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowExecutionLogRecord_EventName", - schema: _schema.Schema, - table: "WorkflowExecutionLogRecords", - column: "EventName"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowExecutionLogRecord_ParentActivityInstanceId", - schema: _schema.Schema, - table: "WorkflowExecutionLogRecords", - column: "ParentActivityInstanceId"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowExecutionLogRecord_Sequence", - schema: _schema.Schema, - table: "WorkflowExecutionLogRecords", - column: "Sequence"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowExecutionLogRecord_Timestamp", - schema: _schema.Schema, - table: "WorkflowExecutionLogRecords", - column: "Timestamp"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowExecutionLogRecord_Timestamp_Sequence", - schema: _schema.Schema, - table: "WorkflowExecutionLogRecords", - columns: new[] { "Timestamp", "Sequence" }); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowExecutionLogRecord_WorkflowDefinitionId", - schema: _schema.Schema, - table: "WorkflowExecutionLogRecords", - column: "WorkflowDefinitionId"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowExecutionLogRecord_WorkflowDefinitionVersionId", - schema: _schema.Schema, - table: "WorkflowExecutionLogRecords", - column: "WorkflowDefinitionVersionId"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowExecutionLogRecord_WorkflowInstanceId", - schema: _schema.Schema, - table: "WorkflowExecutionLogRecords", - column: "WorkflowInstanceId"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowExecutionLogRecord_WorkflowVersion", - schema: _schema.Schema, - table: "WorkflowExecutionLogRecords", - column: "WorkflowVersion"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowInboxMessage_ActivityInstanceId", - schema: _schema.Schema, - table: "WorkflowInboxMessages", - column: "ActivityInstanceId"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowInboxMessage_ActivityTypeName", - schema: _schema.Schema, - table: "WorkflowInboxMessages", - column: "ActivityTypeName"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowInboxMessage_CorrelationId", - schema: _schema.Schema, - table: "WorkflowInboxMessages", - column: "CorrelationId"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowInboxMessage_CreatedAt", - schema: _schema.Schema, - table: "WorkflowInboxMessages", - column: "CreatedAt"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowInboxMessage_ExpiresAt", - schema: _schema.Schema, - table: "WorkflowInboxMessages", - column: "ExpiresAt"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowInboxMessage_Hash", - schema: _schema.Schema, - table: "WorkflowInboxMessages", - column: "Hash"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowInboxMessage_WorkflowInstanceId", - schema: _schema.Schema, - table: "WorkflowInboxMessages", - column: "WorkflowInstanceId"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "ActivityExecutionRecords", - schema: _schema.Schema); - - migrationBuilder.DropTable( - name: "Bookmarks", - schema: _schema.Schema); - - migrationBuilder.DropTable( - name: "Triggers", - schema: _schema.Schema); - - migrationBuilder.DropTable( - name: "WorkflowExecutionLogRecords", - schema: _schema.Schema); - - migrationBuilder.DropTable( - name: "WorkflowInboxMessages", - schema: _schema.Schema); - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Runtime/20240329200657_V3_1.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Runtime/20240329200657_V3_1.Designer.cs deleted file mode 100644 index 2c345fdd73..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Runtime/20240329200657_V3_1.Designer.cs +++ /dev/null @@ -1,408 +0,0 @@ -// -using System; -using Elsa.EntityFrameworkCore.Modules.Runtime; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.SqlServer.Migrations.Runtime -{ - [DbContext(typeof(RuntimeElsaDbContext))] - [Migration("20240329200657_V3_1")] - partial class V3_1 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "7.0.14") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); - - modelBuilder.Entity("Elsa.KeyValues.Entities.SerializedKeyValuePair", b => - { - b.Property("Key") - .HasColumnType("nvarchar(450)"); - - b.Property("SerializedValue") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.HasKey("Key"); - - b.ToTable("KeyValuePairs", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.ActivityExecutionRecord", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityName") - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityNodeId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityType") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityTypeVersion") - .HasColumnType("int"); - - b.Property("CompletedAt") - .HasColumnType("datetimeoffset"); - - b.Property("HasBookmarks") - .HasColumnType("bit"); - - b.Property("SerializedActivityState") - .HasColumnType("nvarchar(max)"); - - b.Property("SerializedActivityStateCompressionAlgorithm") - .HasColumnType("nvarchar(max)"); - - b.Property("SerializedException") - .HasColumnType("nvarchar(max)"); - - b.Property("SerializedOutputs") - .HasColumnType("nvarchar(max)"); - - b.Property("SerializedPayload") - .HasColumnType("nvarchar(max)"); - - b.Property("SerializedProperties") - .HasColumnType("nvarchar(max)"); - - b.Property("StartedAt") - .HasColumnType("datetimeoffset"); - - b.Property("Status") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("ActivityId") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityId"); - - b.HasIndex("ActivityName") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityName"); - - b.HasIndex("ActivityNodeId") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityNodeId"); - - b.HasIndex("ActivityType") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityType"); - - b.HasIndex("ActivityTypeVersion") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityTypeVersion"); - - b.HasIndex("CompletedAt") - .HasDatabaseName("IX_ActivityExecutionRecord_CompletedAt"); - - b.HasIndex("HasBookmarks") - .HasDatabaseName("IX_ActivityExecutionRecord_HasBookmarks"); - - b.HasIndex("StartedAt") - .HasDatabaseName("IX_ActivityExecutionRecord_StartedAt"); - - b.HasIndex("Status") - .HasDatabaseName("IX_ActivityExecutionRecord_Status"); - - b.HasIndex("WorkflowInstanceId") - .HasDatabaseName("IX_ActivityExecutionRecord_WorkflowInstanceId"); - - b.HasIndex("ActivityType", "ActivityTypeVersion") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityType_ActivityTypeVersion"); - - b.ToTable("ActivityExecutionRecords", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.StoredBookmark", b => - { - b.Property("BookmarkId") - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityInstanceId") - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityTypeName") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("CorrelationId") - .HasColumnType("nvarchar(max)"); - - b.Property("CreatedAt") - .HasColumnType("datetimeoffset"); - - b.Property("Hash") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("SerializedMetadata") - .HasColumnType("nvarchar(max)"); - - b.Property("SerializedPayload") - .HasColumnType("nvarchar(max)"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("BookmarkId"); - - b.HasIndex(new[] { "ActivityInstanceId" }, "IX_StoredBookmark_ActivityInstanceId"); - - b.HasIndex(new[] { "ActivityTypeName" }, "IX_StoredBookmark_ActivityTypeName"); - - b.HasIndex(new[] { "ActivityTypeName", "Hash" }, "IX_StoredBookmark_ActivityTypeName_Hash"); - - b.HasIndex(new[] { "ActivityTypeName", "Hash", "WorkflowInstanceId" }, "IX_StoredBookmark_ActivityTypeName_Hash_WorkflowInstanceId"); - - b.HasIndex(new[] { "CreatedAt" }, "IX_StoredBookmark_CreatedAt"); - - b.HasIndex(new[] { "Hash" }, "IX_StoredBookmark_Hash"); - - b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_StoredBookmark_WorkflowInstanceId"); - - b.ToTable("Bookmarks", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.StoredTrigger", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityId") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Hash") - .HasColumnType("nvarchar(450)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("SerializedPayload") - .HasColumnType("nvarchar(max)"); - - b.Property("WorkflowDefinitionId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("WorkflowDefinitionVersionId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("Hash") - .HasDatabaseName("IX_StoredTrigger_Hash"); - - b.HasIndex("Name") - .HasDatabaseName("IX_StoredTrigger_Name"); - - b.HasIndex("WorkflowDefinitionId") - .HasDatabaseName("IX_StoredTrigger_WorkflowDefinitionId"); - - b.HasIndex("WorkflowDefinitionVersionId") - .HasDatabaseName("IX_StoredTrigger_WorkflowDefinitionVersionId"); - - b.ToTable("Triggers", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.WorkflowExecutionLogRecord", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityInstanceId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityName") - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityNodeId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityType") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityTypeVersion") - .HasColumnType("int"); - - b.Property("EventName") - .HasColumnType("nvarchar(450)"); - - b.Property("Message") - .HasColumnType("nvarchar(max)"); - - b.Property("ParentActivityInstanceId") - .HasColumnType("nvarchar(450)"); - - b.Property("Sequence") - .HasColumnType("bigint"); - - b.Property("SerializedActivityState") - .HasColumnType("nvarchar(max)"); - - b.Property("SerializedPayload") - .HasColumnType("nvarchar(max)"); - - b.Property("Source") - .HasColumnType("nvarchar(max)"); - - b.Property("Timestamp") - .HasColumnType("datetimeoffset"); - - b.Property("WorkflowDefinitionId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("WorkflowDefinitionVersionId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("WorkflowVersion") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("ActivityId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityId"); - - b.HasIndex("ActivityInstanceId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityInstanceId"); - - b.HasIndex("ActivityName") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityName"); - - b.HasIndex("ActivityNodeId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityNodeId"); - - b.HasIndex("ActivityType") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityType"); - - b.HasIndex("ActivityTypeVersion") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityTypeVersion"); - - b.HasIndex("EventName") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_EventName"); - - b.HasIndex("ParentActivityInstanceId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ParentActivityInstanceId"); - - b.HasIndex("Sequence") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_Sequence"); - - b.HasIndex("Timestamp") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_Timestamp"); - - b.HasIndex("WorkflowDefinitionId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowDefinitionId"); - - b.HasIndex("WorkflowDefinitionVersionId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowDefinitionVersionId"); - - b.HasIndex("WorkflowInstanceId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowInstanceId"); - - b.HasIndex("WorkflowVersion") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowVersion"); - - b.HasIndex("ActivityType", "ActivityTypeVersion") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityType_ActivityTypeVersion"); - - b.HasIndex("Timestamp", "Sequence") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_Timestamp_Sequence"); - - b.ToTable("WorkflowExecutionLogRecords", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.WorkflowInboxMessage", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityInstanceId") - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityTypeName") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("CorrelationId") - .HasColumnType("nvarchar(450)"); - - b.Property("CreatedAt") - .HasColumnType("datetimeoffset"); - - b.Property("ExpiresAt") - .HasColumnType("datetimeoffset"); - - b.Property("Hash") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("SerializedBookmarkPayload") - .HasColumnType("nvarchar(max)"); - - b.Property("SerializedInput") - .HasColumnType("nvarchar(max)"); - - b.Property("WorkflowInstanceId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "ActivityInstanceId" }, "IX_WorkflowInboxMessage_ActivityInstanceId"); - - b.HasIndex(new[] { "ActivityTypeName" }, "IX_WorkflowInboxMessage_ActivityTypeName"); - - b.HasIndex(new[] { "CorrelationId" }, "IX_WorkflowInboxMessage_CorrelationId"); - - b.HasIndex(new[] { "CreatedAt" }, "IX_WorkflowInboxMessage_CreatedAt"); - - b.HasIndex(new[] { "ExpiresAt" }, "IX_WorkflowInboxMessage_ExpiresAt"); - - b.HasIndex(new[] { "Hash" }, "IX_WorkflowInboxMessage_Hash"); - - b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_WorkflowInboxMessage_WorkflowInstanceId"); - - b.ToTable("WorkflowInboxMessages", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Runtime/20240329200657_V3_1.cs b/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Runtime/20240329200657_V3_1.cs deleted file mode 100644 index 342469eec1..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Runtime/20240329200657_V3_1.cs +++ /dev/null @@ -1,67 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.SqlServer.Migrations.Runtime -{ - /// - public partial class V3_1 : Migration - { - private readonly Elsa.EntityFrameworkCore.IElsaDbContextSchema _schema; - - /// - public V3_1(Elsa.EntityFrameworkCore.IElsaDbContextSchema schema) - { - _schema = schema; - } - - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "SerializedActivityStateCompressionAlgorithm", - schema: _schema.Schema, - table: "ActivityExecutionRecords", - type: "nvarchar(max)", - nullable: true); - - migrationBuilder.AddColumn( - name: "SerializedProperties", - schema: _schema.Schema, - table: "ActivityExecutionRecords", - type: "nvarchar(max)", - nullable: true); - - migrationBuilder.CreateTable( - name: "KeyValuePairs", - schema: _schema.Schema, - columns: table => new - { - Key = table.Column(type: "nvarchar(450)", nullable: false), - SerializedValue = table.Column(type: "nvarchar(max)", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_KeyValuePairs", x => x.Key); - }); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "KeyValuePairs", - schema: _schema.Schema); - - migrationBuilder.DropColumn( - name: "SerializedActivityStateCompressionAlgorithm", - schema: _schema.Schema, - table: "ActivityExecutionRecords"); - - migrationBuilder.DropColumn( - name: "SerializedProperties", - schema: _schema.Schema, - table: "ActivityExecutionRecords"); - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Runtime/20240610184719_V3_2.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Runtime/20240610184719_V3_2.Designer.cs deleted file mode 100644 index 4112cb97da..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Runtime/20240610184719_V3_2.Designer.cs +++ /dev/null @@ -1,408 +0,0 @@ -// -using System; -using Elsa.EntityFrameworkCore.Modules.Runtime; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.SqlServer.Migrations.Runtime -{ - [DbContext(typeof(RuntimeElsaDbContext))] - [Migration("20240610184719_V3_2")] - partial class V3_2 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "7.0.20") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); - - modelBuilder.Entity("Elsa.KeyValues.Entities.SerializedKeyValuePair", b => - { - b.Property("Key") - .HasColumnType("nvarchar(450)"); - - b.Property("SerializedValue") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.HasKey("Key"); - - b.ToTable("KeyValuePairs", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.ActivityExecutionRecord", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityName") - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityNodeId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityType") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityTypeVersion") - .HasColumnType("int"); - - b.Property("CompletedAt") - .HasColumnType("datetimeoffset"); - - b.Property("HasBookmarks") - .HasColumnType("bit"); - - b.Property("SerializedActivityState") - .HasColumnType("nvarchar(max)"); - - b.Property("SerializedActivityStateCompressionAlgorithm") - .HasColumnType("nvarchar(max)"); - - b.Property("SerializedException") - .HasColumnType("nvarchar(max)"); - - b.Property("SerializedOutputs") - .HasColumnType("nvarchar(max)"); - - b.Property("SerializedPayload") - .HasColumnType("nvarchar(max)"); - - b.Property("SerializedProperties") - .HasColumnType("nvarchar(max)"); - - b.Property("StartedAt") - .HasColumnType("datetimeoffset"); - - b.Property("Status") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("ActivityId") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityId"); - - b.HasIndex("ActivityName") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityName"); - - b.HasIndex("ActivityNodeId") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityNodeId"); - - b.HasIndex("ActivityType") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityType"); - - b.HasIndex("ActivityTypeVersion") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityTypeVersion"); - - b.HasIndex("CompletedAt") - .HasDatabaseName("IX_ActivityExecutionRecord_CompletedAt"); - - b.HasIndex("HasBookmarks") - .HasDatabaseName("IX_ActivityExecutionRecord_HasBookmarks"); - - b.HasIndex("StartedAt") - .HasDatabaseName("IX_ActivityExecutionRecord_StartedAt"); - - b.HasIndex("Status") - .HasDatabaseName("IX_ActivityExecutionRecord_Status"); - - b.HasIndex("WorkflowInstanceId") - .HasDatabaseName("IX_ActivityExecutionRecord_WorkflowInstanceId"); - - b.HasIndex("ActivityType", "ActivityTypeVersion") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityType_ActivityTypeVersion"); - - b.ToTable("ActivityExecutionRecords", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.StoredBookmark", b => - { - b.Property("BookmarkId") - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityInstanceId") - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityTypeName") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("CorrelationId") - .HasColumnType("nvarchar(max)"); - - b.Property("CreatedAt") - .HasColumnType("datetimeoffset"); - - b.Property("Hash") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("SerializedMetadata") - .HasColumnType("nvarchar(max)"); - - b.Property("SerializedPayload") - .HasColumnType("nvarchar(max)"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("BookmarkId"); - - b.HasIndex(new[] { "ActivityInstanceId" }, "IX_StoredBookmark_ActivityInstanceId"); - - b.HasIndex(new[] { "ActivityTypeName" }, "IX_StoredBookmark_ActivityTypeName"); - - b.HasIndex(new[] { "ActivityTypeName", "Hash" }, "IX_StoredBookmark_ActivityTypeName_Hash"); - - b.HasIndex(new[] { "ActivityTypeName", "Hash", "WorkflowInstanceId" }, "IX_StoredBookmark_ActivityTypeName_Hash_WorkflowInstanceId"); - - b.HasIndex(new[] { "CreatedAt" }, "IX_StoredBookmark_CreatedAt"); - - b.HasIndex(new[] { "Hash" }, "IX_StoredBookmark_Hash"); - - b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_StoredBookmark_WorkflowInstanceId"); - - b.ToTable("Bookmarks", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.StoredTrigger", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityId") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Hash") - .HasColumnType("nvarchar(450)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("SerializedPayload") - .HasColumnType("nvarchar(max)"); - - b.Property("WorkflowDefinitionId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("WorkflowDefinitionVersionId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("Hash") - .HasDatabaseName("IX_StoredTrigger_Hash"); - - b.HasIndex("Name") - .HasDatabaseName("IX_StoredTrigger_Name"); - - b.HasIndex("WorkflowDefinitionId") - .HasDatabaseName("IX_StoredTrigger_WorkflowDefinitionId"); - - b.HasIndex("WorkflowDefinitionVersionId") - .HasDatabaseName("IX_StoredTrigger_WorkflowDefinitionVersionId"); - - b.ToTable("Triggers", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.WorkflowExecutionLogRecord", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityInstanceId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityName") - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityNodeId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityType") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityTypeVersion") - .HasColumnType("int"); - - b.Property("EventName") - .HasColumnType("nvarchar(450)"); - - b.Property("Message") - .HasColumnType("nvarchar(max)"); - - b.Property("ParentActivityInstanceId") - .HasColumnType("nvarchar(450)"); - - b.Property("Sequence") - .HasColumnType("bigint"); - - b.Property("SerializedActivityState") - .HasColumnType("nvarchar(max)"); - - b.Property("SerializedPayload") - .HasColumnType("nvarchar(max)"); - - b.Property("Source") - .HasColumnType("nvarchar(max)"); - - b.Property("Timestamp") - .HasColumnType("datetimeoffset"); - - b.Property("WorkflowDefinitionId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("WorkflowDefinitionVersionId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("WorkflowVersion") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("ActivityId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityId"); - - b.HasIndex("ActivityInstanceId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityInstanceId"); - - b.HasIndex("ActivityName") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityName"); - - b.HasIndex("ActivityNodeId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityNodeId"); - - b.HasIndex("ActivityType") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityType"); - - b.HasIndex("ActivityTypeVersion") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityTypeVersion"); - - b.HasIndex("EventName") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_EventName"); - - b.HasIndex("ParentActivityInstanceId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ParentActivityInstanceId"); - - b.HasIndex("Sequence") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_Sequence"); - - b.HasIndex("Timestamp") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_Timestamp"); - - b.HasIndex("WorkflowDefinitionId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowDefinitionId"); - - b.HasIndex("WorkflowDefinitionVersionId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowDefinitionVersionId"); - - b.HasIndex("WorkflowInstanceId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowInstanceId"); - - b.HasIndex("WorkflowVersion") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowVersion"); - - b.HasIndex("ActivityType", "ActivityTypeVersion") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityType_ActivityTypeVersion"); - - b.HasIndex("Timestamp", "Sequence") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_Timestamp_Sequence"); - - b.ToTable("WorkflowExecutionLogRecords", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.WorkflowInboxMessage", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityInstanceId") - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityTypeName") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("CorrelationId") - .HasColumnType("nvarchar(450)"); - - b.Property("CreatedAt") - .HasColumnType("datetimeoffset"); - - b.Property("ExpiresAt") - .HasColumnType("datetimeoffset"); - - b.Property("Hash") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("SerializedBookmarkPayload") - .HasColumnType("nvarchar(max)"); - - b.Property("SerializedInput") - .HasColumnType("nvarchar(max)"); - - b.Property("WorkflowInstanceId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "ActivityInstanceId" }, "IX_WorkflowInboxMessage_ActivityInstanceId"); - - b.HasIndex(new[] { "ActivityTypeName" }, "IX_WorkflowInboxMessage_ActivityTypeName"); - - b.HasIndex(new[] { "CorrelationId" }, "IX_WorkflowInboxMessage_CorrelationId"); - - b.HasIndex(new[] { "CreatedAt" }, "IX_WorkflowInboxMessage_CreatedAt"); - - b.HasIndex(new[] { "ExpiresAt" }, "IX_WorkflowInboxMessage_ExpiresAt"); - - b.HasIndex(new[] { "Hash" }, "IX_WorkflowInboxMessage_Hash"); - - b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_WorkflowInboxMessage_WorkflowInstanceId"); - - b.ToTable("WorkflowInboxMessages", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Runtime/20240610184719_V3_2.cs b/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Runtime/20240610184719_V3_2.cs deleted file mode 100644 index 4f0f4c3efc..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Runtime/20240610184719_V3_2.cs +++ /dev/null @@ -1,30 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.SqlServer.Migrations.Runtime -{ - /// - public partial class V3_2 : Migration - { - private readonly Elsa.EntityFrameworkCore.IElsaDbContextSchema _schema; - - /// - public V3_2(Elsa.EntityFrameworkCore.IElsaDbContextSchema schema) - { - _schema = schema; - } - - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Runtime/20250116192837_V3_3.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Runtime/20250116192837_V3_3.Designer.cs deleted file mode 100644 index 6f59df17bf..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Runtime/20250116192837_V3_3.Designer.cs +++ /dev/null @@ -1,492 +0,0 @@ -// -using System; -using Elsa.EntityFrameworkCore.Modules.Runtime; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.SqlServer.Migrations.Runtime -{ - [DbContext(typeof(RuntimeElsaDbContext))] - [Migration("20250116192837_V3_3")] - partial class V3_3 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "8.0.11") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); - - modelBuilder.Entity("Elsa.KeyValues.Entities.SerializedKeyValuePair", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("SerializedValue") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("TenantId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "TenantId" }, "IX_SerializedKeyValuePair_TenantId"); - - b.ToTable("KeyValuePairs", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.ActivityExecutionRecord", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityName") - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityNodeId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityType") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityTypeVersion") - .HasColumnType("int"); - - b.Property("CompletedAt") - .HasColumnType("datetimeoffset"); - - b.Property("HasBookmarks") - .HasColumnType("bit"); - - b.Property("SerializedActivityState") - .HasColumnType("nvarchar(max)"); - - b.Property("SerializedActivityStateCompressionAlgorithm") - .HasColumnType("nvarchar(max)"); - - b.Property("SerializedException") - .HasColumnType("nvarchar(max)"); - - b.Property("SerializedOutputs") - .HasColumnType("nvarchar(max)"); - - b.Property("SerializedPayload") - .HasColumnType("nvarchar(max)"); - - b.Property("SerializedProperties") - .HasColumnType("nvarchar(max)"); - - b.Property("StartedAt") - .HasColumnType("datetimeoffset"); - - b.Property("Status") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("TenantId") - .HasColumnType("nvarchar(450)"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("ActivityId") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityId"); - - b.HasIndex("ActivityName") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityName"); - - b.HasIndex("ActivityNodeId") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityNodeId"); - - b.HasIndex("ActivityType") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityType"); - - b.HasIndex("ActivityTypeVersion") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityTypeVersion"); - - b.HasIndex("CompletedAt") - .HasDatabaseName("IX_ActivityExecutionRecord_CompletedAt"); - - b.HasIndex("HasBookmarks") - .HasDatabaseName("IX_ActivityExecutionRecord_HasBookmarks"); - - b.HasIndex("StartedAt") - .HasDatabaseName("IX_ActivityExecutionRecord_StartedAt"); - - b.HasIndex("Status") - .HasDatabaseName("IX_ActivityExecutionRecord_Status"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_ActivityExecutionRecord_TenantId"); - - b.HasIndex("WorkflowInstanceId") - .HasDatabaseName("IX_ActivityExecutionRecord_WorkflowInstanceId"); - - b.HasIndex("ActivityType", "ActivityTypeVersion") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityType_ActivityTypeVersion"); - - b.ToTable("ActivityExecutionRecords", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.BookmarkQueueItem", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityInstanceId") - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityTypeName") - .HasColumnType("nvarchar(450)"); - - b.Property("BookmarkId") - .HasColumnType("nvarchar(450)"); - - b.Property("CorrelationId") - .HasColumnType("nvarchar(450)"); - - b.Property("CreatedAt") - .HasColumnType("datetimeoffset"); - - b.Property("SerializedOptions") - .HasColumnType("nvarchar(max)"); - - b.Property("StimulusHash") - .HasColumnType("nvarchar(450)"); - - b.Property("TenantId") - .HasColumnType("nvarchar(450)"); - - b.Property("WorkflowInstanceId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "ActivityInstanceId" }, "IX_BookmarkQueueItem_ActivityInstanceId"); - - b.HasIndex(new[] { "ActivityTypeName" }, "IX_BookmarkQueueItem_ActivityTypeName"); - - b.HasIndex(new[] { "BookmarkId" }, "IX_BookmarkQueueItem_BookmarkId"); - - b.HasIndex(new[] { "CorrelationId" }, "IX_BookmarkQueueItem_CorrelationId"); - - b.HasIndex(new[] { "CreatedAt" }, "IX_BookmarkQueueItem_CreatedAt"); - - b.HasIndex(new[] { "StimulusHash" }, "IX_BookmarkQueueItem_StimulusHash"); - - b.HasIndex(new[] { "TenantId" }, "IX_BookmarkQueueItem_TenantId"); - - b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_BookmarkQueueItem_WorkflowInstanceId"); - - b.ToTable("BookmarkQueueItems", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.StoredBookmark", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityInstanceId") - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityTypeName") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("CorrelationId") - .HasColumnType("nvarchar(max)"); - - b.Property("CreatedAt") - .HasColumnType("datetimeoffset"); - - b.Property("Hash") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("SerializedMetadata") - .HasColumnType("nvarchar(max)"); - - b.Property("SerializedPayload") - .HasColumnType("nvarchar(max)"); - - b.Property("TenantId") - .HasColumnType("nvarchar(450)"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "ActivityInstanceId" }, "IX_StoredBookmark_ActivityInstanceId"); - - b.HasIndex(new[] { "ActivityTypeName" }, "IX_StoredBookmark_ActivityTypeName"); - - b.HasIndex(new[] { "ActivityTypeName", "Hash" }, "IX_StoredBookmark_ActivityTypeName_Hash"); - - b.HasIndex(new[] { "ActivityTypeName", "Hash", "WorkflowInstanceId" }, "IX_StoredBookmark_ActivityTypeName_Hash_WorkflowInstanceId"); - - b.HasIndex(new[] { "CreatedAt" }, "IX_StoredBookmark_CreatedAt"); - - b.HasIndex(new[] { "Hash" }, "IX_StoredBookmark_Hash"); - - b.HasIndex(new[] { "TenantId" }, "IX_StoredBookmark_TenantId"); - - b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_StoredBookmark_WorkflowInstanceId"); - - b.ToTable("Bookmarks", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.StoredTrigger", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityId") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Hash") - .HasColumnType("nvarchar(450)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("SerializedPayload") - .HasColumnType("nvarchar(max)"); - - b.Property("TenantId") - .HasColumnType("nvarchar(450)"); - - b.Property("WorkflowDefinitionId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("WorkflowDefinitionVersionId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("Hash") - .HasDatabaseName("IX_StoredTrigger_Hash"); - - b.HasIndex("Name") - .HasDatabaseName("IX_StoredTrigger_Name"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_StoredTrigger_TenantId"); - - b.HasIndex("WorkflowDefinitionId") - .HasDatabaseName("IX_StoredTrigger_WorkflowDefinitionId"); - - b.HasIndex("WorkflowDefinitionVersionId") - .HasDatabaseName("IX_StoredTrigger_WorkflowDefinitionVersionId"); - - b.ToTable("Triggers", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.WorkflowExecutionLogRecord", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityInstanceId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityName") - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityNodeId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityType") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityTypeVersion") - .HasColumnType("int"); - - b.Property("EventName") - .HasColumnType("nvarchar(450)"); - - b.Property("Message") - .HasColumnType("nvarchar(max)"); - - b.Property("ParentActivityInstanceId") - .HasColumnType("nvarchar(450)"); - - b.Property("Sequence") - .HasColumnType("bigint"); - - b.Property("SerializedActivityState") - .HasColumnType("nvarchar(max)"); - - b.Property("SerializedPayload") - .HasColumnType("nvarchar(max)"); - - b.Property("Source") - .HasColumnType("nvarchar(max)"); - - b.Property("TenantId") - .HasColumnType("nvarchar(450)"); - - b.Property("Timestamp") - .HasColumnType("datetimeoffset"); - - b.Property("WorkflowDefinitionId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("WorkflowDefinitionVersionId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("WorkflowVersion") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("ActivityId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityId"); - - b.HasIndex("ActivityInstanceId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityInstanceId"); - - b.HasIndex("ActivityName") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityName"); - - b.HasIndex("ActivityNodeId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityNodeId"); - - b.HasIndex("ActivityType") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityType"); - - b.HasIndex("ActivityTypeVersion") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityTypeVersion"); - - b.HasIndex("EventName") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_EventName"); - - b.HasIndex("ParentActivityInstanceId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ParentActivityInstanceId"); - - b.HasIndex("Sequence") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_Sequence"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_TenantId"); - - b.HasIndex("Timestamp") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_Timestamp"); - - b.HasIndex("WorkflowDefinitionId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowDefinitionId"); - - b.HasIndex("WorkflowDefinitionVersionId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowDefinitionVersionId"); - - b.HasIndex("WorkflowInstanceId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowInstanceId"); - - b.HasIndex("WorkflowVersion") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowVersion"); - - b.HasIndex("ActivityType", "ActivityTypeVersion") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityType_ActivityTypeVersion"); - - b.HasIndex("Timestamp", "Sequence") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_Timestamp_Sequence"); - - b.ToTable("WorkflowExecutionLogRecords", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.WorkflowInboxMessage", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityInstanceId") - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityTypeName") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("CorrelationId") - .HasColumnType("nvarchar(450)"); - - b.Property("CreatedAt") - .HasColumnType("datetimeoffset"); - - b.Property("ExpiresAt") - .HasColumnType("datetimeoffset"); - - b.Property("Hash") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("SerializedBookmarkPayload") - .HasColumnType("nvarchar(max)"); - - b.Property("SerializedInput") - .HasColumnType("nvarchar(max)"); - - b.Property("TenantId") - .HasColumnType("nvarchar(max)"); - - b.Property("WorkflowInstanceId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "ActivityInstanceId" }, "IX_WorkflowInboxMessage_ActivityInstanceId"); - - b.HasIndex(new[] { "ActivityTypeName" }, "IX_WorkflowInboxMessage_ActivityTypeName"); - - b.HasIndex(new[] { "CorrelationId" }, "IX_WorkflowInboxMessage_CorrelationId"); - - b.HasIndex(new[] { "CreatedAt" }, "IX_WorkflowInboxMessage_CreatedAt"); - - b.HasIndex(new[] { "ExpiresAt" }, "IX_WorkflowInboxMessage_ExpiresAt"); - - b.HasIndex(new[] { "Hash" }, "IX_WorkflowInboxMessage_Hash"); - - b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_WorkflowInboxMessage_WorkflowInstanceId"); - - b.ToTable("WorkflowInboxMessages", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Runtime/20250116192837_V3_3.cs b/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Runtime/20250116192837_V3_3.cs deleted file mode 100644 index ea7495e618..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Runtime/20250116192837_V3_3.cs +++ /dev/null @@ -1,251 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.SqlServer.Migrations.Runtime -{ - /// - public partial class V3_3 : Migration - { - private readonly Elsa.EntityFrameworkCore.IElsaDbContextSchema _schema; - - /// - public V3_3(Elsa.EntityFrameworkCore.IElsaDbContextSchema schema) - { - _schema = schema; - } - - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.RenameColumn( - name: "Key", - schema: _schema.Schema, - table: "KeyValuePairs", - newName: "Id"); - - migrationBuilder.RenameColumn( - name: "BookmarkId", - schema: _schema.Schema, - table: "Bookmarks", - newName: "Id"); - - migrationBuilder.AddColumn( - name: "TenantId", - schema: _schema.Schema, - table: "WorkflowInboxMessages", - type: "nvarchar(max)", - nullable: true); - - migrationBuilder.AddColumn( - name: "TenantId", - schema: _schema.Schema, - table: "WorkflowExecutionLogRecords", - type: "nvarchar(450)", - nullable: true); - - migrationBuilder.AddColumn( - name: "TenantId", - schema: _schema.Schema, - table: "Triggers", - type: "nvarchar(450)", - nullable: true); - - migrationBuilder.AddColumn( - name: "TenantId", - schema: _schema.Schema, - table: "KeyValuePairs", - type: "nvarchar(450)", - nullable: true); - - migrationBuilder.AddColumn( - name: "TenantId", - schema: _schema.Schema, - table: "Bookmarks", - type: "nvarchar(450)", - nullable: true); - - migrationBuilder.AddColumn( - name: "TenantId", - schema: _schema.Schema, - table: "ActivityExecutionRecords", - type: "nvarchar(450)", - nullable: true); - - migrationBuilder.CreateTable( - name: "BookmarkQueueItems", - schema: _schema.Schema, - columns: table => new - { - Id = table.Column(type: "nvarchar(450)", nullable: false), - WorkflowInstanceId = table.Column(type: "nvarchar(450)", nullable: true), - CorrelationId = table.Column(type: "nvarchar(450)", nullable: true), - BookmarkId = table.Column(type: "nvarchar(450)", nullable: true), - StimulusHash = table.Column(type: "nvarchar(450)", nullable: true), - ActivityInstanceId = table.Column(type: "nvarchar(450)", nullable: true), - ActivityTypeName = table.Column(type: "nvarchar(450)", nullable: true), - CreatedAt = table.Column(type: "datetimeoffset", nullable: false), - SerializedOptions = table.Column(type: "nvarchar(max)", nullable: true), - TenantId = table.Column(type: "nvarchar(450)", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_BookmarkQueueItems", x => x.Id); - }); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowExecutionLogRecord_TenantId", - schema: _schema.Schema, - table: "WorkflowExecutionLogRecords", - column: "TenantId"); - - migrationBuilder.CreateIndex( - name: "IX_StoredTrigger_TenantId", - schema: _schema.Schema, - table: "Triggers", - column: "TenantId"); - - migrationBuilder.CreateIndex( - name: "IX_SerializedKeyValuePair_TenantId", - schema: _schema.Schema, - table: "KeyValuePairs", - column: "TenantId"); - - migrationBuilder.CreateIndex( - name: "IX_StoredBookmark_TenantId", - schema: _schema.Schema, - table: "Bookmarks", - column: "TenantId"); - - migrationBuilder.CreateIndex( - name: "IX_ActivityExecutionRecord_TenantId", - schema: _schema.Schema, - table: "ActivityExecutionRecords", - column: "TenantId"); - - migrationBuilder.CreateIndex( - name: "IX_BookmarkQueueItem_ActivityInstanceId", - schema: _schema.Schema, - table: "BookmarkQueueItems", - column: "ActivityInstanceId"); - - migrationBuilder.CreateIndex( - name: "IX_BookmarkQueueItem_ActivityTypeName", - schema: _schema.Schema, - table: "BookmarkQueueItems", - column: "ActivityTypeName"); - - migrationBuilder.CreateIndex( - name: "IX_BookmarkQueueItem_BookmarkId", - schema: _schema.Schema, - table: "BookmarkQueueItems", - column: "BookmarkId"); - - migrationBuilder.CreateIndex( - name: "IX_BookmarkQueueItem_CorrelationId", - schema: _schema.Schema, - table: "BookmarkQueueItems", - column: "CorrelationId"); - - migrationBuilder.CreateIndex( - name: "IX_BookmarkQueueItem_CreatedAt", - schema: _schema.Schema, - table: "BookmarkQueueItems", - column: "CreatedAt"); - - migrationBuilder.CreateIndex( - name: "IX_BookmarkQueueItem_StimulusHash", - schema: _schema.Schema, - table: "BookmarkQueueItems", - column: "StimulusHash"); - - migrationBuilder.CreateIndex( - name: "IX_BookmarkQueueItem_TenantId", - schema: _schema.Schema, - table: "BookmarkQueueItems", - column: "TenantId"); - - migrationBuilder.CreateIndex( - name: "IX_BookmarkQueueItem_WorkflowInstanceId", - schema: _schema.Schema, - table: "BookmarkQueueItems", - column: "WorkflowInstanceId"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "BookmarkQueueItems", - schema: _schema.Schema); - - migrationBuilder.DropIndex( - name: "IX_WorkflowExecutionLogRecord_TenantId", - schema: _schema.Schema, - table: "WorkflowExecutionLogRecords"); - - migrationBuilder.DropIndex( - name: "IX_StoredTrigger_TenantId", - schema: _schema.Schema, - table: "Triggers"); - - migrationBuilder.DropIndex( - name: "IX_SerializedKeyValuePair_TenantId", - schema: _schema.Schema, - table: "KeyValuePairs"); - - migrationBuilder.DropIndex( - name: "IX_StoredBookmark_TenantId", - schema: _schema.Schema, - table: "Bookmarks"); - - migrationBuilder.DropIndex( - name: "IX_ActivityExecutionRecord_TenantId", - schema: _schema.Schema, - table: "ActivityExecutionRecords"); - - migrationBuilder.DropColumn( - name: "TenantId", - schema: _schema.Schema, - table: "WorkflowInboxMessages"); - - migrationBuilder.DropColumn( - name: "TenantId", - schema: _schema.Schema, - table: "WorkflowExecutionLogRecords"); - - migrationBuilder.DropColumn( - name: "TenantId", - schema: _schema.Schema, - table: "Triggers"); - - migrationBuilder.DropColumn( - name: "TenantId", - schema: _schema.Schema, - table: "KeyValuePairs"); - - migrationBuilder.DropColumn( - name: "TenantId", - schema: _schema.Schema, - table: "Bookmarks"); - - migrationBuilder.DropColumn( - name: "TenantId", - schema: _schema.Schema, - table: "ActivityExecutionRecords"); - - migrationBuilder.RenameColumn( - name: "Id", - schema: _schema.Schema, - table: "KeyValuePairs", - newName: "Key"); - - migrationBuilder.RenameColumn( - name: "Id", - schema: _schema.Schema, - table: "Bookmarks", - newName: "BookmarkId"); - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Runtime/20250222190834_V3_4.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Runtime/20250222190834_V3_4.Designer.cs deleted file mode 100644 index c417380d40..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Runtime/20250222190834_V3_4.Designer.cs +++ /dev/null @@ -1,492 +0,0 @@ -// -using System; -using Elsa.EntityFrameworkCore.Modules.Runtime; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.SqlServer.Migrations.Runtime -{ - [DbContext(typeof(RuntimeElsaDbContext))] - [Migration("20250222190834_V3_4")] - partial class V3_4 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "8.0.12") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); - - modelBuilder.Entity("Elsa.KeyValues.Entities.SerializedKeyValuePair", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("SerializedValue") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("TenantId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "TenantId" }, "IX_SerializedKeyValuePair_TenantId"); - - b.ToTable("KeyValuePairs", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.ActivityExecutionRecord", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityName") - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityNodeId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityType") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityTypeVersion") - .HasColumnType("int"); - - b.Property("CompletedAt") - .HasColumnType("datetimeoffset"); - - b.Property("HasBookmarks") - .HasColumnType("bit"); - - b.Property("SerializedActivityState") - .HasColumnType("nvarchar(max)"); - - b.Property("SerializedActivityStateCompressionAlgorithm") - .HasColumnType("nvarchar(max)"); - - b.Property("SerializedException") - .HasColumnType("nvarchar(max)"); - - b.Property("SerializedOutputs") - .HasColumnType("nvarchar(max)"); - - b.Property("SerializedPayload") - .HasColumnType("nvarchar(max)"); - - b.Property("SerializedProperties") - .HasColumnType("nvarchar(max)"); - - b.Property("StartedAt") - .HasColumnType("datetimeoffset"); - - b.Property("Status") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("TenantId") - .HasColumnType("nvarchar(450)"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("ActivityId") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityId"); - - b.HasIndex("ActivityName") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityName"); - - b.HasIndex("ActivityNodeId") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityNodeId"); - - b.HasIndex("ActivityType") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityType"); - - b.HasIndex("ActivityTypeVersion") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityTypeVersion"); - - b.HasIndex("CompletedAt") - .HasDatabaseName("IX_ActivityExecutionRecord_CompletedAt"); - - b.HasIndex("HasBookmarks") - .HasDatabaseName("IX_ActivityExecutionRecord_HasBookmarks"); - - b.HasIndex("StartedAt") - .HasDatabaseName("IX_ActivityExecutionRecord_StartedAt"); - - b.HasIndex("Status") - .HasDatabaseName("IX_ActivityExecutionRecord_Status"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_ActivityExecutionRecord_TenantId"); - - b.HasIndex("WorkflowInstanceId") - .HasDatabaseName("IX_ActivityExecutionRecord_WorkflowInstanceId"); - - b.HasIndex("ActivityType", "ActivityTypeVersion") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityType_ActivityTypeVersion"); - - b.ToTable("ActivityExecutionRecords", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.BookmarkQueueItem", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityInstanceId") - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityTypeName") - .HasColumnType("nvarchar(450)"); - - b.Property("BookmarkId") - .HasColumnType("nvarchar(450)"); - - b.Property("CorrelationId") - .HasColumnType("nvarchar(450)"); - - b.Property("CreatedAt") - .HasColumnType("datetimeoffset"); - - b.Property("SerializedOptions") - .HasColumnType("nvarchar(max)"); - - b.Property("StimulusHash") - .HasColumnType("nvarchar(450)"); - - b.Property("TenantId") - .HasColumnType("nvarchar(450)"); - - b.Property("WorkflowInstanceId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "ActivityInstanceId" }, "IX_BookmarkQueueItem_ActivityInstanceId"); - - b.HasIndex(new[] { "ActivityTypeName" }, "IX_BookmarkQueueItem_ActivityTypeName"); - - b.HasIndex(new[] { "BookmarkId" }, "IX_BookmarkQueueItem_BookmarkId"); - - b.HasIndex(new[] { "CorrelationId" }, "IX_BookmarkQueueItem_CorrelationId"); - - b.HasIndex(new[] { "CreatedAt" }, "IX_BookmarkQueueItem_CreatedAt"); - - b.HasIndex(new[] { "StimulusHash" }, "IX_BookmarkQueueItem_StimulusHash"); - - b.HasIndex(new[] { "TenantId" }, "IX_BookmarkQueueItem_TenantId"); - - b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_BookmarkQueueItem_WorkflowInstanceId"); - - b.ToTable("BookmarkQueueItems", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.StoredBookmark", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityInstanceId") - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityTypeName") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("CorrelationId") - .HasColumnType("nvarchar(max)"); - - b.Property("CreatedAt") - .HasColumnType("datetimeoffset"); - - b.Property("Hash") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("SerializedMetadata") - .HasColumnType("nvarchar(max)"); - - b.Property("SerializedPayload") - .HasColumnType("nvarchar(max)"); - - b.Property("TenantId") - .HasColumnType("nvarchar(450)"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "ActivityInstanceId" }, "IX_StoredBookmark_ActivityInstanceId"); - - b.HasIndex(new[] { "ActivityTypeName" }, "IX_StoredBookmark_ActivityTypeName"); - - b.HasIndex(new[] { "ActivityTypeName", "Hash" }, "IX_StoredBookmark_ActivityTypeName_Hash"); - - b.HasIndex(new[] { "ActivityTypeName", "Hash", "WorkflowInstanceId" }, "IX_StoredBookmark_ActivityTypeName_Hash_WorkflowInstanceId"); - - b.HasIndex(new[] { "CreatedAt" }, "IX_StoredBookmark_CreatedAt"); - - b.HasIndex(new[] { "Hash" }, "IX_StoredBookmark_Hash"); - - b.HasIndex(new[] { "TenantId" }, "IX_StoredBookmark_TenantId"); - - b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_StoredBookmark_WorkflowInstanceId"); - - b.ToTable("Bookmarks", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.StoredTrigger", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityId") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Hash") - .HasColumnType("nvarchar(450)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("SerializedPayload") - .HasColumnType("nvarchar(max)"); - - b.Property("TenantId") - .HasColumnType("nvarchar(450)"); - - b.Property("WorkflowDefinitionId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("WorkflowDefinitionVersionId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("Hash") - .HasDatabaseName("IX_StoredTrigger_Hash"); - - b.HasIndex("Name") - .HasDatabaseName("IX_StoredTrigger_Name"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_StoredTrigger_TenantId"); - - b.HasIndex("WorkflowDefinitionId") - .HasDatabaseName("IX_StoredTrigger_WorkflowDefinitionId"); - - b.HasIndex("WorkflowDefinitionVersionId") - .HasDatabaseName("IX_StoredTrigger_WorkflowDefinitionVersionId"); - - b.ToTable("Triggers", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.WorkflowExecutionLogRecord", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityInstanceId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityName") - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityNodeId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityType") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityTypeVersion") - .HasColumnType("int"); - - b.Property("EventName") - .HasColumnType("nvarchar(450)"); - - b.Property("Message") - .HasColumnType("nvarchar(max)"); - - b.Property("ParentActivityInstanceId") - .HasColumnType("nvarchar(450)"); - - b.Property("Sequence") - .HasColumnType("bigint"); - - b.Property("SerializedActivityState") - .HasColumnType("nvarchar(max)"); - - b.Property("SerializedPayload") - .HasColumnType("nvarchar(max)"); - - b.Property("Source") - .HasColumnType("nvarchar(max)"); - - b.Property("TenantId") - .HasColumnType("nvarchar(450)"); - - b.Property("Timestamp") - .HasColumnType("datetimeoffset"); - - b.Property("WorkflowDefinitionId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("WorkflowDefinitionVersionId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("WorkflowVersion") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("ActivityId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityId"); - - b.HasIndex("ActivityInstanceId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityInstanceId"); - - b.HasIndex("ActivityName") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityName"); - - b.HasIndex("ActivityNodeId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityNodeId"); - - b.HasIndex("ActivityType") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityType"); - - b.HasIndex("ActivityTypeVersion") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityTypeVersion"); - - b.HasIndex("EventName") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_EventName"); - - b.HasIndex("ParentActivityInstanceId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ParentActivityInstanceId"); - - b.HasIndex("Sequence") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_Sequence"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_TenantId"); - - b.HasIndex("Timestamp") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_Timestamp"); - - b.HasIndex("WorkflowDefinitionId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowDefinitionId"); - - b.HasIndex("WorkflowDefinitionVersionId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowDefinitionVersionId"); - - b.HasIndex("WorkflowInstanceId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowInstanceId"); - - b.HasIndex("WorkflowVersion") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowVersion"); - - b.HasIndex("ActivityType", "ActivityTypeVersion") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityType_ActivityTypeVersion"); - - b.HasIndex("Timestamp", "Sequence") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_Timestamp_Sequence"); - - b.ToTable("WorkflowExecutionLogRecords", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.WorkflowInboxMessage", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityInstanceId") - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityTypeName") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("CorrelationId") - .HasColumnType("nvarchar(450)"); - - b.Property("CreatedAt") - .HasColumnType("datetimeoffset"); - - b.Property("ExpiresAt") - .HasColumnType("datetimeoffset"); - - b.Property("Hash") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("SerializedBookmarkPayload") - .HasColumnType("nvarchar(max)"); - - b.Property("SerializedInput") - .HasColumnType("nvarchar(max)"); - - b.Property("TenantId") - .HasColumnType("nvarchar(max)"); - - b.Property("WorkflowInstanceId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "ActivityInstanceId" }, "IX_WorkflowInboxMessage_ActivityInstanceId"); - - b.HasIndex(new[] { "ActivityTypeName" }, "IX_WorkflowInboxMessage_ActivityTypeName"); - - b.HasIndex(new[] { "CorrelationId" }, "IX_WorkflowInboxMessage_CorrelationId"); - - b.HasIndex(new[] { "CreatedAt" }, "IX_WorkflowInboxMessage_CreatedAt"); - - b.HasIndex(new[] { "ExpiresAt" }, "IX_WorkflowInboxMessage_ExpiresAt"); - - b.HasIndex(new[] { "Hash" }, "IX_WorkflowInboxMessage_Hash"); - - b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_WorkflowInboxMessage_WorkflowInstanceId"); - - b.ToTable("WorkflowInboxMessages", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Runtime/20250222190834_V3_4.cs b/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Runtime/20250222190834_V3_4.cs deleted file mode 100644 index a63ec7d90d..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Runtime/20250222190834_V3_4.cs +++ /dev/null @@ -1,30 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.SqlServer.Migrations.Runtime -{ - /// - public partial class V3_4 : Migration - { - private readonly Elsa.EntityFrameworkCore.IElsaDbContextSchema _schema; - - /// - public V3_4(Elsa.EntityFrameworkCore.IElsaDbContextSchema schema) - { - _schema = schema; - } - - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Runtime/20250401201357_V3_5.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Runtime/20250401201357_V3_5.Designer.cs deleted file mode 100644 index 9ddb19603d..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Runtime/20250401201357_V3_5.Designer.cs +++ /dev/null @@ -1,503 +0,0 @@ -// -using System; -using Elsa.EntityFrameworkCore.Modules.Runtime; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.SqlServer.Migrations.Runtime -{ - [DbContext(typeof(RuntimeElsaDbContext))] - [Migration("20250401201357_V3_5")] - partial class V3_5 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "9.0.3") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); - - modelBuilder.Entity("Elsa.KeyValues.Entities.SerializedKeyValuePair", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("SerializedValue") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("TenantId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "TenantId" }, "IX_SerializedKeyValuePair_TenantId"); - - b.ToTable("KeyValuePairs", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.ActivityExecutionRecord", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityName") - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityNodeId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityType") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityTypeVersion") - .HasColumnType("int"); - - b.Property("AggregateFaultCount") - .HasColumnType("int"); - - b.Property("CompletedAt") - .HasColumnType("datetimeoffset"); - - b.Property("HasBookmarks") - .HasColumnType("bit"); - - b.Property("SerializedActivityState") - .HasColumnType("nvarchar(max)"); - - b.Property("SerializedActivityStateCompressionAlgorithm") - .HasColumnType("nvarchar(max)"); - - b.Property("SerializedException") - .HasColumnType("nvarchar(max)"); - - b.Property("SerializedOutputs") - .HasColumnType("nvarchar(max)"); - - b.Property("SerializedPayload") - .HasColumnType("nvarchar(max)"); - - b.Property("SerializedProperties") - .HasColumnType("nvarchar(max)"); - - b.Property("StartedAt") - .HasColumnType("datetimeoffset"); - - b.Property("Status") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("TenantId") - .HasColumnType("nvarchar(450)"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("ActivityId") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityId"); - - b.HasIndex("ActivityName") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityName"); - - b.HasIndex("ActivityNodeId") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityNodeId"); - - b.HasIndex("ActivityType") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityType"); - - b.HasIndex("ActivityTypeVersion") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityTypeVersion"); - - b.HasIndex("CompletedAt") - .HasDatabaseName("IX_ActivityExecutionRecord_CompletedAt"); - - b.HasIndex("HasBookmarks") - .HasDatabaseName("IX_ActivityExecutionRecord_HasBookmarks"); - - b.HasIndex("StartedAt") - .HasDatabaseName("IX_ActivityExecutionRecord_StartedAt"); - - b.HasIndex("Status") - .HasDatabaseName("IX_ActivityExecutionRecord_Status"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_ActivityExecutionRecord_TenantId"); - - b.HasIndex("WorkflowInstanceId") - .HasDatabaseName("IX_ActivityExecutionRecord_WorkflowInstanceId"); - - b.HasIndex("ActivityType", "ActivityTypeVersion") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityType_ActivityTypeVersion"); - - b.ToTable("ActivityExecutionRecords", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.BookmarkQueueItem", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityInstanceId") - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityTypeName") - .HasColumnType("nvarchar(450)"); - - b.Property("BookmarkId") - .HasColumnType("nvarchar(450)"); - - b.Property("CorrelationId") - .HasColumnType("nvarchar(450)"); - - b.Property("CreatedAt") - .HasColumnType("datetimeoffset"); - - b.Property("SerializedOptions") - .HasColumnType("nvarchar(max)"); - - b.Property("StimulusHash") - .HasColumnType("nvarchar(450)"); - - b.Property("TenantId") - .HasColumnType("nvarchar(450)"); - - b.Property("WorkflowInstanceId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "ActivityInstanceId" }, "IX_BookmarkQueueItem_ActivityInstanceId"); - - b.HasIndex(new[] { "ActivityTypeName" }, "IX_BookmarkQueueItem_ActivityTypeName"); - - b.HasIndex(new[] { "BookmarkId" }, "IX_BookmarkQueueItem_BookmarkId"); - - b.HasIndex(new[] { "CorrelationId" }, "IX_BookmarkQueueItem_CorrelationId"); - - b.HasIndex(new[] { "CreatedAt" }, "IX_BookmarkQueueItem_CreatedAt"); - - b.HasIndex(new[] { "StimulusHash" }, "IX_BookmarkQueueItem_StimulusHash"); - - b.HasIndex(new[] { "TenantId" }, "IX_BookmarkQueueItem_TenantId"); - - b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_BookmarkQueueItem_WorkflowInstanceId"); - - b.ToTable("BookmarkQueueItems", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.StoredBookmark", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityInstanceId") - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityTypeName") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("CorrelationId") - .HasColumnType("nvarchar(max)"); - - b.Property("CreatedAt") - .HasColumnType("datetimeoffset"); - - b.Property("Hash") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("Name") - .HasColumnType("nvarchar(450)"); - - b.Property("SerializedMetadata") - .HasColumnType("nvarchar(max)"); - - b.Property("SerializedPayload") - .HasColumnType("nvarchar(max)"); - - b.Property("TenantId") - .HasColumnType("nvarchar(450)"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "ActivityInstanceId" }, "IX_StoredBookmark_ActivityInstanceId"); - - b.HasIndex(new[] { "ActivityTypeName" }, "IX_StoredBookmark_ActivityTypeName"); - - b.HasIndex(new[] { "ActivityTypeName", "Hash" }, "IX_StoredBookmark_ActivityTypeName_Hash"); - - b.HasIndex(new[] { "ActivityTypeName", "Hash", "WorkflowInstanceId" }, "IX_StoredBookmark_ActivityTypeName_Hash_WorkflowInstanceId"); - - b.HasIndex(new[] { "CreatedAt" }, "IX_StoredBookmark_CreatedAt"); - - b.HasIndex(new[] { "Hash" }, "IX_StoredBookmark_Hash"); - - b.HasIndex(new[] { "Name" }, "IX_StoredBookmark_Name"); - - b.HasIndex(new[] { "Name", "Hash" }, "IX_StoredBookmark_Name_Hash"); - - b.HasIndex(new[] { "Name", "Hash", "WorkflowInstanceId" }, "IX_StoredBookmark_Name_Hash_WorkflowInstanceId"); - - b.HasIndex(new[] { "TenantId" }, "IX_StoredBookmark_TenantId"); - - b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_StoredBookmark_WorkflowInstanceId"); - - b.ToTable("Bookmarks", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.StoredTrigger", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityId") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Hash") - .HasColumnType("nvarchar(450)"); - - b.Property("Name") - .HasColumnType("nvarchar(450)"); - - b.Property("SerializedPayload") - .HasColumnType("nvarchar(max)"); - - b.Property("TenantId") - .HasColumnType("nvarchar(450)"); - - b.Property("WorkflowDefinitionId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("WorkflowDefinitionVersionId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("Hash") - .HasDatabaseName("IX_StoredTrigger_Hash"); - - b.HasIndex("Name") - .HasDatabaseName("IX_StoredTrigger_Name"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_StoredTrigger_TenantId"); - - b.HasIndex("WorkflowDefinitionId") - .HasDatabaseName("IX_StoredTrigger_WorkflowDefinitionId"); - - b.HasIndex("WorkflowDefinitionVersionId") - .HasDatabaseName("IX_StoredTrigger_WorkflowDefinitionVersionId"); - - b.ToTable("Triggers", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.WorkflowExecutionLogRecord", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityInstanceId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityName") - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityNodeId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityType") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityTypeVersion") - .HasColumnType("int"); - - b.Property("EventName") - .HasColumnType("nvarchar(450)"); - - b.Property("Message") - .HasColumnType("nvarchar(max)"); - - b.Property("ParentActivityInstanceId") - .HasColumnType("nvarchar(450)"); - - b.Property("Sequence") - .HasColumnType("bigint"); - - b.Property("SerializedActivityState") - .HasColumnType("nvarchar(max)"); - - b.Property("SerializedPayload") - .HasColumnType("nvarchar(max)"); - - b.Property("Source") - .HasColumnType("nvarchar(max)"); - - b.Property("TenantId") - .HasColumnType("nvarchar(450)"); - - b.Property("Timestamp") - .HasColumnType("datetimeoffset"); - - b.Property("WorkflowDefinitionId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("WorkflowDefinitionVersionId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("WorkflowVersion") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("ActivityId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityId"); - - b.HasIndex("ActivityInstanceId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityInstanceId"); - - b.HasIndex("ActivityName") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityName"); - - b.HasIndex("ActivityNodeId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityNodeId"); - - b.HasIndex("ActivityType") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityType"); - - b.HasIndex("ActivityTypeVersion") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityTypeVersion"); - - b.HasIndex("EventName") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_EventName"); - - b.HasIndex("ParentActivityInstanceId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ParentActivityInstanceId"); - - b.HasIndex("Sequence") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_Sequence"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_TenantId"); - - b.HasIndex("Timestamp") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_Timestamp"); - - b.HasIndex("WorkflowDefinitionId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowDefinitionId"); - - b.HasIndex("WorkflowDefinitionVersionId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowDefinitionVersionId"); - - b.HasIndex("WorkflowInstanceId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowInstanceId"); - - b.HasIndex("WorkflowVersion") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowVersion"); - - b.HasIndex("ActivityType", "ActivityTypeVersion") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityType_ActivityTypeVersion"); - - b.HasIndex("Timestamp", "Sequence") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_Timestamp_Sequence"); - - b.ToTable("WorkflowExecutionLogRecords", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.WorkflowInboxMessage", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityInstanceId") - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityTypeName") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("CorrelationId") - .HasColumnType("nvarchar(450)"); - - b.Property("CreatedAt") - .HasColumnType("datetimeoffset"); - - b.Property("ExpiresAt") - .HasColumnType("datetimeoffset"); - - b.Property("Hash") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("SerializedBookmarkPayload") - .HasColumnType("nvarchar(max)"); - - b.Property("SerializedInput") - .HasColumnType("nvarchar(max)"); - - b.Property("TenantId") - .HasColumnType("nvarchar(max)"); - - b.Property("WorkflowInstanceId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "ActivityInstanceId" }, "IX_WorkflowInboxMessage_ActivityInstanceId"); - - b.HasIndex(new[] { "ActivityTypeName" }, "IX_WorkflowInboxMessage_ActivityTypeName"); - - b.HasIndex(new[] { "CorrelationId" }, "IX_WorkflowInboxMessage_CorrelationId"); - - b.HasIndex(new[] { "CreatedAt" }, "IX_WorkflowInboxMessage_CreatedAt"); - - b.HasIndex(new[] { "ExpiresAt" }, "IX_WorkflowInboxMessage_ExpiresAt"); - - b.HasIndex(new[] { "Hash" }, "IX_WorkflowInboxMessage_Hash"); - - b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_WorkflowInboxMessage_WorkflowInstanceId"); - - b.ToTable("WorkflowInboxMessages", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Runtime/20250401201357_V3_5.cs b/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Runtime/20250401201357_V3_5.cs deleted file mode 100644 index 3f7cc06650..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Runtime/20250401201357_V3_5.cs +++ /dev/null @@ -1,104 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.SqlServer.Migrations.Runtime -{ - /// - public partial class V3_5 : Migration - { - private readonly Elsa.EntityFrameworkCore.IElsaDbContextSchema _schema; - - /// - public V3_5(Elsa.EntityFrameworkCore.IElsaDbContextSchema schema) - { - _schema = schema; - } - - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AlterColumn( - name: "Name", - schema: _schema.Schema, - table: "Triggers", - type: "nvarchar(450)", - nullable: true, - oldClrType: typeof(string), - oldType: "nvarchar(450)"); - - migrationBuilder.AddColumn( - name: "Name", - schema: _schema.Schema, - table: "Bookmarks", - type: "nvarchar(450)", - nullable: true); - - migrationBuilder.AddColumn( - name: "AggregateFaultCount", - schema: _schema.Schema, - table: "ActivityExecutionRecords", - type: "int", - nullable: false, - defaultValue: 0); - - migrationBuilder.CreateIndex( - name: "IX_StoredBookmark_Name", - schema: _schema.Schema, - table: "Bookmarks", - column: "Name"); - - migrationBuilder.CreateIndex( - name: "IX_StoredBookmark_Name_Hash", - schema: _schema.Schema, - table: "Bookmarks", - columns: new[] { "Name", "Hash" }); - - migrationBuilder.CreateIndex( - name: "IX_StoredBookmark_Name_Hash_WorkflowInstanceId", - schema: _schema.Schema, - table: "Bookmarks", - columns: new[] { "Name", "Hash", "WorkflowInstanceId" }); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropIndex( - name: "IX_StoredBookmark_Name", - schema: _schema.Schema, - table: "Bookmarks"); - - migrationBuilder.DropIndex( - name: "IX_StoredBookmark_Name_Hash", - schema: _schema.Schema, - table: "Bookmarks"); - - migrationBuilder.DropIndex( - name: "IX_StoredBookmark_Name_Hash_WorkflowInstanceId", - schema: _schema.Schema, - table: "Bookmarks"); - - migrationBuilder.DropColumn( - name: "Name", - schema: _schema.Schema, - table: "Bookmarks"); - - migrationBuilder.DropColumn( - name: "AggregateFaultCount", - schema: _schema.Schema, - table: "ActivityExecutionRecords"); - - migrationBuilder.AlterColumn( - name: "Name", - schema: _schema.Schema, - table: "Triggers", - type: "nvarchar(450)", - nullable: false, - defaultValue: "", - oldClrType: typeof(string), - oldType: "nvarchar(450)", - oldNullable: true); - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Runtime/RuntimeElsaDbContextModelSnapshot.cs b/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Runtime/RuntimeElsaDbContextModelSnapshot.cs deleted file mode 100644 index 18a5a051dc..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Runtime/RuntimeElsaDbContextModelSnapshot.cs +++ /dev/null @@ -1,500 +0,0 @@ -// -using System; -using Elsa.EntityFrameworkCore.Modules.Runtime; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.SqlServer.Migrations.Runtime -{ - [DbContext(typeof(RuntimeElsaDbContext))] - partial class RuntimeElsaDbContextModelSnapshot : ModelSnapshot - { - protected override void BuildModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "9.0.3") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); - - modelBuilder.Entity("Elsa.KeyValues.Entities.SerializedKeyValuePair", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("SerializedValue") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("TenantId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "TenantId" }, "IX_SerializedKeyValuePair_TenantId"); - - b.ToTable("KeyValuePairs", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.ActivityExecutionRecord", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityName") - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityNodeId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityType") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityTypeVersion") - .HasColumnType("int"); - - b.Property("AggregateFaultCount") - .HasColumnType("int"); - - b.Property("CompletedAt") - .HasColumnType("datetimeoffset"); - - b.Property("HasBookmarks") - .HasColumnType("bit"); - - b.Property("SerializedActivityState") - .HasColumnType("nvarchar(max)"); - - b.Property("SerializedActivityStateCompressionAlgorithm") - .HasColumnType("nvarchar(max)"); - - b.Property("SerializedException") - .HasColumnType("nvarchar(max)"); - - b.Property("SerializedOutputs") - .HasColumnType("nvarchar(max)"); - - b.Property("SerializedPayload") - .HasColumnType("nvarchar(max)"); - - b.Property("SerializedProperties") - .HasColumnType("nvarchar(max)"); - - b.Property("StartedAt") - .HasColumnType("datetimeoffset"); - - b.Property("Status") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("TenantId") - .HasColumnType("nvarchar(450)"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("ActivityId") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityId"); - - b.HasIndex("ActivityName") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityName"); - - b.HasIndex("ActivityNodeId") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityNodeId"); - - b.HasIndex("ActivityType") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityType"); - - b.HasIndex("ActivityTypeVersion") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityTypeVersion"); - - b.HasIndex("CompletedAt") - .HasDatabaseName("IX_ActivityExecutionRecord_CompletedAt"); - - b.HasIndex("HasBookmarks") - .HasDatabaseName("IX_ActivityExecutionRecord_HasBookmarks"); - - b.HasIndex("StartedAt") - .HasDatabaseName("IX_ActivityExecutionRecord_StartedAt"); - - b.HasIndex("Status") - .HasDatabaseName("IX_ActivityExecutionRecord_Status"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_ActivityExecutionRecord_TenantId"); - - b.HasIndex("WorkflowInstanceId") - .HasDatabaseName("IX_ActivityExecutionRecord_WorkflowInstanceId"); - - b.HasIndex("ActivityType", "ActivityTypeVersion") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityType_ActivityTypeVersion"); - - b.ToTable("ActivityExecutionRecords", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.BookmarkQueueItem", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityInstanceId") - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityTypeName") - .HasColumnType("nvarchar(450)"); - - b.Property("BookmarkId") - .HasColumnType("nvarchar(450)"); - - b.Property("CorrelationId") - .HasColumnType("nvarchar(450)"); - - b.Property("CreatedAt") - .HasColumnType("datetimeoffset"); - - b.Property("SerializedOptions") - .HasColumnType("nvarchar(max)"); - - b.Property("StimulusHash") - .HasColumnType("nvarchar(450)"); - - b.Property("TenantId") - .HasColumnType("nvarchar(450)"); - - b.Property("WorkflowInstanceId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "ActivityInstanceId" }, "IX_BookmarkQueueItem_ActivityInstanceId"); - - b.HasIndex(new[] { "ActivityTypeName" }, "IX_BookmarkQueueItem_ActivityTypeName"); - - b.HasIndex(new[] { "BookmarkId" }, "IX_BookmarkQueueItem_BookmarkId"); - - b.HasIndex(new[] { "CorrelationId" }, "IX_BookmarkQueueItem_CorrelationId"); - - b.HasIndex(new[] { "CreatedAt" }, "IX_BookmarkQueueItem_CreatedAt"); - - b.HasIndex(new[] { "StimulusHash" }, "IX_BookmarkQueueItem_StimulusHash"); - - b.HasIndex(new[] { "TenantId" }, "IX_BookmarkQueueItem_TenantId"); - - b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_BookmarkQueueItem_WorkflowInstanceId"); - - b.ToTable("BookmarkQueueItems", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.StoredBookmark", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityInstanceId") - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityTypeName") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("CorrelationId") - .HasColumnType("nvarchar(max)"); - - b.Property("CreatedAt") - .HasColumnType("datetimeoffset"); - - b.Property("Hash") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("Name") - .HasColumnType("nvarchar(450)"); - - b.Property("SerializedMetadata") - .HasColumnType("nvarchar(max)"); - - b.Property("SerializedPayload") - .HasColumnType("nvarchar(max)"); - - b.Property("TenantId") - .HasColumnType("nvarchar(450)"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "ActivityInstanceId" }, "IX_StoredBookmark_ActivityInstanceId"); - - b.HasIndex(new[] { "ActivityTypeName" }, "IX_StoredBookmark_ActivityTypeName"); - - b.HasIndex(new[] { "ActivityTypeName", "Hash" }, "IX_StoredBookmark_ActivityTypeName_Hash"); - - b.HasIndex(new[] { "ActivityTypeName", "Hash", "WorkflowInstanceId" }, "IX_StoredBookmark_ActivityTypeName_Hash_WorkflowInstanceId"); - - b.HasIndex(new[] { "CreatedAt" }, "IX_StoredBookmark_CreatedAt"); - - b.HasIndex(new[] { "Hash" }, "IX_StoredBookmark_Hash"); - - b.HasIndex(new[] { "Name" }, "IX_StoredBookmark_Name"); - - b.HasIndex(new[] { "Name", "Hash" }, "IX_StoredBookmark_Name_Hash"); - - b.HasIndex(new[] { "Name", "Hash", "WorkflowInstanceId" }, "IX_StoredBookmark_Name_Hash_WorkflowInstanceId"); - - b.HasIndex(new[] { "TenantId" }, "IX_StoredBookmark_TenantId"); - - b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_StoredBookmark_WorkflowInstanceId"); - - b.ToTable("Bookmarks", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.StoredTrigger", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityId") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Hash") - .HasColumnType("nvarchar(450)"); - - b.Property("Name") - .HasColumnType("nvarchar(450)"); - - b.Property("SerializedPayload") - .HasColumnType("nvarchar(max)"); - - b.Property("TenantId") - .HasColumnType("nvarchar(450)"); - - b.Property("WorkflowDefinitionId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("WorkflowDefinitionVersionId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("Hash") - .HasDatabaseName("IX_StoredTrigger_Hash"); - - b.HasIndex("Name") - .HasDatabaseName("IX_StoredTrigger_Name"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_StoredTrigger_TenantId"); - - b.HasIndex("WorkflowDefinitionId") - .HasDatabaseName("IX_StoredTrigger_WorkflowDefinitionId"); - - b.HasIndex("WorkflowDefinitionVersionId") - .HasDatabaseName("IX_StoredTrigger_WorkflowDefinitionVersionId"); - - b.ToTable("Triggers", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.WorkflowExecutionLogRecord", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityInstanceId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityName") - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityNodeId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityType") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityTypeVersion") - .HasColumnType("int"); - - b.Property("EventName") - .HasColumnType("nvarchar(450)"); - - b.Property("Message") - .HasColumnType("nvarchar(max)"); - - b.Property("ParentActivityInstanceId") - .HasColumnType("nvarchar(450)"); - - b.Property("Sequence") - .HasColumnType("bigint"); - - b.Property("SerializedActivityState") - .HasColumnType("nvarchar(max)"); - - b.Property("SerializedPayload") - .HasColumnType("nvarchar(max)"); - - b.Property("Source") - .HasColumnType("nvarchar(max)"); - - b.Property("TenantId") - .HasColumnType("nvarchar(450)"); - - b.Property("Timestamp") - .HasColumnType("datetimeoffset"); - - b.Property("WorkflowDefinitionId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("WorkflowDefinitionVersionId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("WorkflowVersion") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("ActivityId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityId"); - - b.HasIndex("ActivityInstanceId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityInstanceId"); - - b.HasIndex("ActivityName") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityName"); - - b.HasIndex("ActivityNodeId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityNodeId"); - - b.HasIndex("ActivityType") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityType"); - - b.HasIndex("ActivityTypeVersion") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityTypeVersion"); - - b.HasIndex("EventName") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_EventName"); - - b.HasIndex("ParentActivityInstanceId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ParentActivityInstanceId"); - - b.HasIndex("Sequence") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_Sequence"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_TenantId"); - - b.HasIndex("Timestamp") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_Timestamp"); - - b.HasIndex("WorkflowDefinitionId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowDefinitionId"); - - b.HasIndex("WorkflowDefinitionVersionId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowDefinitionVersionId"); - - b.HasIndex("WorkflowInstanceId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowInstanceId"); - - b.HasIndex("WorkflowVersion") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowVersion"); - - b.HasIndex("ActivityType", "ActivityTypeVersion") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityType_ActivityTypeVersion"); - - b.HasIndex("Timestamp", "Sequence") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_Timestamp_Sequence"); - - b.ToTable("WorkflowExecutionLogRecords", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.WorkflowInboxMessage", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityInstanceId") - .HasColumnType("nvarchar(450)"); - - b.Property("ActivityTypeName") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("CorrelationId") - .HasColumnType("nvarchar(450)"); - - b.Property("CreatedAt") - .HasColumnType("datetimeoffset"); - - b.Property("ExpiresAt") - .HasColumnType("datetimeoffset"); - - b.Property("Hash") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("SerializedBookmarkPayload") - .HasColumnType("nvarchar(max)"); - - b.Property("SerializedInput") - .HasColumnType("nvarchar(max)"); - - b.Property("TenantId") - .HasColumnType("nvarchar(max)"); - - b.Property("WorkflowInstanceId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "ActivityInstanceId" }, "IX_WorkflowInboxMessage_ActivityInstanceId"); - - b.HasIndex(new[] { "ActivityTypeName" }, "IX_WorkflowInboxMessage_ActivityTypeName"); - - b.HasIndex(new[] { "CorrelationId" }, "IX_WorkflowInboxMessage_CorrelationId"); - - b.HasIndex(new[] { "CreatedAt" }, "IX_WorkflowInboxMessage_CreatedAt"); - - b.HasIndex(new[] { "ExpiresAt" }, "IX_WorkflowInboxMessage_ExpiresAt"); - - b.HasIndex(new[] { "Hash" }, "IX_WorkflowInboxMessage_Hash"); - - b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_WorkflowInboxMessage_WorkflowInstanceId"); - - b.ToTable("WorkflowInboxMessages", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Tenants/20241212212138_V3_3.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Tenants/20241212212138_V3_3.Designer.cs deleted file mode 100644 index 294cef9b07..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Tenants/20241212212138_V3_3.Designer.cs +++ /dev/null @@ -1,57 +0,0 @@ -// -using Elsa.EntityFrameworkCore.Modules.Tenants; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.SqlServer.Migrations.Tenants -{ - [DbContext(typeof(TenantsElsaDbContext))] - [Migration("20241212212138_V3_3")] - partial class V3_3 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "7.0.20") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); - - modelBuilder.Entity("Elsa.Common.Multitenancy.Tenant", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("Configuration") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("TenantId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .HasDatabaseName("IX_Tenant_Name"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_Tenant_TenantId"); - - b.ToTable("Tenants", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Tenants/20241212212138_V3_3.cs b/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Tenants/20241212212138_V3_3.cs deleted file mode 100644 index 3b72b2b832..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Tenants/20241212212138_V3_3.cs +++ /dev/null @@ -1,60 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.SqlServer.Migrations.Tenants -{ - /// - public partial class V3_3 : Migration - { - private readonly Elsa.EntityFrameworkCore.IElsaDbContextSchema _schema; - - /// - public V3_3(Elsa.EntityFrameworkCore.IElsaDbContextSchema schema) - { - _schema = schema; - } - - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.EnsureSchema( - name: "Elsa"); - - migrationBuilder.CreateTable( - name: "Tenants", - schema: _schema.Schema, - columns: table => new - { - Id = table.Column(type: "nvarchar(450)", nullable: false), - Name = table.Column(type: "nvarchar(450)", nullable: false), - Configuration = table.Column(type: "nvarchar(max)", nullable: false), - TenantId = table.Column(type: "nvarchar(450)", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Tenants", x => x.Id); - }); - - migrationBuilder.CreateIndex( - name: "IX_Tenant_Name", - schema: _schema.Schema, - table: "Tenants", - column: "Name"); - - migrationBuilder.CreateIndex( - name: "IX_Tenant_TenantId", - schema: _schema.Schema, - table: "Tenants", - column: "TenantId"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "Tenants", - schema: _schema.Schema); - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Tenants/20250222191011_V3_4.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Tenants/20250222191011_V3_4.Designer.cs deleted file mode 100644 index 674b7320c9..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Tenants/20250222191011_V3_4.Designer.cs +++ /dev/null @@ -1,57 +0,0 @@ -// -using Elsa.EntityFrameworkCore.Modules.Tenants; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.SqlServer.Migrations.Tenants -{ - [DbContext(typeof(TenantsElsaDbContext))] - [Migration("20250222191011_V3_4")] - partial class V3_4 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "8.0.12") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); - - modelBuilder.Entity("Elsa.Common.Multitenancy.Tenant", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("Configuration") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("TenantId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .HasDatabaseName("IX_Tenant_Name"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_Tenant_TenantId"); - - b.ToTable("Tenants", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Tenants/20250222191011_V3_4.cs b/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Tenants/20250222191011_V3_4.cs deleted file mode 100644 index d0f2bfe919..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Tenants/20250222191011_V3_4.cs +++ /dev/null @@ -1,30 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.SqlServer.Migrations.Tenants -{ - /// - public partial class V3_4 : Migration - { - private readonly Elsa.EntityFrameworkCore.IElsaDbContextSchema _schema; - - /// - public V3_4(Elsa.EntityFrameworkCore.IElsaDbContextSchema schema) - { - _schema = schema; - } - - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Tenants/TenantsElsaDbContextModelSnapshot.cs b/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Tenants/TenantsElsaDbContextModelSnapshot.cs deleted file mode 100644 index b807793faf..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Migrations/Tenants/TenantsElsaDbContextModelSnapshot.cs +++ /dev/null @@ -1,54 +0,0 @@ -// -using Elsa.EntityFrameworkCore.Modules.Tenants; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.SqlServer.Migrations.Tenants -{ - [DbContext(typeof(TenantsElsaDbContext))] - partial class TenantsElsaDbContextModelSnapshot : ModelSnapshot - { - protected override void BuildModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "8.0.12") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); - - modelBuilder.Entity("Elsa.Common.Multitenancy.Tenant", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("Configuration") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("TenantId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .HasDatabaseName("IX_Tenant_Name"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_Tenant_TenantId"); - - b.ToTable("Tenants", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.SqlServer/SqlServerProvidersExtensions.cs b/src/modules/Elsa.EntityFrameworkCore.SqlServer/SqlServerProvidersExtensions.cs deleted file mode 100644 index 32b18e1390..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.SqlServer/SqlServerProvidersExtensions.cs +++ /dev/null @@ -1,56 +0,0 @@ -using System.Reflection; -using Microsoft.EntityFrameworkCore.Infrastructure; - -// ReSharper disable once CheckNamespace -namespace Elsa.EntityFrameworkCore.Extensions; - -/// -/// Provides extensions to configure EF Core to use SQL Server. -/// -public static class SqlServerProvidersExtensions -{ - private static Assembly Assembly => typeof(SqlServerProvidersExtensions).Assembly; - - public static TFeature UseSqlServer(this PersistenceFeatureBase feature, - string connectionString, - ElsaDbContextOptions? options = null, - Action? configure = null) - where TDbContext : ElsaDbContextBase - where TFeature : PersistenceFeatureBase - { - return feature.UseSqlServer(Assembly, connectionString, options, configure); - } - - public static TFeature UseSqlServer(this PersistenceFeatureBase feature, - Func connectionStringFunc, - ElsaDbContextOptions? options = null, - Action? configure = null) - where TDbContext : ElsaDbContextBase - where TFeature : PersistenceFeatureBase - { - return feature.UseSqlServer(Assembly, connectionStringFunc, options, configure); - } - - public static TFeature UseSqlServer(this PersistenceFeatureBase feature, - Assembly migrationsAssembly, - string connectionString, - ElsaDbContextOptions? options = null, - Action? configure = null) - where TDbContext : ElsaDbContextBase - where TFeature : PersistenceFeatureBase - { - return feature.UseSqlServer(migrationsAssembly, _ => connectionString, options, configure); - } - - public static TFeature UseSqlServer(this PersistenceFeatureBase feature, - Assembly migrationsAssembly, - Func connectionStringFunc, - ElsaDbContextOptions? options = null, - Action? configure = null) - where TDbContext : ElsaDbContextBase - where TFeature : PersistenceFeatureBase - { - feature.DbContextOptionsBuilder = (sp, db) => db.UseElsaSqlServer(migrationsAssembly, connectionStringFunc(sp), options, configure); - return (TFeature)feature; - } -} \ No newline at end of file diff --git a/src/modules/Elsa.EntityFrameworkCore.Sqlite/DbContextFactories.cs b/src/modules/Elsa.EntityFrameworkCore.Sqlite/DbContextFactories.cs deleted file mode 100644 index 3b73dee213..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Sqlite/DbContextFactories.cs +++ /dev/null @@ -1,40 +0,0 @@ -using Elsa.EntityFrameworkCore.Abstractions; -using Elsa.EntityFrameworkCore.Extensions; -using Elsa.EntityFrameworkCore.Modules.Alterations; -using Elsa.EntityFrameworkCore.Modules.Identity; -using Elsa.EntityFrameworkCore.Modules.Labels; -using Elsa.EntityFrameworkCore.Modules.Management; -using Elsa.EntityFrameworkCore.Modules.Runtime; -using Elsa.EntityFrameworkCore.Modules.Tenants; -using JetBrains.Annotations; -using Microsoft.EntityFrameworkCore; - -#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member - -namespace Elsa.EntityFrameworkCore.Sqlite; - -[UsedImplicitly] -public class IdentityDbContextFactory : SqliteDesignTimeDbContextFactory; - -[UsedImplicitly] -public class ManagementDbContextFactory : SqliteDesignTimeDbContextFactory; - -[UsedImplicitly] -public class RuntimeDbContextFactory : SqliteDesignTimeDbContextFactory; - -[UsedImplicitly] -public class LabelsDbContextFactory : SqliteDesignTimeDbContextFactory; - -[UsedImplicitly] -public class AlterationsDbContextFactories : SqliteDesignTimeDbContextFactory; - -[UsedImplicitly] -public class TenantsDbContextFactories : SqliteDesignTimeDbContextFactory; - -public class SqliteDesignTimeDbContextFactory : DesignTimeDbContextFactoryBase where TDbContext : DbContext -{ - protected override void ConfigureBuilder(DbContextOptionsBuilder builder, string connectionString) - { - builder.UseElsaSqlite(GetType().Assembly, connectionString); - } -} \ No newline at end of file diff --git a/src/modules/Elsa.EntityFrameworkCore.Sqlite/DbContextOptionsBuilderExtensions.cs b/src/modules/Elsa.EntityFrameworkCore.Sqlite/DbContextOptionsBuilderExtensions.cs deleted file mode 100644 index dc3c386def..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Sqlite/DbContextOptionsBuilderExtensions.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System.Reflection; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; - -// ReSharper disable once CheckNamespace -namespace Elsa.EntityFrameworkCore.Extensions; - -/// -/// Contains extension methods for . -/// -public static class DbContextOptionsBuilderExtensions -{ - /// - /// Configures Entity Framework Core with SQLite. - /// - public static DbContextOptionsBuilder UseElsaSqlite(this DbContextOptionsBuilder builder, Assembly migrationsAssembly, string connectionString = Constants.DefaultConnectionString, ElsaDbContextOptions? options = default, Action? configure = default) => - builder - .UseElsaDbContextOptions(options) - .UseSqlite(connectionString, db => - { - db - .MigrationsAssembly(options.GetMigrationsAssemblyName(migrationsAssembly)) - .MigrationsHistoryTable(options.GetMigrationsHistoryTableName(), options.GetSchemaName()); - - configure?.Invoke(db); - }); -} \ No newline at end of file diff --git a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Elsa.EntityFrameworkCore.Sqlite.csproj b/src/modules/Elsa.EntityFrameworkCore.Sqlite/Elsa.EntityFrameworkCore.Sqlite.csproj deleted file mode 100644 index 7b7edfa041..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Elsa.EntityFrameworkCore.Sqlite.csproj +++ /dev/null @@ -1,20 +0,0 @@ - - - - - Provides SQLite EF Core migrations for various modules. - - elsa module persistence efcore sqlite - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/modules/Elsa.EntityFrameworkCore.Sqlite/FodyWeavers.xml b/src/modules/Elsa.EntityFrameworkCore.Sqlite/FodyWeavers.xml deleted file mode 100644 index 00e1d9a1c1..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Sqlite/FodyWeavers.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Alterations/20231015122159_Initial.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Alterations/20231015122159_Initial.Designer.cs deleted file mode 100644 index 2edc7c955c..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Alterations/20231015122159_Initial.Designer.cs +++ /dev/null @@ -1,117 +0,0 @@ -// -using Elsa.EntityFrameworkCore.Modules.Alterations; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.Sqlite.Migrations.Alterations -{ - [DbContext(typeof(AlterationsElsaDbContext))] - [Migration("20231015122159_Initial")] - partial class Initial - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder.HasAnnotation("ProductVersion", "7.0.11"); - - modelBuilder.Entity("Elsa.Alterations.Core.Entities.AlterationJob", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("CompletedAt") - .HasColumnType("TEXT"); - - b.Property("CreatedAt") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("PlanId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("SerializedLog") - .HasColumnType("TEXT"); - - b.Property("StartedAt") - .HasColumnType("TEXT"); - - b.Property("Status") - .HasColumnType("INTEGER"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("CompletedAt") - .HasDatabaseName("IX_AlterationJob_CompletedAt"); - - b.HasIndex("CreatedAt") - .HasDatabaseName("IX_AlterationJob_CreatedAt"); - - b.HasIndex("PlanId") - .HasDatabaseName("IX_AlterationJob_PlanId"); - - b.HasIndex("StartedAt") - .HasDatabaseName("IX_AlterationJob_StartedAt"); - - b.HasIndex("Status") - .HasDatabaseName("IX_AlterationJob_Status"); - - b.HasIndex("WorkflowInstanceId") - .HasDatabaseName("IX_AlterationJob_WorkflowInstanceId"); - - b.ToTable("AlterationJobs"); - }); - - modelBuilder.Entity("Elsa.Alterations.Core.Entities.AlterationPlan", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("CompletedAt") - .HasColumnType("TEXT"); - - b.Property("CreatedAt") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("SerializedAlterations") - .HasColumnType("TEXT"); - - b.Property("SerializedWorkflowInstanceIds") - .HasColumnType("TEXT"); - - b.Property("StartedAt") - .HasColumnType("TEXT"); - - b.Property("Status") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("CompletedAt") - .HasDatabaseName("IX_AlterationPlan_CompletedAt"); - - b.HasIndex("CreatedAt") - .HasDatabaseName("IX_AlterationPlan_CreatedAt"); - - b.HasIndex("StartedAt") - .HasDatabaseName("IX_AlterationPlan_StartedAt"); - - b.HasIndex("Status") - .HasDatabaseName("IX_AlterationPlan_Status"); - - b.ToTable("AlterationPlans"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Alterations/20231015122159_Initial.cs b/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Alterations/20231015122159_Initial.cs deleted file mode 100644 index d9ff77d6fe..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Alterations/20231015122159_Initial.cs +++ /dev/null @@ -1,109 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.Sqlite.Migrations.Alterations -{ - /// - public partial class Initial : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "AlterationJobs", - columns: table => new - { - Id = table.Column(type: "TEXT", nullable: false), - PlanId = table.Column(type: "TEXT", nullable: false), - WorkflowInstanceId = table.Column(type: "TEXT", nullable: false), - Status = table.Column(type: "INTEGER", nullable: false), - CreatedAt = table.Column(type: "TEXT", nullable: false), - StartedAt = table.Column(type: "TEXT", nullable: true), - CompletedAt = table.Column(type: "TEXT", nullable: true), - SerializedLog = table.Column(type: "TEXT", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_AlterationJobs", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "AlterationPlans", - columns: table => new - { - Id = table.Column(type: "TEXT", nullable: false), - Status = table.Column(type: "INTEGER", nullable: false), - CreatedAt = table.Column(type: "TEXT", nullable: false), - StartedAt = table.Column(type: "TEXT", nullable: true), - CompletedAt = table.Column(type: "TEXT", nullable: true), - SerializedAlterations = table.Column(type: "TEXT", nullable: true), - SerializedWorkflowInstanceIds = table.Column(type: "TEXT", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_AlterationPlans", x => x.Id); - }); - - migrationBuilder.CreateIndex( - name: "IX_AlterationJob_CompletedAt", - table: "AlterationJobs", - column: "CompletedAt"); - - migrationBuilder.CreateIndex( - name: "IX_AlterationJob_CreatedAt", - table: "AlterationJobs", - column: "CreatedAt"); - - migrationBuilder.CreateIndex( - name: "IX_AlterationJob_PlanId", - table: "AlterationJobs", - column: "PlanId"); - - migrationBuilder.CreateIndex( - name: "IX_AlterationJob_StartedAt", - table: "AlterationJobs", - column: "StartedAt"); - - migrationBuilder.CreateIndex( - name: "IX_AlterationJob_Status", - table: "AlterationJobs", - column: "Status"); - - migrationBuilder.CreateIndex( - name: "IX_AlterationJob_WorkflowInstanceId", - table: "AlterationJobs", - column: "WorkflowInstanceId"); - - migrationBuilder.CreateIndex( - name: "IX_AlterationPlan_CompletedAt", - table: "AlterationPlans", - column: "CompletedAt"); - - migrationBuilder.CreateIndex( - name: "IX_AlterationPlan_CreatedAt", - table: "AlterationPlans", - column: "CreatedAt"); - - migrationBuilder.CreateIndex( - name: "IX_AlterationPlan_StartedAt", - table: "AlterationPlans", - column: "StartedAt"); - - migrationBuilder.CreateIndex( - name: "IX_AlterationPlan_Status", - table: "AlterationPlans", - column: "Status"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "AlterationJobs"); - - migrationBuilder.DropTable( - name: "AlterationPlans"); - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Alterations/20240329200634_V3_1.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Alterations/20240329200634_V3_1.Designer.cs deleted file mode 100644 index 47bab0e42e..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Alterations/20240329200634_V3_1.Designer.cs +++ /dev/null @@ -1,119 +0,0 @@ -// -using Elsa.EntityFrameworkCore.Modules.Alterations; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.Sqlite.Migrations.Alterations -{ - [DbContext(typeof(AlterationsElsaDbContext))] - [Migration("20240329200634_V3_1")] - partial class V3_1 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder.HasAnnotation("ProductVersion", "7.0.14"); - - modelBuilder.Entity("Elsa.Alterations.Core.Entities.AlterationJob", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("CompletedAt") - .HasColumnType("TEXT"); - - b.Property("CreatedAt") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("PlanId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("SerializedLog") - .HasColumnType("TEXT"); - - b.Property("StartedAt") - .HasColumnType("TEXT"); - - b.Property("Status") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("CompletedAt") - .HasDatabaseName("IX_AlterationJob_CompletedAt"); - - b.HasIndex("CreatedAt") - .HasDatabaseName("IX_AlterationJob_CreatedAt"); - - b.HasIndex("PlanId") - .HasDatabaseName("IX_AlterationJob_PlanId"); - - b.HasIndex("StartedAt") - .HasDatabaseName("IX_AlterationJob_StartedAt"); - - b.HasIndex("Status") - .HasDatabaseName("IX_AlterationJob_Status"); - - b.HasIndex("WorkflowInstanceId") - .HasDatabaseName("IX_AlterationJob_WorkflowInstanceId"); - - b.ToTable("AlterationJobs"); - }); - - modelBuilder.Entity("Elsa.Alterations.Core.Entities.AlterationPlan", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("CompletedAt") - .HasColumnType("TEXT"); - - b.Property("CreatedAt") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("SerializedAlterations") - .HasColumnType("TEXT"); - - b.Property("SerializedWorkflowInstanceFilter") - .HasColumnType("TEXT"); - - b.Property("StartedAt") - .HasColumnType("TEXT"); - - b.Property("Status") - .IsRequired() - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("CompletedAt") - .HasDatabaseName("IX_AlterationPlan_CompletedAt"); - - b.HasIndex("CreatedAt") - .HasDatabaseName("IX_AlterationPlan_CreatedAt"); - - b.HasIndex("StartedAt") - .HasDatabaseName("IX_AlterationPlan_StartedAt"); - - b.HasIndex("Status") - .HasDatabaseName("IX_AlterationPlan_Status"); - - b.ToTable("AlterationPlans"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Alterations/20240329200634_V3_1.cs b/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Alterations/20240329200634_V3_1.cs deleted file mode 100644 index c0aa49c2ca..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Alterations/20240329200634_V3_1.cs +++ /dev/null @@ -1,68 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.Sqlite.Migrations.Alterations -{ - /// - public partial class V3_1 : Migration - { - private readonly IElsaDbContextSchema _schema; - - /// - public V3_1(IElsaDbContextSchema schema) - { - _schema = schema; - } - - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.RenameColumn( - name: "SerializedWorkflowInstanceIds", - table: "AlterationPlans", - newName: "SerializedWorkflowInstanceFilter"); - - migrationBuilder.AlterColumn( - name: "Status", - table: "AlterationPlans", - type: "TEXT", - nullable: false, - oldClrType: typeof(int), - oldType: "INTEGER"); - - migrationBuilder.AlterColumn( - name: "Status", - table: "AlterationJobs", - type: "TEXT", - nullable: false, - oldClrType: typeof(int), - oldType: "INTEGER"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.RenameColumn( - name: "SerializedWorkflowInstanceFilter", - table: "AlterationPlans", - newName: "SerializedWorkflowInstanceIds"); - - migrationBuilder.AlterColumn( - name: "Status", - table: "AlterationPlans", - type: "INTEGER", - nullable: false, - oldClrType: typeof(string), - oldType: "TEXT"); - - migrationBuilder.AlterColumn( - name: "Status", - table: "AlterationJobs", - type: "INTEGER", - nullable: false, - oldClrType: typeof(string), - oldType: "TEXT"); - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Alterations/20240610184608_V3_2.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Alterations/20240610184608_V3_2.Designer.cs deleted file mode 100644 index 74f9a7fa88..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Alterations/20240610184608_V3_2.Designer.cs +++ /dev/null @@ -1,119 +0,0 @@ -// -using Elsa.EntityFrameworkCore.Modules.Alterations; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.Sqlite.Migrations.Alterations -{ - [DbContext(typeof(AlterationsElsaDbContext))] - [Migration("20240610184608_V3_2")] - partial class V3_2 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder.HasAnnotation("ProductVersion", "7.0.20"); - - modelBuilder.Entity("Elsa.Alterations.Core.Entities.AlterationJob", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("CompletedAt") - .HasColumnType("TEXT"); - - b.Property("CreatedAt") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("PlanId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("SerializedLog") - .HasColumnType("TEXT"); - - b.Property("StartedAt") - .HasColumnType("TEXT"); - - b.Property("Status") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("CompletedAt") - .HasDatabaseName("IX_AlterationJob_CompletedAt"); - - b.HasIndex("CreatedAt") - .HasDatabaseName("IX_AlterationJob_CreatedAt"); - - b.HasIndex("PlanId") - .HasDatabaseName("IX_AlterationJob_PlanId"); - - b.HasIndex("StartedAt") - .HasDatabaseName("IX_AlterationJob_StartedAt"); - - b.HasIndex("Status") - .HasDatabaseName("IX_AlterationJob_Status"); - - b.HasIndex("WorkflowInstanceId") - .HasDatabaseName("IX_AlterationJob_WorkflowInstanceId"); - - b.ToTable("AlterationJobs"); - }); - - modelBuilder.Entity("Elsa.Alterations.Core.Entities.AlterationPlan", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("CompletedAt") - .HasColumnType("TEXT"); - - b.Property("CreatedAt") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("SerializedAlterations") - .HasColumnType("TEXT"); - - b.Property("SerializedWorkflowInstanceFilter") - .HasColumnType("TEXT"); - - b.Property("StartedAt") - .HasColumnType("TEXT"); - - b.Property("Status") - .IsRequired() - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("CompletedAt") - .HasDatabaseName("IX_AlterationPlan_CompletedAt"); - - b.HasIndex("CreatedAt") - .HasDatabaseName("IX_AlterationPlan_CreatedAt"); - - b.HasIndex("StartedAt") - .HasDatabaseName("IX_AlterationPlan_StartedAt"); - - b.HasIndex("Status") - .HasDatabaseName("IX_AlterationPlan_Status"); - - b.ToTable("AlterationPlans"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Alterations/20240610184608_V3_2.cs b/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Alterations/20240610184608_V3_2.cs deleted file mode 100644 index f779303aa9..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Alterations/20240610184608_V3_2.cs +++ /dev/null @@ -1,30 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.Sqlite.Migrations.Alterations -{ - /// - public partial class V3_2 : Migration - { - private readonly IElsaDbContextSchema _schema; - - /// - public V3_2(IElsaDbContextSchema schema) - { - _schema = schema; - } - - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Alterations/20241212211547_V3_3.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Alterations/20241212211547_V3_3.Designer.cs deleted file mode 100644 index a4b55f6ecd..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Alterations/20241212211547_V3_3.Designer.cs +++ /dev/null @@ -1,130 +0,0 @@ -// -using System; -using Elsa.EntityFrameworkCore.Modules.Alterations; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.Sqlite.Migrations.Alterations -{ - [DbContext(typeof(AlterationsElsaDbContext))] - [Migration("20241212211547_V3_3")] - partial class V3_3 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder.HasAnnotation("ProductVersion", "7.0.20"); - - modelBuilder.Entity("Elsa.Alterations.Core.Entities.AlterationJob", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("CompletedAt") - .HasColumnType("TEXT"); - - b.Property("CreatedAt") - .HasColumnType("TEXT"); - - b.Property("PlanId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("SerializedLog") - .HasColumnType("TEXT"); - - b.Property("StartedAt") - .HasColumnType("TEXT"); - - b.Property("Status") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("TenantId") - .HasColumnType("TEXT"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("CompletedAt") - .HasDatabaseName("IX_AlterationJob_CompletedAt"); - - b.HasIndex("CreatedAt") - .HasDatabaseName("IX_AlterationJob_CreatedAt"); - - b.HasIndex("PlanId") - .HasDatabaseName("IX_AlterationJob_PlanId"); - - b.HasIndex("StartedAt") - .HasDatabaseName("IX_AlterationJob_StartedAt"); - - b.HasIndex("Status") - .HasDatabaseName("IX_AlterationJob_Status"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_AlterationJob_TenantId"); - - b.HasIndex("WorkflowInstanceId") - .HasDatabaseName("IX_AlterationJob_WorkflowInstanceId"); - - b.ToTable("AlterationJobs"); - }); - - modelBuilder.Entity("Elsa.Alterations.Core.Entities.AlterationPlan", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("CompletedAt") - .HasColumnType("TEXT"); - - b.Property("CreatedAt") - .HasColumnType("TEXT"); - - b.Property("SerializedAlterations") - .HasColumnType("TEXT"); - - b.Property("SerializedWorkflowInstanceFilter") - .HasColumnType("TEXT"); - - b.Property("StartedAt") - .HasColumnType("TEXT"); - - b.Property("Status") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("TenantId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("CompletedAt") - .HasDatabaseName("IX_AlterationPlan_CompletedAt"); - - b.HasIndex("CreatedAt") - .HasDatabaseName("IX_AlterationPlan_CreatedAt"); - - b.HasIndex("StartedAt") - .HasDatabaseName("IX_AlterationPlan_StartedAt"); - - b.HasIndex("Status") - .HasDatabaseName("IX_AlterationPlan_Status"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_AlterationPlan_TenantId"); - - b.ToTable("AlterationPlans"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Alterations/20241212211547_V3_3.cs b/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Alterations/20241212211547_V3_3.cs deleted file mode 100644 index 2400207bed..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Alterations/20241212211547_V3_3.cs +++ /dev/null @@ -1,64 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.Sqlite.Migrations.Alterations -{ - /// - public partial class V3_3 : Migration - { - private readonly Elsa.EntityFrameworkCore.IElsaDbContextSchema _schema; - - /// - public V3_3(Elsa.EntityFrameworkCore.IElsaDbContextSchema schema) - { - _schema = schema; - } - - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "TenantId", - table: "AlterationPlans", - type: "TEXT", - nullable: true); - - migrationBuilder.AddColumn( - name: "TenantId", - table: "AlterationJobs", - type: "TEXT", - nullable: true); - - migrationBuilder.CreateIndex( - name: "IX_AlterationPlan_TenantId", - table: "AlterationPlans", - column: "TenantId"); - - migrationBuilder.CreateIndex( - name: "IX_AlterationJob_TenantId", - table: "AlterationJobs", - column: "TenantId"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropIndex( - name: "IX_AlterationPlan_TenantId", - table: "AlterationPlans"); - - migrationBuilder.DropIndex( - name: "IX_AlterationJob_TenantId", - table: "AlterationJobs"); - - migrationBuilder.DropColumn( - name: "TenantId", - table: "AlterationPlans"); - - migrationBuilder.DropColumn( - name: "TenantId", - table: "AlterationJobs"); - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Alterations/20250222190815_V3_4.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Alterations/20250222190815_V3_4.Designer.cs deleted file mode 100644 index d95253ef52..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Alterations/20250222190815_V3_4.Designer.cs +++ /dev/null @@ -1,132 +0,0 @@ -// -using System; -using Elsa.EntityFrameworkCore.Modules.Alterations; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.Sqlite.Migrations.Alterations -{ - [DbContext(typeof(AlterationsElsaDbContext))] - [Migration("20250222190815_V3_4")] - partial class V3_4 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "8.0.12"); - - modelBuilder.Entity("Elsa.Alterations.Core.Entities.AlterationJob", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("CompletedAt") - .HasColumnType("TEXT"); - - b.Property("CreatedAt") - .HasColumnType("TEXT"); - - b.Property("PlanId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("SerializedLog") - .HasColumnType("TEXT"); - - b.Property("StartedAt") - .HasColumnType("TEXT"); - - b.Property("Status") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("TenantId") - .HasColumnType("TEXT"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("CompletedAt") - .HasDatabaseName("IX_AlterationJob_CompletedAt"); - - b.HasIndex("CreatedAt") - .HasDatabaseName("IX_AlterationJob_CreatedAt"); - - b.HasIndex("PlanId") - .HasDatabaseName("IX_AlterationJob_PlanId"); - - b.HasIndex("StartedAt") - .HasDatabaseName("IX_AlterationJob_StartedAt"); - - b.HasIndex("Status") - .HasDatabaseName("IX_AlterationJob_Status"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_AlterationJob_TenantId"); - - b.HasIndex("WorkflowInstanceId") - .HasDatabaseName("IX_AlterationJob_WorkflowInstanceId"); - - b.ToTable("AlterationJobs", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Alterations.Core.Entities.AlterationPlan", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("CompletedAt") - .HasColumnType("TEXT"); - - b.Property("CreatedAt") - .HasColumnType("TEXT"); - - b.Property("SerializedAlterations") - .HasColumnType("TEXT"); - - b.Property("SerializedWorkflowInstanceFilter") - .HasColumnType("TEXT"); - - b.Property("StartedAt") - .HasColumnType("TEXT"); - - b.Property("Status") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("TenantId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("CompletedAt") - .HasDatabaseName("IX_AlterationPlan_CompletedAt"); - - b.HasIndex("CreatedAt") - .HasDatabaseName("IX_AlterationPlan_CreatedAt"); - - b.HasIndex("StartedAt") - .HasDatabaseName("IX_AlterationPlan_StartedAt"); - - b.HasIndex("Status") - .HasDatabaseName("IX_AlterationPlan_Status"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_AlterationPlan_TenantId"); - - b.ToTable("AlterationPlans", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Alterations/20250222190815_V3_4.cs b/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Alterations/20250222190815_V3_4.cs deleted file mode 100644 index 3631eb1299..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Alterations/20250222190815_V3_4.cs +++ /dev/null @@ -1,49 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.Sqlite.Migrations.Alterations -{ - /// - public partial class V3_4 : Migration - { - private readonly Elsa.EntityFrameworkCore.IElsaDbContextSchema _schema; - - /// - public V3_4(Elsa.EntityFrameworkCore.IElsaDbContextSchema schema) - { - _schema = schema; - } - - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.EnsureSchema( - name: _schema.Schema); - - migrationBuilder.RenameTable( - name: "AlterationPlans", - newName: "AlterationPlans", - newSchema: _schema.Schema); - - migrationBuilder.RenameTable( - name: "AlterationJobs", - newName: "AlterationJobs", - newSchema: _schema.Schema); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.RenameTable( - name: "AlterationPlans", - schema: _schema.Schema, - newName: "AlterationPlans"); - - migrationBuilder.RenameTable( - name: "AlterationJobs", - schema: _schema.Schema, - newName: "AlterationJobs"); - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Alterations/AlterationsElsaDbContextModelSnapshot.cs b/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Alterations/AlterationsElsaDbContextModelSnapshot.cs deleted file mode 100644 index 38cc74daa6..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Alterations/AlterationsElsaDbContextModelSnapshot.cs +++ /dev/null @@ -1,129 +0,0 @@ -// -using System; -using Elsa.EntityFrameworkCore.Modules.Alterations; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.Sqlite.Migrations.Alterations -{ - [DbContext(typeof(AlterationsElsaDbContext))] - partial class AlterationsElsaDbContextModelSnapshot : ModelSnapshot - { - protected override void BuildModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "8.0.12"); - - modelBuilder.Entity("Elsa.Alterations.Core.Entities.AlterationJob", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("CompletedAt") - .HasColumnType("TEXT"); - - b.Property("CreatedAt") - .HasColumnType("TEXT"); - - b.Property("PlanId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("SerializedLog") - .HasColumnType("TEXT"); - - b.Property("StartedAt") - .HasColumnType("TEXT"); - - b.Property("Status") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("TenantId") - .HasColumnType("TEXT"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("CompletedAt") - .HasDatabaseName("IX_AlterationJob_CompletedAt"); - - b.HasIndex("CreatedAt") - .HasDatabaseName("IX_AlterationJob_CreatedAt"); - - b.HasIndex("PlanId") - .HasDatabaseName("IX_AlterationJob_PlanId"); - - b.HasIndex("StartedAt") - .HasDatabaseName("IX_AlterationJob_StartedAt"); - - b.HasIndex("Status") - .HasDatabaseName("IX_AlterationJob_Status"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_AlterationJob_TenantId"); - - b.HasIndex("WorkflowInstanceId") - .HasDatabaseName("IX_AlterationJob_WorkflowInstanceId"); - - b.ToTable("AlterationJobs", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Alterations.Core.Entities.AlterationPlan", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("CompletedAt") - .HasColumnType("TEXT"); - - b.Property("CreatedAt") - .HasColumnType("TEXT"); - - b.Property("SerializedAlterations") - .HasColumnType("TEXT"); - - b.Property("SerializedWorkflowInstanceFilter") - .HasColumnType("TEXT"); - - b.Property("StartedAt") - .HasColumnType("TEXT"); - - b.Property("Status") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("TenantId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("CompletedAt") - .HasDatabaseName("IX_AlterationPlan_CompletedAt"); - - b.HasIndex("CreatedAt") - .HasDatabaseName("IX_AlterationPlan_CreatedAt"); - - b.HasIndex("StartedAt") - .HasDatabaseName("IX_AlterationPlan_StartedAt"); - - b.HasIndex("Status") - .HasDatabaseName("IX_AlterationPlan_Status"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_AlterationPlan_TenantId"); - - b.ToTable("AlterationPlans", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Identity/20231015122246_Initial.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Identity/20231015122246_Initial.Designer.cs deleted file mode 100644 index e27d1ab1ed..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Identity/20231015122246_Initial.Designer.cs +++ /dev/null @@ -1,125 +0,0 @@ -// -using Elsa.EntityFrameworkCore.Modules.Identity; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.Sqlite.Migrations.Identity -{ - [DbContext(typeof(IdentityElsaDbContext))] - [Migration("20231015122246_Initial")] - partial class Initial - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder.HasAnnotation("ProductVersion", "7.0.11"); - - modelBuilder.Entity("Elsa.Identity.Entities.Application", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("ClientId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("HashedApiKey") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("HashedApiKeySalt") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("HashedClientSecret") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("HashedClientSecretSalt") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("Name") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("Roles") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("Roles"); - - b.HasKey("Id"); - - b.HasIndex("ClientId") - .IsUnique() - .HasDatabaseName("IX_Application_ClientId"); - - b.HasIndex("Name") - .IsUnique() - .HasDatabaseName("IX_Application_Name"); - - b.ToTable("Applications"); - }); - - modelBuilder.Entity("Elsa.Identity.Entities.Role", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("Name") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("Permissions") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("Permissions"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique() - .HasDatabaseName("IX_Role_Name"); - - b.ToTable("Roles"); - }); - - modelBuilder.Entity("Elsa.Identity.Entities.User", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("HashedPassword") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("HashedPasswordSalt") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("Name") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("Roles") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("Roles"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique() - .HasDatabaseName("IX_User_Name"); - - b.ToTable("Users"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Identity/20231015122246_Initial.cs b/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Identity/20231015122246_Initial.cs deleted file mode 100644 index e78e031255..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Identity/20231015122246_Initial.cs +++ /dev/null @@ -1,97 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.Sqlite.Migrations.Identity -{ - /// - public partial class Initial : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "Applications", - columns: table => new - { - Id = table.Column(type: "TEXT", nullable: false), - ClientId = table.Column(type: "TEXT", nullable: false), - HashedClientSecret = table.Column(type: "TEXT", nullable: false), - HashedClientSecretSalt = table.Column(type: "TEXT", nullable: false), - Name = table.Column(type: "TEXT", nullable: false), - HashedApiKey = table.Column(type: "TEXT", nullable: false), - HashedApiKeySalt = table.Column(type: "TEXT", nullable: false), - Roles = table.Column(type: "TEXT", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Applications", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "Roles", - columns: table => new - { - Id = table.Column(type: "TEXT", nullable: false), - Name = table.Column(type: "TEXT", nullable: false), - Permissions = table.Column(type: "TEXT", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Roles", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "Users", - columns: table => new - { - Id = table.Column(type: "TEXT", nullable: false), - Name = table.Column(type: "TEXT", nullable: false), - HashedPassword = table.Column(type: "TEXT", nullable: false), - HashedPasswordSalt = table.Column(type: "TEXT", nullable: false), - Roles = table.Column(type: "TEXT", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Users", x => x.Id); - }); - - migrationBuilder.CreateIndex( - name: "IX_Application_ClientId", - table: "Applications", - column: "ClientId", - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_Application_Name", - table: "Applications", - column: "Name", - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_Role_Name", - table: "Roles", - column: "Name", - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_User_Name", - table: "Users", - column: "Name", - unique: true); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "Applications"); - - migrationBuilder.DropTable( - name: "Roles"); - - migrationBuilder.DropTable( - name: "Users"); - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Identity/20240329200800_V3_1.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Identity/20240329200800_V3_1.Designer.cs deleted file mode 100644 index 833c23e32d..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Identity/20240329200800_V3_1.Designer.cs +++ /dev/null @@ -1,125 +0,0 @@ -// -using Elsa.EntityFrameworkCore.Modules.Identity; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.Sqlite.Migrations.Identity -{ - [DbContext(typeof(IdentityElsaDbContext))] - [Migration("20240329200800_V3_1")] - partial class V3_1 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder.HasAnnotation("ProductVersion", "7.0.14"); - - modelBuilder.Entity("Elsa.Identity.Entities.Application", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("ClientId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("HashedApiKey") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("HashedApiKeySalt") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("HashedClientSecret") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("HashedClientSecretSalt") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("Name") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("Roles") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("Roles"); - - b.HasKey("Id"); - - b.HasIndex("ClientId") - .IsUnique() - .HasDatabaseName("IX_Application_ClientId"); - - b.HasIndex("Name") - .IsUnique() - .HasDatabaseName("IX_Application_Name"); - - b.ToTable("Applications"); - }); - - modelBuilder.Entity("Elsa.Identity.Entities.Role", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("Name") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("Permissions") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("Permissions"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique() - .HasDatabaseName("IX_Role_Name"); - - b.ToTable("Roles"); - }); - - modelBuilder.Entity("Elsa.Identity.Entities.User", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("HashedPassword") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("HashedPasswordSalt") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("Name") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("Roles") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("Roles"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique() - .HasDatabaseName("IX_User_Name"); - - b.ToTable("Users"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Identity/20240329200800_V3_1.cs b/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Identity/20240329200800_V3_1.cs deleted file mode 100644 index 6e2aa0f3a1..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Identity/20240329200800_V3_1.cs +++ /dev/null @@ -1,30 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.Sqlite.Migrations.Identity -{ - /// - public partial class V3_1 : Migration - { - private readonly IElsaDbContextSchema _schema; - - /// - public V3_1(IElsaDbContextSchema schema) - { - _schema = schema; - } - - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Identity/20240610184930_V3_2.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Identity/20240610184930_V3_2.Designer.cs deleted file mode 100644 index d94c085c81..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Identity/20240610184930_V3_2.Designer.cs +++ /dev/null @@ -1,125 +0,0 @@ -// -using Elsa.EntityFrameworkCore.Modules.Identity; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.Sqlite.Migrations.Identity -{ - [DbContext(typeof(IdentityElsaDbContext))] - [Migration("20240610184930_V3_2")] - partial class V3_2 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder.HasAnnotation("ProductVersion", "7.0.20"); - - modelBuilder.Entity("Elsa.Identity.Entities.Application", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("ClientId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("HashedApiKey") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("HashedApiKeySalt") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("HashedClientSecret") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("HashedClientSecretSalt") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("Name") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("Roles") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("Roles"); - - b.HasKey("Id"); - - b.HasIndex("ClientId") - .IsUnique() - .HasDatabaseName("IX_Application_ClientId"); - - b.HasIndex("Name") - .IsUnique() - .HasDatabaseName("IX_Application_Name"); - - b.ToTable("Applications"); - }); - - modelBuilder.Entity("Elsa.Identity.Entities.Role", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("Name") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("Permissions") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("Permissions"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique() - .HasDatabaseName("IX_Role_Name"); - - b.ToTable("Roles"); - }); - - modelBuilder.Entity("Elsa.Identity.Entities.User", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("HashedPassword") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("HashedPasswordSalt") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("Name") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("Roles") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("Roles"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique() - .HasDatabaseName("IX_User_Name"); - - b.ToTable("Users"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Identity/20240610184930_V3_2.cs b/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Identity/20240610184930_V3_2.cs deleted file mode 100644 index 3c43a28b7c..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Identity/20240610184930_V3_2.cs +++ /dev/null @@ -1,30 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.Sqlite.Migrations.Identity -{ - /// - public partial class V3_2 : Migration - { - private readonly IElsaDbContextSchema _schema; - - /// - public V3_2(IElsaDbContextSchema schema) - { - _schema = schema; - } - - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Identity/20241212211850_V3_3.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Identity/20241212211850_V3_3.Designer.cs deleted file mode 100644 index 603cee5b92..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Identity/20241212211850_V3_3.Designer.cs +++ /dev/null @@ -1,143 +0,0 @@ -// -using Elsa.EntityFrameworkCore.Modules.Identity; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.Sqlite.Migrations.Identity -{ - [DbContext(typeof(IdentityElsaDbContext))] - [Migration("20241212211850_V3_3")] - partial class V3_3 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder.HasAnnotation("ProductVersion", "7.0.20"); - - modelBuilder.Entity("Elsa.Identity.Entities.Application", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("ClientId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("HashedApiKey") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("HashedApiKeySalt") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("HashedClientSecret") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("HashedClientSecretSalt") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("Name") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("Roles") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("Roles"); - - b.Property("TenantId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("ClientId") - .IsUnique() - .HasDatabaseName("IX_Application_ClientId"); - - b.HasIndex("Name") - .IsUnique() - .HasDatabaseName("IX_Application_Name"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_Application_TenantId"); - - b.ToTable("Applications"); - }); - - modelBuilder.Entity("Elsa.Identity.Entities.Role", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("Name") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("Permissions") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("Permissions"); - - b.Property("TenantId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique() - .HasDatabaseName("IX_Role_Name"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_Role_TenantId"); - - b.ToTable("Roles"); - }); - - modelBuilder.Entity("Elsa.Identity.Entities.User", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("HashedPassword") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("HashedPasswordSalt") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("Name") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("Roles") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("Roles"); - - b.Property("TenantId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique() - .HasDatabaseName("IX_User_Name"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_User_TenantId"); - - b.ToTable("Users"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Identity/20241212211850_V3_3.cs b/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Identity/20241212211850_V3_3.cs deleted file mode 100644 index 0299c554f1..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Identity/20241212211850_V3_3.cs +++ /dev/null @@ -1,83 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.Sqlite.Migrations.Identity -{ - /// - public partial class V3_3 : Migration - { - private readonly Elsa.EntityFrameworkCore.IElsaDbContextSchema _schema; - - /// - public V3_3(Elsa.EntityFrameworkCore.IElsaDbContextSchema schema) - { - _schema = schema; - } - - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "TenantId", - table: "Users", - type: "TEXT", - nullable: true); - - migrationBuilder.AddColumn( - name: "TenantId", - table: "Roles", - type: "TEXT", - nullable: true); - - migrationBuilder.AddColumn( - name: "TenantId", - table: "Applications", - type: "TEXT", - nullable: true); - - migrationBuilder.CreateIndex( - name: "IX_User_TenantId", - table: "Users", - column: "TenantId"); - - migrationBuilder.CreateIndex( - name: "IX_Role_TenantId", - table: "Roles", - column: "TenantId"); - - migrationBuilder.CreateIndex( - name: "IX_Application_TenantId", - table: "Applications", - column: "TenantId"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropIndex( - name: "IX_User_TenantId", - table: "Users"); - - migrationBuilder.DropIndex( - name: "IX_Role_TenantId", - table: "Roles"); - - migrationBuilder.DropIndex( - name: "IX_Application_TenantId", - table: "Applications"); - - migrationBuilder.DropColumn( - name: "TenantId", - table: "Users"); - - migrationBuilder.DropColumn( - name: "TenantId", - table: "Roles"); - - migrationBuilder.DropColumn( - name: "TenantId", - table: "Applications"); - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Identity/20250222190924_V3_4.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Identity/20250222190924_V3_4.Designer.cs deleted file mode 100644 index 0a23ff8ac4..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Identity/20250222190924_V3_4.Designer.cs +++ /dev/null @@ -1,145 +0,0 @@ -// -using Elsa.EntityFrameworkCore.Modules.Identity; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.Sqlite.Migrations.Identity -{ - [DbContext(typeof(IdentityElsaDbContext))] - [Migration("20250222190924_V3_4")] - partial class V3_4 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "8.0.12"); - - modelBuilder.Entity("Elsa.Identity.Entities.Application", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("ClientId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("HashedApiKey") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("HashedApiKeySalt") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("HashedClientSecret") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("HashedClientSecretSalt") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("Name") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("Roles") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("Roles"); - - b.Property("TenantId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("ClientId") - .IsUnique() - .HasDatabaseName("IX_Application_ClientId"); - - b.HasIndex("Name") - .IsUnique() - .HasDatabaseName("IX_Application_Name"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_Application_TenantId"); - - b.ToTable("Applications", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Identity.Entities.Role", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("Name") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("Permissions") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("Permissions"); - - b.Property("TenantId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique() - .HasDatabaseName("IX_Role_Name"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_Role_TenantId"); - - b.ToTable("Roles", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Identity.Entities.User", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("HashedPassword") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("HashedPasswordSalt") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("Name") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("Roles") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("Roles"); - - b.Property("TenantId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique() - .HasDatabaseName("IX_User_Name"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_User_TenantId"); - - b.ToTable("Users", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Identity/20250222190924_V3_4.cs b/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Identity/20250222190924_V3_4.cs deleted file mode 100644 index 22201862b5..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Identity/20250222190924_V3_4.cs +++ /dev/null @@ -1,60 +0,0 @@ -using Elsa.Extensions; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.Sqlite.Migrations.Identity -{ - /// - public partial class V3_4 : Migration - { - private readonly Elsa.EntityFrameworkCore.IElsaDbContextSchema _schema; - - /// - public V3_4(Elsa.EntityFrameworkCore.IElsaDbContextSchema schema) - { - _schema = schema; - } - - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.EnsureSchema( - name: _schema.Schema); - - migrationBuilder.RenameTable( - name: "Users", - newName: "Users", - newSchema: _schema.Schema); - - migrationBuilder.RenameTable( - name: "Roles", - newName: "Roles", - newSchema: _schema.Schema); - - migrationBuilder.RenameTable( - name: "Applications", - newName: "Applications", - newSchema: _schema.Schema); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.RenameTable( - name: "Users", - schema: _schema.Schema, - newName: "Users"); - - migrationBuilder.RenameTable( - name: "Roles", - schema: _schema.Schema, - newName: "Roles"); - - migrationBuilder.RenameTable( - name: "Applications", - schema: _schema.Schema, - newName: "Applications"); - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Identity/IdentityElsaDbContextModelSnapshot.cs b/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Identity/IdentityElsaDbContextModelSnapshot.cs deleted file mode 100644 index 3fa637d950..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Identity/IdentityElsaDbContextModelSnapshot.cs +++ /dev/null @@ -1,142 +0,0 @@ -// -using Elsa.EntityFrameworkCore.Modules.Identity; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.Sqlite.Migrations.Identity -{ - [DbContext(typeof(IdentityElsaDbContext))] - partial class IdentityElsaDbContextModelSnapshot : ModelSnapshot - { - protected override void BuildModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "8.0.12"); - - modelBuilder.Entity("Elsa.Identity.Entities.Application", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("ClientId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("HashedApiKey") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("HashedApiKeySalt") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("HashedClientSecret") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("HashedClientSecretSalt") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("Name") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("Roles") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("Roles"); - - b.Property("TenantId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("ClientId") - .IsUnique() - .HasDatabaseName("IX_Application_ClientId"); - - b.HasIndex("Name") - .IsUnique() - .HasDatabaseName("IX_Application_Name"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_Application_TenantId"); - - b.ToTable("Applications", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Identity.Entities.Role", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("Name") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("Permissions") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("Permissions"); - - b.Property("TenantId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique() - .HasDatabaseName("IX_Role_Name"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_Role_TenantId"); - - b.ToTable("Roles", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Identity.Entities.User", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("HashedPassword") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("HashedPasswordSalt") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("Name") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("Roles") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("Roles"); - - b.Property("TenantId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique() - .HasDatabaseName("IX_User_Name"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_User_TenantId"); - - b.ToTable("Users", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Labels/20231015122301_Initial.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Labels/20231015122301_Initial.Designer.cs deleted file mode 100644 index 34b57767f2..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Labels/20231015122301_Initial.Designer.cs +++ /dev/null @@ -1,79 +0,0 @@ -// -using Elsa.EntityFrameworkCore.Modules.Labels; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.Sqlite.Migrations.Labels -{ - [DbContext(typeof(LabelsElsaDbContext))] - [Migration("20231015122301_Initial")] - partial class Initial - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder.HasAnnotation("ProductVersion", "7.0.11"); - - modelBuilder.Entity("Elsa.Labels.Entities.Label", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("Color") - .HasColumnType("TEXT"); - - b.Property("Description") - .HasColumnType("TEXT"); - - b.Property("Name") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("NormalizedName") - .IsRequired() - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.ToTable("Labels"); - }); - - modelBuilder.Entity("Elsa.Labels.Entities.WorkflowDefinitionLabel", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("LabelId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("WorkflowDefinitionId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("WorkflowDefinitionVersionId") - .IsRequired() - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("LabelId") - .HasDatabaseName("WorkflowDefinitionLabel_LabelId"); - - b.HasIndex("WorkflowDefinitionId") - .HasDatabaseName("WorkflowDefinitionLabel_WorkflowDefinitionId"); - - b.HasIndex("WorkflowDefinitionVersionId") - .HasDatabaseName("WorkflowDefinitionLabel_WorkflowDefinitionVersionId"); - - b.ToTable("WorkflowDefinitionLabels"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Labels/20231015122301_Initial.cs b/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Labels/20231015122301_Initial.cs deleted file mode 100644 index cffbc529e5..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Labels/20231015122301_Initial.cs +++ /dev/null @@ -1,68 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.Sqlite.Migrations.Labels -{ - /// - public partial class Initial : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "Labels", - columns: table => new - { - Id = table.Column(type: "TEXT", nullable: false), - Name = table.Column(type: "TEXT", nullable: false), - NormalizedName = table.Column(type: "TEXT", nullable: false), - Description = table.Column(type: "TEXT", nullable: true), - Color = table.Column(type: "TEXT", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Labels", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "WorkflowDefinitionLabels", - columns: table => new - { - Id = table.Column(type: "TEXT", nullable: false), - WorkflowDefinitionId = table.Column(type: "TEXT", nullable: false), - WorkflowDefinitionVersionId = table.Column(type: "TEXT", nullable: false), - LabelId = table.Column(type: "TEXT", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_WorkflowDefinitionLabels", x => x.Id); - }); - - migrationBuilder.CreateIndex( - name: "WorkflowDefinitionLabel_LabelId", - table: "WorkflowDefinitionLabels", - column: "LabelId"); - - migrationBuilder.CreateIndex( - name: "WorkflowDefinitionLabel_WorkflowDefinitionId", - table: "WorkflowDefinitionLabels", - column: "WorkflowDefinitionId"); - - migrationBuilder.CreateIndex( - name: "WorkflowDefinitionLabel_WorkflowDefinitionVersionId", - table: "WorkflowDefinitionLabels", - column: "WorkflowDefinitionVersionId"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "Labels"); - - migrationBuilder.DropTable( - name: "WorkflowDefinitionLabels"); - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Labels/20240329200834_V3_1.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Labels/20240329200834_V3_1.Designer.cs deleted file mode 100644 index 0a36316d97..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Labels/20240329200834_V3_1.Designer.cs +++ /dev/null @@ -1,79 +0,0 @@ -// -using Elsa.EntityFrameworkCore.Modules.Labels; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.Sqlite.Migrations.Labels -{ - [DbContext(typeof(LabelsElsaDbContext))] - [Migration("20240329200834_V3_1")] - partial class V3_1 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder.HasAnnotation("ProductVersion", "7.0.14"); - - modelBuilder.Entity("Elsa.Labels.Entities.Label", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("Color") - .HasColumnType("TEXT"); - - b.Property("Description") - .HasColumnType("TEXT"); - - b.Property("Name") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("NormalizedName") - .IsRequired() - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.ToTable("Labels"); - }); - - modelBuilder.Entity("Elsa.Labels.Entities.WorkflowDefinitionLabel", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("LabelId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("WorkflowDefinitionId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("WorkflowDefinitionVersionId") - .IsRequired() - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("LabelId") - .HasDatabaseName("WorkflowDefinitionLabel_LabelId"); - - b.HasIndex("WorkflowDefinitionId") - .HasDatabaseName("WorkflowDefinitionLabel_WorkflowDefinitionId"); - - b.HasIndex("WorkflowDefinitionVersionId") - .HasDatabaseName("WorkflowDefinitionLabel_WorkflowDefinitionVersionId"); - - b.ToTable("WorkflowDefinitionLabels"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Labels/20240329200834_V3_1.cs b/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Labels/20240329200834_V3_1.cs deleted file mode 100644 index 1f8f234efb..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Labels/20240329200834_V3_1.cs +++ /dev/null @@ -1,30 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.Sqlite.Migrations.Labels -{ - /// - public partial class V3_1 : Migration - { - private readonly IElsaDbContextSchema _schema; - - /// - public V3_1(IElsaDbContextSchema schema) - { - _schema = schema; - } - - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Labels/20240610185018_V3_2.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Labels/20240610185018_V3_2.Designer.cs deleted file mode 100644 index 45554fb6f5..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Labels/20240610185018_V3_2.Designer.cs +++ /dev/null @@ -1,79 +0,0 @@ -// -using Elsa.EntityFrameworkCore.Modules.Labels; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.Sqlite.Migrations.Labels -{ - [DbContext(typeof(LabelsElsaDbContext))] - [Migration("20240610185018_V3_2")] - partial class V3_2 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder.HasAnnotation("ProductVersion", "7.0.20"); - - modelBuilder.Entity("Elsa.Labels.Entities.Label", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("Color") - .HasColumnType("TEXT"); - - b.Property("Description") - .HasColumnType("TEXT"); - - b.Property("Name") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("NormalizedName") - .IsRequired() - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.ToTable("Labels"); - }); - - modelBuilder.Entity("Elsa.Labels.Entities.WorkflowDefinitionLabel", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("LabelId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("WorkflowDefinitionId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("WorkflowDefinitionVersionId") - .IsRequired() - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("LabelId") - .HasDatabaseName("WorkflowDefinitionLabel_LabelId"); - - b.HasIndex("WorkflowDefinitionId") - .HasDatabaseName("WorkflowDefinitionLabel_WorkflowDefinitionId"); - - b.HasIndex("WorkflowDefinitionVersionId") - .HasDatabaseName("WorkflowDefinitionLabel_WorkflowDefinitionVersionId"); - - b.ToTable("WorkflowDefinitionLabels"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Labels/20240610185018_V3_2.cs b/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Labels/20240610185018_V3_2.cs deleted file mode 100644 index 73bcf04f57..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Labels/20240610185018_V3_2.cs +++ /dev/null @@ -1,30 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.Sqlite.Migrations.Labels -{ - /// - public partial class V3_2 : Migration - { - private readonly IElsaDbContextSchema _schema; - - /// - public V3_2(IElsaDbContextSchema schema) - { - _schema = schema; - } - - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Labels/20241212212030_V3_3.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Labels/20241212212030_V3_3.Designer.cs deleted file mode 100644 index 5859543118..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Labels/20241212212030_V3_3.Designer.cs +++ /dev/null @@ -1,88 +0,0 @@ -// -using Elsa.EntityFrameworkCore.Modules.Labels; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.Sqlite.Migrations.Labels -{ - [DbContext(typeof(LabelsElsaDbContext))] - [Migration("20241212212030_V3_3")] - partial class V3_3 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder.HasAnnotation("ProductVersion", "7.0.20"); - - modelBuilder.Entity("Elsa.Labels.Entities.Label", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("Color") - .HasColumnType("TEXT"); - - b.Property("Description") - .HasColumnType("TEXT"); - - b.Property("Name") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("NormalizedName") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("TenantId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.ToTable("Labels"); - }); - - modelBuilder.Entity("Elsa.Labels.Entities.WorkflowDefinitionLabel", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("LabelId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("TenantId") - .HasColumnType("TEXT"); - - b.Property("WorkflowDefinitionId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("WorkflowDefinitionVersionId") - .IsRequired() - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("LabelId") - .HasDatabaseName("WorkflowDefinitionLabel_LabelId"); - - b.HasIndex("TenantId") - .HasDatabaseName("WorkflowDefinitionLabel_TenantId"); - - b.HasIndex("WorkflowDefinitionId") - .HasDatabaseName("WorkflowDefinitionLabel_WorkflowDefinitionId"); - - b.HasIndex("WorkflowDefinitionVersionId") - .HasDatabaseName("WorkflowDefinitionLabel_WorkflowDefinitionVersionId"); - - b.ToTable("WorkflowDefinitionLabels"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Labels/20241212212030_V3_3.cs b/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Labels/20241212212030_V3_3.cs deleted file mode 100644 index 6075de0db7..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Labels/20241212212030_V3_3.cs +++ /dev/null @@ -1,55 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.Sqlite.Migrations.Labels -{ - /// - public partial class V3_3 : Migration - { - private readonly Elsa.EntityFrameworkCore.IElsaDbContextSchema _schema; - - /// - public V3_3(Elsa.EntityFrameworkCore.IElsaDbContextSchema schema) - { - _schema = schema; - } - - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "TenantId", - table: "WorkflowDefinitionLabels", - type: "TEXT", - nullable: true); - - migrationBuilder.AddColumn( - name: "TenantId", - table: "Labels", - type: "TEXT", - nullable: true); - - migrationBuilder.CreateIndex( - name: "WorkflowDefinitionLabel_TenantId", - table: "WorkflowDefinitionLabels", - column: "TenantId"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropIndex( - name: "WorkflowDefinitionLabel_TenantId", - table: "WorkflowDefinitionLabels"); - - migrationBuilder.DropColumn( - name: "TenantId", - table: "WorkflowDefinitionLabels"); - - migrationBuilder.DropColumn( - name: "TenantId", - table: "Labels"); - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Labels/20250222190951_V3_4.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Labels/20250222190951_V3_4.Designer.cs deleted file mode 100644 index 6d2cb97f8e..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Labels/20250222190951_V3_4.Designer.cs +++ /dev/null @@ -1,90 +0,0 @@ -// -using Elsa.EntityFrameworkCore.Modules.Labels; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.Sqlite.Migrations.Labels -{ - [DbContext(typeof(LabelsElsaDbContext))] - [Migration("20250222190951_V3_4")] - partial class V3_4 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "8.0.12"); - - modelBuilder.Entity("Elsa.Labels.Entities.Label", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("Color") - .HasColumnType("TEXT"); - - b.Property("Description") - .HasColumnType("TEXT"); - - b.Property("Name") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("NormalizedName") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("TenantId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.ToTable("Labels", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Labels.Entities.WorkflowDefinitionLabel", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("LabelId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("TenantId") - .HasColumnType("TEXT"); - - b.Property("WorkflowDefinitionId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("WorkflowDefinitionVersionId") - .IsRequired() - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("LabelId") - .HasDatabaseName("WorkflowDefinitionLabel_LabelId"); - - b.HasIndex("TenantId") - .HasDatabaseName("WorkflowDefinitionLabel_TenantId"); - - b.HasIndex("WorkflowDefinitionId") - .HasDatabaseName("WorkflowDefinitionLabel_WorkflowDefinitionId"); - - b.HasIndex("WorkflowDefinitionVersionId") - .HasDatabaseName("WorkflowDefinitionLabel_WorkflowDefinitionVersionId"); - - b.ToTable("WorkflowDefinitionLabels", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Labels/20250222190951_V3_4.cs b/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Labels/20250222190951_V3_4.cs deleted file mode 100644 index 8ca5e24079..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Labels/20250222190951_V3_4.cs +++ /dev/null @@ -1,49 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.Sqlite.Migrations.Labels -{ - /// - public partial class V3_4 : Migration - { - private readonly Elsa.EntityFrameworkCore.IElsaDbContextSchema _schema; - - /// - public V3_4(Elsa.EntityFrameworkCore.IElsaDbContextSchema schema) - { - _schema = schema; - } - - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.EnsureSchema( - name: _schema.Schema); - - migrationBuilder.RenameTable( - name: "WorkflowDefinitionLabels", - newName: "WorkflowDefinitionLabels", - newSchema: _schema.Schema); - - migrationBuilder.RenameTable( - name: "Labels", - newName: "Labels", - newSchema: _schema.Schema); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.RenameTable( - name: "WorkflowDefinitionLabels", - schema: _schema.Schema, - newName: "WorkflowDefinitionLabels"); - - migrationBuilder.RenameTable( - name: "Labels", - schema: _schema.Schema, - newName: "Labels"); - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Labels/LabelsElsaDbContextModelSnapshot.cs b/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Labels/LabelsElsaDbContextModelSnapshot.cs deleted file mode 100644 index 50e82e708d..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Labels/LabelsElsaDbContextModelSnapshot.cs +++ /dev/null @@ -1,87 +0,0 @@ -// -using Elsa.EntityFrameworkCore.Modules.Labels; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.Sqlite.Migrations.Labels -{ - [DbContext(typeof(LabelsElsaDbContext))] - partial class LabelsElsaDbContextModelSnapshot : ModelSnapshot - { - protected override void BuildModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "8.0.12"); - - modelBuilder.Entity("Elsa.Labels.Entities.Label", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("Color") - .HasColumnType("TEXT"); - - b.Property("Description") - .HasColumnType("TEXT"); - - b.Property("Name") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("NormalizedName") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("TenantId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.ToTable("Labels", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Labels.Entities.WorkflowDefinitionLabel", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("LabelId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("TenantId") - .HasColumnType("TEXT"); - - b.Property("WorkflowDefinitionId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("WorkflowDefinitionVersionId") - .IsRequired() - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("LabelId") - .HasDatabaseName("WorkflowDefinitionLabel_LabelId"); - - b.HasIndex("TenantId") - .HasDatabaseName("WorkflowDefinitionLabel_TenantId"); - - b.HasIndex("WorkflowDefinitionId") - .HasDatabaseName("WorkflowDefinitionLabel_WorkflowDefinitionId"); - - b.HasIndex("WorkflowDefinitionVersionId") - .HasDatabaseName("WorkflowDefinitionLabel_WorkflowDefinitionVersionId"); - - b.ToTable("WorkflowDefinitionLabels", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Management/20231015122231_Initial.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Management/20231015122231_Initial.Designer.cs deleted file mode 100644 index 41c6a5ceb8..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Management/20231015122231_Initial.Designer.cs +++ /dev/null @@ -1,193 +0,0 @@ -// -using System; -using Elsa.EntityFrameworkCore.Modules.Management; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.Sqlite.Migrations.Management -{ - [DbContext(typeof(ManagementElsaDbContext))] - [Migration("20231015122231_Initial")] - partial class Initial - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder.HasAnnotation("ProductVersion", "7.0.11"); - - modelBuilder.Entity("Elsa.Workflows.Management.Entities.WorkflowDefinition", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("BinaryData") - .HasColumnType("BLOB"); - - b.Property("CreatedAt") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("Data") - .HasColumnType("TEXT"); - - b.Property("DefinitionId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("Description") - .HasColumnType("TEXT"); - - b.Property("IsLatest") - .HasColumnType("INTEGER"); - - b.Property("IsPublished") - .HasColumnType("INTEGER"); - - b.Property("IsReadonly") - .HasColumnType("INTEGER"); - - b.Property("MaterializerContext") - .HasColumnType("TEXT"); - - b.Property("MaterializerName") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("Name") - .HasColumnType("TEXT"); - - b.Property("ProviderName") - .HasColumnType("TEXT"); - - b.Property("StringData") - .HasColumnType("TEXT"); - - b.Property("ToolVersion") - .HasColumnType("TEXT"); - - b.Property("UsableAsActivity") - .HasColumnType("INTEGER"); - - b.Property("Version") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("IsLatest") - .HasDatabaseName("IX_WorkflowDefinition_IsLatest"); - - b.HasIndex("IsPublished") - .HasDatabaseName("IX_WorkflowDefinition_IsPublished"); - - b.HasIndex("Name") - .HasDatabaseName("IX_WorkflowDefinition_Name"); - - b.HasIndex("UsableAsActivity") - .HasDatabaseName("IX_WorkflowDefinition_UsableAsActivity"); - - b.HasIndex("Version") - .HasDatabaseName("IX_WorkflowDefinition_Version"); - - b.HasIndex("DefinitionId", "Version") - .IsUnique() - .HasDatabaseName("IX_WorkflowDefinition_DefinitionId_Version"); - - b.ToTable("WorkflowDefinitions"); - }); - - modelBuilder.Entity("Elsa.Workflows.Management.Entities.WorkflowInstance", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("CorrelationId") - .HasColumnType("TEXT"); - - b.Property("CreatedAt") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("Data") - .HasColumnType("TEXT"); - - b.Property("DefinitionId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("DefinitionVersionId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("FinishedAt") - .HasColumnType("TEXT"); - - b.Property("IncidentCount") - .HasColumnType("INTEGER"); - - b.Property("Name") - .HasColumnType("TEXT"); - - b.Property("Status") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("SubStatus") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("UpdatedAt") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("Version") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("CorrelationId") - .HasDatabaseName("IX_WorkflowInstance_CorrelationId"); - - b.HasIndex("CreatedAt") - .HasDatabaseName("IX_WorkflowInstance_CreatedAt"); - - b.HasIndex("DefinitionId") - .HasDatabaseName("IX_WorkflowInstance_DefinitionId"); - - b.HasIndex("FinishedAt") - .HasDatabaseName("IX_WorkflowInstance_FinishedAt"); - - b.HasIndex("Name") - .HasDatabaseName("IX_WorkflowInstance_Name"); - - b.HasIndex("Status") - .HasDatabaseName("IX_WorkflowInstance_Status"); - - b.HasIndex("SubStatus") - .HasDatabaseName("IX_WorkflowInstance_SubStatus"); - - b.HasIndex("UpdatedAt") - .HasDatabaseName("IX_WorkflowInstance_UpdatedAt"); - - b.HasIndex("Status", "DefinitionId") - .HasDatabaseName("IX_WorkflowInstance_Status_DefinitionId"); - - b.HasIndex("Status", "SubStatus") - .HasDatabaseName("IX_WorkflowInstance_Status_SubStatus"); - - b.HasIndex("SubStatus", "DefinitionId") - .HasDatabaseName("IX_WorkflowInstance_SubStatus_DefinitionId"); - - b.HasIndex("Status", "SubStatus", "DefinitionId", "Version") - .HasDatabaseName("IX_WorkflowInstance_Status_SubStatus_DefinitionId_Version"); - - b.ToTable("WorkflowInstances"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Management/20231015122231_Initial.cs b/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Management/20231015122231_Initial.cs deleted file mode 100644 index da07029d06..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Management/20231015122231_Initial.cs +++ /dev/null @@ -1,165 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.Sqlite.Migrations.Management -{ - /// - public partial class Initial : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "WorkflowDefinitions", - columns: table => new - { - Id = table.Column(type: "TEXT", nullable: false), - DefinitionId = table.Column(type: "TEXT", nullable: false), - Name = table.Column(type: "TEXT", nullable: true), - Description = table.Column(type: "TEXT", nullable: true), - ToolVersion = table.Column(type: "TEXT", nullable: true), - ProviderName = table.Column(type: "TEXT", nullable: true), - MaterializerName = table.Column(type: "TEXT", nullable: false), - MaterializerContext = table.Column(type: "TEXT", nullable: true), - StringData = table.Column(type: "TEXT", nullable: true), - BinaryData = table.Column(type: "BLOB", nullable: true), - IsReadonly = table.Column(type: "INTEGER", nullable: false), - Data = table.Column(type: "TEXT", nullable: true), - UsableAsActivity = table.Column(type: "INTEGER", nullable: true), - CreatedAt = table.Column(type: "TEXT", nullable: false), - Version = table.Column(type: "INTEGER", nullable: false), - IsLatest = table.Column(type: "INTEGER", nullable: false), - IsPublished = table.Column(type: "INTEGER", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_WorkflowDefinitions", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "WorkflowInstances", - columns: table => new - { - Id = table.Column(type: "TEXT", nullable: false), - DefinitionId = table.Column(type: "TEXT", nullable: false), - DefinitionVersionId = table.Column(type: "TEXT", nullable: false), - Version = table.Column(type: "INTEGER", nullable: false), - Status = table.Column(type: "TEXT", nullable: false), - SubStatus = table.Column(type: "TEXT", nullable: false), - CorrelationId = table.Column(type: "TEXT", nullable: true), - Name = table.Column(type: "TEXT", nullable: true), - IncidentCount = table.Column(type: "INTEGER", nullable: false), - CreatedAt = table.Column(type: "TEXT", nullable: false), - UpdatedAt = table.Column(type: "TEXT", nullable: false), - FinishedAt = table.Column(type: "TEXT", nullable: true), - Data = table.Column(type: "TEXT", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_WorkflowInstances", x => x.Id); - }); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowDefinition_DefinitionId_Version", - table: "WorkflowDefinitions", - columns: new[] { "DefinitionId", "Version" }, - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowDefinition_IsLatest", - table: "WorkflowDefinitions", - column: "IsLatest"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowDefinition_IsPublished", - table: "WorkflowDefinitions", - column: "IsPublished"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowDefinition_Name", - table: "WorkflowDefinitions", - column: "Name"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowDefinition_UsableAsActivity", - table: "WorkflowDefinitions", - column: "UsableAsActivity"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowDefinition_Version", - table: "WorkflowDefinitions", - column: "Version"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowInstance_CorrelationId", - table: "WorkflowInstances", - column: "CorrelationId"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowInstance_CreatedAt", - table: "WorkflowInstances", - column: "CreatedAt"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowInstance_DefinitionId", - table: "WorkflowInstances", - column: "DefinitionId"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowInstance_FinishedAt", - table: "WorkflowInstances", - column: "FinishedAt"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowInstance_Name", - table: "WorkflowInstances", - column: "Name"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowInstance_Status", - table: "WorkflowInstances", - column: "Status"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowInstance_Status_DefinitionId", - table: "WorkflowInstances", - columns: new[] { "Status", "DefinitionId" }); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowInstance_Status_SubStatus", - table: "WorkflowInstances", - columns: new[] { "Status", "SubStatus" }); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowInstance_Status_SubStatus_DefinitionId_Version", - table: "WorkflowInstances", - columns: new[] { "Status", "SubStatus", "DefinitionId", "Version" }); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowInstance_SubStatus", - table: "WorkflowInstances", - column: "SubStatus"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowInstance_SubStatus_DefinitionId", - table: "WorkflowInstances", - columns: new[] { "SubStatus", "DefinitionId" }); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowInstance_UpdatedAt", - table: "WorkflowInstances", - column: "UpdatedAt"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "WorkflowDefinitions"); - - migrationBuilder.DropTable( - name: "WorkflowInstances"); - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Management/20240329200734_V3_1.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Management/20240329200734_V3_1.Designer.cs deleted file mode 100644 index 9cc7d53bcc..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Management/20240329200734_V3_1.Designer.cs +++ /dev/null @@ -1,211 +0,0 @@ -// -using System; -using Elsa.EntityFrameworkCore.Modules.Management; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.Sqlite.Migrations.Management -{ - [DbContext(typeof(ManagementElsaDbContext))] - [Migration("20240329200734_V3_1")] - partial class V3_1 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder.HasAnnotation("ProductVersion", "7.0.14"); - - modelBuilder.Entity("Elsa.Workflows.Management.Entities.WorkflowDefinition", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("BinaryData") - .HasColumnType("BLOB"); - - b.Property("CreatedAt") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("Data") - .HasColumnType("TEXT"); - - b.Property("DefinitionId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("Description") - .HasColumnType("TEXT"); - - b.Property("IsLatest") - .HasColumnType("INTEGER"); - - b.Property("IsPublished") - .HasColumnType("INTEGER"); - - b.Property("IsReadonly") - .HasColumnType("INTEGER"); - - b.Property("IsSystem") - .HasColumnType("INTEGER"); - - b.Property("MaterializerContext") - .HasColumnType("TEXT"); - - b.Property("MaterializerName") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("Name") - .HasColumnType("TEXT"); - - b.Property("ProviderName") - .HasColumnType("TEXT"); - - b.Property("StringData") - .HasColumnType("TEXT"); - - b.Property("ToolVersion") - .HasColumnType("TEXT"); - - b.Property("UsableAsActivity") - .HasColumnType("INTEGER"); - - b.Property("Version") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("IsLatest") - .HasDatabaseName("IX_WorkflowDefinition_IsLatest"); - - b.HasIndex("IsPublished") - .HasDatabaseName("IX_WorkflowDefinition_IsPublished"); - - b.HasIndex("IsSystem") - .HasDatabaseName("IX_WorkflowDefinition_IsSystem"); - - b.HasIndex("Name") - .HasDatabaseName("IX_WorkflowDefinition_Name"); - - b.HasIndex("UsableAsActivity") - .HasDatabaseName("IX_WorkflowDefinition_UsableAsActivity"); - - b.HasIndex("Version") - .HasDatabaseName("IX_WorkflowDefinition_Version"); - - b.HasIndex("DefinitionId", "Version") - .IsUnique() - .HasDatabaseName("IX_WorkflowDefinition_DefinitionId_Version"); - - b.ToTable("WorkflowDefinitions"); - }); - - modelBuilder.Entity("Elsa.Workflows.Management.Entities.WorkflowInstance", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("CorrelationId") - .HasColumnType("TEXT"); - - b.Property("CreatedAt") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("Data") - .HasColumnType("TEXT"); - - b.Property("DataCompressionAlgorithm") - .HasColumnType("TEXT"); - - b.Property("DefinitionId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("DefinitionVersionId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("FinishedAt") - .HasColumnType("TEXT"); - - b.Property("IncidentCount") - .HasColumnType("INTEGER"); - - b.Property("IsSystem") - .HasColumnType("INTEGER"); - - b.Property("Name") - .HasColumnType("TEXT"); - - b.Property("ParentWorkflowInstanceId") - .HasColumnType("TEXT"); - - b.Property("Status") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("SubStatus") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("UpdatedAt") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("Version") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("CorrelationId") - .HasDatabaseName("IX_WorkflowInstance_CorrelationId"); - - b.HasIndex("CreatedAt") - .HasDatabaseName("IX_WorkflowInstance_CreatedAt"); - - b.HasIndex("DefinitionId") - .HasDatabaseName("IX_WorkflowInstance_DefinitionId"); - - b.HasIndex("FinishedAt") - .HasDatabaseName("IX_WorkflowInstance_FinishedAt"); - - b.HasIndex("IsSystem") - .HasDatabaseName("IX_WorkflowInstance_IsSystem"); - - b.HasIndex("Name") - .HasDatabaseName("IX_WorkflowInstance_Name"); - - b.HasIndex("Status") - .HasDatabaseName("IX_WorkflowInstance_Status"); - - b.HasIndex("SubStatus") - .HasDatabaseName("IX_WorkflowInstance_SubStatus"); - - b.HasIndex("UpdatedAt") - .HasDatabaseName("IX_WorkflowInstance_UpdatedAt"); - - b.HasIndex("Status", "DefinitionId") - .HasDatabaseName("IX_WorkflowInstance_Status_DefinitionId"); - - b.HasIndex("Status", "SubStatus") - .HasDatabaseName("IX_WorkflowInstance_Status_SubStatus"); - - b.HasIndex("SubStatus", "DefinitionId") - .HasDatabaseName("IX_WorkflowInstance_SubStatus_DefinitionId"); - - b.HasIndex("Status", "SubStatus", "DefinitionId", "Version") - .HasDatabaseName("IX_WorkflowInstance_Status_SubStatus_DefinitionId_Version"); - - b.ToTable("WorkflowInstances"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Management/20240329200734_V3_1.cs b/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Management/20240329200734_V3_1.cs deleted file mode 100644 index deaad852f5..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Management/20240329200734_V3_1.cs +++ /dev/null @@ -1,86 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.Sqlite.Migrations.Management -{ - /// - public partial class V3_1 : Migration - { - private readonly IElsaDbContextSchema _schema; - - /// - public V3_1(IElsaDbContextSchema schema) - { - _schema = schema; - } - - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "DataCompressionAlgorithm", - table: "WorkflowInstances", - type: "TEXT", - nullable: true); - - migrationBuilder.AddColumn( - name: "IsSystem", - table: "WorkflowInstances", - type: "INTEGER", - nullable: false, - defaultValue: false); - - migrationBuilder.AddColumn( - name: "ParentWorkflowInstanceId", - table: "WorkflowInstances", - type: "TEXT", - nullable: true); - - migrationBuilder.AddColumn( - name: "IsSystem", - table: "WorkflowDefinitions", - type: "INTEGER", - nullable: false, - defaultValue: false); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowInstance_IsSystem", - table: "WorkflowInstances", - column: "IsSystem"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowDefinition_IsSystem", - table: "WorkflowDefinitions", - column: "IsSystem"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropIndex( - name: "IX_WorkflowInstance_IsSystem", - table: "WorkflowInstances"); - - migrationBuilder.DropIndex( - name: "IX_WorkflowDefinition_IsSystem", - table: "WorkflowDefinitions"); - - migrationBuilder.DropColumn( - name: "DataCompressionAlgorithm", - table: "WorkflowInstances"); - - migrationBuilder.DropColumn( - name: "IsSystem", - table: "WorkflowInstances"); - - migrationBuilder.DropColumn( - name: "ParentWorkflowInstanceId", - table: "WorkflowInstances"); - - migrationBuilder.DropColumn( - name: "IsSystem", - table: "WorkflowDefinitions"); - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Management/20240610184829_V3_2.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Management/20240610184829_V3_2.Designer.cs deleted file mode 100644 index e04c4c939c..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Management/20240610184829_V3_2.Designer.cs +++ /dev/null @@ -1,211 +0,0 @@ -// -using System; -using Elsa.EntityFrameworkCore.Modules.Management; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.Sqlite.Migrations.Management -{ - [DbContext(typeof(ManagementElsaDbContext))] - [Migration("20240610184829_V3_2")] - partial class V3_2 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder.HasAnnotation("ProductVersion", "7.0.20"); - - modelBuilder.Entity("Elsa.Workflows.Management.Entities.WorkflowDefinition", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("BinaryData") - .HasColumnType("BLOB"); - - b.Property("CreatedAt") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("Data") - .HasColumnType("TEXT"); - - b.Property("DefinitionId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("Description") - .HasColumnType("TEXT"); - - b.Property("IsLatest") - .HasColumnType("INTEGER"); - - b.Property("IsPublished") - .HasColumnType("INTEGER"); - - b.Property("IsReadonly") - .HasColumnType("INTEGER"); - - b.Property("IsSystem") - .HasColumnType("INTEGER"); - - b.Property("MaterializerContext") - .HasColumnType("TEXT"); - - b.Property("MaterializerName") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("Name") - .HasColumnType("TEXT"); - - b.Property("ProviderName") - .HasColumnType("TEXT"); - - b.Property("StringData") - .HasColumnType("TEXT"); - - b.Property("ToolVersion") - .HasColumnType("TEXT"); - - b.Property("UsableAsActivity") - .HasColumnType("INTEGER"); - - b.Property("Version") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("IsLatest") - .HasDatabaseName("IX_WorkflowDefinition_IsLatest"); - - b.HasIndex("IsPublished") - .HasDatabaseName("IX_WorkflowDefinition_IsPublished"); - - b.HasIndex("IsSystem") - .HasDatabaseName("IX_WorkflowDefinition_IsSystem"); - - b.HasIndex("Name") - .HasDatabaseName("IX_WorkflowDefinition_Name"); - - b.HasIndex("UsableAsActivity") - .HasDatabaseName("IX_WorkflowDefinition_UsableAsActivity"); - - b.HasIndex("Version") - .HasDatabaseName("IX_WorkflowDefinition_Version"); - - b.HasIndex("DefinitionId", "Version") - .IsUnique() - .HasDatabaseName("IX_WorkflowDefinition_DefinitionId_Version"); - - b.ToTable("WorkflowDefinitions"); - }); - - modelBuilder.Entity("Elsa.Workflows.Management.Entities.WorkflowInstance", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("CorrelationId") - .HasColumnType("TEXT"); - - b.Property("CreatedAt") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("Data") - .HasColumnType("TEXT"); - - b.Property("DataCompressionAlgorithm") - .HasColumnType("TEXT"); - - b.Property("DefinitionId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("DefinitionVersionId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("FinishedAt") - .HasColumnType("TEXT"); - - b.Property("IncidentCount") - .HasColumnType("INTEGER"); - - b.Property("IsSystem") - .HasColumnType("INTEGER"); - - b.Property("Name") - .HasColumnType("TEXT"); - - b.Property("ParentWorkflowInstanceId") - .HasColumnType("TEXT"); - - b.Property("Status") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("SubStatus") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("UpdatedAt") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("Version") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("CorrelationId") - .HasDatabaseName("IX_WorkflowInstance_CorrelationId"); - - b.HasIndex("CreatedAt") - .HasDatabaseName("IX_WorkflowInstance_CreatedAt"); - - b.HasIndex("DefinitionId") - .HasDatabaseName("IX_WorkflowInstance_DefinitionId"); - - b.HasIndex("FinishedAt") - .HasDatabaseName("IX_WorkflowInstance_FinishedAt"); - - b.HasIndex("IsSystem") - .HasDatabaseName("IX_WorkflowInstance_IsSystem"); - - b.HasIndex("Name") - .HasDatabaseName("IX_WorkflowInstance_Name"); - - b.HasIndex("Status") - .HasDatabaseName("IX_WorkflowInstance_Status"); - - b.HasIndex("SubStatus") - .HasDatabaseName("IX_WorkflowInstance_SubStatus"); - - b.HasIndex("UpdatedAt") - .HasDatabaseName("IX_WorkflowInstance_UpdatedAt"); - - b.HasIndex("Status", "DefinitionId") - .HasDatabaseName("IX_WorkflowInstance_Status_DefinitionId"); - - b.HasIndex("Status", "SubStatus") - .HasDatabaseName("IX_WorkflowInstance_Status_SubStatus"); - - b.HasIndex("SubStatus", "DefinitionId") - .HasDatabaseName("IX_WorkflowInstance_SubStatus_DefinitionId"); - - b.HasIndex("Status", "SubStatus", "DefinitionId", "Version") - .HasDatabaseName("IX_WorkflowInstance_Status_SubStatus_DefinitionId_Version"); - - b.ToTable("WorkflowInstances"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Management/20240610184829_V3_2.cs b/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Management/20240610184829_V3_2.cs deleted file mode 100644 index 003ae489f9..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Management/20240610184829_V3_2.cs +++ /dev/null @@ -1,30 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.Sqlite.Migrations.Management -{ - /// - public partial class V3_2 : Migration - { - private readonly IElsaDbContextSchema _schema; - - /// - public V3_2(IElsaDbContextSchema schema) - { - _schema = schema; - } - - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Management/20241212211754_V3_3.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Management/20241212211754_V3_3.Designer.cs deleted file mode 100644 index 15de8d8c06..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Management/20241212211754_V3_3.Designer.cs +++ /dev/null @@ -1,220 +0,0 @@ -// -using System; -using Elsa.EntityFrameworkCore.Modules.Management; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.Sqlite.Migrations.Management -{ - [DbContext(typeof(ManagementElsaDbContext))] - [Migration("20241212211754_V3_3")] - partial class V3_3 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder.HasAnnotation("ProductVersion", "7.0.20"); - - modelBuilder.Entity("Elsa.Workflows.Management.Entities.WorkflowDefinition", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("BinaryData") - .HasColumnType("BLOB"); - - b.Property("CreatedAt") - .HasColumnType("TEXT"); - - b.Property("Data") - .HasColumnType("TEXT"); - - b.Property("DefinitionId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("Description") - .HasColumnType("TEXT"); - - b.Property("IsLatest") - .HasColumnType("INTEGER"); - - b.Property("IsPublished") - .HasColumnType("INTEGER"); - - b.Property("IsReadonly") - .HasColumnType("INTEGER"); - - b.Property("IsSystem") - .HasColumnType("INTEGER"); - - b.Property("MaterializerContext") - .HasColumnType("TEXT"); - - b.Property("MaterializerName") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("Name") - .HasColumnType("TEXT"); - - b.Property("ProviderName") - .HasColumnType("TEXT"); - - b.Property("StringData") - .HasColumnType("TEXT"); - - b.Property("TenantId") - .HasColumnType("TEXT"); - - b.Property("ToolVersion") - .HasColumnType("TEXT"); - - b.Property("UsableAsActivity") - .HasColumnType("INTEGER"); - - b.Property("Version") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("IsLatest") - .HasDatabaseName("IX_WorkflowDefinition_IsLatest"); - - b.HasIndex("IsPublished") - .HasDatabaseName("IX_WorkflowDefinition_IsPublished"); - - b.HasIndex("IsSystem") - .HasDatabaseName("IX_WorkflowDefinition_IsSystem"); - - b.HasIndex("Name") - .HasDatabaseName("IX_WorkflowDefinition_Name"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_WorkflowDefinition_TenantId"); - - b.HasIndex("UsableAsActivity") - .HasDatabaseName("IX_WorkflowDefinition_UsableAsActivity"); - - b.HasIndex("Version") - .HasDatabaseName("IX_WorkflowDefinition_Version"); - - b.HasIndex("DefinitionId", "Version") - .IsUnique() - .HasDatabaseName("IX_WorkflowDefinition_DefinitionId_Version"); - - b.ToTable("WorkflowDefinitions"); - }); - - modelBuilder.Entity("Elsa.Workflows.Management.Entities.WorkflowInstance", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("CorrelationId") - .HasColumnType("TEXT"); - - b.Property("CreatedAt") - .HasColumnType("TEXT"); - - b.Property("Data") - .HasColumnType("TEXT"); - - b.Property("DataCompressionAlgorithm") - .HasColumnType("TEXT"); - - b.Property("DefinitionId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("DefinitionVersionId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("FinishedAt") - .HasColumnType("TEXT"); - - b.Property("IncidentCount") - .HasColumnType("INTEGER"); - - b.Property("IsSystem") - .HasColumnType("INTEGER"); - - b.Property("Name") - .HasColumnType("TEXT"); - - b.Property("ParentWorkflowInstanceId") - .HasColumnType("TEXT"); - - b.Property("Status") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("SubStatus") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("TenantId") - .HasColumnType("TEXT"); - - b.Property("UpdatedAt") - .HasColumnType("TEXT"); - - b.Property("Version") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("CorrelationId") - .HasDatabaseName("IX_WorkflowInstance_CorrelationId"); - - b.HasIndex("CreatedAt") - .HasDatabaseName("IX_WorkflowInstance_CreatedAt"); - - b.HasIndex("DefinitionId") - .HasDatabaseName("IX_WorkflowInstance_DefinitionId"); - - b.HasIndex("FinishedAt") - .HasDatabaseName("IX_WorkflowInstance_FinishedAt"); - - b.HasIndex("IsSystem") - .HasDatabaseName("IX_WorkflowInstance_IsSystem"); - - b.HasIndex("Name") - .HasDatabaseName("IX_WorkflowInstance_Name"); - - b.HasIndex("Status") - .HasDatabaseName("IX_WorkflowInstance_Status"); - - b.HasIndex("SubStatus") - .HasDatabaseName("IX_WorkflowInstance_SubStatus"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_WorkflowInstance_TenantId"); - - b.HasIndex("UpdatedAt") - .HasDatabaseName("IX_WorkflowInstance_UpdatedAt"); - - b.HasIndex("Status", "DefinitionId") - .HasDatabaseName("IX_WorkflowInstance_Status_DefinitionId"); - - b.HasIndex("Status", "SubStatus") - .HasDatabaseName("IX_WorkflowInstance_Status_SubStatus"); - - b.HasIndex("SubStatus", "DefinitionId") - .HasDatabaseName("IX_WorkflowInstance_SubStatus_DefinitionId"); - - b.HasIndex("Status", "SubStatus", "DefinitionId", "Version") - .HasDatabaseName("IX_WorkflowInstance_Status_SubStatus_DefinitionId_Version"); - - b.ToTable("WorkflowInstances"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Management/20241212211754_V3_3.cs b/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Management/20241212211754_V3_3.cs deleted file mode 100644 index 56d8890939..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Management/20241212211754_V3_3.cs +++ /dev/null @@ -1,64 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.Sqlite.Migrations.Management -{ - /// - public partial class V3_3 : Migration - { - private readonly Elsa.EntityFrameworkCore.IElsaDbContextSchema _schema; - - /// - public V3_3(Elsa.EntityFrameworkCore.IElsaDbContextSchema schema) - { - _schema = schema; - } - - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "TenantId", - table: "WorkflowInstances", - type: "TEXT", - nullable: true); - - migrationBuilder.AddColumn( - name: "TenantId", - table: "WorkflowDefinitions", - type: "TEXT", - nullable: true); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowInstance_TenantId", - table: "WorkflowInstances", - column: "TenantId"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowDefinition_TenantId", - table: "WorkflowDefinitions", - column: "TenantId"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropIndex( - name: "IX_WorkflowInstance_TenantId", - table: "WorkflowInstances"); - - migrationBuilder.DropIndex( - name: "IX_WorkflowDefinition_TenantId", - table: "WorkflowDefinitions"); - - migrationBuilder.DropColumn( - name: "TenantId", - table: "WorkflowInstances"); - - migrationBuilder.DropColumn( - name: "TenantId", - table: "WorkflowDefinitions"); - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Management/20250222190901_V3_4.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Management/20250222190901_V3_4.Designer.cs deleted file mode 100644 index 2a4ecb02eb..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Management/20250222190901_V3_4.Designer.cs +++ /dev/null @@ -1,228 +0,0 @@ -// -using System; -using Elsa.EntityFrameworkCore.Modules.Management; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.Sqlite.Migrations.Management -{ - [DbContext(typeof(ManagementElsaDbContext))] - [Migration("20250222190901_V3_4")] - partial class V3_4 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "8.0.12"); - - modelBuilder.Entity("Elsa.Workflows.Management.Entities.WorkflowDefinition", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("BinaryData") - .HasColumnType("BLOB"); - - b.Property("CreatedAt") - .HasColumnType("TEXT"); - - b.Property("Data") - .HasColumnType("TEXT"); - - b.Property("DefinitionId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("Description") - .HasColumnType("TEXT"); - - b.Property("IsLatest") - .HasColumnType("INTEGER"); - - b.Property("IsPublished") - .HasColumnType("INTEGER"); - - b.Property("IsReadonly") - .HasColumnType("INTEGER"); - - b.Property("IsSystem") - .HasColumnType("INTEGER"); - - b.Property("MaterializerContext") - .HasColumnType("TEXT"); - - b.Property("MaterializerName") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("Name") - .HasColumnType("TEXT"); - - b.Property("ProviderName") - .HasColumnType("TEXT"); - - b.Property("StringData") - .HasColumnType("TEXT"); - - b.Property("TenantId") - .HasColumnType("TEXT"); - - b.Property("ToolVersion") - .HasColumnType("TEXT"); - - b.Property("UsableAsActivity") - .HasColumnType("INTEGER"); - - b.Property("Version") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("IsLatest") - .HasDatabaseName("IX_WorkflowDefinition_IsLatest"); - - b.HasIndex("IsPublished") - .HasDatabaseName("IX_WorkflowDefinition_IsPublished"); - - b.HasIndex("IsSystem") - .HasDatabaseName("IX_WorkflowDefinition_IsSystem"); - - b.HasIndex("Name") - .HasDatabaseName("IX_WorkflowDefinition_Name"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_WorkflowDefinition_TenantId"); - - b.HasIndex("UsableAsActivity") - .HasDatabaseName("IX_WorkflowDefinition_UsableAsActivity"); - - b.HasIndex("Version") - .HasDatabaseName("IX_WorkflowDefinition_Version"); - - b.HasIndex("DefinitionId", "Version") - .IsUnique() - .HasDatabaseName("IX_WorkflowDefinition_DefinitionId_Version"); - - b.ToTable("WorkflowDefinitions", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Management.Entities.WorkflowInstance", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("CorrelationId") - .HasColumnType("TEXT"); - - b.Property("CreatedAt") - .HasColumnType("TEXT"); - - b.Property("Data") - .HasColumnType("TEXT"); - - b.Property("DataCompressionAlgorithm") - .HasColumnType("TEXT"); - - b.Property("DefinitionId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("DefinitionVersionId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("FinishedAt") - .HasColumnType("TEXT"); - - b.Property("IncidentCount") - .HasColumnType("INTEGER"); - - b.Property("IsExecuting") - .HasColumnType("INTEGER"); - - b.Property("IsSystem") - .HasColumnType("INTEGER"); - - b.Property("Name") - .HasColumnType("TEXT"); - - b.Property("ParentWorkflowInstanceId") - .HasColumnType("TEXT"); - - b.Property("Status") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("SubStatus") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("TenantId") - .HasColumnType("TEXT"); - - b.Property("UpdatedAt") - .HasColumnType("TEXT"); - - b.Property("Version") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("CorrelationId") - .HasDatabaseName("IX_WorkflowInstance_CorrelationId"); - - b.HasIndex("CreatedAt") - .HasDatabaseName("IX_WorkflowInstance_CreatedAt"); - - b.HasIndex("DefinitionId") - .HasDatabaseName("IX_WorkflowInstance_DefinitionId"); - - b.HasIndex("FinishedAt") - .HasDatabaseName("IX_WorkflowInstance_FinishedAt"); - - b.HasIndex("IsExecuting") - .HasDatabaseName("IX_WorkflowInstance_IsExecuting"); - - b.HasIndex("IsSystem") - .HasDatabaseName("IX_WorkflowInstance_IsSystem"); - - b.HasIndex("Name") - .HasDatabaseName("IX_WorkflowInstance_Name"); - - b.HasIndex("Status") - .HasDatabaseName("IX_WorkflowInstance_Status"); - - b.HasIndex("SubStatus") - .HasDatabaseName("IX_WorkflowInstance_SubStatus"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_WorkflowInstance_TenantId"); - - b.HasIndex("UpdatedAt") - .HasDatabaseName("IX_WorkflowInstance_UpdatedAt"); - - b.HasIndex("Status", "DefinitionId") - .HasDatabaseName("IX_WorkflowInstance_Status_DefinitionId"); - - b.HasIndex("Status", "SubStatus") - .HasDatabaseName("IX_WorkflowInstance_Status_SubStatus"); - - b.HasIndex("SubStatus", "DefinitionId") - .HasDatabaseName("IX_WorkflowInstance_SubStatus_DefinitionId"); - - b.HasIndex("Status", "SubStatus", "DefinitionId", "Version") - .HasDatabaseName("IX_WorkflowInstance_Status_SubStatus_DefinitionId_Version"); - - b.ToTable("WorkflowInstances", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Management/20250222190901_V3_4.cs b/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Management/20250222190901_V3_4.cs deleted file mode 100644 index 9d6bded591..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Management/20250222190901_V3_4.cs +++ /dev/null @@ -1,73 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.Sqlite.Migrations.Management -{ - /// - public partial class V3_4 : Migration - { - private readonly Elsa.EntityFrameworkCore.IElsaDbContextSchema _schema; - - /// - public V3_4(Elsa.EntityFrameworkCore.IElsaDbContextSchema schema) - { - _schema = schema; - } - - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.EnsureSchema( - name: _schema.Schema); - - migrationBuilder.RenameTable( - name: "WorkflowInstances", - newName: "WorkflowInstances", - newSchema: _schema.Schema); - - migrationBuilder.RenameTable( - name: "WorkflowDefinitions", - newName: "WorkflowDefinitions", - newSchema: _schema.Schema); - - migrationBuilder.AddColumn( - name: "IsExecuting", - schema: _schema.Schema, - table: "WorkflowInstances", - type: "INTEGER", - nullable: false, - defaultValue: false); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowInstance_IsExecuting", - schema: _schema.Schema, - table: "WorkflowInstances", - column: "IsExecuting"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropIndex( - name: "IX_WorkflowInstance_IsExecuting", - schema: _schema.Schema, - table: "WorkflowInstances"); - - migrationBuilder.DropColumn( - name: "IsExecuting", - schema: _schema.Schema, - table: "WorkflowInstances"); - - migrationBuilder.RenameTable( - name: "WorkflowInstances", - schema: _schema.Schema, - newName: "WorkflowInstances"); - - migrationBuilder.RenameTable( - name: "WorkflowDefinitions", - schema: _schema.Schema, - newName: "WorkflowDefinitions"); - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Management/ManagementElsaDbContextModelSnapshot.cs b/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Management/ManagementElsaDbContextModelSnapshot.cs deleted file mode 100644 index b06b4e2e67..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Management/ManagementElsaDbContextModelSnapshot.cs +++ /dev/null @@ -1,225 +0,0 @@ -// -using System; -using Elsa.EntityFrameworkCore.Modules.Management; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.Sqlite.Migrations.Management -{ - [DbContext(typeof(ManagementElsaDbContext))] - partial class ManagementElsaDbContextModelSnapshot : ModelSnapshot - { - protected override void BuildModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "8.0.12"); - - modelBuilder.Entity("Elsa.Workflows.Management.Entities.WorkflowDefinition", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("BinaryData") - .HasColumnType("BLOB"); - - b.Property("CreatedAt") - .HasColumnType("TEXT"); - - b.Property("Data") - .HasColumnType("TEXT"); - - b.Property("DefinitionId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("Description") - .HasColumnType("TEXT"); - - b.Property("IsLatest") - .HasColumnType("INTEGER"); - - b.Property("IsPublished") - .HasColumnType("INTEGER"); - - b.Property("IsReadonly") - .HasColumnType("INTEGER"); - - b.Property("IsSystem") - .HasColumnType("INTEGER"); - - b.Property("MaterializerContext") - .HasColumnType("TEXT"); - - b.Property("MaterializerName") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("Name") - .HasColumnType("TEXT"); - - b.Property("ProviderName") - .HasColumnType("TEXT"); - - b.Property("StringData") - .HasColumnType("TEXT"); - - b.Property("TenantId") - .HasColumnType("TEXT"); - - b.Property("ToolVersion") - .HasColumnType("TEXT"); - - b.Property("UsableAsActivity") - .HasColumnType("INTEGER"); - - b.Property("Version") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("IsLatest") - .HasDatabaseName("IX_WorkflowDefinition_IsLatest"); - - b.HasIndex("IsPublished") - .HasDatabaseName("IX_WorkflowDefinition_IsPublished"); - - b.HasIndex("IsSystem") - .HasDatabaseName("IX_WorkflowDefinition_IsSystem"); - - b.HasIndex("Name") - .HasDatabaseName("IX_WorkflowDefinition_Name"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_WorkflowDefinition_TenantId"); - - b.HasIndex("UsableAsActivity") - .HasDatabaseName("IX_WorkflowDefinition_UsableAsActivity"); - - b.HasIndex("Version") - .HasDatabaseName("IX_WorkflowDefinition_Version"); - - b.HasIndex("DefinitionId", "Version") - .IsUnique() - .HasDatabaseName("IX_WorkflowDefinition_DefinitionId_Version"); - - b.ToTable("WorkflowDefinitions", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Management.Entities.WorkflowInstance", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("CorrelationId") - .HasColumnType("TEXT"); - - b.Property("CreatedAt") - .HasColumnType("TEXT"); - - b.Property("Data") - .HasColumnType("TEXT"); - - b.Property("DataCompressionAlgorithm") - .HasColumnType("TEXT"); - - b.Property("DefinitionId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("DefinitionVersionId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("FinishedAt") - .HasColumnType("TEXT"); - - b.Property("IncidentCount") - .HasColumnType("INTEGER"); - - b.Property("IsExecuting") - .HasColumnType("INTEGER"); - - b.Property("IsSystem") - .HasColumnType("INTEGER"); - - b.Property("Name") - .HasColumnType("TEXT"); - - b.Property("ParentWorkflowInstanceId") - .HasColumnType("TEXT"); - - b.Property("Status") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("SubStatus") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("TenantId") - .HasColumnType("TEXT"); - - b.Property("UpdatedAt") - .HasColumnType("TEXT"); - - b.Property("Version") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("CorrelationId") - .HasDatabaseName("IX_WorkflowInstance_CorrelationId"); - - b.HasIndex("CreatedAt") - .HasDatabaseName("IX_WorkflowInstance_CreatedAt"); - - b.HasIndex("DefinitionId") - .HasDatabaseName("IX_WorkflowInstance_DefinitionId"); - - b.HasIndex("FinishedAt") - .HasDatabaseName("IX_WorkflowInstance_FinishedAt"); - - b.HasIndex("IsExecuting") - .HasDatabaseName("IX_WorkflowInstance_IsExecuting"); - - b.HasIndex("IsSystem") - .HasDatabaseName("IX_WorkflowInstance_IsSystem"); - - b.HasIndex("Name") - .HasDatabaseName("IX_WorkflowInstance_Name"); - - b.HasIndex("Status") - .HasDatabaseName("IX_WorkflowInstance_Status"); - - b.HasIndex("SubStatus") - .HasDatabaseName("IX_WorkflowInstance_SubStatus"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_WorkflowInstance_TenantId"); - - b.HasIndex("UpdatedAt") - .HasDatabaseName("IX_WorkflowInstance_UpdatedAt"); - - b.HasIndex("Status", "DefinitionId") - .HasDatabaseName("IX_WorkflowInstance_Status_DefinitionId"); - - b.HasIndex("Status", "SubStatus") - .HasDatabaseName("IX_WorkflowInstance_Status_SubStatus"); - - b.HasIndex("SubStatus", "DefinitionId") - .HasDatabaseName("IX_WorkflowInstance_SubStatus_DefinitionId"); - - b.HasIndex("Status", "SubStatus", "DefinitionId", "Version") - .HasDatabaseName("IX_WorkflowInstance_Status_SubStatus_DefinitionId_Version"); - - b.ToTable("WorkflowInstances", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Runtime/20231024160948_Initial.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Runtime/20231024160948_Initial.Designer.cs deleted file mode 100644 index 3d44652209..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Runtime/20231024160948_Initial.Designer.cs +++ /dev/null @@ -1,386 +0,0 @@ -// -using Elsa.EntityFrameworkCore.Modules.Runtime; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.Sqlite.Migrations.Runtime -{ - [DbContext(typeof(RuntimeElsaDbContext))] - [Migration("20231024160948_Initial")] - partial class Initial - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder.HasAnnotation("ProductVersion", "7.0.11"); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.ActivityExecutionRecord", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("ActivityId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("ActivityName") - .HasColumnType("TEXT"); - - b.Property("ActivityNodeId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("ActivityType") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("ActivityTypeVersion") - .HasColumnType("INTEGER"); - - b.Property("CompletedAt") - .HasColumnType("TEXT"); - - b.Property("HasBookmarks") - .HasColumnType("INTEGER"); - - b.Property("SerializedActivityState") - .HasColumnType("TEXT"); - - b.Property("SerializedException") - .HasColumnType("TEXT"); - - b.Property("SerializedOutputs") - .HasColumnType("TEXT"); - - b.Property("SerializedPayload") - .HasColumnType("TEXT"); - - b.Property("StartedAt") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("Status") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("ActivityId") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityId"); - - b.HasIndex("ActivityName") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityName"); - - b.HasIndex("ActivityNodeId") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityNodeId"); - - b.HasIndex("ActivityType") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityType"); - - b.HasIndex("ActivityTypeVersion") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityTypeVersion"); - - b.HasIndex("CompletedAt") - .HasDatabaseName("IX_ActivityExecutionRecord_CompletedAt"); - - b.HasIndex("HasBookmarks") - .HasDatabaseName("IX_ActivityExecutionRecord_HasBookmarks"); - - b.HasIndex("StartedAt") - .HasDatabaseName("IX_ActivityExecutionRecord_StartedAt"); - - b.HasIndex("Status") - .HasDatabaseName("IX_ActivityExecutionRecord_Status"); - - b.HasIndex("WorkflowInstanceId") - .HasDatabaseName("IX_ActivityExecutionRecord_WorkflowInstanceId"); - - b.HasIndex("ActivityType", "ActivityTypeVersion") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityType_ActivityTypeVersion"); - - b.ToTable("ActivityExecutionRecords"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.StoredBookmark", b => - { - b.Property("BookmarkId") - .HasColumnType("TEXT"); - - b.Property("ActivityInstanceId") - .HasColumnType("TEXT"); - - b.Property("ActivityTypeName") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("CorrelationId") - .HasColumnType("TEXT"); - - b.Property("CreatedAt") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("Hash") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("SerializedMetadata") - .HasColumnType("TEXT"); - - b.Property("SerializedPayload") - .HasColumnType("TEXT"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("TEXT"); - - b.HasKey("BookmarkId"); - - b.HasIndex(new[] { "ActivityInstanceId" }, "IX_StoredBookmark_ActivityInstanceId"); - - b.HasIndex(new[] { "ActivityTypeName" }, "IX_StoredBookmark_ActivityTypeName"); - - b.HasIndex(new[] { "ActivityTypeName", "Hash" }, "IX_StoredBookmark_ActivityTypeName_Hash"); - - b.HasIndex(new[] { "ActivityTypeName", "Hash", "WorkflowInstanceId" }, "IX_StoredBookmark_ActivityTypeName_Hash_WorkflowInstanceId"); - - b.HasIndex(new[] { "CreatedAt" }, "IX_StoredBookmark_CreatedAt"); - - b.HasIndex(new[] { "Hash" }, "IX_StoredBookmark_Hash"); - - b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_StoredBookmark_WorkflowInstanceId"); - - b.ToTable("Bookmarks"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.StoredTrigger", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("ActivityId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("Hash") - .HasColumnType("TEXT"); - - b.Property("Name") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("SerializedPayload") - .HasColumnType("TEXT"); - - b.Property("WorkflowDefinitionId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("WorkflowDefinitionVersionId") - .IsRequired() - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("Hash") - .HasDatabaseName("IX_StoredTrigger_Hash"); - - b.HasIndex("Name") - .HasDatabaseName("IX_StoredTrigger_Name"); - - b.HasIndex("WorkflowDefinitionId") - .HasDatabaseName("IX_StoredTrigger_WorkflowDefinitionId"); - - b.HasIndex("WorkflowDefinitionVersionId") - .HasDatabaseName("IX_StoredTrigger_WorkflowDefinitionVersionId"); - - b.ToTable("Triggers"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.WorkflowExecutionLogRecord", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("ActivityId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("ActivityInstanceId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("ActivityName") - .HasColumnType("TEXT"); - - b.Property("ActivityNodeId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("ActivityType") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("ActivityTypeVersion") - .HasColumnType("INTEGER"); - - b.Property("EventName") - .HasColumnType("TEXT"); - - b.Property("Message") - .HasColumnType("TEXT"); - - b.Property("ParentActivityInstanceId") - .HasColumnType("TEXT"); - - b.Property("Sequence") - .HasColumnType("INTEGER"); - - b.Property("SerializedActivityState") - .HasColumnType("TEXT"); - - b.Property("SerializedPayload") - .HasColumnType("TEXT"); - - b.Property("Source") - .HasColumnType("TEXT"); - - b.Property("Timestamp") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("WorkflowDefinitionId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("WorkflowDefinitionVersionId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("WorkflowVersion") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("ActivityId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityId"); - - b.HasIndex("ActivityInstanceId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityInstanceId"); - - b.HasIndex("ActivityName") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityName"); - - b.HasIndex("ActivityNodeId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityNodeId"); - - b.HasIndex("ActivityType") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityType"); - - b.HasIndex("ActivityTypeVersion") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityTypeVersion"); - - b.HasIndex("EventName") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_EventName"); - - b.HasIndex("ParentActivityInstanceId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ParentActivityInstanceId"); - - b.HasIndex("Sequence") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_Sequence"); - - b.HasIndex("Timestamp") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_Timestamp"); - - b.HasIndex("WorkflowDefinitionId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowDefinitionId"); - - b.HasIndex("WorkflowDefinitionVersionId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowDefinitionVersionId"); - - b.HasIndex("WorkflowInstanceId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowInstanceId"); - - b.HasIndex("WorkflowVersion") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowVersion"); - - b.HasIndex("ActivityType", "ActivityTypeVersion") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityType_ActivityTypeVersion"); - - b.HasIndex("Timestamp", "Sequence") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_Timestamp_Sequence"); - - b.ToTable("WorkflowExecutionLogRecords"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.WorkflowInboxMessage", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("ActivityInstanceId") - .HasColumnType("TEXT"); - - b.Property("ActivityTypeName") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("CorrelationId") - .HasColumnType("TEXT"); - - b.Property("CreatedAt") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("ExpiresAt") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("Hash") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("SerializedBookmarkPayload") - .HasColumnType("TEXT"); - - b.Property("SerializedInput") - .HasColumnType("TEXT"); - - b.Property("WorkflowInstanceId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "ActivityInstanceId" }, "IX_WorkflowInboxMessage_ActivityInstanceId"); - - b.HasIndex(new[] { "ActivityTypeName" }, "IX_WorkflowInboxMessage_ActivityTypeName"); - - b.HasIndex(new[] { "CorrelationId" }, "IX_WorkflowInboxMessage_CorrelationId"); - - b.HasIndex(new[] { "CreatedAt" }, "IX_WorkflowInboxMessage_CreatedAt"); - - b.HasIndex(new[] { "ExpiresAt" }, "IX_WorkflowInboxMessage_ExpiresAt"); - - b.HasIndex(new[] { "Hash" }, "IX_WorkflowInboxMessage_Hash"); - - b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_WorkflowInboxMessage_WorkflowInstanceId"); - - b.ToTable("WorkflowInboxMessages"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Runtime/20231024160948_Initial.cs b/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Runtime/20231024160948_Initial.cs deleted file mode 100644 index d8f72fb2bf..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Runtime/20231024160948_Initial.cs +++ /dev/null @@ -1,368 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.Sqlite.Migrations.Runtime -{ - /// - public partial class Initial : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "ActivityExecutionRecords", - columns: table => new - { - Id = table.Column(type: "TEXT", nullable: false), - WorkflowInstanceId = table.Column(type: "TEXT", nullable: false), - ActivityId = table.Column(type: "TEXT", nullable: false), - ActivityNodeId = table.Column(type: "TEXT", nullable: false), - ActivityType = table.Column(type: "TEXT", nullable: false), - ActivityTypeVersion = table.Column(type: "INTEGER", nullable: false), - ActivityName = table.Column(type: "TEXT", nullable: true), - StartedAt = table.Column(type: "TEXT", nullable: false), - HasBookmarks = table.Column(type: "INTEGER", nullable: false), - Status = table.Column(type: "TEXT", nullable: false), - CompletedAt = table.Column(type: "TEXT", nullable: true), - SerializedActivityState = table.Column(type: "TEXT", nullable: true), - SerializedException = table.Column(type: "TEXT", nullable: true), - SerializedOutputs = table.Column(type: "TEXT", nullable: true), - SerializedPayload = table.Column(type: "TEXT", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_ActivityExecutionRecords", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "Bookmarks", - columns: table => new - { - BookmarkId = table.Column(type: "TEXT", nullable: false), - ActivityTypeName = table.Column(type: "TEXT", nullable: false), - Hash = table.Column(type: "TEXT", nullable: false), - WorkflowInstanceId = table.Column(type: "TEXT", nullable: false), - ActivityInstanceId = table.Column(type: "TEXT", nullable: true), - CorrelationId = table.Column(type: "TEXT", nullable: true), - CreatedAt = table.Column(type: "TEXT", nullable: false), - SerializedMetadata = table.Column(type: "TEXT", nullable: true), - SerializedPayload = table.Column(type: "TEXT", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Bookmarks", x => x.BookmarkId); - }); - - migrationBuilder.CreateTable( - name: "Triggers", - columns: table => new - { - Id = table.Column(type: "TEXT", nullable: false), - WorkflowDefinitionId = table.Column(type: "TEXT", nullable: false), - WorkflowDefinitionVersionId = table.Column(type: "TEXT", nullable: false), - Name = table.Column(type: "TEXT", nullable: false), - ActivityId = table.Column(type: "TEXT", nullable: false), - Hash = table.Column(type: "TEXT", nullable: true), - SerializedPayload = table.Column(type: "TEXT", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Triggers", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "WorkflowExecutionLogRecords", - columns: table => new - { - Id = table.Column(type: "TEXT", nullable: false), - WorkflowDefinitionId = table.Column(type: "TEXT", nullable: false), - WorkflowDefinitionVersionId = table.Column(type: "TEXT", nullable: false), - WorkflowInstanceId = table.Column(type: "TEXT", nullable: false), - WorkflowVersion = table.Column(type: "INTEGER", nullable: false), - ActivityInstanceId = table.Column(type: "TEXT", nullable: false), - ParentActivityInstanceId = table.Column(type: "TEXT", nullable: true), - ActivityId = table.Column(type: "TEXT", nullable: false), - ActivityType = table.Column(type: "TEXT", nullable: false), - ActivityTypeVersion = table.Column(type: "INTEGER", nullable: false), - ActivityName = table.Column(type: "TEXT", nullable: true), - ActivityNodeId = table.Column(type: "TEXT", nullable: false), - Timestamp = table.Column(type: "TEXT", nullable: false), - Sequence = table.Column(type: "INTEGER", nullable: false), - EventName = table.Column(type: "TEXT", nullable: true), - Message = table.Column(type: "TEXT", nullable: true), - Source = table.Column(type: "TEXT", nullable: true), - SerializedActivityState = table.Column(type: "TEXT", nullable: true), - SerializedPayload = table.Column(type: "TEXT", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_WorkflowExecutionLogRecords", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "WorkflowInboxMessages", - columns: table => new - { - Id = table.Column(type: "TEXT", nullable: false), - ActivityTypeName = table.Column(type: "TEXT", nullable: false), - Hash = table.Column(type: "TEXT", nullable: false), - WorkflowInstanceId = table.Column(type: "TEXT", nullable: true), - CorrelationId = table.Column(type: "TEXT", nullable: true), - ActivityInstanceId = table.Column(type: "TEXT", nullable: true), - CreatedAt = table.Column(type: "TEXT", nullable: false), - ExpiresAt = table.Column(type: "TEXT", nullable: false), - SerializedBookmarkPayload = table.Column(type: "TEXT", nullable: true), - SerializedInput = table.Column(type: "TEXT", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_WorkflowInboxMessages", x => x.Id); - }); - - migrationBuilder.CreateIndex( - name: "IX_ActivityExecutionRecord_ActivityId", - table: "ActivityExecutionRecords", - column: "ActivityId"); - - migrationBuilder.CreateIndex( - name: "IX_ActivityExecutionRecord_ActivityName", - table: "ActivityExecutionRecords", - column: "ActivityName"); - - migrationBuilder.CreateIndex( - name: "IX_ActivityExecutionRecord_ActivityNodeId", - table: "ActivityExecutionRecords", - column: "ActivityNodeId"); - - migrationBuilder.CreateIndex( - name: "IX_ActivityExecutionRecord_ActivityType", - table: "ActivityExecutionRecords", - column: "ActivityType"); - - migrationBuilder.CreateIndex( - name: "IX_ActivityExecutionRecord_ActivityType_ActivityTypeVersion", - table: "ActivityExecutionRecords", - columns: new[] { "ActivityType", "ActivityTypeVersion" }); - - migrationBuilder.CreateIndex( - name: "IX_ActivityExecutionRecord_ActivityTypeVersion", - table: "ActivityExecutionRecords", - column: "ActivityTypeVersion"); - - migrationBuilder.CreateIndex( - name: "IX_ActivityExecutionRecord_CompletedAt", - table: "ActivityExecutionRecords", - column: "CompletedAt"); - - migrationBuilder.CreateIndex( - name: "IX_ActivityExecutionRecord_HasBookmarks", - table: "ActivityExecutionRecords", - column: "HasBookmarks"); - - migrationBuilder.CreateIndex( - name: "IX_ActivityExecutionRecord_StartedAt", - table: "ActivityExecutionRecords", - column: "StartedAt"); - - migrationBuilder.CreateIndex( - name: "IX_ActivityExecutionRecord_Status", - table: "ActivityExecutionRecords", - column: "Status"); - - migrationBuilder.CreateIndex( - name: "IX_ActivityExecutionRecord_WorkflowInstanceId", - table: "ActivityExecutionRecords", - column: "WorkflowInstanceId"); - - migrationBuilder.CreateIndex( - name: "IX_StoredBookmark_ActivityInstanceId", - table: "Bookmarks", - column: "ActivityInstanceId"); - - migrationBuilder.CreateIndex( - name: "IX_StoredBookmark_ActivityTypeName", - table: "Bookmarks", - column: "ActivityTypeName"); - - migrationBuilder.CreateIndex( - name: "IX_StoredBookmark_ActivityTypeName_Hash", - table: "Bookmarks", - columns: new[] { "ActivityTypeName", "Hash" }); - - migrationBuilder.CreateIndex( - name: "IX_StoredBookmark_ActivityTypeName_Hash_WorkflowInstanceId", - table: "Bookmarks", - columns: new[] { "ActivityTypeName", "Hash", "WorkflowInstanceId" }); - - migrationBuilder.CreateIndex( - name: "IX_StoredBookmark_CreatedAt", - table: "Bookmarks", - column: "CreatedAt"); - - migrationBuilder.CreateIndex( - name: "IX_StoredBookmark_Hash", - table: "Bookmarks", - column: "Hash"); - - migrationBuilder.CreateIndex( - name: "IX_StoredBookmark_WorkflowInstanceId", - table: "Bookmarks", - column: "WorkflowInstanceId"); - - migrationBuilder.CreateIndex( - name: "IX_StoredTrigger_Hash", - table: "Triggers", - column: "Hash"); - - migrationBuilder.CreateIndex( - name: "IX_StoredTrigger_Name", - table: "Triggers", - column: "Name"); - - migrationBuilder.CreateIndex( - name: "IX_StoredTrigger_WorkflowDefinitionId", - table: "Triggers", - column: "WorkflowDefinitionId"); - - migrationBuilder.CreateIndex( - name: "IX_StoredTrigger_WorkflowDefinitionVersionId", - table: "Triggers", - column: "WorkflowDefinitionVersionId"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowExecutionLogRecord_ActivityId", - table: "WorkflowExecutionLogRecords", - column: "ActivityId"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowExecutionLogRecord_ActivityInstanceId", - table: "WorkflowExecutionLogRecords", - column: "ActivityInstanceId"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowExecutionLogRecord_ActivityName", - table: "WorkflowExecutionLogRecords", - column: "ActivityName"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowExecutionLogRecord_ActivityNodeId", - table: "WorkflowExecutionLogRecords", - column: "ActivityNodeId"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowExecutionLogRecord_ActivityType", - table: "WorkflowExecutionLogRecords", - column: "ActivityType"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowExecutionLogRecord_ActivityType_ActivityTypeVersion", - table: "WorkflowExecutionLogRecords", - columns: new[] { "ActivityType", "ActivityTypeVersion" }); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowExecutionLogRecord_ActivityTypeVersion", - table: "WorkflowExecutionLogRecords", - column: "ActivityTypeVersion"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowExecutionLogRecord_EventName", - table: "WorkflowExecutionLogRecords", - column: "EventName"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowExecutionLogRecord_ParentActivityInstanceId", - table: "WorkflowExecutionLogRecords", - column: "ParentActivityInstanceId"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowExecutionLogRecord_Sequence", - table: "WorkflowExecutionLogRecords", - column: "Sequence"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowExecutionLogRecord_Timestamp", - table: "WorkflowExecutionLogRecords", - column: "Timestamp"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowExecutionLogRecord_Timestamp_Sequence", - table: "WorkflowExecutionLogRecords", - columns: new[] { "Timestamp", "Sequence" }); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowExecutionLogRecord_WorkflowDefinitionId", - table: "WorkflowExecutionLogRecords", - column: "WorkflowDefinitionId"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowExecutionLogRecord_WorkflowDefinitionVersionId", - table: "WorkflowExecutionLogRecords", - column: "WorkflowDefinitionVersionId"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowExecutionLogRecord_WorkflowInstanceId", - table: "WorkflowExecutionLogRecords", - column: "WorkflowInstanceId"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowExecutionLogRecord_WorkflowVersion", - table: "WorkflowExecutionLogRecords", - column: "WorkflowVersion"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowInboxMessage_ActivityInstanceId", - table: "WorkflowInboxMessages", - column: "ActivityInstanceId"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowInboxMessage_ActivityTypeName", - table: "WorkflowInboxMessages", - column: "ActivityTypeName"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowInboxMessage_CorrelationId", - table: "WorkflowInboxMessages", - column: "CorrelationId"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowInboxMessage_CreatedAt", - table: "WorkflowInboxMessages", - column: "CreatedAt"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowInboxMessage_ExpiresAt", - table: "WorkflowInboxMessages", - column: "ExpiresAt"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowInboxMessage_Hash", - table: "WorkflowInboxMessages", - column: "Hash"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowInboxMessage_WorkflowInstanceId", - table: "WorkflowInboxMessages", - column: "WorkflowInstanceId"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "ActivityExecutionRecords"); - - migrationBuilder.DropTable( - name: "Bookmarks"); - - migrationBuilder.DropTable( - name: "Triggers"); - - migrationBuilder.DropTable( - name: "WorkflowExecutionLogRecords"); - - migrationBuilder.DropTable( - name: "WorkflowInboxMessages"); - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Runtime/20240329200705_V3_1.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Runtime/20240329200705_V3_1.Designer.cs deleted file mode 100644 index a101dd2993..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Runtime/20240329200705_V3_1.Designer.cs +++ /dev/null @@ -1,406 +0,0 @@ -// -using Elsa.EntityFrameworkCore.Modules.Runtime; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.Sqlite.Migrations.Runtime -{ - [DbContext(typeof(RuntimeElsaDbContext))] - [Migration("20240329200705_V3_1")] - partial class V3_1 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder.HasAnnotation("ProductVersion", "7.0.14"); - - modelBuilder.Entity("Elsa.KeyValues.Entities.SerializedKeyValuePair", b => - { - b.Property("Key") - .HasColumnType("TEXT"); - - b.Property("SerializedValue") - .IsRequired() - .HasColumnType("TEXT"); - - b.HasKey("Key"); - - b.ToTable("KeyValuePairs"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.ActivityExecutionRecord", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("ActivityId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("ActivityName") - .HasColumnType("TEXT"); - - b.Property("ActivityNodeId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("ActivityType") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("ActivityTypeVersion") - .HasColumnType("INTEGER"); - - b.Property("CompletedAt") - .HasColumnType("TEXT"); - - b.Property("HasBookmarks") - .HasColumnType("INTEGER"); - - b.Property("SerializedActivityState") - .HasColumnType("TEXT"); - - b.Property("SerializedActivityStateCompressionAlgorithm") - .HasColumnType("TEXT"); - - b.Property("SerializedException") - .HasColumnType("TEXT"); - - b.Property("SerializedOutputs") - .HasColumnType("TEXT"); - - b.Property("SerializedPayload") - .HasColumnType("TEXT"); - - b.Property("SerializedProperties") - .HasColumnType("TEXT"); - - b.Property("StartedAt") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("Status") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("ActivityId") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityId"); - - b.HasIndex("ActivityName") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityName"); - - b.HasIndex("ActivityNodeId") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityNodeId"); - - b.HasIndex("ActivityType") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityType"); - - b.HasIndex("ActivityTypeVersion") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityTypeVersion"); - - b.HasIndex("CompletedAt") - .HasDatabaseName("IX_ActivityExecutionRecord_CompletedAt"); - - b.HasIndex("HasBookmarks") - .HasDatabaseName("IX_ActivityExecutionRecord_HasBookmarks"); - - b.HasIndex("StartedAt") - .HasDatabaseName("IX_ActivityExecutionRecord_StartedAt"); - - b.HasIndex("Status") - .HasDatabaseName("IX_ActivityExecutionRecord_Status"); - - b.HasIndex("WorkflowInstanceId") - .HasDatabaseName("IX_ActivityExecutionRecord_WorkflowInstanceId"); - - b.HasIndex("ActivityType", "ActivityTypeVersion") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityType_ActivityTypeVersion"); - - b.ToTable("ActivityExecutionRecords"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.StoredBookmark", b => - { - b.Property("BookmarkId") - .HasColumnType("TEXT"); - - b.Property("ActivityInstanceId") - .HasColumnType("TEXT"); - - b.Property("ActivityTypeName") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("CorrelationId") - .HasColumnType("TEXT"); - - b.Property("CreatedAt") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("Hash") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("SerializedMetadata") - .HasColumnType("TEXT"); - - b.Property("SerializedPayload") - .HasColumnType("TEXT"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("TEXT"); - - b.HasKey("BookmarkId"); - - b.HasIndex(new[] { "ActivityInstanceId" }, "IX_StoredBookmark_ActivityInstanceId"); - - b.HasIndex(new[] { "ActivityTypeName" }, "IX_StoredBookmark_ActivityTypeName"); - - b.HasIndex(new[] { "ActivityTypeName", "Hash" }, "IX_StoredBookmark_ActivityTypeName_Hash"); - - b.HasIndex(new[] { "ActivityTypeName", "Hash", "WorkflowInstanceId" }, "IX_StoredBookmark_ActivityTypeName_Hash_WorkflowInstanceId"); - - b.HasIndex(new[] { "CreatedAt" }, "IX_StoredBookmark_CreatedAt"); - - b.HasIndex(new[] { "Hash" }, "IX_StoredBookmark_Hash"); - - b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_StoredBookmark_WorkflowInstanceId"); - - b.ToTable("Bookmarks"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.StoredTrigger", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("ActivityId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("Hash") - .HasColumnType("TEXT"); - - b.Property("Name") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("SerializedPayload") - .HasColumnType("TEXT"); - - b.Property("WorkflowDefinitionId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("WorkflowDefinitionVersionId") - .IsRequired() - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("Hash") - .HasDatabaseName("IX_StoredTrigger_Hash"); - - b.HasIndex("Name") - .HasDatabaseName("IX_StoredTrigger_Name"); - - b.HasIndex("WorkflowDefinitionId") - .HasDatabaseName("IX_StoredTrigger_WorkflowDefinitionId"); - - b.HasIndex("WorkflowDefinitionVersionId") - .HasDatabaseName("IX_StoredTrigger_WorkflowDefinitionVersionId"); - - b.ToTable("Triggers"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.WorkflowExecutionLogRecord", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("ActivityId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("ActivityInstanceId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("ActivityName") - .HasColumnType("TEXT"); - - b.Property("ActivityNodeId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("ActivityType") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("ActivityTypeVersion") - .HasColumnType("INTEGER"); - - b.Property("EventName") - .HasColumnType("TEXT"); - - b.Property("Message") - .HasColumnType("TEXT"); - - b.Property("ParentActivityInstanceId") - .HasColumnType("TEXT"); - - b.Property("Sequence") - .HasColumnType("INTEGER"); - - b.Property("SerializedActivityState") - .HasColumnType("TEXT"); - - b.Property("SerializedPayload") - .HasColumnType("TEXT"); - - b.Property("Source") - .HasColumnType("TEXT"); - - b.Property("Timestamp") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("WorkflowDefinitionId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("WorkflowDefinitionVersionId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("WorkflowVersion") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("ActivityId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityId"); - - b.HasIndex("ActivityInstanceId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityInstanceId"); - - b.HasIndex("ActivityName") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityName"); - - b.HasIndex("ActivityNodeId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityNodeId"); - - b.HasIndex("ActivityType") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityType"); - - b.HasIndex("ActivityTypeVersion") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityTypeVersion"); - - b.HasIndex("EventName") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_EventName"); - - b.HasIndex("ParentActivityInstanceId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ParentActivityInstanceId"); - - b.HasIndex("Sequence") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_Sequence"); - - b.HasIndex("Timestamp") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_Timestamp"); - - b.HasIndex("WorkflowDefinitionId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowDefinitionId"); - - b.HasIndex("WorkflowDefinitionVersionId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowDefinitionVersionId"); - - b.HasIndex("WorkflowInstanceId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowInstanceId"); - - b.HasIndex("WorkflowVersion") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowVersion"); - - b.HasIndex("ActivityType", "ActivityTypeVersion") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityType_ActivityTypeVersion"); - - b.HasIndex("Timestamp", "Sequence") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_Timestamp_Sequence"); - - b.ToTable("WorkflowExecutionLogRecords"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.WorkflowInboxMessage", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("ActivityInstanceId") - .HasColumnType("TEXT"); - - b.Property("ActivityTypeName") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("CorrelationId") - .HasColumnType("TEXT"); - - b.Property("CreatedAt") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("ExpiresAt") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("Hash") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("SerializedBookmarkPayload") - .HasColumnType("TEXT"); - - b.Property("SerializedInput") - .HasColumnType("TEXT"); - - b.Property("WorkflowInstanceId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "ActivityInstanceId" }, "IX_WorkflowInboxMessage_ActivityInstanceId"); - - b.HasIndex(new[] { "ActivityTypeName" }, "IX_WorkflowInboxMessage_ActivityTypeName"); - - b.HasIndex(new[] { "CorrelationId" }, "IX_WorkflowInboxMessage_CorrelationId"); - - b.HasIndex(new[] { "CreatedAt" }, "IX_WorkflowInboxMessage_CreatedAt"); - - b.HasIndex(new[] { "ExpiresAt" }, "IX_WorkflowInboxMessage_ExpiresAt"); - - b.HasIndex(new[] { "Hash" }, "IX_WorkflowInboxMessage_Hash"); - - b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_WorkflowInboxMessage_WorkflowInstanceId"); - - b.ToTable("WorkflowInboxMessages"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Runtime/20240329200705_V3_1.cs b/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Runtime/20240329200705_V3_1.cs deleted file mode 100644 index c6e73b527b..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Runtime/20240329200705_V3_1.cs +++ /dev/null @@ -1,61 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.Sqlite.Migrations.Runtime -{ - /// - public partial class V3_1 : Migration - { - private readonly Elsa.EntityFrameworkCore.IElsaDbContextSchema _schema; - - /// - public V3_1(Elsa.EntityFrameworkCore.IElsaDbContextSchema schema) - { - _schema = schema; - } - - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "SerializedActivityStateCompressionAlgorithm", - table: "ActivityExecutionRecords", - type: "TEXT", - nullable: true); - - migrationBuilder.AddColumn( - name: "SerializedProperties", - table: "ActivityExecutionRecords", - type: "TEXT", - nullable: true); - - migrationBuilder.CreateTable( - name: "KeyValuePairs", - columns: table => new - { - Key = table.Column(type: "TEXT", nullable: false), - SerializedValue = table.Column(type: "TEXT", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_KeyValuePairs", x => x.Key); - }); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "KeyValuePairs"); - - migrationBuilder.DropColumn( - name: "SerializedActivityStateCompressionAlgorithm", - table: "ActivityExecutionRecords"); - - migrationBuilder.DropColumn( - name: "SerializedProperties", - table: "ActivityExecutionRecords"); - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Runtime/20240610184731_V3_2.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Runtime/20240610184731_V3_2.Designer.cs deleted file mode 100644 index 1408fee545..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Runtime/20240610184731_V3_2.Designer.cs +++ /dev/null @@ -1,406 +0,0 @@ -// -using Elsa.EntityFrameworkCore.Modules.Runtime; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.Sqlite.Migrations.Runtime -{ - [DbContext(typeof(RuntimeElsaDbContext))] - [Migration("20240610184731_V3_2")] - partial class V3_2 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder.HasAnnotation("ProductVersion", "7.0.20"); - - modelBuilder.Entity("Elsa.KeyValues.Entities.SerializedKeyValuePair", b => - { - b.Property("Key") - .HasColumnType("TEXT"); - - b.Property("SerializedValue") - .IsRequired() - .HasColumnType("TEXT"); - - b.HasKey("Key"); - - b.ToTable("KeyValuePairs"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.ActivityExecutionRecord", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("ActivityId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("ActivityName") - .HasColumnType("TEXT"); - - b.Property("ActivityNodeId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("ActivityType") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("ActivityTypeVersion") - .HasColumnType("INTEGER"); - - b.Property("CompletedAt") - .HasColumnType("TEXT"); - - b.Property("HasBookmarks") - .HasColumnType("INTEGER"); - - b.Property("SerializedActivityState") - .HasColumnType("TEXT"); - - b.Property("SerializedActivityStateCompressionAlgorithm") - .HasColumnType("TEXT"); - - b.Property("SerializedException") - .HasColumnType("TEXT"); - - b.Property("SerializedOutputs") - .HasColumnType("TEXT"); - - b.Property("SerializedPayload") - .HasColumnType("TEXT"); - - b.Property("SerializedProperties") - .HasColumnType("TEXT"); - - b.Property("StartedAt") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("Status") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("ActivityId") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityId"); - - b.HasIndex("ActivityName") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityName"); - - b.HasIndex("ActivityNodeId") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityNodeId"); - - b.HasIndex("ActivityType") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityType"); - - b.HasIndex("ActivityTypeVersion") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityTypeVersion"); - - b.HasIndex("CompletedAt") - .HasDatabaseName("IX_ActivityExecutionRecord_CompletedAt"); - - b.HasIndex("HasBookmarks") - .HasDatabaseName("IX_ActivityExecutionRecord_HasBookmarks"); - - b.HasIndex("StartedAt") - .HasDatabaseName("IX_ActivityExecutionRecord_StartedAt"); - - b.HasIndex("Status") - .HasDatabaseName("IX_ActivityExecutionRecord_Status"); - - b.HasIndex("WorkflowInstanceId") - .HasDatabaseName("IX_ActivityExecutionRecord_WorkflowInstanceId"); - - b.HasIndex("ActivityType", "ActivityTypeVersion") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityType_ActivityTypeVersion"); - - b.ToTable("ActivityExecutionRecords"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.StoredBookmark", b => - { - b.Property("BookmarkId") - .HasColumnType("TEXT"); - - b.Property("ActivityInstanceId") - .HasColumnType("TEXT"); - - b.Property("ActivityTypeName") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("CorrelationId") - .HasColumnType("TEXT"); - - b.Property("CreatedAt") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("Hash") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("SerializedMetadata") - .HasColumnType("TEXT"); - - b.Property("SerializedPayload") - .HasColumnType("TEXT"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("TEXT"); - - b.HasKey("BookmarkId"); - - b.HasIndex(new[] { "ActivityInstanceId" }, "IX_StoredBookmark_ActivityInstanceId"); - - b.HasIndex(new[] { "ActivityTypeName" }, "IX_StoredBookmark_ActivityTypeName"); - - b.HasIndex(new[] { "ActivityTypeName", "Hash" }, "IX_StoredBookmark_ActivityTypeName_Hash"); - - b.HasIndex(new[] { "ActivityTypeName", "Hash", "WorkflowInstanceId" }, "IX_StoredBookmark_ActivityTypeName_Hash_WorkflowInstanceId"); - - b.HasIndex(new[] { "CreatedAt" }, "IX_StoredBookmark_CreatedAt"); - - b.HasIndex(new[] { "Hash" }, "IX_StoredBookmark_Hash"); - - b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_StoredBookmark_WorkflowInstanceId"); - - b.ToTable("Bookmarks"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.StoredTrigger", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("ActivityId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("Hash") - .HasColumnType("TEXT"); - - b.Property("Name") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("SerializedPayload") - .HasColumnType("TEXT"); - - b.Property("WorkflowDefinitionId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("WorkflowDefinitionVersionId") - .IsRequired() - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("Hash") - .HasDatabaseName("IX_StoredTrigger_Hash"); - - b.HasIndex("Name") - .HasDatabaseName("IX_StoredTrigger_Name"); - - b.HasIndex("WorkflowDefinitionId") - .HasDatabaseName("IX_StoredTrigger_WorkflowDefinitionId"); - - b.HasIndex("WorkflowDefinitionVersionId") - .HasDatabaseName("IX_StoredTrigger_WorkflowDefinitionVersionId"); - - b.ToTable("Triggers"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.WorkflowExecutionLogRecord", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("ActivityId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("ActivityInstanceId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("ActivityName") - .HasColumnType("TEXT"); - - b.Property("ActivityNodeId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("ActivityType") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("ActivityTypeVersion") - .HasColumnType("INTEGER"); - - b.Property("EventName") - .HasColumnType("TEXT"); - - b.Property("Message") - .HasColumnType("TEXT"); - - b.Property("ParentActivityInstanceId") - .HasColumnType("TEXT"); - - b.Property("Sequence") - .HasColumnType("INTEGER"); - - b.Property("SerializedActivityState") - .HasColumnType("TEXT"); - - b.Property("SerializedPayload") - .HasColumnType("TEXT"); - - b.Property("Source") - .HasColumnType("TEXT"); - - b.Property("Timestamp") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("WorkflowDefinitionId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("WorkflowDefinitionVersionId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("WorkflowVersion") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("ActivityId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityId"); - - b.HasIndex("ActivityInstanceId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityInstanceId"); - - b.HasIndex("ActivityName") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityName"); - - b.HasIndex("ActivityNodeId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityNodeId"); - - b.HasIndex("ActivityType") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityType"); - - b.HasIndex("ActivityTypeVersion") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityTypeVersion"); - - b.HasIndex("EventName") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_EventName"); - - b.HasIndex("ParentActivityInstanceId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ParentActivityInstanceId"); - - b.HasIndex("Sequence") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_Sequence"); - - b.HasIndex("Timestamp") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_Timestamp"); - - b.HasIndex("WorkflowDefinitionId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowDefinitionId"); - - b.HasIndex("WorkflowDefinitionVersionId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowDefinitionVersionId"); - - b.HasIndex("WorkflowInstanceId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowInstanceId"); - - b.HasIndex("WorkflowVersion") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowVersion"); - - b.HasIndex("ActivityType", "ActivityTypeVersion") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityType_ActivityTypeVersion"); - - b.HasIndex("Timestamp", "Sequence") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_Timestamp_Sequence"); - - b.ToTable("WorkflowExecutionLogRecords"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.WorkflowInboxMessage", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("ActivityInstanceId") - .HasColumnType("TEXT"); - - b.Property("ActivityTypeName") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("CorrelationId") - .HasColumnType("TEXT"); - - b.Property("CreatedAt") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("ExpiresAt") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("Hash") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("SerializedBookmarkPayload") - .HasColumnType("TEXT"); - - b.Property("SerializedInput") - .HasColumnType("TEXT"); - - b.Property("WorkflowInstanceId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "ActivityInstanceId" }, "IX_WorkflowInboxMessage_ActivityInstanceId"); - - b.HasIndex(new[] { "ActivityTypeName" }, "IX_WorkflowInboxMessage_ActivityTypeName"); - - b.HasIndex(new[] { "CorrelationId" }, "IX_WorkflowInboxMessage_CorrelationId"); - - b.HasIndex(new[] { "CreatedAt" }, "IX_WorkflowInboxMessage_CreatedAt"); - - b.HasIndex(new[] { "ExpiresAt" }, "IX_WorkflowInboxMessage_ExpiresAt"); - - b.HasIndex(new[] { "Hash" }, "IX_WorkflowInboxMessage_Hash"); - - b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_WorkflowInboxMessage_WorkflowInstanceId"); - - b.ToTable("WorkflowInboxMessages"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Runtime/20240610184731_V3_2.cs b/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Runtime/20240610184731_V3_2.cs deleted file mode 100644 index d84cfc43f8..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Runtime/20240610184731_V3_2.cs +++ /dev/null @@ -1,30 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.Sqlite.Migrations.Runtime -{ - /// - public partial class V3_2 : Migration - { - private readonly Elsa.EntityFrameworkCore.IElsaDbContextSchema _schema; - - /// - public V3_2(Elsa.EntityFrameworkCore.IElsaDbContextSchema schema) - { - _schema = schema; - } - - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Runtime/20250116192907_V3_3.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Runtime/20250116192907_V3_3.Designer.cs deleted file mode 100644 index d92a8513f7..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Runtime/20250116192907_V3_3.Designer.cs +++ /dev/null @@ -1,486 +0,0 @@ -// -using System; -using Elsa.EntityFrameworkCore.Modules.Runtime; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.Sqlite.Migrations.Runtime -{ - [DbContext(typeof(RuntimeElsaDbContext))] - [Migration("20250116192907_V3_3")] - partial class V3_3 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder.HasAnnotation("ProductVersion", "8.0.11"); - - modelBuilder.Entity("Elsa.KeyValues.Entities.SerializedKeyValuePair", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("SerializedValue") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("TenantId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "TenantId" }, "IX_SerializedKeyValuePair_TenantId"); - - b.ToTable("KeyValuePairs"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.ActivityExecutionRecord", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("ActivityId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("ActivityName") - .HasColumnType("TEXT"); - - b.Property("ActivityNodeId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("ActivityType") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("ActivityTypeVersion") - .HasColumnType("INTEGER"); - - b.Property("CompletedAt") - .HasColumnType("TEXT"); - - b.Property("HasBookmarks") - .HasColumnType("INTEGER"); - - b.Property("SerializedActivityState") - .HasColumnType("TEXT"); - - b.Property("SerializedActivityStateCompressionAlgorithm") - .HasColumnType("TEXT"); - - b.Property("SerializedException") - .HasColumnType("TEXT"); - - b.Property("SerializedOutputs") - .HasColumnType("TEXT"); - - b.Property("SerializedPayload") - .HasColumnType("TEXT"); - - b.Property("SerializedProperties") - .HasColumnType("TEXT"); - - b.Property("StartedAt") - .HasColumnType("TEXT"); - - b.Property("Status") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("TenantId") - .HasColumnType("TEXT"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("ActivityId") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityId"); - - b.HasIndex("ActivityName") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityName"); - - b.HasIndex("ActivityNodeId") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityNodeId"); - - b.HasIndex("ActivityType") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityType"); - - b.HasIndex("ActivityTypeVersion") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityTypeVersion"); - - b.HasIndex("CompletedAt") - .HasDatabaseName("IX_ActivityExecutionRecord_CompletedAt"); - - b.HasIndex("HasBookmarks") - .HasDatabaseName("IX_ActivityExecutionRecord_HasBookmarks"); - - b.HasIndex("StartedAt") - .HasDatabaseName("IX_ActivityExecutionRecord_StartedAt"); - - b.HasIndex("Status") - .HasDatabaseName("IX_ActivityExecutionRecord_Status"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_ActivityExecutionRecord_TenantId"); - - b.HasIndex("WorkflowInstanceId") - .HasDatabaseName("IX_ActivityExecutionRecord_WorkflowInstanceId"); - - b.HasIndex("ActivityType", "ActivityTypeVersion") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityType_ActivityTypeVersion"); - - b.ToTable("ActivityExecutionRecords"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.BookmarkQueueItem", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("ActivityInstanceId") - .HasColumnType("TEXT"); - - b.Property("ActivityTypeName") - .HasColumnType("TEXT"); - - b.Property("BookmarkId") - .HasColumnType("TEXT"); - - b.Property("CorrelationId") - .HasColumnType("TEXT"); - - b.Property("CreatedAt") - .HasColumnType("TEXT"); - - b.Property("SerializedOptions") - .HasColumnType("TEXT"); - - b.Property("StimulusHash") - .HasColumnType("TEXT"); - - b.Property("TenantId") - .HasColumnType("TEXT"); - - b.Property("WorkflowInstanceId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "ActivityInstanceId" }, "IX_BookmarkQueueItem_ActivityInstanceId"); - - b.HasIndex(new[] { "ActivityTypeName" }, "IX_BookmarkQueueItem_ActivityTypeName"); - - b.HasIndex(new[] { "BookmarkId" }, "IX_BookmarkQueueItem_BookmarkId"); - - b.HasIndex(new[] { "CorrelationId" }, "IX_BookmarkQueueItem_CorrelationId"); - - b.HasIndex(new[] { "CreatedAt" }, "IX_BookmarkQueueItem_CreatedAt"); - - b.HasIndex(new[] { "StimulusHash" }, "IX_BookmarkQueueItem_StimulusHash"); - - b.HasIndex(new[] { "TenantId" }, "IX_BookmarkQueueItem_TenantId"); - - b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_BookmarkQueueItem_WorkflowInstanceId"); - - b.ToTable("BookmarkQueueItems"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.StoredBookmark", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("ActivityInstanceId") - .HasColumnType("TEXT"); - - b.Property("ActivityTypeName") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("CorrelationId") - .HasColumnType("TEXT"); - - b.Property("CreatedAt") - .HasColumnType("TEXT"); - - b.Property("Hash") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("SerializedMetadata") - .HasColumnType("TEXT"); - - b.Property("SerializedPayload") - .HasColumnType("TEXT"); - - b.Property("TenantId") - .HasColumnType("TEXT"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "ActivityInstanceId" }, "IX_StoredBookmark_ActivityInstanceId"); - - b.HasIndex(new[] { "ActivityTypeName" }, "IX_StoredBookmark_ActivityTypeName"); - - b.HasIndex(new[] { "ActivityTypeName", "Hash" }, "IX_StoredBookmark_ActivityTypeName_Hash"); - - b.HasIndex(new[] { "ActivityTypeName", "Hash", "WorkflowInstanceId" }, "IX_StoredBookmark_ActivityTypeName_Hash_WorkflowInstanceId"); - - b.HasIndex(new[] { "CreatedAt" }, "IX_StoredBookmark_CreatedAt"); - - b.HasIndex(new[] { "Hash" }, "IX_StoredBookmark_Hash"); - - b.HasIndex(new[] { "TenantId" }, "IX_StoredBookmark_TenantId"); - - b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_StoredBookmark_WorkflowInstanceId"); - - b.ToTable("Bookmarks"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.StoredTrigger", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("ActivityId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("Hash") - .HasColumnType("TEXT"); - - b.Property("Name") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("SerializedPayload") - .HasColumnType("TEXT"); - - b.Property("TenantId") - .HasColumnType("TEXT"); - - b.Property("WorkflowDefinitionId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("WorkflowDefinitionVersionId") - .IsRequired() - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("Hash") - .HasDatabaseName("IX_StoredTrigger_Hash"); - - b.HasIndex("Name") - .HasDatabaseName("IX_StoredTrigger_Name"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_StoredTrigger_TenantId"); - - b.HasIndex("WorkflowDefinitionId") - .HasDatabaseName("IX_StoredTrigger_WorkflowDefinitionId"); - - b.HasIndex("WorkflowDefinitionVersionId") - .HasDatabaseName("IX_StoredTrigger_WorkflowDefinitionVersionId"); - - b.ToTable("Triggers"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.WorkflowExecutionLogRecord", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("ActivityId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("ActivityInstanceId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("ActivityName") - .HasColumnType("TEXT"); - - b.Property("ActivityNodeId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("ActivityType") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("ActivityTypeVersion") - .HasColumnType("INTEGER"); - - b.Property("EventName") - .HasColumnType("TEXT"); - - b.Property("Message") - .HasColumnType("TEXT"); - - b.Property("ParentActivityInstanceId") - .HasColumnType("TEXT"); - - b.Property("Sequence") - .HasColumnType("INTEGER"); - - b.Property("SerializedActivityState") - .HasColumnType("TEXT"); - - b.Property("SerializedPayload") - .HasColumnType("TEXT"); - - b.Property("Source") - .HasColumnType("TEXT"); - - b.Property("TenantId") - .HasColumnType("TEXT"); - - b.Property("Timestamp") - .HasColumnType("TEXT"); - - b.Property("WorkflowDefinitionId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("WorkflowDefinitionVersionId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("WorkflowVersion") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("ActivityId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityId"); - - b.HasIndex("ActivityInstanceId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityInstanceId"); - - b.HasIndex("ActivityName") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityName"); - - b.HasIndex("ActivityNodeId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityNodeId"); - - b.HasIndex("ActivityType") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityType"); - - b.HasIndex("ActivityTypeVersion") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityTypeVersion"); - - b.HasIndex("EventName") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_EventName"); - - b.HasIndex("ParentActivityInstanceId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ParentActivityInstanceId"); - - b.HasIndex("Sequence") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_Sequence"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_TenantId"); - - b.HasIndex("Timestamp") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_Timestamp"); - - b.HasIndex("WorkflowDefinitionId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowDefinitionId"); - - b.HasIndex("WorkflowDefinitionVersionId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowDefinitionVersionId"); - - b.HasIndex("WorkflowInstanceId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowInstanceId"); - - b.HasIndex("WorkflowVersion") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowVersion"); - - b.HasIndex("ActivityType", "ActivityTypeVersion") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityType_ActivityTypeVersion"); - - b.HasIndex("Timestamp", "Sequence") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_Timestamp_Sequence"); - - b.ToTable("WorkflowExecutionLogRecords"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.WorkflowInboxMessage", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("ActivityInstanceId") - .HasColumnType("TEXT"); - - b.Property("ActivityTypeName") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("CorrelationId") - .HasColumnType("TEXT"); - - b.Property("CreatedAt") - .HasColumnType("TEXT"); - - b.Property("ExpiresAt") - .HasColumnType("TEXT"); - - b.Property("Hash") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("SerializedBookmarkPayload") - .HasColumnType("TEXT"); - - b.Property("SerializedInput") - .HasColumnType("TEXT"); - - b.Property("TenantId") - .HasColumnType("TEXT"); - - b.Property("WorkflowInstanceId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "ActivityInstanceId" }, "IX_WorkflowInboxMessage_ActivityInstanceId"); - - b.HasIndex(new[] { "ActivityTypeName" }, "IX_WorkflowInboxMessage_ActivityTypeName"); - - b.HasIndex(new[] { "CorrelationId" }, "IX_WorkflowInboxMessage_CorrelationId"); - - b.HasIndex(new[] { "CreatedAt" }, "IX_WorkflowInboxMessage_CreatedAt"); - - b.HasIndex(new[] { "ExpiresAt" }, "IX_WorkflowInboxMessage_ExpiresAt"); - - b.HasIndex(new[] { "Hash" }, "IX_WorkflowInboxMessage_Hash"); - - b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_WorkflowInboxMessage_WorkflowInstanceId"); - - b.ToTable("WorkflowInboxMessages"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Runtime/20250116192907_V3_3.cs b/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Runtime/20250116192907_V3_3.cs deleted file mode 100644 index 4316a24598..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Runtime/20250116192907_V3_3.cs +++ /dev/null @@ -1,215 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.Sqlite.Migrations.Runtime -{ - /// - public partial class V3_3 : Migration - { - private readonly Elsa.EntityFrameworkCore.IElsaDbContextSchema _schema; - - /// - public V3_3(Elsa.EntityFrameworkCore.IElsaDbContextSchema schema) - { - _schema = schema; - } - - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.RenameColumn( - name: "Key", - table: "KeyValuePairs", - newName: "Id"); - - migrationBuilder.RenameColumn( - name: "BookmarkId", - table: "Bookmarks", - newName: "Id"); - - migrationBuilder.AddColumn( - name: "TenantId", - table: "WorkflowInboxMessages", - type: "TEXT", - nullable: true); - - migrationBuilder.AddColumn( - name: "TenantId", - table: "WorkflowExecutionLogRecords", - type: "TEXT", - nullable: true); - - migrationBuilder.AddColumn( - name: "TenantId", - table: "Triggers", - type: "TEXT", - nullable: true); - - migrationBuilder.AddColumn( - name: "TenantId", - table: "KeyValuePairs", - type: "TEXT", - nullable: true); - - migrationBuilder.AddColumn( - name: "TenantId", - table: "Bookmarks", - type: "TEXT", - nullable: true); - - migrationBuilder.AddColumn( - name: "TenantId", - table: "ActivityExecutionRecords", - type: "TEXT", - nullable: true); - - migrationBuilder.CreateTable( - name: "BookmarkQueueItems", - columns: table => new - { - Id = table.Column(type: "TEXT", nullable: false), - WorkflowInstanceId = table.Column(type: "TEXT", nullable: true), - CorrelationId = table.Column(type: "TEXT", nullable: true), - BookmarkId = table.Column(type: "TEXT", nullable: true), - StimulusHash = table.Column(type: "TEXT", nullable: true), - ActivityInstanceId = table.Column(type: "TEXT", nullable: true), - ActivityTypeName = table.Column(type: "TEXT", nullable: true), - CreatedAt = table.Column(type: "TEXT", nullable: false), - SerializedOptions = table.Column(type: "TEXT", nullable: true), - TenantId = table.Column(type: "TEXT", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_BookmarkQueueItems", x => x.Id); - }); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowExecutionLogRecord_TenantId", - table: "WorkflowExecutionLogRecords", - column: "TenantId"); - - migrationBuilder.CreateIndex( - name: "IX_StoredTrigger_TenantId", - table: "Triggers", - column: "TenantId"); - - migrationBuilder.CreateIndex( - name: "IX_SerializedKeyValuePair_TenantId", - table: "KeyValuePairs", - column: "TenantId"); - - migrationBuilder.CreateIndex( - name: "IX_StoredBookmark_TenantId", - table: "Bookmarks", - column: "TenantId"); - - migrationBuilder.CreateIndex( - name: "IX_ActivityExecutionRecord_TenantId", - table: "ActivityExecutionRecords", - column: "TenantId"); - - migrationBuilder.CreateIndex( - name: "IX_BookmarkQueueItem_ActivityInstanceId", - table: "BookmarkQueueItems", - column: "ActivityInstanceId"); - - migrationBuilder.CreateIndex( - name: "IX_BookmarkQueueItem_ActivityTypeName", - table: "BookmarkQueueItems", - column: "ActivityTypeName"); - - migrationBuilder.CreateIndex( - name: "IX_BookmarkQueueItem_BookmarkId", - table: "BookmarkQueueItems", - column: "BookmarkId"); - - migrationBuilder.CreateIndex( - name: "IX_BookmarkQueueItem_CorrelationId", - table: "BookmarkQueueItems", - column: "CorrelationId"); - - migrationBuilder.CreateIndex( - name: "IX_BookmarkQueueItem_CreatedAt", - table: "BookmarkQueueItems", - column: "CreatedAt"); - - migrationBuilder.CreateIndex( - name: "IX_BookmarkQueueItem_StimulusHash", - table: "BookmarkQueueItems", - column: "StimulusHash"); - - migrationBuilder.CreateIndex( - name: "IX_BookmarkQueueItem_TenantId", - table: "BookmarkQueueItems", - column: "TenantId"); - - migrationBuilder.CreateIndex( - name: "IX_BookmarkQueueItem_WorkflowInstanceId", - table: "BookmarkQueueItems", - column: "WorkflowInstanceId"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "BookmarkQueueItems"); - - migrationBuilder.DropIndex( - name: "IX_WorkflowExecutionLogRecord_TenantId", - table: "WorkflowExecutionLogRecords"); - - migrationBuilder.DropIndex( - name: "IX_StoredTrigger_TenantId", - table: "Triggers"); - - migrationBuilder.DropIndex( - name: "IX_SerializedKeyValuePair_TenantId", - table: "KeyValuePairs"); - - migrationBuilder.DropIndex( - name: "IX_StoredBookmark_TenantId", - table: "Bookmarks"); - - migrationBuilder.DropIndex( - name: "IX_ActivityExecutionRecord_TenantId", - table: "ActivityExecutionRecords"); - - migrationBuilder.DropColumn( - name: "TenantId", - table: "WorkflowInboxMessages"); - - migrationBuilder.DropColumn( - name: "TenantId", - table: "WorkflowExecutionLogRecords"); - - migrationBuilder.DropColumn( - name: "TenantId", - table: "Triggers"); - - migrationBuilder.DropColumn( - name: "TenantId", - table: "KeyValuePairs"); - - migrationBuilder.DropColumn( - name: "TenantId", - table: "Bookmarks"); - - migrationBuilder.DropColumn( - name: "TenantId", - table: "ActivityExecutionRecords"); - - migrationBuilder.RenameColumn( - name: "Id", - table: "KeyValuePairs", - newName: "Key"); - - migrationBuilder.RenameColumn( - name: "Id", - table: "Bookmarks", - newName: "BookmarkId"); - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Runtime/20250222190839_V3_4.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Runtime/20250222190839_V3_4.Designer.cs deleted file mode 100644 index f068516b15..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Runtime/20250222190839_V3_4.Designer.cs +++ /dev/null @@ -1,488 +0,0 @@ -// -using System; -using Elsa.EntityFrameworkCore.Modules.Runtime; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.Sqlite.Migrations.Runtime -{ - [DbContext(typeof(RuntimeElsaDbContext))] - [Migration("20250222190839_V3_4")] - partial class V3_4 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "8.0.12"); - - modelBuilder.Entity("Elsa.KeyValues.Entities.SerializedKeyValuePair", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("SerializedValue") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("TenantId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "TenantId" }, "IX_SerializedKeyValuePair_TenantId"); - - b.ToTable("KeyValuePairs", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.ActivityExecutionRecord", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("ActivityId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("ActivityName") - .HasColumnType("TEXT"); - - b.Property("ActivityNodeId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("ActivityType") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("ActivityTypeVersion") - .HasColumnType("INTEGER"); - - b.Property("CompletedAt") - .HasColumnType("TEXT"); - - b.Property("HasBookmarks") - .HasColumnType("INTEGER"); - - b.Property("SerializedActivityState") - .HasColumnType("TEXT"); - - b.Property("SerializedActivityStateCompressionAlgorithm") - .HasColumnType("TEXT"); - - b.Property("SerializedException") - .HasColumnType("TEXT"); - - b.Property("SerializedOutputs") - .HasColumnType("TEXT"); - - b.Property("SerializedPayload") - .HasColumnType("TEXT"); - - b.Property("SerializedProperties") - .HasColumnType("TEXT"); - - b.Property("StartedAt") - .HasColumnType("TEXT"); - - b.Property("Status") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("TenantId") - .HasColumnType("TEXT"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("ActivityId") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityId"); - - b.HasIndex("ActivityName") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityName"); - - b.HasIndex("ActivityNodeId") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityNodeId"); - - b.HasIndex("ActivityType") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityType"); - - b.HasIndex("ActivityTypeVersion") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityTypeVersion"); - - b.HasIndex("CompletedAt") - .HasDatabaseName("IX_ActivityExecutionRecord_CompletedAt"); - - b.HasIndex("HasBookmarks") - .HasDatabaseName("IX_ActivityExecutionRecord_HasBookmarks"); - - b.HasIndex("StartedAt") - .HasDatabaseName("IX_ActivityExecutionRecord_StartedAt"); - - b.HasIndex("Status") - .HasDatabaseName("IX_ActivityExecutionRecord_Status"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_ActivityExecutionRecord_TenantId"); - - b.HasIndex("WorkflowInstanceId") - .HasDatabaseName("IX_ActivityExecutionRecord_WorkflowInstanceId"); - - b.HasIndex("ActivityType", "ActivityTypeVersion") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityType_ActivityTypeVersion"); - - b.ToTable("ActivityExecutionRecords", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.BookmarkQueueItem", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("ActivityInstanceId") - .HasColumnType("TEXT"); - - b.Property("ActivityTypeName") - .HasColumnType("TEXT"); - - b.Property("BookmarkId") - .HasColumnType("TEXT"); - - b.Property("CorrelationId") - .HasColumnType("TEXT"); - - b.Property("CreatedAt") - .HasColumnType("TEXT"); - - b.Property("SerializedOptions") - .HasColumnType("TEXT"); - - b.Property("StimulusHash") - .HasColumnType("TEXT"); - - b.Property("TenantId") - .HasColumnType("TEXT"); - - b.Property("WorkflowInstanceId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "ActivityInstanceId" }, "IX_BookmarkQueueItem_ActivityInstanceId"); - - b.HasIndex(new[] { "ActivityTypeName" }, "IX_BookmarkQueueItem_ActivityTypeName"); - - b.HasIndex(new[] { "BookmarkId" }, "IX_BookmarkQueueItem_BookmarkId"); - - b.HasIndex(new[] { "CorrelationId" }, "IX_BookmarkQueueItem_CorrelationId"); - - b.HasIndex(new[] { "CreatedAt" }, "IX_BookmarkQueueItem_CreatedAt"); - - b.HasIndex(new[] { "StimulusHash" }, "IX_BookmarkQueueItem_StimulusHash"); - - b.HasIndex(new[] { "TenantId" }, "IX_BookmarkQueueItem_TenantId"); - - b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_BookmarkQueueItem_WorkflowInstanceId"); - - b.ToTable("BookmarkQueueItems", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.StoredBookmark", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("ActivityInstanceId") - .HasColumnType("TEXT"); - - b.Property("ActivityTypeName") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("CorrelationId") - .HasColumnType("TEXT"); - - b.Property("CreatedAt") - .HasColumnType("TEXT"); - - b.Property("Hash") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("SerializedMetadata") - .HasColumnType("TEXT"); - - b.Property("SerializedPayload") - .HasColumnType("TEXT"); - - b.Property("TenantId") - .HasColumnType("TEXT"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "ActivityInstanceId" }, "IX_StoredBookmark_ActivityInstanceId"); - - b.HasIndex(new[] { "ActivityTypeName" }, "IX_StoredBookmark_ActivityTypeName"); - - b.HasIndex(new[] { "ActivityTypeName", "Hash" }, "IX_StoredBookmark_ActivityTypeName_Hash"); - - b.HasIndex(new[] { "ActivityTypeName", "Hash", "WorkflowInstanceId" }, "IX_StoredBookmark_ActivityTypeName_Hash_WorkflowInstanceId"); - - b.HasIndex(new[] { "CreatedAt" }, "IX_StoredBookmark_CreatedAt"); - - b.HasIndex(new[] { "Hash" }, "IX_StoredBookmark_Hash"); - - b.HasIndex(new[] { "TenantId" }, "IX_StoredBookmark_TenantId"); - - b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_StoredBookmark_WorkflowInstanceId"); - - b.ToTable("Bookmarks", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.StoredTrigger", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("ActivityId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("Hash") - .HasColumnType("TEXT"); - - b.Property("Name") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("SerializedPayload") - .HasColumnType("TEXT"); - - b.Property("TenantId") - .HasColumnType("TEXT"); - - b.Property("WorkflowDefinitionId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("WorkflowDefinitionVersionId") - .IsRequired() - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("Hash") - .HasDatabaseName("IX_StoredTrigger_Hash"); - - b.HasIndex("Name") - .HasDatabaseName("IX_StoredTrigger_Name"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_StoredTrigger_TenantId"); - - b.HasIndex("WorkflowDefinitionId") - .HasDatabaseName("IX_StoredTrigger_WorkflowDefinitionId"); - - b.HasIndex("WorkflowDefinitionVersionId") - .HasDatabaseName("IX_StoredTrigger_WorkflowDefinitionVersionId"); - - b.ToTable("Triggers", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.WorkflowExecutionLogRecord", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("ActivityId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("ActivityInstanceId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("ActivityName") - .HasColumnType("TEXT"); - - b.Property("ActivityNodeId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("ActivityType") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("ActivityTypeVersion") - .HasColumnType("INTEGER"); - - b.Property("EventName") - .HasColumnType("TEXT"); - - b.Property("Message") - .HasColumnType("TEXT"); - - b.Property("ParentActivityInstanceId") - .HasColumnType("TEXT"); - - b.Property("Sequence") - .HasColumnType("INTEGER"); - - b.Property("SerializedActivityState") - .HasColumnType("TEXT"); - - b.Property("SerializedPayload") - .HasColumnType("TEXT"); - - b.Property("Source") - .HasColumnType("TEXT"); - - b.Property("TenantId") - .HasColumnType("TEXT"); - - b.Property("Timestamp") - .HasColumnType("TEXT"); - - b.Property("WorkflowDefinitionId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("WorkflowDefinitionVersionId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("WorkflowVersion") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("ActivityId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityId"); - - b.HasIndex("ActivityInstanceId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityInstanceId"); - - b.HasIndex("ActivityName") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityName"); - - b.HasIndex("ActivityNodeId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityNodeId"); - - b.HasIndex("ActivityType") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityType"); - - b.HasIndex("ActivityTypeVersion") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityTypeVersion"); - - b.HasIndex("EventName") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_EventName"); - - b.HasIndex("ParentActivityInstanceId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ParentActivityInstanceId"); - - b.HasIndex("Sequence") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_Sequence"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_TenantId"); - - b.HasIndex("Timestamp") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_Timestamp"); - - b.HasIndex("WorkflowDefinitionId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowDefinitionId"); - - b.HasIndex("WorkflowDefinitionVersionId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowDefinitionVersionId"); - - b.HasIndex("WorkflowInstanceId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowInstanceId"); - - b.HasIndex("WorkflowVersion") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowVersion"); - - b.HasIndex("ActivityType", "ActivityTypeVersion") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityType_ActivityTypeVersion"); - - b.HasIndex("Timestamp", "Sequence") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_Timestamp_Sequence"); - - b.ToTable("WorkflowExecutionLogRecords", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.WorkflowInboxMessage", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("ActivityInstanceId") - .HasColumnType("TEXT"); - - b.Property("ActivityTypeName") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("CorrelationId") - .HasColumnType("TEXT"); - - b.Property("CreatedAt") - .HasColumnType("TEXT"); - - b.Property("ExpiresAt") - .HasColumnType("TEXT"); - - b.Property("Hash") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("SerializedBookmarkPayload") - .HasColumnType("TEXT"); - - b.Property("SerializedInput") - .HasColumnType("TEXT"); - - b.Property("TenantId") - .HasColumnType("TEXT"); - - b.Property("WorkflowInstanceId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "ActivityInstanceId" }, "IX_WorkflowInboxMessage_ActivityInstanceId"); - - b.HasIndex(new[] { "ActivityTypeName" }, "IX_WorkflowInboxMessage_ActivityTypeName"); - - b.HasIndex(new[] { "CorrelationId" }, "IX_WorkflowInboxMessage_CorrelationId"); - - b.HasIndex(new[] { "CreatedAt" }, "IX_WorkflowInboxMessage_CreatedAt"); - - b.HasIndex(new[] { "ExpiresAt" }, "IX_WorkflowInboxMessage_ExpiresAt"); - - b.HasIndex(new[] { "Hash" }, "IX_WorkflowInboxMessage_Hash"); - - b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_WorkflowInboxMessage_WorkflowInstanceId"); - - b.ToTable("WorkflowInboxMessages", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Runtime/20250222190839_V3_4.cs b/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Runtime/20250222190839_V3_4.cs deleted file mode 100644 index afcbe9a7b3..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Runtime/20250222190839_V3_4.cs +++ /dev/null @@ -1,99 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.Sqlite.Migrations.Runtime -{ - /// - public partial class V3_4 : Migration - { - private readonly Elsa.EntityFrameworkCore.IElsaDbContextSchema _schema; - - /// - public V3_4(Elsa.EntityFrameworkCore.IElsaDbContextSchema schema) - { - _schema = schema; - } - - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.EnsureSchema( - name: _schema.Schema); - - migrationBuilder.RenameTable( - name: "WorkflowInboxMessages", - newName: "WorkflowInboxMessages", - newSchema: _schema.Schema); - - migrationBuilder.RenameTable( - name: "WorkflowExecutionLogRecords", - newName: "WorkflowExecutionLogRecords", - newSchema: _schema.Schema); - - migrationBuilder.RenameTable( - name: "Triggers", - newName: "Triggers", - newSchema: _schema.Schema); - - migrationBuilder.RenameTable( - name: "KeyValuePairs", - newName: "KeyValuePairs", - newSchema: _schema.Schema); - - migrationBuilder.RenameTable( - name: "Bookmarks", - newName: "Bookmarks", - newSchema: _schema.Schema); - - migrationBuilder.RenameTable( - name: "BookmarkQueueItems", - newName: "BookmarkQueueItems", - newSchema: _schema.Schema); - - migrationBuilder.RenameTable( - name: "ActivityExecutionRecords", - newName: "ActivityExecutionRecords", - newSchema: _schema.Schema); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.RenameTable( - name: "WorkflowInboxMessages", - schema: _schema.Schema, - newName: "WorkflowInboxMessages"); - - migrationBuilder.RenameTable( - name: "WorkflowExecutionLogRecords", - schema: _schema.Schema, - newName: "WorkflowExecutionLogRecords"); - - migrationBuilder.RenameTable( - name: "Triggers", - schema: _schema.Schema, - newName: "Triggers"); - - migrationBuilder.RenameTable( - name: "KeyValuePairs", - schema: _schema.Schema, - newName: "KeyValuePairs"); - - migrationBuilder.RenameTable( - name: "Bookmarks", - schema: _schema.Schema, - newName: "Bookmarks"); - - migrationBuilder.RenameTable( - name: "BookmarkQueueItems", - schema: _schema.Schema, - newName: "BookmarkQueueItems"); - - migrationBuilder.RenameTable( - name: "ActivityExecutionRecords", - schema: _schema.Schema, - newName: "ActivityExecutionRecords"); - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Runtime/20250401201414_V3_5.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Runtime/20250401201414_V3_5.Designer.cs deleted file mode 100644 index f433f75628..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Runtime/20250401201414_V3_5.Designer.cs +++ /dev/null @@ -1,499 +0,0 @@ -// -using System; -using Elsa.EntityFrameworkCore.Modules.Runtime; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.Sqlite.Migrations.Runtime -{ - [DbContext(typeof(RuntimeElsaDbContext))] - [Migration("20250401201414_V3_5")] - partial class V3_5 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "9.0.3"); - - modelBuilder.Entity("Elsa.KeyValues.Entities.SerializedKeyValuePair", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("SerializedValue") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("TenantId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "TenantId" }, "IX_SerializedKeyValuePair_TenantId"); - - b.ToTable("KeyValuePairs", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.ActivityExecutionRecord", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("ActivityId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("ActivityName") - .HasColumnType("TEXT"); - - b.Property("ActivityNodeId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("ActivityType") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("ActivityTypeVersion") - .HasColumnType("INTEGER"); - - b.Property("AggregateFaultCount") - .HasColumnType("INTEGER"); - - b.Property("CompletedAt") - .HasColumnType("TEXT"); - - b.Property("HasBookmarks") - .HasColumnType("INTEGER"); - - b.Property("SerializedActivityState") - .HasColumnType("TEXT"); - - b.Property("SerializedActivityStateCompressionAlgorithm") - .HasColumnType("TEXT"); - - b.Property("SerializedException") - .HasColumnType("TEXT"); - - b.Property("SerializedOutputs") - .HasColumnType("TEXT"); - - b.Property("SerializedPayload") - .HasColumnType("TEXT"); - - b.Property("SerializedProperties") - .HasColumnType("TEXT"); - - b.Property("StartedAt") - .HasColumnType("TEXT"); - - b.Property("Status") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("TenantId") - .HasColumnType("TEXT"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("ActivityId") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityId"); - - b.HasIndex("ActivityName") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityName"); - - b.HasIndex("ActivityNodeId") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityNodeId"); - - b.HasIndex("ActivityType") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityType"); - - b.HasIndex("ActivityTypeVersion") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityTypeVersion"); - - b.HasIndex("CompletedAt") - .HasDatabaseName("IX_ActivityExecutionRecord_CompletedAt"); - - b.HasIndex("HasBookmarks") - .HasDatabaseName("IX_ActivityExecutionRecord_HasBookmarks"); - - b.HasIndex("StartedAt") - .HasDatabaseName("IX_ActivityExecutionRecord_StartedAt"); - - b.HasIndex("Status") - .HasDatabaseName("IX_ActivityExecutionRecord_Status"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_ActivityExecutionRecord_TenantId"); - - b.HasIndex("WorkflowInstanceId") - .HasDatabaseName("IX_ActivityExecutionRecord_WorkflowInstanceId"); - - b.HasIndex("ActivityType", "ActivityTypeVersion") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityType_ActivityTypeVersion"); - - b.ToTable("ActivityExecutionRecords", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.BookmarkQueueItem", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("ActivityInstanceId") - .HasColumnType("TEXT"); - - b.Property("ActivityTypeName") - .HasColumnType("TEXT"); - - b.Property("BookmarkId") - .HasColumnType("TEXT"); - - b.Property("CorrelationId") - .HasColumnType("TEXT"); - - b.Property("CreatedAt") - .HasColumnType("TEXT"); - - b.Property("SerializedOptions") - .HasColumnType("TEXT"); - - b.Property("StimulusHash") - .HasColumnType("TEXT"); - - b.Property("TenantId") - .HasColumnType("TEXT"); - - b.Property("WorkflowInstanceId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "ActivityInstanceId" }, "IX_BookmarkQueueItem_ActivityInstanceId"); - - b.HasIndex(new[] { "ActivityTypeName" }, "IX_BookmarkQueueItem_ActivityTypeName"); - - b.HasIndex(new[] { "BookmarkId" }, "IX_BookmarkQueueItem_BookmarkId"); - - b.HasIndex(new[] { "CorrelationId" }, "IX_BookmarkQueueItem_CorrelationId"); - - b.HasIndex(new[] { "CreatedAt" }, "IX_BookmarkQueueItem_CreatedAt"); - - b.HasIndex(new[] { "StimulusHash" }, "IX_BookmarkQueueItem_StimulusHash"); - - b.HasIndex(new[] { "TenantId" }, "IX_BookmarkQueueItem_TenantId"); - - b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_BookmarkQueueItem_WorkflowInstanceId"); - - b.ToTable("BookmarkQueueItems", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.StoredBookmark", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("ActivityInstanceId") - .HasColumnType("TEXT"); - - b.Property("ActivityTypeName") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("CorrelationId") - .HasColumnType("TEXT"); - - b.Property("CreatedAt") - .HasColumnType("TEXT"); - - b.Property("Hash") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("Name") - .HasColumnType("TEXT"); - - b.Property("SerializedMetadata") - .HasColumnType("TEXT"); - - b.Property("SerializedPayload") - .HasColumnType("TEXT"); - - b.Property("TenantId") - .HasColumnType("TEXT"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "ActivityInstanceId" }, "IX_StoredBookmark_ActivityInstanceId"); - - b.HasIndex(new[] { "ActivityTypeName" }, "IX_StoredBookmark_ActivityTypeName"); - - b.HasIndex(new[] { "ActivityTypeName", "Hash" }, "IX_StoredBookmark_ActivityTypeName_Hash"); - - b.HasIndex(new[] { "ActivityTypeName", "Hash", "WorkflowInstanceId" }, "IX_StoredBookmark_ActivityTypeName_Hash_WorkflowInstanceId"); - - b.HasIndex(new[] { "CreatedAt" }, "IX_StoredBookmark_CreatedAt"); - - b.HasIndex(new[] { "Hash" }, "IX_StoredBookmark_Hash"); - - b.HasIndex(new[] { "Name" }, "IX_StoredBookmark_Name"); - - b.HasIndex(new[] { "Name", "Hash" }, "IX_StoredBookmark_Name_Hash"); - - b.HasIndex(new[] { "Name", "Hash", "WorkflowInstanceId" }, "IX_StoredBookmark_Name_Hash_WorkflowInstanceId"); - - b.HasIndex(new[] { "TenantId" }, "IX_StoredBookmark_TenantId"); - - b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_StoredBookmark_WorkflowInstanceId"); - - b.ToTable("Bookmarks", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.StoredTrigger", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("ActivityId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("Hash") - .HasColumnType("TEXT"); - - b.Property("Name") - .HasColumnType("TEXT"); - - b.Property("SerializedPayload") - .HasColumnType("TEXT"); - - b.Property("TenantId") - .HasColumnType("TEXT"); - - b.Property("WorkflowDefinitionId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("WorkflowDefinitionVersionId") - .IsRequired() - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("Hash") - .HasDatabaseName("IX_StoredTrigger_Hash"); - - b.HasIndex("Name") - .HasDatabaseName("IX_StoredTrigger_Name"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_StoredTrigger_TenantId"); - - b.HasIndex("WorkflowDefinitionId") - .HasDatabaseName("IX_StoredTrigger_WorkflowDefinitionId"); - - b.HasIndex("WorkflowDefinitionVersionId") - .HasDatabaseName("IX_StoredTrigger_WorkflowDefinitionVersionId"); - - b.ToTable("Triggers", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.WorkflowExecutionLogRecord", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("ActivityId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("ActivityInstanceId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("ActivityName") - .HasColumnType("TEXT"); - - b.Property("ActivityNodeId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("ActivityType") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("ActivityTypeVersion") - .HasColumnType("INTEGER"); - - b.Property("EventName") - .HasColumnType("TEXT"); - - b.Property("Message") - .HasColumnType("TEXT"); - - b.Property("ParentActivityInstanceId") - .HasColumnType("TEXT"); - - b.Property("Sequence") - .HasColumnType("INTEGER"); - - b.Property("SerializedActivityState") - .HasColumnType("TEXT"); - - b.Property("SerializedPayload") - .HasColumnType("TEXT"); - - b.Property("Source") - .HasColumnType("TEXT"); - - b.Property("TenantId") - .HasColumnType("TEXT"); - - b.Property("Timestamp") - .HasColumnType("TEXT"); - - b.Property("WorkflowDefinitionId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("WorkflowDefinitionVersionId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("WorkflowVersion") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("ActivityId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityId"); - - b.HasIndex("ActivityInstanceId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityInstanceId"); - - b.HasIndex("ActivityName") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityName"); - - b.HasIndex("ActivityNodeId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityNodeId"); - - b.HasIndex("ActivityType") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityType"); - - b.HasIndex("ActivityTypeVersion") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityTypeVersion"); - - b.HasIndex("EventName") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_EventName"); - - b.HasIndex("ParentActivityInstanceId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ParentActivityInstanceId"); - - b.HasIndex("Sequence") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_Sequence"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_TenantId"); - - b.HasIndex("Timestamp") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_Timestamp"); - - b.HasIndex("WorkflowDefinitionId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowDefinitionId"); - - b.HasIndex("WorkflowDefinitionVersionId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowDefinitionVersionId"); - - b.HasIndex("WorkflowInstanceId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowInstanceId"); - - b.HasIndex("WorkflowVersion") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowVersion"); - - b.HasIndex("ActivityType", "ActivityTypeVersion") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityType_ActivityTypeVersion"); - - b.HasIndex("Timestamp", "Sequence") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_Timestamp_Sequence"); - - b.ToTable("WorkflowExecutionLogRecords", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.WorkflowInboxMessage", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("ActivityInstanceId") - .HasColumnType("TEXT"); - - b.Property("ActivityTypeName") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("CorrelationId") - .HasColumnType("TEXT"); - - b.Property("CreatedAt") - .HasColumnType("TEXT"); - - b.Property("ExpiresAt") - .HasColumnType("TEXT"); - - b.Property("Hash") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("SerializedBookmarkPayload") - .HasColumnType("TEXT"); - - b.Property("SerializedInput") - .HasColumnType("TEXT"); - - b.Property("TenantId") - .HasColumnType("TEXT"); - - b.Property("WorkflowInstanceId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "ActivityInstanceId" }, "IX_WorkflowInboxMessage_ActivityInstanceId"); - - b.HasIndex(new[] { "ActivityTypeName" }, "IX_WorkflowInboxMessage_ActivityTypeName"); - - b.HasIndex(new[] { "CorrelationId" }, "IX_WorkflowInboxMessage_CorrelationId"); - - b.HasIndex(new[] { "CreatedAt" }, "IX_WorkflowInboxMessage_CreatedAt"); - - b.HasIndex(new[] { "ExpiresAt" }, "IX_WorkflowInboxMessage_ExpiresAt"); - - b.HasIndex(new[] { "Hash" }, "IX_WorkflowInboxMessage_Hash"); - - b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_WorkflowInboxMessage_WorkflowInstanceId"); - - b.ToTable("WorkflowInboxMessages", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Runtime/20250401201414_V3_5.cs b/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Runtime/20250401201414_V3_5.cs deleted file mode 100644 index 3b0796080c..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Runtime/20250401201414_V3_5.cs +++ /dev/null @@ -1,104 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.Sqlite.Migrations.Runtime -{ - /// - public partial class V3_5 : Migration - { - private readonly Elsa.EntityFrameworkCore.IElsaDbContextSchema _schema; - - /// - public V3_5(Elsa.EntityFrameworkCore.IElsaDbContextSchema schema) - { - _schema = schema; - } - - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AlterColumn( - name: "Name", - schema: _schema.Schema, - table: "Triggers", - type: "TEXT", - nullable: true, - oldClrType: typeof(string), - oldType: "TEXT"); - - migrationBuilder.AddColumn( - name: "Name", - schema: _schema.Schema, - table: "Bookmarks", - type: "TEXT", - nullable: true); - - migrationBuilder.AddColumn( - name: "AggregateFaultCount", - schema: _schema.Schema, - table: "ActivityExecutionRecords", - type: "INTEGER", - nullable: false, - defaultValue: 0); - - migrationBuilder.CreateIndex( - name: "IX_StoredBookmark_Name", - schema: _schema.Schema, - table: "Bookmarks", - column: "Name"); - - migrationBuilder.CreateIndex( - name: "IX_StoredBookmark_Name_Hash", - schema: _schema.Schema, - table: "Bookmarks", - columns: new[] { "Name", "Hash" }); - - migrationBuilder.CreateIndex( - name: "IX_StoredBookmark_Name_Hash_WorkflowInstanceId", - schema: _schema.Schema, - table: "Bookmarks", - columns: new[] { "Name", "Hash", "WorkflowInstanceId" }); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropIndex( - name: "IX_StoredBookmark_Name", - schema: _schema.Schema, - table: "Bookmarks"); - - migrationBuilder.DropIndex( - name: "IX_StoredBookmark_Name_Hash", - schema: _schema.Schema, - table: "Bookmarks"); - - migrationBuilder.DropIndex( - name: "IX_StoredBookmark_Name_Hash_WorkflowInstanceId", - schema: _schema.Schema, - table: "Bookmarks"); - - migrationBuilder.DropColumn( - name: "Name", - schema: _schema.Schema, - table: "Bookmarks"); - - migrationBuilder.DropColumn( - name: "AggregateFaultCount", - schema: _schema.Schema, - table: "ActivityExecutionRecords"); - - migrationBuilder.AlterColumn( - name: "Name", - schema: _schema.Schema, - table: "Triggers", - type: "TEXT", - nullable: false, - defaultValue: "", - oldClrType: typeof(string), - oldType: "TEXT", - oldNullable: true); - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Runtime/RuntimeElsaDbContextModelSnapshot.cs b/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Runtime/RuntimeElsaDbContextModelSnapshot.cs deleted file mode 100644 index c3410fd5b7..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Runtime/RuntimeElsaDbContextModelSnapshot.cs +++ /dev/null @@ -1,496 +0,0 @@ -// -using System; -using Elsa.EntityFrameworkCore.Modules.Runtime; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.Sqlite.Migrations.Runtime -{ - [DbContext(typeof(RuntimeElsaDbContext))] - partial class RuntimeElsaDbContextModelSnapshot : ModelSnapshot - { - protected override void BuildModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "9.0.3"); - - modelBuilder.Entity("Elsa.KeyValues.Entities.SerializedKeyValuePair", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("SerializedValue") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("TenantId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "TenantId" }, "IX_SerializedKeyValuePair_TenantId"); - - b.ToTable("KeyValuePairs", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.ActivityExecutionRecord", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("ActivityId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("ActivityName") - .HasColumnType("TEXT"); - - b.Property("ActivityNodeId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("ActivityType") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("ActivityTypeVersion") - .HasColumnType("INTEGER"); - - b.Property("AggregateFaultCount") - .HasColumnType("INTEGER"); - - b.Property("CompletedAt") - .HasColumnType("TEXT"); - - b.Property("HasBookmarks") - .HasColumnType("INTEGER"); - - b.Property("SerializedActivityState") - .HasColumnType("TEXT"); - - b.Property("SerializedActivityStateCompressionAlgorithm") - .HasColumnType("TEXT"); - - b.Property("SerializedException") - .HasColumnType("TEXT"); - - b.Property("SerializedOutputs") - .HasColumnType("TEXT"); - - b.Property("SerializedPayload") - .HasColumnType("TEXT"); - - b.Property("SerializedProperties") - .HasColumnType("TEXT"); - - b.Property("StartedAt") - .HasColumnType("TEXT"); - - b.Property("Status") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("TenantId") - .HasColumnType("TEXT"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("ActivityId") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityId"); - - b.HasIndex("ActivityName") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityName"); - - b.HasIndex("ActivityNodeId") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityNodeId"); - - b.HasIndex("ActivityType") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityType"); - - b.HasIndex("ActivityTypeVersion") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityTypeVersion"); - - b.HasIndex("CompletedAt") - .HasDatabaseName("IX_ActivityExecutionRecord_CompletedAt"); - - b.HasIndex("HasBookmarks") - .HasDatabaseName("IX_ActivityExecutionRecord_HasBookmarks"); - - b.HasIndex("StartedAt") - .HasDatabaseName("IX_ActivityExecutionRecord_StartedAt"); - - b.HasIndex("Status") - .HasDatabaseName("IX_ActivityExecutionRecord_Status"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_ActivityExecutionRecord_TenantId"); - - b.HasIndex("WorkflowInstanceId") - .HasDatabaseName("IX_ActivityExecutionRecord_WorkflowInstanceId"); - - b.HasIndex("ActivityType", "ActivityTypeVersion") - .HasDatabaseName("IX_ActivityExecutionRecord_ActivityType_ActivityTypeVersion"); - - b.ToTable("ActivityExecutionRecords", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.BookmarkQueueItem", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("ActivityInstanceId") - .HasColumnType("TEXT"); - - b.Property("ActivityTypeName") - .HasColumnType("TEXT"); - - b.Property("BookmarkId") - .HasColumnType("TEXT"); - - b.Property("CorrelationId") - .HasColumnType("TEXT"); - - b.Property("CreatedAt") - .HasColumnType("TEXT"); - - b.Property("SerializedOptions") - .HasColumnType("TEXT"); - - b.Property("StimulusHash") - .HasColumnType("TEXT"); - - b.Property("TenantId") - .HasColumnType("TEXT"); - - b.Property("WorkflowInstanceId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "ActivityInstanceId" }, "IX_BookmarkQueueItem_ActivityInstanceId"); - - b.HasIndex(new[] { "ActivityTypeName" }, "IX_BookmarkQueueItem_ActivityTypeName"); - - b.HasIndex(new[] { "BookmarkId" }, "IX_BookmarkQueueItem_BookmarkId"); - - b.HasIndex(new[] { "CorrelationId" }, "IX_BookmarkQueueItem_CorrelationId"); - - b.HasIndex(new[] { "CreatedAt" }, "IX_BookmarkQueueItem_CreatedAt"); - - b.HasIndex(new[] { "StimulusHash" }, "IX_BookmarkQueueItem_StimulusHash"); - - b.HasIndex(new[] { "TenantId" }, "IX_BookmarkQueueItem_TenantId"); - - b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_BookmarkQueueItem_WorkflowInstanceId"); - - b.ToTable("BookmarkQueueItems", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.StoredBookmark", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("ActivityInstanceId") - .HasColumnType("TEXT"); - - b.Property("ActivityTypeName") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("CorrelationId") - .HasColumnType("TEXT"); - - b.Property("CreatedAt") - .HasColumnType("TEXT"); - - b.Property("Hash") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("Name") - .HasColumnType("TEXT"); - - b.Property("SerializedMetadata") - .HasColumnType("TEXT"); - - b.Property("SerializedPayload") - .HasColumnType("TEXT"); - - b.Property("TenantId") - .HasColumnType("TEXT"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "ActivityInstanceId" }, "IX_StoredBookmark_ActivityInstanceId"); - - b.HasIndex(new[] { "ActivityTypeName" }, "IX_StoredBookmark_ActivityTypeName"); - - b.HasIndex(new[] { "ActivityTypeName", "Hash" }, "IX_StoredBookmark_ActivityTypeName_Hash"); - - b.HasIndex(new[] { "ActivityTypeName", "Hash", "WorkflowInstanceId" }, "IX_StoredBookmark_ActivityTypeName_Hash_WorkflowInstanceId"); - - b.HasIndex(new[] { "CreatedAt" }, "IX_StoredBookmark_CreatedAt"); - - b.HasIndex(new[] { "Hash" }, "IX_StoredBookmark_Hash"); - - b.HasIndex(new[] { "Name" }, "IX_StoredBookmark_Name"); - - b.HasIndex(new[] { "Name", "Hash" }, "IX_StoredBookmark_Name_Hash"); - - b.HasIndex(new[] { "Name", "Hash", "WorkflowInstanceId" }, "IX_StoredBookmark_Name_Hash_WorkflowInstanceId"); - - b.HasIndex(new[] { "TenantId" }, "IX_StoredBookmark_TenantId"); - - b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_StoredBookmark_WorkflowInstanceId"); - - b.ToTable("Bookmarks", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.StoredTrigger", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("ActivityId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("Hash") - .HasColumnType("TEXT"); - - b.Property("Name") - .HasColumnType("TEXT"); - - b.Property("SerializedPayload") - .HasColumnType("TEXT"); - - b.Property("TenantId") - .HasColumnType("TEXT"); - - b.Property("WorkflowDefinitionId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("WorkflowDefinitionVersionId") - .IsRequired() - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("Hash") - .HasDatabaseName("IX_StoredTrigger_Hash"); - - b.HasIndex("Name") - .HasDatabaseName("IX_StoredTrigger_Name"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_StoredTrigger_TenantId"); - - b.HasIndex("WorkflowDefinitionId") - .HasDatabaseName("IX_StoredTrigger_WorkflowDefinitionId"); - - b.HasIndex("WorkflowDefinitionVersionId") - .HasDatabaseName("IX_StoredTrigger_WorkflowDefinitionVersionId"); - - b.ToTable("Triggers", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.WorkflowExecutionLogRecord", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("ActivityId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("ActivityInstanceId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("ActivityName") - .HasColumnType("TEXT"); - - b.Property("ActivityNodeId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("ActivityType") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("ActivityTypeVersion") - .HasColumnType("INTEGER"); - - b.Property("EventName") - .HasColumnType("TEXT"); - - b.Property("Message") - .HasColumnType("TEXT"); - - b.Property("ParentActivityInstanceId") - .HasColumnType("TEXT"); - - b.Property("Sequence") - .HasColumnType("INTEGER"); - - b.Property("SerializedActivityState") - .HasColumnType("TEXT"); - - b.Property("SerializedPayload") - .HasColumnType("TEXT"); - - b.Property("Source") - .HasColumnType("TEXT"); - - b.Property("TenantId") - .HasColumnType("TEXT"); - - b.Property("Timestamp") - .HasColumnType("TEXT"); - - b.Property("WorkflowDefinitionId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("WorkflowDefinitionVersionId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("WorkflowInstanceId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("WorkflowVersion") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("ActivityId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityId"); - - b.HasIndex("ActivityInstanceId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityInstanceId"); - - b.HasIndex("ActivityName") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityName"); - - b.HasIndex("ActivityNodeId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityNodeId"); - - b.HasIndex("ActivityType") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityType"); - - b.HasIndex("ActivityTypeVersion") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityTypeVersion"); - - b.HasIndex("EventName") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_EventName"); - - b.HasIndex("ParentActivityInstanceId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ParentActivityInstanceId"); - - b.HasIndex("Sequence") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_Sequence"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_TenantId"); - - b.HasIndex("Timestamp") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_Timestamp"); - - b.HasIndex("WorkflowDefinitionId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowDefinitionId"); - - b.HasIndex("WorkflowDefinitionVersionId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowDefinitionVersionId"); - - b.HasIndex("WorkflowInstanceId") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowInstanceId"); - - b.HasIndex("WorkflowVersion") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowVersion"); - - b.HasIndex("ActivityType", "ActivityTypeVersion") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityType_ActivityTypeVersion"); - - b.HasIndex("Timestamp", "Sequence") - .HasDatabaseName("IX_WorkflowExecutionLogRecord_Timestamp_Sequence"); - - b.ToTable("WorkflowExecutionLogRecords", "Elsa"); - }); - - modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.WorkflowInboxMessage", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("ActivityInstanceId") - .HasColumnType("TEXT"); - - b.Property("ActivityTypeName") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("CorrelationId") - .HasColumnType("TEXT"); - - b.Property("CreatedAt") - .HasColumnType("TEXT"); - - b.Property("ExpiresAt") - .HasColumnType("TEXT"); - - b.Property("Hash") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("SerializedBookmarkPayload") - .HasColumnType("TEXT"); - - b.Property("SerializedInput") - .HasColumnType("TEXT"); - - b.Property("TenantId") - .HasColumnType("TEXT"); - - b.Property("WorkflowInstanceId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "ActivityInstanceId" }, "IX_WorkflowInboxMessage_ActivityInstanceId"); - - b.HasIndex(new[] { "ActivityTypeName" }, "IX_WorkflowInboxMessage_ActivityTypeName"); - - b.HasIndex(new[] { "CorrelationId" }, "IX_WorkflowInboxMessage_CorrelationId"); - - b.HasIndex(new[] { "CreatedAt" }, "IX_WorkflowInboxMessage_CreatedAt"); - - b.HasIndex(new[] { "ExpiresAt" }, "IX_WorkflowInboxMessage_ExpiresAt"); - - b.HasIndex(new[] { "Hash" }, "IX_WorkflowInboxMessage_Hash"); - - b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_WorkflowInboxMessage_WorkflowInstanceId"); - - b.ToTable("WorkflowInboxMessages", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Tenants/20241212212154_V3_3.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Tenants/20241212212154_V3_3.Designer.cs deleted file mode 100644 index c37d1f2334..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Tenants/20241212212154_V3_3.Designer.cs +++ /dev/null @@ -1,51 +0,0 @@ -// -using Elsa.EntityFrameworkCore.Modules.Tenants; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.Sqlite.Migrations.Tenants -{ - [DbContext(typeof(TenantsElsaDbContext))] - [Migration("20241212212154_V3_3")] - partial class V3_3 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder.HasAnnotation("ProductVersion", "7.0.20"); - - modelBuilder.Entity("Elsa.Common.Multitenancy.Tenant", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("Configuration") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("Name") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("TenantId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .HasDatabaseName("IX_Tenant_Name"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_Tenant_TenantId"); - - b.ToTable("Tenants"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Tenants/20241212212154_V3_3.cs b/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Tenants/20241212212154_V3_3.cs deleted file mode 100644 index 055d068c2d..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Tenants/20241212212154_V3_3.cs +++ /dev/null @@ -1,53 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.Sqlite.Migrations.Tenants -{ - /// - public partial class V3_3 : Migration - { - private readonly Elsa.EntityFrameworkCore.IElsaDbContextSchema _schema; - - /// - public V3_3(Elsa.EntityFrameworkCore.IElsaDbContextSchema schema) - { - _schema = schema; - } - - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "Tenants", - columns: table => new - { - Id = table.Column(type: "TEXT", nullable: false), - Name = table.Column(type: "TEXT", nullable: false), - Configuration = table.Column(type: "TEXT", nullable: false), - TenantId = table.Column(type: "TEXT", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Tenants", x => x.Id); - }); - - migrationBuilder.CreateIndex( - name: "IX_Tenant_Name", - table: "Tenants", - column: "Name"); - - migrationBuilder.CreateIndex( - name: "IX_Tenant_TenantId", - table: "Tenants", - column: "TenantId"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "Tenants"); - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Tenants/20250222191016_V3_4.Designer.cs b/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Tenants/20250222191016_V3_4.Designer.cs deleted file mode 100644 index ee26859007..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Tenants/20250222191016_V3_4.Designer.cs +++ /dev/null @@ -1,53 +0,0 @@ -// -using Elsa.EntityFrameworkCore.Modules.Tenants; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.Sqlite.Migrations.Tenants -{ - [DbContext(typeof(TenantsElsaDbContext))] - [Migration("20250222191016_V3_4")] - partial class V3_4 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "8.0.12"); - - modelBuilder.Entity("Elsa.Common.Multitenancy.Tenant", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("Configuration") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("Name") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("TenantId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .HasDatabaseName("IX_Tenant_Name"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_Tenant_TenantId"); - - b.ToTable("Tenants", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Tenants/20250222191016_V3_4.cs b/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Tenants/20250222191016_V3_4.cs deleted file mode 100644 index b1b30db0af..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Tenants/20250222191016_V3_4.cs +++ /dev/null @@ -1,39 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.Sqlite.Migrations.Tenants -{ - /// - public partial class V3_4 : Migration - { - private readonly Elsa.EntityFrameworkCore.IElsaDbContextSchema _schema; - - /// - public V3_4(Elsa.EntityFrameworkCore.IElsaDbContextSchema schema) - { - _schema = schema; - } - - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.EnsureSchema( - name: _schema.Schema); - - migrationBuilder.RenameTable( - name: "Tenants", - newName: "Tenants", - newSchema: _schema.Schema); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.RenameTable( - name: "Tenants", - schema: _schema.Schema, - newName: "Tenants"); - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Tenants/TenantsElsaDbContextModelSnapshot.cs b/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Tenants/TenantsElsaDbContextModelSnapshot.cs deleted file mode 100644 index 9fff9838de..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Sqlite/Migrations/Tenants/TenantsElsaDbContextModelSnapshot.cs +++ /dev/null @@ -1,50 +0,0 @@ -// -using Elsa.EntityFrameworkCore.Modules.Tenants; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Elsa.EntityFrameworkCore.Sqlite.Migrations.Tenants -{ - [DbContext(typeof(TenantsElsaDbContext))] - partial class TenantsElsaDbContextModelSnapshot : ModelSnapshot - { - protected override void BuildModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Elsa") - .HasAnnotation("ProductVersion", "8.0.12"); - - modelBuilder.Entity("Elsa.Common.Multitenancy.Tenant", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("Configuration") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("Name") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("TenantId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .HasDatabaseName("IX_Tenant_Name"); - - b.HasIndex("TenantId") - .HasDatabaseName("IX_Tenant_TenantId"); - - b.ToTable("Tenants", "Elsa"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.Sqlite/SetupForSqlite.cs b/src/modules/Elsa.EntityFrameworkCore.Sqlite/SetupForSqlite.cs deleted file mode 100644 index 8d60ac9621..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Sqlite/SetupForSqlite.cs +++ /dev/null @@ -1,30 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -namespace Elsa.EntityFrameworkCore.Sqlite; - -/// -/// Represents a class that handles entity model creation for SQLite databases. -/// -public class SetupForSqlite : IEntityModelCreatingHandler -{ - /// - public void Handle(ElsaDbContextBase dbContext, ModelBuilder modelBuilder, IMutableEntityType entityType) - { - if(!dbContext.Database.IsSqlite()) - return; - - // SQLite does not have proper support for DateTimeOffset via Entity Framework Core, see the limitations - // here: https://docs.microsoft.com/en-us/ef/core/providers/sqlite/limitations#query-limitations - var properties = entityType.ClrType.GetProperties().Where(p => p.PropertyType == typeof(DateTimeOffset) || p.PropertyType == typeof(DateTimeOffset?)); - - foreach (var property in properties) - { - modelBuilder - .Entity(entityType.Name) - .Property(property.Name) - .HasConversion(new DateTimeOffsetToStringConverter()); - } - } -} \ No newline at end of file diff --git a/src/modules/Elsa.EntityFrameworkCore.Sqlite/SqliteProvidersExtensions.cs b/src/modules/Elsa.EntityFrameworkCore.Sqlite/SqliteProvidersExtensions.cs deleted file mode 100644 index 561b35428e..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore.Sqlite/SqliteProvidersExtensions.cs +++ /dev/null @@ -1,76 +0,0 @@ -using System.Reflection; -using Elsa.EntityFrameworkCore.EntityHandlers; -using Elsa.EntityFrameworkCore.Sqlite; -using Elsa.Extensions; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.DependencyInjection.Extensions; - -// ReSharper disable once CheckNamespace -namespace Elsa.EntityFrameworkCore.Extensions; - -/// -/// Provides extensions to configure EF Core to use Sqlite. -/// -public static class SqliteProvidersExtensions -{ - private static Assembly Assembly => typeof(SqliteProvidersExtensions).Assembly; - - /// - /// Configures the feature to use Sqlite. - /// - public static TFeature UseSqlite(this PersistenceFeatureBase feature, - string? connectionString = null, - ElsaDbContextOptions? options = null, - Action? configure = null) - where TDbContext : ElsaDbContextBase - where TFeature : PersistenceFeatureBase - { - return feature.UseSqlite(Assembly, connectionString, options, configure); - } - - /// - /// Configures the feature to use Sqlite. - /// - public static TFeature UseSqlite(this PersistenceFeatureBase feature, - Func connectionStringFunc, - ElsaDbContextOptions? options = null, - Action? configure = null) - where TDbContext : ElsaDbContextBase - where TFeature : PersistenceFeatureBase - { - return feature.UseSqlite(Assembly, connectionStringFunc, options, configure); - } - - /// - /// Configures the feature to use Sqlite. - /// - public static TFeature UseSqlite(this PersistenceFeatureBase feature, - Assembly migrationsAssembly, - string? connectionString = null, - ElsaDbContextOptions? options = null, - Action? configure = null) - where TDbContext : ElsaDbContextBase - where TFeature : PersistenceFeatureBase - { - connectionString ??= "Data Source=elsa.sqlite.db;Cache=Shared;"; - return feature.UseSqlite(migrationsAssembly, _ => connectionString, options, configure); - } - - /// - /// Configures the feature to use Sqlite. - /// - public static TFeature UseSqlite(this PersistenceFeatureBase feature, - Assembly migrationsAssembly, - Func connectionStringFunc, - ElsaDbContextOptions? options = null, - Action? configure = null) - where TDbContext : ElsaDbContextBase - where TFeature : PersistenceFeatureBase - { - - feature.Module.Services.TryAddScopedImplementation(); - feature.DbContextOptionsBuilder = (sp, db) => db.UseElsaSqlite(migrationsAssembly, connectionStringFunc(sp), options, configure: configure); - return (TFeature)feature; - } -} \ No newline at end of file diff --git a/src/modules/Elsa.EntityFrameworkCore/Elsa.EntityFrameworkCore.csproj b/src/modules/Elsa.EntityFrameworkCore/Elsa.EntityFrameworkCore.csproj deleted file mode 100644 index 8a9b1901ec..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore/Elsa.EntityFrameworkCore.csproj +++ /dev/null @@ -1,24 +0,0 @@ - - - - - Provides Entity Framework Core implementations of various abstractions from various modules. - - elsa module persistence efcore - - - - - - - - - - - - - - - - - diff --git a/src/modules/Elsa.EntityFrameworkCore/FodyWeavers.xml b/src/modules/Elsa.EntityFrameworkCore/FodyWeavers.xml deleted file mode 100644 index 00e1d9a1c1..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore/FodyWeavers.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/src/modules/Elsa.EntityFrameworkCore/Modules/Alterations/AlterationJobStore.cs b/src/modules/Elsa.EntityFrameworkCore/Modules/Alterations/AlterationJobStore.cs deleted file mode 100644 index 7f185a8513..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore/Modules/Alterations/AlterationJobStore.cs +++ /dev/null @@ -1,79 +0,0 @@ -using System.Text.Json; -using Elsa.Alterations.Core.Contracts; -using Elsa.Alterations.Core.Entities; -using Elsa.Alterations.Core.Filters; -using Elsa.Alterations.Core.Models; -using Open.Linq.AsyncExtensions; - -namespace Elsa.EntityFrameworkCore.Modules.Alterations; - -/// -/// An EF Core implementation of . -/// -public class EFCoreAlterationJobStore : IAlterationJobStore -{ - private readonly EntityStore _store; - - /// - /// Constructor. - /// - public EFCoreAlterationJobStore(EntityStore store) - { - _store = store; - } - - /// - public async Task SaveAsync(AlterationJob record, CancellationToken cancellationToken = default) - { - await _store.SaveAsync(record, OnSaveAsync, cancellationToken); - } - - /// - public async Task SaveManyAsync(IEnumerable jobs, CancellationToken cancellationToken = default) - { - await _store.SaveManyAsync(jobs, OnSaveAsync, cancellationToken); - } - - /// - public async Task FindAsync(AlterationJobFilter filter, CancellationToken cancellationToken = default) - { - return await _store.FindAsync(filter.Apply, OnLoadAsync, cancellationToken); - } - - /// - public async Task> FindManyAsync(AlterationJobFilter filter, CancellationToken cancellationToken = default) - { - return await _store.QueryAsync(filter.Apply, OnLoadAsync, cancellationToken).ToList(); - } - - /// - public async Task> FindManyIdsAsync(AlterationJobFilter filter, CancellationToken cancellationToken = default) - { - return await _store.QueryAsync(filter.Apply, x => x.Id, cancellationToken); - } - - /// - public async Task CountAsync(AlterationJobFilter filter, CancellationToken cancellationToken = default) - { - return await _store.CountAsync(queryable => Filter(queryable, filter), cancellationToken); - } - - private static ValueTask OnSaveAsync(AlterationsElsaDbContext elsaDbContext, AlterationJob entity, CancellationToken cancellationToken) - { - elsaDbContext.Entry(entity).Property("SerializedLog").CurrentValue = JsonSerializer.Serialize(entity.Log); - return default; - } - - private static ValueTask OnLoadAsync(AlterationsElsaDbContext elsaDbContext, AlterationJob? entity, CancellationToken cancellationToken) - { - if (entity is null) - return default; - - var logJson = elsaDbContext.Entry(entity).Property("SerializedLog").CurrentValue; - entity.Log = JsonSerializer.Deserialize(logJson)!; - - return default; - } - - private static IQueryable Filter(IQueryable queryable, AlterationJobFilter filter) => filter.Apply(queryable); -} \ No newline at end of file diff --git a/src/modules/Elsa.EntityFrameworkCore/Modules/Alterations/AlterationPlanStore.cs b/src/modules/Elsa.EntityFrameworkCore/Modules/Alterations/AlterationPlanStore.cs deleted file mode 100644 index 7c8836eda0..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore/Modules/Alterations/AlterationPlanStore.cs +++ /dev/null @@ -1,66 +0,0 @@ -using System.Diagnostics.CodeAnalysis; -using System.Text.Json; -using Elsa.Alterations.Core.Contracts; -using Elsa.Alterations.Core.Entities; -using Elsa.Alterations.Core.Filters; -using Elsa.Alterations.Core.Models; - -namespace Elsa.EntityFrameworkCore.Modules.Alterations; - -/// -/// An EF Core implementation of . -/// -public class EFCoreAlterationPlanStore : IAlterationPlanStore -{ - private readonly EntityStore _store; - private readonly IAlterationSerializer _alterationSerializer; - - /// - /// Constructor. - /// - public EFCoreAlterationPlanStore(EntityStore store, IAlterationSerializer alterationSerializer) - { - _store = store; - _alterationSerializer = alterationSerializer; - } - - /// - public async Task SaveAsync(AlterationPlan record, CancellationToken cancellationToken = default) - { - await _store.SaveAsync(record, OnSaveAsync, cancellationToken); - } - - /// - [RequiresUnreferencedCode("Calls System.Text.Json.JsonSerializer.Deserialize(String, JsonSerializerOptions)")] - public async Task FindAsync(AlterationPlanFilter filter, CancellationToken cancellationToken = default) - { - return await _store.FindAsync(filter.Apply, OnLoadAsync, cancellationToken); - } - - /// - public async Task CountAsync(AlterationPlanFilter filter, CancellationToken cancellationToken = default) - { - return await _store.CountAsync(filter.Apply, cancellationToken); - } - - private ValueTask OnSaveAsync(AlterationsElsaDbContext elsaDbContext, AlterationPlan entity, CancellationToken cancellationToken) - { - elsaDbContext.Entry(entity).Property("SerializedAlterations").CurrentValue = _alterationSerializer.SerializeMany(entity.Alterations); - elsaDbContext.Entry(entity).Property("SerializedWorkflowInstanceFilter").CurrentValue = JsonSerializer.Serialize(entity.WorkflowInstanceFilter); - return default; - } - - [RequiresUnreferencedCode("Calls System.Text.Json.JsonSerializer.Deserialize(String, JsonSerializerOptions)")] - private ValueTask OnLoadAsync(AlterationsElsaDbContext elsaDbContext, AlterationPlan? entity, CancellationToken cancellationToken) - { - if (entity is null) - return default; - - var alterationsJson = elsaDbContext.Entry(entity).Property("SerializedAlterations").CurrentValue; - var workflowInstanceFilterJson = elsaDbContext.Entry(entity).Property("SerializedWorkflowInstanceFilter").CurrentValue; - entity.Alterations = _alterationSerializer.DeserializeMany(alterationsJson).ToList(); - entity.WorkflowInstanceFilter = JsonSerializer.Deserialize(workflowInstanceFilterJson)!; - - return default; - } -} \ No newline at end of file diff --git a/src/modules/Elsa.EntityFrameworkCore/Modules/Alterations/Configurations.cs b/src/modules/Elsa.EntityFrameworkCore/Modules/Alterations/Configurations.cs deleted file mode 100644 index 16eb4c7e28..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore/Modules/Alterations/Configurations.cs +++ /dev/null @@ -1,41 +0,0 @@ -using Elsa.Alterations.Core.Entities; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; - -namespace Elsa.EntityFrameworkCore.Modules.Alterations; - -/// -/// EF Core configuration for various entity types. -/// -public class Configurations : IEntityTypeConfiguration, IEntityTypeConfiguration -{ - /// - public void Configure(EntityTypeBuilder builder) - { - builder.Ignore(x => x.Alterations); - builder.Ignore(x => x.WorkflowInstanceFilter); - builder.Property("SerializedAlterations"); - builder.Property("SerializedWorkflowInstanceFilter"); - builder.Property(x => x.Status).HasConversion(); - builder.HasIndex(x => x.Status).HasDatabaseName($"IX_{nameof(AlterationPlan)}_{nameof(AlterationPlan.Status)}"); - builder.HasIndex(x => x.CreatedAt).HasDatabaseName($"IX_{nameof(AlterationPlan)}_{nameof(AlterationPlan.CreatedAt)}"); - builder.HasIndex(x => x.StartedAt).HasDatabaseName($"IX_{nameof(AlterationPlan)}_{nameof(AlterationPlan.StartedAt)}"); - builder.HasIndex(x => x.CompletedAt).HasDatabaseName($"IX_{nameof(AlterationPlan)}_{nameof(AlterationPlan.CompletedAt)}"); - builder.HasIndex(x => x.TenantId).HasDatabaseName($"IX_{nameof(AlterationPlan)}_{nameof(AlterationPlan.TenantId)}"); - } - - /// - public void Configure(EntityTypeBuilder builder) - { - builder.Ignore(x => x.Log); - builder.Property("SerializedLog"); - builder.Property(x => x.Status).HasConversion(); - builder.HasIndex(x => x.PlanId).HasDatabaseName($"IX_{nameof(AlterationJob)}_{nameof(AlterationJob.PlanId)}"); - builder.HasIndex(x => x.WorkflowInstanceId).HasDatabaseName($"IX_{nameof(AlterationJob)}_{nameof(AlterationJob.WorkflowInstanceId)}"); - builder.HasIndex(x => x.Status).HasDatabaseName($"IX_{nameof(AlterationJob)}_{nameof(AlterationJob.Status)}"); - builder.HasIndex(x => x.CreatedAt).HasDatabaseName($"IX_{nameof(AlterationJob)}_{nameof(AlterationJob.CreatedAt)}"); - builder.HasIndex(x => x.StartedAt).HasDatabaseName($"IX_{nameof(AlterationJob)}_{nameof(AlterationJob.StartedAt)}"); - builder.HasIndex(x => x.CompletedAt).HasDatabaseName($"IX_{nameof(AlterationJob)}_{nameof(AlterationJob.CompletedAt)}"); - builder.HasIndex(x => x.TenantId).HasDatabaseName($"IX_{nameof(AlterationJob)}_{nameof(AlterationJob.TenantId)}"); - } -} \ No newline at end of file diff --git a/src/modules/Elsa.EntityFrameworkCore/Modules/Alterations/DbContext.cs b/src/modules/Elsa.EntityFrameworkCore/Modules/Alterations/DbContext.cs deleted file mode 100644 index 6043382519..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore/Modules/Alterations/DbContext.cs +++ /dev/null @@ -1,42 +0,0 @@ -using Elsa.Alterations.Core.Entities; -using Elsa.Alterations.Core.Models; -using Elsa.Workflows.Management.Models; -using JetBrains.Annotations; -using Microsoft.EntityFrameworkCore; - -namespace Elsa.EntityFrameworkCore.Modules.Alterations; - -/// -/// DB context for the runtime module. -/// -[UsedImplicitly] -public class AlterationsElsaDbContext : ElsaDbContextBase -{ - /// - public AlterationsElsaDbContext(DbContextOptions options, IServiceProvider serviceProvider) : base(options, serviceProvider) - { - } - - /// - /// The alteration plans. - /// - public DbSet AlterationPlans { get; set; } = default!; - - /// - /// The alteration jobs. - /// - public DbSet AlterationJobs { get; set; } = default!; - - /// - protected override void OnModelCreating(ModelBuilder modelBuilder) - { - modelBuilder.Ignore(); - modelBuilder.Ignore(); - modelBuilder.Ignore(); - - var configuration = new Configurations(); - modelBuilder.ApplyConfiguration(configuration); - modelBuilder.ApplyConfiguration(configuration); - base.OnModelCreating(modelBuilder); - } -} \ No newline at end of file diff --git a/src/modules/Elsa.EntityFrameworkCore/Modules/Alterations/Extensions.cs b/src/modules/Elsa.EntityFrameworkCore/Modules/Alterations/Extensions.cs deleted file mode 100644 index 02be5e43b9..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore/Modules/Alterations/Extensions.cs +++ /dev/null @@ -1,20 +0,0 @@ -using Elsa.Alterations.Features; -using JetBrains.Annotations; - -namespace Elsa.EntityFrameworkCore.Modules.Alterations; - -/// -/// Provides extensions to the feature. -/// -[PublicAPI] -public static class Extensions -{ - /// - /// Configures the to use EF Core persistence providers. - /// - public static AlterationsFeature UseEntityFrameworkCore(this AlterationsFeature feature, Action? configure = default) - { - feature.Module.Configure(configure); - return feature; - } -} \ No newline at end of file diff --git a/src/modules/Elsa.EntityFrameworkCore/Modules/Alterations/Feature.cs b/src/modules/Elsa.EntityFrameworkCore/Modules/Alterations/Feature.cs deleted file mode 100644 index de79b7815c..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore/Modules/Alterations/Feature.cs +++ /dev/null @@ -1,32 +0,0 @@ -using Elsa.Alterations.Core.Entities; -using Elsa.Alterations.Features; -using Elsa.Features.Attributes; -using Elsa.Features.Services; -using Microsoft.Extensions.DependencyInjection; - -namespace Elsa.EntityFrameworkCore.Modules.Alterations; - -/// -/// Configures the default workflow runtime to use EF Core persistence providers. -/// -[DependsOn(typeof(AlterationsFeature))] -public class EFCoreAlterationsPersistenceFeature(IModule module) : PersistenceFeatureBase(module) -{ - /// - public override void Configure() - { - Module.Configure(feature => - { - feature.AlterationPlanStoreFactory = sp => sp.GetRequiredService(); - feature.AlterationJobStoreFactory = sp => sp.GetRequiredService(); - }); - } - - /// - public override void Apply() - { - base.Apply(); - AddEntityStore(); - AddEntityStore(); - } -} \ No newline at end of file diff --git a/src/modules/Elsa.EntityFrameworkCore/Modules/Identity/ApplicationStore.cs b/src/modules/Elsa.EntityFrameworkCore/Modules/Identity/ApplicationStore.cs deleted file mode 100644 index cef3e5d675..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore/Modules/Identity/ApplicationStore.cs +++ /dev/null @@ -1,41 +0,0 @@ -using Elsa.Identity.Contracts; -using Elsa.Identity.Entities; -using Elsa.Identity.Models; - -namespace Elsa.EntityFrameworkCore.Modules.Identity; - -/// -/// An EF Core implementation of . -/// -public class EFCoreApplicationStore : IApplicationStore -{ - private readonly EntityStore _applicationStore; - - /// - /// Initializes a new instance of . - /// - public EFCoreApplicationStore(EntityStore applicationStore) - { - _applicationStore = applicationStore; - } - - /// - public async Task SaveAsync(Application application, CancellationToken cancellationToken = default) - { - await _applicationStore.SaveAsync(application, cancellationToken); - } - - /// - public async Task DeleteAsync(ApplicationFilter filter, CancellationToken cancellationToken = default) - { - await _applicationStore.DeleteWhereAsync(query => Filter(query, filter), cancellationToken); - } - - /// - public async Task FindAsync(ApplicationFilter filter, CancellationToken cancellationToken = default) - { - return await _applicationStore.FindAsync(query => Filter(query, filter), cancellationToken); - } - - private static IQueryable Filter(IQueryable query, ApplicationFilter filter) => filter.Apply(query); -} \ No newline at end of file diff --git a/src/modules/Elsa.EntityFrameworkCore/Modules/Identity/Configurations.cs b/src/modules/Elsa.EntityFrameworkCore/Modules/Identity/Configurations.cs deleted file mode 100644 index ac15f24e33..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore/Modules/Identity/Configurations.cs +++ /dev/null @@ -1,40 +0,0 @@ -using System.Linq.Expressions; -using Elsa.Identity.Entities; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.ChangeTracking; -using Microsoft.EntityFrameworkCore.Metadata.Builders; - -namespace Elsa.EntityFrameworkCore.Modules.Identity; - -internal class Configurations : IEntityTypeConfiguration, IEntityTypeConfiguration, IEntityTypeConfiguration -{ - private static Expression, string>> StringCollectionToStringConverter => v => string.Join(",", v); - private static Expression>> StringToStringCollectionConverter => v => v.Split(",", StringSplitOptions.RemoveEmptyEntries).ToList(); - - private static readonly ValueComparer> StringCollectionComparer = new( - (c1, c2) => c1!.SequenceEqual(c2!), - c => c.Aggregate(0, (a, v) => HashCode.Combine(a, v.GetHashCode())), - c => c.ToList()); - - public void Configure(EntityTypeBuilder builder) - { - builder.HasIndex(x => x.Name).HasDatabaseName($"IX_{nameof(User)}_{nameof(User.Name)}").IsUnique(); - builder.HasIndex(x => x.TenantId).HasDatabaseName($"IX_{nameof(User)}_{nameof(User.TenantId)}"); - builder.Property(x => x.Roles).HasColumnName("Roles").HasConversion(StringCollectionToStringConverter, StringToStringCollectionConverter).IsRequired().Metadata.SetValueComparer(StringCollectionComparer); - } - - public void Configure(EntityTypeBuilder builder) - { - builder.HasIndex(x => x.ClientId).HasDatabaseName($"IX_{nameof(Application)}_{nameof(Application.ClientId)}").IsUnique(); - builder.HasIndex(x => x.Name).HasDatabaseName($"IX_{nameof(Application)}_{nameof(Application.Name)}").IsUnique(); - builder.HasIndex(x => x.TenantId).HasDatabaseName($"IX_{nameof(Application)}_{nameof(Application.TenantId)}"); - builder.Property(x => x.Roles).HasColumnName("Roles").HasConversion(StringCollectionToStringConverter, StringToStringCollectionConverter).IsRequired().Metadata.SetValueComparer(StringCollectionComparer); - } - - public void Configure(EntityTypeBuilder builder) - { - builder.HasIndex(x => x.Name).HasDatabaseName($"IX_{nameof(Role)}_{nameof(Role.Name)}").IsUnique(); - builder.HasIndex(x => x.TenantId).HasDatabaseName($"IX_{nameof(Role)}_{nameof(Role.TenantId)}"); - builder.Property(x => x.Permissions).HasColumnName("Permissions").HasConversion(StringCollectionToStringConverter, StringToStringCollectionConverter).IsRequired().Metadata.SetValueComparer(StringCollectionComparer); - } -} \ No newline at end of file diff --git a/src/modules/Elsa.EntityFrameworkCore/Modules/Identity/DbContext.cs b/src/modules/Elsa.EntityFrameworkCore/Modules/Identity/DbContext.cs deleted file mode 100644 index 21e5a43fc2..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore/Modules/Identity/DbContext.cs +++ /dev/null @@ -1,41 +0,0 @@ -using Elsa.Identity.Entities; -using Microsoft.EntityFrameworkCore; - -namespace Elsa.EntityFrameworkCore.Modules.Identity; - -/// -/// The database context for the Identity module. -/// -public class IdentityElsaDbContext : ElsaDbContextBase -{ - /// - public IdentityElsaDbContext(DbContextOptions options, IServiceProvider serviceProvider) : base(options, serviceProvider) - { - } - - /// - /// The users. - /// - public DbSet Users { get; set; } = default!; - - /// - /// The applications. - /// - public DbSet Applications { get; set; } = default!; - - /// - /// The roles. - /// - public DbSet Roles { get; set; } = default!; - - /// - protected override void OnModelCreating(ModelBuilder modelBuilder) - { - var config = new Configurations(); - modelBuilder.ApplyConfiguration(config); - modelBuilder.ApplyConfiguration(config); - modelBuilder.ApplyConfiguration(config); - - base.OnModelCreating(modelBuilder); - } -} \ No newline at end of file diff --git a/src/modules/Elsa.EntityFrameworkCore/Modules/Identity/Feature.cs b/src/modules/Elsa.EntityFrameworkCore/Modules/Identity/Feature.cs deleted file mode 100644 index c756dc3a3b..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore/Modules/Identity/Feature.cs +++ /dev/null @@ -1,36 +0,0 @@ -using Elsa.Features.Attributes; -using Elsa.Features.Services; -using Elsa.Identity.Entities; -using Elsa.Identity.Features; -using JetBrains.Annotations; -using Microsoft.Extensions.DependencyInjection; - -namespace Elsa.EntityFrameworkCore.Modules.Identity; - -/// -/// Configures the feature with Entity Framework Core persistence providers. -/// -[DependsOn(typeof(IdentityFeature))] -[PublicAPI] -public class EFCoreIdentityPersistenceFeature(IModule module) : PersistenceFeatureBase(module) -{ - /// - public override void Configure() - { - Module.Configure(feature => - { - feature.UserStore = sp => sp.GetRequiredService(); - feature.ApplicationStore = sp => sp.GetRequiredService(); - feature.RoleStore = sp => sp.GetRequiredService(); - }); - } - - /// - public override void Apply() - { - base.Apply(); - AddEntityStore(); - AddEntityStore(); - AddEntityStore(); - } -} \ No newline at end of file diff --git a/src/modules/Elsa.EntityFrameworkCore/Modules/Identity/IdentityFeatureExtensions.cs b/src/modules/Elsa.EntityFrameworkCore/Modules/Identity/IdentityFeatureExtensions.cs deleted file mode 100644 index 5704267441..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore/Modules/Identity/IdentityFeatureExtensions.cs +++ /dev/null @@ -1,18 +0,0 @@ -using Elsa.Identity.Features; - -namespace Elsa.EntityFrameworkCore.Modules.Identity; - -/// -/// Provides extensions for -/// -public static class IdentityFeatureExtensions -{ - /// - /// Sets up the EF Core persistence provider for the User, Application and Role stores. - /// - public static IdentityFeature UseEntityFrameworkCore(this IdentityFeature feature, Action? configure = default) - { - feature.Module.Configure(configure); - return feature; - } -} \ No newline at end of file diff --git a/src/modules/Elsa.EntityFrameworkCore/Modules/Identity/RoleStore.cs b/src/modules/Elsa.EntityFrameworkCore/Modules/Identity/RoleStore.cs deleted file mode 100644 index 4f5e0d6538..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore/Modules/Identity/RoleStore.cs +++ /dev/null @@ -1,54 +0,0 @@ -using Elsa.Identity.Contracts; -using Elsa.Identity.Entities; -using Elsa.Identity.Models; -using Open.Linq.AsyncExtensions; - -namespace Elsa.EntityFrameworkCore.Modules.Identity; - -/// -/// An EF Core implementation of . -/// -public class EFCoreRoleStore : IRoleStore -{ - private readonly EntityStore _applicationStore; - - /// - /// Initializes a new instance of . - /// - public EFCoreRoleStore(EntityStore applicationStore) - { - _applicationStore = applicationStore; - } - - /// - public async Task SaveAsync(Role application, CancellationToken cancellationToken = default) - { - await _applicationStore.SaveAsync(application, cancellationToken); - } - - /// - public async Task AddAsync(Role role, CancellationToken cancellationToken = default) - { - await _applicationStore.AddAsync(role, cancellationToken); - } - - /// - public async Task DeleteAsync(RoleFilter filter, CancellationToken cancellationToken = default) - { - await _applicationStore.DeleteWhereAsync(query => Filter(query, filter), cancellationToken); - } - - /// - public async Task FindAsync(RoleFilter filter, CancellationToken cancellationToken = default) - { - return await _applicationStore.FindAsync(query => Filter(query, filter), cancellationToken); - } - - /// - public async Task> FindManyAsync(RoleFilter filter, CancellationToken cancellationToken = default) - { - return await _applicationStore.QueryAsync(queryable => Filter(queryable, filter), cancellationToken).ToList(); - } - - private static IQueryable Filter(IQueryable query, RoleFilter filter) => filter.Apply(query); -} \ No newline at end of file diff --git a/src/modules/Elsa.EntityFrameworkCore/Modules/Identity/UserStore.cs b/src/modules/Elsa.EntityFrameworkCore/Modules/Identity/UserStore.cs deleted file mode 100644 index 882599c0e2..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore/Modules/Identity/UserStore.cs +++ /dev/null @@ -1,31 +0,0 @@ -using Elsa.Identity.Contracts; -using Elsa.Identity.Entities; -using Elsa.Identity.Models; - -namespace Elsa.EntityFrameworkCore.Modules.Identity; - -/// -/// An EF Core implementation of . -/// -public class EFCoreUserStore(EntityStore userStore) : IUserStore -{ - /// - public async Task SaveAsync(User user, CancellationToken cancellationToken = default) - { - await userStore.SaveAsync(user, cancellationToken); - } - - /// - public async Task DeleteAsync(UserFilter filter, CancellationToken cancellationToken = default) - { - await userStore.DeleteWhereAsync(query => Filter(query, filter), cancellationToken); - } - - /// - public async Task FindAsync(UserFilter filter, CancellationToken cancellationToken = default) - { - return await userStore.FindAsync(query => Filter(query, filter), cancellationToken); - } - - private static IQueryable Filter(IQueryable query, UserFilter filter) => filter.Apply(query); -} \ No newline at end of file diff --git a/src/modules/Elsa.EntityFrameworkCore/Modules/Labels/Configurations.cs b/src/modules/Elsa.EntityFrameworkCore/Modules/Labels/Configurations.cs deleted file mode 100644 index b20ea10888..0000000000 --- a/src/modules/Elsa.EntityFrameworkCore/Modules/Labels/Configurations.cs +++ /dev/null @@ -1,20 +0,0 @@ -using Elsa.Labels.Entities; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; - -namespace Elsa.EntityFrameworkCore.Modules.Labels; - -public class Configurations : IEntityTypeConfiguration