1. In the Docker container’s startup script, to force the migration command to run without prompts, use the –force parameter.
php artisan migrate --force
2. Currently, there are modules developed based on LARAVEL MODULES that contain migration files, for example: /Modules/ThemeStoreDB/Database/Migrations. See Figure 1.

3. In the local development environment, to execute the migration files under a module, you typically run the command: php artisan module:migrate ThemeStoreDB. See Figure 2.

PS E:\wwwroot\object> php artisan module:migrate ThemeStoreDB
Migrating: 2021_12_06_133918_create_theme_asset_table
Migrated: 2021_12_06_133918_create_theme_asset_table (0.11 seconds)
Migrating: 2021_12_13_145303_create_theme_asset_version_table
Migrated: 2021_12_13_145303_create_theme_asset_version_table (0.1 seconds)
Migrating: 2022_05_16_105847_create_theme_installation_table
Migrated: 2022_05_16_105847_create_theme_installation_table (0.07 seconds)
Migrating: 2022_05_16_134353_create_theme_installation_version_preset_table
Migrated: 2022_05_16_134353_create_theme_installation_version_preset_table (0.21 seconds)
Migrating: 2022_05_16_172815_create_theme_installation_task_table
Migrated: 2022_05_16_172815_create_theme_installation_task_table (0.12 seconds)
4. However, with a large number of modules, it is impractical to frequently add migration commands for each corresponding module in the startup script. Reference: module:publish-migration, to publish the module’s database migration files. See Figure 3.

PS E:\wwwroot\object> php artisan module:publish-migration ThemeStoreDB
5. The files in the directory: /Modules/ThemeStoreDB/Database/Migrations have been copied to the directory: /database/migrations. See Figure 4.

6. This way, the command to execute migrations in the startup script only needs to be: php artisan migrate –force, without requiring any changes. When executed in the local environment, there are no migrations to run, which is as expected.
PS E:\wwwroot\object> php artisan migrate
Nothing to migrate.
PS E:\wwwroot\object>
