Skip to content
Merged
21 changes: 18 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,31 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## Version 3.0.0

To upgrade to the 3.0.0 version :

* Remove the old bundle declaration from `config/bundles.php` (e.g. `Kaliop\IbexaMigrationBundle\IbexaMigrationBundle::class => ['all' => true]`).
* Update the bundle with composer : `composer require mrk-te/ibexa-migration-bundle2:^3.0`.
* Ensure the bundle is declared with his new name in `config/bundles.php` (e.g. `Kaliop\IbexaMigrationBundle\KaliopMigrationBundle::class => ['all' => true]`).
* Optionnally, rename the `src/MigrationsDefinitions` folder to `src/KaliopMigrations`.

### Changed

* Rename `IbexaMigrationBundle` to `KaliopMigrationBundle` to avoid conflicts with official ibexa/migrations (#8).
* Rename all elements prefixed with `ibexa_migration*` to `kaliop_migration*` to avoid ambiguity (#8).
* Rename `MigrationsDefinitions` to `KaliopMigrations` to avoid ambiguity (#8).

## Version 2.1.0

### Changed

* #6 - Update WHATSNEW to CHANGELOG following the "Keep a Changelog" format
* Update WHATSNEW to CHANGELOG following the "Keep a Changelog" format (#6).

### Fixed

* #1 - Fix image, binary files and media field types file input property name
* #4 - Content type descriptions are not nullable. Ensure descriptions are always strings on fields too.
* Fix image, binary files and media field types file input property name (#1).
* Content type descriptions are not nullable. Ensure descriptions are always strings on fields too (#4).

## Version 2.0.0

Expand Down
4 changes: 2 additions & 2 deletions Command/GenerateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ protected function listAvailableTypes(OutputInterface $output)
protected function getMigrationDirectory($bundleName)
{
if (!$bundleName) {
return $this->getApplication()->getKernel()->getProjectDir() . '/src/' . $this->configResolver->getParameter('ibexa_migration_bundle.version_directory');
return $this->getApplication()->getKernel()->getProjectDir() . '/src/' . $this->configResolver->getParameter('kaliop_migration_bundle.version_directory');
}

// Allow direct usage of a directory path instead of a bundle name
Expand All @@ -368,7 +368,7 @@ protected function getMigrationDirectory($bundleName)
}

$bundle = $this->getApplication()->getKernel()->getBundle($bundleName);
$migrationDirectory = $bundle->getPath() . '/' . $this->configResolver->getParameter('ibexa_migration_bundle.version_directory');
$migrationDirectory = $bundle->getPath() . '/' . $this->configResolver->getParameter('kaliop_migration_bundle.version_directory');

return $migrationDirectory;
}
Expand Down
26 changes: 13 additions & 13 deletions DependencyInjection/CompilerPass/TaggedServicesCompilerPass.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,28 +13,28 @@ class TaggedServicesCompilerPass implements CompilerPassInterface
*/
public function process(ContainerBuilder $container)
{
if ($container->has('ibexa_migration_bundle.migration_service')) {
$migrationService = $container->findDefinition('ibexa_migration_bundle.migration_service');
if ($container->has('kaliop_migration_bundle.migration_service')) {
$migrationService = $container->findDefinition('kaliop_migration_bundle.migration_service');

$DefinitionParsers = $container->findTaggedServiceIds('ibexa_migration_bundle.definition_parser');
$DefinitionParsers = $container->findTaggedServiceIds('kaliop_migration_bundle.definition_parser');
foreach ($DefinitionParsers as $id => $tags) {
$migrationService->addMethodCall('addDefinitionParser', array(
new Reference($id)
));
}

$executors = $container->findTaggedServiceIds('ibexa_migration_bundle.executor');
$executors = $container->findTaggedServiceIds('kaliop_migration_bundle.executor');
foreach ($executors as $id => $tags) {
$migrationService->addMethodCall('addExecutor', array(
new Reference($id)
));
}
}

if ($container->has('ibexa_migration_bundle.complex_field_manager')) {
$migrationService = $container->findDefinition('ibexa_migration_bundle.complex_field_manager');
if ($container->has('kaliop_migration_bundle.complex_field_manager')) {
$migrationService = $container->findDefinition('kaliop_migration_bundle.complex_field_manager');

$DefinitionParsers = $container->findTaggedServiceIds('ibexa_migration_bundle.complex_field');
$DefinitionParsers = $container->findTaggedServiceIds('kaliop_migration_bundle.complex_field');

// allow for prioritization of tagged services
$handlers = array();
Expand All @@ -58,9 +58,9 @@ public function process(ContainerBuilder $container)
}
}

if ($container->has('ibexa_migration_bundle.reference_resolver.customreference.flexible')) {
$customReferenceResolver = $container->findDefinition('ibexa_migration_bundle.reference_resolver.customreference.flexible');
$extraResolvers = $container->findTaggedServiceIds('ibexa_migration_bundle.reference_resolver.customreference');
if ($container->has('kaliop_migration_bundle.reference_resolver.customreference.flexible')) {
$customReferenceResolver = $container->findDefinition('kaliop_migration_bundle.reference_resolver.customreference.flexible');
$extraResolvers = $container->findTaggedServiceIds('kaliop_migration_bundle.reference_resolver.customreference');

foreach ($extraResolvers as $id => $tags) {
$customReferenceResolver->addMethodCall('addResolver', array(
Expand All @@ -69,9 +69,9 @@ public function process(ContainerBuilder $container)
}
}

if ($container->has('ibexa_migration_bundle.context_handler')) {
$contextHandlerService = $container->findDefinition('ibexa_migration_bundle.context_handler');
$ContextProviders = $container->findTaggedServiceIds('ibexa_migration_bundle.context_provider');
if ($container->has('kaliop_migration_bundle.context_handler')) {
$contextHandlerService = $container->findDefinition('kaliop_migration_bundle.context_handler');
$ContextProviders = $container->findTaggedServiceIds('kaliop_migration_bundle.context_provider');

foreach ($ContextProviders as $id => $tags) {
foreach ($tags as $attributes) {
Expand Down
2 changes: 1 addition & 1 deletion DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class Configuration implements ConfigurationInterface
*/
public function getConfigTreeBuilder(): TreeBuilder
{
$treeBuilder = new TreeBuilder('ibexa_migration_bundle', 'array');
$treeBuilder = new TreeBuilder('kaliop_migration_bundle', 'array');
$rootNode = $treeBuilder->getRootNode();

// Here you should define the parameters that are allowed to
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
*
* To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html}
*/
class IbexaMigrationExtension extends Extension
class KaliopMigrationExtension extends Extension
{
public static $loadTestConfig = false;

Expand Down
2 changes: 1 addition & 1 deletion IbexaMigrationBundle.php → KaliopMigrationBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\Bundle\Bundle;

class IbexaMigrationBundle extends Bundle
class KaliopMigrationBundle extends Bundle
{
public function build(ContainerBuilder $container)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ private function __construct(ContainerInterface $container)

private function goForIt()
{
$this->migrationsTableName = $this->container->getParameter('ibexa_migration_bundle.table_name');
$this->migrationsTableName = $this->container->getParameter('kaliop_migration_bundle.table_name');

$this->connection = $this->container->get('ibexa.persistence.connection');

/** @var \Kaliop\IbexaMigrationBundle\Core\Helper\ConsoleIO $io */
$io = $this->container->get('ibexa_migration_bundle.helper.console_io');
$io = $this->container->get('kaliop_migration_bundle.helper.console_io');
// NB: in theory this could be null!
$output = $io->getOutput();

Expand Down
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ Ibexa-Migration-Bundle for Ibexa 5

This is an upgrade of [tanoconsulting/ibexa-migration-bundle](https://github.com/tanoconsulting/ibexa-migration-bundle for Ibexa 5.

Version `^2.0` adds support for Ibexa 5.
Version `^3.0` adds support for Ibexa 5.

Version '^2.0' was dropped as it conflict with official Ibexa/Migrations.

Version `1.0.6` includes the support of the `ezimageasset` field type for Ibexa 4.

Expand Down Expand Up @@ -31,7 +33,7 @@ Following versions are available:

Run :

composer require 'mrk-te/ibexa-migration-bundle2:^2.0'
composer require 'mrk-te/ibexa-migration-bundle2:^3.0'

This will install the bundle and all its dependencies.

Expand Down Expand Up @@ -90,7 +92,7 @@ status command in your eZPlatform root directory:

The list of migrations which have been already applied is stored in the database, in a table named `kaliop_migrations`.
The bundle will automatically create the table if needed.
In case you need to use a different name for that table, you can change the Symfony parameter `ibexa_migration_bundle.table_name`.
In case you need to use a different name for that table, you can change the Symfony parameter `kaliop_migration_bundle.table_name`.

### Applying migrations

Expand Down Expand Up @@ -172,7 +174,7 @@ Example command to generate an SQL migration definition:

This will create the following file, which you are free to edit:

./src/MigrationsDefinitions/2021XXYYHHMMSS_mysql_create-new-table.sql
./src/KaliopMigrations/2021XXYYHHMMSS_mysql_create-new-table.sql

*NB* if you rename the sql file, keep in mind that the type of database to which it is supposed to apply is the part
of the filename between the first and second underscore characters.
Expand All @@ -198,7 +200,7 @@ migration definition. To generate a PHP migration definition, execute:

This will create the following file, which you are free to edit:

./src/MigrationsDefinitions/2021XXYYHHMMSS_AMigrationClass.php
./src/KaliopMigrations/2021XXYYHHMMSS_AMigrationClass.php

As you can see in the generated definition, the php class to be used for a migration needs to implement a specific
interface. The Symfony DIC container is passed to the migration class so that it can access from it all the services,
Expand Down Expand Up @@ -303,7 +305,7 @@ Event Subscribers are supported as an alternative to Event Listeners, as is stan
- and/or configuring Solr to always commit changes to the index immediately (eg. disable `commitwithin`)

* when using SOLR in multi-core configurations and getting a `java.lang.NegativeArraySizeException` error, you will have
to set a lower value than the default 2147483647 for parameter `ibexa_migration_bundle.query_limit`
to set a lower value than the default 2147483647 for parameter `kaliop_migration_bundle.query_limit`

* if you get fatal errors without any error message when running a migration which involves a lot of content changes,
such as f.e. altering a contentType with many contents, it might be that you are running out of memory for your
Expand Down
Loading