File tree Expand file tree Collapse file tree 4 files changed +9
-7
lines changed
src/Umbraco.Cms.Integrations.Crm.Dynamics Expand file tree Collapse file tree 4 files changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,8 @@ public class Constants
11
11
12
12
public const string AlterAccessTokenColumnLengthTargetStateName = "dynamicsOAuthConfiguration-alter-access-token-column-length-db" ;
13
13
14
+ public const int AccessTokenFieldSize = 4000 ;
15
+
14
16
public const string AppPluginFolderPath = "~/App_Plugins/UmbracoCms.Integrations/Crm/Dynamics" ;
15
17
16
18
public static class RenderingComponent
Original file line number Diff line number Diff line change @@ -62,7 +62,7 @@ public class DynamicsOAuthConfigurationTable
62
62
public int Id { get ; set ; }
63
63
64
64
[ Column ( "AccessToken" ) ]
65
- [ Length ( 2048 ) ]
65
+ [ Length ( Constants . AccessTokenFieldSize ) ]
66
66
public string AccessToken { get ; set ; }
67
67
68
68
[ Column ( "UserId" ) ]
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ public DynamicsMigrationPlan() : base(Constants.MigrationPlanName)
12
12
{
13
13
From ( string . Empty )
14
14
. To < DynamicsMigration > ( Constants . TargetStateName )
15
- . To < AlterAccessTokenColumnLength > ( Constants . AlterAccessTokenColumnLengthTargetStateName ) ;
15
+ . To < EnsureAccessTokenColumnLength > ( Constants . AlterAccessTokenColumnLengthTargetStateName ) ;
16
16
}
17
17
}
18
18
}
Original file line number Diff line number Diff line change 9
9
10
10
namespace Umbraco . Cms . Integrations . Crm . Dynamics . Migrations
11
11
{
12
- public class AlterAccessTokenColumnLength : MigrationBase
12
+ public class EnsureAccessTokenColumnLength : MigrationBase
13
13
{
14
- public AlterAccessTokenColumnLength ( IMigrationContext context ) : base ( context )
14
+ public EnsureAccessTokenColumnLength ( IMigrationContext context ) : base ( context )
15
15
{
16
16
}
17
17
@@ -22,15 +22,15 @@ public override void Migrate()
22
22
#endif
23
23
{
24
24
#if NETCOREAPP
25
- Logger . LogDebug ( "Running migration {0}" , nameof ( AlterAccessTokenColumnLength ) ) ;
25
+ Logger . LogDebug ( "Running migration {0}" , nameof ( EnsureAccessTokenColumnLength ) ) ;
26
26
27
27
#else
28
- Logger . Debug < AlterAccessTokenColumnLength > ( "Running migration {0}" , nameof ( AlterAccessTokenColumnLength ) ) ;
28
+ Logger . Debug < EnsureAccessTokenColumnLength > ( "Running migration {0}" , nameof ( EnsureAccessTokenColumnLength ) ) ;
29
29
#endif
30
30
31
31
Alter . Table ( Constants . DynamicsOAuthConfigurationTable )
32
32
. AlterColumn ( nameof ( DynamicsOAuthConfigurationTable . AccessToken ) )
33
- . AsString ( 4000 )
33
+ . AsString ( Constants . AccessTokenFieldSize )
34
34
. NotNullable ( )
35
35
. Do ( ) ;
36
36
You can’t perform that action at this time.
0 commit comments