PostgreSQL schema:update ignore removing jsonb => true on json_array field #5300

Open
opened 2026-01-22 15:03:57 +01:00 by admin · 0 comments
Owner

Originally created by @michalwiking on GitHub (Oct 22, 2016).

When you add column:

@ORM\Column(type="json_array", nullable=true, options={"jsonb": true})

Update schema and remove options than schema:update prints: nothing to change but json_array default type is JSON not JSONB, it schould alter column and change type.

Altering code depends on : https://github.com/doctrine/dbal/blob/master/lib/Doctrine/DBAL/Schema/Comparator.php#L491
It compare changes on columns, try to array_intersect_key but https://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/Tools/SchemaTool.php#L389 dont add jsonb key to platformOptions

and in comparator : array_intersect_key(array('jsonb'), array()) return empty array.

Originally created by @michalwiking on GitHub (Oct 22, 2016). When you add column: @ORM\Column(type="json_array", nullable=true, options={"jsonb": true}) Update schema and remove options than schema:update prints: nothing to change but json_array default type is JSON not JSONB, it schould alter column and change type. Altering code depends on : https://github.com/doctrine/dbal/blob/master/lib/Doctrine/DBAL/Schema/Comparator.php#L491 It compare changes on columns, try to array_intersect_key but https://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/Tools/SchemaTool.php#L389 dont add jsonb key to platformOptions and in comparator : array_intersect_key(array('jsonb'), array()) return empty array.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#5300