From f050a94b48499286abfb4b69f3bcb3dee5f9ea2d Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Tue, 12 Sep 2023 10:43:14 +0200 Subject: SQL: clean old auto-updates (#5649) Should help with some DB lock issues. Complete https://github.com/FreshRSS/FreshRSS/pull/3558 after https://github.com/FreshRSS/FreshRSS/pull/5625 already cherry-picked from it. * Removed auto-update of MySQL GUID case sensitivity https://github.com/FreshRSS/FreshRSS/pull/2078 * Contributed to a DB lock in https://github.com/FreshRSS/FreshRSS/issues/5008 Also removed the following non-problematic auto-updates, simply because they were older than the above ones * Auto-create custom labels (1.12.0) https://github.com/FreshRSS/FreshRSS/pull/2027 * Auto-add JSON column for feeds (1.11.0) https://github.com/FreshRSS/FreshRSS/pull/1838 * Auto-create temporary tables (1.7.0) https://github.com/FreshRSS/FreshRSS/pull/1470 --- app/Models/FeedDAO.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'app/Models/FeedDAO.php') diff --git a/app/Models/FeedDAO.php b/app/Models/FeedDAO.php index 5461ba4ed..508d38bfc 100644 --- a/app/Models/FeedDAO.php +++ b/app/Models/FeedDAO.php @@ -10,8 +10,6 @@ class FreshRSS_FeedDAO extends Minz_ModelPdo { try { if ($name === 'kind') { //v1.20.0 return $this->pdo->exec('ALTER TABLE `_feed` ADD COLUMN kind SMALLINT DEFAULT 0') !== false; - } elseif ($name === 'attributes') { //v1.11.0 - return $this->pdo->exec('ALTER TABLE `_feed` ADD COLUMN attributes TEXT') !== false; } } catch (Exception $e) { Minz_Log::error(__method__ . ' error: ' . $e->getMessage()); @@ -24,7 +22,7 @@ class FreshRSS_FeedDAO extends Minz_ModelPdo { if (isset($errorInfo[0])) { if ($errorInfo[0] === FreshRSS_DatabaseDAO::ER_BAD_FIELD_ERROR || $errorInfo[0] === FreshRSS_DatabaseDAOPGSQL::UNDEFINED_COLUMN) { $errorLines = explode("\n", $errorInfo[2], 2); // The relevant column name is on the first line, other lines are noise - foreach (['attributes', 'kind'] as $column) { + foreach (['kind'] as $column) { if (stripos($errorLines[0], $column) !== false) { return $this->addColumn($column); } -- cgit v1.2.3