-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1451 from input-output-hk/ensemble/1435-gather-st…
…ore-cardano-transactions Gather and store Cardano transactions from immutable files
- Loading branch information
Showing
47 changed files
with
1,851 additions
and
91 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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
26 changes: 26 additions & 0 deletions
26
mithril-aggregator/src/database/cardano_transaction_migration.rs
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,26 @@ | ||
//! Migration module for cardano transactions store | ||
//! | ||
use mithril_common::database::SqlMigration; | ||
|
||
/// Get all the migrations required by this version of the software. | ||
/// There shall be one migration per database version. There could be several | ||
/// statements per migration. | ||
pub fn get_migrations() -> Vec<SqlMigration> { | ||
vec![ | ||
// Migration 1 | ||
// Add the `cardano_tx` table. | ||
SqlMigration::new( | ||
1, | ||
r#" | ||
create table cardano_tx ( | ||
transaction_hash text not null, | ||
block_number integer not null, | ||
immutable_file_number integer not null, | ||
primary key (transaction_hash) | ||
); | ||
create unique index cardano_tx_immutable_file_number_index on cardano_tx(immutable_file_number); | ||
"#, | ||
), | ||
] | ||
} |
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 |
---|---|---|
@@ -1,5 +1,7 @@ | ||
//! database module. | ||
//! This module contains the entities definition tied with database | ||
//! representation with their associated providers. | ||
|
||
pub mod cardano_transaction_migration; | ||
pub mod migration; | ||
pub mod provider; |
Oops, something went wrong.