From 075f8764d76507a2acbc10847b3fffe4edd36508 Mon Sep 17 00:00:00 2001 From: Mathias Wagner Date: Sat, 9 Jul 2022 17:35:38 +0200 Subject: [PATCH] Renamed the 'user_id' column into 'author' & added a ref to the 'users' schema --- models/Addon.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/models/Addon.js b/models/Addon.js index 6ac602c..0335aea 100644 --- a/models/Addon.js +++ b/models/Addon.js @@ -36,8 +36,9 @@ const AddonSchema = new mongoose.Schema({ type: Number, default: 0 }, - user_id: { // The id of the author + author: { // The author type: mongoose.mongo.ObjectId, + ref: 'users', required: true }, price: Number // The price needed to pay for the addon