From 390a3ee7fb1301dda142b2d0d9c349bfc8577c01 Mon Sep 17 00:00:00 2001 From: Jochen Topf Date: Sun, 7 Sep 2014 20:24:58 +0200 Subject: Rename 'fetch_result' to 'status'. --- sources/projects/import.rb | 2 +- sources/projects/parse.rb | 4 ++-- sources/projects/pre.sql | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'sources/projects') diff --git a/sources/projects/import.rb b/sources/projects/import.rb index 4004892..f128281 100755 --- a/sources/projects/import.rb +++ b/sources/projects/import.rb @@ -61,7 +61,7 @@ projects.each do |id, url| rescue last_modified = Time.now.utc end - db.execute("INSERT INTO projects (id, json_url, last_modified, fetch_date, fetch_status, fetch_json, fetch_result, data_updated) VALUES (?, ?, ?, ?, ?, ?, ?, ?)", + db.execute("INSERT INTO projects (id, json_url, last_modified, fetch_date, fetch_status, fetch_json, status, data_updated) VALUES (?, ?, ?, ?, ?, ?, ?, ?)", id, url, last_modified, diff --git a/sources/projects/parse.rb b/sources/projects/parse.rb index 1471d0e..679d9de 100755 --- a/sources/projects/parse.rb +++ b/sources/projects/parse.rb @@ -36,7 +36,7 @@ db = SQLite3::Database.new(dir + '/taginfo-projects.db') #------------------------------------------------------------------------------ -projects = db.execute("SELECT id, fetch_json FROM projects WHERE fetch_result='OK' ORDER BY id") +projects = db.execute("SELECT id, fetch_json FROM projects WHERE status='OK' ORDER BY id") projects.each do |id, json| puts " #{id}..." @@ -89,7 +89,7 @@ projects.each do |id, json| end end rescue JSON::ParserError - db.execute("UPDATE projects SET fetch_result='PARSE_ERROR' WHERE id=?", id) + db.execute("UPDATE projects SET status='PARSE_ERROR' WHERE id=?", id) end end diff --git a/sources/projects/pre.sql b/sources/projects/pre.sql index 6e4c0de..ae55fbf 100644 --- a/sources/projects/pre.sql +++ b/sources/projects/pre.sql @@ -17,7 +17,7 @@ CREATE TABLE projects ( fetch_date DATE, fetch_status TEXT, -- HTTP status code fetch_json TEXT, -- HTTP body - fetch_result TEXT, -- 'OK', 'FETCH ERROR', 'PARSE ERROR' + status TEXT, -- 'OK', 'FETCH ERROR', 'PARSE ERROR' data_format INTEGER, data_updated DATE, data_url TEXT, -- cgit v1.2.3