Package commands :: Module create_sqlite_file
[hide private]
[frames] | no frames]

Source Code for Module commands.create_sqlite_file

 1  import os 
 2  import flask 
 3  import click 
4 5 6 -def create_sqlite_file_function():
7 if flask.current_app.config["SQLALCHEMY_DATABASE_URI"].startswith("sqlite"): 8 # strip sqlite:/// 9 datadir_name = os.path.dirname( 10 flask.current_app.config["SQLALCHEMY_DATABASE_URI"][10:]) 11 if not os.path.exists(datadir_name): 12 os.makedirs(datadir_name)
13
14 @click.command() 15 -def create_sqlite_file():
16 """ 17 Create the sqlite DB file (not the tables). 18 Used for alembic, "create-db" does this automatically. 19 """ 20 return create_sqlite_file()
21