Commit graph

5 commits

Author SHA1 Message Date
Vadym Samoilenko
79b24ef3d9 fix(migrator): replace payload migrate with direct psql runner
Some checks failed
CI / Type Check (push) Has been cancelled
CI / Lint (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
Deploy / Build & Push Image (push) Has been cancelled
Deploy / Deploy to VPS (push) Has been cancelled
tsx@4.21.0 + Node.js v22 has two unfixable interop bugs:
- --import tsx/esm hook: importSyncForRequire fails on @/ path aliases
- tsx runner: @next/env has __esModule:true but no .default export → TypeError

Solution: run SQL migrations directly via psql (alpine + postgresql-client).
All migration files use IF NOT EXISTS guards so they're idempotent on re-run.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13 20:12:02 +01:00
Vadym Samoilenko
a26a9c05ae fix(migrator): use tsx as runner instead of hook to fix Node.js v22 ESM interop
Some checks are pending
CI / Type Check (push) Waiting to run
CI / Lint (push) Waiting to run
CI / Unit Tests (push) Waiting to run
Deploy / Build & Push Image (push) Waiting to run
Deploy / Deploy to VPS (push) Blocked by required conditions
NODE_OPTIONS="--import tsx/esm" registers tsx as a hook, which exposes the
tsx@4.21.0 + Node.js v22 importSyncForRequire bug (named export not found).
Running tsx directly as the process runner handles TypeScript module loading
at a higher level, avoiding the CJS/ESM interop conflict.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13 20:00:39 +01:00
Vadym Samoilenko
daf90b1127 fix(migrator): node:22 + NODE_OPTIONS tsx/esm for ESM bare specifier resolution
Some checks are pending
CI / Type Check (push) Waiting to run
CI / Lint (push) Waiting to run
CI / Unit Tests (push) Waiting to run
Deploy / Build & Push Image (push) Waiting to run
Deploy / Deploy to VPS (push) Blocked by required conditions
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13 18:20:33 +01:00
Vadym Samoilenko
d9cc08d7f1 fix(migrator): use node:20 — tsx 4.21 ESM resolution broken on node:22
Some checks are pending
CI / Type Check (push) Waiting to run
CI / Lint (push) Waiting to run
CI / Unit Tests (push) Waiting to run
Deploy / Build & Push Image (push) Waiting to run
Deploy / Deploy to VPS (push) Blocked by required conditions
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13 18:14:59 +01:00
Vadym Samoilenko
03c7640874 feat(migrations): add Payload migrator infrastructure
Some checks are pending
CI / Type Check (push) Waiting to run
CI / Lint (push) Waiting to run
CI / Unit Tests (push) Waiting to run
Deploy / Build & Push Image (push) Waiting to run
Deploy / Deploy to VPS (push) Blocked by required conditions
Add Dockerfile.migrator (node:22-alpine + full source) and
docker-compose.prod.yml `migrate` service (profile: tools) so
migrations can be generated and applied on the server without
Node.js v26/tsx compatibility issues.

Workflow:
  # generate migration:
  docker compose --profile tools run --rm migrate migrate:create --name <desc>
  # apply pending migrations:
  docker compose --profile tools run --rm migrate

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13 17:45:21 +01:00