'use strict';

/**
 * Module dependencies.
 */
var mongoose = require('mongoose'),
	Schema = mongoose.Schema;

/**
 * Survey Schema
 */
var SurveySchema = new Schema({
	created: {
		type: Date,
		default: Date.now
	},
	id: {
		type: String,
		default: '',
		trim: true,
		required: 'Id cannot be blank'
	},
	answer: {
		type: String,
		default: '',
		trim: true,
		required: 'Answer cannot be blank'
	},
	user: {
		type: Schema.ObjectId,
		ref: 'User'
	}
});

mongoose.model('Survey', SurveySchema);
@@ -165,58 +165,8 @@
 a(%7B%0A
-%09created: %7B%0A%09%09type: Date,%0A%09%09default: Date.now%0A%09%7D,%0A
 %09id:
@@ -205,32 +205,48 @@
 ,%0A%09%09trim: true,%0A
+%09%09unique: true,%0A
 %09%09required: 'Id 
@@ -264,21 +264,19 @@
 lank
+.
 '%0A%09%7D,%0A%09
-answer
+end
 : %7B%0A
@@ -275,38 +275,36 @@
 %09end: %7B%0A%09%09type: 
-String
+Date
 ,%0A%09%09default: '',
@@ -304,67 +304,53 @@
 lt: 
-'',%0A%09%09trim: true,%0A%09%09required: 'Answer cannot be blank'%0A%09%7D,%0A
+null%0A%09%7D,%0A%09answers: %7B%0A%09%09type: %5Bnew Schema(%7B%0A%09%09
 %09use
@@ -350,24 +350,26 @@
 %0A%09%09%09user: %7B%0A
+%09%09
 %09%09type: Sche
@@ -381,16 +381,18 @@
 jectId,%0A
+%09%09
 %09%09ref: '
@@ -397,16 +397,206 @@
  'User'%0A
+%09%09%09%7D,%0A%09%09%09submitted: %7B%0A%09%09%09%09type: Date,%0A%09%09%09%09default: Date.now%0A%09%09%09%7D,%0A%09%09%09answer: %7B%0A%09%09%09%09type: String,%0A%09%09%09%09default: '',%0A%09%09%09%09trim: true%0A%09%09%09%7D%0A%09%09%7D, %7B%0A%09%09%09id: false,%0A%09%09%09_id: false%0A%09%09%7D)%5D,%0A%09%09default: %5B%5D%0A
 %09%7D%0A%7D);%0A%0A
@@ -634,8 +634,9 @@
 Schema);
+%0A

Change model for surveys