File tree Expand file tree Collapse file tree 2 files changed +28
-7
lines changed Expand file tree Collapse file tree 2 files changed +28
-7
lines changed Original file line number Diff line number Diff line change @@ -259,6 +259,26 @@ create table signer_registration (
259
259
);
260
260
insert into signer_registration select * from signer_registration_temp order by ROWID asc;
261
261
drop table signer_registration_temp;
262
+ "# ,
263
+ ) ,
264
+ // Migration 9
265
+ // Add the `single_signature` table and rename previous table to `single_signature_legacy`
266
+ SqlMigration :: new(
267
+ 9 ,
268
+ r#"
269
+ create table if not exists single_signature (key_hash text primary key, key json not null, value json not null);
270
+ alter table single_signature rename to single_signature_legacy;
271
+ create table single_signature (
272
+ open_message_id text not null,
273
+ signer_id text not null,
274
+ registration_epoch_setting_id integer not null,
275
+ lottery_indexes json not null,
276
+ signature text not null,
277
+ created_at text not null default current_timestamp,
278
+ primary key (open_message_id, signer_id, registration_epoch_setting_id)
279
+ foreign key (open_message_id) references open_message(open_message_id) on delete cascade
280
+ foreign key (signer_id, registration_epoch_setting_id) references signer_registration(signer_id, epoch_setting_id)
281
+ );
262
282
"# ,
263
283
) ,
264
284
]
Original file line number Diff line number Diff line change @@ -469,13 +469,14 @@ impl DependenciesBuilder {
469
469
dyn StoreAdapter < Key = Beacon , Record = HashMap < PartyId , SingleSignatures > > ,
470
470
> = match self . configuration . environment {
471
471
ExecutionEnvironment :: Production => {
472
- let adapter =
473
- SQLiteAdapter :: new ( "single_signature" , self . get_sqlite_connection ( ) . await ?)
474
- . map_err ( |e| DependenciesBuilderError :: Initialization {
475
- message : "Cannot create SQLite adapter for SingleSignatureStore."
476
- . to_string ( ) ,
477
- error : Some ( e. into ( ) ) ,
478
- } ) ?;
472
+ let adapter = SQLiteAdapter :: new (
473
+ "single_signature_legacy" ,
474
+ self . get_sqlite_connection ( ) . await ?,
475
+ )
476
+ . map_err ( |e| DependenciesBuilderError :: Initialization {
477
+ message : "Cannot create SQLite adapter for SingleSignatureStore." . to_string ( ) ,
478
+ error : Some ( e. into ( ) ) ,
479
+ } ) ?;
479
480
480
481
Box :: new ( adapter)
481
482
}
You can’t perform that action at this time.
0 commit comments