Merged in feature/document (pull request #36)
Document CRUD * doccreate * dochashlocandget * depsandtodo
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
CREATE TABLE documents (
|
||||
id uuid primary key DEFAULT gen_random_uuid(),
|
||||
jobId uuid not null,
|
||||
hash text not null,
|
||||
location text not null,
|
||||
foreign key (jobId) references jobs(id)
|
||||
);
|
||||
@@ -1,5 +1,5 @@
|
||||
-- name: GetDocument :one
|
||||
SELECT id, jobId FROM documents WHERE id = $1 LIMIT 1;
|
||||
SELECT id, jobId, hash, location FROM documents WHERE id = $1 LIMIT 1;
|
||||
|
||||
-- name: CreateDocument :one
|
||||
INSERT INTO documents (jobId) VALUES ($1) RETURNING id;
|
||||
INSERT INTO documents (jobId, hash, location) VALUES ($1, $2, $3) RETURNING id;
|
||||
Reference in New Issue
Block a user