From 474cffbf7c436f87ed837d731f076cc32d05f5d7 Mon Sep 17 00:00:00 2001 From: Kenn Jacobsen Date: Wed, 25 Sep 2024 10:59:55 +0200 Subject: [PATCH] Make AddUserClientId able to run twice if needed (#17123) --- .../Migrations/Upgrade/V_15_0_0/AddUserClientId.cs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_15_0_0/AddUserClientId.cs b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_15_0_0/AddUserClientId.cs index 12322dd65153..946ac296076d 100644 --- a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_15_0_0/AddUserClientId.cs +++ b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_15_0_0/AddUserClientId.cs @@ -1,4 +1,5 @@ -using Umbraco.Cms.Infrastructure.Persistence.Dtos; +using Umbraco.Cms.Core; +using Umbraco.Cms.Infrastructure.Persistence.Dtos; namespace Umbraco.Cms.Infrastructure.Migrations.Upgrade.V_15_0_0; @@ -11,5 +12,12 @@ public AddUserClientId(IMigrationContext context) } protected override void Migrate() - => Create.Table().Do(); + { + if (TableExists(Constants.DatabaseSchema.Tables.User2ClientId)) + { + return; + } + + Create.Table().Do(); + } }