File tree Expand file tree Collapse file tree 3 files changed +42
-2
lines changed
src/Umbraco.Cms.Integrations.Crm.Dynamics Expand file tree Collapse file tree 3 files changed +42
-2
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ public class Constants
9
9
10
10
public const string TargetStateName = "dynamicsOAuthConfiguration-db" ;
11
11
12
-
12
+ public const string AlterAccessTokenColumnLengthTargetStateName = "dynamicsOAuthConfiguration-alter-access-token-column-length-db" ;
13
13
14
14
public const string AppPluginFolderPath = "~/App_Plugins/UmbracoCms.Integrations/Crm/Dynamics" ;
15
15
Original file line number Diff line number Diff line change
1
+ #if NETCOREAPP
2
+ using Microsoft . Extensions . Logging ;
3
+ using Umbraco . Cms . Infrastructure . Migrations ;
4
+ using Umbraco . Cms . Infrastructure . Persistence ;
5
+ #else
6
+ using Umbraco . Core . Logging ;
7
+ using Umbraco . Core . Migrations ;
8
+ #endif
9
+
10
+ namespace Umbraco . Cms . Integrations . Crm . Dynamics . Migrations
11
+ {
12
+ public class AlterAccessTokenColumnLength : MigrationBase
13
+ {
14
+ public AlterAccessTokenColumnLength ( IMigrationContext context ) : base ( context )
15
+ {
16
+ }
17
+
18
+ #if NETCOREAPP
19
+ protected override void Migrate ( )
20
+ #else
21
+ public override void Migrate ( )
22
+ #endif
23
+ {
24
+ #if NETCOREAPP
25
+ Logger . LogDebug ( "Running migration {0}" , nameof ( AlterAccessTokenColumnLength ) ) ;
26
+
27
+ #else
28
+ Logger . Debug < AlterAccessTokenColumnLength > ( "Running migration {0}" , nameof ( AlterAccessTokenColumnLength ) ) ;
29
+ #endif
30
+
31
+ Alter . Table ( Constants . DynamicsOAuthConfigurationTable )
32
+ . AlterColumn ( nameof ( DynamicsOAuthConfigurationTable . AccessToken ) )
33
+ . AsString ( 4000 )
34
+ . NotNullable ( )
35
+ . Do ( ) ;
36
+
37
+ }
38
+ }
39
+ }
Original file line number Diff line number Diff line change @@ -11,7 +11,8 @@ public class DynamicsMigrationPlan : MigrationPlan
11
11
public DynamicsMigrationPlan ( ) : base ( Constants . MigrationPlanName )
12
12
{
13
13
From ( string . Empty )
14
- . To < DynamicsMigration > ( Constants . TargetStateName ) ;
14
+ . To < DynamicsMigration > ( Constants . TargetStateName )
15
+ . To < AlterAccessTokenColumnLength > ( Constants . AlterAccessTokenColumnLengthTargetStateName ) ;
15
16
}
16
17
}
17
18
}
You can’t perform that action at this time.
0 commit comments