Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

invalid alter statement with json data type using mariadb #6237

Open
gaetan-petit opened this issue Dec 7, 2023 · 1 comment
Open

invalid alter statement with json data type using mariadb #6237

gaetan-petit opened this issue Dec 7, 2023 · 1 comment

Comments

@gaetan-petit
Copy link

Bug Report

Q A
Version 3.7.2

Summary

When updating schema in our Symfony application with doctrine:schema:update --force --complete alter table statement is invalid for json columns.

Current behaviour

Generated alter look like so:
ALTER TABLE my_table CHANGE data data JSON CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '(DC2Type:json)';

Removing CHARACTER SET utf8mb4 gives a correct statement.

How to reproduce

Entity:

<?php

namespace App\Entity;

#[ORM\Entity()]
class MyEntity
{
    #[ORM\Column(type: 'json')]
    private ?array $data = [];
}

Expected behaviour

Correct alter statement.

@gaetan-petit
Copy link
Author

I suspect that this comes from the dbal now supporting the native json format from mariadb instead of relying on longtext. I think this changes should be investigated: #5916

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

No branches or pull requests

1 participant