babenkoivan / elastic-migrations

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

Change migration format #54

Closed pelmered closed 1 month ago

pelmered commented 7 months ago

I've been having issues with this package when I use autoloading of migrations from domain paths in my project that uses DDD, in specific this package: lunarstorm/laravel-ddd. I get error like Cannot declare class CreateUsersIndex, because the name is already in use because the file is loaded multiple times which makes the class names clash. That DDD package autoloads several types of files which scans the Domain directory and creates this problem.

While this could be fixed in that package as well, but I think it would be better if this migration format is updated to be the same as the Laravel format with anonymous classes. I.e: return new class implements MigrationInterface Instead of: final class CreateVehiclesIndex implements MigrationInterface The file names are not changed.

This change is made to be backwards compatible with the current format.

I have added some tests, but some more tests could probably be added to to test this format further.

github-actions[bot] commented 6 months ago

This pull request 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

github-actions[bot] commented 5 months ago

This pull request 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 4 months ago

Hey @pelmered, thank you for the PR! Could you please resolve the conflicts and look at the comment I left?

babenkoivan commented 3 months ago

Could you please also adjust the code so that all checks would be green?

github-actions[bot] commented 2 months ago

This pull request 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

github-actions[bot] commented 1 month ago

This pull request 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