Skip to content

Commit c489c40

Browse files
committed
Migration updates
1 parent 2a15b17 commit c489c40

File tree

4 files changed

+9
-7
lines changed

4 files changed

+9
-7
lines changed

src/Umbraco.Cms.Integrations.Crm.Dynamics/Constants.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ public class Constants
1111

1212
public const string AlterAccessTokenColumnLengthTargetStateName = "dynamicsOAuthConfiguration-alter-access-token-column-length-db";
1313

14+
public const int AccessTokenFieldSize = 4000;
15+
1416
public const string AppPluginFolderPath = "~/App_Plugins/UmbracoCms.Integrations/Crm/Dynamics";
1517

1618
public static class RenderingComponent

src/Umbraco.Cms.Integrations.Crm.Dynamics/Migrations/DynamicsMigration.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public class DynamicsOAuthConfigurationTable
6262
public int Id { get; set; }
6363

6464
[Column("AccessToken")]
65-
[Length(2048)]
65+
[Length(Constants.AccessTokenFieldSize)]
6666
public string AccessToken { get; set; }
6767

6868
[Column("UserId")]

src/Umbraco.Cms.Integrations.Crm.Dynamics/Migrations/DynamicsMigrationPlan.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public DynamicsMigrationPlan() : base(Constants.MigrationPlanName)
1212
{
1313
From(string.Empty)
1414
.To<DynamicsMigration>(Constants.TargetStateName)
15-
.To<AlterAccessTokenColumnLength>(Constants.AlterAccessTokenColumnLengthTargetStateName);
15+
.To<EnsureAccessTokenColumnLength>(Constants.AlterAccessTokenColumnLengthTargetStateName);
1616
}
1717
}
1818
}

src/Umbraco.Cms.Integrations.Crm.Dynamics/Migrations/AlterAccessTokenColumnLength.cs renamed to src/Umbraco.Cms.Integrations.Crm.Dynamics/Migrations/EnsureAccessTokenColumnLength.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99

1010
namespace Umbraco.Cms.Integrations.Crm.Dynamics.Migrations
1111
{
12-
public class AlterAccessTokenColumnLength : MigrationBase
12+
public class EnsureAccessTokenColumnLength : MigrationBase
1313
{
14-
public AlterAccessTokenColumnLength(IMigrationContext context) : base(context)
14+
public EnsureAccessTokenColumnLength(IMigrationContext context) : base(context)
1515
{
1616
}
1717

@@ -22,15 +22,15 @@ public override void Migrate()
2222
#endif
2323
{
2424
#if NETCOREAPP
25-
Logger.LogDebug("Running migration {0}", nameof(AlterAccessTokenColumnLength));
25+
Logger.LogDebug("Running migration {0}", nameof(EnsureAccessTokenColumnLength));
2626

2727
#else
28-
Logger.Debug<AlterAccessTokenColumnLength>("Running migration {0}", nameof(AlterAccessTokenColumnLength));
28+
Logger.Debug<EnsureAccessTokenColumnLength>("Running migration {0}", nameof(EnsureAccessTokenColumnLength));
2929
#endif
3030

3131
Alter.Table(Constants.DynamicsOAuthConfigurationTable)
3232
.AlterColumn(nameof(DynamicsOAuthConfigurationTable.AccessToken))
33-
.AsString(4000)
33+
.AsString(Constants.AccessTokenFieldSize)
3434
.NotNullable()
3535
.Do();
3636

0 commit comments

Comments
 (0)