Skip to content

Loading…

DBAL-569: json_array/simple_array columns constantly updated by schema-tool #1779

Closed
doctrinebot opened this Issue · 6 comments

2 participants

@doctrinebot

Jira issue originally created by user jcampbell:

I have the following columns defined:

    /****
     * @ORM\Column(type="json_array")
     * @var array
     */
    protected $feedKey = array();

    /****
     * @ORM\Column(type="simple_array")
     * @var array
     */
    protected $privileges = array('none');

Every time I run " .\vendor\bin\doctrine-module orm:schema-tool:update --dump-sql", these two columns are "updated":

ALTER TABLE RoleResource ALTER COLUMN [privileges] VARCHAR(MAX) NOT NULL;
ALTER TABLE FeedEntity ALTER COLUMN feedKey VARCHAR(MAX) NOT NULL

When I browse to that table in Microsoft SQL Server Management Studio, the column definitions are already "privileges (varchar(max), not null)" and "feedKey (varchar(max), not null)".

The repeated update from schema-tool continues even after I let it run with --force.

@doctrinebot

Comment created by @deeky666:

There is WIP PR to support column comments in SQL Server which resolves this issue:

#426

@doctrinebot

Comment created by @doctrinebot:

A related Github Pull-Request [GH-426] was closed:
#426

@doctrinebot

Comment created by @deeky666:

Fixed in commit: 28264a1

@doctrinebot

Issue was closed with resolution "Fixed"

@doctrinebot

Comment created by greg0ire:

I'm having the same bug with postgresql and a json_array to array migration. Should this bug be reopened and made more generic or should I create a new one ?

A workaround for this bug is to simply delete the field. An additional line is generated (it adds an SQL comment).

@doctrinebot doctrinebot added the Bug label
@deeky666 deeky666 was assigned by doctrinebot
@doctrinebot doctrinebot added this to the 2.5 milestone
@doctrinebot doctrinebot closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.