With a database per tenant, deploying application code and migrating data become separate fleet-wide operations. A failed migration must not disappear into a generic deployment log.
Implementation approach
Track the target schema version and the result of each tenant migration. Start with a controlled cohort, use bounded concurrency and preserve compatibility between old and new schemas during the rollout.
Example
SELECT tenant_id, schema_version, status
FROM tenant_migration_status
WHERE status <> 'completed';
Validation and edge cases
Exercise retries against a partially migrated database and verify backups can be restored. Review expensive schema changes on realistic data before running them across every tenant.
Key takeaway
Prefer additive changes followed by backfills and later cleanup when a rolling deployment requires mixed schema versions.




