-var SCHEMA_VERSION = 9;
+var SCHEMA_VERSION = 10;
var offline_mode = false;
var store = false;
window.setTimeout("update_offline_data(0)", 1800*1000);
debug("update_offline_data: finished");
- var date = new Date();
- var ts = Math.round(date.getTime() / 1000);
-
- db.execute("DELETE FROM articles WHERE added < ? - 2592000", [ts]);
+ db.execute("DELETE FROM articles WHERE "+
+ "updated < DATETIME('NOW', 'localtime', '-31 days')");
}
}
db.execute("CREATE TRIGGER IF NOT EXISTS articles_update_modified "+
"UPDATE OF unread ON articles "+
"BEGIN "+
- "UPDATE articles SET modified = DATETIME('NOW') WHERE id = old.id AND "+
+ "UPDATE articles SET modified = DATETIME('NOW', 'localtime') "+
+ "WHERE id = old.id AND "+
"old.unread = 1;"+
"END;");