-
Notifications
You must be signed in to change notification settings - Fork 8
/
Migrations.cs
44 lines (40 loc) · 1.41 KB
/
Migrations.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
using Orchard.Data.Migration;
using Orchard;
using Orchard.ContentManagement;
using SH.GoogleAnalytics.Models;
namespace SH.GoogleAnalytics {
public class Migrations : DataMigrationImpl {
public int Create() {
SchemaBuilder.CreateTable("GoogleAnalyticsSettingsPartRecord",
table => table
.ContentPartRecord()
.Column<string>("GoogleAnalyticsKey")
.Column<string>("DomainName")
.Column<bool>("UseAsyncTracking")
.Column<bool>("TrackOnAdmin")
);
return 1;
}
public int UpdateFrom1() {
SchemaBuilder.AlterTable("GoogleAnalyticsSettingsPartRecord", table => table
.AddColumn<bool>("UseDoubleClick")
);
return 2;
}
public int UpdateFrom2()
{
SchemaBuilder.AlterTable("GoogleAnalyticsSettingsPartRecord", table => {
table.AddColumn<bool>("UseUniversalAnalytics");
table.AddColumn<bool>("UseEnhancedLinkAttribution");
});
return 3;
}
public int UpdateFrom3()
{
SchemaBuilder.AlterTable("GoogleAnalyticsSettingsPartRecord", table => table
.AddColumn<string>("AdditionalScripts", c => c.Unlimited())
);
return 4;
}
}
}