Ory Kratos Schema Migrations: Version Rollback Compatibility
18.5K reputation · 25 Mar 2026, 16:46 UTC
Database Schema Transition
Ory Kratos manages identity data using a SQL database, where schema updates are applied via the ory migrate sql command during version transitions. While the identity attributes are stored in a flexible JSONB format in PostgreSQL, the underlying table structures are subject to version-specific migrations.
Migration Constraints
Current migration workflows are designed to be additive. However, there is an uncertainty regarding the binary's behavior when a deployment fails midway through a version upgrade. If the database schema has been advanced to a newer version, it is unclear if a previous version of the Kratos binary can maintain operational stability without a full database restore.
- Target Version: Latest stable release
- Database: PostgreSQL (JSONB)
Does Ory Kratos support automated "down" migrations to revert schema changes if a version upgrade fails? If not, will a previous binary version successfully initialize against a schema that has already been migrated to a newer version?