X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=update.php;h=a4d71bc4fde2b30f11e3e0a0fe71f7a53439fa44;hb=05bd0d0b671ad509465fa6cddabc3c2a07c796a7;hp=82c34f9ddaf0a494006a3e116d44c0f8447b7fdf;hpb=dd85f48e0de68aa71cb46ff067bd872f0f97ee1e;p=friendica.git diff --git a/update.php b/update.php index 82c34f9dda..a4d71bc4fd 100644 --- a/update.php +++ b/update.php @@ -513,9 +513,65 @@ function update_1351() function pre_update_1354() { if (DBStructure::existsColumn('contact', ['ffi_keyword_blacklist']) + && !DBStructure::existsColumn('contact', ['ffi_keyword_denylist']) && !DBA::e("ALTER TABLE `contact` CHANGE `ffi_keyword_blacklist` `ffi_keyword_denylist` text null")) { return Update::FAILED; } + return Update::SUCCESS; +} + +function update_1354() +{ + if (DBStructure::existsColumn('contact', ['ffi_keyword_blacklist']) + && DBStructure::existsColumn('contact', ['ffi_keyword_denylist'])) { + if (!DBA::e("UPDATE `contact` SET `ffi_keyword_denylist` = `ffi_keyword_blacklist`")) { + return Update::FAILED; + } + + // When the data had been copied then the main task is done. + // Having the old field removed is only beauty but not crucial. + // So we don't care if this was successful or not. + DBA::e("ALTER TABLE `contact` DROP `ffi_keyword_blacklist`"); + } + return Update::SUCCESS; +} + +function update_1357() +{ + if (!DBA::e("UPDATE `contact` SET `failed` = true WHERE `success_update` < `failure_update` AND `failed` IS NULL")) { + return Update::FAILED; + } + + if (!DBA::e("UPDATE `contact` SET `failed` = false WHERE `success_update` > `failure_update` AND `failed` IS NULL")) { + return Update::FAILED; + } + + if (!DBA::e("UPDATE `contact` SET `failed` = false WHERE `updated` > `failure_update` AND `failed` IS NULL")) { + return Update::FAILED; + } + + if (!DBA::e("UPDATE `contact` SET `failed` = false WHERE `last-item` > `failure_update` AND `failed` IS NULL")) { + return Update::FAILED; + } + if (!DBA::e("UPDATE `gserver` SET `failed` = true WHERE `last_contact` < `last_failure` AND `failed` IS NULL")) { + return Update::FAILED; + } + + if (!DBA::e("UPDATE `gserver` SET `failed` = false WHERE `last_contact` > `last_failure` AND `failed` IS NULL")) { + return Update::FAILED; + } + + if (!DBA::e("UPDATE `gcontact` SET `failed` = true WHERE `last_contact` < `last_failure` AND `failed` IS NULL")) { + return Update::FAILED; + } + + if (!DBA::e("UPDATE `gcontact` SET `failed` = false WHERE `last_contact` > `last_failure` AND `failed` IS NULL")) { + return Update::FAILED; + } + + if (!DBA::e("UPDATE `gcontact` SET `failed` = false WHERE `updated` > `last_failure` AND `failed` IS NULL")) { + return Update::FAILED; + } return Update::SUCCESS; }