give anon a bio and remove cowboy hat/top stackers;

This commit is contained in:
keyan 2023-08-11 13:32:01 -05:00
parent d406ccc2d8
commit e995fd4929
1 changed files with 22 additions and 0 deletions

View File

@ -0,0 +1,22 @@
set transaction isolation level serializable;
-- hack ... prisma doesn't know about our other schemas (e.g. pgboss)
-- and this is only really a problem on their "shadow database"
-- so we catch the exception it throws and ignore it
CREATE OR REPLACE FUNCTION create_anon_bio()
RETURNS INTEGER
LANGUAGE plpgsql
AS $$
DECLARE
BEGIN
-- give anon a bio
PERFORM create_bio('@anon''s bio', 'account of stackers just passing through', 27);
-- hide anon from top users and dont give them a hat
UPDATE users set "hideFromTopUsers" = true, "hideCowboyHat" = true where id = 27;
return 0;
EXCEPTION WHEN sqlstate '42P01' THEN
return 0;
END;
$$;
SELECT create_anon_bio();
DROP FUNCTION IF EXISTS create_anon_bio();