Here is my table:
+-------------+--------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-------------+--------------+------+-----+---------+----------------+
| id | bigint(20) | NO | PRI | NULL | auto_increment |
| template_id | int(11) | NO | MUL | NULL | |
| type | smallint(6) | NO | | 2 | |
| width | varchar(100) | NO | | | |
| height | varchar(100) | NO | | | |
+-------------+--------------+------+-----+---------+----------------+
As you can tell from the table, the id
and template_id
are the primary key, and the id
has an auto_increment setting.
What I want to do is drop the tempalte_id
primary key attribute.
Here is the mysql query string I tried:
ALTER TABLE ts_template_size
DROP PRIMARY KEY,
ADD PRIMARY KEY (`id`);
The query could execute successfully, but seems nothing changed. No warning, no error, and the tempalte_id
's primary key attribute still there
So how can I fix this? What's wrong with my query?