A composer package made for importing database dumps faster than the laravel classic migration system.
It can be used to replace the rather slow
$this->runDatabaseMigrations()
$this->seed()
artisan migrate:fresh
artisan migrate:fresh --seed
php artisan db:dump
php artisan db:load {--seed}
use Illuminate\Foundation\Testing\DatabaseMigrations;
use QuickDatabaseMigrations\QuickDatabaseMigrations;
It makes migrations for tests as fast as db:load at the cost of manually running db:dump after a migration|seed change (and no rollbacks after tests)
composer require alexandruflorea/quick-laravel-migrations
this enables db:dump and db:load
use QuickDatabaseMigrations;
/**
* The Artisan commands provided by your application.
*
* @var array
*/
protected $commands = [
\QuickDatabaseMigrations\MySqlDump::class,
\QuickDatabaseMigrations\MySqlLoad::class
];
use Illuminate\Foundation\Testing\DatabaseMigrations;
use QuickDatabaseMigrations\QuickDatabaseMigrations;
3 utility classes are provided under the same namespace
defines hooks to migrate the database
it requires a db:dump beforehand
use QuickDatabaseMigrations\QuickDatabaseMigrations;
use QuickDatabaseMigrations;
$this->runDatabaseMigrations(); //fast migrate:fresh
$this->runDatabaseSeedMigrations(); //fast migrate:fresh --seed
$this->baseRunDatabaseMigrations(); //default migrate:fresh
$this->baseRunDatabaseSeedMigrations(); //default migrate:fresh --seed
a fast way to generate dump files
you can totally ignore this and manually place the dump files in
/QuickMigration/sql.dump
or/QuickSeedMigration/sql.dump
php artisan db:dump
a fast way to load a dump file
you can totally ignore this as well if you want to manually import it every time
php artisan db:load
Laravel 5.6+
The MIT License (MIT). Please see License File for more information.