Initial commit
This commit is contained in:
17
setup.py
Normal file
17
setup.py
Normal file
@@ -0,0 +1,17 @@
|
||||
import os, datetime
|
||||
|
||||
delete_db = False
|
||||
|
||||
if delete_db and os.path.isfile("app/data.sqlite"):
|
||||
os.remove("app/data.sqlite")
|
||||
|
||||
if not os.path.isfile("app/data.sqlite"):
|
||||
from app import models
|
||||
|
||||
print("Creating database tables...")
|
||||
models.db.create_all()
|
||||
|
||||
print("Filling database...")
|
||||
models.db.session.commit()
|
||||
else:
|
||||
print("Database already exists")
|
||||
Reference in New Issue
Block a user