Skip to content

Commit

Permalink
Set the comments 'parent' schema item to optional
Browse files Browse the repository at this point in the history
  • Loading branch information
MKHenson committed May 20, 2016
1 parent b91db03 commit 2e141c3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion server/dist/src/models/comments-model.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class CommentsModel extends model_1.Model {
super("comments");
this.defaultSchema.add(new schema_item_factory_1.text("author", "")).setRequired(true);
this.defaultSchema.add(new schema_item_factory_1.foreignKey("post", "", "posts", false)).setRequired(true);
this.defaultSchema.add(new schema_item_factory_1.foreignKey("parent", "", "comments"));
this.defaultSchema.add(new schema_item_factory_1.foreignKey("parent", "", "comments", true));
this.defaultSchema.add(new schema_item_factory_1.html("content", "", schema_html_1.SchemaHtml.defaultTags.concat("img"), undefined, true));
this.defaultSchema.add(new schema_item_factory_1.bool("public", true));
this.defaultSchema.add(new schema_item_factory_1.date("createdOn")).setIndexable(true);
Expand Down
2 changes: 1 addition & 1 deletion server/src/models/comments-model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export class CommentsModel extends Model

this.defaultSchema.add(new text("author", "")).setRequired(true)
this.defaultSchema.add(new foreignKey("post", "", "posts", false)).setRequired(true)
this.defaultSchema.add(new foreignKey("parent", "", "comments"))
this.defaultSchema.add(new foreignKey("parent", "", "comments", true))
this.defaultSchema.add(new html( "content", "", SchemaHtml.defaultTags.concat("img"), undefined, true));
this.defaultSchema.add(new bool("public", true));
this.defaultSchema.add(new date("createdOn")).setIndexable(true);
Expand Down

0 comments on commit 2e141c3

Please sign in to comment.