nWidart / laravel-modules

Module Management In Laravel
https://docs.laravelmodules.com
MIT License
5.5k stars 954 forks source link

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

Closed inkomomutane closed 1 week ago

inkomomutane commented 1 week ago

Versions:

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 commented 1 week ago

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 commented 1 week ago

Thanks that works