magendoo / module-declarative-enum-support

magendoo/module-declarative-enum-support

Lets Magento 2 declarative schema (setup:upgrade) read past MySQL ENUM/SET columns in third-party database tables instead of failing with 'Cannot process definition to array for type enum'.

magento2-module Compatibility: 2.4.7-2.4.9 Code Quality: Info Tests: N/A Security: Pass MIT

Are you the maintainer of magendoo?

Packagento pulls magendoo's Composer packages from the public registry so buyers can find them here.

Claim the namespace to take ownership, publish new releases directly, and start charging for premium versions.

Claim this namespace →

Magendoo DeclarativeEnumSupport for Magento 2

Lets bin/magento setup:upgrade succeed when the Magento database contains
third-party tables with MySQL ENUM or SET columns.

The problem

Magento's declarative schema reads every table in the database — not just
the tables declared in db_schema.xml files. If any table contains an ENUM
or SET column, setup:upgrade aborts:

Upgrade failed: Cannot process definition to array for type enum

and, once past that, a second failure in the DTO layer:

Types enum is not declared

This bites any installation whose database is shared with other applications
(microservices, ETL pipelines, reporting tools) or contains tables left behind
by legacy extensions — Magento itself never creates ENUM/SET columns, but
it refuses to read past anyone else's.

What this module does

It registers handlers for the enum and set column types in the two
declarative-schema registries that lack them:

Registry Class Handler
definitionProcessors Magento\Framework\Setup\Declaration\Schema\Db\DefinitionAggregator Pass-through processor (Model/EnumDefinition.php)
typeFactories Magento\Framework\Setup\Declaration\Schema\Dto\ElementFactory Stock Blob DTO factory

Tables that are not declared in any db_schema.xml are never diffed, so
declarative schema only needs to parse their columns without crashing — it
never generates DDL for them. Your third-party tables are read, ignored, and
left untouched.

Declaring an ENUM column in a db_schema.xml remains unsupported: the
pass-through processor throws a LogicException if declarative schema ever
tries to render one, so misuse fails loudly instead of producing broken DDL.

Installation

Via composer (VCS repository)

composer config repositories.magendoo-declarative-enum-support vcs https://github.com/magendooro/magento2-declarative-enum-support
composer require magendoo/module-declarative-enum-support
bin/magento module:enable Magendoo_DeclarativeEnumSupport
bin/magento setup:upgrade

Via app/code

mkdir -p app/code/Magendoo
git clone https://github.com/magendooro/magento2-declarative-enum-support app/code/Magendoo/DeclarativeEnumSupport
bin/magento module:enable Magendoo_DeclarativeEnumSupport
bin/magento setup:upgrade

Compatibility

  • Magento Open Source / Adobe Commerce 2.4.x (tested on 2.4.9)
  • PHP 8.1+

Maintenance note (important)

A module's di.xml argument replaces — it does not merge with — the same
argument declared in the primary config app/etc/di.xml; primary and module
configs are combined per-argument, not per-array-item. This module therefore
ships full copies of the typeFactories and definitionProcessors
registries with enum/set appended.

After upgrading Magento, diff this module's etc/di.xml against your
app/etc/di.xml: if a new core release adds column types to either registry,
they must be re-synced here, otherwise the new types would be masked.

License

MIT

No changelog yet

The vendor hasn't published a changelog. Tagged releases appear in the Versions tab.

Versions
Version Stability QA Status Compatibility Released
v1.0.0 stable Pass Magento 2.4.7-2.4.9 Details 2026-07-18 14:43:16

Requires 2

Package Constraint
magento/framework >=103.0.0
php >=8.1

Compatibility

Each Magento release line is installed on its supported PHP versions, then the module is built (DI compilation + static-content deploy) and its unit and integration suites are run. The matrix shows the lines and PHP versions the module is confirmed to install and run on. Code-quality results further down (phpstan, phpcs, …) are reported separately and never affect compatibility.

Compatibility matrix (Magento × PHP)
Magento PHP 8.2 PHP 8.3 PHP 8.4 PHP 8.5
2.4.7 Pass Pass
2.4.8 Pass Pass
2.4.9 Pass Pass

Code Quality

Advisory checks against the module's source. Static analysis runs once across the whole module; PHPStan re-runs per Magento + PHP version because resolvable symbols differ between releases. These NEVER affect the Compatibility badge. A phpcs finding can't make a module incompatible.

Static analysis

Coding standards (phpcs), mess detection (phpmd), copy-pasted code (cpd), PHP cross-version compatibility, composer.json validity. Each runs once for the whole module.

Static analysis results
Tool Status Findings Summary
PHPCS Pass 0
PHPMD Pass 0
Cpd Pass 0
Composer validate Info 1 valid; 1 advisory note (composer validate --strict)

PHPStan

Type-checks the module's PHP against a real Magento install at the configured gate level. Re-runs per Magento and PHP version because resolvable symbols differ between releases.

PHPStan results by Magento and PHP version
Magento PHP 8.2 PHP 8.3 PHP 8.4 PHP 8.5
2.4.7 Pass Pass
2.4.8 Pass Pass
2.4.9 Pass Pass

Tests

Unit and integration suites, run for each applicable Magento and PHP version. A test failure speaks to the module's behaviour, not its compatibility with a Magento line, so it is reported here separately and never reddens the compatibility matrix.

Unit tests

Unit tests results by Magento and PHP version
Magento PHP 8.2 PHP 8.3 PHP 8.4 PHP 8.5
2.4.7 N/A N/A
2.4.8 N/A N/A
2.4.9 N/A N/A

Integration tests

Integration tests results by Magento and PHP version
Magento PHP 8.2 PHP 8.3 PHP 8.4 PHP 8.5
2.4.7 N/A N/A
2.4.8 N/A N/A
2.4.9 N/A N/A

Security

Security checks run directly against the module: an audit of its declared dependencies for known vulnerabilities (composer audit) and a scan of its source for malware and web-shell signatures. Each runs once. A malware detection fails the version outright.

Security results
Tool Status Findings Summary
Composer audit Pass 0
Malware scan Pass 0
License
MIT
Authors
  • Magendoo

More from magendoo

View vendor
Make it pay

Turn an existing module into recurring revenue.

If you already maintain a Magento 2 module on GitHub or GitLab, listing it on Packagento takes about five minutes. We mirror your tags, handle distribution signing, and route paid licenses through Stripe Connect, so you can keep shipping the way you already do.