diff options
author | rubenwardy <rw@rubenwardy.com> | 2018-03-18 18:05:53 +0000 |
---|---|---|
committer | rubenwardy <rw@rubenwardy.com> | 2018-03-18 18:05:53 +0000 |
commit | 7d20c49ebb2a59e54a77ab92f268acd7fe069383 (patch) | |
tree | 6d28dfd1eeb8c13cfa82ff965b138e4b3634292b /setup.py | |
parent | 7f4faf21fae08c5e661c8f45ebda570dec3e8996 (diff) | |
download | cheatdb-7d20c49ebb2a59e54a77ab92f268acd7fe069383.tar.xz |
Add Github login
Diffstat (limited to 'setup.py')
-rw-r--r-- | setup.py | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -6,12 +6,15 @@ 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 + from app.models import * print("Creating database tables...") - models.db.create_all() - + db.create_all() print("Filling database...") - models.db.session.commit() + + ruben = User("rubenwardy") + ruben.github_username = "rubenwardy" + db.session.add(ruben) + db.session.commit() else: print("Database already exists") |