aboutsummaryrefslogtreecommitdiff
path: root/models/feedback/feedback.model.ts
diff options
context:
space:
mode:
Diffstat (limited to 'models/feedback/feedback.model.ts')
-rw-r--r--models/feedback/feedback.model.ts7
1 files changed, 7 insertions, 0 deletions
diff --git a/models/feedback/feedback.model.ts b/models/feedback/feedback.model.ts
new file mode 100644
index 0000000..b21747b
--- /dev/null
+++ b/models/feedback/feedback.model.ts
@@ -0,0 +1,7 @@
+import { Model, model } from 'mongoose';
+import { FeedbackSchema, feedbackSchema } from './feedback.schema';
+
+feedbackSchema.index({ version: 1, authorId: 1 }, { unique: true }); // Unique together
+
+export default model<FeedbackSchema, Model<FeedbackSchema>>('Feedback', feedbackSchema);
+