Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Enhancement] Allow finding operations from multiple directories #10

Open
shadoWalker89 opened this issue Apr 3, 2023 · 2 comments
Open

Comments

@shadoWalker89
Copy link

Hi,

I have an enhancement suggestion.
Allow loading operations from multiple directories just like laravel migrations.
This can be done via the config file directory key maybe renamed to directories with a fallback to directory to avoid breaking change.
Also you could add a method called loadOperationsFrom() the same way laravel provides loadMigrationsFrom()

Personally for my use case, i have two places where i can load laravel migrations from.

@dev-databee
Copy link

I have a similar request, so not opening a new issue.

My case is this. I have a multi-tenant application that uses two databases. So I would need to load operations from different directories - one for tenants, and one for the central app (landlord).

While this enhancement could work partially for me, I have trouble with migrating the operations table. This is just a thought for now. I will eventually need to create the table in both tenant and landlord database.

Since the operations table migration is not published, and always picks form the vendor directory, when I run migrate --database=tenant, its fine and creates the operations table in the tenant database. This works because for tenant database the migration files are stored in the default location - database/migrations. But when I want to run it for the default database migrate --database=landlord --path=database/migrations/landlord it wouldn't pick up the migration for operations as it is in the vendor directory. For now I just copied the migration to the landlord directory, but it would be nice if we could publish the migration file.

@dev-databee
Copy link

Never mind, I mitigated the issue by moving my tenant migrations to it's own directory.

But yeah, I can't wait for the enhancement to be merged 😀.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants