From 71af6d360960eddbd4233b2ed20b01aca5ee2fe1 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sat, 7 Feb 2009 11:14:15 +0300 Subject: [PATCH] more schema updates --- offline.js | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/offline.js b/offline.js index e6d5c48a..be28b43d 100644 --- a/offline.js +++ b/offline.js @@ -1,4 +1,4 @@ -var SCHEMA_VERSION = 9; +var SCHEMA_VERSION = 10; var offline_mode = false; var store = false; @@ -256,8 +256,6 @@ function viewfeed_offline(feed_id, subop, is_cat, subop_param, skip_history, off var labels = get_local_article_labels(id); - debug(labels); - var labels_str = ""; labels_str += format_article_labels(labels, id); labels_str += ""; @@ -940,12 +938,12 @@ function init_gears() { [SCHEMA_VERSION]); } - db.execute("CREATE TABLE IF NOT EXISTS init_params (key text PRIMARY KEY, value text)"); + db.execute("CREATE TABLE IF NOT EXISTS init_params (key text, value text)"); - db.execute("CREATE TABLE IF NOT EXISTS cache (id PRIMARY KEY, article text, param text, added text)"); - db.execute("CREATE TABLE IF NOT EXISTS feeds (id PRIMARY KEY, title text, has_icon integer, cat_id integer)"); - db.execute("CREATE TABLE IF NOT EXISTS categories (id PRIMARY KEY, title text, collapsed integer)"); - db.execute("CREATE TABLE IF NOT EXISTS labels (id PRIMARY KEY, caption text, fg_color text, bg_color text)"); + db.execute("CREATE TABLE IF NOT EXISTS cache (id integer, article text, param text, added text)"); + db.execute("CREATE TABLE IF NOT EXISTS feeds (id integer, title text, has_icon integer, cat_id integer)"); + db.execute("CREATE TABLE IF NOT EXISTS categories (id integer, title text, collapsed integer)"); + db.execute("CREATE TABLE IF NOT EXISTS labels (id integer, caption text, fg_color text, bg_color text)"); db.execute("CREATE TABLE IF NOT EXISTS article_labels (id integer, label_id integer)"); db.execute("CREATE TABLE IF NOT EXISTS articles (id integer, feed_id integer, title text, link text, guid text, updated timestamp, content text, tags text, unread integer, marked integer, added text, modified timestamp, comments text)"); @@ -953,7 +951,7 @@ function init_gears() { db.execute("CREATE INDEX IF NOT EXISTS article_labels_label_id_idx ON article_labels(label_id)"); db.execute("CREATE INDEX IF NOT EXISTS articles_feed_id_idx ON articles(feed_id)"); - db.execute("CREATE TABLE IF NOT EXISTS syncdata (key PRIMARY KEY, value text)"); + db.execute("CREATE TABLE IF NOT EXISTS syncdata (key integer, value text)"); db.execute("DELETE FROM cache WHERE id LIKE 'F:%' OR id LIKE 'C:%'"); @@ -1012,6 +1010,7 @@ function local_collapse_cat(id) { function get_local_category_title(id) { try { + var rs = db.execute("SELECT title FROM categories WHERE id = ?", [id]); var tmp = ""; -- 2.39.5