-
Notifications
You must be signed in to change notification settings - Fork 1
/
seed.py
69 lines (61 loc) · 2.36 KB
/
seed.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
from models import db, User, Week, Day
from app import app
db.drop_all()
db.create_all()
User.query.delete()
Week.query.delete()
Day.query.delete()
db.session.add_all([
User(username='Sadie', password='meow', total_miles_completed=10, num_weeks=30),
User(username='Tiny', password='meow', total_miles_completed=3, num_weeks=24),
User(username='Princess', password='meow', total_miles_completed=12.8)
])
db.session.commit()
db.session.add_all([
Week(num=1, mileage_target=19, user=1),
Week(num=2, mileage_target=21, user=1),
Week(num=3, mileage_target=25, user=1),
Week(num=4, mileage_target=23, user=1),
Week(num=1, mileage_target=19, user=2),
Week(num=2, mileage_target=21, user=2),
Week(num=3, mileage_target=25, user=2),
Week(num=4, mileage_target=23, user=2),
Week(num=1, mileage_target=19, user=3),
Week(num=2, mileage_target=21, user=3),
Week(num=3, mileage_target=25, user=3),
Week(num=4, mileage_target=23, user=3)
])
# db.session.add_all([user1, user2, user3, week1, week2, week3, week4])
db.session.commit()
db.session.add_all([
Day(num=1, mileage_target=3, week=1, user=1),
Day(num=2, mileage_target=0, week=1, user=1),
Day(num=3, mileage_target=4, week=1, user=1),
Day(num=4, mileage_target=0, week=1, user=1),
Day(num=5, mileage_target=4, week=1, user=1),
Day(num=6, mileage_target=0, week=1, user=1),
Day(num=7, mileage_target=8, week=1, user=1),
Day(num=1, mileage_target=3, week=2, user=1),
Day(num=2, mileage_target=0, week=2, user=1),
Day(num=3, mileage_target=4, week=2, user=1),
Day(num=4, mileage_target=0, week=2, user=1),
Day(num=5, mileage_target=4, week=2, user=1),
Day(num=6, mileage_target=0, week=2, user=1),
Day(num=7, mileage_target=8, week=2, user=1),
Day(num=1, mileage_target=3, week=3, user=1),
Day(num=2, mileage_target=0, week=3, user=1),
Day(num=3, mileage_target=4, week=3, user=1),
Day(num=4, mileage_target=0, week=3, user=1),
Day(num=5, mileage_target=4, week=3, user=1),
Day(num=6, mileage_target=0, week=3, user=1),
Day(num=7, mileage_target=8, week=3, user=1),
Day(num=1, mileage_target=3, week=4, user=1),
Day(num=2, mileage_target=0, week=4, user=1),
Day(num=3, mileage_target=4, week=4, user=1),
Day(num=4, mileage_target=0, week=4, user=1),
Day(num=5, mileage_target=4, week=4, user=1),
Day(num=6, mileage_target=0, week=4, user=1),
Day(num=7, mileage_target=8, week=4, user=1)
])
# db.session.add_all([day1, day2, day3, day4, day5, day6, day7])
db.session.commit()