Skip to content

Commit 10625b6

Browse files
authored
Merge pull request #11167 from Jeavon/task/migrateIsMaster
Add migration for isMaster column to isSchedulingPublisher in UmbracoServer table
2 parents 69e47fc + a3ca09c commit 10625b6

File tree

5 files changed

+26
-3
lines changed

5 files changed

+26
-3
lines changed

src/Umbraco.Infrastructure/Migrations/Upgrade/UmbracoPlan.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,9 @@ protected void DefinePlan()
246246
.To<DictionaryTablesIndexes>("{12DCDE7F-9AB7-4617-804F-AB66BF360980}")
247247
.As("{5AAE6276-80DB-4ACF-B845-199BC6C37538}");
248248

249+
// TO 9.0.0-rc4
250+
To<UmbracoServerColumn>("5E02F241-5253-403D-B5D3-7DB00157E20F");
251+
249252
// TO 9.0.0
250253

251254
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
using Umbraco.Cms.Infrastructure.Persistence.Dtos;
2+
3+
namespace Umbraco.Cms.Infrastructure.Migrations.Upgrade.V_9_0_0
4+
{
5+
public class UmbracoServerColumn : MigrationBase
6+
{
7+
public UmbracoServerColumn(IMigrationContext context)
8+
: base(context)
9+
{
10+
}
11+
12+
/// <summary>
13+
/// Adds new columns to members table
14+
/// </summary>
15+
protected override void Migrate()
16+
{
17+
ReplaceColumn<ServerRegistrationDto>(Cms.Core.Constants.DatabaseSchema.Tables.Server, "isMaster", "isSchedulingPublisher");
18+
}
19+
}
20+
}

src/Umbraco.Infrastructure/Persistence/Dtos/ServerRegistrationDto.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ internal class ServerRegistrationDto
3434
[Index(IndexTypes.NonClustered)]
3535
public bool IsActive { get; set; }
3636

37-
[Column("isMaster")]
37+
[Column("isSchedulingPublisher")]
3838
public bool IsSchedulingPublisher { get; set; }
3939
}
4040
}

src/Umbraco.Infrastructure/Persistence/Repositories/Implement/ServerRegistrationRepository.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ public void DeactiveStaleServers(TimeSpan staleTimeout)
121121
{
122122
var timeoutDate = DateTime.Now.Subtract(staleTimeout);
123123

124-
Database.Update<ServerRegistrationDto>("SET isActive=0, isMaster=0 WHERE lastNotifiedDate < @timeoutDate", new { /*timeoutDate =*/ timeoutDate });
124+
Database.Update<ServerRegistrationDto>("SET isActive=0, isSchedulingPublisher=0 WHERE lastNotifiedDate < @timeoutDate", new { /*timeoutDate =*/ timeoutDate });
125125
ClearCache();
126126
}
127127
}

src/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/NPocoTests/NPocoBulkInsertTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ public void Generate_Bulk_Import_Sql()
175175
// Assert
176176
Assert.That(
177177
commands[0].CommandText,
178-
Is.EqualTo("INSERT INTO [umbracoServer] ([umbracoServer].[address], [umbracoServer].[computerName], [umbracoServer].[registeredDate], [umbracoServer].[lastNotifiedDate], [umbracoServer].[isActive], [umbracoServer].[isMaster]) VALUES (@0,@1,@2,@3,@4,@5), (@6,@7,@8,@9,@10,@11)"));
178+
Is.EqualTo("INSERT INTO [umbracoServer] ([umbracoServer].[address], [umbracoServer].[computerName], [umbracoServer].[registeredDate], [umbracoServer].[lastNotifiedDate], [umbracoServer].[isActive], [umbracoServer].[isSchedulingPublisher]) VALUES (@0,@1,@2,@3,@4,@5), (@6,@7,@8,@9,@10,@11)"));
179179
}
180180

181181
[Test]

0 commit comments

Comments
 (0)