import { Posts } from './';
import { SimpleSchema } from 'meteor/aldeed:simple-schema';

const postsSchema = new SimpleSchema({
  url: {
    type: String,
    regEx: SimpleSchema.RegEx.Url,
  },
});

Posts.attachSchema(postsSchema);

@@ -188,16 +188,310 @@
 l,%0A  %7D,%0A
+  createdAt: %7B%0A    type: Date,%0A    autoValue: function() %7B%0A      if (this.isInsert) %7B%0A        return new Date();%0A      %7D else if (this.isUpsert) %7B%0A        return %7B$setOnInsert: new Date()%7D;%0A      %7D else %7B%0A        this.unset();  // Prevent user from supplying their own value%0A      %7D%0A    %7D%0A  %7D,%0A
 %7D);%0A%0APos

Add createdAt field