mysql alter int column to bigint with foreign keys
I want to change the datatype of some primary-key columns in my database from INT to BIGINT. The following definition is a toy-example to illustrate the problem: CREATE TABLE IF NOT EXISTS `owner` ( `id` int(11) NOT NULL AUTO_INCREMENT, `thing_id` int(11) NOT NULL, PRIMARY KEY (`id`), KEY `thing_id` (`thing_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ; DROP TABLE IF EXISTS `thing`; CREATE TABLE IF NOT EXISTS `thing` ( `id` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;