dorfteich/apps/api/prisma/migrations
Claude Opus 4.8 14e69b399c
All checks were successful
CD / Build and push images (push) Successful in 3m2s
CI / Lint, typecheck, test (push) Successful in 2m16s
CI / Auth e2e pack (push) Successful in 2m44s
CI / Build container images (push) Has been skipped
CD / Deploy to Test (push) Successful in 9s
CD / Smoke tests against Test (push) Successful in 1m16s
CD / Promote to Int (push) Successful in 11s
Add wikilink index, backlinks API, and phantom resolution (#47)
Maintain a server-side `page_links` index on every content change so
backlinks and missing-target ("phantom") links can be queried.

- prisma: `PageLink` (from_page_id, nullable to_page_id, target_slug;
  unique per (from, slug); cascade on source purge, set-null on target
  purge); migration.
- shared: `extractWikilinkSlugs(doc)` (distinct target slugs) and the
  `BacklinkView` / `PhantomLinkView` read shapes.
- collab: the persistence hook (#35) now rewrites the source page's outgoing
  links in the same transaction as the content cache — one row per distinct
  wikilink slug, resolved to a page in the same pond (null = phantom).
- api: `GET /pages/:id/backlinks` (permission-filtered — wikilinks resolve
  within a pond, so seeing the pond is the read right) and
  `GET /ponds/:id/phantom-links` (missing targets grouped with their
  referrers). Creating or renaming a page to a slug that pages already link
  to resolves those phantom rows; because links store the target's id,
  backlinks survive a later rename of the target's slug.
- tests: shared extraction unit test; collab persistence db test (store
  writes resolved + phantom rows and rewrites the index); api LinksService
  db test (backlinks, permission filter, phantom aggregation, create/rename
  resolution, id-based backlinks survive target rename).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PGdhRiwU1WRL4XxJfZYipY
2026-07-09 12:54:10 +02:00
..
20260704171456_init Add Prisma with PostgreSQL, automatic migrations, and /readyz 2026-07-04 19:16:44 +02:00
20260704224132_auth_models Add user, identity, session, and auth-support data model 2026-07-05 00:42:22 +02:00
20260705090100_ponds Ponds: data model, CRUD API, personal pond on verification (#21) 2026-07-05 11:08:16 +02:00
20260705185146_quotas Quota foundation: overrides, resolution, race-safe consumption (#22) 2026-07-05 20:55:59 +02:00
20260705200714_pages Add page CRUD and Yjs state persistence (#23) 2026-07-05 22:25:41 +02:00
20260708082627_attachments Add file storage service and image upload API (#27) 2026-07-08 10:35:03 +02:00
20260708101011_trash_and_jobs Add page trash: soft delete, restore, and purge job (#31) 2026-07-08 12:48:17 +02:00
20260709060328_collab_open_sessions Add Yjs update-log compaction job (#40) 2026-07-09 08:15:55 +02:00
20260709062007_page_versions Fix compaction test Bytes typing for strict typecheck (#40) 2026-07-09 08:23:55 +02:00
20260709062727_page_version_created_by Add version snapshots: automatic, named, thinning (#41) 2026-07-09 08:37:07 +02:00
20260709082418_labels Add hierarchical labels: model, CRUD API, and validation (#43) 2026-07-09 10:30:17 +02:00
20260709104519_page_links Add wikilink index, backlinks API, and phantom resolution (#47) 2026-07-09 12:54:10 +02:00
migration_lock.toml Add Prisma with PostgreSQL, automatic migrations, and /readyz 2026-07-04 19:16:44 +02:00