watchlist: only set updated_at when marking anime as completed
This commit is contained in:
@@ -31,19 +31,17 @@ SELECT * FROM anime WHERE id = ? LIMIT 1;
|
||||
|
||||
-- name: UpsertWatchListEntry :one
|
||||
INSERT INTO watch_list_entry (id, user_id, anime_id, status, current_episode, current_time_seconds, updated_at)
|
||||
VALUES (?, ?, ?, ?, ?, ?, CURRENT_TIMESTAMP)
|
||||
VALUES (?, ?, ?, ?, ?, ?, NULL)
|
||||
ON CONFLICT (user_id, anime_id) DO UPDATE SET
|
||||
status = excluded.status,
|
||||
current_episode = excluded.current_episode,
|
||||
current_time_seconds = excluded.current_time_seconds,
|
||||
updated_at = CURRENT_TIMESTAMP
|
||||
current_time_seconds = excluded.current_time_seconds
|
||||
RETURNING *;
|
||||
|
||||
-- name: SaveWatchProgress :exec
|
||||
UPDATE watch_list_entry
|
||||
SET current_episode = ?,
|
||||
current_time_seconds = ?,
|
||||
updated_at = CURRENT_TIMESTAMP
|
||||
current_time_seconds = ?
|
||||
WHERE user_id = ? AND anime_id = ?;
|
||||
|
||||
-- name: UpsertContinueWatchingEntry :one
|
||||
|
||||
Reference in New Issue
Block a user