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

Runing migration even if the migrations are not loaded from module service provider #1951

Closed
inkomomutane opened this issue Sep 19, 2024 · 2 comments
Labels

Comments

@inkomomutane
Copy link

inkomomutane commented Sep 19, 2024

Versions:

  • laravel-modules Version: 11.1.0 - 11.1.1
  • Laravel Version: 11.23.5
  • PHP Version: 8.3.6

Description:

I commented loadMigrationsFrom function to ensure that no migration should be run by module itself
and let the tenancy provider to do so because i have a modular system and is multi-tenanted database.
but after updating the composer all my module migration are going to central database and this is not what we pretend.

but after downgrade to version 11.0.11 everything works fine.
Thanks.

Steps To Reproduce:

 # ModuleServiceProvider
        //$this->loadMigrationsFrom(module_path($this->moduleName, 'database/migrations'));

php artisan migrate

@alissn
Copy link
Contributor

alissn commented Sep 19, 2024

Hi,

In version 11.1.0, we introduced auto-registration of migrations for all enabled modules (#1889, #1945).

You can sync your config file with the new version and disable this feature if needed by updating the following section:

/*
|--------------------------------------------------------------------------
| Auto Discover of Modules
|--------------------------------------------------------------------------
|
| Configure the auto-discovery of modules here.
| This simplifies module service provider management.
|
*/
'auto-discover' => [
    /*
    |--------------------------------------------------------------------------
    | Migrations
    |--------------------------------------------------------------------------
    |
    | This option automatically registers migrations.
    |
    */
    'migrations' => true,

    /*
    |--------------------------------------------------------------------------
    | Translations
    |--------------------------------------------------------------------------
    |
    | This option automatically registers language files.
    |
    */
    'translations' => false,
],

@inkomomutane
Copy link
Author

Thanks that works

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

No branches or pull requests

2 participants