Skip to content

Commit 567ecee

Browse files
Update database-migrations.md
1 parent ecff64d commit 567ecee

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

guides/plugins/plugins/database/database-migrations.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,3 +197,16 @@ Therefore, a typical update method might look more like this:
197197
```
198198

199199
If you don't use the Shopware migration system, an empty collection (`NullObject`) will be in the context.
200+
201+
### Customizing the migration path / namespace
202+
203+
Most plugins should keep the default `src/Migration` directory — the tooling and examples in this guide assume it. If you have a specific reason to relocate your migrations, you can choose another namespace for them by overwriting your plugin's `getMigrationNamespace()` method in the plugin base class:
204+
205+
```php
206+
public function getMigrationNamespace(): string
207+
{
208+
return 'Swag\BasicExample\MyMigrationNamespace';
209+
}
210+
```
211+
212+
Since the path is read from the namespace, your Migration directory would have to be named `MyMigrationNamespace` now.

0 commit comments

Comments
 (0)