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 Migrations Generator Laravel Package

kitloong/laravel-migrations-generator

Generate Laravel migrations from an existing database, complete with indexes and foreign keys. Supports MariaDB, MySQL, PostgreSQL, SQL Server and SQLite, with options to include, exclude or target specific tables via Artisan.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit

  • kitloong/laravel-migrations-generator is a development-time Artisan tool, not a runtime dependency. It fits Laravel/Lumen projects that need to reverse-engineer an existing database into migration files.
  • Best architectural fit: brownfield Laravel adoption, legacy database modernization, schema documentation, test-fixture baselining, and database-first teams moving toward Laravel migrations.
  • Poor fit: greenfield schema authoring, production schema synchronization, or teams expecting generated migrations to be a permanent source of truth without review.

Integration feasibility

  • Low integration effort: composer require --dev kitloong/laravel-migrations-generator, configure a Laravel database connection, and run php artisan migrate:generate.
  • The command surface is strong for controlled adoption: --connection, --tables, --ignore, --path, --squash, filename templates, and skip flags for views, procedures, foreign keys, vendor migrations, and logging.
  • Supports MariaDB, MySQL, PostgreSQL, SQL Server, and SQLite. Lumen requires manual facade/provider registration, which is documented.
  • The package should be treated as a schema-discovery and migration-bootstrap tool, not as an automated database migration service.

Technical risk

  • Generated migrations are an approximation of the live schema. Type fidelity, defaults, enums, collations, generated columns, indexes, and foreign-key naming may require manual correction.
  • Views and stored procedures are supported but are inherently database-specific; portability and long-term maintainability should be questioned. Trigger support is not evidenced in the supplied material.
  • Foreign-key generation depends on all referenced tables being included. Scoped generation with --tables or --ignore can produce incomplete or failing migration sets.
  • Existing migration history is a significant risk. Running generation into an application that already has migrations can create duplicate or conflicting schema definitions.
  • Recent releases include Laravel 13 support and schema-fidelity fixes, which is positive. However, the package remains community-supported OSS with no vendor SLA. A dependents count of 0 is inconclusive; stars, docs, CI badges, and release cadence suggest real usage but not enterprise endorsement.

Key questions

  • Which database engine and version are in scope, and does the target schema include views, stored procedures, triggers, custom types, spatial types, or nonstandard collations?
  • What Laravel and PHP versions must be supported, and is the application already migration-managed?
  • How large and complex is the schema, and can generation be scoped to a representative subset first?
  • Is the goal a one-time baseline, ongoing schema documentation, or repeatable legacy-to-Laravel conversion?
  • Who owns review and correction of generated migrations, and what parity test proves the generated schema matches the source?
  • Will generated migrations be logged in the migrations table, skipped, or assigned a baseline batch, and how will that behave across fresh and existing environments?

Integration Approach

Stack fit

  • Strong fit for Laravel and Lumen applications using Composer and Artisan.
  • Install as a dev dependency and keep it out of production runtime images unless there is a deliberate operational reason to retain it.
  • Use a dedicated, read-only or isolated database connection for generation where possible, rather than pointing the tool at a production primary.

Migration path

  • Start with a non-production clone or sanitized schema snapshot.
  • Pin the package version in composer.json and document the exact generation command used.
  • Generate first into a temporary directory or disposable branch, not directly into the application’s active migrations folder.
  • Prefer per-table generation for reviewability, or --squash for a single baseline migration when the team accepts a larger review surface.
  • Use --skip-log when generating reference migrations that should not alter the application’s migration ledger. Use --log-with-batch=0 only after deciding the generated set is a deliberate first baseline.
  • Validate by running php artisan migrate:fresh against an empty database, then compare the resulting schema to the source using native schema inspection or database tooling.

Compatibility

  • Database support is broad, but fidelity varies by engine. SQL Server, PostgreSQL, and MySQL/MariaDB schemas should be validated separately if the organization supports multiple engines.
  • Laravel 13 support is present in v7.3.0+, but PHP version compatibility and framework version should be confirmed during the spike.
  • Generated migrations target the Laravel schema builder available at generation time. Upgrading Laravel later may require regenerating or revising migrations.
  • Lumen requires explicit provider registration; account for that in setup documentation.

Sequencing

  1. Discovery: inventory database engine, schema size, constructs, existing migration history, and target Laravel/PHP versions.
  2. Sandbox: install as a dev dependency in a branch or spike environment and generate from a non-production clone.
  3. Scope: generate a representative subset first using --tables or --ignore; confirm foreign-key completeness.
  4. Review: code-review generated migrations for type fidelity, naming, indexes, defaults, collations, views, and procedures.
  5. Parity test: run migrations on an empty database and compare schema against the source.
  6. Adoption: decide whether to use the output as a baseline, reference documentation, or selective migration source; do not overwrite existing migration history blindly.
  7. Operationalize: document the generation recipe, version pin, validation checklist, and ownership of generated files.

Operational Impact

Maintenance

  • Ongoing maintenance is low if the package remains a dev-only, pinned tool used for controlled generation.
  • Generated migration files become team-owned code and must be reviewed and maintained like hand-written migrations.
  • Package upgrades should be tested against the target Laravel version and database engine. Recent releases show active maintenance, but the team should not assume automatic compatibility.

Support

  • Community-supported MIT package with documentation, CI, and release history. No commercial SLA.
  • Support risk is acceptable for a development tool because failures occur during generation or validation, not in production runtime.
  • Teams should have a fallback path: manually correct generated migrations or hand-author migrations for unsupported constructs.

Scaling

  • Scaling concern is schema size, not application traffic. Large schemas may produce many files, slow generation, and high memory use.
  • Scope generation by table groups; use --squash when file count is operationally painful, accepting a larger diff.
  • Avoid running generation automatically against production or in every CI build unless the schema is stable and the output is intentionally compared as a drift check.

Failure modes

  • Foreign-key failures when referenced tables are excluded.
  • Unsupported or imprecisely mapped column types, defaults, enums, generated columns, collations, or indexes.
  • Views and stored procedures that are database-specific and fail on target environments.
  • Duplicate or conflicting migration files when generation is run into an existing migrations directory.
  • Migration-ledger pollution if logging options are used without a baseline decision.
  • Permission or connection failures when the configured database user lacks schema introspection rights.
  • Schema drift if the source database changes after generation without regeneration or review.

Ramp-up

  • Low for Laravel developers familiar with Artisan and migrations.
  • TPM should ensure a database-savvy reviewer is available for the first generation and parity test.
  • Document a short runbook: install, configure connection, generate scoped subset, review, validate on empty database, and record the approved baseline.
  • Avoid one-off “hero” generation. Make the generation and validation process repeatable before relying on it for modernization or documentation.
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.
skyraptor/chatter
edlugz/sasapay
abbasudo/artisan-route
mirvan/ippanel
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