Skip to content
Discussion options

You must be logged in to vote

I've added an event which allows you to register additional migrators that are run with the php craft migrate:all command: 70a57d6

use CraftCms\Cms\Database\Events\RegisterMigrators;
use CraftCms\Cms\Database\Migrator;
use Illuminate\Support\Facades\Event;

Event::listen(RegisterMigrators::class, function (RegisterMigrators $event) {
    $event->migrators[] = app(Migrator::class)->track('my-track')->setPaths([
        // Path to migration files
    ]);
});

This is similar to how the functionality was already available as discussed here: #6172 (comment)

Replies: 3 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@BenParizek
Comment options

@BenParizek
Comment options

@riasvdv
Comment options

Answer selected by BenParizek
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants