aboutsummaryrefslogtreecommitdiff
path: root/app/Models/EntryDAOSQLite.php
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2015-05-12 18:31:03 +0200
committerGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2015-05-12 18:31:03 +0200
commit0f408e83e0173977cb4659d126b31a3671fa8114 (patch)
tree04530333e0a303420924ce0f835db365fa9e7f45 /app/Models/EntryDAOSQLite.php
parentd6c22a0841779c387949f52a6e87c2f9e1f89955 (diff)
parent217c191a1ba3ac03b847d261a32e19975380fcad (diff)
Merge pull request #828 from Alkarex/sqliteBug
SQLite compatibility with new update mode
Diffstat (limited to 'app/Models/EntryDAOSQLite.php')
-rw-r--r--app/Models/EntryDAOSQLite.php15
1 files changed, 15 insertions, 0 deletions
diff --git a/app/Models/EntryDAOSQLite.php b/app/Models/EntryDAOSQLite.php
index ffe0f037c..ff049d813 100644
--- a/app/Models/EntryDAOSQLite.php
+++ b/app/Models/EntryDAOSQLite.php
@@ -2,6 +2,21 @@
class FreshRSS_EntryDAOSQLite extends FreshRSS_EntryDAO {
+ protected function autoAddColumn($errorInfo) {
+ if (empty($errorInfo[0]) || $errorInfo[0] == '42S22') { //ER_BAD_FIELD_ERROR
+ if ($tableInfo = $this->bd->query("SELECT sql FROM sqlite_master where name='entry'")) {
+ $showCreate = $tableInfo->fetchColumn();
+ Minz_Log::debug('FreshRSS_EntryDAOSQLite::autoAddColumn: ' . $showCreate);
+ foreach (array('lastSeen', 'hash') as $column) {
+ if (stripos($showCreate, $column) === false) {
+ return $this->addColumn($column);
+ }
+ }
+ }
+ }
+ return false;
+ }
+
protected function sqlConcat($s1, $s2) {
return $s1 . '||' . $s2;
}