NiclasvanEyk / jetbrains-laravel-make-integration

🛠 A set of integration points that connect your Laravel application to PhpStorm
https://plugins.jetbrains.com/plugin/14612-make-for-laravel
37 stars 5 forks source link

✅ Migration status #46

Open NiclasvanEyk opened 2 years ago

NiclasvanEyk commented 2 years ago

Indicates whether the migration was run or not via a gutter icon next to the class keyword in a migration file.

Migration Ran (DB icon with gray checkmark) Migration still needs to be ran (DB icon with green play icon)
Screen Shot 2022-04-30 at 14 57 59 Screen Shot 2022-04-30 at 14 57 42

First iteration, only works if:

The feature basically works by running select * from migrations and compare this to the files in the datbase/migrations folder.

For migrations also found in the database we just display an icon stating that the migration ran. For pending migrations, the icon is different and can be used to easily apply all pending migration by running php artisan migrate via a run configuration.

Eventbus Connector

This PR also introduces a new component, which injects code into the projects source code, which enables us to listen for events emitted by the Laravel application. This enables us to listen for the MigrationsEnded event and refresh the migration status, as well as the manged data source schema.

Since some might see this as invasive, we should provide a setting to turn this off.

TODO

Further iterations could apply/reverse single migrations by utilizing the --step parameter, but for now this is out of scope.

pniaps commented 2 years ago

Wow, nice!