Hopefully, I can explain this well.
I have a Laravel application that has been in production for a minute. So, I have a bunch of migration files with a lot of changes. I would like to consolidate these migration files without losing the database.
The way I think this would work:
Part of why I would like to do this is because I would like to make some of the service providers public with the cleanest migration set possible.
The difficult version might be to:
Just hoping there's an easier way than that.
Edit (from comments): I have a production database that has about 50+ migration files - some minor changes, some large changes. If I consolidated, the number of migrations needed would be about 12 or so. I would like to consolidate the migration files, but still be able to perform migrate:rollback
on production - not that I would.
Advantages and Disadvantages of Laravel MigrationIt is a new framework. Web applications can be built on it quickly. It is easy to learn. The documentation is easily available.
Migration SquashingLaravel will write the new schema file to database/schema . Then when you run your migrations, Laravel will run the SQL from the schema file first before moving on to anything created later in the migrations folder. Note: Migration squashing is currently only supported for MySQL and Postgres.
Laravel Migration is an essential feature in Laravel that allows you to create a table in your database. It allows you to modify and share the application's database schema. You can modify the table by adding a new column or deleting an existing column.
You could use the library "xethron/migrations-generator
" . Here's the repo.
After installation, basic usage:
php artisan migrate:generate
Some Discussions about this are found at laracast.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With