Add tests and edit comments if the item they're replying to has been edited
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
/* name: ItemExists :one */
|
||||
SELECT COUNT(1) FROM replied_items WHERE item_type = ? AND id = ? AND updated_time = ?;
|
||||
/* name: GetItem :one */
|
||||
SELECT * FROM replied_items WHERE item_type = ? AND id = ? LIMIT 1;
|
||||
|
||||
/* name: AddItem :exec */
|
||||
INSERT OR REPLACE INTO replied_items (id, item_type, updated_time) VALUES (?, ?, ?);
|
||||
INSERT OR REPLACE INTO replied_items (id, reply_id, item_type, updated_time) VALUES (?, -1, ?, ?);
|
||||
|
||||
/* name: SetReplyID :exec */
|
||||
UPDATE replied_items SET reply_id = ? WHERE id = ?;
|
||||
@@ -1,5 +1,6 @@
|
||||
CREATE TABLE IF NOT EXISTS replied_items (
|
||||
id INT NOT NULL PRIMARY KEY,
|
||||
reply_id INT NOT NULL,
|
||||
item_type TEXT NOT NULL CHECK( item_type IN ('p', 'c') ),
|
||||
updated_time INT NOT NULL,
|
||||
UNIQUE(id, item_type)
|
||||
|
||||
Reference in New Issue
Block a user