-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
88 additions
and
139 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
supabase/migrations/20240728180825_enable_pg_cron_extension.sql
This file was deleted.
Oops, something went wrong.
29 changes: 29 additions & 0 deletions
29
supabase/migrations/202407281808278_send_account_transfers_filter_non_send_accounts.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
set check_function_bodies = off; | ||
|
||
-- create trigger function for filtering send_account_transfers with no send_account_created | ||
create or replace function private.filter_send_account_transfers_with_no_send_account_created() | ||
returns trigger | ||
language plpgsql | ||
security definer | ||
as $$ | ||
begin | ||
-- Deletes send_account_transfers with no send_account_created. | ||
-- This is due to performance issues in our shovel indexer and using filter_ref to limit indexing to only | ||
-- send_account_transfers with send_account_created. | ||
-- For now, we index all USDC and SEND token transfers, and use this function cron job to delete the rest. | ||
-- See https://github.com/orgs/indexsupply/discussions/268 | ||
if exists ( select 1 from send_account_created where account = new.f ) | ||
or exists ( select 1 from send_account_created where account = new.t ) | ||
then | ||
return new; | ||
else | ||
return null; | ||
end if; | ||
end; | ||
$$; | ||
|
||
-- create trigger on send_account_transfers table | ||
create trigger filter_send_account_transfers_with_no_send_account_created | ||
before insert on public.send_account_transfers | ||
for each row | ||
execute function private.filter_send_account_transfers_with_no_send_account_created(); |
55 changes: 0 additions & 55 deletions
55
...ations/20240728180827_cron_delete_send_account_transfers_with_no_send_account_created.sql
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters