hellth-hub/packages/db/drizzle/0013_club_api_bridge.sql
Sebastian Mayer 2436dd9cac Initial commit: Hellth Hub monorepo
Mobile-first Web-App fuer persoenliches Health-, Ernaehrungs-,
Aktivitaets- und Einkaufs-Tracking im Home-Lab-Betrieb.

Stack: pnpm Monorepo - Next.js 16 + React 19 + Tailwind (apps/admin) -
Hono + tRPC + Better Auth mit 2FA und Passkeys (packages/api) -
PostgreSQL + Drizzle ORM (packages/db) - Docker fuer Postgres und pgAdmin.

Module:
- Auth mit Login, 2FA (TOTP + Backup-Codes), Passkeys und Admin-Recovery
- Tagesansicht mit Essen, Trinken, Gewicht, Aktivitaeten und Coach-Hinweisen
- Lebensmittelkatalog mit Naehrwerten, Portionen, OCR/Barcode/Open Food Facts
- Rezepte mit Live-Naehrwertberechnung und Community-Vorschlaegen
- Essensplanung und Wochenbudget mit Sportbonus
- Einkaufslisten mit Maerkten und Laufweg-Sortierung
- Hellfireclub mit Aktivitaetspunkten und gemeinsamer Aktivitaetsplanung
- Wearables-Vorbereitung (Fitbit / Google Fit / Health Connect)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-27 22:15:16 +02:00

17 lines
913 B
SQL

ALTER TABLE "club_activities" ADD COLUMN IF NOT EXISTS "scope" text DEFAULT 'nationwide' NOT NULL;
ALTER TABLE "club_activities" ADD COLUMN IF NOT EXISTS "state" text;
ALTER TABLE "club_activities" ADD COLUMN IF NOT EXISTS "city" text;
ALTER TABLE "club_activities" ADD COLUMN IF NOT EXISTS "latitude" numeric(9, 6);
ALTER TABLE "club_activities" ADD COLUMN IF NOT EXISTS "longitude" numeric(9, 6);
ALTER TABLE "club_activities" ADD COLUMN IF NOT EXISTS "locationLabel" text;
CREATE TABLE IF NOT EXISTS "club_profiles" (
"userId" text PRIMARY KEY NOT NULL,
"state" text DEFAULT 'Bayern' NOT NULL,
"city" text,
"latitude" numeric(9, 6),
"longitude" numeric(9, 6),
"privacyMode" text DEFAULT 'state' NOT NULL,
"updatedAt" timestamp DEFAULT now() NOT NULL,
CONSTRAINT "club_profiles_userId_user_id_fk" FOREIGN KEY ("userId") REFERENCES "public"."user"("id") ON DELETE cascade ON UPDATE no action
);