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

Schema comparison behavior changed for boolean default values #3377

Closed
Majkl578 opened this issue Dec 4, 2018 · 2 comments
Closed

Schema comparison behavior changed for boolean default values #3377

Majkl578 opened this issue Dec 4, 2018 · 2 comments

Comments

@Majkl578
Copy link
Contributor

Majkl578 commented Dec 4, 2018

@ORM\Column(type="boolean", nullable=false, options={"default" = false})

it always generates migration becouse of #3355. compared with old version https://3v4l.org/HBLG7 :

<?php
$changedProperties = [];
$properties1['default'] = false;
$properties2['default'] = 0;

if ($properties1['default'] != $properties2['default'] ||
    (null === $properties1['default'] && null !== $properties2['default']) ||
    (null === $properties2['default'] && null !== $properties1['default'])
) {
    $changedProperties[] = 'default';
}

var_dump($changedProperties);

if (($properties1['default'] === null) !== ($properties2['default'] === null)
    || (string) $properties1['default'] !== (string) $properties2['default']) {
    $changedProperties[] = 'default';
}

var_dump($changedProperties);

result:

array(0) {
}
array(1) {
  [0]=>
  string(7) "default"
}

Originally posted by @svycka in #3355

@Ocramius
Copy link
Member

Ocramius commented Dec 5, 2018

Handled in #3382

@github-actions
Copy link

github-actions bot commented Aug 1, 2022

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 1, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants