ޤ칹

3.3˥åץ졼ɤƱݤˤʤä

 failed to execute statement alter table mt_session modify session_id varchar(80) not null primary key: Multiple primary key defined at lib/MT/Upgrade.pm line 1190.

Ȥ顼˿ʤʤMySQLʤɡMySQLοͤϤߤǺޤƤΤ顩

ad hocбȤơȤꤢmt_sessionprimary keyöƤߤ

 mysql> show fields from mt_session;
 +---------------+----------------+------+-----+---------+-------+
 | Field         | Type           | Null | Key | Default | Extra |
 +---------------+----------------+------+-----+---------+-------+
 | session_data  | mediumblob     | YES  |     | NULL    |       |
 | session_email | varbinary(255) | YES  |     | NULL    |       |
 | session_id    | varbinary(80)  |      | PRI |         |       |
 | session_kind  | binary(2)      | YES  | MUL | NULL    |       |
 | session_name  | varbinary(255) | YES  |     | NULL    |       |
 | session_start | int(11)        |      | MUL | 0       |       |
 +---------------+----------------+------+-----+---------+-------+
 6 rows in set (0.00 sec)

session_idPKʤΤˡUpgrade.pmǤPKꤷ褦ȤƤǤ礦

 alter table mt_session drop primary key;

Ȥơsession_idKeyPRIäƤΤǧ

 mysql> show fields from mt_session;
 +---------------+----------------+------+-----+---------+-------+
 | Field         | Type           | Null | Key | Default | Extra |
 +---------------+----------------+------+-----+---------+-------+
 | session_data  | mediumblob     | YES  |     | NULL    |       |
 | session_email | varbinary(255) | YES  |     | NULL    |       |
 | session_id    | varbinary(80)  |      |     |         |       |
 | session_kind  | binary(2)      | YES  | MUL | NULL    |       |
 | session_name  | varbinary(255) | YES  |     | NULL    |       |
 | session_start | int(11)        |      | MUL | 0       |       |
 +---------------+----------------+------+-----+---------+-------+
 6 rows in set (0.00 sec)

ξ֤ǡ٥åץ졼Ѥcgi¹ԤȺ٤Ϥޤä⤦äfields򸫤Ƥߤ롣

 mysql> show fields from mt_session;
 +---------------+----------------+------+-----+---------+-------+
 | Field         | Type           | Null | Key | Default | Extra |
 +---------------+----------------+------+-----+---------+-------+
 | session_data  | mediumblob     | YES  |     | NULL    |       |
 | session_email | varbinary(255) | YES  |     | NULL    |       |
 | session_id    | varbinary(80)  |      | PRI |         |       |
 | session_kind  | binary(2)      | YES  | MUL | NULL    |       |
 | session_name  | varbinary(255) | YES  |     | NULL    |       |
 | session_start | int(11)        |      | MUL | 0       |       |
 +---------------+----------------+------+-----+---------+-------+
 6 rows in set (0.00 sec)

̤ꡣ褫ä褫ä(Τ?)