fix: set updated_at in watchlist queries
This commit is contained in:
@@ -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
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
`
|
`
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user