diff --git a/sql/import-config.sql b/sql/import-config.sql index 52621a4..ec20f74 100644 --- a/sql/import-config.sql +++ b/sql/import-config.sql @@ -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 $$ diff --git a/sql/procedures.sql b/sql/procedures.sql index 68a205e..e807e55 100644 --- a/sql/procedures.sql +++ b/sql/procedures.sql @@ -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