'use strict'

module.exports = function (Schema) {
  return {
    user: new Schema({
      properties: {
        id: { type: 'string' },
        name: { type: 'string' }
      }
    }),

    post: new Schema({
      properties: {
        id: { type: 'string' },
        // Only the DataStore component cares about the "indexed" attribute
        user_id: { type: 'string', indexed: true },
        title: { type: 'string' },
        content: { type: 'string' }
      }
    }),

    comment: new Schema({
      properties: {
        id: { type: 'string' },
        // Only the DataStore component cares about the "indexed" attribute
        post_id: { type: 'string', indexed: true },
        // Only the DataStore component cares about the "indexed" attribute
        user_id: { type: 'string', indexed: true },
        content: { type: 'string' }
      }
    })
  }
}

@@ -1,93 +1,239 @@
-'use strict'%0A%0Amodule.exports = function (
+import %7B Schema %7D from 'js-data';%0A%0Aexport const user = new 
 Schema
-) 
+(
 %7B%0A  
-return %7B%0A    user: new Schema(%7B%0A    
+$schema: 'http://json-schema.org/draft-04/schema#', // optional%0A  title: 'User', // optional%0A  description: 'Schema for User records', // optional%0A  type: 'object',%0A
   pr
@@ -236,36 +236,32 @@
   properties: %7B%0A
-    
     id: %7B type: 
@@ -257,39 +257,35 @@
 d: %7B type: '
-string
+number
 ' %7D,%0A
-    
     name: %7B 
@@ -307,32 +307,34 @@
 %7D%0A  
-    %7D%0A    %7D),%0A%0A   
+%7D%0A%7D);%0A%0Aexport const
  post
-:
+ =
  new
@@ -337,34 +337,48 @@
  new Schema(%7B%0A  
-  
+type: 'object',%0A
   properties: %7B%0A
@@ -373,36 +373,32 @@
 operties: %7B%0A    
-    
 id: %7B type: 'str
@@ -386,38 +386,38 @@
    id: %7B type: '
-string
+number
 ' %7D,%0A        // 
@@ -401,36 +401,32 @@
 'number' %7D,%0A    
-    
 // Only the Data
@@ -423,32 +423,48 @@
 y the DataStore 
+and SimpleStore 
 component cares 
@@ -448,38 +448,38 @@
 eStore component
+s
  care
-s
  about the %22inde
@@ -489,36 +489,32 @@
 %22 attribute%0A    
-    
 user_id: %7B type:
@@ -507,38 +507,38 @@
 er_id: %7B type: '
-string
+number
 ', indexed: true
@@ -537,28 +537,24 @@
 ed: true %7D,%0A
-    
     title: %7B
@@ -568,28 +568,24 @@
 'string' %7D,%0A
-    
     content:
@@ -607,37 +607,88 @@
 g' %7D
+,
 %0A    
-  %7D%0A    %7D),%0A%0A   
+date_published: %7B type: %5B'string', 'null'%5D %7D%0A  %7D%0A%7D);%0A%0Aexport const
  comment
 : ne
@@ -683,17 +683,18 @@
  comment
-:
+ =
  new Sch
@@ -701,18 +701,32 @@
 ema(%7B%0A  
-  
+type: 'object',%0A
   proper
@@ -737,20 +737,16 @@
 : %7B%0A    
-    
 id: %7B ty
@@ -750,31 +750,27 @@
  type: '
-string
+number
 ' %7D,%0A
-    
     // O
@@ -779,32 +779,48 @@
 y the DataStore 
+and SimpleStore 
 component cares 
@@ -804,38 +804,38 @@
 eStore component
+s
  care
-s
  about the %22inde
@@ -853,20 +853,16 @@
 ute%0A    
-    
 post_id:
@@ -863,38 +863,38 @@
 st_id: %7B type: '
-string
+number
 ', indexed: true
@@ -893,28 +893,24 @@
 ed: true %7D,%0A
-    
     // Only 
@@ -919,24 +919,40 @@
 e DataStore 
+and SimpleStore 
 component ca
@@ -952,14 +952,14 @@
 nent
+s
  care
-s
  abo
@@ -989,20 +989,16 @@
 ute%0A    
-    
 user_id:
@@ -1007,22 +1007,22 @@
  type: '
-string
+number
 ', index
@@ -1037,20 +1037,16 @@
  %7D,%0A    
-    
 content:
@@ -1069,25 +1069,12 @@
 ' %7D%0A
-      %7D%0A    %7D)%0A
   %7D%0A%7D
+);
 %0A

Update schemas.js