forked from sdotson/react-invoice-app
-
Notifications
You must be signed in to change notification settings - Fork 0
/
seed_database.js
51 lines (42 loc) · 931 Bytes
/
seed_database.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
var path = require('path'),
db_models = require('./db_models'),
Sequelize = require('sequelize');
sequelize.sync().then(function() {
Customer.create({
name: "Mark Benson",
address: "353 Rochester St, Rialto FL 43250",
phone: "555-534-2342"
});
Customer.create({
name: "Bob Smith",
address: "215 Market St, Dansville CA 94325",
phone: "555-534-2342"
});
Customer.create({
name: "John Draper",
address: "890 Main St, Fontana IL 31450",
phone: "555-534-2342"
});
Product.create({
name: "Parachute Pants",
price: 29.99
});
Product.create({
name: "Phone Holder",
price: 9.99
});
Product.create({
name: "Pet Rock",
price: 5.99
});
Product.create({
name: "Egg Timer",
price: 15.99
});
Product.create({
name: "Neon Green Hat",
price: 21.99
});
}).catch(function(e) {
console.log("ERROR SYNCING WITH DB", e);
});