沒有唯一的列這裏是我的表:表與在phpMyAdmin
CREATE TABLE group_edits (
vfile_id bigint(20) unsigned NOT NULL,
editor_id int(10) unsigned NOT NULL,
edits text
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
沒有唯一索引,因爲一個editor_id可同時編輯多個vfile_ids,也是一個vfile_id可以由多個editor_ids進行編輯。
phpMyAdmin的4.1.6不允許我編輯此表說:
Current selection does not contain a unique column. Grid edit, checkbox, Edit, Copy and Delete features are not available.
現在,它讓我的事情有什麼不對,像這樣的表?當您獲取editor_id和vfile_id的值時,行是唯一的,而沒有單獨的列是唯一的。
我知道,要解決它,我可以添加
`ID` int(11) NOT NULL AUTO_INCREMENT,
,但它並不反映我的數據庫架構的設計,我想避免添加技巧只是爲了讓phpMyAdmin的工作。
我的數據庫設計是錯的還是phpMyAdmin?
我不會稱之爲「ID」列添加「詭計」。這就是我在這種情況下建議的。 –
@RocketHazmat是否有任何理由從我的應用程序的角度添加'ID'列,而不是phpMyAdmin? – Peeeech
看到這個:http://stackoverflow.com/questions/5187643/do-mysql-tables-need-an-id –