fix 500 error on making post

master
Aevann 2023-06-23 17:25:31 +03:00
parent 3cf4c7c9dc
commit 662113dfc1
1 changed files with 12 additions and 0 deletions

View File

@ -14,3 +14,15 @@ alter table subactions rename constraint subactions_submission_fkey to subaction
alter table subscriptions rename constraint subscription_submission_fkey to subscription_post_fkey;
alter table post_option_votes rename constraint vote_submission_fkey to vote_post_fkey;
alter table votes rename constraint vote_submission_key to vote_post_key;
drop function bump_utc;
CREATE FUNCTION public.bump_utc(public.posts) RETURNS integer
LANGUAGE sql IMMUTABLE STRICT
AS $_$
SELECT CREATED_UTC
FROM comments
WHERE parent_post = $1.id
ORDER BY created_utc desc
LIMIT 1
$_$;