-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMigrations.cs
38 lines (32 loc) · 1.22 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
using Orchard.ContentManagement.MetaData;
using Orchard.Data.Migration;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Windsong.VersionManager.Models;
namespace Windsong.VersionManager
{
public class Migrations : DataMigrationImpl {
private readonly IContentDefinitionManager _contentDefinitionManager;
public Migrations(IContentDefinitionManager contentDefinitionManager)
{
_contentDefinitionManager = contentDefinitionManager;
}
public int Create() {
// Creating table BodyPartVersionRecord
SchemaBuilder.CreateTable("BodyPartVersionRecord", table => table
.Column<int>("Id", column => column.PrimaryKey().Identity())
.Column<int>("ContentItemRecord_id", c => c.NotNull())
.Column<int>("ContentItemVersionRecord_id", c => c.NotNull())
.Column<string>("Text")
.Column<string>("Format")
);
SchemaBuilder.AlterTable("BodyPartVersionRecord",
table => table
.CreateIndex("IDX_ContentItemRecord_id", "ContentItemRecord_id")
);
return 1;
}
}
}