次の表を取得しました。
CREATE TABLE `unsub_counts` (
`count_id` int(11) NOT NULL AUTO_INCREMENT,
`unsub_date` date DEFAULT NULL,
`unsub_count` int(11) DEFAULT NULL,
`store_id` smallint(5) DEFAULT NULL,
PRIMARY KEY (`count_id`),
UNIQUE KEY `uc_unsub_date` (`unsub_date`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
列unsub_date
はunique
です。に一意のインデックスが必要なので、その一意性を削除したいと思いますunsub_date + store_id
。
ネットで提案を見つけましたが、失敗しています:
ALTER TABLE `unsub_counts` DROP CONSTRAINT `unsub_date`
教えてください:SQL構文にエラーがあります。unsub_date
1行目の「CONSTRAINT」付近で使用する正しい構文については、MySQLサーバーのバージョンに対応するマニュアルを確認してください
これは MyISAM に関連していますか? 他の提案はありますか?