stgleb | 75c7041 | 2015-02-17 02:52:00 +0200 | [diff] [blame] | 1 | from config import SQLALCHEMY_MIGRATE_REPO, basedir |
2 | from web_app.app import db | ||||
3 | import shutil | ||||
4 | |||||
5 | import os.path | ||||
6 | from os import remove | ||||
7 | |||||
8 | db.create_all() | ||||
9 | if os.path.exists(SQLALCHEMY_MIGRATE_REPO): | ||||
10 | shutil.rmtree(SQLALCHEMY_MIGRATE_REPO) | ||||
11 | |||||
12 | db.drop_all() | ||||
13 | if os.path.exists(os.path.join(basedir, 'app.db')): | ||||
14 | remove(os.path.join(basedir, 'app.db')) |