health: drop hair_progress; owner = Stan's account email only
All checks were successful
Deploy production / deploy (push) Successful in 2m22s

Regenerated the (not yet deployed) health migration without hair_progress.
This commit is contained in:
2026-10-24 00:22:24 +00:00
parent 8275f1fb22
commit 8aa689af64
10 changed files with 50 additions and 268 deletions

View File

@@ -2,7 +2,6 @@ import { db } from '#lib/server/db/index.js';
import {
healthAppointments,
healthBodyMeasurements,
healthHairProgress,
healthMedications,
healthNutritionDaily,
healthSleep,
@@ -30,54 +29,44 @@ function daysAgo(day: string, n: number): string {
export const load: PageServerLoad = async (event) => {
requireOwner(event);
const now = today();
const [
measurements,
workouts,
nutrition,
sleep,
medications,
vaccinations,
upcoming,
past,
hair
] = await Promise.all([
db
.select()
.from(healthBodyMeasurements)
.orderBy(asc(healthBodyMeasurements.date), asc(healthBodyMeasurements.createdAt)),
db
.select()
.from(healthWorkouts)
.orderBy(desc(healthWorkouts.date), asc(healthWorkouts.createdAt))
.limit(30),
db
.select()
.from(healthNutritionDaily)
.where(gte(healthNutritionDaily.date, daysAgo(now, 6)))
.orderBy(desc(healthNutritionDaily.date)),
db
.select()
.from(healthSleep)
.where(gte(healthSleep.date, daysAgo(now, 6)))
.orderBy(desc(healthSleep.date)),
db.select().from(healthMedications).orderBy(asc(healthMedications.name)),
db
.select()
.from(healthVaccinations)
.orderBy(desc(healthVaccinations.date), asc(healthVaccinations.vaccine)),
db
.select()
.from(healthAppointments)
.where(gte(healthAppointments.date, now))
.orderBy(asc(healthAppointments.date)),
db
.select()
.from(healthAppointments)
.where(lt(healthAppointments.date, now))
.orderBy(desc(healthAppointments.date))
.limit(10),
db.select().from(healthHairProgress).orderBy(desc(healthHairProgress.date)).limit(10)
]);
const [measurements, workouts, nutrition, sleep, medications, vaccinations, upcoming, past] =
await Promise.all([
db
.select()
.from(healthBodyMeasurements)
.orderBy(asc(healthBodyMeasurements.date), asc(healthBodyMeasurements.createdAt)),
db
.select()
.from(healthWorkouts)
.orderBy(desc(healthWorkouts.date), asc(healthWorkouts.createdAt))
.limit(30),
db
.select()
.from(healthNutritionDaily)
.where(gte(healthNutritionDaily.date, daysAgo(now, 6)))
.orderBy(desc(healthNutritionDaily.date)),
db
.select()
.from(healthSleep)
.where(gte(healthSleep.date, daysAgo(now, 6)))
.orderBy(desc(healthSleep.date)),
db.select().from(healthMedications).orderBy(asc(healthMedications.name)),
db
.select()
.from(healthVaccinations)
.orderBy(desc(healthVaccinations.date), asc(healthVaccinations.vaccine)),
db
.select()
.from(healthAppointments)
.where(gte(healthAppointments.date, now))
.orderBy(asc(healthAppointments.date)),
db
.select()
.from(healthAppointments)
.where(lt(healthAppointments.date, now))
.orderBy(desc(healthAppointments.date))
.limit(10)
]);
return {
today: now,
measurements,
@@ -87,7 +76,6 @@ export const load: PageServerLoad = async (event) => {
medications,
vaccinations,
appointments: { upcoming, past },
hair,
seo: { title: 'Health', description: 'Private health log.', index: false }
};
};

View File

@@ -340,26 +340,6 @@
{/if}
</section>
<section class="panel">
{@render sectionHeader('Hair progress', 'hair_progress')}
{#if data.hair.length}
<ul class="divide-y divide-[var(--site-border)] text-sm">
{#each data.hair as h (h.id)}
<li class="flex items-center justify-between gap-2 py-1.5">
<span
>{dayLabel(h.date)}{h.photoRef ? ` · ${h.photoRef}` : ''}{h.notes
? ` · ${h.notes}`
: ''}</span
>
{@render rowActions('hair_progress', h)}
</li>
{/each}
</ul>
{:else}
{@render empty('No hair check-ins yet.')}
{/if}
</section>
<section class="panel lg:col-span-3">
{@render sectionHeader('Vaccinations', 'vaccinations')}
{#if data.vaccinations.length}