docs: document automatic migrations system
Updated CLAUDE.md to reflect new database migrations system: - Added backend/migrations/ to directory structure - Added schema_migrations table to database schema - Updated deployment section with migration workflow - Added reference to .claude/docs/technical/MIGRATIONS.md The migrations system automatically applies SQL files (XXX_*.sql pattern) on container startup, with tracking in schema_migrations table. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
913b485500
commit
49467ca6e9
14
CLAUDE.md
14
CLAUDE.md
|
|
@ -21,9 +21,11 @@ Teil der **Jinkendo**-App-Familie (人拳道). Domains: jinkendo.de / .com / .li
|
||||||
backend/
|
backend/
|
||||||
├── main.py # App-Setup + Router-Registration (~75 Zeilen)
|
├── main.py # App-Setup + Router-Registration (~75 Zeilen)
|
||||||
├── db.py # PostgreSQL Connection Pool
|
├── db.py # PostgreSQL Connection Pool
|
||||||
|
├── db_init.py # DB-Init + Migrations-System (automatisch beim Start)
|
||||||
├── auth.py # Hash, Verify, Sessions, Feature-Access-Control
|
├── auth.py # Hash, Verify, Sessions, Feature-Access-Control
|
||||||
├── models.py # Pydantic Models
|
├── models.py # Pydantic Models
|
||||||
├── feature_logger.py # Strukturiertes JSON-Logging (Phase 2)
|
├── feature_logger.py # Strukturiertes JSON-Logging (Phase 2)
|
||||||
|
├── migrations/ # SQL-Migrationen (XXX_*.sql Pattern)
|
||||||
└── routers/ # 14 Router-Module
|
└── routers/ # 14 Router-Module
|
||||||
auth · profiles · weight · circumference · caliper
|
auth · profiles · weight · circumference · caliper
|
||||||
activity · nutrition · photos · insights · prompts
|
activity · nutrition · photos · insights · prompts
|
||||||
|
|
@ -83,6 +85,7 @@ frontend/src/
|
||||||
### v9c Finalisierung ✅
|
### v9c Finalisierung ✅
|
||||||
- ✅ **Selbst-Registrierung:** POST /api/auth/register, E-Mail-Verifizierung, Auto-Login
|
- ✅ **Selbst-Registrierung:** POST /api/auth/register, E-Mail-Verifizierung, Auto-Login
|
||||||
- ✅ **Trial-System UI:** Countdown-Banner im Dashboard (3 Urgency-Level)
|
- ✅ **Trial-System UI:** Countdown-Banner im Dashboard (3 Urgency-Level)
|
||||||
|
- ✅ **Migrations-System:** Automatische Schema-Migrationen beim Start (db_init.py)
|
||||||
|
|
||||||
### Offen v9d 🔲
|
### Offen v9d 🔲
|
||||||
- Schlaf-Modul
|
- Schlaf-Modul
|
||||||
|
|
@ -121,6 +124,12 @@ Runner: Raspberry Pi (/home/lars/gitea-runner/)
|
||||||
Manuell:
|
Manuell:
|
||||||
cd /home/lars/docker/bodytrack[-dev]
|
cd /home/lars/docker/bodytrack[-dev]
|
||||||
docker compose -f docker-compose[.dev-env].yml build --no-cache && up -d
|
docker compose -f docker-compose[.dev-env].yml build --no-cache && up -d
|
||||||
|
|
||||||
|
Migrations:
|
||||||
|
Werden automatisch beim Container-Start ausgeführt (db_init.py)
|
||||||
|
Nur nummerierte Dateien: backend/migrations/XXX_*.sql
|
||||||
|
Tracking in schema_migrations Tabelle
|
||||||
|
📚 Details: .claude/docs/technical/MIGRATIONS.md
|
||||||
```
|
```
|
||||||
|
|
||||||
## Datenbank-Schema (PostgreSQL 16)
|
## Datenbank-Schema (PostgreSQL 16)
|
||||||
|
|
@ -142,10 +151,14 @@ subscriptions · coupons · coupon_redemptions · features
|
||||||
tier_limits · user_feature_restrictions · user_feature_usage
|
tier_limits · user_feature_restrictions · user_feature_usage
|
||||||
access_grants · user_activity_log
|
access_grants · user_activity_log
|
||||||
|
|
||||||
|
Infrastruktur:
|
||||||
|
schema_migrations – Tracking für automatische DB-Migrationen
|
||||||
|
|
||||||
Feature-Logging (Phase 2):
|
Feature-Logging (Phase 2):
|
||||||
/app/logs/feature-usage.log # JSON-Format, alle Feature-Zugriffe
|
/app/logs/feature-usage.log # JSON-Format, alle Feature-Zugriffe
|
||||||
|
|
||||||
Schema-Datei: backend/schema.sql
|
Schema-Datei: backend/schema.sql
|
||||||
|
Migrationen: backend/migrations/*.sql (automatisch beim Start)
|
||||||
```
|
```
|
||||||
|
|
||||||
## API & Auth
|
## API & Auth
|
||||||
|
|
@ -233,6 +246,7 @@ Bottom-Padding Mobile: 80px (Navigation)
|
||||||
| Backend-Architektur, Router, DB-Zugriff | `.claude/docs/architecture/BACKEND.md` |
|
| Backend-Architektur, Router, DB-Zugriff | `.claude/docs/architecture/BACKEND.md` |
|
||||||
| Frontend-Architektur, api.js, Komponenten | `.claude/docs/architecture/FRONTEND.md` |
|
| Frontend-Architektur, api.js, Komponenten | `.claude/docs/architecture/FRONTEND.md` |
|
||||||
| **Feature-Enforcement (neue Features hinzufügen)** | `.claude/docs/architecture/FEATURE_ENFORCEMENT.md` |
|
| **Feature-Enforcement (neue Features hinzufügen)** | `.claude/docs/architecture/FEATURE_ENFORCEMENT.md` |
|
||||||
|
| **Database Migrations (Schema-Änderungen)** | `.claude/docs/technical/MIGRATIONS.md` |
|
||||||
| Coding Rules (Pflichtregeln) | `.claude/docs/rules/CODING_RULES.md` |
|
| Coding Rules (Pflichtregeln) | `.claude/docs/rules/CODING_RULES.md` |
|
||||||
| Lessons Learned (Fehler vermeiden) | `.claude/docs/rules/LESSONS_LEARNED.md` |
|
| Lessons Learned (Fehler vermeiden) | `.claude/docs/rules/LESSONS_LEARNED.md` |
|
||||||
| Feature Backlog (Übersicht) | `.claude/docs/BACKLOG.md` |
|
| Feature Backlog (Übersicht) | `.claude/docs/BACKLOG.md` |
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user