-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Backport v1.7.6 to v1.8.1 & main (#370)
* first * chore: add migration 17 test * fix: remove verbose * fix: review gfyrag * fix: 'account' filter on GET /transactions using old method
- Loading branch information
Showing
4 changed files
with
203 additions
and
148 deletions.
There are no files selected for viewing
52 changes: 0 additions & 52 deletions
52
pkg/storage/sqlstorage/migrates/14-update-timestamp-column-type/any_test.go
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
36 changes: 36 additions & 0 deletions
36
pkg/storage/sqlstorage/migrates/17-optimized-segments/postgres.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,36 @@ | ||
--statement | ||
drop trigger if exists log_entry on "VAR_LEDGER_NAME".log; | ||
--statement | ||
drop trigger if exists volumes_changed on "VAR_LEDGER_NAME".log; | ||
|
||
--statement | ||
alter table "VAR_LEDGER_NAME".transactions drop column if exists sources; | ||
--statement | ||
alter table "VAR_LEDGER_NAME".transactions drop column if exists destinations; | ||
--statement | ||
drop index if exists transactions_sources; | ||
--statement | ||
drop index if exists transactions_destinations; | ||
|
||
--statement | ||
create table if not exists "VAR_LEDGER_NAME".postings ( | ||
txid bigint, | ||
posting_index integer, | ||
source jsonb, | ||
destination jsonb | ||
); | ||
|
||
--statement | ||
create index postings_src on "VAR_LEDGER_NAME".postings using GIN(source); | ||
--statement | ||
create index postings_dest on "VAR_LEDGER_NAME".postings using GIN(destination); | ||
--statement | ||
create index postings_txid on "VAR_LEDGER_NAME".postings (txid asc); | ||
|
||
--statement | ||
insert into "VAR_LEDGER_NAME".postings(txid, posting_index, source, destination) | ||
select txs.id as txid, i - 1 as posting_index, | ||
array_to_json(string_to_array(t.posting->>'source', ':'))::jsonb as source, | ||
array_to_json(string_to_array(t.posting->>'destination', ':'))::jsonb as destination | ||
from "VAR_LEDGER_NAME".transactions txs left join lateral jsonb_array_elements(txs.postings) | ||
with ordinality as t(posting, i) on true; |
Oops, something went wrong.