diff --git a/files/grest/rpc/assets/asset_address_list.sql b/files/grest/rpc/assets/asset_address_list.sql index b196811ad..f38bbd34c 100644 --- a/files/grest/rpc/assets/asset_address_list.sql +++ b/files/grest/rpc/assets/asset_address_list.sql @@ -1,8 +1,3 @@ --- Index creation should be moved to a more general place in the setup -CREATE INDEX IF NOT EXISTS _asset_policy_idx ON PUBLIC.MA_TX_OUT ( policy); - -CREATE INDEX IF NOT EXISTS _asset_identifier_idx ON PUBLIC.MA_TX_OUT ( policy, name); - DROP FUNCTION IF EXISTS grest.asset_address_list (text, text); CREATE FUNCTION grest.asset_address_list (_asset_policy text, _asset_name text) diff --git a/scripts/grest-helper-scripts/setup-grest.sh b/scripts/grest-helper-scripts/setup-grest.sh index d48c235f7..af4f7ee41 100755 --- a/scripts/grest-helper-scripts/setup-grest.sh +++ b/scripts/grest-helper-scripts/setup-grest.sh @@ -424,6 +424,10 @@ ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO web_anon; ALTER DEFAULT PRIVILEGES IN SCHEMA grest GRANT SELECT ON TABLES TO web_anon; ALTER ROLE web_anon SET search_path TO grest, public; + + CREATE INDEX IF NOT EXISTS _asset_policy_idx ON PUBLIC.MA_TX_OUT (policy); + CREATE INDEX IF NOT EXISTS _asset_identifier_idx ON PUBLIC.MA_TX_OUT (policy, name); + COMMIT; EOF populate_genesis_table