I am using PHPMyAdmin and I am trying to add a NOT NULL constraint to the column of my table.
PHPMyAdmin accepts my following request:
ALTER TABLE `wall` MODIFY `token_message` varchar(40) NOT NULL;
But I can still insert blank lines (= NULL), I don't understand why.
PS: If you want to give me other requests to add this restriction, please note that I tried these 3, which do not work in my PHPMyAdmin (error type: # 1064 - You have an error in your SQL syntax, check the manual):
ALTER TABLE `wall` ALTER COLUMN `token_message` SET NOT NULL;
ALTER TABLE `wall` ALTER COLUMN `token_message` varchar(40) NOT NULL;
ALTER TABLE `wall` MODIFY `token_message` CONSTRAINTS token_message_not_null NOT NULL;
source
share