mirror of
https://github.com/johannesjo/super-productivity.git
synced 2026-07-18 00:46:45 +00:00
The Prisma migration chain began with an ALTER on the operations table, so a fresh database could not be initialized from migrations alone (the first migration failed with no table to ALTER). Separately, the login_token / login_token_expires_at columns and index existed in schema.prisma and were used at runtime by src/auth.ts (magic-link login) but were never created by any migration, so a migrate-only database crashed with "column users.login_token does not exist". - Add a 0_init baseline migration that creates the base tables (the pre-2025-12-12 shape), sorting before the first incremental migration so the existing ALTER migrations apply cleanly on top. - Add 20260601000000_add_login_token to create the missing magic-link columns and index (IF NOT EXISTS, safe on installs that already have them from a prior db push). - Add migration_lock.toml (provider = postgresql), the standard companion to a real migration baseline. - Document baselining for existing databases: `migrate resolve --applied 0_init` for installs with migration history, and resolving the whole chain for db-push installs with none (covers the Helm/Docker unattended paths). - Add regression tests asserting the baseline exists and that every @map column in schema.prisma stays backed by a migration (guards the drift class that caused this bug, not just login_token). Verified by replaying all migrations on a fresh Postgres: the chain applies cleanly and the resulting schema matches schema.prisma exactly. Closes #8187 |
||
|---|---|---|
| .. | ||
| migrations | ||
| schema.prisma | ||