|
|
|
This is a bundle for Ibexa DXP. It automatically creates migrations for content types and content type groups.
The goal is to eliminate the need to manually create migrations or test them – instead have Ibexa auto-generate them for us whenever content types change.
Migrations are created in the default locations (in src/Migrations/Ibexa/migrations when using ibexa/migrations or in src/MigrationsDefinitions when using kaliop, tanoconsulting, mrk-te open source migration bundle).
- Ibexa DXP >= v5.0
- Ibexa DXP >= v4.4 (untested)
- A migrations bundle if using Ibexa OSS
- Automatically create migrations when changes are made in the admin panel
- Supports Ibexa DXP v5.x Headless, Experience and Commerce editions via
ibexa/migrations - Supports Ibexa DXP v5.x. Open Source Edition via
mrk-te/ibexa-migration-bundle2
- Content Type Group
- Content Type
- Language
- Object State Group
- Object State
- Role
- Section
- URL Wildcards
- URL Manager
Add the recipe endpoint to your project's composer.json once:
"extra": {
"symfony": {
"endpoint": [
"https://raw.githubusercontent.com/vardumper/IbexaAutomaticMigrationsBundle/main/flex/",
"flex://defaults"
]
}
}Then install the bundle:
composer require vardumper/ibexa-automatic-migrations-bundleSymfony Flex will automatically:
- Register the bundle in
config/bundles.php - Copy a default configuration to
config/packages/ibexa_automatic_migrations.yaml
composer require vardumper/ibexa-automatic-migrations-bundleRemember that even though the bundle is activated for all environments, migration files are only created when APP_ENV is set to dev.
return [
// ...
vardumper\IbexaAutomaticMigrationsBundle\IbexaAutomaticMigrationsBundle::class => ['all' => true],
];Create config/packages/ibexa_automatic_migrations.yaml:
ibexa_automatic_migrations:
enabled: true
types:
content: false
content_type: true
content_type_group: true
section: false
object_state: false
object_state_group: false
user: false
user_group: false
role: false
language: false
url: falseCreate config/routes/dev/ibexa_automatic_migrations.yaml:
ibexa_automatic_migrations:
resource: '@IbexaAutomaticMigrationsBundle/src/Controller/'
type: attributeTo configure which migration types are generated, go to Admin > Migrations > Settings.
This bundle uses Pest for testing.
First, install the development dependencies:
composer install --devThen run the tests:
./vendor/bin/pestYou can also generate a coverage report by running the following command.
XDEBUG_MODE=coverage vendor/bin/pest --coverage-html=coverage-report
- Allow admins to execute pending migrations in the admin panel
- Support more types of migrations, not only content types are relevant, but Languages, Sections, etc.
- Determine or allow configuring which Migration Bundle one wants to use (if kaliop and ibexa bundles are installed)