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

[DBAL-1090] Changing string to fixed string is not recognized in PostgreSQL Platform #754

Merged
merged 4 commits into from
Dec 26, 2014
Merged

[DBAL-1090] Changing string to fixed string is not recognized in PostgreSQL Platform #754

merged 4 commits into from
Dec 26, 2014

Conversation

SenseException
Copy link
Member

The following change of an entity using PostgreSQL is not recognized by Doctrine DBAL:
from

    /**
     * @ORM\Column(type="string", name="name", length=2)
     */
    public $name;

to

    /**
     * @ORM\Column(type="string", name="name", length=2, options={"fixed"=true})
     */
    public $name;

A schema-update should change the column from character varying(2) to character(2) but instead acts like no changes were made on the column.

With this PR, I've extended the PostgreSqlPlatform to detect changes of the fixed option of a column.

@doctrinebot
Copy link

Hello,

thank you for creating this pull request. I have automatically opened an issue
on our Jira Bug Tracker for you. See the issue link:

http://www.doctrine-project.org/jira/browse/DBAL-1090

We use Jira to track the state of pull requests and the versions they got
included in.

@SenseException SenseException changed the title Changing string to fixed string is not recognized in PostgreSQL Platform [DBAL-1090] Changing string to fixed string is not recognized in PostgreSQL Platform Dec 21, 2014
$tableDiff = new TableDiff('mytable');
$tableDiff->fromTable = $table;

$tableDiff->changedColumns['dloo1'] = new \Doctrine\DBAL\Schema\ColumnDiff(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why dloo1? Shouldn't it be name also?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I must confess: I did evil copy paste. There's the reason why copy paste is an anti-pattern.

@deeky666
Copy link
Member

@SenseException could you please make the new test case run on all platforms? You should put it into AbstractPlatformTestCase. This way we ensure, that this is working on all platforms. Thanks!

@SenseException
Copy link
Member Author

@deeky666 I moved the test to AbstractPlatformTestCase and changed it into the style of the other test cases.

It looks like DrizzlePlatform has no tests at the moment. Is that correct?

@deeky666
Copy link
Member

@SenseException looking good, merging. True, unfortunately we do not have a test class for the Drizzle platform yet :( So I'm fine with skipping it for the moment. Thanks!

deeky666 added a commit that referenced this pull request Dec 26, 2014
[DBAL-1090] Changing string to fixed string is not recognized in PostgreSQL Platform
@deeky666 deeky666 merged commit d0e0c2f into doctrine:master Dec 26, 2014
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 24, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants