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 |
||
|---|---|---|
| .. | ||
| integration | ||
| account-page-contrast.spec.ts | ||
| api.routes.spec.ts | ||
| auth-cache.spec.ts | ||
| auth-flows.spec.ts | ||
| cleanup.spec.ts | ||
| config.spec.ts | ||
| conflict-detection.spec.ts | ||
| conflict.spec.ts | ||
| decompress-body.spec.ts | ||
| device.service.spec.ts | ||
| duplicate-operation-precheck.spec.ts | ||
| email.spec.ts | ||
| gap-detection.spec.ts | ||
| magic-link-registration.spec.ts | ||
| middleware.spec.ts | ||
| migrate-deploy-script.spec.ts | ||
| migration-sql.spec.ts | ||
| op-replay.spec.ts | ||
| operation-download.service.spec.ts | ||
| passkey.spec.ts | ||
| password-reset-api.spec.ts | ||
| password-reset.spec.ts | ||
| rate-limit.service.spec.ts | ||
| registration-api.spec.ts | ||
| replace-token-expiry.spec.ts | ||
| request-deduplication.service.spec.ts | ||
| retention-config.spec.ts | ||
| security-fixes.spec.ts | ||
| server-security.spec.ts | ||
| server.error-log-level.spec.ts | ||
| setup.ts | ||
| snapshot-skip-optimization.spec.ts | ||
| snapshot.service.spec.ts | ||
| storage-quota-cleanup.spec.ts | ||
| storage-quota.service.spec.ts | ||
| sync-compressed-body.routes.spec.ts | ||
| sync-fixes.spec.ts | ||
| sync-operations.spec.ts | ||
| sync-types.spec.ts | ||
| sync.routes.spec.ts | ||
| sync.service.spec.ts | ||
| sync.service.test-state.ts | ||
| time-tracking-operations.spec.ts | ||
| validation.service.spec.ts | ||
| websocket-connection.service.spec.ts | ||
| websocket.routes.spec.ts | ||