You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add database migration system for generating and running migrations
Introduces a complete migration workflow:
- Schema diffing engine that compares TypeScript config against the live database
- SQL migration file generation with timestamped naming
- Safety checks inspired by strong_migrations (warns on drops, unsafe type casts, etc.)
- Migration runner with PostgreSQL advisory locking for concurrent safety
- Migration tracking table (_orm_migrations) with checksum verification
- Support for non-transactional migrations via -- orm:no-transaction directive
- CLI commands: orm generate migration, orm db migrate, orm db migrate status
- Programmatic API: migrate.generate(), migrate.run(), migrate.status()
Also enhances getForeignKeys to return onUpdate/onDelete actions and
getUniqueConstraints to return structured column data and nullsNotDistinct.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
0 commit comments