File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
src/upgrades/from_v1_0_0_to_v2_0_0 Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -30,9 +30,9 @@ const NUMBER_OF_ARGUMENTS: i64 = 3;
3030
3131#[ derive( Debug ) ]
3232pub struct Arguments {
33- source_database_file : String , // The source database in version v1.0.0 we want to migrate
34- destiny_database_file : String , // The new migrated database in version v2.0.0
35- upload_path : String , // The relative dir where torrent files are stored
33+ pub source_database_file : String , // The source database in version v1.0.0 we want to migrate
34+ pub destiny_database_file : String , // The new migrated database in version v2.0.0
35+ pub upload_path : String , // The relative dir where torrent files are stored
3636}
3737
3838fn print_usage ( ) {
@@ -96,8 +96,9 @@ pub async fn upgrade(args: &Arguments) {
9696 . await ;
9797}
9898
99- async fn current_db ( connect_url : & str ) -> Arc < SqliteDatabaseV1_0_0 > {
100- Arc :: new ( SqliteDatabaseV1_0_0 :: new ( connect_url) . await )
99+ async fn current_db ( db_filename : & str ) -> Arc < SqliteDatabaseV1_0_0 > {
100+ let source_database_connect_url = format ! ( "sqlite://{}?mode=ro" , db_filename) ;
101+ Arc :: new ( SqliteDatabaseV1_0_0 :: new ( & source_database_connect_url) . await )
101102}
102103
103104async fn new_db ( db_filename : & str ) -> Arc < SqliteDatabaseV2_0_0 > {
You can’t perform that action at this time.
0 commit comments