Files
ProxmoxVE/ct
MickLesk 42cc1d298b sparkyfitness: start the server through the entrypoint that migrates
The Better Auth CLI added in the previous commit is the wrong tool. It
generates sso_provider.user_id as text and cannot reference this
schema's uuid user.id:

  foreign key constraint "sso_provider_user_id_fkey" cannot be
  implemented [...] incompatible types: text and uuid

The real cause is one line up in the unit. It ran

  tsx SparkyFitnessServer.js

which imports the application module directly and never applies the
schema migrations. Upstream starts through index.ts - nodemon.json has
exec: tsx index.ts - and that file runs applyMigrations() and
applyRlsPolicies() before importing anything, with a comment naming this
exact failure:

  Better Auth validates the database schema eagerly, the moment
  betterAuth() is constructed at auth.ts module scope [...] When
  migrations ran later (from inside SparkyFitnessServer.ts) that check
  read the pre-migration schema on the first boot after an upgrade, so
  every /api/auth request failed until the container was restarted.

Point both the install and the update at index.ts and drop the CLI call.
index.ts exits non-zero when a migration fails, so systemd surfaces that
instead of serving a broken login.
2026-09-17 10:49:58 +02:00
..
2026-09-15 09:16:43 +02:00
2026-08-24 17:09:34 +02:00
2026-08-26 22:09:11 +10:00
2026-08-24 17:11:26 +02:00
2026-09-14 15:50:54 +02:00
2026-08-25 16:09:04 +02:00
2026-08-26 22:09:19 +10:00
2026-09-07 16:57:57 +02:00
2026-09-10 15:10:59 +02:00
2026-09-08 11:20:32 +02:00
2026-08-30 20:53:34 +02:00
2026-08-26 13:42:52 +02:00
2026-09-12 22:11:22 +02:00
2026-08-26 22:07:45 +10:00
2026-09-16 12:01:52 +02:00
2026-08-26 13:42:13 +02:00
2026-09-12 11:52:55 +02:00
2026-09-12 14:24:00 +02:00
2026-08-26 08:48:51 +02:00
2026-09-16 16:00:31 +02:00
2026-09-02 16:31:59 +02:00
2026-09-07 16:51:29 +02:00
2026-09-11 23:40:58 +02:00
2026-09-09 15:25:01 +02:00
2026-09-10 15:02:09 +02:00
2026-09-01 22:25:05 +02:00
2026-09-07 16:53:13 +02:00
2026-09-11 07:43:35 +02:00
2026-08-30 20:53:12 +02:00
2026-08-26 13:42:32 +02:00
2026-08-31 08:49:37 +02:00
2026-08-26 13:41:49 +02:00
2026-09-02 16:32:44 +02:00
2026-09-10 15:02:18 +02:00
2026-08-25 15:11:31 +02:00
2026-09-02 16:31:34 +02:00
2026-08-24 17:07:31 +02:00
2026-09-10 13:49:15 +02:00
2026-08-27 09:56:12 +02:00
2026-08-30 20:55:03 +02:00
2026-09-08 11:18:20 +02:00
2026-09-15 09:16:43 +02:00