mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
Fixing List changes
This commit is contained in:
@@ -48,7 +48,7 @@ namespace Orchard.Core.Containers {
|
|||||||
.Attachable()
|
.Attachable()
|
||||||
.WithDescription("Allows your content item to be contained by a content item that has the ContainerPart attached."));
|
.WithDescription("Allows your content item to be contained by a content item that has the ContainerPart attached."));
|
||||||
|
|
||||||
return 5;
|
return 6;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int UpdateFrom1() {
|
public int UpdateFrom1() {
|
||||||
@@ -83,8 +83,6 @@ namespace Orchard.Core.Containers {
|
|||||||
ContentDefinitionManager.DeleteTypeDefinition("CustomPropertiesPart");
|
ContentDefinitionManager.DeleteTypeDefinition("CustomPropertiesPart");
|
||||||
SchemaBuilder.DropTable("CustomPropertiesPartRecord");
|
SchemaBuilder.DropTable("CustomPropertiesPartRecord");
|
||||||
SchemaBuilder.AlterTable("ContainerPartRecord", table => {
|
SchemaBuilder.AlterTable("ContainerPartRecord", table => {
|
||||||
table.DropColumn("OrderByProperty");
|
|
||||||
table.DropColumn("OrderByDirection");
|
|
||||||
table.DropColumn("ItemContentType");
|
table.DropColumn("ItemContentType");
|
||||||
table.AddColumn<string>("ItemContentTypes");
|
table.AddColumn<string>("ItemContentTypes");
|
||||||
table.AddColumn<bool>("ShowOnAdminMenu");
|
table.AddColumn<bool>("ShowOnAdminMenu");
|
||||||
@@ -101,7 +99,29 @@ namespace Orchard.Core.Containers {
|
|||||||
table.AddColumn<int>("Position");
|
table.AddColumn<int>("Position");
|
||||||
});
|
});
|
||||||
|
|
||||||
return 5;
|
return 6;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int UpdateFrom5() {
|
||||||
|
SchemaBuilder.AlterTable("ContainerWidgetPartRecord", table => table
|
||||||
|
.AddColumn<string>("OrderByProperty", c => c.WithLength(64)));
|
||||||
|
|
||||||
|
SchemaBuilder.AlterTable("ContainerWidgetPartRecord", table => table
|
||||||
|
.AddColumn<int>("OrderByDirection"));
|
||||||
|
|
||||||
|
SchemaBuilder.AlterTable("ContainerWidgetPartRecord", table => table
|
||||||
|
.AddColumn<bool>("ApplyFilter"));
|
||||||
|
|
||||||
|
SchemaBuilder.AlterTable("ContainerWidgetPartRecord", table => table
|
||||||
|
.AddColumn<string>("FilterByProperty", c => c.WithLength(64)));
|
||||||
|
|
||||||
|
SchemaBuilder.AlterTable("ContainerWidgetPartRecord", table => table
|
||||||
|
.AddColumn<string>("FilterByOperator", c => c.WithLength(4)));
|
||||||
|
|
||||||
|
SchemaBuilder.AlterTable("ContainerWidgetPartRecord", table => table
|
||||||
|
.AddColumn<string>("FilterByValue", c => c.WithLength(128)));
|
||||||
|
|
||||||
|
return 6;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -20,8 +20,8 @@ namespace Orchard.Lists.Projections {
|
|||||||
bool ascending = Boolean.Parse(Convert.ToString(context.State.Sort));
|
bool ascending = Boolean.Parse(Convert.ToString(context.State.Sort));
|
||||||
var query = (IHqlQuery)context.Query;
|
var query = (IHqlQuery)context.Query;
|
||||||
query = ascending
|
query = ascending
|
||||||
? query.OrderBy(alias => alias.ContentPartRecord<ContainablePartRecord>(), x => x.Asc("Position"))
|
? query.OrderBy(alias => alias.ContentPartRecord<ContainablePartRecord>(), x => x.Desc("Position"))
|
||||||
: query.OrderBy(alias => alias.ContentPartRecord<ContainablePartRecord>(), x => x.Desc("Position"));
|
: query.OrderBy(alias => alias.ContentPartRecord<ContainablePartRecord>(), x => x.Asc("Position"));
|
||||||
|
|
||||||
context.Query = query;
|
context.Query = query;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user