fix: database should not overwrite

This commit is contained in:
eric
2026-02-23 17:32:19 +01:00
parent 724666ea36
commit 82259117dd
6 changed files with 43 additions and 3 deletions

View File

@@ -47,10 +47,31 @@ src/
| `ELEVENLABS_API_KEY` | ElevenLabs API key for voiceover |
| `ELEVENLABS_VOICE_ID` | Default ElevenLabs voice ID (optional) |
| `ELEVENLABS_MODEL` | ElevenLabs model ID (default: `eleven_multilingual_v2`) |
| `DATABASE_PATH` | SQLite file path (default: `./data/db.sqlite3`) |
| `WEB_PORT` | Port for web dashboard (default: 3000) |
| `WEB_BASE_URL` | Base URL for web dashboard |
| `SESSION_SECRET` | Secret for session encryption |
## Data Persistence
- Bot options and other runtime state are stored in SQLite.
- Keep `DATABASE_PATH` on persistent storage so updates/redeploys do not reset settings.
- Backward compatibility: if `DATABASE_PATH` is unset and `src/database/db.sqlite3` exists, it is used automatically.
- Recommended one-time migration:
```bash
mkdir -p data && cp src/database/db.sqlite3 data/db.sqlite3
```
- Docker example:
```bash
docker run -d \
--name joel-discord \
-v joel_data:/data \
--env-file .env \
your-image:latest
```
## Scripts
| Script | Description |