Compare commits
2 Commits
release-20
...
release-20
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
74e6a50f14 | ||
|
|
3eb9b28ea0 |
@@ -8,6 +8,7 @@ DROP TRIGGER IF EXISTS comment_suspicious_change_trigger ON "Comment";
|
|||||||
DROP TRIGGER IF EXISTS comment_upvote_change_trigger ON "Comment";
|
DROP TRIGGER IF EXISTS comment_upvote_change_trigger ON "Comment";
|
||||||
DROP TRIGGER IF EXISTS comment_vote_change_trigger ON "CommentVote";
|
DROP TRIGGER IF EXISTS comment_vote_change_trigger ON "CommentVote";
|
||||||
DROP TRIGGER IF EXISTS suggestion_status_change_trigger ON "ServiceSuggestion";
|
DROP TRIGGER IF EXISTS suggestion_status_change_trigger ON "ServiceSuggestion";
|
||||||
|
DROP TRIGGER IF EXISTS manual_karma_adjustment_trigger ON "KarmaTransaction";
|
||||||
|
|
||||||
-- Drop existing functions
|
-- Drop existing functions
|
||||||
DROP FUNCTION IF EXISTS handle_comment_upvote_change();
|
DROP FUNCTION IF EXISTS handle_comment_upvote_change();
|
||||||
@@ -19,26 +20,30 @@ DROP FUNCTION IF EXISTS handle_comment_vote_change();
|
|||||||
DROP FUNCTION IF EXISTS insert_karma_transaction();
|
DROP FUNCTION IF EXISTS insert_karma_transaction();
|
||||||
DROP FUNCTION IF EXISTS update_user_karma();
|
DROP FUNCTION IF EXISTS update_user_karma();
|
||||||
DROP FUNCTION IF EXISTS handle_suggestion_status_change();
|
DROP FUNCTION IF EXISTS handle_suggestion_status_change();
|
||||||
|
DROP FUNCTION IF EXISTS handle_manual_karma_adjustment();
|
||||||
|
|
||||||
-- Helper function to insert karma transaction
|
-- Helper function to insert karma transaction
|
||||||
CREATE OR REPLACE FUNCTION insert_karma_transaction(
|
CREATE OR REPLACE FUNCTION insert_karma_transaction(
|
||||||
p_user_id INT,
|
p_user_id INT,
|
||||||
p_points INT,
|
p_points INT,
|
||||||
p_action "KarmaTransactionAction",
|
p_action TEXT,
|
||||||
p_comment_id INT,
|
p_comment_id INT,
|
||||||
p_description TEXT,
|
p_description TEXT,
|
||||||
p_suggestion_id INT DEFAULT NULL
|
p_suggestion_id INT DEFAULT NULL
|
||||||
) RETURNS VOID AS $$
|
) RETURNS VOID AS $$
|
||||||
BEGIN
|
BEGIN
|
||||||
INSERT INTO "KarmaTransaction" (
|
INSERT INTO "KarmaTransaction" (
|
||||||
"userId", "points", "action", "commentId",
|
"userId", "points", "action", "commentId", "suggestionId", "description", "processed", "createdAt"
|
||||||
"suggestionId",
|
)
|
||||||
"description", "processed", "createdAt"
|
|
||||||
)
|
|
||||||
VALUES (
|
VALUES (
|
||||||
p_user_id, p_points, p_action, p_comment_id,
|
p_user_id,
|
||||||
|
p_points,
|
||||||
|
p_action::"KarmaTransactionAction",
|
||||||
|
p_comment_id,
|
||||||
p_suggestion_id,
|
p_suggestion_id,
|
||||||
p_description, true, NOW()
|
p_description,
|
||||||
|
true,
|
||||||
|
NOW()
|
||||||
);
|
);
|
||||||
END;
|
END;
|
||||||
$$ LANGUAGE plpgsql;
|
$$ LANGUAGE plpgsql;
|
||||||
|
|||||||
BIN
web/src/assets/ogimage.png
Normal file
BIN
web/src/assets/ogimage.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 131 KiB |
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user