mirror of
https://github.com/TeamPiped/Piped-Backend.git
synced 2024-08-14 23:51:41 +00:00
Use excluded in DO UPDATE SET
This commit is contained in:
parent
82aa66eee8
commit
8aefd7023d
1 changed files with 1 additions and 3 deletions
|
@ -162,9 +162,7 @@ public class VideoHelpers {
|
|||
s.createNativeMutationQuery(
|
||||
"INSERT INTO videos (uploader_id,duration,is_short,thumbnail,title,uploaded,views,id) values " +
|
||||
"(:uploader_id,:duration,:is_short,:thumbnail,:title,:uploaded,:views,:id) ON CONFLICT (id) DO UPDATE SET " +
|
||||
"duration = :duration," +
|
||||
"title = :title," +
|
||||
"views = :views"
|
||||
"duration = excluded.duration, title = excluded.title, views = excluded.views"
|
||||
)
|
||||
.setParameter("uploader_id", video.getChannel())
|
||||
.setParameter("duration", video.getDuration())
|
||||
|
|
Loading…
Reference in a new issue