WordPress中著名的dbDelta()函数导致多个插件出现问题。我对create table查询所做的任何更改似乎都无法解决问题,或者确实解决了问题,而dbDelta()在更改后会导致不同的错误。
对于这些特定的CREATE TABLE查询的建议,我们将不胜感激。
[2016年10月21日23:01:29 UTC]WordPress数据库错误查询的索引名称不正确ALTER TABLE wp\\u webtechglobal\\u schedule ADD UNIQUE KEY``(rowid
)
$sql_create_table = "CREATE TABLE " . $wpdb->prefix . "webtechglobal_schedule (
rowid bigint(20) unsigned NOT NULL AUTO_INCREMENT,
timesapplied bigint(20) unsigned NOT NULL DEFAULT 0,
plugin varchar(125) DEFAULT NULL,
pluginname varchar(125) DEFAULT NULL,
class varchar(250) DEFAULT NULL,
method varchar(30) DEFAULT NULL,
lastupdate timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
recurrence varchar(20) DEFAULT NULL,
basepath varchar(250) DEFAULT NULL,
active tinyint(1) unsigned NOT NULL DEFAULT 1,
lastexecuted timestamp NULL,
lastcron timestamp NULL,
weight int(2) NOT NULL DEFAULT 5,
delay int(4) NOT NULL DEFAULT 3600,
firsttime timestamp NULL,
UNIQUE KEY (rowid) ) $charset_collate; ";
WordPress数据库错误查询ALTER TABLE wp\\u webtechglobal\\u socialaccounts添加唯一键`(
rowid
) 由activate\\u插件制作
$sql_create_table = "CREATE TABLE " . $wpdb->prefix . "webtechglobal_socialaccounts (
rowid bigint(20) unsigned NOT NULL AUTO_INCREMENT,
active tinyint(1) unsigned NOT NULL DEFAULT 1,
wpuserid bigint(20) unsigned NOT NULL DEFAULT 0,
screenname varchar(45) UNIQUE,
consumer_key varchar(90) DEFAULT NULL,
consumer_secret varchar(90) DEFAULT NULL,
access_token varchar(90) DEFAULT NULL,
access_token_secret varchar(90) DEFAULT NULL,
passcode varchar(50) DEFAULT NULL,
profileurl varchar(500),
UNIQUE KEY (rowid) ) $charset_collate; ";