Add new hasAccessToAllLanguages migration
This commit is contained in:
@@ -292,5 +292,6 @@ public class UmbracoPlan : MigrationPlan
|
||||
|
||||
// TO 10.2.0
|
||||
To<AddUserGroup2LanguageTable>("{D0B3D29D-F4D5-43E3-BA67-9D49256F3266}");
|
||||
To<AddHasAccessToAllLanguagesColumn>("{79D8217B-5920-4C0E-8E9A-3CF8FA021882}");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
using Umbraco.Cms.Core;
|
||||
|
||||
namespace Umbraco.Cms.Infrastructure.Migrations.Upgrade.V_10_2_0;
|
||||
|
||||
public class AddHasAccessToAllLanguagesColumn : MigrationBase
|
||||
{
|
||||
public AddHasAccessToAllLanguagesColumn(IMigrationContext context) : base(context)
|
||||
{
|
||||
}
|
||||
|
||||
protected override void Migrate()
|
||||
{
|
||||
if (ColumnExists(Constants.DatabaseSchema.Tables.UserGroup, "hasAccessToAllLanguages") is false)
|
||||
{
|
||||
Create.Column("hasAccessToAllLanguages")
|
||||
.OnTable(Constants.DatabaseSchema.Tables.UserGroup)
|
||||
.AsBoolean()
|
||||
.WithDefaultValue(true)
|
||||
.Do();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,4 @@
|
||||
using Umbraco.Cms.Core;
|
||||
using Umbraco.Cms.Infrastructure.Persistence.Dtos;
|
||||
using Umbraco.Cms.Infrastructure.Persistence.Dtos;
|
||||
using Umbraco.Extensions;
|
||||
|
||||
namespace Umbraco.Cms.Infrastructure.Migrations.Upgrade.V_10_2_0;
|
||||
@@ -14,12 +13,6 @@ public class AddUserGroup2LanguageTable : MigrationBase
|
||||
{
|
||||
IEnumerable<string> tables = SqlSyntax.GetTablesInSchema(Context.Database);
|
||||
|
||||
Create.Column("hasAccessToAllLanguages")
|
||||
.OnTable(Constants.DatabaseSchema.Tables.UserGroup)
|
||||
.AsBoolean()
|
||||
.WithDefaultValue(true)
|
||||
.Do();
|
||||
|
||||
if (tables.InvariantContains(UserGroup2LanguageDto.TableName))
|
||||
{
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user