I want to alter an integer column on a table to add a check constraint preventing the value from being zero or a positive number. For example:
CREATE TABLE example (id INTEGER)
ALTER TABLE example ADD CONSTRAINT chk_negID CHECK (id<0)
MySQL happily complies with these yet then allows the following:
INSERT INTO example VALUES (-1);
INSERT INTO example VALUES (1);
Are my constraints not actually being added? Is there a way to list constraints that have been added to a table after it was created?