Fix MySQL create table feeds (#2047)

https://github.com/FreshRSS/FreshRSS/issues/2042
This commit is contained in:
Alexandre Alapetite
2018-10-14 13:48:59 +02:00
committed by GitHub
parent 8221c807a1
commit c8b54ae807
3 changed files with 3 additions and 3 deletions

View File

@@ -166,7 +166,7 @@ class FreshRSS_user_Controller extends Minz_ActionController {
$entryDAO = FreshRSS_Factory::createEntryDao($this->view->current_user);
$this->view->nb_articles = $entryDAO->count();
$databaseDAO = FreshRSS_Factory::createDatabaseDAO();
$databaseDAO = FreshRSS_Factory::createDatabaseDAO($this->view->current_user);
$this->view->size_user = $databaseDAO->size();
}
}

View File

@@ -992,7 +992,7 @@ class FreshRSS_EntryDAO extends Minz_ModelPdo implements FreshRSS_Searchable {
$stm = $this->bd->prepare($sql);
$stm->execute();
$res = $stm->fetchAll(PDO::FETCH_COLUMN, 0);
return $res[0];
return isset($res[0]) ? $res[0] : 0;
}
public function countNotRead($minPriority = null) {
$sql = 'SELECT COUNT(e.id) AS count FROM `' . $this->prefix . 'entry` e';

View File

@@ -18,7 +18,7 @@ CREATE TABLE IF NOT EXISTS `%1$sfeed` (
`website` VARCHAR(255) CHARACTER SET latin1,
`description` TEXT,
`lastUpdate` INT(11) DEFAULT 0, -- Until year 2038
`priority` TINYNT(2) NOT NULL DEFAULT 10,
`priority` TINYINT(2) NOT NULL DEFAULT 10,
`pathEntries` VARCHAR(511) DEFAULT NULL,
`httpAuth` VARCHAR(511) DEFAULT NULL,
`error` BOOLEAN DEFAULT 0,