Resolved: Modifying NOT NULL Constraints with Existing Data
Hello,
I tried to modify the NOT NULL constraint of email_address field in customers table. Having one record with NULL email_address, MySQL thrown an error.


Suppose we have real data, is there a workaround that we can do to continue the NOT NULL constraint on email_address field?
1 answers ( 1 marked as helpful)
Hi Carl!
Thanks for reaching out.
This error message 1138 is because you have already NULL values for the email_address column. Please, remove this record and then run the ALTER TABLE query.
Hope this helps.
Best,
Tsvetelin