Artisan command to migrate an existing production database structure to use Laravel migrations
Require this package with composer:
composer require exolnet/laravel-db-upgrade
The package will automatically register its service provider.
Publish the config file to config/db-upgrade.php
using:
php artisan vendor:publish --provider="Exolnet\DbUpgrade\DbUpgradeServiceProvider"
Review and update the default configuration according to your use case (see Usage section for more information).
- Create migrations to obtain your current database structure;
- Configure
last_migration_for_upgrade
to points to the last migration that represent your current database structure; - Optionally, you can add migrations to update your old structure;
- Run the
php artisan db:upgrade
command.
The db:upgrade
command will perform the following actions:
- Backup your data;
- Run your migrations up to the
last_migration_for_upgrade
migration; - Restore your data;
- Run remaining migration.
To run the phpUnit tests, please use:
composer test
Please see CONTRIBUTING and CODE OF CONDUCT for details.
If you discover any security related issues, please email security@exolnet.com instead of using the issue tracker.
This code is licensed under the MIT license. Please see the license file for more information.