Commit f3889d10 authored by Ivanq's avatar Ivanq

Add 'issue_json_id' column to 'issue_comments' table

parent 14ee37d4
......@@ -24,7 +24,7 @@
["cert_user_id", "TEXT"]
],
"indexes": ["CREATE UNIQUE INDEX path ON json(directory, site, file_name)"],
"schema_changed": 1
"schema_changed": 4
},
"issues": {
"cols": [
......@@ -42,12 +42,13 @@
"cols": [
["id", "INTEGER"],
["issue_id", "INTEGER"],
["issue_json_id", "INTEGER REFERENCES json (json_id)"],
["body", "TEXT"],
["date_added", "INTEGER"],
["json_id", "INTEGER REFERENCES json (json_id)"]
],
"indexes": ["CREATE UNIQUE INDEX issue_comments_key ON issue_comments(json_id, id)"],
"schema_changed": 1
"schema_changed": 2
}
}
}
\ No newline at end of file
......@@ -180,7 +180,7 @@ class Repository {
}
getIssueComments(id, jsonId) {
return this.zeroDB.query("\
SELECT issues.id AS issue_id, -1 AS id, issues.body AS body, issues.date_added AS date_added, issues.json_id AS json_id, json.cert_user_id AS cert_user_id FROM issues, json WHERE issues.json_id = json.json_id AND issues.json_id = :jsonId AND issues.id = :id\
SELECT issues.id AS issue_id, -1 AS id, issues.body AS body, issues.date_added AS date_added, issues.json_id AS issue_json_id, issues.json_id AS json_id, json.cert_user_id AS cert_user_id FROM issues, json WHERE issues.json_id = json.json_id AND issues.json_id = :jsonId AND issues.id = :id\
UNION ALL\
SELECT issue_comments.*, json.cert_user_id AS cert_user_id FROM issue_comments, json WHERE issue_comments.json_id = json.json_id AND issue_comments.json_id = :jsonId AND issue_comments.issue_id = :id\
ORDER BY date_added ASC\
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment