Fix readonly database error by setting proper permissions on storage directory
This commit is contained in:
parent
5cfa4ee90f
commit
d3a069aee9
@ -25,10 +25,10 @@ class Settings(BaseSettings):
|
||||
if isinstance(v, str):
|
||||
return v
|
||||
|
||||
# Ensure the database directory exists
|
||||
# Ensure the database directory exists with proper permissions
|
||||
db_dir = info.data.get("DB_DIR")
|
||||
if db_dir:
|
||||
db_dir.mkdir(parents=True, exist_ok=True)
|
||||
db_dir.mkdir(parents=True, exist_ok=True, mode=0o755)
|
||||
|
||||
return f"sqlite:///{db_dir}/db.sqlite"
|
||||
|
||||
|
@ -3,8 +3,8 @@ from sqlalchemy.orm import sessionmaker
|
||||
|
||||
from app.core.config import settings
|
||||
|
||||
# Ensure the database directory exists
|
||||
settings.DB_DIR.mkdir(parents=True, exist_ok=True)
|
||||
# Ensure the database directory exists with proper permissions
|
||||
settings.DB_DIR.mkdir(parents=True, exist_ok=True, mode=0o755)
|
||||
|
||||
# Create SQLAlchemy engine
|
||||
engine = create_engine(
|
||||
|
Loading…
x
Reference in New Issue
Block a user