Fix Issue #2816
- Change (P)Config::set to use INSERT >>> ON DUPLICATE KEY UPDATE - Add DB update
This commit is contained in:
parent
82dcc3fe79
commit
3c85fb8c9a
3 changed files with 25 additions and 44 deletions
12
update.php
12
update.php
|
@ -1677,7 +1677,7 @@ function update_1190() {
|
|||
$idx = array_search($plugin, $plugins_arr);
|
||||
if ($idx !== false){
|
||||
unset($plugins_arr[$idx]);
|
||||
//delete forumlist manually from addon and hook table
|
||||
//delete forumlist manually from addon and hook table
|
||||
// since uninstall_plugin() don't work here
|
||||
q("DELETE FROM `addon` WHERE `name` = 'forumlist' ");
|
||||
q("DELETE FROM `hook` WHERE `file` = 'addon/forumlist/forumlist.php' ");
|
||||
|
@ -1728,3 +1728,13 @@ function update_1202() {
|
|||
$r = q("UPDATE `user` SET `account-type` = %d WHERE `page-flags` IN (%d, %d)",
|
||||
dbesc(ACCOUNT_TYPE_COMMUNITY), dbesc(PAGE_COMMUNITY), dbesc(PAGE_PRVGROUP));
|
||||
}
|
||||
|
||||
function update_1210() {
|
||||
// Convert config indexes to unique, old_alter_table=1 removes duplicates on ALTER IGNORE
|
||||
$r = q("SET session old_alter_table=1;");
|
||||
$r = q("ALTER TABLE config DROP INDEX cat_k");
|
||||
$r = q("ALTER IGNORE TABLE config ADD UNIQUE INDEX cat_k (cat, k)");
|
||||
|
||||
$r = q("ALTER TABLE pconfig DROP INDEX uid_cat_k");
|
||||
$r = q("ALTER IGNORE TABLE pconfig ADD UNIQUE INDEX uid_cat_k (uid, cat, k)");
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue