Permissions for plpython3u and add claim_boost

This commit is contained in:
Joseph Ferano 2023-04-22 16:34:11 +07:00
parent d0bcdde4c8
commit 01cc1d78ef
2 changed files with 5 additions and 3 deletions

View File

@ -131,7 +131,10 @@ end;
$$ language plpgsql;
-- Needed to load the python3 extension
CREATE EXTENSION plpython3u;
create or replace trusted language plpython3u;
-- If you don't grant this permission then devs will not be able to update this function
-- It's dangerous though, I guess
update pg_language set lanpltrusted = true where lanname = 'plpython3u';
create or replace function download_sheets()
returns void as $$

View File

@ -280,7 +280,6 @@ begin
end;
$$ language plpgsql;
create or replace function purchase_item(
p_user_id uuid,
p_store_item_id integer
@ -397,7 +396,7 @@ begin
raise exception 'Unable to find an inventory item that is owned and not actively staked';
end if;
select claim_amount
select claim_amount + claim_boost
into total_stake_amount
from inventory_item
join store_item on inventory_item.store_item_id = store_item.id