umbrellio / rollback-missing-migrations
Laravel package for rolling back migrations between different releases
2.4.1
2023-03-23 09:50 UTC
Requires
- php: ^7.3|^7.4|^8.0
- illuminate/console: ^5.7|^6.20|^7.30|^8.20|^9.0|^10.0
- illuminate/database: ^5.7|^6.20|^7.30|^8.20|^9.0|^10.0
- illuminate/support: ^5.7|^6.20|^7.30|^8.20|^9.0|^10.0
Requires (Dev)
- laravel/legacy-factories: ^1.0
- orchestra/testbench: ^3.8|^4.8|^5.7|^6.2|^7.0|^8.0
- php-coveralls/php-coveralls: ^2.1
- php-mock/php-mock: ^2.0
- phpunit/phpunit: ^7.3|^8.5|^9.4|^10.0
- squizlabs/php_codesniffer: ^3.5
- umbrellio/code-style-php: ^1.0
README
Laravel package for rolling back migrations between different releases
Installation
composer
composer require umbrellio/rollback-missing-migrations
Usage
In your new release directory:
php artisan rollback_missing_migrations:rollback <path_to_artisan>
<path_to_artisan>
- absolute path to artisan command in previous release
Example:
php artisan rollback_missing_migrations:rollback /projects/old_release/your_app/artisan
If your migrations files locate in the custom directory you can use optional parameters:
--path
- path where your migration files locate in current release--old-path
- path where your migration files locate in old release--realpath
- this flag indicates, how--path
and--old-path
formats (absolute or relative) will be recognized
Example with a relative path:
php artisan rollback_missing_migrations:rollback /projects/old_release_app/artisan \
--old-path=database/old_custom_folder \
--path=database/custom_migration_folder
Example with an absolute path:
php artisan rollback_missing_migrations:rollback /projects/old_release/your_app/artisan \
--old-path=/projects/old_release/your_app/database/old_custom_folder \
--path=/new_release/your_app/database/custom_migration_folder \
--realpath
In case if you need rollback new migrations different from origin/master, you can use rollback_new_migrations:rollback
Authors
Created by Art4es & Korben Dallas.