fix: set updated_at in watchlist queries

This commit is contained in:
2026-05-01 18:45:33 +02:00
parent 81125dfd15
commit 8a09cf2cc8
5 changed files with 14 additions and 10 deletions

View File

@@ -1,6 +1,6 @@
// Code generated by sqlc. DO NOT EDIT.
// versions:
// sqlc v1.30.0
// sqlc v1.31.1
// source: queries.sql
package database
@@ -687,7 +687,8 @@ func (q *Queries) MarkRelationsSynced(ctx context.Context, id int64) error {
const saveWatchProgress = `-- name: SaveWatchProgress :exec
UPDATE watch_list_entry
SET current_episode = ?,
current_time_seconds = ?
current_time_seconds = ?,
updated_at = CURRENT_TIMESTAMP
WHERE user_id = ? AND anime_id = ?
`
@@ -846,11 +847,12 @@ func (q *Queries) UpsertContinueWatchingEntry(ctx context.Context, arg UpsertCon
const upsertWatchListEntry = `-- name: UpsertWatchListEntry :one
INSERT INTO watch_list_entry (id, user_id, anime_id, status, current_episode, current_time_seconds, updated_at)
VALUES (?, ?, ?, ?, ?, ?, NULL)
VALUES (?, ?, ?, ?, ?, ?, CURRENT_TIMESTAMP)
ON CONFLICT (user_id, anime_id) DO UPDATE SET
status = excluded.status,
current_episode = excluded.current_episode,
current_time_seconds = excluded.current_time_seconds
current_time_seconds = excluded.current_time_seconds,
updated_at = CURRENT_TIMESTAMP
RETURNING id, user_id, anime_id, status, created_at, updated_at, current_episode, last_episode_at, current_time_seconds
`