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. // Code generated by sqlc. DO NOT EDIT.
// versions: // versions:
// sqlc v1.30.0 // sqlc v1.31.1
package database package database

View File

@@ -1,6 +1,6 @@
// Code generated by sqlc. DO NOT EDIT. // Code generated by sqlc. DO NOT EDIT.
// versions: // versions:
// sqlc v1.30.0 // sqlc v1.31.1
package database package database

View File

@@ -1,6 +1,6 @@
// Code generated by sqlc. DO NOT EDIT. // Code generated by sqlc. DO NOT EDIT.
// versions: // versions:
// sqlc v1.30.0 // sqlc v1.31.1
package database package database

View File

@@ -31,17 +31,19 @@ SELECT * FROM anime WHERE id = ? LIMIT 1;
-- name: UpsertWatchListEntry :one -- name: UpsertWatchListEntry :one
INSERT INTO watch_list_entry (id, user_id, anime_id, status, current_episode, current_time_seconds, updated_at) 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 ON CONFLICT (user_id, anime_id) DO UPDATE SET
status = excluded.status, status = excluded.status,
current_episode = excluded.current_episode, current_episode = excluded.current_episode,
current_time_seconds = excluded.current_time_seconds current_time_seconds = excluded.current_time_seconds,
updated_at = CURRENT_TIMESTAMP
RETURNING *; RETURNING *;
-- name: SaveWatchProgress :exec -- name: SaveWatchProgress :exec
UPDATE watch_list_entry UPDATE watch_list_entry
SET current_episode = ?, SET current_episode = ?,
current_time_seconds = ? current_time_seconds = ?,
updated_at = CURRENT_TIMESTAMP
WHERE user_id = ? AND anime_id = ?; WHERE user_id = ? AND anime_id = ?;
-- name: UpsertContinueWatchingEntry :one -- name: UpsertContinueWatchingEntry :one

View File

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