Database Migration

Modules can have their own migrations. To get comprehensive information about migrations in OXID eShop, check database migrations documentation.

Configuration

Put the migration configuration file into the migration folder inside the module’s root directory:

├── migration
     └── migrations.yml

Example of migrations.yml:

table_storage:
  table_name: oxmigrations_ddoewysiwyg
migrations_paths:
  'OxidEsales\WysiwygModule\Migrations': data

Tip

To prevent database table name conflicts, include your module’s ID in table_name.

Migration Classes

Most recent info on requirements and structure of Migration Classes can be found in Doctrine Migrations documentation.

Module migrations can also be generated and executed via OXID eShop Doctrine Migration Wrapper.

Warning

When planning your Migration’s structure, remember that certain SQL statements will issue Implicit commits which will affect the transaction functionality and may have unexpected side-effects.

Usage

To generate migration versions for a specific module, we must use module_id for <Suite_Type> parameter. Then all the module migration versions will be generated based on the configuration from migrations.yml file in migration folder of the given module.

Example:

vendor/bin/oe-eshop-db_migrate migrations:generate ddoewysiwyg

In this case it will be generated only for WYSIWYG module.