Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Laravel Migration Generator Laravel Package

barryvdh/laravel-migration-generator

Generate Laravel migration files from an existing database schema. This package by Barry vd. Heuvel inspects your current tables and creates matching migrations, including indexes and foreign keys, making it easy to version-control legacy or inherited databases.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit. This is a development-time scaffolding utility, not a runtime library. It introspects a configured database connection and emits Laravel migration classes through an Artisan command. The only architecture concern it legitimately serves is converting a pre-existing, unmanaged schema into a version-controlled migration baseline. It belongs in require-dev, pinned, and absent from any production artifact or deployment pipeline. It is a bridge artifact: generate, review, commit, then hand schema ownership to Laravel's native schema:dump so the migrations become a historical record rather than a permanently regenerated output. Framing it as a one-shot accelerator rather than a dependency is the decision that keeps the architecture clean.

Integration feasibility. Mechanically trivial — Composer install, optional config publish, point at a named connection, run the command. The feasibility question is fidelity, not mechanics. The tool translates what it understands into Laravel's schema builder; views, stored procedures, triggers, partitions, partial indexes, generated columns, check constraints, custom types, spatial types, and DB-specific defaults are approximated or silently dropped. Integration is feasible when the target schema is conventional (tables, PK/FK, indexes, enums) and the acceptance bar is "reviewed draft baseline," not byte-exact replica. Two friction points worth confirming early: a hard transitive dependency on doctrine/dbal (the most common install failure on modern Laravel), and command-name drift between the description (generate:migrations) and the developer walkthrough (migrate:generate) — evidence of version fragmentation the team pins down empirically against php artisan help, not by reading the README.

Technical risk. Dominant risk is lifecycle: archived repository, 246 stars, zero dependents, no upstream security triage, no compatibility path for future Laravel/PHP majors. Secondary risks are correctness (silent omissions that surface later as production schema drift), ordering (foreign-key cycles causing replay failure), and blast radius (a misconfigured connection pointed at a live primary). The low opportunity score reinforces the framing: tactical accelerator, not strategic dependency. Treat archived status as an accepted, time-boxed risk rather than something to engineer around.

Key questions.

  • What Laravel/PHP version is targeted, and does the resolved composer.json constraint plus doctrine/dbal actually admit it — verified by a spike, not by reading the README?
  • Which engine and version, and are we generating against a read-only replica of the real thing?
  • Is the objective a one-time baseline or ongoing synchronization? Only the former is viable; if anyone asks for the latter, redirect to Laravel's schema-diff / schema:dump tooling.
  • What schema objects exist beyond plain tables, and who owns hand-authoring those?
  • What is the acceptance criterion for fidelity, and which named senior reviewer signs off on the schema diff?
  • Are we willing to fork or vendor internally if a PHP upgrade breaks it — and who is that owner?
  • What is the retirement date and the exit criteria for removing it from composer.json?

Integration Approach

Stack fit. Assumes a Laravel application with a working Artisan console and at least one configured connection. It composes alongside, not instead of, the standard migration workflow. Pair it with a dedicated legacy connection entry rather than reusing an existing production config, and generate into a quarantine path (database/migrations/imported) that is visibly distinct from curated migration history — this prevents both accidental promotion of unreviewed files and later re-runs clobbering hand-edited output. For stacks that need ongoing schema management, this tool is the bootstrap and schema:dump is the steady state; the two are sequential, not competitive.

Migration path.

  1. Snapshot the source schema from a read-only replica; capture information_schema as ground truth.
  2. Inventory every object and classify in-scope (tables, columns, indexes, FKs) versus out-of-scope (views, procs, triggers, custom types).
  3. Install as require-dev, pin the exact version in composer.lock, record the resolved doctrine/dbal version.
  4. Generate scoped with --only / --skip / --path=database/migrations/imported against the replica only.
  5. Peer-review each file against the inventory; hand-author omissions.
  6. Replay on an empty database and diff the result against ground truth — this replay diff is the gate, not code review alone.
  7. Promote reviewed files, commit the baseline, switch to schema:dump, and either remove the tool or leave it dev-only with a documented expiry.

