From 3bbb82c13da4eb9c2253f935ae347563308ac1d3 Mon Sep 17 00:00:00 2001 From: AdrianSantamarina Date: Wed, 6 Mar 2024 17:56:13 +0100 Subject: [PATCH] =?UTF-8?q?Creaci=C3=B3n=20tabla=20historial?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- users/userservice/database/history-model.js | 28 +++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 users/userservice/database/history-model.js diff --git a/users/userservice/database/history-model.js b/users/userservice/database/history-model.js new file mode 100644 index 00000000..3b26c015 --- /dev/null +++ b/users/userservice/database/history-model.js @@ -0,0 +1,28 @@ +const mongoose = require('mongoose'); + +const historySchema = new mongoose.Schema({ + total_correct_answers: { + type: Number, + required: true, + }, + total_failed_answers: { + type: Number, + required: true, + }, + total_punctuation: { + type: Number, + required: true, + }, + total_time: { + type: TimeStamp, + required: true, + }, + user: { + type: User, + required: true, + }, +}); + +const History = mongoose.model('History', historySchema, 'History'); + +module.exports = History \ No newline at end of file