|
@@ -1,13 +1,13 @@
|
|
|
const mongoose = require('mongoose');
|
|
const mongoose = require('mongoose');
|
|
|
const config = require('../config/config.json');
|
|
const config = require('../config/config.json');
|
|
|
-const { Ticket } = require('../models/ticket.model');
|
|
|
|
|
-const { Restaurant} = require('../models/restaurant.model');
|
|
|
|
|
-const { User } = require('../models/user.model');
|
|
|
|
|
- const bcrypt = require('bcrypt');
|
|
|
|
|
-const Role = require('../lib/role');
|
|
|
|
|
-//const db = config.url;
|
|
|
|
|
|
|
+//const { Ticket } = require('../models/ticket.model');
|
|
|
|
|
+//const { Restaurant} = require('../models/restaurant.model');
|
|
|
|
|
+// const { User } = require('../models/user.model');
|
|
|
|
|
+ //const bcrypt = require('bcrypt');
|
|
|
|
|
+// const Role = require('../lib/role');
|
|
|
|
|
+const db = config.url;
|
|
|
|
|
|
|
|
-var db = 'mongodb://database_preprod:27017/mean-fatboar-db';
|
|
|
|
|
|
|
+//var db = 'mongodb://database_preprod:27017/mean-fatboar-db';
|
|
|
//var mongoURI = 'mongodb://localhost:27017/my-db';
|
|
//var mongoURI = 'mongodb://localhost:27017/my-db';
|
|
|
//mongoose.set('useCreateIndex', true)
|
|
//mongoose.set('useCreateIndex', true)
|
|
|
mongoose.connect(db, {useNewUrlParser: true, useUnifiedTopology: true })
|
|
mongoose.connect(db, {useNewUrlParser: true, useUnifiedTopology: true })
|
|
@@ -18,22 +18,24 @@ mongoose.connect(db, {useNewUrlParser: true, useUnifiedTopology: true })
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
-let min = 999999999;
|
|
|
|
|
-let max = 10000000000;
|
|
|
|
|
-for (i = 0; i < 500000; i++) {
|
|
|
|
|
- let code = Math.floor(Math.random() * (max - min + 1)) + min;
|
|
|
|
|
|
|
+module.exports = mongoose.connection;
|
|
|
|
|
+
|
|
|
|
|
+// let min = 999999999;
|
|
|
|
|
+// let max = 10000000000;
|
|
|
|
|
+// for (i = 0; i < 2; i++) {
|
|
|
|
|
+// let code = Math.floor(Math.random() * (max - min + 1)) + min;
|
|
|
|
|
|
|
|
- const ticke = new Ticket({
|
|
|
|
|
- code: code,
|
|
|
|
|
- isUsed: false,
|
|
|
|
|
- gains: "une entrée ou un dessert au choix",
|
|
|
|
|
- date_used: new Date(),
|
|
|
|
|
- index: 'index',
|
|
|
|
|
- isServed: true
|
|
|
|
|
- });
|
|
|
|
|
|
|
+// const ticke = new Ticket({
|
|
|
|
|
+// code: code,
|
|
|
|
|
+// isUsed: false,
|
|
|
|
|
+// gains: "un menu du jour",
|
|
|
|
|
+// date_used: new Date(),
|
|
|
|
|
+// index: 'index',
|
|
|
|
|
+// isServed: true
|
|
|
|
|
+// });
|
|
|
|
|
|
|
|
- ticke.save();
|
|
|
|
|
- }
|
|
|
|
|
|
|
+// ticke.save();
|
|
|
|
|
+// }
|
|
|
// const resto = new Restaurant({
|
|
// const resto = new Restaurant({
|
|
|
// "index": 5,
|
|
// "index": 5,
|
|
|
// "name": "FatBoar 5",
|
|
// "name": "FatBoar 5",
|
|
@@ -52,7 +54,7 @@ for (i = 0; i < 500000; i++) {
|
|
|
// firstname: " adrien",
|
|
// firstname: " adrien",
|
|
|
// lastname: "xxxxxxx",
|
|
// lastname: "xxxxxxx",
|
|
|
// email: "adrien@hotmail.fr",
|
|
// email: "adrien@hotmail.fr",
|
|
|
-// role: 'client',
|
|
|
|
|
|
|
+// role: 'admin',
|
|
|
// birthday: date,
|
|
// birthday: date,
|
|
|
// phonenumber: '0680705876',
|
|
// phonenumber: '0680705876',
|
|
|
// isActive: true,
|
|
// isActive: true,
|
|
@@ -60,7 +62,4 @@ for (i = 0; i < 500000; i++) {
|
|
|
// });
|
|
// });
|
|
|
|
|
|
|
|
|
|
|
|
|
-// user.save();
|
|
|
|
|
-
|
|
|
|
|
-module.exports = mongoose.connection;
|
|
|
|
|
-
|
|
|
|
|
|
|
+// user.save();
|