srlabs/migration-wrangler

This package is abandoned and no longer maintained. No replacement package was suggested.

Import and export migration table data in Laravel projects.

v4.0.0 2020-03-04 22:20 UTC

This package is auto-updated.

Last update: 2020-09-09 21:12:47 UTC


README

WARNING

This package has been deprecated; new schema management tools have been added directly to Laravel 8; you can read about them here: https://laravel.com/docs/8.x/migrations#squashing-migrations

Migration Wrangler - Deprecated

No Maintenance Intended

Sometimes you may find that you want to port a migrations table from one database to another. This might occur if you are refactoring your migrations and want to update your production database migrations table to allow future migration tasks to remain in sync with your development database. This tool provides three artisan commands that should make that process easier.

Installation

composer require srlabs/migration-wrangler

This package uses automatic Package Discovery; once your composer installation is complete, you should be good to go. If not, you may need to manually register the service provider.

Usage

There are three new artisan commands provided by this package:

migrations:export

This command takes data from an existing migrations table and writes it to a json file.

Options: - database: The name of the database connection you want to pull data from - filepath: The destination folder for the generated json file - pretty: Optionally write the json in an easily readable format.

migrations:import

This command takes a json file generated by the export command and uses it to populate the migrations table, replacing the existing data. You must specify a path to the json file as the first argument to this command.

Options: - database: The name of the database connection you want to insert data into - pretend: Attempt the import process without making any actual changes to the database.

migrations:generate

This command traverses your migrations folder and generates a json file based on the migrations found there. It will automatically put each migration into a separate batch.

Options: - path: The location of the migrations folder you want to inspect - filepath: The destination folder for the generated json file - pretty: Optionally write the json in an easily readable format.