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'.
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
No changelog yet
The vendor hasn't published a changelog. Tagged releases appear in the Versions tab.
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.
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.
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.
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
| 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
| 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.
More from magendoo
View vendorEU Base Price (Grundpreis) display for Magento 2. Shows price per reference unit (kg, litre, m) on product pages, category listings, search results and cart. Compliant with EU Price Indication Directive 98/6/EC and German PAngV.
Shipping Restrictions module
Product labels for Magento 2 - first-class label entities with stable codes, manual assignment via product attribute, rule-computed assignments materialized by an indexer, PLP/PDP badges and GraphQL exposure
EU Omnibus Directive (2019/2161) price tracker for Magento 2. Records price changes with timestamps, computes the lowest prior price in the disclosure window, and displays it on PDP and PLP, with async queue processing for bulk operations.
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.