Skip to content

Commit d89b76c

Browse files
authored
Merge pull request #1609 from input-output-hk/damien/1603/add-indexes-on-foreign-keys
New migration to add indexes on foreign keys
2 parents 42f4432 + 505b1eb commit d89b76c

File tree

3 files changed

+28
-2
lines changed

3 files changed

+28
-2
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
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.52"
3+
version = "0.4.53"
44
description = "A Mithril Aggregator server"
55
authors = { workspace = true }
66
edition = { workspace = true }

mithril-aggregator/src/database/migration.rs

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -699,5 +699,31 @@ update pending_certificate
699699
);
700700
"#,
701701
),
702+
// Migration 24
703+
// Add indexes for foreign keys
704+
SqlMigration::new(
705+
24,
706+
r#"
707+
-- `certificate` table
708+
create index certificate_parent_certificate_id_index on certificate(parent_certificate_id);
709+
710+
-- `signer_registration` table
711+
create index signer_registration_epoch_setting_id_index on signer_registration(epoch_setting_id);
712+
create index signer_registration_signer_id_index on signer_registration(signer_id);
713+
714+
-- `open_message` table
715+
create index open_message_epoch_setting_id_index on open_message(epoch_setting_id);
716+
create index open_message_signed_entity_type_id_index on open_message(signed_entity_type_id);
717+
718+
-- `signed_entity` table
719+
create index signed_entity_signed_entity_type_id_index on signed_entity(signed_entity_type_id);
720+
create index signed_entity_certificate_id_index on signed_entity(certificate_id);
721+
722+
-- `single_signature` table
723+
create index single_signature_open_message_id_index on single_signature(open_message_id);
724+
create index single_signature_signer_id_index on single_signature(signer_id);
725+
create index single_signature_registration_epoch_setting_id_index on single_signature(registration_epoch_setting_id);
726+
"#,
727+
),
702728
]
703729
}

0 commit comments

Comments
 (0)