You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The problem occurred when I removed nullable column attributes, I tried to create migration with diff command (should be empty) but there is ~20 SQL statements for changing nullable columns to non-null, even when their type is nullable (for instance ?string), cache was clear when new migrations was generated.
The text was updated successfully, but these errors were encountered:
Ah, it's because someone didn't want it, but I don't understand why #8732
Why isn't variable nullability preferred? If someone want to have different nullability in DB and in code he can declare it with nullable argument.
It was already in 2.9, and it's not big BC break, since it was in 2.9 (removed in 2.9.2), and if someone has nullable variable but column is non-null, why would be variable nullable, what's the use-case for this?
It seems like it will only help detect potential problems as mentioned by @Slamdunk in #8732 (comment)
Those people that had nullable types but didn't want them in DB will notice when they create next migration, and if it's somehow overlooked (worst case, developer should always check migration), it's not really a big issue, making column nullable.
Maybe not a big, but it is a BC break. Thus if we don't want to violate the pretty important rules of semantic versioning (and I really wouldn't want that) we'll have to wait for 3.0.
Bug Report
Hello, I tried to use PHP type mapping and I also removed nullable property since it says it will be automatically determined when variable type is nullable as said in https://www.doctrine-project.org/projects/doctrine-orm/en/2.9/reference/basic-mapping.html#php-types-mapping
The problem occurred when I removed nullable column attributes, I tried to create migration with diff command (should be empty) but there is ~20 SQL statements for changing nullable columns to non-null, even when their type is nullable (for instance
?string
), cache was clear when new migrations was generated.The text was updated successfully, but these errors were encountered: