When I try to activate my custom plugin, I receive the error below:
WordPress database error Multiple primary key defined for query ALTER TABLE temp CHANGE COLUMN
idid int(11) UNSIGNED AUTO_INCREMENT PRIMARY
private function runDbMigration_20() {
$sql = "CREATE TABLE " . PREFIX . "subscribers (
id int(11) UNSIGNED AUTO_INCREMENT PRIMARY KEY,
name tinytext NOT NULL,
email text NOT NULL,
secretkey text NOT NULL,
random_key text NOT NULL,
onehourmailsent int(1) NOT NULL DEFAULT 0,
onedaymailsent int(1) NOT NULL DEFAULT 0,
wbstartingmailsent int(1) NOT NULL DEFAULT 0,
replaymailsent int(1) NOT NULL DEFAULT 0,
temp_id int(11) NOT NULL,
exact_time datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,
watch_day varchar(3),
watch_time time,
time datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,
last_seen datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,
active int(1) UNSIGNED NOT NULL DEFAULT 1,
high_five int(1) UNSIGNED NOT NULL DEFAULT 0,
attended int(1) UNSIGNED NOT NULL DEFAULT 0
)" . $this->CHARSET_COLLATE . ";";
return $this->calldbDelta($sql);
}
Please, can some one help me how to resolve this error?
Adding PRIMARY KEY (id) at last resolved the error