30d02dd7c7e9fdb0959013bbd84819d599b275a5
drizzle-orm/postgres-js/migrator's migrate() has the known high-water-mark
bug (GRO-1999/2033): on a fresh DB it applies migration 0000 first, setting
the watermark to its `when` timestamp (1773771452946, 2026-03-17). Migrations
0001, 0003, 0010, 0011 all have stale 2025-era `when` values that fall below
this watermark and are silently skipped.
Migration 0003 (recurring_series) is the critical skip: it creates the
`recurring_series` table and adds `series_id`/`series_index` columns to
`appointments`. Since migrate() wraps all SQL in a single Postgres transaction,
any downstream applied migration that depends on those missing objects causes
a full transaction rollback — including migration 0000's staff and services
tables. The result: every reset-demo-data run since the 552a4d9 deploy leaves
the DB with zero tables, causing both reset-demo-data and seed-test-data jobs
to fail on every subsequent run.
Fix: replace migrate() from drizzle-orm with `pnpm exec drizzle-kit migrate`
(hash-based, same as the K8s migrate Job). drizzle-kit applies every unhashed
migration regardless of its `when` timestamp ordering, matching the K8s migrate
Job's behaviour exactly.
Co-Authored-By: Paperclip <noreply@paperclip.ing>
GroomBook API
GroomBook API service — extracted from the groombook/app monorepo.
Overview
This repository contains the GroomBook API service, including:
- REST API endpoints
- Database schema and migrations (via Drizzle ORM)
- Authentication (via Better Auth)
- Background job handlers
Structure
src/ # API service source
packages/db/ # Database schema, migrations, and utilities
packages/types/ # Shared TypeScript types
Setup
pnpm install
cp .env.example .env # Fill in required environment variables
pnpm --filter @groombook/api dev
Docker
docker build -t ghcr.io/groombook/api:latest .
docker run -p 3000:3000 ghcr.io/groombook/api:latest
License
AGPL-3.0-only
Description
Languages
TypeScript
99.4%
JavaScript
0.3%
Dockerfile
0.2%