-
Notifications
You must be signed in to change notification settings - Fork 0
/
database.py
83 lines (63 loc) · 2.07 KB
/
database.py
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
from dotenv import load_dotenv
load_dotenv()
from app.models import Employee, Menu, MenuItem, MenuItemType, Table
from app import app, db
with app.app_context():
db.drop_all()
db.create_all()
# employee = Employee(name="Margot", employee_number=1234,
# password="password")
# db.session.add(employee)
# db.session.commit()
# beverages = MenuItemType(name="Beverages")
# db.session.add(beverages)
# db.session.commit()
# entrees = MenuItemType(name="Entrees")
# db.session.add(entrees)
# db.session.commit()
# sides = MenuItemType(name="Sides")
# db.session.add(sides)
# db.session.commit()
# dinner = Menu(name="Dinner")
# db.session.add(dinner)
# db.session.commit()
# fries = MenuItem(name="French fries", price=3.50, type=sides, menu=dinner)
# db.session.add(fries)
# db.session.commit()
# drp = MenuItem(name="Dr. Pepper", price=1.0, type=beverages, menu=dinner)
# db.session.add(drp)
# db.session.commit()
# jambalaya = MenuItem(name="Jambalaya", price=21.98,
# type=entrees, menu=dinner)
# db.session.add(jambalaya)
# db.session.commit()
# t1 = Table(number=1, capacity=4)
# db.session.add(t1)
# db.session.commit()
# t2 = Table(number=2, capacity=4)
# db.session.add(t2)
# db.session.commit()
# t3 = Table(number=3, capacity=4)
# db.session.add(t3)
# db.session.commit()
# t4 = Table(number=4, capacity=4)
# db.session.add(t4)
# db.session.commit()
# t5 = Table(number=5, capacity=4)
# db.session.add(t5)
# db.session.commit()
# t6 = Table(number=6, capacity=4)
# db.session.add(t6)
# db.session.commit()
# t7 = Table(number=7, capacity=4)
# db.session.add(t7)
# db.session.commit()
# t8 = Table(number=8, capacity=4)
# db.session.add(t8)
# db.session.commit()
# t9 = Table(number=9, capacity=4)
# db.session.add(t9)
# db.session.commit()
# t10 = Table(number=10, capacity=4)
# db.session.add(t10)
# db.session.commit()