You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: internal/storage/bucket/migrations/11-make-stateless/up.sql
+14-7Lines changed: 14 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -495,35 +495,42 @@ $do$
495
495
vsql ='select setval(''"log_id_'||ledger.id||'"'', coalesce((select max(id) + 1 from logs where ledger = '''||ledger.name||'''), 1)::bigint, false)';
496
496
execute vsql;
497
497
498
-
vsql ='create trigger "set_effective_volumes_'||ledger.id||'" before insert on moves for each row when (new.ledger = '''||ledger.name||''') execute procedure set_effective_volumes()';
498
+
vsql ='create trigger "transaction_set_addresses_'||ledger.id||'" before insert on transactions for each row when (new.ledger = '''||ledger.name||''') execute procedure set_transaction_addresses()';
499
499
execute vsql;
500
500
501
-
vsql ='create trigger "update_effective_volumes_'||ledger.id||'" after insert on moves for each row when (new.ledger = '''||ledger.name||''') execute procedure update_effective_volumes()';
501
+
vsql ='create trigger "accounts_set_address_array_'||ledger.id||'" before insert on accounts for each row when (new.ledger = '''||ledger.name||''') execute procedure set_address_array_for_account()';
502
502
execute vsql;
503
503
504
-
-- logs hash
505
-
vsql ='create trigger "set_log_hash_'||ledger.id||'" before insert on logs for each row when (new.ledger = '''||ledger.name||''') execute procedure set_log_hash()';
504
+
vsql ='create trigger "transaction_set_addresses_segments_'||ledger.id||'" before insert on "transactions" for each row when (new.ledger = '''||ledger.name||''') execute procedure set_transaction_addresses_segments()';
506
505
execute vsql;
506
+
end loop;
507
507
508
+
for ledger inselect*from_system.ledgerswhere bucket = current_schema and features->>'ACCOUNT_METADATA_HISTORY'='SYNC' loop
508
509
vsql ='create trigger "update_account_metadata_history_'||ledger.id||'" after update on "accounts" for each row when (new.ledger = '''||ledger.name||''') execute procedure update_account_metadata_history()';
509
510
execute vsql;
510
511
511
512
vsql ='create trigger "insert_account_metadata_history_'||ledger.id||'" after insert on "accounts" for each row when (new.ledger = '''||ledger.name||''') execute procedure insert_account_metadata_history()';
512
513
execute vsql;
514
+
end loop;
513
515
516
+
for ledger inselect*from_system.ledgerswhere bucket = current_schema and features->>'TRANSACTION_METADATA_HISTORY'='SYNC' loop
514
517
vsql ='create trigger "update_transaction_metadata_history_'||ledger.id||'" after update on "transactions" for each row when (new.ledger = '''||ledger.name||''') execute procedure update_transaction_metadata_history()';
515
518
execute vsql;
516
519
517
520
vsql ='create trigger "insert_transaction_metadata_history_'||ledger.id||'" after insert on "transactions" for each row when (new.ledger = '''||ledger.name||''') execute procedure insert_transaction_metadata_history()';
518
521
execute vsql;
522
+
end loop;
519
523
520
-
vsql ='create trigger "transaction_set_addresses_'||ledger.id||'" before insert on transactions for each row when (new.ledger = '''||ledger.name||''') execute procedure set_transaction_addresses()';
524
+
for ledger inselect*from_system.ledgerswhere bucket = current_schema and features->>'MOVES_HISTORY_POST_COMMIT_EFFECTIVE_VOLUMES'='SYNC' loop
525
+
vsql ='create trigger "set_effective_volumes_'||ledger.id||'" before insert on moves for each row when (new.ledger = '''||ledger.name||''') execute procedure set_effective_volumes()';
521
526
execute vsql;
522
527
523
-
vsql ='create trigger "accounts_set_address_array_'||ledger.id||'" before insert on accounts for each row when (new.ledger = '''||ledger.name||''') execute procedure set_address_array_for_account()';
528
+
vsql ='create trigger "update_effective_volumes_'||ledger.id||'" after insert on moves for each row when (new.ledger = '''||ledger.name||''') execute procedure update_effective_volumes()';
524
529
execute vsql;
530
+
end loop;
525
531
526
-
vsql ='create trigger "transaction_set_addresses_segments_'||ledger.id||'" before insert on "transactions" for each row when (new.ledger = '''||ledger.name||''') execute procedure set_transaction_addresses_segments()';
532
+
for ledger inselect*from_system.ledgerswhere bucket = current_schema and features->>'HASH_LOGS'='SYNC' loop
533
+
vsql ='create trigger "set_log_hash_'||ledger.id||'" before insert on logs for each row when (new.ledger = '''||ledger.name||''') execute procedure set_log_hash()';
0 commit comments