Skip to content

Commit

Permalink
Merge pull request #110 from EGA-archive/db-typo-fix
Browse files Browse the repository at this point in the history
Fixing the field names in the pipeline DB
  • Loading branch information
silverdaz committed Jun 17, 2020
2 parents 2b9ca74 + 185af78 commit 16da21b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ingestion/db/db.sql
Original file line number Diff line number Diff line change
Expand Up @@ -143,13 +143,13 @@ RETURNS local_ega.jobs.id%TYPE AS $insert_job$
WHERE correlation_id = cid AND
inbox_path = inpath AND
user_id = uid AND
inbox_path_encrypted_checksum = checksum AND
inbox_path_encrypted_checksum_type = checksum_type AND
inbox_checksum = checksum AND
inbox_checksum_type = checksum_type AND
NOT (status = 'ERROR' OR status = 'CANCELED');
IF FOUND THEN RETURN -1; END IF;

-- If not found, make a new insertion
INSERT INTO local_ega.jobs (correlation_id,inbox_path,user_id,inbox_path_encrypted_checksum,inbox_path_encrypted_checksum_type)
INSERT INTO local_ega.jobs (correlation_id,inbox_path,user_id,inbox_checksum,inbox_checksum_type)
VALUES(cid,inpath,uid,checksum,checksum_type)
ON CONFLICT -- ON CONSTRAINT (correlation_id,inbox_path,user_id,inbox_sha256)
DO NOTHING -- UPDATE SET status = 'CANCELED' -- data race here ?
Expand Down

0 comments on commit 16da21b

Please sign in to comment.