Set default value of autoflush to 15 days in not set to avoid large database

This commit is contained in:
Frédéric Guillot 2013-12-22 21:11:50 -05:00
parent 4fb68b9b80
commit ee917419ad
1 changed files with 14 additions and 0 deletions

View File

@ -3,6 +3,20 @@
namespace Schema;
function version_19($pdo)
{
$rq = $pdo->prepare('SELECT autoflush FROM config');
$rq->execute();
$value = (int) $rq->fetchColumn();
// Change default value of autoflush to 15 days to avoid very large database
if ($value <= 0) {
$rq = $pdo->prepare('UPDATE config SET autoflush=?');
$rq->execute(array(15));
}
}
function version_18($pdo)
{
$pdo->exec('ALTER TABLE feeds ADD COLUMN parsing_error INTEGER DEFAULT 0');