1 import os
2 import flask
3 from flask_script import Command
4
5
7
8 """
9 Create the sqlite DB file (not the tables).
10 Used for alembic, "create_db" does this automatically.
11 """
12
14 if flask.current_app.config["SQLALCHEMY_DATABASE_URI"].startswith("sqlite"):
15
16 datadir_name = os.path.dirname(
17 flask.current_app.config["SQLALCHEMY_DATABASE_URI"][10:])
18 if not os.path.exists(datadir_name):
19 os.makedirs(datadir_name)
20