babenkoivan / elastic-migrations

Elasticsearch migrations for Laravel
MIT License
187 stars 32 forks source link

Allow declare migration from inside packages #37

Closed iget-master closed 2 years ago

iget-master commented 2 years ago

Hi @babenkoivan,

First congrats by the new package, just now I had time to migrate from the old package to this one. The migration experience was awesome.

This feature request is about a method for declaring migrations from inside a package service provider.

Let me explain: I've a ton of packages that add functionalities to a core project, this allows me to create modular systems, implementing only the necessary.

In your old package, I used to put the IndexConfigurators inside each module, and I had a core package that was responsible for creating the indexes. With the migrations, I could publish the migrations to the core project, but this bloats my code base, IMO I don't like this approach. For the database migrations, I use loadMigrationsFrom to declare the migration files inside my package.

My suggestion is to allow the same behavior. A package can auto declare your migrations without needing to publish them to the core project.

github-actions[bot] commented 2 years ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days

babenkoivan commented 2 years ago

Hi @iget-master, this is a good suggestion, but it requires a complete rework of MigrationStorage and some commands. I've noted this feature for the future version 3, but can't give an estimation of when it's gonna be released at the moment.

babenkoivan commented 2 years ago

Hey @iget-master, I've recently released v3.0.0 that supports multiple directories 🎉 You can see how it can be configured here. Please note, that the new version supports only Elasticsearch 8.