Removed unused Guid property from LayoutRecord.

This commit is contained in:
Sipke Schoorstra
2015-10-13 20:41:05 +02:00
parent 5344ed2e2a
commit 161ac92c9e
4 changed files with 3 additions and 23 deletions

View File

@@ -105,7 +105,7 @@ namespace Orchard.Projections.Controllers {
model.Form = form; model.Form = form;
if (ModelState.IsValid) { if (ModelState.IsValid) {
var layoutRecord = new LayoutRecord { Guid = Guid.NewGuid() ,Category = model.Category, Type = model.Type }; var layoutRecord = new LayoutRecord { Category = model.Category, Type = model.Type };
var query = _queryService.GetQuery(model.QueryId); var query = _queryService.GetQuery(model.QueryId);
query.Layouts.Add(layoutRecord); query.Layouts.Add(layoutRecord);

View File

@@ -84,7 +84,6 @@ namespace Orchard.Projections.Drivers {
return new XElement("Layout", return new XElement("Layout",
// Attributes // Attributes
new XAttribute("Guid", layout.Guid),
new XAttribute("Category", layout.Category ?? ""), new XAttribute("Category", layout.Category ?? ""),
new XAttribute("Description", layout.Description ?? ""), new XAttribute("Description", layout.Description ?? ""),
new XAttribute("State", state ?? ""), new XAttribute("State", state ?? ""),
@@ -162,7 +161,6 @@ namespace Orchard.Projections.Drivers {
part.Record.Layouts.Clear(); part.Record.Layouts.Clear();
foreach (var item in queryElement.Element("Layouts").Elements("Layout").Select(layout => { foreach (var item in queryElement.Element("Layouts").Elements("Layout").Select(layout => {
var guid = layout.Attr("Guid");
var category = layout.Attribute("Category").Value; var category = layout.Attribute("Category").Value;
var type = layout.Attribute("Type").Value; var type = layout.Attribute("Type").Value;
var state = layout.Attribute("State").Value; var state = layout.Attribute("State").Value;
@@ -173,7 +171,6 @@ namespace Orchard.Projections.Drivers {
} }
return new LayoutRecord { return new LayoutRecord {
Guid = !String.IsNullOrWhiteSpace(guid) ? Guid.Parse(guid) : Guid.NewGuid(),
Category = category, Category = category,
Description = layout.Attribute("Description").Value, Description = layout.Attribute("Description").Value,
Display = int.Parse(layout.Attribute("Display").Value), Display = int.Parse(layout.Attribute("Display").Value),

View File

@@ -103,7 +103,6 @@ namespace Orchard.Projections {
SchemaBuilder.CreateTable("LayoutRecord", SchemaBuilder.CreateTable("LayoutRecord",
table => table table => table
.Column<int>("Id", c => c.PrimaryKey().Identity()) .Column<int>("Id", c => c.PrimaryKey().Identity())
.Column<Guid>("Guid")
.Column<string>("Category", c => c.WithLength(64)) .Column<string>("Category", c => c.WithLength(64))
.Column<string>("Type", c => c.WithLength(64)) .Column<string>("Type", c => c.WithLength(64))
.Column<string>("Description", c => c.WithLength(255)) .Column<string>("Description", c => c.WithLength(255))
@@ -114,9 +113,6 @@ namespace Orchard.Projections {
.Column<int>("GroupProperty_id") .Column<int>("GroupProperty_id")
); );
SchemaBuilder.AlterTable("LayoutRecord", table => table
.CreateIndex("IDX_LR_GUID", "Guid"));
SchemaBuilder.CreateTable("PropertyRecord", SchemaBuilder.CreateTable("PropertyRecord",
table => table table => table
.Column<int>("Id", c => c.PrimaryKey().Identity()) .Column<int>("Id", c => c.PrimaryKey().Identity())
@@ -267,7 +263,7 @@ namespace Orchard.Projections {
ContentDefinitionManager.AlterTypeDefinition("ProjectionPage", cfg => cfg.Listable()); ContentDefinitionManager.AlterTypeDefinition("ProjectionPage", cfg => cfg.Listable());
return 4; return 3;
} }
public int UpdateFrom2() { public int UpdateFrom2() {
@@ -277,16 +273,5 @@ namespace Orchard.Projections {
return 3; return 3;
} }
public int UpdateFrom3() {
SchemaBuilder.AlterTable("LayoutRecord", table => table
.AddColumn<Guid>("Guid")
);
SchemaBuilder.AlterTable("LayoutRecord", table => table
.CreateIndex("IDX_LR_GUID", "Guid"));
return 4;
}
} }
} }

View File

@@ -1,5 +1,4 @@
using System; using System.Collections.Generic;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using Orchard.Data.Conventions; using Orchard.Data.Conventions;
@@ -10,7 +9,6 @@ namespace Orchard.Projections.Models {
} }
public virtual int Id { get; set; } public virtual int Id { get; set; }
public virtual Guid Guid { get; set; }
public virtual string Description { get; set; } public virtual string Description { get; set; }
public virtual string Category { get; set; } public virtual string Category { get; set; }
public virtual string Type { get; set; } public virtual string Type { get; set; }