From 56024bb861111000d9e20afe3105d221bb75c98d Mon Sep 17 00:00:00 2001 From: Idan Cohen Date: Mon, 17 Dec 2018 20:34:40 +0200 Subject: [PATCH 1/2] add eventsPhases model --- server/models/eventsPhases.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 server/models/eventsPhases.js diff --git a/server/models/eventsPhases.js b/server/models/eventsPhases.js new file mode 100644 index 00000000..89e7e89b --- /dev/null +++ b/server/models/eventsPhases.js @@ -0,0 +1,15 @@ +const mongoose = require('mongoose'); +const Schema = mongoose.Schema; + +const eventsPhasesSchema = new Schema({ + _id: String, + eventId: String, + phase1GrantingStart: Date, + phase1GrantingEnd: Date, + phase2PurchaseStart: Date, + phase2PurchaseEnd: Date, +}, {_id: false, timestamps: {createdAt: 'createdAt', updatedAt: 'updatedAt'}}); + +const eventsPhases = mongoose.model('EventsPhases', eventsPhasesSchema); + +module.exports = eventsPhases; From 37fdac65e01f696d466d083e71662394f7367060 Mon Sep 17 00:00:00 2001 From: Idan Cohen Date: Mon, 17 Dec 2018 20:37:12 +0200 Subject: [PATCH 2/2] change columns names --- server/models/eventsPhases.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/server/models/eventsPhases.js b/server/models/eventsPhases.js index 89e7e89b..e5effa99 100644 --- a/server/models/eventsPhases.js +++ b/server/models/eventsPhases.js @@ -4,10 +4,10 @@ const Schema = mongoose.Schema; const eventsPhasesSchema = new Schema({ _id: String, eventId: String, - phase1GrantingStart: Date, - phase1GrantingEnd: Date, - phase2PurchaseStart: Date, - phase2PurchaseEnd: Date, + phase1GrantingStartDate: Date, + phase1GrantingEndDate: Date, + phase2PurchaseStartDate: Date, + phase2PurchaseEndDate: Date, }, {_id: false, timestamps: {createdAt: 'createdAt', updatedAt: 'updatedAt'}}); const eventsPhases = mongoose.model('EventsPhases', eventsPhasesSchema);