File tree 1 file changed +6
-0
lines changed
1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -54,11 +54,17 @@ impl Database for MysqlDatabase {
54
54
UNIQUE (`key`)
55
55
);" , AUTH_KEY_LENGTH as i8 ) ;
56
56
57
+ // When upgrading from < v2.3.0
58
+ let alter_whitelist_table = "ALTER TABLE `whitelist` MODIFY `info_hash` VARCHAR(40);" . to_string ( ) ;
59
+ let alter_torrents_table = "ALTER TABLE `torrents` MODIFY `info_hash` VARCHAR(40);" . to_string ( ) ;
60
+
57
61
let mut conn = self . pool . get ( ) . map_err ( |_| database:: Error :: DatabaseError ) ?;
58
62
59
63
conn. query_drop ( & create_torrents_table) . expect ( "Could not create torrents table." ) ;
60
64
conn. query_drop ( & create_keys_table) . expect ( "Could not create keys table." ) ;
61
65
conn. query_drop ( & create_whitelist_table) . expect ( "Could not create whitelist table." ) ;
66
+ conn. query_drop ( & alter_whitelist_table) . expect ( "Could not alter whitelist table." ) ;
67
+ conn. query_drop ( & alter_torrents_table) . expect ( "Could not alter torrents table." ) ;
62
68
63
69
Ok ( ( ) )
64
70
}
You can’t perform that action at this time.
0 commit comments