Skip to content

Commit

Permalink
Merge branch 'develop' of github.com:MindsHub/insigno_backend into de…
Browse files Browse the repository at this point in the history
…velop
  • Loading branch information
Usioumeo committed Oct 19, 2023
2 parents 2838440 + 95dd959 commit de684f9
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Insigno.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ intro_images = []
[default.databases.db]
url = "postgres://mindshub:test@localhost:5432/insignorocketdb"
timeout = 5
pool_size = 5
pool_size = 5
2 changes: 1 addition & 1 deletion migrations/2023-10-09-143951_verify_verdict/up.sql
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ CREATE OR REPLACE FUNCTION verify_set_verdict(
-- update the score of the marker image
UPDATE marker_images
SET verify_number = verify_number + 1,
verify_average = (verify_average * verify_number + CASE WHEN verdict_inp = TRUE THEN 1.0 ELSE 0.0 END)/verify_number
verify_average = (verify_average * verify_number + CASE WHEN verdict_inp = TRUE THEN 1.0 ELSE 0.0 END)/COALESCE(verify_number+1, 1)
WHERE marker_images.id = image_id_inp;

-- check if the remaining images in the session are down to 0
Expand Down
2 changes: 1 addition & 1 deletion migrations/2023-10-16-090225_get_near/up.sql
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ CREATE OR REPLACE FUNCTION get_near(
AND (SELECT COUNT (*) FROM marker_reports WHERE markers.id = reported_marker)<1
AND (
(SELECT COUNT (*) FROM marker_images WHERE markers.id = marker_images.refers_to AND (marker_images.verify_average>0.5 OR marker_images.approved) )>0
OR ((user_id_inp IS NOT NULL) OR markers.created_by =user_id_inp)
OR ((user_id_inp IS NOT NULL) AND markers.created_by =user_id_inp)
);
END;
$$ LANGUAGE plpgsql;

0 comments on commit de684f9

Please sign in to comment.