adly-nady/php-my-migration
Laravel package to generate migrations (and optional Eloquent models) from an existing MySQL database. Detects column types, keys, indexes, foreign keys, timestamps/soft deletes; supports batch processing, custom paths, overwrite, and connections.
Schema builder, Artisan commands, and migration system, reducing friction in adoption.ENGINE=InnoDB with custom options) not being fully captured in generated migrations. Mitigation: Validate generated migrations against a test DB before production use.INT vs BIGINT) differ between the existing schema and Laravel’s defaults. Mitigation: Use --dry-run flag to preview changes.Schema builder syntax.SpatialIndex, Json columns)?Artisan CLI and migration system. No conflicts with existing Laravel tooling (e.g., php artisan migrate).php-my-migration:generate in --dry-run mode to preview affected tables.php artisan php-my-migration:generate to create migration files in database/migrations/.php artisan migrate --pretend.Schema::hasTable() and Schema::hasColumn() for runtime checks.php artisan migrate:fresh for future schema changes.MEMORY).php artisan migrate in staging, then production.migrate:rollback (if migrations are reversible).timestamps, softDeletes).php -d memory_limit=-1 for large schemas.| Failure Scenario | Impact | Mitigation |
|---|---|---|
| Corrupted migration files | Broken deployments | Store generated files in Git with pre-commit hooks. |
| Data type mismatches in generation | Silent schema drift | Validate with php artisan db:show. |
| MySQL connection issues | Partial generation | Retry with exponential backoff. |
| Laravel migration conflicts | Deployment blocker | Manually resolve conflicts pre-merge. |
| Unhandled MySQL features | Incomplete migrations | Supplement with custom SQL migrations. |
ALTER TABLE in production).php artisan db:show in tests).How can I help you explore Laravel packages today?