diff --git a/.drone.yml b/.drone.yml
index ff37f1c1c..a90b4695b 100644
--- a/.drone.yml
+++ b/.drone.yml
@@ -2,11 +2,11 @@
kind: pipeline
name: default
-steps:
- - name: test_pull_request
+steps:
+ - name: build_release
image: docker
commands:
- - docker build -t squidex/squidex:test_pull_request .
+ - docker build -t squidex --build-arg SQUIDEX__VERSION=4.0.0-dev-$${DRONE_BUILD_NUMBER} .
volumes:
- name: docker1
path: /var/run/docker.sock
@@ -14,13 +14,82 @@ steps:
path: /var/lib/docker
when:
event:
+ - push
- pull_request
-
+ branch:
+ - master
+
- name: build_dev
+ image: docker
+ commands:
+ - docker build -t squidex --build-arg SQUIDEX__VERSION=$${DRONE_TAG} .
+ volumes:
+ - name: docker1
+ path: /var/run/docker.sock
+ - name: docker2
+ path: /var/lib/docker
+ when:
+ event:
+ - tag
+
+ - name: test_start
+ image: docker/compose
+ commands:
+ - cd backend/tests
+ - docker-compose up -d
+ volumes:
+ - name: docker1
+ path: /var/run/docker.sock
+ - name: docker2
+ path: /var/lib/docker
+ when:
+ event:
+ - push
+ - pull_request
+ branch:
+ - master
+
+ - name: test_run
+ image: mcr.microsoft.com/dotnet/core/sdk:3.1-buster
+ environment:
+ CONFIG__SERVER__URL: http://localhost:8080
+ CONFIG__WAIT: 60
+ commands:
+ - dotnet test backend/tools/TestSuite/TestSuite.ApiTests/TestSuite.ApiTests.csproj --filter Category!=NotAutomated
+ network_mode: host
+ when:
+ event:
+ - push
+ - pull_request
+ branch:
+ - master
+
+ - name: test_cleanup
+ image: docker/compose
+ commands:
+ - cd backend/tests
+ - docker-compose down
+ volumes:
+ - name: docker1
+ path: /var/run/docker.sock
+ - name: docker2
+ path: /var/lib/docker
+ when:
+ status:
+ - failure
+ - success
+ event:
+ - push
+ - pull_request
+ branch:
+ - master
+
+ - name: push_dev
image: docker
commands:
- docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
- - docker build -t squidex/squidex:dev -t squidex/squidex:dev-$${DRONE_BUILD_NUMBER} --build-arg SQUIDEX__VERSION=4.0.0-dev-$${DRONE_BUILD_NUMBER} .
+ - docker tag sq squidex/squidex:dev
+ - docker tag sq squidex/squidex:dev-$${DRONE_BUILD_NUMBER}
- docker push squidex/squidex:dev
- docker push squidex/squidex:dev-$${DRONE_BUILD_NUMBER}
volumes:
@@ -39,11 +108,12 @@ steps:
branch:
- master
- - name: build_release
+ - name: push_release
image: docker
commands:
- docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
- - docker build -t squidex/squidex:latest -t squidex/squidex:$${DRONE_TAG} --build-arg SQUIDEX__VERSION=$${DRONE_TAG} .
+ - docker tag sq squidex/squidex:latest
+ - docker tag sq squidex/squidex:$${DRONE_TAG}
- docker push squidex/squidex:latest
- docker push squidex/squidex:$${DRONE_TAG}
volumes:
@@ -63,9 +133,8 @@ steps:
- name: build_binaries
image: docker
commands:
- - docker build -t squidex-build-image --build-arg SQUIDEX__VERSION=$${DRONE_TAG} .
- - docker create --name squidex-build-container squidex-build-image
- - docker cp squidex-build-container:/app/. /build
+ - docker create --name squidex-container squidex
+ - docker cp squidex-container:/app/. /build
volumes:
- name: build
path: /build
@@ -104,21 +173,10 @@ steps:
event:
- tag
- - name: slack
- image: plugins/slack
- settings:
- webhook:
- from_secret: slack_webhook
- when:
- status:
- - failure
- - success
-
- - name: cleanup-build
+ - name: binaries_cleanup
image: docker
commands:
- - docker rm squidex-build-container
- - docker rmi squidex-build-image
+ - docker rm squidex-container
volumes:
- name: docker1
path: /var/run/docker.sock
@@ -130,6 +188,16 @@ steps:
- success
event:
- tag
+
+ - name: slack
+ image: plugins/slack
+ settings:
+ webhook:
+ from_secret: slack_webhook
+ when:
+ status:
+ - failure
+ - success
volumes:
- name: build
diff --git a/Dockerfile b/Dockerfile
index deb5e3f73..cbcaac61c 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -8,24 +8,29 @@ ARG SQUIDEX__VERSION=4.0.0
WORKDIR /src
# Copy nuget project files.
-COPY backend/**/**/*.csproj /tmp/
-# Copy nuget.config for package sources.
-COPY backend/NuGet.Config /tmp/
+COPY backend/*.sln backend/NuGet.Config ./
-# Install nuget packages
-RUN bash -c 'pushd /tmp; for p in *.csproj; do dotnet restore $p --verbosity quiet; true; done; popd'
+# Copy the main source project files
+COPY backend/src/*/*.csproj ./
+RUN for file in $(ls *.csproj); do mkdir -p src/${file%.*}/ && mv $file src/${file%.*}/; done
+
+# Copy the test project files
+COPY backend/tests/*/*.csproj ./
+RUN for file in $(ls *.csproj); do mkdir -p tests/${file%.*}/ && mv $file tests/${file%.*}/; done
+
+# Copy the extension project files
+COPY backend/extensions/*/*.csproj ./
+RUN for file in $(ls *.csproj); do mkdir -p extensions/${file%.*}/ && mv $file extensions/${file%.*}/; done
+
+RUN dotnet restore
COPY backend .
# Test Backend
-RUN dotnet test tests/Squidex.Infrastructure.Tests/Squidex.Infrastructure.Tests.csproj --filter Category!=Dependencies \
- && dotnet test tests/Squidex.Domain.Apps.Core.Tests/Squidex.Domain.Apps.Core.Tests.csproj --filter Category!=Dependencies \
- && dotnet test tests/Squidex.Domain.Apps.Entities.Tests/Squidex.Domain.Apps.Entities.Tests.csproj --filter Category!=Dependencies \
- && dotnet test tests/Squidex.Domain.Users.Tests/Squidex.Domain.Users.Tests.csproj --filter Category!=Dependencies \
- && dotnet test tests/Squidex.Web.Tests/Squidex.Web.Tests.csproj --filter Category!=Dependencies
+RUN dotnet test --no-restore --filter Category!=Dependencies
# Publish
-RUN dotnet publish src/Squidex/Squidex.csproj --output /build/ --configuration Release -p:version=$SQUIDEX__VERSION
+RUN dotnet publish --no-restore src/Squidex/Squidex.csproj --output /build/ --configuration Release -p:version=$SQUIDEX__VERSION
#
diff --git a/backend/Squidex.sln b/backend/Squidex.sln
index 272b5a13f..874783716 100644
--- a/backend/Squidex.sln
+++ b/backend/Squidex.sln
@@ -24,8 +24,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Squidex.Infrastructure.Goog
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tools", "tools", "{94207AA6-4923-4183-A558-E0F8196B8CA3}"
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Migrate_00", "tools\Migrate_00\Migrate_00.csproj", "{B51126A8-0D75-4A79-867D-10724EC6AC84}"
-EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Squidex.Shared", "src\Squidex.Shared\Squidex.Shared.csproj", "{5E75AB7D-6F01-4313-AFF1-7F7128FFD71F}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Squidex.Domain.Users", "src\Squidex.Domain.Users\Squidex.Domain.Users.csproj", "{F7771E22-47BD-45C4-A133-FD7F1DE27CA0}"
@@ -53,8 +51,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Squidex.Domain.Apps.Entitie
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Squidex.Domain.Apps.Entities.MongoDb", "src\Squidex.Domain.Apps.Entities.MongoDb\Squidex.Domain.Apps.Entities.MongoDb.csproj", "{7DA5B308-D950-4496-93D5-21D6C4D91644}"
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Migrate_01", "tools\Migrate_01\Migrate_01.csproj", "{A4823E14-C0E5-4A4D-B28F-27424C25C3C7}"
-EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Squidex.Web.Tests", "tests\Squidex.Web.Tests\Squidex.Web.Tests.csproj", "{7E8CC864-4C6E-496F-A672-9F9AD8874835}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "extensions", "extensions", "{FB8BC3A2-2010-4C3C-A87D-D4A98C05EE52}"
@@ -67,7 +63,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Squidex.Web", "src\Squidex.
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Squidex.Infrastructure.Amazon", "src\Squidex.Infrastructure.Amazon\Squidex.Infrastructure.Amazon.csproj", "{32DA4B56-7EFA-4E34-A29D-30E00579A894}"
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Benchmarks", "tools\Benchmarks\Benchmarks.csproj", "{F36EF843-BDDD-45A8-B9C6-360001161AAA}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Migrations", "src\Migrations\Migrations.csproj", "{23615A39-F3FB-4575-A91C-535899DFB636}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -151,18 +147,6 @@ Global
{945871B1-77B8-43FB-B53C-27CF385AB756}.Release|x64.Build.0 = Release|Any CPU
{945871B1-77B8-43FB-B53C-27CF385AB756}.Release|x86.ActiveCfg = Release|Any CPU
{945871B1-77B8-43FB-B53C-27CF385AB756}.Release|x86.Build.0 = Release|Any CPU
- {B51126A8-0D75-4A79-867D-10724EC6AC84}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {B51126A8-0D75-4A79-867D-10724EC6AC84}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {B51126A8-0D75-4A79-867D-10724EC6AC84}.Debug|x64.ActiveCfg = Debug|Any CPU
- {B51126A8-0D75-4A79-867D-10724EC6AC84}.Debug|x64.Build.0 = Debug|Any CPU
- {B51126A8-0D75-4A79-867D-10724EC6AC84}.Debug|x86.ActiveCfg = Debug|Any CPU
- {B51126A8-0D75-4A79-867D-10724EC6AC84}.Debug|x86.Build.0 = Debug|Any CPU
- {B51126A8-0D75-4A79-867D-10724EC6AC84}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {B51126A8-0D75-4A79-867D-10724EC6AC84}.Release|Any CPU.Build.0 = Release|Any CPU
- {B51126A8-0D75-4A79-867D-10724EC6AC84}.Release|x64.ActiveCfg = Release|Any CPU
- {B51126A8-0D75-4A79-867D-10724EC6AC84}.Release|x64.Build.0 = Release|Any CPU
- {B51126A8-0D75-4A79-867D-10724EC6AC84}.Release|x86.ActiveCfg = Release|Any CPU
- {B51126A8-0D75-4A79-867D-10724EC6AC84}.Release|x86.Build.0 = Release|Any CPU
{5E75AB7D-6F01-4313-AFF1-7F7128FFD71F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5E75AB7D-6F01-4313-AFF1-7F7128FFD71F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5E75AB7D-6F01-4313-AFF1-7F7128FFD71F}.Debug|x64.ActiveCfg = Debug|Any CPU
@@ -295,18 +279,6 @@ Global
{7DA5B308-D950-4496-93D5-21D6C4D91644}.Release|x64.Build.0 = Release|Any CPU
{7DA5B308-D950-4496-93D5-21D6C4D91644}.Release|x86.ActiveCfg = Release|Any CPU
{7DA5B308-D950-4496-93D5-21D6C4D91644}.Release|x86.Build.0 = Release|Any CPU
- {A4823E14-C0E5-4A4D-B28F-27424C25C3C7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {A4823E14-C0E5-4A4D-B28F-27424C25C3C7}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {A4823E14-C0E5-4A4D-B28F-27424C25C3C7}.Debug|x64.ActiveCfg = Debug|Any CPU
- {A4823E14-C0E5-4A4D-B28F-27424C25C3C7}.Debug|x64.Build.0 = Debug|Any CPU
- {A4823E14-C0E5-4A4D-B28F-27424C25C3C7}.Debug|x86.ActiveCfg = Debug|Any CPU
- {A4823E14-C0E5-4A4D-B28F-27424C25C3C7}.Debug|x86.Build.0 = Debug|Any CPU
- {A4823E14-C0E5-4A4D-B28F-27424C25C3C7}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {A4823E14-C0E5-4A4D-B28F-27424C25C3C7}.Release|Any CPU.Build.0 = Release|Any CPU
- {A4823E14-C0E5-4A4D-B28F-27424C25C3C7}.Release|x64.ActiveCfg = Release|Any CPU
- {A4823E14-C0E5-4A4D-B28F-27424C25C3C7}.Release|x64.Build.0 = Release|Any CPU
- {A4823E14-C0E5-4A4D-B28F-27424C25C3C7}.Release|x86.ActiveCfg = Release|Any CPU
- {A4823E14-C0E5-4A4D-B28F-27424C25C3C7}.Release|x86.Build.0 = Release|Any CPU
{7E8CC864-4C6E-496F-A672-9F9AD8874835}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7E8CC864-4C6E-496F-A672-9F9AD8874835}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7E8CC864-4C6E-496F-A672-9F9AD8874835}.Debug|x64.ActiveCfg = Debug|Any CPU
@@ -355,18 +327,18 @@ Global
{32DA4B56-7EFA-4E34-A29D-30E00579A894}.Release|x64.Build.0 = Release|Any CPU
{32DA4B56-7EFA-4E34-A29D-30E00579A894}.Release|x86.ActiveCfg = Release|Any CPU
{32DA4B56-7EFA-4E34-A29D-30E00579A894}.Release|x86.Build.0 = Release|Any CPU
- {F36EF843-BDDD-45A8-B9C6-360001161AAA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {F36EF843-BDDD-45A8-B9C6-360001161AAA}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {F36EF843-BDDD-45A8-B9C6-360001161AAA}.Debug|x64.ActiveCfg = Debug|Any CPU
- {F36EF843-BDDD-45A8-B9C6-360001161AAA}.Debug|x64.Build.0 = Debug|Any CPU
- {F36EF843-BDDD-45A8-B9C6-360001161AAA}.Debug|x86.ActiveCfg = Debug|Any CPU
- {F36EF843-BDDD-45A8-B9C6-360001161AAA}.Debug|x86.Build.0 = Debug|Any CPU
- {F36EF843-BDDD-45A8-B9C6-360001161AAA}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {F36EF843-BDDD-45A8-B9C6-360001161AAA}.Release|Any CPU.Build.0 = Release|Any CPU
- {F36EF843-BDDD-45A8-B9C6-360001161AAA}.Release|x64.ActiveCfg = Release|Any CPU
- {F36EF843-BDDD-45A8-B9C6-360001161AAA}.Release|x64.Build.0 = Release|Any CPU
- {F36EF843-BDDD-45A8-B9C6-360001161AAA}.Release|x86.ActiveCfg = Release|Any CPU
- {F36EF843-BDDD-45A8-B9C6-360001161AAA}.Release|x86.Build.0 = Release|Any CPU
+ {23615A39-F3FB-4575-A91C-535899DFB636}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {23615A39-F3FB-4575-A91C-535899DFB636}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {23615A39-F3FB-4575-A91C-535899DFB636}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {23615A39-F3FB-4575-A91C-535899DFB636}.Debug|x64.Build.0 = Debug|Any CPU
+ {23615A39-F3FB-4575-A91C-535899DFB636}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {23615A39-F3FB-4575-A91C-535899DFB636}.Debug|x86.Build.0 = Debug|Any CPU
+ {23615A39-F3FB-4575-A91C-535899DFB636}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {23615A39-F3FB-4575-A91C-535899DFB636}.Release|Any CPU.Build.0 = Release|Any CPU
+ {23615A39-F3FB-4575-A91C-535899DFB636}.Release|x64.ActiveCfg = Release|Any CPU
+ {23615A39-F3FB-4575-A91C-535899DFB636}.Release|x64.Build.0 = Release|Any CPU
+ {23615A39-F3FB-4575-A91C-535899DFB636}.Release|x86.ActiveCfg = Release|Any CPU
+ {23615A39-F3FB-4575-A91C-535899DFB636}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -379,7 +351,6 @@ Global
{6A811927-3C37-430A-90F4-503E37123956} = {8CF53B92-5EB1-461D-98F8-70DA9B603FBF}
{C1E5BBB6-6B6A-4DE5-B19D-0538304DE343} = {8CF53B92-5EB1-461D-98F8-70DA9B603FBF}
{945871B1-77B8-43FB-B53C-27CF385AB756} = {8CF53B92-5EB1-461D-98F8-70DA9B603FBF}
- {B51126A8-0D75-4A79-867D-10724EC6AC84} = {94207AA6-4923-4183-A558-E0F8196B8CA3}
{5E75AB7D-6F01-4313-AFF1-7F7128FFD71F} = {7EDE8CF1-B1E4-4005-B154-834B944E0D7A}
{F7771E22-47BD-45C4-A133-FD7F1DE27CA0} = {7EDE8CF1-B1E4-4005-B154-834B944E0D7A}
{27CF800D-890F-4882-BF05-44EC3233537D} = {7EDE8CF1-B1E4-4005-B154-834B944E0D7A}
@@ -391,12 +362,11 @@ Global
{79FEF326-CA5E-4698-B2BA-C16A4580B4D5} = {4C6B06C2-6D77-4E0E-AE32-D7050236433A}
{AA003372-CD8D-4DBC-962C-F61E0C93CF05} = {4C6B06C2-6D77-4E0E-AE32-D7050236433A}
{7DA5B308-D950-4496-93D5-21D6C4D91644} = {4C6B06C2-6D77-4E0E-AE32-D7050236433A}
- {A4823E14-C0E5-4A4D-B28F-27424C25C3C7} = {94207AA6-4923-4183-A558-E0F8196B8CA3}
{7E8CC864-4C6E-496F-A672-9F9AD8874835} = {7EDE8CF1-B1E4-4005-B154-834B944E0D7A}
{F3C41B82-6A67-409A-B7FE-54543EE4F38B} = {FB8BC3A2-2010-4C3C-A87D-D4A98C05EE52}
{5B2D251F-46E3-486A-AE16-E3FE06B559ED} = {7EDE8CF1-B1E4-4005-B154-834B944E0D7A}
{32DA4B56-7EFA-4E34-A29D-30E00579A894} = {8CF53B92-5EB1-461D-98F8-70DA9B603FBF}
- {F36EF843-BDDD-45A8-B9C6-360001161AAA} = {94207AA6-4923-4183-A558-E0F8196B8CA3}
+ {23615A39-F3FB-4575-A91C-535899DFB636} = {94207AA6-4923-4183-A558-E0F8196B8CA3}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {02F2E872-3141-44F5-BD6A-33CD84E9FE08}
diff --git a/backend/extensions/Squidex.Extensions/Actions/Webhook/WebhookAction.cs b/backend/extensions/Squidex.Extensions/Actions/Webhook/WebhookAction.cs
index 7faab9e32..37a3437df 100644
--- a/backend/extensions/Squidex.Extensions/Actions/Webhook/WebhookAction.cs
+++ b/backend/extensions/Squidex.Extensions/Actions/Webhook/WebhookAction.cs
@@ -31,7 +31,7 @@ namespace Squidex.Extensions.Actions.Webhook
[DataType(DataType.Text)]
public string SharedSecret { get; set; }
- [Display(Name = "Payload (Optional)", Description = "Leave it empty to use the full event as payload.")]
+ [Display(Name = "Payload (Optional)", Description = "Leave it empty to use the full event as body.")]
[DataType(DataType.MultilineText)]
[Formattable]
public string Payload { get; set; }
diff --git a/backend/tools/Migrate_01/MigrationPath.cs b/backend/src/Migrations/MigrationPath.cs
similarity index 98%
rename from backend/tools/Migrate_01/MigrationPath.cs
rename to backend/src/Migrations/MigrationPath.cs
index c062df194..03950a6d2 100644
--- a/backend/tools/Migrate_01/MigrationPath.cs
+++ b/backend/src/Migrations/MigrationPath.cs
@@ -9,12 +9,12 @@ using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Extensions.DependencyInjection;
-using Migrate_01.Migrations;
-using Migrate_01.Migrations.MongoDb;
+using Migrations.Migrations;
+using Migrations.Migrations.MongoDb;
using Squidex.Infrastructure;
using Squidex.Infrastructure.Migrations;
-namespace Migrate_01
+namespace Migrations
{
public sealed class MigrationPath : IMigrationPath
{
diff --git a/backend/src/Migrations/Migrations.csproj b/backend/src/Migrations/Migrations.csproj
new file mode 100644
index 000000000..0d8295f08
--- /dev/null
+++ b/backend/src/Migrations/Migrations.csproj
@@ -0,0 +1,25 @@
+
+
+ netcoreapp3.1
+ 8.0
+ enable
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ..\..\Squidex.ruleset
+
+
+
+
+
diff --git a/backend/tools/Migrate_01/Migrations/AddPatterns.cs b/backend/src/Migrations/Migrations/AddPatterns.cs
similarity index 98%
rename from backend/tools/Migrate_01/Migrations/AddPatterns.cs
rename to backend/src/Migrations/Migrations/AddPatterns.cs
index f3f087a9c..df55f092e 100644
--- a/backend/tools/Migrate_01/Migrations/AddPatterns.cs
+++ b/backend/src/Migrations/Migrations/AddPatterns.cs
@@ -13,7 +13,7 @@ using Squidex.Domain.Apps.Entities.Apps.Indexes;
using Squidex.Infrastructure.Commands;
using Squidex.Infrastructure.Migrations;
-namespace Migrate_01.Migrations
+namespace Migrations.Migrations
{
public sealed class AddPatterns : IMigration
{
diff --git a/backend/tools/Migrate_01/Migrations/ClearSchemas.cs b/backend/src/Migrations/Migrations/ClearSchemas.cs
similarity index 96%
rename from backend/tools/Migrate_01/Migrations/ClearSchemas.cs
rename to backend/src/Migrations/Migrations/ClearSchemas.cs
index 81c977a76..302f8793c 100644
--- a/backend/tools/Migrate_01/Migrations/ClearSchemas.cs
+++ b/backend/src/Migrations/Migrations/ClearSchemas.cs
@@ -11,7 +11,7 @@ using Squidex.Domain.Apps.Entities.Schemas.State;
using Squidex.Infrastructure.Migrations;
using Squidex.Infrastructure.States;
-namespace Migrate_01.Migrations
+namespace Migrations.Migrations
{
public sealed class ClearSchemas : IMigration
{
diff --git a/backend/tools/Migrate_01/Migrations/ConvertEventStore.cs b/backend/src/Migrations/Migrations/ConvertEventStore.cs
similarity index 98%
rename from backend/tools/Migrate_01/Migrations/ConvertEventStore.cs
rename to backend/src/Migrations/Migrations/ConvertEventStore.cs
index 990431f37..26b291617 100644
--- a/backend/tools/Migrate_01/Migrations/ConvertEventStore.cs
+++ b/backend/src/Migrations/Migrations/ConvertEventStore.cs
@@ -13,7 +13,7 @@ using Newtonsoft.Json.Linq;
using Squidex.Infrastructure.EventSourcing;
using Squidex.Infrastructure.Migrations;
-namespace Migrate_01.Migrations
+namespace Migrations.Migrations
{
public sealed class ConvertEventStore : IMigration
{
diff --git a/backend/tools/Migrate_01/Migrations/ConvertEventStoreAppId.cs b/backend/src/Migrations/Migrations/ConvertEventStoreAppId.cs
similarity index 99%
rename from backend/tools/Migrate_01/Migrations/ConvertEventStoreAppId.cs
rename to backend/src/Migrations/Migrations/ConvertEventStoreAppId.cs
index 3a0271125..ed0f465f4 100644
--- a/backend/tools/Migrate_01/Migrations/ConvertEventStoreAppId.cs
+++ b/backend/src/Migrations/Migrations/ConvertEventStoreAppId.cs
@@ -16,7 +16,7 @@ using Squidex.Infrastructure;
using Squidex.Infrastructure.EventSourcing;
using Squidex.Infrastructure.Migrations;
-namespace Migrate_01.Migrations
+namespace Migrations.Migrations
{
public sealed class ConvertEventStoreAppId : IMigration
{
diff --git a/backend/tools/Migrate_01/Migrations/CreateAssetSlugs.cs b/backend/src/Migrations/Migrations/CreateAssetSlugs.cs
similarity index 97%
rename from backend/tools/Migrate_01/Migrations/CreateAssetSlugs.cs
rename to backend/src/Migrations/Migrations/CreateAssetSlugs.cs
index cf85cc195..419f5bb12 100644
--- a/backend/tools/Migrate_01/Migrations/CreateAssetSlugs.cs
+++ b/backend/src/Migrations/Migrations/CreateAssetSlugs.cs
@@ -12,7 +12,7 @@ using Squidex.Domain.Apps.Entities.Assets.State;
using Squidex.Infrastructure.Migrations;
using Squidex.Infrastructure.States;
-namespace Migrate_01.Migrations
+namespace Migrations.Migrations
{
public sealed class CreateAssetSlugs : IMigration
{
diff --git a/backend/tools/Migrate_01/Migrations/MongoDb/ConvertOldSnapshotStores.cs b/backend/src/Migrations/Migrations/MongoDb/ConvertOldSnapshotStores.cs
similarity index 97%
rename from backend/tools/Migrate_01/Migrations/MongoDb/ConvertOldSnapshotStores.cs
rename to backend/src/Migrations/Migrations/MongoDb/ConvertOldSnapshotStores.cs
index fac1c06a4..6bfd8cc61 100644
--- a/backend/tools/Migrate_01/Migrations/MongoDb/ConvertOldSnapshotStores.cs
+++ b/backend/src/Migrations/Migrations/MongoDb/ConvertOldSnapshotStores.cs
@@ -11,7 +11,7 @@ using MongoDB.Bson;
using MongoDB.Driver;
using Squidex.Infrastructure.Migrations;
-namespace Migrate_01.Migrations.MongoDb
+namespace Migrations.Migrations.MongoDb
{
public sealed class ConvertOldSnapshotStores : IMigration
{
diff --git a/backend/tools/Migrate_01/Migrations/MongoDb/ConvertRuleEventsJson.cs b/backend/src/Migrations/Migrations/MongoDb/ConvertRuleEventsJson.cs
similarity index 97%
rename from backend/tools/Migrate_01/Migrations/MongoDb/ConvertRuleEventsJson.cs
rename to backend/src/Migrations/Migrations/MongoDb/ConvertRuleEventsJson.cs
index 220e01942..fe69573e9 100644
--- a/backend/tools/Migrate_01/Migrations/MongoDb/ConvertRuleEventsJson.cs
+++ b/backend/src/Migrations/Migrations/MongoDb/ConvertRuleEventsJson.cs
@@ -10,7 +10,7 @@ using MongoDB.Bson;
using MongoDB.Driver;
using Squidex.Infrastructure.Migrations;
-namespace Migrate_01.Migrations.MongoDb
+namespace Migrations.Migrations.MongoDb
{
public sealed class ConvertRuleEventsJson : IMigration
{
diff --git a/backend/tools/Migrate_01/Migrations/MongoDb/DeleteContentCollections.cs b/backend/src/Migrations/Migrations/MongoDb/DeleteContentCollections.cs
similarity index 96%
rename from backend/tools/Migrate_01/Migrations/MongoDb/DeleteContentCollections.cs
rename to backend/src/Migrations/Migrations/MongoDb/DeleteContentCollections.cs
index cafa08eac..73b30dbfe 100644
--- a/backend/tools/Migrate_01/Migrations/MongoDb/DeleteContentCollections.cs
+++ b/backend/src/Migrations/Migrations/MongoDb/DeleteContentCollections.cs
@@ -9,7 +9,7 @@ using System.Threading.Tasks;
using MongoDB.Driver;
using Squidex.Infrastructure.Migrations;
-namespace Migrate_01.Migrations.MongoDb
+namespace Migrations.Migrations.MongoDb
{
public sealed class DeleteContentCollections : IMigration
{
diff --git a/backend/tools/Migrate_01/Migrations/MongoDb/RenameAssetMetadata.cs b/backend/src/Migrations/Migrations/MongoDb/RenameAssetMetadata.cs
similarity index 98%
rename from backend/tools/Migrate_01/Migrations/MongoDb/RenameAssetMetadata.cs
rename to backend/src/Migrations/Migrations/MongoDb/RenameAssetMetadata.cs
index 3711f0716..ab8bdb1b2 100644
--- a/backend/tools/Migrate_01/Migrations/MongoDb/RenameAssetMetadata.cs
+++ b/backend/src/Migrations/Migrations/MongoDb/RenameAssetMetadata.cs
@@ -10,7 +10,7 @@ using MongoDB.Bson;
using MongoDB.Driver;
using Squidex.Infrastructure.Migrations;
-namespace Migrate_01.Migrations.MongoDb
+namespace Migrations.Migrations.MongoDb
{
public sealed class RenameAssetMetadata : IMigration
{
diff --git a/backend/tools/Migrate_01/Migrations/MongoDb/RenameAssetSlugField.cs b/backend/src/Migrations/Migrations/MongoDb/RenameAssetSlugField.cs
similarity index 96%
rename from backend/tools/Migrate_01/Migrations/MongoDb/RenameAssetSlugField.cs
rename to backend/src/Migrations/Migrations/MongoDb/RenameAssetSlugField.cs
index 1fcfad042..1fb1d8916 100644
--- a/backend/tools/Migrate_01/Migrations/MongoDb/RenameAssetSlugField.cs
+++ b/backend/src/Migrations/Migrations/MongoDb/RenameAssetSlugField.cs
@@ -10,7 +10,7 @@ using MongoDB.Bson;
using MongoDB.Driver;
using Squidex.Infrastructure.Migrations;
-namespace Migrate_01.Migrations.MongoDb
+namespace Migrations.Migrations.MongoDb
{
public sealed class RenameAssetSlugField : IMigration
{
diff --git a/backend/tools/Migrate_01/Migrations/MongoDb/RestructureContentCollection.cs b/backend/src/Migrations/Migrations/MongoDb/RestructureContentCollection.cs
similarity index 97%
rename from backend/tools/Migrate_01/Migrations/MongoDb/RestructureContentCollection.cs
rename to backend/src/Migrations/Migrations/MongoDb/RestructureContentCollection.cs
index ea5511052..8bef57f48 100644
--- a/backend/tools/Migrate_01/Migrations/MongoDb/RestructureContentCollection.cs
+++ b/backend/src/Migrations/Migrations/MongoDb/RestructureContentCollection.cs
@@ -11,7 +11,7 @@ using MongoDB.Driver;
using Squidex.Infrastructure.Migrations;
using Squidex.Infrastructure.MongoDb;
-namespace Migrate_01.Migrations.MongoDb
+namespace Migrations.Migrations.MongoDb
{
public sealed class RestructureContentCollection : IMigration
{
diff --git a/backend/tools/Migrate_01/Migrations/PopulateGrainIndexes.cs b/backend/src/Migrations/Migrations/PopulateGrainIndexes.cs
similarity index 99%
rename from backend/tools/Migrate_01/Migrations/PopulateGrainIndexes.cs
rename to backend/src/Migrations/Migrations/PopulateGrainIndexes.cs
index 19ec93f73..13fffb0c7 100644
--- a/backend/tools/Migrate_01/Migrations/PopulateGrainIndexes.cs
+++ b/backend/src/Migrations/Migrations/PopulateGrainIndexes.cs
@@ -19,7 +19,7 @@ using Squidex.Infrastructure;
using Squidex.Infrastructure.EventSourcing;
using Squidex.Infrastructure.Migrations;
-namespace Migrate_01.Migrations
+namespace Migrations.Migrations
{
public class PopulateGrainIndexes : IMigration
{
diff --git a/backend/tools/Migrate_01/Migrations/RebuildApps.cs b/backend/src/Migrations/Migrations/RebuildApps.cs
similarity index 96%
rename from backend/tools/Migrate_01/Migrations/RebuildApps.cs
rename to backend/src/Migrations/Migrations/RebuildApps.cs
index 2dffb5852..d7c16de5a 100644
--- a/backend/tools/Migrate_01/Migrations/RebuildApps.cs
+++ b/backend/src/Migrations/Migrations/RebuildApps.cs
@@ -9,7 +9,7 @@ using System.Threading.Tasks;
using Squidex.Infrastructure.Commands;
using Squidex.Infrastructure.Migrations;
-namespace Migrate_01.Migrations
+namespace Migrations.Migrations
{
public sealed class RebuildApps : IMigration
{
diff --git a/backend/tools/Migrate_01/Migrations/RebuildAssets.cs b/backend/src/Migrations/Migrations/RebuildAssets.cs
similarity index 96%
rename from backend/tools/Migrate_01/Migrations/RebuildAssets.cs
rename to backend/src/Migrations/Migrations/RebuildAssets.cs
index 045825b73..dec067418 100644
--- a/backend/tools/Migrate_01/Migrations/RebuildAssets.cs
+++ b/backend/src/Migrations/Migrations/RebuildAssets.cs
@@ -9,7 +9,7 @@ using System.Threading.Tasks;
using Squidex.Infrastructure.Commands;
using Squidex.Infrastructure.Migrations;
-namespace Migrate_01.Migrations
+namespace Migrations.Migrations
{
public sealed class RebuildAssets : IMigration
{
diff --git a/backend/tools/Migrate_01/Migrations/RebuildContents.cs b/backend/src/Migrations/Migrations/RebuildContents.cs
similarity index 96%
rename from backend/tools/Migrate_01/Migrations/RebuildContents.cs
rename to backend/src/Migrations/Migrations/RebuildContents.cs
index e0912931d..bd75fa805 100644
--- a/backend/tools/Migrate_01/Migrations/RebuildContents.cs
+++ b/backend/src/Migrations/Migrations/RebuildContents.cs
@@ -9,7 +9,7 @@ using System.Threading.Tasks;
using Squidex.Infrastructure.Commands;
using Squidex.Infrastructure.Migrations;
-namespace Migrate_01.Migrations
+namespace Migrations.Migrations
{
public sealed class RebuildContents : IMigration
{
diff --git a/backend/tools/Migrate_01/Migrations/RebuildSnapshots.cs b/backend/src/Migrations/Migrations/RebuildSnapshots.cs
similarity index 97%
rename from backend/tools/Migrate_01/Migrations/RebuildSnapshots.cs
rename to backend/src/Migrations/Migrations/RebuildSnapshots.cs
index 5e873d2f2..548e446f2 100644
--- a/backend/tools/Migrate_01/Migrations/RebuildSnapshots.cs
+++ b/backend/src/Migrations/Migrations/RebuildSnapshots.cs
@@ -9,7 +9,7 @@ using System.Threading.Tasks;
using Squidex.Infrastructure.Commands;
using Squidex.Infrastructure.Migrations;
-namespace Migrate_01.Migrations
+namespace Migrations.Migrations
{
public sealed class RebuildSnapshots : IMigration
{
diff --git a/backend/tools/Migrate_01/Migrations/StartEventConsumers.cs b/backend/src/Migrations/Migrations/StartEventConsumers.cs
similarity index 96%
rename from backend/tools/Migrate_01/Migrations/StartEventConsumers.cs
rename to backend/src/Migrations/Migrations/StartEventConsumers.cs
index e65f2f42a..96c6b3a1b 100644
--- a/backend/tools/Migrate_01/Migrations/StartEventConsumers.cs
+++ b/backend/src/Migrations/Migrations/StartEventConsumers.cs
@@ -11,7 +11,7 @@ using Squidex.Infrastructure.EventSourcing.Grains;
using Squidex.Infrastructure.Migrations;
using Squidex.Infrastructure.Orleans;
-namespace Migrate_01.Migrations
+namespace Migrations.Migrations
{
public sealed class StartEventConsumers : IMigration
{
diff --git a/backend/tools/Migrate_01/Migrations/StopEventConsumers.cs b/backend/src/Migrations/Migrations/StopEventConsumers.cs
similarity index 96%
rename from backend/tools/Migrate_01/Migrations/StopEventConsumers.cs
rename to backend/src/Migrations/Migrations/StopEventConsumers.cs
index 74e45072e..9de6378e1 100644
--- a/backend/tools/Migrate_01/Migrations/StopEventConsumers.cs
+++ b/backend/src/Migrations/Migrations/StopEventConsumers.cs
@@ -11,7 +11,7 @@ using Squidex.Infrastructure.EventSourcing.Grains;
using Squidex.Infrastructure.Migrations;
using Squidex.Infrastructure.Orleans;
-namespace Migrate_01.Migrations
+namespace Migrations.Migrations
{
public sealed class StopEventConsumers : IMigration
{
diff --git a/backend/tools/Migrate_01/OldEvents/AppClientChanged.cs b/backend/src/Migrations/OldEvents/AppClientChanged.cs
similarity index 97%
rename from backend/tools/Migrate_01/OldEvents/AppClientChanged.cs
rename to backend/src/Migrations/OldEvents/AppClientChanged.cs
index fd7fc6613..1ec198d3b 100644
--- a/backend/tools/Migrate_01/OldEvents/AppClientChanged.cs
+++ b/backend/src/Migrations/OldEvents/AppClientChanged.cs
@@ -11,7 +11,7 @@ using Squidex.Infrastructure.EventSourcing;
using Squidex.Infrastructure.Migrations;
using Squidex.Infrastructure.Reflection;
-namespace Migrate_01.OldEvents
+namespace Migrations.OldEvents
{
[EventType(nameof(AppClientChanged))]
[Obsolete]
diff --git a/backend/tools/Migrate_01/OldEvents/AppClientPermission.cs b/backend/src/Migrations/OldEvents/AppClientPermission.cs
similarity index 94%
rename from backend/tools/Migrate_01/OldEvents/AppClientPermission.cs
rename to backend/src/Migrations/OldEvents/AppClientPermission.cs
index 4e22ca94d..a9ac65032 100644
--- a/backend/tools/Migrate_01/OldEvents/AppClientPermission.cs
+++ b/backend/src/Migrations/OldEvents/AppClientPermission.cs
@@ -7,7 +7,7 @@
using System;
-namespace Migrate_01.OldEvents
+namespace Migrations.OldEvents
{
[Obsolete]
public enum AppClientPermission
diff --git a/backend/tools/Migrate_01/OldEvents/AppClientUpdated.cs b/backend/src/Migrations/OldEvents/AppClientUpdated.cs
similarity index 97%
rename from backend/tools/Migrate_01/OldEvents/AppClientUpdated.cs
rename to backend/src/Migrations/OldEvents/AppClientUpdated.cs
index 64e6f5281..1d1685b1f 100644
--- a/backend/tools/Migrate_01/OldEvents/AppClientUpdated.cs
+++ b/backend/src/Migrations/OldEvents/AppClientUpdated.cs
@@ -13,7 +13,7 @@ using Squidex.Infrastructure.Migrations;
using Squidex.Infrastructure.Reflection;
using AppClientUpdatedV2 = Squidex.Domain.Apps.Events.Apps.AppClientUpdated;
-namespace Migrate_01.OldEvents
+namespace Migrations.OldEvents
{
[EventType(nameof(AppClientUpdated))]
[Obsolete]
diff --git a/backend/tools/Migrate_01/OldEvents/AppContributorAssigned.cs b/backend/src/Migrations/OldEvents/AppContributorAssigned.cs
similarity index 98%
rename from backend/tools/Migrate_01/OldEvents/AppContributorAssigned.cs
rename to backend/src/Migrations/OldEvents/AppContributorAssigned.cs
index 2e91a2e02..6bb92bc5c 100644
--- a/backend/tools/Migrate_01/OldEvents/AppContributorAssigned.cs
+++ b/backend/src/Migrations/OldEvents/AppContributorAssigned.cs
@@ -13,7 +13,7 @@ using Squidex.Infrastructure.Migrations;
using Squidex.Infrastructure.Reflection;
using AppContributorAssignedV2 = Squidex.Domain.Apps.Events.Apps.AppContributorAssigned;
-namespace Migrate_01.OldEvents
+namespace Migrations.OldEvents
{
[EventType(nameof(AppContributorAssigned))]
[Obsolete]
diff --git a/backend/tools/Migrate_01/OldEvents/AppContributorPermission.cs b/backend/src/Migrations/OldEvents/AppContributorPermission.cs
similarity index 94%
rename from backend/tools/Migrate_01/OldEvents/AppContributorPermission.cs
rename to backend/src/Migrations/OldEvents/AppContributorPermission.cs
index 0135058d7..c46a5b53f 100644
--- a/backend/tools/Migrate_01/OldEvents/AppContributorPermission.cs
+++ b/backend/src/Migrations/OldEvents/AppContributorPermission.cs
@@ -7,7 +7,7 @@
using System;
-namespace Migrate_01.OldEvents
+namespace Migrations.OldEvents
{
[Obsolete]
public enum AppContributorPermission
diff --git a/backend/tools/Migrate_01/OldEvents/AppPlanChanged.cs b/backend/src/Migrations/OldEvents/AppPlanChanged.cs
similarity index 97%
rename from backend/tools/Migrate_01/OldEvents/AppPlanChanged.cs
rename to backend/src/Migrations/OldEvents/AppPlanChanged.cs
index 228044a2f..1c4ca2eef 100644
--- a/backend/tools/Migrate_01/OldEvents/AppPlanChanged.cs
+++ b/backend/src/Migrations/OldEvents/AppPlanChanged.cs
@@ -13,7 +13,7 @@ using Squidex.Infrastructure.Migrations;
using Squidex.Infrastructure.Reflection;
using AppPlanChangedV2 = Squidex.Domain.Apps.Events.Apps.AppPlanChanged;
-namespace Migrate_01.OldEvents
+namespace Migrations.OldEvents
{
[TypeName("AppPlanChanged")]
[Obsolete]
diff --git a/backend/tools/Migrate_01/OldEvents/AppWorkflowConfigured.cs b/backend/src/Migrations/OldEvents/AppWorkflowConfigured.cs
similarity index 96%
rename from backend/tools/Migrate_01/OldEvents/AppWorkflowConfigured.cs
rename to backend/src/Migrations/OldEvents/AppWorkflowConfigured.cs
index 21f0dc8ce..1cccfcf81 100644
--- a/backend/tools/Migrate_01/OldEvents/AppWorkflowConfigured.cs
+++ b/backend/src/Migrations/OldEvents/AppWorkflowConfigured.cs
@@ -13,7 +13,7 @@ using Squidex.Infrastructure.EventSourcing;
using Squidex.Infrastructure.Migrations;
using Squidex.Infrastructure.Reflection;
-namespace Migrate_01.OldEvents
+namespace Migrations.OldEvents
{
[EventType(nameof(AppWorkflowConfigured))]
[Obsolete]
diff --git a/backend/tools/Migrate_01/OldEvents/AssetCreated.cs b/backend/src/Migrations/OldEvents/AssetCreated.cs
similarity index 98%
rename from backend/tools/Migrate_01/OldEvents/AssetCreated.cs
rename to backend/src/Migrations/OldEvents/AssetCreated.cs
index 7b2b72bbe..9e812342d 100644
--- a/backend/tools/Migrate_01/OldEvents/AssetCreated.cs
+++ b/backend/src/Migrations/OldEvents/AssetCreated.cs
@@ -14,7 +14,7 @@ using Squidex.Infrastructure.Migrations;
using Squidex.Infrastructure.Reflection;
using AssetCreatedV2 = Squidex.Domain.Apps.Events.Assets.AssetCreated;
-namespace Migrate_01.OldEvents
+namespace Migrations.OldEvents
{
[EventType(nameof(AssetCreated))]
[Obsolete]
diff --git a/backend/tools/Migrate_01/OldEvents/AssetRenamed.cs b/backend/src/Migrations/OldEvents/AssetRenamed.cs
similarity index 96%
rename from backend/tools/Migrate_01/OldEvents/AssetRenamed.cs
rename to backend/src/Migrations/OldEvents/AssetRenamed.cs
index 9ed42dc56..f16ad6962 100644
--- a/backend/tools/Migrate_01/OldEvents/AssetRenamed.cs
+++ b/backend/src/Migrations/OldEvents/AssetRenamed.cs
@@ -11,7 +11,7 @@ using Squidex.Infrastructure.EventSourcing;
using Squidex.Infrastructure.Migrations;
using Squidex.Infrastructure.Reflection;
-namespace Migrate_01.OldEvents
+namespace Migrations.OldEvents
{
[EventType(nameof(AssetRenamed))]
[Obsolete]
diff --git a/backend/tools/Migrate_01/OldEvents/AssetTagged.cs b/backend/src/Migrations/OldEvents/AssetTagged.cs
similarity index 96%
rename from backend/tools/Migrate_01/OldEvents/AssetTagged.cs
rename to backend/src/Migrations/OldEvents/AssetTagged.cs
index b34f72ac0..2b3fbaf56 100644
--- a/backend/tools/Migrate_01/OldEvents/AssetTagged.cs
+++ b/backend/src/Migrations/OldEvents/AssetTagged.cs
@@ -12,7 +12,7 @@ using Squidex.Infrastructure.EventSourcing;
using Squidex.Infrastructure.Migrations;
using Squidex.Infrastructure.Reflection;
-namespace Migrate_01.OldEvents
+namespace Migrations.OldEvents
{
[EventType(nameof(AssetTagged))]
[Obsolete]
diff --git a/backend/tools/Migrate_01/OldEvents/AssetUpdated.cs b/backend/src/Migrations/OldEvents/AssetUpdated.cs
similarity index 98%
rename from backend/tools/Migrate_01/OldEvents/AssetUpdated.cs
rename to backend/src/Migrations/OldEvents/AssetUpdated.cs
index d2133ddde..c66f69d53 100644
--- a/backend/tools/Migrate_01/OldEvents/AssetUpdated.cs
+++ b/backend/src/Migrations/OldEvents/AssetUpdated.cs
@@ -12,7 +12,7 @@ using Squidex.Infrastructure.Migrations;
using Squidex.Infrastructure.Reflection;
using AssetUpdatedV2 = Squidex.Domain.Apps.Events.Assets.AssetUpdated;
-namespace Migrate_01.OldEvents
+namespace Migrations.OldEvents
{
[TypeName("AssetUpdated")]
public sealed class AssetUpdated : AssetEvent, IMigrated
diff --git a/backend/tools/Migrate_01/OldEvents/ContentArchived.cs b/backend/src/Migrations/OldEvents/ContentArchived.cs
similarity index 96%
rename from backend/tools/Migrate_01/OldEvents/ContentArchived.cs
rename to backend/src/Migrations/OldEvents/ContentArchived.cs
index 10ef90005..57eedfab7 100644
--- a/backend/tools/Migrate_01/OldEvents/ContentArchived.cs
+++ b/backend/src/Migrations/OldEvents/ContentArchived.cs
@@ -12,7 +12,7 @@ using Squidex.Infrastructure.EventSourcing;
using Squidex.Infrastructure.Migrations;
using Squidex.Infrastructure.Reflection;
-namespace Migrate_01.OldEvents
+namespace Migrations.OldEvents
{
[EventType(nameof(ContentArchived))]
[Obsolete]
diff --git a/backend/tools/Migrate_01/OldEvents/ContentChangesDiscarded.cs b/backend/src/Migrations/OldEvents/ContentChangesDiscarded.cs
similarity index 96%
rename from backend/tools/Migrate_01/OldEvents/ContentChangesDiscarded.cs
rename to backend/src/Migrations/OldEvents/ContentChangesDiscarded.cs
index 33d87550a..69092345e 100644
--- a/backend/tools/Migrate_01/OldEvents/ContentChangesDiscarded.cs
+++ b/backend/src/Migrations/OldEvents/ContentChangesDiscarded.cs
@@ -11,7 +11,7 @@ using Squidex.Infrastructure.EventSourcing;
using Squidex.Infrastructure.Migrations;
using Squidex.Infrastructure.Reflection;
-namespace Migrate_01.OldEvents
+namespace Migrations.OldEvents
{
[EventType(nameof(ContentChangesDiscarded))]
[Obsolete]
diff --git a/backend/tools/Migrate_01/OldEvents/ContentChangesPublished.cs b/backend/src/Migrations/OldEvents/ContentChangesPublished.cs
similarity index 97%
rename from backend/tools/Migrate_01/OldEvents/ContentChangesPublished.cs
rename to backend/src/Migrations/OldEvents/ContentChangesPublished.cs
index dd4e74345..9a23b86a9 100644
--- a/backend/tools/Migrate_01/OldEvents/ContentChangesPublished.cs
+++ b/backend/src/Migrations/OldEvents/ContentChangesPublished.cs
@@ -13,7 +13,7 @@ using Squidex.Infrastructure.Migrations;
using Squidex.Infrastructure.Reflection;
using ContentStatusChangedV2 = Squidex.Domain.Apps.Events.Contents.ContentStatusChanged;
-namespace Migrate_01.OldEvents
+namespace Migrations.OldEvents
{
[EventType(nameof(ContentChangesPublished))]
[Obsolete]
diff --git a/backend/tools/Migrate_01/OldEvents/ContentCreated.cs b/backend/src/Migrations/OldEvents/ContentCreated.cs
similarity index 97%
rename from backend/tools/Migrate_01/OldEvents/ContentCreated.cs
rename to backend/src/Migrations/OldEvents/ContentCreated.cs
index ebbab5f79..69668cc14 100644
--- a/backend/tools/Migrate_01/OldEvents/ContentCreated.cs
+++ b/backend/src/Migrations/OldEvents/ContentCreated.cs
@@ -13,7 +13,7 @@ using Squidex.Infrastructure.Migrations;
using Squidex.Infrastructure.Reflection;
using ContentCreatedV2 = Squidex.Domain.Apps.Events.Contents.ContentCreated;
-namespace Migrate_01.OldEvents
+namespace Migrations.OldEvents
{
[EventType(nameof(ContentCreated))]
[Obsolete]
diff --git a/backend/tools/Migrate_01/OldEvents/ContentPublished.cs b/backend/src/Migrations/OldEvents/ContentPublished.cs
similarity index 96%
rename from backend/tools/Migrate_01/OldEvents/ContentPublished.cs
rename to backend/src/Migrations/OldEvents/ContentPublished.cs
index 41f026e95..8101b7699 100644
--- a/backend/tools/Migrate_01/OldEvents/ContentPublished.cs
+++ b/backend/src/Migrations/OldEvents/ContentPublished.cs
@@ -12,7 +12,7 @@ using Squidex.Infrastructure.EventSourcing;
using Squidex.Infrastructure.Migrations;
using Squidex.Infrastructure.Reflection;
-namespace Migrate_01.OldEvents
+namespace Migrations.OldEvents
{
[EventType(nameof(ContentPublished))]
[Obsolete]
diff --git a/backend/tools/Migrate_01/OldEvents/ContentRestored.cs b/backend/src/Migrations/OldEvents/ContentRestored.cs
similarity index 96%
rename from backend/tools/Migrate_01/OldEvents/ContentRestored.cs
rename to backend/src/Migrations/OldEvents/ContentRestored.cs
index f5b7f308c..7bc262817 100644
--- a/backend/tools/Migrate_01/OldEvents/ContentRestored.cs
+++ b/backend/src/Migrations/OldEvents/ContentRestored.cs
@@ -12,7 +12,7 @@ using Squidex.Infrastructure.EventSourcing;
using Squidex.Infrastructure.Migrations;
using Squidex.Infrastructure.Reflection;
-namespace Migrate_01.OldEvents
+namespace Migrations.OldEvents
{
[EventType(nameof(ContentRestored))]
[Obsolete]
diff --git a/backend/tools/Migrate_01/OldEvents/ContentStatusChanged.cs b/backend/src/Migrations/OldEvents/ContentStatusChanged.cs
similarity index 97%
rename from backend/tools/Migrate_01/OldEvents/ContentStatusChanged.cs
rename to backend/src/Migrations/OldEvents/ContentStatusChanged.cs
index b06d10cc6..8b4c3fa93 100644
--- a/backend/tools/Migrate_01/OldEvents/ContentStatusChanged.cs
+++ b/backend/src/Migrations/OldEvents/ContentStatusChanged.cs
@@ -13,7 +13,7 @@ using Squidex.Infrastructure.Migrations;
using Squidex.Infrastructure.Reflection;
using ContentStatusChangedV2 = Squidex.Domain.Apps.Events.Contents.ContentStatusChanged;
-namespace Migrate_01.OldEvents
+namespace Migrations.OldEvents
{
[EventType(nameof(ContentStatusChanged))]
[Obsolete]
diff --git a/backend/tools/Migrate_01/OldEvents/ContentUnpublished.cs b/backend/src/Migrations/OldEvents/ContentUnpublished.cs
similarity index 96%
rename from backend/tools/Migrate_01/OldEvents/ContentUnpublished.cs
rename to backend/src/Migrations/OldEvents/ContentUnpublished.cs
index cb4092127..1e23ab43b 100644
--- a/backend/tools/Migrate_01/OldEvents/ContentUnpublished.cs
+++ b/backend/src/Migrations/OldEvents/ContentUnpublished.cs
@@ -12,7 +12,7 @@ using Squidex.Infrastructure.EventSourcing;
using Squidex.Infrastructure.Migrations;
using Squidex.Infrastructure.Reflection;
-namespace Migrate_01.OldEvents
+namespace Migrations.OldEvents
{
[EventType(nameof(ContentUnpublished))]
[Obsolete]
diff --git a/backend/tools/Migrate_01/OldEvents/ContentUpdateProposed.cs b/backend/src/Migrations/OldEvents/ContentUpdateProposed.cs
similarity index 97%
rename from backend/tools/Migrate_01/OldEvents/ContentUpdateProposed.cs
rename to backend/src/Migrations/OldEvents/ContentUpdateProposed.cs
index 6b9aaa3f3..ccec23d70 100644
--- a/backend/tools/Migrate_01/OldEvents/ContentUpdateProposed.cs
+++ b/backend/src/Migrations/OldEvents/ContentUpdateProposed.cs
@@ -12,7 +12,7 @@ using Squidex.Infrastructure.EventSourcing;
using Squidex.Infrastructure.Migrations;
using Squidex.Infrastructure.Reflection;
-namespace Migrate_01.OldEvents
+namespace Migrations.OldEvents
{
[EventType(nameof(ContentUpdateProposed))]
[Obsolete]
diff --git a/backend/tools/Migrate_01/OldEvents/NoopConventEvent.cs b/backend/src/Migrations/OldEvents/NoopConventEvent.cs
similarity index 94%
rename from backend/tools/Migrate_01/OldEvents/NoopConventEvent.cs
rename to backend/src/Migrations/OldEvents/NoopConventEvent.cs
index 27654fc2d..839661632 100644
--- a/backend/tools/Migrate_01/OldEvents/NoopConventEvent.cs
+++ b/backend/src/Migrations/OldEvents/NoopConventEvent.cs
@@ -8,7 +8,7 @@
using Squidex.Domain.Apps.Events.Contents;
using Squidex.Infrastructure.Reflection;
-namespace Migrate_01.OldEvents
+namespace Migrations.OldEvents
{
[TypeName(nameof(NoopConventEvent))]
public sealed class NoopConventEvent : ContentEvent
diff --git a/backend/tools/Migrate_01/OldEvents/NoopEvent.cs b/backend/src/Migrations/OldEvents/NoopEvent.cs
similarity index 100%
rename from backend/tools/Migrate_01/OldEvents/NoopEvent.cs
rename to backend/src/Migrations/OldEvents/NoopEvent.cs
diff --git a/backend/tools/Migrate_01/OldEvents/SchemaCreated.cs b/backend/src/Migrations/OldEvents/SchemaCreated.cs
similarity index 99%
rename from backend/tools/Migrate_01/OldEvents/SchemaCreated.cs
rename to backend/src/Migrations/OldEvents/SchemaCreated.cs
index c1b199c75..9f939aed9 100644
--- a/backend/tools/Migrate_01/OldEvents/SchemaCreated.cs
+++ b/backend/src/Migrations/OldEvents/SchemaCreated.cs
@@ -15,7 +15,7 @@ using Squidex.Infrastructure.Reflection;
using SchemaCreatedV2 = Squidex.Domain.Apps.Events.Schemas.SchemaCreated;
using SchemaFields = System.Collections.Generic.List;
-namespace Migrate_01.OldEvents
+namespace Migrations.OldEvents
{
[EventType(nameof(SchemaCreated))]
[Obsolete]
diff --git a/backend/tools/Migrate_01/OldEvents/ScriptsConfigured.cs b/backend/src/Migrations/OldEvents/ScriptsConfigured.cs
similarity index 98%
rename from backend/tools/Migrate_01/OldEvents/ScriptsConfigured.cs
rename to backend/src/Migrations/OldEvents/ScriptsConfigured.cs
index dd9ff18b9..7f27244ce 100644
--- a/backend/tools/Migrate_01/OldEvents/ScriptsConfigured.cs
+++ b/backend/src/Migrations/OldEvents/ScriptsConfigured.cs
@@ -13,7 +13,7 @@ using Squidex.Infrastructure.EventSourcing;
using Squidex.Infrastructure.Migrations;
using Squidex.Infrastructure.Reflection;
-namespace Migrate_01.OldEvents
+namespace Migrations.OldEvents
{
[EventType(nameof(ScriptsConfigured))]
[Obsolete]
diff --git a/backend/tools/Migrate_01/OldEvents/WebhookAdded.cs b/backend/src/Migrations/OldEvents/WebhookAdded.cs
similarity index 95%
rename from backend/tools/Migrate_01/OldEvents/WebhookAdded.cs
rename to backend/src/Migrations/OldEvents/WebhookAdded.cs
index 5a0a69311..68236d39d 100644
--- a/backend/tools/Migrate_01/OldEvents/WebhookAdded.cs
+++ b/backend/src/Migrations/OldEvents/WebhookAdded.cs
@@ -9,7 +9,7 @@ using System;
using Squidex.Domain.Apps.Events;
using Squidex.Infrastructure.EventSourcing;
-namespace Migrate_01.OldEvents
+namespace Migrations.OldEvents
{
[EventType(nameof(WebhookAdded))]
[Obsolete]
diff --git a/backend/tools/Migrate_01/OldEvents/WebhookDeleted.cs b/backend/src/Migrations/OldEvents/WebhookDeleted.cs
similarity index 95%
rename from backend/tools/Migrate_01/OldEvents/WebhookDeleted.cs
rename to backend/src/Migrations/OldEvents/WebhookDeleted.cs
index ffa10562b..6c801e2c2 100644
--- a/backend/tools/Migrate_01/OldEvents/WebhookDeleted.cs
+++ b/backend/src/Migrations/OldEvents/WebhookDeleted.cs
@@ -9,7 +9,7 @@ using System;
using Squidex.Domain.Apps.Events;
using Squidex.Infrastructure.EventSourcing;
-namespace Migrate_01.OldEvents
+namespace Migrations.OldEvents
{
[EventType(nameof(WebhookDeleted))]
[Obsolete]
diff --git a/backend/tools/Migrate_01/OldTriggers/AssetChangedTrigger.cs b/backend/src/Migrations/OldTriggers/AssetChangedTrigger.cs
similarity index 98%
rename from backend/tools/Migrate_01/OldTriggers/AssetChangedTrigger.cs
rename to backend/src/Migrations/OldTriggers/AssetChangedTrigger.cs
index f81f7a038..94d3e3037 100644
--- a/backend/tools/Migrate_01/OldTriggers/AssetChangedTrigger.cs
+++ b/backend/src/Migrations/OldTriggers/AssetChangedTrigger.cs
@@ -13,7 +13,7 @@ using Squidex.Domain.Apps.Core.Rules.Triggers;
using Squidex.Infrastructure.Migrations;
using Squidex.Infrastructure.Reflection;
-namespace Migrate_01.OldTriggers
+namespace Migrations.OldTriggers
{
[TypeName(nameof(AssetChangedTrigger))]
public sealed class AssetChangedTrigger : RuleTrigger, IMigrated
diff --git a/backend/tools/Migrate_01/OldTriggers/ContentChangedTrigger.cs b/backend/src/Migrations/OldTriggers/ContentChangedTrigger.cs
similarity index 97%
rename from backend/tools/Migrate_01/OldTriggers/ContentChangedTrigger.cs
rename to backend/src/Migrations/OldTriggers/ContentChangedTrigger.cs
index 32e5ca19f..5c68f81f0 100644
--- a/backend/tools/Migrate_01/OldTriggers/ContentChangedTrigger.cs
+++ b/backend/src/Migrations/OldTriggers/ContentChangedTrigger.cs
@@ -13,7 +13,7 @@ using Squidex.Domain.Apps.Core.Rules.Triggers;
using Squidex.Infrastructure.Migrations;
using Squidex.Infrastructure.Reflection;
-namespace Migrate_01.OldTriggers
+namespace Migrations.OldTriggers
{
[TypeName(nameof(ContentChangedTrigger))]
public sealed class ContentChangedTrigger : RuleTrigger, IMigrated
diff --git a/backend/tools/Migrate_01/OldTriggers/ContentChangedTriggerSchema.cs b/backend/src/Migrations/OldTriggers/ContentChangedTriggerSchema.cs
similarity index 98%
rename from backend/tools/Migrate_01/OldTriggers/ContentChangedTriggerSchema.cs
rename to backend/src/Migrations/OldTriggers/ContentChangedTriggerSchema.cs
index 735963124..19ab08846 100644
--- a/backend/tools/Migrate_01/OldTriggers/ContentChangedTriggerSchema.cs
+++ b/backend/src/Migrations/OldTriggers/ContentChangedTriggerSchema.cs
@@ -11,7 +11,7 @@ using Squidex.Domain.Apps.Core;
using Squidex.Domain.Apps.Core.Rules.EnrichedEvents;
using Squidex.Domain.Apps.Core.Rules.Triggers;
-namespace Migrate_01.OldTriggers
+namespace Migrations.OldTriggers
{
public sealed class ContentChangedTriggerSchema : Freezable
{
diff --git a/backend/tools/Migrate_01/RebuildOptions.cs b/backend/src/Migrations/RebuildOptions.cs
similarity index 96%
rename from backend/tools/Migrate_01/RebuildOptions.cs
rename to backend/src/Migrations/RebuildOptions.cs
index 94f9743c9..4de8cbb80 100644
--- a/backend/tools/Migrate_01/RebuildOptions.cs
+++ b/backend/src/Migrations/RebuildOptions.cs
@@ -5,7 +5,7 @@
// All rights reserved. Licensed under the MIT license.
// ==========================================================================
-namespace Migrate_01
+namespace Migrations
{
public sealed class RebuildOptions
{
diff --git a/backend/tools/Migrate_01/RebuildRunner.cs b/backend/src/Migrations/RebuildRunner.cs
similarity index 97%
rename from backend/tools/Migrate_01/RebuildRunner.cs
rename to backend/src/Migrations/RebuildRunner.cs
index cb814172b..6cfb6e4a5 100644
--- a/backend/tools/Migrate_01/RebuildRunner.cs
+++ b/backend/src/Migrations/RebuildRunner.cs
@@ -8,11 +8,11 @@
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Extensions.Options;
-using Migrate_01.Migrations;
+using Migrations.Migrations;
using Squidex.Infrastructure;
using Squidex.Infrastructure.Commands;
-namespace Migrate_01
+namespace Migrations
{
public sealed class RebuildRunner
{
diff --git a/backend/tools/Migrate_01/RebuilderExtensions.cs b/backend/src/Migrations/RebuilderExtensions.cs
similarity index 99%
rename from backend/tools/Migrate_01/RebuilderExtensions.cs
rename to backend/src/Migrations/RebuilderExtensions.cs
index 3aca8a079..7effbb013 100644
--- a/backend/tools/Migrate_01/RebuilderExtensions.cs
+++ b/backend/src/Migrations/RebuilderExtensions.cs
@@ -19,7 +19,7 @@ using Squidex.Domain.Apps.Entities.Schemas;
using Squidex.Domain.Apps.Entities.Schemas.State;
using Squidex.Infrastructure.Commands;
-namespace Migrate_01
+namespace Migrations
{
public static class RebuilderExtensions
{
diff --git a/backend/tools/Migrate_01/SquidexMigrations.cs b/backend/src/Migrations/SquidexMigrations.cs
similarity index 96%
rename from backend/tools/Migrate_01/SquidexMigrations.cs
rename to backend/src/Migrations/SquidexMigrations.cs
index 9ca97bdc6..e2016b421 100644
--- a/backend/tools/Migrate_01/SquidexMigrations.cs
+++ b/backend/src/Migrations/SquidexMigrations.cs
@@ -9,7 +9,7 @@ using System.Reflection;
#pragma warning disable RECS0014 // If all fields, properties and methods members are static, the class can be made static.
-namespace Migrate_01
+namespace Migrations
{
public sealed class SquidexMigrations
{
diff --git a/backend/src/Squidex.Domain.Apps.Entities/Apps/Invitation/InviteUserCommandMiddleware.cs b/backend/src/Squidex.Domain.Apps.Entities/Apps/Invitation/InviteUserCommandMiddleware.cs
index f20f104a4..2aa9912ef 100644
--- a/backend/src/Squidex.Domain.Apps.Entities/Apps/Invitation/InviteUserCommandMiddleware.cs
+++ b/backend/src/Squidex.Domain.Apps.Entities/Apps/Invitation/InviteUserCommandMiddleware.cs
@@ -26,9 +26,20 @@ namespace Squidex.Domain.Apps.Entities.Apps.Invitation
public async Task HandleAsync(CommandContext context, NextDelegate next)
{
- if (context.Command is AssignContributor assignContributor && ShouldInvite(assignContributor))
+ if (context.Command is AssignContributor assignContributor && ShouldResolve(assignContributor))
{
- var (user, created) = await userResolver.CreateUserIfNotExistsAsync(assignContributor.ContributorId, true);
+ IUser? user;
+
+ var created = false;
+
+ if (assignContributor.Invite)
+ {
+ (user, created) = await userResolver.CreateUserIfNotExistsAsync(assignContributor.ContributorId, true);
+ }
+ else
+ {
+ user = await userResolver.FindByIdOrEmailAsync(assignContributor.ContributorId);
+ }
if (user != null)
{
@@ -48,9 +59,9 @@ namespace Squidex.Domain.Apps.Entities.Apps.Invitation
}
}
- private static bool ShouldInvite(AssignContributor assignContributor)
+ private static bool ShouldResolve(AssignContributor assignContributor)
{
- return assignContributor.Invite && assignContributor.ContributorId.IsEmail();
+ return assignContributor.ContributorId.IsEmail();
}
}
}
diff --git a/backend/src/Squidex.Domain.Users/DefaultUserResolver.cs b/backend/src/Squidex.Domain.Users/DefaultUserResolver.cs
index 8da722640..12ba8e55d 100644
--- a/backend/src/Squidex.Domain.Users/DefaultUserResolver.cs
+++ b/backend/src/Squidex.Domain.Users/DefaultUserResolver.cs
@@ -65,23 +65,16 @@ namespace Squidex.Domain.Users
}
}
- public async Task FindByIdAsync(string idOrEmail)
+ public async Task FindByIdAsync(string id)
{
- Guard.NotNullOrEmpty(idOrEmail, nameof(idOrEmail));
+ Guard.NotNullOrEmpty(id, nameof(id));
using (var scope = serviceProvider.CreateScope())
{
var userFactory = scope.ServiceProvider.GetRequiredService();
var userManager = scope.ServiceProvider.GetRequiredService>();
- if (userFactory.IsId(idOrEmail))
- {
- return await userManager.FindByIdWithClaimsAsync(idOrEmail);
- }
- else
- {
- return await userManager.FindByEmailWithClaimsAsync(idOrEmail);
- }
+ return await userManager.FindByIdWithClaimsAsync(id);
}
}
diff --git a/backend/src/Squidex/Config/Domain/MigrationServices.cs b/backend/src/Squidex/Config/Domain/MigrationServices.cs
index ae1b917d0..1634fde5d 100644
--- a/backend/src/Squidex/Config/Domain/MigrationServices.cs
+++ b/backend/src/Squidex/Config/Domain/MigrationServices.cs
@@ -7,8 +7,8 @@
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
-using Migrate_01;
-using Migrate_01.Migrations;
+using Migrations;
+using Migrations.Migrations;
using Squidex.Infrastructure.Migrations;
namespace Squidex.Config.Domain
diff --git a/backend/src/Squidex/Config/Domain/SerializationServices.cs b/backend/src/Squidex/Config/Domain/SerializationServices.cs
index f1a387763..9d74defdf 100644
--- a/backend/src/Squidex/Config/Domain/SerializationServices.cs
+++ b/backend/src/Squidex/Config/Domain/SerializationServices.cs
@@ -6,7 +6,7 @@
// ==========================================================================
using Microsoft.Extensions.DependencyInjection;
-using Migrate_01;
+using Migrations;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Squidex.Domain.Apps.Core;
diff --git a/backend/src/Squidex/Config/Domain/StoreServices.cs b/backend/src/Squidex/Config/Domain/StoreServices.cs
index 03f5cb54f..4b8af4606 100644
--- a/backend/src/Squidex/Config/Domain/StoreServices.cs
+++ b/backend/src/Squidex/Config/Domain/StoreServices.cs
@@ -11,7 +11,7 @@ using IdentityServer4.Stores;
using Microsoft.AspNetCore.Identity;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
-using Migrate_01.Migrations.MongoDb;
+using Migrations.Migrations.MongoDb;
using MongoDB.Driver;
using MongoDB.Driver.GridFS;
using Squidex.Domain.Apps.Entities.Assets.Repositories;
diff --git a/backend/src/Squidex/Config/Startup/MigrationRebuilderHost.cs b/backend/src/Squidex/Config/Startup/MigrationRebuilderHost.cs
index 5523ca278..4276d44a5 100644
--- a/backend/src/Squidex/Config/Startup/MigrationRebuilderHost.cs
+++ b/backend/src/Squidex/Config/Startup/MigrationRebuilderHost.cs
@@ -7,7 +7,7 @@
using System.Threading;
using System.Threading.Tasks;
-using Migrate_01;
+using Migrations;
using Squidex.Infrastructure.Log;
namespace Squidex.Config.Startup
diff --git a/backend/src/Squidex/Squidex.csproj b/backend/src/Squidex/Squidex.csproj
index d9340d8c1..00beeee54 100644
--- a/backend/src/Squidex/Squidex.csproj
+++ b/backend/src/Squidex/Squidex.csproj
@@ -14,7 +14,7 @@
-
+
@@ -124,4 +124,6 @@
$(NoWarn);CS1591;1591;1573;1572;NU1605;IDE0060
+
+
\ No newline at end of file
diff --git a/backend/src/Squidex/appsettings.json b/backend/src/Squidex/appsettings.json
index c66f13f84..67ac399f3 100644
--- a/backend/src/Squidex/appsettings.json
+++ b/backend/src/Squidex/appsettings.json
@@ -240,7 +240,7 @@
/*
* True to delete assets recursively.
*/
- "deleteRecursive": false
+ "deleteRecursive": true
},
"logging": {
@@ -623,7 +623,7 @@
* Kafka Producer configuration
*/
"kafka": {
- "bootstrapServers": ""
+ "bootstrapServers": "adasdasdsd"
},
/*
diff --git a/backend/tests/Squidex.Web.Tests/Squidex.Web.Tests.csproj b/backend/tests/Squidex.Web.Tests/Squidex.Web.Tests.csproj
index 0f0ac9d7d..63c05d709 100644
--- a/backend/tests/Squidex.Web.Tests/Squidex.Web.Tests.csproj
+++ b/backend/tests/Squidex.Web.Tests/Squidex.Web.Tests.csproj
@@ -7,8 +7,8 @@
enable
-
-
+
+
diff --git a/backend/tests/docker-compose.yml b/backend/tests/docker-compose.yml
index 2f17c969d..75c4fff5e 100644
--- a/backend/tests/docker-compose.yml
+++ b/backend/tests/docker-compose.yml
@@ -7,27 +7,15 @@ services:
networks:
- internal
- squidex2:
- image: "squidex-local"
- environment:
- - URLS__BASEURL=http://localhost
- - EVENTSTORE__MONGODB__CONFIGURATION=mongodb://mongo
- - ORLEANS__HOSTNAMEORIPADDRESS=FirstOfHost
- - STORE__MONGODB__CONFIGURATION=mongodb://mongo
- - STORE__TYPE=MongoDB
- networks:
- - internal
- depends_on:
- - mongo
-
- squidex1:
- image: "squidex-local"
+ squidex:
+ image: squidex
ports:
- - "80:80"
+ - "8080:80"
environment:
- - URLS__BASEURL=http://localhost
+ - URLS__BASEURL=http://localhost:8080
- EVENTSTORE__MONGODB__CONFIGURATION=mongodb://mongo
- - ORLEANS__HOSTNAMEORIPADDRESS=FirstOfHost
+ - IDENTITY__ADMINCLIENTID=root
+ - IDENTITY__ADMINCLIENTSECRET=xeLd6jFxqbXJrfmNLlO2j1apagGGGSyZJhFnIuHp4I0=
- STORE__MONGODB__CONFIGURATION=mongodb://mongo
- STORE__TYPE=MongoDB
networks:
diff --git a/backend/tools/Benchmarks/Benchmarks.sln b/backend/tools/Benchmarks/Benchmarks.sln
new file mode 100644
index 000000000..4ac0453f3
--- /dev/null
+++ b/backend/tools/Benchmarks/Benchmarks.sln
@@ -0,0 +1,34 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 15
+VisualStudioVersion = 15.0.26124.0
+MinimumVisualStudioVersion = 15.0.26124.0
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Benchmarks", "Benchmarks.csproj", "{976EDCCA-6E53-41E9-9279-B111ED68B79A}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Debug|x64 = Debug|x64
+ Debug|x86 = Debug|x86
+ Release|Any CPU = Release|Any CPU
+ Release|x64 = Release|x64
+ Release|x86 = Release|x86
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {976EDCCA-6E53-41E9-9279-B111ED68B79A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {976EDCCA-6E53-41E9-9279-B111ED68B79A}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {976EDCCA-6E53-41E9-9279-B111ED68B79A}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {976EDCCA-6E53-41E9-9279-B111ED68B79A}.Debug|x64.Build.0 = Debug|Any CPU
+ {976EDCCA-6E53-41E9-9279-B111ED68B79A}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {976EDCCA-6E53-41E9-9279-B111ED68B79A}.Debug|x86.Build.0 = Debug|Any CPU
+ {976EDCCA-6E53-41E9-9279-B111ED68B79A}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {976EDCCA-6E53-41E9-9279-B111ED68B79A}.Release|Any CPU.Build.0 = Release|Any CPU
+ {976EDCCA-6E53-41E9-9279-B111ED68B79A}.Release|x64.ActiveCfg = Release|Any CPU
+ {976EDCCA-6E53-41E9-9279-B111ED68B79A}.Release|x64.Build.0 = Release|Any CPU
+ {976EDCCA-6E53-41E9-9279-B111ED68B79A}.Release|x86.ActiveCfg = Release|Any CPU
+ {976EDCCA-6E53-41E9-9279-B111ED68B79A}.Release|x86.Build.0 = Release|Any CPU
+ EndGlobalSection
+EndGlobal
diff --git a/backend/tools/Migrate_01/Migrate_01.csproj b/backend/tools/Migrate_01/Migrate_01.csproj
deleted file mode 100644
index 28e8d196e..000000000
--- a/backend/tools/Migrate_01/Migrate_01.csproj
+++ /dev/null
@@ -1,25 +0,0 @@
-
-
- netcoreapp3.1
- 8.0
- enable
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- ..\..\Squidex.ruleset
-
-
-
-
-
diff --git a/backend/tools/Migrate_00/Migrate_00.csproj b/backend/tools/Migrator/Migrator.csproj
similarity index 100%
rename from backend/tools/Migrate_00/Migrate_00.csproj
rename to backend/tools/Migrator/Migrator.csproj
diff --git a/backend/tools/Migrator/Migrator.sln b/backend/tools/Migrator/Migrator.sln
new file mode 100644
index 000000000..80fcb7d09
--- /dev/null
+++ b/backend/tools/Migrator/Migrator.sln
@@ -0,0 +1,34 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 15
+VisualStudioVersion = 15.0.26124.0
+MinimumVisualStudioVersion = 15.0.26124.0
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Migrator", "Migrator.csproj", "{94526967-6D82-4860-8220-80B8B176ABB6}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Debug|x64 = Debug|x64
+ Debug|x86 = Debug|x86
+ Release|Any CPU = Release|Any CPU
+ Release|x64 = Release|x64
+ Release|x86 = Release|x86
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {94526967-6D82-4860-8220-80B8B176ABB6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {94526967-6D82-4860-8220-80B8B176ABB6}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {94526967-6D82-4860-8220-80B8B176ABB6}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {94526967-6D82-4860-8220-80B8B176ABB6}.Debug|x64.Build.0 = Debug|Any CPU
+ {94526967-6D82-4860-8220-80B8B176ABB6}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {94526967-6D82-4860-8220-80B8B176ABB6}.Debug|x86.Build.0 = Debug|Any CPU
+ {94526967-6D82-4860-8220-80B8B176ABB6}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {94526967-6D82-4860-8220-80B8B176ABB6}.Release|Any CPU.Build.0 = Release|Any CPU
+ {94526967-6D82-4860-8220-80B8B176ABB6}.Release|x64.ActiveCfg = Release|Any CPU
+ {94526967-6D82-4860-8220-80B8B176ABB6}.Release|x64.Build.0 = Release|Any CPU
+ {94526967-6D82-4860-8220-80B8B176ABB6}.Release|x86.ActiveCfg = Release|Any CPU
+ {94526967-6D82-4860-8220-80B8B176ABB6}.Release|x86.Build.0 = Release|Any CPU
+ EndGlobalSection
+EndGlobal
diff --git a/backend/tools/Migrate_00/Program.cs b/backend/tools/Migrator/Program.cs
similarity index 99%
rename from backend/tools/Migrate_00/Program.cs
rename to backend/tools/Migrator/Program.cs
index 3ecc953de..224141752 100644
--- a/backend/tools/Migrate_00/Program.cs
+++ b/backend/tools/Migrator/Program.cs
@@ -9,7 +9,7 @@ using System;
using MongoDB.Bson;
using MongoDB.Driver;
-namespace Migrate_00
+namespace Migrator
{
public class Program
{
diff --git a/backend/tools/TestSuite/TestSuite.ApiTests/AppTests.cs b/backend/tools/TestSuite/TestSuite.ApiTests/AppTests.cs
index d3511e560..e05102a70 100644
--- a/backend/tools/TestSuite/TestSuite.ApiTests/AppTests.cs
+++ b/backend/tools/TestSuite/TestSuite.ApiTests/AppTests.cs
@@ -7,6 +7,7 @@
using System;
using System.Collections.Generic;
+using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
@@ -31,9 +32,25 @@ namespace TestSuite.ApiTests
[Fact]
public async Task Should_get_app()
{
+ var w = Stopwatch.StartNew();
+
var app = await _.Apps.GetAppAsync(_.AppName);
Assert.Equal(_.AppName, app.Name);
+
+ w.Stop();
+
+ Debug.WriteLine("ELAPSED: {0}", w.Elapsed);
+
+ var w2 = Stopwatch.StartNew();
+
+ app = await _.Apps.GetAppAsync(_.AppName);
+
+ Assert.Equal(_.AppName, app.Name);
+
+ w2.Stop();
+
+ Debug.WriteLine("ELAPSED: {0}", w2.Elapsed);
}
[Fact]
@@ -186,7 +203,7 @@ namespace TestSuite.ApiTests
{
var roleName = Guid.NewGuid().ToString();
var roleClient = Guid.NewGuid().ToString();
- var roleContributor1 = "role@squidex.io";
+ var roleContributor1 = "role1@squidex.io";
var roleContributor2 = "role2@squidex.io";
// STEP 1: Add role.
diff --git a/backend/tools/TestSuite/TestSuite.ApiTests/AssetTests.cs b/backend/tools/TestSuite/TestSuite.ApiTests/AssetTests.cs
index 3ec7d5a5a..e0247a67f 100644
--- a/backend/tools/TestSuite/TestSuite.ApiTests/AssetTests.cs
+++ b/backend/tools/TestSuite/TestSuite.ApiTests/AssetTests.cs
@@ -16,6 +16,7 @@ using Xunit;
#pragma warning disable SA1300 // Element should begin with upper-case letter
#pragma warning disable SA1507 // Code should not contain multiple blank lines in a row
+#pragma warning disable SA1133 // Do not combine attributes
namespace TestSuite.ApiTests
{
@@ -188,7 +189,7 @@ namespace TestSuite.ApiTests
Assert.Contains(assets_2.Items, x => x.Id == asset_1.Id);
}
- [Fact]
+ [Fact, Trait("Category", "NotAutomated")]
public async Task Should_delete_recursively()
{
// STEP 1: Create asset folder
diff --git a/backend/tools/TestSuite/TestSuite.ApiTests/BackupTests.cs b/backend/tools/TestSuite/TestSuite.ApiTests/BackupTests.cs
index 8c6da95c4..acfb18e08 100644
--- a/backend/tools/TestSuite/TestSuite.ApiTests/BackupTests.cs
+++ b/backend/tools/TestSuite/TestSuite.ApiTests/BackupTests.cs
@@ -18,6 +18,7 @@ using Xunit;
namespace TestSuite.ApiTests
{
+ [Trait("Category", "NotAutomated")]
public class BackupTests : IClassFixture
{
public ClientFixture _ { get; }
diff --git a/backend/tools/TestSuite/TestSuite.ApiTests/CDNTests.cs b/backend/tools/TestSuite/TestSuite.ApiTests/CDNTests.cs
index eadf3257a..8a9b2e569 100644
--- a/backend/tools/TestSuite/TestSuite.ApiTests/CDNTests.cs
+++ b/backend/tools/TestSuite/TestSuite.ApiTests/CDNTests.cs
@@ -16,7 +16,7 @@ using Xunit;
namespace TestSuite.ApiTests
{
- [Trait("Category", "Dependencies")]
+ [Trait("Category", "NotAutomated")]
public class CDNTests : IClassFixture
{
public CloudFixture _ { get; }
diff --git a/backend/tools/TestSuite/TestSuite.ApiTests/ContentCleanupTests.cs b/backend/tools/TestSuite/TestSuite.ApiTests/ContentCleanupTests.cs
index e56ef3362..7b1616f91 100644
--- a/backend/tools/TestSuite/TestSuite.ApiTests/ContentCleanupTests.cs
+++ b/backend/tools/TestSuite/TestSuite.ApiTests/ContentCleanupTests.cs
@@ -17,11 +17,11 @@ using Xunit;
namespace TestSuite.ApiTests
{
- public class ContentCleanupTests : IClassFixture
+ public class ContentCleanupTests : IClassFixture
{
- public ClientFixture _ { get; }
+ public CreatedAppFixture _ { get; }
- public ContentCleanupTests(ClientFixture fixture)
+ public ContentCleanupTests(CreatedAppFixture fixture)
{
_ = fixture;
}
diff --git a/backend/tools/TestSuite/TestSuite.ApiTests/GraphQLTests.cs b/backend/tools/TestSuite/TestSuite.ApiTests/GraphQLTests.cs
index a23c86ee3..c63a6ed27 100644
--- a/backend/tools/TestSuite/TestSuite.ApiTests/GraphQLTests.cs
+++ b/backend/tools/TestSuite/TestSuite.ApiTests/GraphQLTests.cs
@@ -20,6 +20,7 @@ using Xunit;
namespace TestSuite.ApiTests
{
+ [Trait("Category", "NotAutomated")]
public sealed class GraphQLTests : IClassFixture
{
public CreatedAppFixture _ { get; }
diff --git a/backend/tools/TestSuite/TestSuite.ApiTests/TestSuite.ApiTests.csproj b/backend/tools/TestSuite/TestSuite.ApiTests/TestSuite.ApiTests.csproj
index 044108192..cf147d566 100644
--- a/backend/tools/TestSuite/TestSuite.ApiTests/TestSuite.ApiTests.csproj
+++ b/backend/tools/TestSuite/TestSuite.ApiTests/TestSuite.ApiTests.csproj
@@ -4,7 +4,7 @@
netcoreapp3.1
-
+
diff --git a/backend/tools/TestSuite/TestSuite.LoadTests/TestSuite.LoadTests.csproj b/backend/tools/TestSuite/TestSuite.LoadTests/TestSuite.LoadTests.csproj
index 615318519..fd98135ea 100644
--- a/backend/tools/TestSuite/TestSuite.LoadTests/TestSuite.LoadTests.csproj
+++ b/backend/tools/TestSuite/TestSuite.LoadTests/TestSuite.LoadTests.csproj
@@ -4,7 +4,7 @@
netcoreapp3.1
-
+
diff --git a/backend/tools/TestSuite/TestSuite.Shared/Fixtures/ClientFixture.cs b/backend/tools/TestSuite/TestSuite.Shared/Fixtures/ClientFixture.cs
index a618adc78..9c265aa95 100644
--- a/backend/tools/TestSuite/TestSuite.Shared/Fixtures/ClientFixture.cs
+++ b/backend/tools/TestSuite/TestSuite.Shared/Fixtures/ClientFixture.cs
@@ -11,16 +11,33 @@ namespace TestSuite.Fixtures
{
public class ClientFixture : ClientManagerFixture
{
- public IAppsClient Apps => ClientManager.CreateAppsClient();
+ public IAppsClient Apps { get; }
- public IBackupsClient Backups => ClientManager.CreateBackupsClient();
+ public IBackupsClient Backups { get; }
- public ILanguagesClient Languages => ClientManager.CreateLanguagesClient();
+ public ILanguagesClient Languages { get; }
- public IPingClient Ping => ClientManager.CreatePingClient();
+ public IPingClient Ping { get; }
- public IRulesClient Rules => ClientManager.CreateRulesClient();
+ public IRulesClient Rules { get; }
- public ISchemasClient Schemas => ClientManager.CreateSchemasClient();
+ public ISchemasClient Schemas { get; }
+
+ public ClientFixture()
+ {
+ Apps = ClientManager.CreateAppsClient();
+
+ Backups = ClientManager.CreateBackupsClient();
+
+ Languages = ClientManager.CreateLanguagesClient();
+
+ Languages = ClientManager.CreateLanguagesClient();
+
+ Ping = ClientManager.CreatePingClient();
+
+ Rules = ClientManager.CreateRulesClient();
+
+ Schemas = ClientManager.CreateSchemasClient();
+ }
}
}
diff --git a/backend/tools/TestSuite/TestSuite.Shared/Fixtures/ClientManagerFactory.cs b/backend/tools/TestSuite/TestSuite.Shared/Fixtures/ClientManagerFactory.cs
new file mode 100644
index 000000000..e51b34f3c
--- /dev/null
+++ b/backend/tools/TestSuite/TestSuite.Shared/Fixtures/ClientManagerFactory.cs
@@ -0,0 +1,100 @@
+// ==========================================================================
+// Squidex Headless CMS
+// ==========================================================================
+// Copyright (c) Squidex UG (haftungsbeschraenkt)
+// All rights reserved. Licensed under the MIT license.
+// ==========================================================================
+
+using System;
+using System.Threading;
+using System.Threading.Tasks;
+using Squidex.ClientLibrary;
+using Squidex.ClientLibrary.Configuration;
+
+namespace TestSuite.Fixtures
+{
+ public static class ClientManagerFactory
+ {
+ private static Task manager;
+
+ public static Task CreateAsync()
+ {
+ if (manager == null)
+ {
+ manager = CreateInternalAsync();
+ }
+
+ return manager;
+ }
+
+ private static async Task CreateInternalAsync()
+ {
+ var appName = GetValue("APP__NAME", "integration-tests");
+ var clientId = GetValue("CLIENT__ID", "root");
+ var clientSecret = GetValue("CLIENT__SECRET", "xeLd6jFxqbXJrfmNLlO2j1apagGGGSyZJhFnIuHp4I0=");
+ var serviceURl = GetValue("SERVER__URL", "https://localhost:5001");
+
+ var clientManager = new SquidexClientManager(new SquidexOptions
+ {
+ AppName = appName,
+ ClientId = clientId,
+ ClientSecret = clientSecret,
+ ReadResponseAsString = true,
+ Configurator = AcceptAllCertificatesConfigurator.Instance,
+ Url = serviceURl
+ });
+
+ if (TryGetTimeout(out var waitSeconds))
+ {
+ Console.WriteLine("Waiting {0} seconds to access server", waitSeconds);
+
+ var pingClient = clientManager.CreatePingClient();
+
+ using (var cts = new CancellationTokenSource(waitSeconds * 1000))
+ {
+ while (!cts.IsCancellationRequested)
+ {
+ try
+ {
+ await pingClient.GetPingAsync(cts.Token);
+
+ break;
+ }
+ catch
+ {
+ await Task.Delay(100);
+ }
+ }
+ }
+ }
+
+ return clientManager;
+ }
+
+ private static bool TryGetTimeout(out int timeout)
+ {
+ var variable = Environment.GetEnvironmentVariable("CONFIG__WAIT");
+
+ if (!string.IsNullOrWhiteSpace(variable))
+ {
+ Console.WriteLine("Using: CONFIG__WAIT={0}", variable);
+ }
+
+ return int.TryParse(variable, out timeout) && timeout > 10;
+ }
+
+ private static string GetValue(string name, string defaultValue)
+ {
+ var variable = Environment.GetEnvironmentVariable($"CONFIG__{name}");
+
+ if (!string.IsNullOrWhiteSpace(variable))
+ {
+ Console.WriteLine("Using: {0}={1}", name, variable);
+
+ return variable;
+ }
+
+ return defaultValue;
+ }
+ }
+}
diff --git a/backend/tools/TestSuite/TestSuite.Shared/Fixtures/ClientManagerFixture.cs b/backend/tools/TestSuite/TestSuite.Shared/Fixtures/ClientManagerFixture.cs
index 96c7814f4..4d3ef8b45 100644
--- a/backend/tools/TestSuite/TestSuite.Shared/Fixtures/ClientManagerFixture.cs
+++ b/backend/tools/TestSuite/TestSuite.Shared/Fixtures/ClientManagerFixture.cs
@@ -6,77 +6,25 @@
// ==========================================================================
using System;
-using System.Threading;
-using System.Threading.Tasks;
using Squidex.ClientLibrary;
-using Squidex.ClientLibrary.Configuration;
namespace TestSuite.Fixtures
{
public class ClientManagerFixture : IDisposable
{
- public string AppName { get; } = GetValue("APP__NAME", "integration-tests");
+ public string AppName => ClientManager.Options.AppName;
- public string ClientId { get; } = GetValue("CLIENT__ID", "root");
+ public string ClientId => ClientManager.Options.ClientId;
- public string ClientSecret { get; } = GetValue("CLIENT__SECRET", "xeLd6jFxqbXJrfmNLlO2j1apagGGGSyZJhFnIuHp4I0=");
+ public string ClientSecret => ClientManager.Options.ClientSecret;
- public string ServerUrl { get; } = GetValue("SERVER__URL", "https://localhost:5001");
+ public string ServerUrl => ClientManager.Options.Url;
public SquidexClientManager ClientManager { get; }
public ClientManagerFixture()
{
- ClientManager = new SquidexClientManager(new SquidexOptions
- {
- AppName = AppName,
- ClientId = ClientId,
- ClientSecret = ClientSecret,
- Configurator = AcceptAllCertificatesConfigurator.Instance,
- Url = ServerUrl
- });
-
- if (TryGetTimeout(out var waitSeconds))
- {
- Task.Run(async () =>
- {
- var pingClient = ClientManager.CreatePingClient();
-
- using (var cts = new CancellationTokenSource(waitSeconds * 1000))
- {
- while (!cts.IsCancellationRequested)
- {
- try
- {
- await pingClient.GetPingAsync(cts.Token);
-
- break;
- }
- catch
- {
- continue;
- }
- }
- }
- }).Wait();
- }
- }
-
- private static bool TryGetTimeout(out int timeout)
- {
- return int.TryParse(Environment.GetEnvironmentVariable("TEST_WAIT"), out timeout) && timeout > 10;
- }
-
- private static string GetValue(string name, string defaultValue)
- {
- var variable = Environment.GetEnvironmentVariable($"CONFIG__{name}");
-
- if (!string.IsNullOrWhiteSpace(variable))
- {
- return variable;
- }
-
- return defaultValue;
+ ClientManager = ClientManagerFactory.CreateAsync().Result;
}
public virtual void Dispose()
diff --git a/backend/tools/TestSuite/TestSuite.Shared/Fixtures/ContentFixture.cs b/backend/tools/TestSuite/TestSuite.Shared/Fixtures/ContentFixture.cs
index 5cde9aca8..1a72e32d5 100644
--- a/backend/tools/TestSuite/TestSuite.Shared/Fixtures/ContentFixture.cs
+++ b/backend/tools/TestSuite/TestSuite.Shared/Fixtures/ContentFixture.cs
@@ -5,6 +5,7 @@
// All rights reserved. Licensed under the MIT license.
// ==========================================================================
+using System.Collections.Generic;
using System.Threading.Tasks;
using Squidex.ClientLibrary;
using Squidex.ClientLibrary.Management;
@@ -14,6 +15,8 @@ namespace TestSuite.Fixtures
{
public class ContentFixture : CreatedAppFixture
{
+ private static readonly HashSet CreatedSchemas = new HashSet();
+
public IContentsClient Contents { get; }
public string SchemaName { get; }
@@ -27,20 +30,25 @@ namespace TestSuite.Fixtures
{
SchemaName = schemaName;
- Task.Run(async () =>
+ if (!CreatedSchemas.Contains(schemaName))
{
- try
- {
- await TestEntity.CreateSchemaAsync(Schemas, AppName, schemaName);
- }
- catch (SquidexManagementException ex)
+ Task.Run(async () =>
{
- if (ex.StatusCode != 400)
+ try
{
- throw;
+ await TestEntity.CreateSchemaAsync(Schemas, AppName, schemaName);
}
- }
- }).Wait();
+ catch (SquidexManagementException ex)
+ {
+ if (ex.StatusCode != 400)
+ {
+ throw;
+ }
+ }
+ }).Wait();
+
+ CreatedSchemas.Add(schemaName);
+ }
Contents = ClientManager.CreateContentsClient(SchemaName);
}
diff --git a/backend/tools/TestSuite/TestSuite.Shared/Fixtures/ContentReferencesFixture.cs b/backend/tools/TestSuite/TestSuite.Shared/Fixtures/ContentReferencesFixture.cs
index 0189cc8e6..561c57eba 100644
--- a/backend/tools/TestSuite/TestSuite.Shared/Fixtures/ContentReferencesFixture.cs
+++ b/backend/tools/TestSuite/TestSuite.Shared/Fixtures/ContentReferencesFixture.cs
@@ -7,6 +7,7 @@
using System.Threading.Tasks;
using Squidex.ClientLibrary;
+using Squidex.ClientLibrary.Management;
using TestSuite.Model;
namespace TestSuite.Fixtures
@@ -21,8 +22,18 @@ namespace TestSuite.Fixtures
{
Task.Run(async () =>
{
- await TestEntityWithReferences.CreateSchemaAsync(Schemas, AppName, SchemaName);
- }).Wait();
+ try
+ {
+ await TestEntityWithReferences.CreateSchemaAsync(Schemas, AppName, SchemaName);
+ }
+ catch (SquidexManagementException ex)
+ {
+ if (ex.StatusCode != 400)
+ {
+ throw;
+ }
+ }
+ }).Wait();
Contents = ClientManager.CreateContentsClient(SchemaName);
}
diff --git a/backend/tools/TestSuite/TestSuite.Shared/Fixtures/CreatedAppFixture.cs b/backend/tools/TestSuite/TestSuite.Shared/Fixtures/CreatedAppFixture.cs
index 3302f869b..3ee48c8d2 100644
--- a/backend/tools/TestSuite/TestSuite.Shared/Fixtures/CreatedAppFixture.cs
+++ b/backend/tools/TestSuite/TestSuite.Shared/Fixtures/CreatedAppFixture.cs
@@ -12,26 +12,33 @@ namespace TestSuite.Fixtures
{
public class CreatedAppFixture : ClientFixture
{
+ private static bool isCreated;
+
public CreatedAppFixture()
{
- Task.Run(async () =>
+ if (!isCreated)
{
- try
- {
- await Apps.PostAppAsync(new CreateAppDto { Name = AppName });
- }
- catch (SquidexManagementException ex)
+ Task.Run(async () =>
{
- if (ex.StatusCode != 400)
+ try
{
- throw;
+ await Apps.PostAppAsync(new CreateAppDto { Name = AppName });
}
- }
+ catch (SquidexManagementException ex)
+ {
+ if (ex.StatusCode != 400)
+ {
+ throw;
+ }
+ }
+
+ var invite = new AssignContributorDto { ContributorId = "sebastian@squidex.io", Invite = true, Role = "Owner" };
- var invite = new AssignContributorDto { ContributorId = "sebastian@squidex.io", Invite = true, Role = "Owner" };
+ await Apps.PostContributorAsync(AppName, invite);
+ }).Wait();
- await Apps.PostContributorAsync(AppName, invite);
- }).Wait();
+ isCreated = true;
+ }
}
}
}
diff --git a/backend/tools/TestSuite/TestSuite.Shared/TestSuite.Shared.csproj b/backend/tools/TestSuite/TestSuite.Shared/TestSuite.Shared.csproj
index 90cbcdec6..432de718e 100644
--- a/backend/tools/TestSuite/TestSuite.Shared/TestSuite.Shared.csproj
+++ b/backend/tools/TestSuite/TestSuite.Shared/TestSuite.Shared.csproj
@@ -4,7 +4,7 @@
-
+