Renamed the 'user_id' column into 'author' & added a ref to the 'users' schema

This commit is contained in:
2022-07-09 17:35:38 +02:00
parent 79d598002f
commit 075f8764d7

View File

@@ -36,8 +36,9 @@ const AddonSchema = new mongoose.Schema({
type: Number, type: Number,
default: 0 default: 0
}, },
user_id: { // The id of the author author: { // The author
type: mongoose.mongo.ObjectId, type: mongoose.mongo.ObjectId,
ref: 'users',
required: true required: true
}, },
price: Number // The price needed to pay for the addon price: Number // The price needed to pay for the addon