aboutsummaryrefslogtreecommitdiff
path: root/setup.py
blob: 9949776bcdf49c4f48e19f33bc07dcb0a39722e3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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.models import *

	print("Creating database tables...")
	db.create_all()
	print("Filling database...")

	ruben = User("rubenwardy")
	ruben.github_username = "rubenwardy"
	db.session.add(ruben)
	db.session.commit()
else:
	print("Database already exists")