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
Create table1, add varchar(100) field, set NOT NULL for the field
Create table2, add varchar(100) field, DO NOT set NOT NULL field, add foreign key to table1 (data can be null, because foreign key)
Build models
Try to insert/update model2
What is the expected result?
Null value in model2 field
What do you get instead?
Empty string value in model2 field what causes Foreign key exception
Additional info
Q
A
Yii version
2.0.14
PHP version
7.2
Operating system
Windows 10 Pro
The text was updated successfully, but these errors were encountered:
This issue has originally been reported by @6562680 at yiisoft/yii2#16909.
Moved here by @cebe.
What steps will reproduce the problem?
Create table1, add varchar(100) field, set NOT NULL for the field
Create table2, add varchar(100) field, DO NOT set NOT NULL field, add foreign key to table1 (data can be null, because foreign key)
Build models
Try to insert/update model2
What is the expected result?
Null value in model2 field
What do you get instead?
Empty string value in model2 field what causes Foreign key exception
Additional info
The text was updated successfully, but these errors were encountered: