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

Migrations Generator Laravel Package

oscarafdev/migrations-generator

Reverse-engineer an existing database into Laravel migrations. This package inspects your tables and generates migration files with columns, indexes, and foreign keys—ideal for legacy projects. Supports MySQL, PostgreSQL, SQLite, and SQL Server.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Brownfield adoption of Laravel. The core value is reverse-engineering an existing database into Laravel migration files, which directly de-risks "we have a 10-year-old schema and want to move to Laravel" decisions. This release removes the last blocker (DBAL 4 / Carbon 3 alignment) for teams standardizing on Laravel 12.
  • Database replatforming (roadmap-level). Release notes explicitly call out MariaDB → PostgreSQL scenarios. That makes this a supporting tool for a roadmap item like "migrate off managed MariaDB onto PostgreSQL," where you need a repeatable, version-controlled representation of the schema before and after the cutover.
  • Build vs. buy: buy (and here, take the free option). Writing your own schema introspection layer against Doctrine DBAL is undifferentiated work with a long tail of type-mapping edge cases. Adopting this package is the obvious call versus in-house tooling; the only real cost is a dev-dependency.
  • Onboarding and documentation. Generated migrations double as executable schema documentation for new engineers and for architecture reviews.
  • Test fixture generation. Quickly scaffolding schema for integration tests or local environments without production data.
  • Dependency-health signal. The 12.0.2 fix tells you the maintainer is tracking the Laravel 12 / Carbon 3 / DBAL 4 ecosystem rather than pinning to stale constraints — relevant when scoring maintenance risk in a dependency review.

When to Consider This Package

Adopt when most of the following hold:

  • You have a pre-existing database and are introducing Laravel, or migrating a legacy app onto it.
  • You are planning a DB engine move and want a reviewable, diffable artifact of the schema.
  • You need one-time or occasional schema-to-migration generation, not continuous two-way sync.
  • You are on Laravel 12 (this release is the line that makes that viable) or an older supported line with a compatible DBAL.
  • You want the database schema under version control as a baseline, after which Laravel migrations become the source of truth.

Look elsewhere or proceed with caution when:

  • The project is greenfield and migrations are hand-authored from day one — the tool adds nothing.
  • You expect the database to remain the source of truth indefinitely; generated migrations go stale and create drift between the DB and the migration history.
  • The schema relies heavily on stored procedures, triggers, custom types, partitions, or vendor-specific extensions — expect incomplete fidelity and plan manual follow-up.
  • You need bidirectional or continuous schema synchronization; this is a generator, not a sync engine.
  • You cannot tolerate a dev-only dependency whose compatibility is coupled to Doctrine DBAL major versions — note the doctrine/dbal:^4.0 requirement on the 12.x line, which may conflict with other packages still on DBAL 3.

How to Pitch It (Stakeholders)

To executives: This is a free, open-source Laravel package that converts an existing database into version-controlled migration files. Its practical value is risk and cost reduction on two roadmap items: moving a legacy application onto Laravel, and changing database engines. The new 12.0.2 release resolves a dependency conflict that previously blocked Laravel 12 projects, so the tool is usable on our current stack with no licensing cost and no vendor commitment.

To engineering: migrations-generator 12.0.2 aligns the Laravel 12 line with doctrine/dbal:^4.0, resolving the Carbon 3 → carbon-doctrine-types:^3 → DBAL 4 chain that previously forced a DBAL 3 pin and caused an ecosystem mismatch. It handles both DBAL schema manager APIs (createSchemaManager() on DBAL 4, getSchemaManager() fallback for older implementations), ships a regression test for that selection logic, and documents the 12.x compatibility story. Practical guidance: install as a dev dependency, generate a baseline migration set, review the output (especially enum, JSON, and index handling), then treat Laravel migrations as the source of truth going forward. Known constraint: DBAL 4 requirement may collide with other packages still on DBAL 3 — verify with a dependency resolution dry run before merging.

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.
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource
noith/settings
kda/laravel-package
kda/filament-dynamic-navigation
bypersoft/signbox
pairus/product-data
fayne/laravel-filament-cms-core