I have this innoDB table with two columns in Mysql:
CREATE TABLE mytable (
`id_1` mediumint(8) unsigned NOT NULL,
`id_2` mediumint(8) unsigned NOT NULL
) ENGINE=InnoDB;
And I want to force a check on INSERT operations: id_1 must be less than id_2 So I tried with this but it didn't work out:
ALTER TABLE mytable ADD CONSTRAINT mycheck CHECK (id_1 < id_2)
Is this even possible? What I did wrong? Thanks!