Skip to content

Commit 0307303

Browse files
committed
Add new migration in aggregator db
This migration adds indexes for foreign keys
1 parent 42f4432 commit 0307303

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

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)