Resolved: Modifying NOT NULL Constraints with Existing Data
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)
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.
Submit an answer
Why did you not do not null, primary key and auto increment for customer id in the solution?
The schema section does not show the tables in the Tables subsection.