Skip to content

Commit

Permalink
update sql
Browse files Browse the repository at this point in the history
  • Loading branch information
mertalev committed Sep 28, 2024
1 parent ad1b572 commit 09fb41a
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions server/src/queries/asset.repository.sql
Original file line number Diff line number Diff line change
Expand Up @@ -1132,3 +1132,27 @@ RETURNING
"id",
"createdAt",
"updatedAt"

-- AssetRepository.upsertFiles
INSERT INTO
"asset_files" (
"id",
"assetId",
"createdAt",
"updatedAt",
"type",
"path"
)
VALUES
(DEFAULT, $1, DEFAULT, DEFAULT, $2, $3)
ON CONFLICT ("assetId", "type") DO
UPDATE
SET
"assetId" = EXCLUDED."assetId",
"type" = EXCLUDED."type",
"path" = EXCLUDED."path",
"updatedAt" = DEFAULT
RETURNING
"id",
"createdAt",
"updatedAt"

0 comments on commit 09fb41a

Please sign in to comment.