Skip to content

IBX-11939: Skipped the MariaDB JSON conversion on columns already in 6.0's form - #876

Merged
Steveb-p merged 1 commit into
feature/fix-schema-rename-migration-6.0-postgresfrom
feature/schema-migration-guards-6.0
Oct 9, 2026
Merged

Steveb-p merged 1 commit into
feature/fix-schema-rename-migration-6.0-postgresfrom
feature/schema-migration-guards-6.0

Conversation

@Steveb-p

@Steveb-p Steveb-p commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Note

Parked as a draft, to come back to later.

🎫 Issue IBX-11939

Related PRs:

Description:

Brings back a check before ConvertMariaDbJsonColumnsTo6_0Migration runs sql/convert-json-columns-to-6-0-mariadb.sql.

Doctrine Migrations isn't mandatory on 6.0 yet, so a site installed through SchemaBuilderEvent can run ibexa:doctrine:migrations:migrate later. Its columns are in 6.0's form already, so the MODIFY statements change nothing: on MariaDB 10.11 they're all accepted with ALGORITHM=INSTANT, and SHOW CREATE TABLE stays byte-identical. Still, each one is an ALTER TABLE that briefly takes an exclusive metadata lock, and it waits behind any long-running transaction on that table. With the check, those sites get no ALTER at all.

The check uses the Schema Doctrine Migrations passes to up(), with no MariaDB-specific query. Doctrine DBAL 4 reads MariaDB's json_valid() check as the JSON type and returns the column comment as it is, which tells the three shapes apart:

Created by getType() getComment()
4.6 (LONGTEXT) TextType (DC2Type:json)
5.0 (JSON) JsonType (DC2Type:json)
6.0 (JSON) JsonType empty

The tables are in that Schema because both ways Ibexa runs migrations lift core's schema assets filter: ibexa:install itself, and ibexa:doctrine:migrations:* with ibexa/doctrine-migrations#23.

The trade-off: a fresh migrations install skips the statements as well, because it creates the columns in their final form. So nothing that only checks fresh installs, such as the schema alignment test if it ever runs on MariaDB, covers the SQL file anymore.

Checked on MariaDB 10.11 by running the migrations directly: skipped on fresh 6.0 installs through either path and on a re-run, run on 5.0 and 4.6 databases (identical to a fresh 6.0 install afterwards, data kept), and invalid JSON still fails the conversion.

…6.0's form

A database installed with SchemaBuilderEvent on 6.0 and migrated later has
these columns in 6.0's form already, so the conversion has nothing to do
there. The check uses the schema Doctrine Migrations passes in: Doctrine
DBAL 4 reads MariaDB's json_valid() check as the JSON type and returns the
column comment as it is.
@Steveb-p
Steveb-p force-pushed the feature/fix-schema-rename-migration-6.0-postgres branch from ffc1f3b to 464c5c2 Compare October 9, 2026 09:27
@Steveb-p
Steveb-p force-pushed the feature/schema-migration-guards-6.0 branch from 1375121 to e789499 Compare October 9, 2026 09:27
@sonarqubecloud

sonarqubecloud Bot commented Oct 9, 2026

Copy link
Copy Markdown

@Steveb-p
Steveb-p marked this pull request as ready for review October 9, 2026 10:36
@Steveb-p
Steveb-p merged commit 969cb77 into feature/fix-schema-rename-migration-6.0-postgres Oct 9, 2026
25 checks passed
@Steveb-p
Steveb-p deleted the feature/schema-migration-guards-6.0 branch October 9, 2026 11:57
Steveb-p added a commit that referenced this pull request Oct 9, 2026
…6.0's form (#876)

* IBX-11939: Skipped the MariaDB JSON conversion on columns already in 6.0's form

A database installed with SchemaBuilderEvent on 6.0 and migrated later has
these columns in 6.0's form already, so the conversion has nothing to do
there. The check uses the schema Doctrine Migrations passes in: Doctrine
DBAL 4 reads MariaDB's json_valid() check as the JSON type and returns the
column comment as it is.
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.

1 participant