Code-Cleanup: toter Check, none-Sentinel, Login-Jitter raus
- entry.go: redundantes stored != "" entfernt - filepath-Sentinel "none" -> leerer String (Go-Zero-Value), Checks in entry.go/user.go und web/js/app.js vereinfacht - auth.go: zufaelligen Login-Jitter samt loginJitter-Variable und Test-Seam entfernt (war nur Spielerei, kein echter Schutz) - notes/migrations.md: einmalige "none"->"" Migration dokumentiert Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
# Datenbank-Migrationen
|
||||
|
||||
Manuelle Schritte, die beim Deploy gegen eine **bestehende** Datenbank nötig sind.
|
||||
Eine frische DB (Schema aus `db.go`) braucht keine davon.
|
||||
|
||||
---
|
||||
|
||||
## `filepath`-Sentinel `"none"` → leerer String
|
||||
|
||||
**Wann:** beim Umstieg auf die Go-Version, falls eine alte `kver.db` aus der
|
||||
Python-Zeit weiterverwendet wird.
|
||||
|
||||
**Hintergrund:** Die Python-Version schrieb für Beiträge ohne Bild den
|
||||
String `"none"` in `entry.filepath`. Die Go-Version nutzt stattdessen den
|
||||
leeren String (Go-Zero-Value) und prüft nur noch auf `filepath == ""`.
|
||||
Alte `"none"`-Zeilen würden sonst im Feed als Bildpfad interpretiert
|
||||
(`<img src="/none">` → kaputtes Bild).
|
||||
|
||||
**Migration:**
|
||||
```sql
|
||||
UPDATE entry SET filepath = '' WHERE filepath = 'none';
|
||||
```
|
||||
|
||||
Idempotent — kann gefahrlos mehrfach laufen.
|
||||
Reference in New Issue
Block a user