2010-11-09 16:00:51 -08:00
|
|
|
|
using Orchard.ContentManagement.MetaData;
|
2010-11-08 15:33:56 -08:00
|
|
|
|
using Orchard.Core.Contents.Extensions;
|
|
|
|
|
using Orchard.Data.Migration;
|
|
|
|
|
|
|
|
|
|
namespace Orchard.Core.Containers {
|
|
|
|
|
public class Migrations : DataMigrationImpl {
|
|
|
|
|
public int Create() {
|
|
|
|
|
SchemaBuilder.CreateTable("ContainerPartRecord",
|
2010-11-11 16:15:49 -08:00
|
|
|
|
table => table
|
|
|
|
|
.ContentPartRecord()
|
|
|
|
|
.Column<bool>("Paginated")
|
|
|
|
|
.Column<int>("PageSize")
|
|
|
|
|
.Column<string>("OrderByProperty")
|
|
|
|
|
.Column<int>("OrderByDirection"));
|
|
|
|
|
|
2010-11-12 15:35:58 -08:00
|
|
|
|
SchemaBuilder.CreateTable("ContainerWidgetPartRecord",
|
|
|
|
|
table => table
|
|
|
|
|
.ContentPartRecord()
|
|
|
|
|
.Column<int>("ContainerId")
|
|
|
|
|
.Column<int>("PageSize")
|
|
|
|
|
.Column<string>("OrderByProperty")
|
|
|
|
|
.Column<int>("OrderByDirection")
|
|
|
|
|
.Column<bool>("ApplyFilter")
|
|
|
|
|
.Column<string>("FilterByProperty")
|
|
|
|
|
.Column<string>("FilterByOperator")
|
|
|
|
|
.Column<string>("FilterByValue"));
|
|
|
|
|
|
2010-12-02 08:10:32 -08:00
|
|
|
|
SchemaBuilder.CreateTable("CustomPropertiesPartRecord",
|
2010-11-12 15:35:58 -08:00
|
|
|
|
table => table
|
|
|
|
|
.ContentPartRecord()
|
|
|
|
|
.Column<string>("CustomOne")
|
|
|
|
|
.Column<string>("CustomTwo")
|
|
|
|
|
.Column<string>("CustomThree"));
|
|
|
|
|
|
2010-11-11 16:15:49 -08:00
|
|
|
|
ContentDefinitionManager.AlterTypeDefinition("ContainerWidget",
|
|
|
|
|
cfg => cfg
|
|
|
|
|
.WithPart("CommonPart")
|
|
|
|
|
.WithPart("WidgetPart")
|
|
|
|
|
.WithPart("ContainerWidgetPart")
|
|
|
|
|
.WithSetting("Stereotype", "Widget"));
|
2010-11-08 15:33:56 -08:00
|
|
|
|
|
|
|
|
|
ContentDefinitionManager.AlterPartDefinition("ContainerPart", builder => builder.Attachable());
|
|
|
|
|
ContentDefinitionManager.AlterPartDefinition("ContainablePart", builder => builder.Attachable());
|
2010-12-02 08:10:32 -08:00
|
|
|
|
ContentDefinitionManager.AlterPartDefinition("CustomPropertiesPart", builder => builder.Attachable());
|
2010-11-08 15:33:56 -08:00
|
|
|
|
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|