Skip to content

Instantly share code, notes, and snippets.

@clifff
clifff / add_auto_increment_to_int_single_pk.sql
Created January 11, 2019 20:39 — forked from carlosrobles/add_auto_increment_to_int_single_pk.sql
Add auto_increment to all the single PRIMARY KEY of type int of a database
DROP TABLE if exists temp;
CREATE TABLE temp (
`table` varchar(250) DEFAULT NULL,
`colum` varchar(250) DEFAULT NULL,
`type` varchar(250) DEFAULT NULL,
`number_of_PK` tinyint(2) DEFAULT NULL,
`alter` varchar(250) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;