From 450f243797301e439d4638b39fb4574cfef336be Mon Sep 17 00:00:00 2001 From: BurnyLlama Date: Wed, 29 Sep 2021 20:53:24 +0200 Subject: [PATCH] Separeted Finishes from TeamFinishes. --- schemas/{Finishes.js => Finish.js} | 2 +- schemas/TeamFinish.js | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) rename schemas/{Finishes.js => Finish.js} (76%) create mode 100644 schemas/TeamFinish.js diff --git a/schemas/Finishes.js b/schemas/Finish.js similarity index 76% rename from schemas/Finishes.js rename to schemas/Finish.js index 6f75211..2d3fe69 100644 --- a/schemas/Finishes.js +++ b/schemas/Finish.js @@ -4,7 +4,7 @@ const Finish = new mongoose.Schema({ map: { type: mongoose.Schema.ObjectId, ref: 'Level' }, time: Number, time: Date, - players: [{ type: mongoose.Schema.ObjectId, ref: 'Player' }] + player: { type: mongoose.Schema.ObjectId, ref: 'Player' } }) export default mongoose.model("Finish", Finish) \ No newline at end of file diff --git a/schemas/TeamFinish.js b/schemas/TeamFinish.js new file mode 100644 index 0000000..83ae8df --- /dev/null +++ b/schemas/TeamFinish.js @@ -0,0 +1,10 @@ +import mongoose from 'mongoose' + +const TeamFinish = new mongoose.Schema({ + map: { type: mongoose.Schema.ObjectId, ref: 'Level' }, + time: Number, + time: Date, + players: [{ type: mongoose.Schema.ObjectId, ref: 'Player' }] +}) + +export default mongoose.model("TeamFinish", TeamFinish) \ No newline at end of file