PHPackages                             arfaram/ezdatabasemigrationschema - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. arfaram/ezdatabasemigrationschema

ActiveEzplatform-bundle[Database &amp; ORM](/categories/database)

arfaram/ezdatabasemigrationschema
=================================

This bundle gives you the possibility to import,export and drop database table(s) by extending the doctrine-dbal-schema bundle introduced in v2.5

v0.1(6y ago)0131GPL-2.0-onlyPHPPHP ^7.1

Since Oct 30Pushed 6y ago1 watchersCompare

[ Source](https://github.com/arfaram/ezdatabasemigrationschema)[ Packagist](https://packagist.org/packages/arfaram/ezdatabasemigrationschema)[ Docs](https://github.com/arfaram/ezdatabasemigrationschema)[ RSS](/packages/arfaram-ezdatabasemigrationschema/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (1)Versions (2)Used By (0)

EzPlatformDatabaseSchemaMigrationBundle
=======================================

[](#ezplatformdatabaseschemamigrationbundle)

This bundle comes with several commands to export, import and drop database table(s) using schema files during or after site development. It allows you also to add data to your tables

Basically, you can use `DoctrineMigrationsBundle` or `KaliopMigrationBundle` to achieve database migration but this bundle uses the `doctrine-dbal-schema` bundle(used only during eZ Platform installation) and coming with ezplatform v2.5. It uses the same concept and classes to migrate custom schema either using `mysql` or `postgresql` databases.

Requirement
-----------

[](#requirement)

eZPlatform 2.5+ (Open Source or EE), PHP 7+

Installation
------------

[](#installation)

```
composer require arfaram/ezdatabasemigrationschema:^0.1

```

- Activate the Bundle in AppKernel.php

```
    public function registerBundles()
    {
        $bundles = array(
            new EzPlatform\DatabaseSchemaMigrationBundle\EzPlatformDatabaseSchemaMigrationBundle(),
        );

```

Commands
--------

[](#commands)

### Export Schema

[](#export-schema)

```
php bin/console db_schema_migration:schema:export

```

Parameters:

- `-t, --table[=TABLE]` : The table name to be exported. It will create an export file using the same table name and current timestamp e.g `ezcobj_state_1572446173.yaml`
- `all`: (default) If you don't specify explicitly the table name then it will export the entire db schema in `db_schema_>.yaml`

Note: You can specify the export folder path in `parameters.yml` otherwise it will create the dump files in your installation root folder:

Example:

```
parameters:
    database_schema_migration.export.schema.folder.path: '%kernel.root_dir%/../var/schemaexport/'

```

Note: Using eZPlatform Cloud you should mount the export path folder in `.platform.app.yaml`:

### Import Schema

[](#import-schema)

```
php bin/console db_schema_migration:schema:import

```

This command imports custom schema definition and you have to add the schema file path in `parameters.yml`

Example:

```
parameters:
    database_schema_migration.schema.file.path: '%kernel.root_dir%/../'

```

You can find a schema example in `bundle/doc/schema.yml` or the legacy ezplatform [schema.yaml](https://github.com/ezsystems/ezpublish-kernel/blob/master/eZ/Bundle/EzPublishCoreBundle/Resources/config/storage/legacy/schema.yaml)

### Import Data

[](#import-data)

Sometimes you want also to import data to an existing database table. This is also possible using below command:

```
php bin/console db_schema_migration:data:import

```

You have to add your sql file path in `parameters.yml`

Example:

```
parameters:
    database_schema_migration.import.data.file.path: '%kernel.root_dir%/../'

```

You can find an sql file example in `bundle/doc/mysql/data.sql` or just check more ezplatform [mysql](https://github.com/ezsystems/ezpublish-kernel/blob/master/data/mysql/cleandata.sql) or [postgresql](https://github.com/ezsystems/ezpublish-kernel/blob/master/data/postgresql/cleandata.sql) clean data installation example.

### Drop table(s) using schema file

[](#drop-tables-using-schema-file)

```
php bin/console db_schema_migration:schema:drop

```

This command removes table(s) using an existing schema file.You have to add the file path in `parameters.yml`

Example:

```
parameters:
    database_schema_migration.schema.file.path: '%kernel.root_dir%/../'

```

### Drop table(s) using table name

[](#drop-tables-using-table-name)

```
php bin/console db_schema_migration:table:drop

```

This command is using doctrine schema manager to drop db table.

How it works:
-------------

[](#how-it-works)

### SchemaBuilder

[](#schemabuilder)

The `Installer.php` class extends the `CoreInstaller` (used only during eZ Platform installation) but its constructor becomes a custom `SchemaBuilder`. It has the same structure like the `EzSystems\DoctrineSchema\Builder\SchemaBuilder` introduced in the `doctrine-dbal-schema` bundle.

The EventsSubscriber `BuildSchemaSubscriber` class will load the schema using the `importSchemaFromFile()` method defined in the `SchemaBuilder`.

You can also add a custom Subscriber which contains your custom schema. See the example in `services.yml`.

Take into account to use the `SchemaBuilderEvents::INSTALLER_BUILD_SCHEMA` event name to dispatch your subscriber during execution.

### ImportData

[](#importdata)

The `DbDataInstaller` extend the `DbBasedInstaller` coming with the `PlatformInstallerBundle` and being used by `CoreInstaller.php` (used only during eZ Platform installation)

This class hat its own constructor and `importData()` method which runs your custom queries.

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community5

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

2385d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/f444701f5c4c36a0bce616a679bf2e638d06a01f639acebed6d128dd9fca3182?d=identicon)[arfaram](/maintainers/arfaram)

---

Tags

ezplatformdoctrine-dbal-schema

### Embed Badge

![Health badge](/badges/arfaram-ezdatabasemigrationschema/health.svg)

```
[![Health](https://phpackages.com/badges/arfaram-ezdatabasemigrationschema/health.svg)](https://phpackages.com/packages/arfaram-ezdatabasemigrationschema)
```

###  Alternatives

[kaliop/ezmigrationbundle

Kaliop eZ-Migration Bundle

54358.0k9](/packages/kaliop-ezmigrationbundle)[netgen/admin-ui-bundle

Netgen Admin UI implements an alternate administration UI for eZ Platform, based on eZ Publish Legacy administration interface

3325.4k4](/packages/netgen-admin-ui-bundle)[netgen/information-collection-bundle

Information collection alike feature for Ibexa Platform

1945.1k9](/packages/netgen-information-collection-bundle)[netgen/remote-media-bundle

Remote media field type implementation

189.4k4](/packages/netgen-remote-media-bundle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
