An extension to allow you to separate data migrations from structure migrations
jamesfreeman/laravel-data-migrations is a Laravel package for an extension to allow you to separate data migrations from structure migrations.
It currently has 0 GitHub stars and 2.779 downloads on Packagist (latest version 2.0.0).
Install it with composer require jamesfreeman/laravel-data-migrations.
Discover more Laravel packages by jamesfreeman
or browse all Laravel packages to compare alternatives.
Last updated
This extension allows you to separate data migrations from structure migrations.
The preferred way to install this extension is through composer.
With Composer installed, you can then install the extension using the following commands:
composer require jamesfreeman/laravel-data-migrations
or add
...
"require": {
"jamesfreeman/laravel-data-migrations": "^2.0"
}
to the require section of your composer.json file.
config/app.php
return [
//other stuff
'providers' => [
\JamesFreeman\DataMigrations\DataMigrationsServiceProvider::class,
];
];
php artisan vendor:publish --tag=data-migrations
This will create the default migrations directory and the config/data-migrations.php file.
By default, the table used to store the data migrations is "migrations_data" table. You can change the table on the config/data-migrations.php file.
The data migrations will be stored in the migrations_data folder of the database path if no path is specified in the command execution.
The available commands of the package are:
Create migration command
php artisan make:data-migration [name] [--path=]
The first time you use it the data migrations table will be created.
Run migration command
php artisan migrate-data [--path=]
Rollback migration command
php artisan migrate-data:rollback [--path=]
The behavior of the migrations is the same as the regular migrations.
Copyright © 2021 José Lorente Martín [email protected], Eran Machiels [email protected].
Licensed under the MIT license. See LICENSE.txt for details.