Skip to content

Commit 733d002

Browse files
authored
Merge pull request #1607 from input-output-hk/ensemble/1591/incremental-storage-for-cardano-tx
Add and persist `slot_number` and `block_hash` to `CardanoTransaction`
2 parents 0d4cace + a869994 commit 733d002

File tree

14 files changed

+437
-236
lines changed

14 files changed

+437
-236
lines changed

Cargo.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

mithril-aggregator/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "mithril-aggregator"
3-
version = "0.4.51"
3+
version = "0.4.52"
44
description = "A Mithril Aggregator server"
55
authors = { workspace = true }
66
edition = { workspace = true }

mithril-aggregator/src/database/cardano_transaction_migration.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,19 @@ create index cardano_tx_immutable_file_number_index on cardano_tx(immutable_file
3737
vacuum;
3838
"#,
3939
),
40+
// Migration 3
41+
// Add `slot_number` and `block_hash` columns to `cardano_tx`.
42+
SqlMigration::new(
43+
3,
44+
r#"
45+
-- remove all data from the cardano tx table since the new columns are mandatory
46+
delete from cardano_tx;
47+
48+
alter table cardano_tx add column slot_number integer not null;
49+
alter table cardano_tx add column block_hash text not null;
50+
51+
vacuum;
52+
"#,
53+
),
4054
]
4155
}

0 commit comments

Comments
 (0)