ORY Kratos registration fails in production PostgreSQL due to missing verification_token column
26K reputation · 30 Jun 2023, 16:56 UTC
The ORY Kratos self‑service registration endpoint works correctly when backed by a local SQLite database, but returns a 500 Internal Server Error in a production PostgreSQL deployment.
In the SQLite environment the ORM automatically creates the required verification_token column, masking the missing migration step, whereas the PostgreSQL schema lacks this column unless the explicit migrate_postgres.sql script is applied.
The unresolved decision is whether to rely on ORM auto‑migration for production or to enforce explicit migration execution as part of the release process.
Should the ORM be permitted to generate the schema automatically for PostgreSQL in production? Is it advisable to depend on ORM‑driven schema changes for a production database? Should the release pipeline guarantee that the PostgreSQL migration script is run before the service starts?