Using phpMyAdmin and MySQL v5.5.49 consider:
CREATE TABLE op_sys (
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(255) NOT NULL,
version VARCHAR(255) NOT NULL,
-- UNIQUE KEY name_version (name, version)
-- CONSTRAINT name_version UNIQUE (name, version)
-- UNIQUE(name, version)
-- CONSTRAINT UNIQUE(name, version)
)ENGINE=InnoDB;
I've tried all four of the commented out attempts to simply stop INSERT INTO sys_op duplicate values for "name" and "version". All four are processed without error.
The insert into:
INSERT INTO op_sys(name, version)
VALUES ('ANDROID','ANDROID');
executes "successfully". ANDROID ANDROID is now a row. Where have I gone wrong or what step am I not aware of? I've checked the MySQL manual and several different posts here that seem to say I'm doing it correctly... Thanks.