remove directory creation logic for SQLite database from create_app function
All checks were successful
Build and Push Image / build-and-push (push) Successful in 15s
All checks were successful
Build and Push Image / build-and-push (push) Successful in 15s
This commit is contained in:
parent
73227d5a6c
commit
995cadeb27
1 changed files with 0 additions and 9 deletions
|
|
@ -26,15 +26,6 @@ def create_app():
|
||||||
|
|
||||||
# Initialize database tables
|
# Initialize database tables
|
||||||
with app.app_context():
|
with app.app_context():
|
||||||
# Create data directory if it doesn't exist
|
|
||||||
import os
|
|
||||||
db_path = app.config.get('SQLALCHEMY_DATABASE_URI', '')
|
|
||||||
if db_path.startswith('sqlite:///'):
|
|
||||||
db_file_path = db_path.replace('sqlite:///', '')
|
|
||||||
db_dir = os.path.dirname(db_file_path)
|
|
||||||
if db_dir and not os.path.exists(db_dir):
|
|
||||||
os.makedirs(db_dir, exist_ok=True)
|
|
||||||
|
|
||||||
db.create_all()
|
db.create_all()
|
||||||
|
|
||||||
return app
|
return app
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue