-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdb_create.py
executable file
·36 lines (27 loc) · 1.01 KB
/
db_create.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
#!/usr/bin/env python
from datetime import datetime
from hod import db
from models import MakeAppointment, User, Test, Administrator
db.drop_all()
#Create db and db tables
db.create_all()
#insert
db.session.add(Test('Pregnancy'))
db.session.add(Test('Blood Type'))
db.session.add(Test('HIV'))
db.session.add(Test('DNA'))
db.session.add(Administrator('ama', 'liverpool','admin'))
db.session.add(Administrator('boye', 'enyimba','admin'))
db.session.add(Administrator('cele', 'green','staff'))
db.session.add(User('[email protected]', 'igobi'))
db.session.add(User('[email protected]', 'vikky'))
db.session.add(User('[email protected]', 'lusaka'))
db.session.add(User('[email protected]', 'rojenny'))
db.session.add(User('[email protected]', 'titi'))
db.session.add(User('[email protected]', 'abuja'))
db.session.add(User('[email protected]', 'lafia'))
db.session.add(MakeAppointment(datetime.utcnow(),5,1))
db.session.add(MakeAppointment(datetime.utcnow(),7,1))
db.session.add(MakeAppointment(datetime.utcnow(),6,3))
#Commit
db.session.commit()