laravel-auto/migrations
Laravel package that generates migration files automatically from your existing database schema, letting you version-control tables without writing migrations by hand. Inspects your tables and columns, then scaffolds matching up and down migrations.
Architecture fit. The package's premise — co-locating schema definition with the Eloquent model via a static migration(Blueprint $table) method — is a legitimate pattern with strong precedents (Rails, Django, Prisma). It collapses two artifacts (model + migration file) into one, which is genuinely attractive for greenfield work and for AI-assisted code generation where keeping parallel files in sync is the failure point. The friction is that it diverges from Laravel's canonical, file-versioned migration contract. Laravel's migrations table, batch numbering, migrate:status, migrate:rollback, and schema:dump all assume an append-only sequence of timestamped files. This package replaces that with desired-state derived from current model source, which is a fundamentally different model (declarative convergence vs. imperative history).
The critical unknown: the docs never state whether migrate:auto creates missing tables only or diffs the model against live schema and alters. The troubleshooting entry "Schema changes not applying: check that your migration method signature matches" hints at a narrow create-if-absent implementation, but this must be confirmed in source before any decision.
Integration feasibility. Low coupling, small surface area: one convention, three commands (make:amodel, migrate:auto, migrate:auto-discover), one ordering property ($migrationOrder). No framework patching implied. Documented coexistence with traditional migrations (traditional first, auto after) means an incremental adoption path exists. The DSL is just Blueprint, so developer knowledge transfer is near-zero.
Technical risk. High, and driven mostly by project health rather than the idea:
down(), no down-migration strategy, no mention of destructive-change guards. This alone disqualifies it from any schema containing regulated or irreplaceable data.$migrationOrder as an integer property is a manual topological sort. It has no conflict resolution, no cycle detection, and no visibility — versus Laravel's timestamped ordering which at least fails loudly.last release: 2026-10-22 is future-dated. Either an index artifact or a placeholder — treat the maintenance signal as unverified.Key questions to resolve before committing (est. 1–2 days of spike work):
ALTER? Does it detect and refuse column drops/type narrowing?up/down equivalent? Can a change be reverted?migrations table, and does it participate in migrate, migrate:status, migrate:rollback?schema:dump / squashing compatibility?chareka-legacy an archived namespace?Stack fit. Good for Laravel 10/11/12 with PHP 8.x — the Blueprint API is stable across these, so the DSL is portable and low-risk to adopt syntactically. Best fit is greenfield, single-owner, low-blast-radius code: internal tools, admin panels, prototypes, hackathon/MVP builds, and AI-generated scaffolding where the model+schema sync problem is acute. Poor fit for anything with a shared database, external consumers, or a compliance boundary.
Migration path — do not retrofit. Retrofitting an existing production schema is the highest-risk use and should be explicitly out of scope. Instead:
Compatibility caveat that will bite. Traditional migrations run first, auto-migrations after. That means a traditional migration cannot declare a foreign key to an auto-migrated table — the table doesn't exist yet at that point. Any plan to bridge legacy and new modules via FKs inverts this ordering and will fail. Plan new modules as FK-takers, not FK-providers, to legacy.
Sequencing (2-sprint horizon):
migrate:auto --info in CI to catch drift between model source and a disposable schema.migration() body requires reviewer sign-off, because the diff no longer looks like a schema change. Add a CI job that runs migrate:auto-discover and fails if discovery count changes unexpectedly.Maintenance. Assume full ownership from day one. Zero stars, zero dependents, and an unverified release date mean there is effectively no upstream. Budget ~1 week/year of fork maintenance plus per-Laravel-major validation — modest in absolute terms, but it must be someone's named responsibility or it becomes silent debt. Weigh this against the cost saved per new table (roughly 15 minutes of boilerplate), which is real but small.
Support. None. No community, no issue triage cadence, no security disclosure path. Escalation route is "read the source." This is acceptable for a dev-velocity tool, unacceptable for anything on the critical path of a production deploy. Set expectations explicitly with the team so nobody assumes it's supported like first-party Laravel.
Scaling. This is the sharpest risk. Schema changes against large tables are where declarative sync tools fail: long-running DDL, table locks, and no integration with online-DDL tooling (gh-ost, pt-online-schema-change). Laravel's own migrations are already weak here; a package with no online-migration story is worse. Also note the per-model reflection/discovery cost grows with model count — fine at 50 models, worth measuring at 500. Constrain to databases where a lock is tolerable, and cap the number of auto-migrated tables as an explicit policy.
Failure modes to monitor:
$migrationOrder mis-set; fails at deploy, not at PR time. Mitigation: CI runs auto-migrate against a disposable schema on every branch.migration() edited but migrate:auto never run in the target environment; local and prod schemas diverge with no artifact recording the difference. Mitigation: schema snapshot in CI.down(). Mitigation: never point this at a database whose recovery time exceeds your backup restore time.--fresh / --force foot-guns — data-wiping and prod-bypass flags in the same CLI namespace as routine commands. Mitigation: block both in CI and shell aliases; require a second approval in the deploy pipeline.migration() body into a conventional migration file — a mechanical, ~1-day-per-30-tables conversion).Ramp-up. Developer ramp-up is genuinely trivial: 1–2 hours, because the DSL is the Blueprint API developers already know and the command surface is three commands. The real ramp-up cost is organizational, not technical — teaching the team that schema review no longer surfaces in the migration directory, and that --fresh is not a debugging tool. Plan a 30-minute team briefing plus a written convention doc, and treat the CI guards above as the enforcement mechanism rather than relying on discipline.
Recommendation. Fund a 3–5 day spike, not an adoption. The opportunity score (45.28) reflects a real, recurring pain point — model/schema drift, especially in AI-generated code — but the maturity signals (score 19.56, 0 dependents, no documented rollback, future-dated release, agent-skill-file documentation) do not support production commitment today. If the spike confirms create-only with clean rollback and Laravel command integration, pilot on one greenfield module. If it confirms create-only with no down(), either fork and build the rollback layer yourself, or copy the pattern into 150 lines of in-house Artisan command and keep the dependency at zero.
How can I help you explore Laravel packages today?