Is there an equivalent to a grouped primary key using an InnoDB MySQL database and allowing auto-increment on the second key?
What I am trying to implement is a table to
there can be only one auto column and it must be defined as a key. check this
CREATE TABLE images (
parent_id INT(11) NOT NULL,
image_id INT(11) Not Null AUTO_INCREMENT,
source_url VARCHAR(255) NOT NULL,
caption VARCHAR(255) NOT NULL,
key(image_id), -- add as a key
PRIMARY KEY(parent_id, image_id)
) ENGINE = InnoDB;