Compatibility. Validate Composer constraints before committing to the approach — archived packages typically cap out one or two Laravel majors behind, and Laravel 5.5-era auto-discovery assumptions may not hold. Test driver behavior against the exact production engine version: MySQL/MariaDB, PostgreSQL, SQLite, and SQL Server differ in what introspection returns and how Laravel renders types. Verify the actual command name and available flags against the installed build, since documentation and reality have already been shown to drift.

Sequencing. Timebox a sandbox spike first; do not run this in parallel with active schema changes on the source. Freeze DDL for the duration of generation and review so the diff is stable. Place this workstream after schema inventory and before any application-level data migration or backfill work, because the baseline defines the contract everything downstream depends on — environment parity, CI migrate:fresh, seeders, ORM modeling. For a medium schema, plan days to roughly a week inclusive of review, versus weeks for manual transcription; that delta is the entire business case and should be stated in the plan as the expected return on the spike.

Operational Impact

Maintenance. Effectively zero upstream maintenance. Treat it as an internally owned, vendored utility with a small enough codebase to patch if a PHP/Laravel compatibility break lands. That patch cost must be explicitly accepted up front, and the dependency should carry a defined retirement date rather than indefinite residency in composer.json. The correct posture is "adopt the output, not the dependency" — buy the hour, own the artifact.

Support. Community support is dormant; escalation is internal only. Requires a named owner, a runbook documenting the exact command invocation and pinned versions, and a known-issues list enumerating what the generator drops for this specific schema. The worst outcome is an undocumented utility a future team inherits mid-modernization without context — which is precisely why the archived status and retirement plan belong in the written record.

Scaling. Scaling is schema-size, not traffic. Hundreds of tables and thousands of foreign keys produce long migration chains, slow Artisan runs, and ordering failures on replay; large single runs are also harder to review, which is why scoped --only/--skip runs into a quarantine directory beat one heroic generation. For very large schemas, expect to segment by domain and review in batches. There is no runtime scaling concern because the tool never runs in production.

Failure modes.

  • Silent omission — a view, trigger, or check constraint never appears in the output and nobody notices until behavior diverges in a non-production environment. Mitigation: the inventory-versus-output reconciliation step and the empty-database replay diff.
  • Constraint ordering — circular foreign keys cause replay failure; mitigation is generating in dependency order or splitting FK creation into a follow-up migration.
  • Type degradation — vendor-specific types (JSONB nuance, spatial, enum, generated columns) rendered as approximations; mitigation is treating the target engine version as part of the test matrix.
  • Blast radius — a misconfigured connection pointed at a live primary performs introspection against production; mitigation is a scoped legacy connection with read-only credentials and a mandatory replica.
  • Dependency rot — a routine PHP or Laravel upgrade breaks the tool weeks before it was scheduled for retirement; mitigation is retiring it promptly after the baseline is committed rather than leaving it resident "just in case."

Ramp-up. Low engineer ramp-up — a mid-level engineer can run the command in an afternoon. The real ramp-up cost is reviewer expertise: a senior engineer with database depth must own the schema diff, at roughly a day per medium schema. Budget for that reviewer explicitly in the plan; the tool's output is only as trustworthy as the review behind it, and an unreviewed baseline is worse than no baseline because it looks authoritative.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
ignibyte/aic-framework
glavweb/data-schema-bundle
glavweb/datagrid-bundle
tacticmedia/scim-server
uni-method/frame
neika-ai/sdk
adachsoft/php-code-style
pharaonic/laravel-notification-dependencies
beautinow/translug
dev-brainiac/bot-cloaked
octoberrain/html
octoberrain/extension
octoberrain/exception
octoberrain/contracts
adachsoft/api-version-bundle
cgv/localized-resource
noith/settings
kda/laravel-package
kda/filament-dynamic-navigation
bypersoft/signbox