Show logs and usernames for deleted users and remove svg mimetype for client side

This commit is contained in:
thiloho
2024-09-14 15:12:08 +02:00
parent 79d1c9f5c7
commit 5f38500b9c
11 changed files with 119 additions and 95 deletions

View File

@@ -3,18 +3,17 @@ CREATE FUNCTION internal.check_user_not_website_owner ()
RETURNS TRIGGER
AS $$
BEGIN
IF EXISTS (
IF (EXISTS (
SELECT
1
FROM
internal.website AS w
WHERE
w.id = NEW.website_id
AND w.user_id = NEW.user_id) THEN
RAISE foreign_key_violation
USING message = 'User cannot be added as a collaborator to their own website';
END IF;
RETURN NEW;
w.id = NEW.website_id AND w.user_id = NEW.user_id)) THEN
RAISE foreign_key_violation
USING message = 'User cannot be added as a collaborator to their own website';
END IF;
RETURN NULL;
END;
$$
LANGUAGE plpgsql;