fix: use absolute paths for database to ensure persistence
Critical bug fix: Path(__file__).parent.parent returns a relative path, causing the database to be created in different locations depending on the working directory. This caused data loss on container restarts. Changes: - Add .resolve() to BASE_DIR in src/config.py and migrations/env.py - Fix admin dashboard showing 0 for participant count (was hardcoded) - Fix exchange detail page to show actual participant list - Add startup diagnostics to entrypoint.sh for troubleshooting 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -24,7 +24,8 @@ if config.config_file_name is not None:
|
||||
# Create minimal Flask app for migrations (without session initialization)
|
||||
# This avoids Flask-Session trying to create tables before migrations run
|
||||
app = Flask(__name__)
|
||||
BASE_DIR = Path(__file__).parent.parent
|
||||
# Use resolve() to ensure absolute paths - critical for database persistence
|
||||
BASE_DIR = Path(__file__).parent.parent.resolve()
|
||||
DATA_DIR = BASE_DIR / "data"
|
||||
DATA_DIR.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user