replace go uuid generation by postgresql
This commit is contained in:
@@ -18,13 +18,13 @@ WHERE id = ANY($1::text[])
|
||||
ORDER BY created_at DESC;
|
||||
|
||||
-- name: CreateFile :one
|
||||
INSERT INTO files (id, name, mime_type, size, storage_key, checksum, created_at, updated_at)
|
||||
VALUES ($1, $2, $3, $4, $5, $6, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP)
|
||||
INSERT INTO files (name, mime_type, size, storage_key, checksum, created_at, updated_at)
|
||||
VALUES ($1, $2, $3, $4, $5, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP)
|
||||
RETURNING *;
|
||||
|
||||
-- name: CreateFolder :one
|
||||
INSERT INTO files (id, name, is_folder, created_at, updated_at)
|
||||
VALUES ($1, $2, true, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP)
|
||||
INSERT INTO files (name, is_folder, created_at, updated_at)
|
||||
VALUES ($1, true, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP)
|
||||
RETURNING *;
|
||||
|
||||
-- name: ListFilesByParentID :many
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
-- name: CreateTag :one
|
||||
INSERT INTO tags (id, tag_name, tag_type)
|
||||
VALUES ($1, $2, $3)
|
||||
INSERT INTO tags (tag_name, tag_type)
|
||||
VALUES ($1, $2)
|
||||
RETURNING *;
|
||||
|
||||
-- name: GetTag :one
|
||||
@@ -20,8 +20,8 @@ DELETE FROM tags
|
||||
WHERE id = $1;
|
||||
|
||||
-- name: AddTagToFile :exec
|
||||
INSERT INTO file_tags (id, tag_id, file_id)
|
||||
VALUES ($1, $2, $3)
|
||||
INSERT INTO file_tags (tag_id, file_id)
|
||||
VALUES ($1, $2)
|
||||
ON CONFLICT DO NOTHING;
|
||||
|
||||
-- name: RemoveTagFromFile :exec
|
||||
|
||||
Reference in New Issue
Block a user