summaryrefslogtreecommitdiff
path: root/models/EventGroup.js
blob: 336074c2df4e661fea9f40cd355e48f3ca013d04 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
const mongoose = require('mongoose');

const EventGroupSchema = new mongoose.Schema({
	id: {
		type: String,
		required: true,
		unique: true
	},
	name: {
		type: String,
		trim: true,
		required: true
	},
	description: {
		type: String,
		trim: true,
		required: true
	},
	image: {
		type: String,
		trim: true
	},
	url: {
		type: String,
		trim: true
	},
	creatorEmail: {
		type: String,
		trim: true
	},
	hostName: {
		type: String,
		trim: true
	},
	editToken: {
		type: String,
		trim: true,
		minlength: 32,
		maxlength: 32
	},
	firstLoad: {
		type: Boolean,
		trim: true,
		default: true
	},
	events: [{ type: mongoose.Schema.Types.ObjectId, ref: 'Event' }]
});

module.exports = mongoose.model('EventGroup', EventGroupSchema);