Skip to content

Commit

Permalink
Added 'children' to comments model
Browse files Browse the repository at this point in the history
  • Loading branch information
MKHenson committed May 26, 2016
1 parent ddd068d commit 270f347
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions server/dist/src/models/comments-model.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ class CommentsModel extends model_1.Model {
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", true));
this.defaultSchema.add(new schema_item_factory_1.idArray("children", [], 0, undefined, "comments"));
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
3 changes: 2 additions & 1 deletion server/src/models/comments-model.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {Model} from "./model";
import {num, text, bool, textArray, date, html, foreignKey} from "./schema-items/schema-item-factory";
import {num, text, bool, textArray, idArray, date, html, foreignKey} from "./schema-items/schema-item-factory";
import {SchemaHtml} from "./schema-items/schema-html";


Expand All @@ -12,6 +12,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", true))
this.defaultSchema.add(new idArray("children", [], 0, undefined, "comments"))
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 270f347

Please sign in to comment.