summaryrefslogtreecommitdiff
path: root/sources/projects
diff options
context:
space:
mode:
authorJochen Topf <jochen@topf.org>2014-09-07 20:24:58 +0200
committerJochen Topf <jochen@topf.org>2014-09-07 20:24:58 +0200
commit390a3ee7fb1301dda142b2d0d9c349bfc8577c01 (patch)
tree2f666968644bfc63f252d25304b0d6e59339dada /sources/projects
parent866f4c505b978d18fce4b25c2c9c4cfd57747979 (diff)
downloadtaginfo-390a3ee7fb1301dda142b2d0d9c349bfc8577c01.tar
taginfo-390a3ee7fb1301dda142b2d0d9c349bfc8577c01.tar.gz
Rename 'fetch_result' to 'status'.
Diffstat (limited to 'sources/projects')
-rwxr-xr-xsources/projects/import.rb2
-rwxr-xr-xsources/projects/parse.rb4
-rw-r--r--sources/projects/pre.sql2
3 files changed, 4 insertions, 4 deletions
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,