From ee917419ad8adbb0a3db8734b0cba26692c27ba3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Guillot?= Date: Sun, 22 Dec 2013 21:11:50 -0500 Subject: [PATCH] Set default value of autoflush to 15 days in not set to avoid large database --- schema.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/schema.php b/schema.php index 20496c5..6e83c6b 100644 --- a/schema.php +++ b/schema.php @@ -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');