diff options
author | Andrew Dolgov <[email protected]> | 2009-02-04 13:53:25 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2009-02-04 13:53:25 +0300 |
commit | b871dd06e12048502dff8436b14fb1271db97f6a (patch) | |
tree | 23e5c1f3faf48444ea4f38faf482ce7c8a9af520 /offline.js | |
parent | 25d993538216482ac4e043c5f2857e2b0748b1f6 (diff) |
offline: schema updated
Diffstat (limited to 'offline.js')
-rw-r--r-- | offline.js | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/offline.js b/offline.js index 04262bfba..38bcc286a 100644 --- a/offline.js +++ b/offline.js @@ -1,3 +1,5 @@ +var SCHEMA_VERSION = 2; + var offline_mode = false; var store = false; var localServer = false; @@ -572,19 +574,16 @@ function init_gears() { } if (version != SCHEMA_VERSION) { - db.execute("DROP TABLE cache"); - db.execute("DROP TABLE feeds"); - db.execute("DROP TABLE articles"); + db.execute("DROP TABLE IF EXISTS cache"); + db.execute("DROP TABLE IF EXISTS feeds"); + db.execute("DROP TABLE IF EXISTS articles"); db.execute("INSERT INTO version (schema_version) VALUES (?)", [SCHEMA_VERSION]); } db.execute("CREATE TABLE IF NOT EXISTS cache (id text, article text, param text, added text)"); - - db.execute("CREATE TABLE if not exists feeds (id integer, title text, has_icon integer)"); - - db.execute("CREATE TABLE if not exists articles (id integer, feed_id integer, title text, link text, guid text, updated text, content text, tags text, unread text, marked text, added text)"); - + db.execute("CREATE TABLE IF NOT EXISTS feeds (id integer, title text, has_icon integer)"); + db.execute("CREATE TABLE IF NOT EXISTS articles (id integer, feed_id integer, title text, link text, guid text, updated text, content text, tags text, unread text, marked text, added text, comments text)"); window.setTimeout("update_offline_data(0)", 100); } |