/
Migrations.cs
43 lines (37 loc) · 1.54 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
using System;
using System.Collections.Generic;
using System.Data;
using Orchard.ContentManagement.Drivers;
using Orchard.ContentManagement.MetaData;
using Orchard.ContentManagement.MetaData.Builders;
using Orchard.Core.Contents.Extensions;
using Orchard.Data.Migration;
namespace Datwendo.ConnectorFeeder {
public class Migrations : DataMigrationImpl {
public int Create()
{
SchemaBuilder.CreateTable("ConnectorFeederPartRecord", table => table
.ContentPartRecord()
.Column<int>("PublisherId", c => c.WithDefault(0))
.Column<string>("DataReceived", c => c.Nullable().WithLength(4096))
);
ContentDefinitionManager.AlterPartDefinition("ConnectorFeederPart",
builder => builder.Attachable());
return 2;
}
public int UpdateFrom1()
{
SchemaBuilder.AlterTable("ConnectorFeederPartRecord", table => table
.DropColumn("PartName")
);
SchemaBuilder.AlterTable("ConnectorFeederPartRecord", table => table
.DropColumn("PropertyName")
);
SchemaBuilder.AlterTable("ConnectorFeederPartRecord", table => table
.AddColumn<int>("PublisherId", c => c.WithDefault(0)));
SchemaBuilder.AlterTable("ConnectorFeederPartRecord", table => table
.AddColumn<string>("DataReceived", c => c.Nullable().WithLength(4096)));
return 2;
}
}
}