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

Support multiple migrations-directories #342

Open
marcusrettig opened this issue Jun 19, 2023 · 1 comment
Open

Support multiple migrations-directories #342

marcusrettig opened this issue Jun 19, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@marcusrettig
Copy link

Is your feature request related to a problem? Please describe.
The plugin only considers migrations in the database/migrations directory. If migrations are spread out in several directories, e.g. when using Laravel Modules, some Model stubs are generated without @property definitions. This results in many false positive UndefinedMagicPropertyAssignment errors.

Describe the solution you'd like
First, a warning message would be nice when a table can't be found (here).

Second, a way to specify multiple directories for migrations would be nice. I'm not sure what would be the best way to do this.

Describe alternatives you've considered
Temporarily moving all migrations into database/migrations before running Psalm fixes the issue, but it is rather inconvenient.

Additional context
Our directory structure looks like this:

database/
    migrations/
modules/
    MobuleA/
        database/
            migrations/
    MobuleB/
        database/
            migrations/
@marcusrettig marcusrettig added the enhancement New feature or request label Jun 19, 2023
@Ar-Monta
Copy link

Ar-Monta commented Apr 3, 2024

Hello @marcusrettig
To support migrating from a specific migration directory you can customize your module's service provider by overriding boot() function and adding this line of code:
$this->loadMigrationsFrom("YOUR_SPECIFIC_MODULE_MIGRATIONS_DIRECTORY");

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

No branches or pull requests

3 participants