summaryrefslogtreecommitdiff
path: root/app/Models/CategoryDAOSQLite.php
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2019-10-31 18:15:47 +0100
committerGravatar GitHub <noreply@github.com> 2019-10-31 18:15:47 +0100
commit3aa66f317b496ccd9a2df914bbc747c52081a7ad (patch)
tree6a3f3f74899801abdca00546e213dfdc141c53cf /app/Models/CategoryDAOSQLite.php
parent82611c9622ed23b0e9fcf5f9f651ddffa1fd7706 (diff)
parentfcae48f313d399050cb15f37a8a73ae52fc67796 (diff)
Merge pull request #2599 from FreshRSS/dev1.15.0
FreshRSS 1.15
Diffstat (limited to 'app/Models/CategoryDAOSQLite.php')
-rw-r--r--app/Models/CategoryDAOSQLite.php17
1 files changed, 17 insertions, 0 deletions
diff --git a/app/Models/CategoryDAOSQLite.php b/app/Models/CategoryDAOSQLite.php
new file mode 100644
index 000000000..e32545c90
--- /dev/null
+++ b/app/Models/CategoryDAOSQLite.php
@@ -0,0 +1,17 @@
+<?php
+
+class FreshRSS_CategoryDAOSQLite extends FreshRSS_CategoryDAO {
+
+ protected function autoUpdateDb($errorInfo) {
+ if ($tableInfo = $this->pdo->query("PRAGMA table_info('category')")) {
+ $columns = $tableInfo->fetchAll(PDO::FETCH_COLUMN, 1);
+ foreach (['attributes'] as $column) {
+ if (!in_array($column, $columns)) {
+ return $this->addColumn($column);
+ }
+ }
+ }
+ return false;
+ }
+
+}