[1.7.x] Fixed #23609 -- Fixed IntegrityError that prevented altering a NULL...
[1.7.x] Fixed #23609 -- Fixed IntegrityError that prevented altering a NULL column into a NOT NULL one due to existing rows
Thanks to Simon Charette, Loic Bistuer and Tim Graham for the review.
Backport of f633ba77 from master