aboutsummaryrefslogtreecommitdiff
path: root/app/Models
diff options
context:
space:
mode:
Diffstat (limited to 'app/Models')
-rw-r--r--app/Models/CategoryDAO.php15
-rw-r--r--app/Models/DatabaseDAO.php3
2 files changed, 14 insertions, 4 deletions
diff --git a/app/Models/CategoryDAO.php b/app/Models/CategoryDAO.php
index f4cef9726..08dc4eef0 100644
--- a/app/Models/CategoryDAO.php
+++ b/app/Models/CategoryDAO.php
@@ -4,6 +4,16 @@ class FreshRSS_CategoryDAO extends Minz_ModelPdo implements FreshRSS_Searchable
const DEFAULTCATEGORYID = 1;
+ public function resetDefaultCategoryName() {
+ //FreshRSS 1.15.1
+ $stm = $this->pdo->prepare('UPDATE `_category` SET name = :name WHERE id = :id');
+ if ($stm) {
+ $stm->bindValue(':id', self::DEFAULTCATEGORYID, PDO::PARAM_INT);
+ $stm->bindValue(':name', 'Uncategorized');
+ }
+ return $stm && $stm->execute();
+ }
+
protected function addColumn($name) {
Minz_Log::warning(__method__ . ': ' . $name);
try {
@@ -46,10 +56,7 @@ class FreshRSS_CategoryDAO extends Minz_ModelPdo implements FreshRSS_Searchable
$this->pdo->exec('DROP INDEX IF EXISTS feed_keep_history_index'); //SQLite at least drop index
}
- $stm = $this->pdo->prepare('UPDATE `_category` SET name = :name WHERE id = :id');
- $stm->bindValue(':id', self::DEFAULTCATEGORYID, PDO::PARAM_INT);
- $stm->bindValue(':name', 'Uncategorized');
- $stm->execute();
+ $this->resetDefaultCategoryName();
return $ok;
}
diff --git a/app/Models/DatabaseDAO.php b/app/Models/DatabaseDAO.php
index a36b469b1..13330db23 100644
--- a/app/Models/DatabaseDAO.php
+++ b/app/Models/DatabaseDAO.php
@@ -178,6 +178,9 @@ class FreshRSS_DatabaseDAO extends Minz_ModelPdo {
}
public function minorDbMaintenance() {
+ $catDAO = FreshRSS_Factory::createCategoryDao();
+ $catDAO->resetDefaultCategoryName();
+
$this->ensureCaseInsensitiveGuids();
}