huangdijia/laravel-migrate-recreate
Adds a migrate:recreate Artisan command to Laravel that rolls back and re-runs only the migrations you specify, instead of refreshing the whole database. Handy in development for iterating on a single migration while leaving other tables and their data intact.
Architecture fit. huangdijia/laravel-migrate-recreate is a single-purpose Artisan command package: it drops all tables in the connected database and re-runs migrations in one step. Architecturally it is a thin console layer over Laravel's own db:wipe + migrate primitives — one service provider, no domain coupling, no persistence, no runtime middleware. Its correct placement is require-dev in application repos and test harnesses only. It contributes nothing to production request paths.
Integration feasibility. Very high, mechanically. composer require --dev huangdijia/laravel-migrate-recreate with package auto-discovery yields a working migrate:recreate command in under an hour including verification. There is no published config to manage, no published migrations, no queue/event surface.
Technical risk. The dominant risk is not the code, it is the command's blast radius: a destructive, non-interactive-by-default table drop reachable by anyone with shell access to the container. Secondary risks: (a) the v2.1.0 changelog is an empty compare link, so the actual diff — and therefore backward-compatibility guarantees — is unverified; (b) single-maintainer personal package with no vendor backing or observable security policy; (c) interaction with schema:dump / schema.sql is undocumented, so a dump-based project may find its schema file untouched while tables are dropped, producing an inconsistent state.
Key questions to resolve before adoption.
illuminate/* and PHP constraints, and does v2.1.0 add Laravel 11/12 support?--force in non-local environments, or does it prompt? Is there any environment guard?schema:dump artifacts and the migrations table?Stack fit. Laravel applications on PHP 8.x using standard artisan and a relational database (MySQL/Postgres/SQLite). It fits cleanly alongside migrate:fresh, db:wipe, and test-DB reset tooling. It does not fit projects that rely on hand-managed production schema or shared long-lived dev databases.
Migration path. From 2.0.0 to 2.1.0: treat as low risk, constrain to ^2.1 in require-dev and let a green CI run validate. From 1.x: assume a major-version break — do not let a loose * constraint float across the boundary; pin ^1 until the command surface is re-verified. Because the package is dev-only, rollback is a one-line composer change with no data migration.
Compatibility checks. Confirm the constraint matrix against the project's supported Laravel and PHP versions. Check for conflicts with other migrate-adjacent packages (doctrine/dbal-dependent tooling, laravel/schema-dump workflows) and with any custom migrate command overrides. Verify behaviour on the specific database driver used in CI, since drop-all semantics differ on SQLite versus Postgres with open connections.
Sequencing.
require-dev, run locally against a disposable database.--no-dev and that the command is absent from the prod container's artisan list.Maintenance. Low ongoing cost: no config drift, no upgrade treadmill beyond Laravel major-version alignment. The real maintenance item is the dev-dependency review cycle — this package should sit in the "review each Laravel major" bucket, not the "review each release" bucket.
Support. Community-only. No SLA, no vendor escalation path, no guaranteed CVE response. Acceptable for a dev tool; unacceptable if anyone argues for promoting it into deployment automation against shared environments.
Scaling. Not a throughput concern — the command is invoked per developer or per CI shard, not per request. The practical scaling dimension is CI: parallel test jobs each needing an isolated database must each run it, so wall-clock cost is migration count × shards. For large schema sets, prefer a schema dump plus a narrow reset over drop-and-remigrate.
Failure modes.
schema:dump projects where the dump file is not regenerated, so the drop is invisible until the next fresh provisioning.Ramp-up. Effectively zero for anyone who has used migrate:fresh. The training requirement is not usage, it is the safety briefing: state plainly in the runbook that this command is local-and-CI only, that production images must exclude dev dependencies, and that it is never to be wired into a deployment step or a shared-environment script. One paragraph, delivered at onboarding, is sufficient.
How can I help you explore Laravel packages today?