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  from flask_script import Command 
 4   
 5   
6 -class CreateSqliteFileCommand(Command):
7 8 """ 9 Create the sqlite DB file (not the tables). 10 Used for alembic, "create_db" does this automatically. 11 """ 12
13 - def run(self):
14 if flask.current_app.config["SQLALCHEMY_DATABASE_URI"].startswith("sqlite"): 15 # strip sqlite:/// 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