Skip to content

invalid alter statement with json data type using mariadb #6237

Closed as not planned
@gaetan-petit

Description

@gaetan-petit

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions