generated from nighthawkcoders/flocker_backend
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdb_init.py
More file actions
29 lines (27 loc) · 817 Bytes
/
db_init.py
File metadata and controls
29 lines (27 loc) · 817 Bytes
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
from __init__ import app, db
from model.user import initUsers
from model.section import initSections
from model.group import initGroups
from model.channel import initChannels
from model.post import initPosts
from model.nestPost import initNestPosts
from model.vote import initVotes
from model.guess import initGuessDataTable
from model.leaderboard import initLeaderboardTable
from model.drawing import initDrawingTable
def init_db():
with app.app_context():
db.create_all()
initUsers()
initSections()
initGroups()
initChannels()
initPosts()
initNestPosts()
initVotes()
initGuessDataTable()
initLeaderboardTable()
initDrawingTable()
print("Database and tables initialized.")
if __name__ == "__main__":
init_db()