File tree Expand file tree Collapse file tree 2 files changed +19
-4
lines changed
mithril-aggregator/src/database Expand file tree Collapse file tree 2 files changed +19
-4
lines changed Original file line number Diff line number Diff line change @@ -318,6 +318,14 @@ insert into signed_entity (signed_entity_id,
318
318
from signed_entity_old
319
319
order by rowid asc;
320
320
drop table signed_entity_old;
321
+ "# ,
322
+ ) ,
323
+ // Migration 12
324
+ // Alter `open_message` table
325
+ SqlMigration :: new(
326
+ 12 ,
327
+ r#"
328
+ create unique index open_message_unique_index on open_message(signed_entity_type_id, beacon);
321
329
"# ,
322
330
) ,
323
331
]
Original file line number Diff line number Diff line change @@ -799,18 +799,25 @@ mod tests {
799
799
async fn repository_clean_open_message ( ) {
800
800
let connection = get_connection ( ) . await ;
801
801
let repository = OpenMessageRepository :: new ( connection. clone ( ) ) ;
802
+ let beacon = Beacon {
803
+ epoch : Epoch ( 1 ) ,
804
+ ..Beacon :: default ( )
805
+ } ;
802
806
let _ = repository
803
807
. create_open_message (
804
- Epoch ( 2 ) ,
805
- & SignedEntityType :: CardanoImmutableFilesFull ( Beacon :: default ( ) ) ,
808
+ beacon . epoch ,
809
+ & SignedEntityType :: CardanoImmutableFilesFull ( beacon . clone ( ) ) ,
806
810
& ProtocolMessage :: new ( ) ,
807
811
)
808
812
. await
809
813
. unwrap ( ) ;
810
814
let _ = repository
811
815
. create_open_message (
812
- Epoch ( 1 ) ,
813
- & SignedEntityType :: CardanoImmutableFilesFull ( Beacon :: default ( ) ) ,
816
+ beacon. epoch ,
817
+ & SignedEntityType :: CardanoImmutableFilesFull ( Beacon {
818
+ epoch : Epoch ( 2 ) ,
819
+ ..beacon
820
+ } ) ,
814
821
& ProtocolMessage :: new ( ) ,
815
822
)
816
823
. await
You can’t perform that action at this time.
0 commit comments