Skip to content

fix: replace removed DBAL4 'json_array' type in install migration#16

Merged
S-Tian86 merged 1 commit into
synolia:masterfrom
S-Tian86:fix/dbal4-json-array-install
Jun 16, 2026
Merged

fix: replace removed DBAL4 'json_array' type in install migration#16
S-Tian86 merged 1 commit into
synolia:masterfrom
S-Tian86:fix/dbal4-json-array-install

Conversation

@S-Tian86

Copy link
Copy Markdown
Collaborator

Why

A fresh oro:install on OroCommerce 7.0 aborts with:

ERROR: Unknown column type "json_array" requested. Any Doctrine type that you use has to be registered with \Doctrine\DBAL\Types\Type::addType().
> Synolia\Bundle\StockAlertBundle\Migrations\Schema\SynoliaStockAlertBundleInstaller

DBAL 4 (shipped with OroCommerce 7.0 / Symfony 7) removed the json_array column type (deprecated since DBAL 2.6, gone in DBAL 3). The installer still declared serialized_data as json_array, so the install aborts before synolia_stock_alert is created.

This was invisible to the oro:platform:update path (an existing migrated DB short-circuits getMigrationVersion() and never runs the table creation), so it only surfaces on a from-scratch install (CI / clean environments).

What

serialized_data now uses the native Types::JSON, which is the Oro 7.0 convention for the serialized-data column of extend entities. The stale legacy (DC2Type:array) comment and length => 0 are dropped accordingly.

-$table->addColumn('serialized_data', 'json_array', ['jsonb' => true, 'notnull' => false, 'length' => 0, 'comment' => '(DC2Type:array)']);
+$table->addColumn('serialized_data', Types::JSON, ['notnull' => false]);

Follow-up to the 7.0 migration (#15): this DBAL 4 break in the migration installer was missed there.

@CLAassistant

CLAassistant commented Jun 16, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

DBAL 4 (shipped with OroCommerce 7.0 / Symfony 7) removed the
'json_array' column type (deprecated since DBAL 2.6, gone in DBAL 3).
The bundle installer still declared serialized_data as 'json_array',
so a fresh `oro:install` aborted with "Unknown column type 'json_array'
requested" before the synolia_stock_alert table was created.

This was invisible to the platform:update path (an existing migrated DB
short-circuits getMigrationVersion and never runs the create), so it
only surfaces on a from-scratch install (CI / clean environments).

Use the native Types::JSON, which is the Oro 7.0 convention for the
serialized_data column of extend entities; the stale legacy
'(DC2Type:array)' comment and length=0 are dropped accordingly.
@S-Tian86 S-Tian86 force-pushed the fix/dbal4-json-array-install branch from 9a77a87 to b66126f Compare June 16, 2026 14:44
@S-Tian86 S-Tian86 merged commit e8d4d54 into synolia:master Jun 16, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants