-
Notifications
You must be signed in to change notification settings - Fork 4
/
db.js
34 lines (29 loc) · 785 Bytes
/
db.js
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
const mongoose = require('mongoose');
const passportLocalMongoose = require('passport-local-mongoose');
var self = module.exports = {}
self.models = {}
const Schema = mongoose.Schema;
const UserSchema = new Schema({
name: String,
username: String,
password: String
});
UserSchema.plugin(passportLocalMongoose);
const EcommerceSchema = new Schema({
name: String,
description: String,
stripe: Object,
logo: String,
theme: String,
domain: String,
homeDescription: String,
homeTitle: String,
facebook: String,
instagram: String,
apiKey: String,
airtable: Object,
fieldsMapping : Object,
data: Object,
});
self.models.User = mongoose.model('User', UserSchema, 'User');
self.models.Ecommerce = mongoose.model('Ecommerce', EcommerceSchema, 'Ecommerce');