forked from CloudMetal/Orchard.Api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMigrations.cs
40 lines (32 loc) · 1.01 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
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 Orchard.Api
{
public class Migrations : DataMigrationImpl
{
public int Create()
{
SchemaBuilder.CreateTable("ApiPartRecord", table => table
.ContentPartRecord()
.Column<bool>("Enabled")
);
ContentDefinitionManager.AlterPartDefinition("ApiPart", p => p
.Attachable()
.WithDescription("Registers a content type for access via REST API."));
return 1;
}
public int UpdateFrom1() {
SchemaBuilder.CreateTable("ApiSettingsPartRecord", table => table
.ContentPartRecord()
.Column<bool>("Enabled")
);
return 2;
}
}
}