You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/upgrades/from_v1_0_0_to_v2_0_0/upgrader.rs
+49-10Lines changed: 49 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -1,15 +1,51 @@
1
-
//! It updates the application from version v1.0.0 to v2.0.0.
1
+
//! A console command to upgrade the application from version `v1.0.0` to `v2.0.0`.
2
+
//!
3
+
//! # Usage
4
+
//!
5
+
//! ```bash
6
+
//! cargo run --bin upgrade SOURCE_DB_FILE TARGET_DB_FILE TORRENT_UPLOAD_DIR
7
+
//! ```
8
+
//!
9
+
//! Where:
10
+
//!
11
+
//! - `SOURCE_DB_FILE` is the source database in version `v1.0.0` we want to migrate.
12
+
//! - `TARGET_DB_FILE` is the new migrated database in version `v2.0.0`.
13
+
//! - `TORRENT_UPLOAD_DIR` is the relative dir where torrent files are stored.
14
+
//!
15
+
//! For example:
16
+
//!
17
+
//! ```bash
18
+
//! cargo run --bin upgrade ./data.db ./data_v2.db ./uploads
19
+
//! ```
20
+
//!
21
+
//! This command was created to help users to migrate from version `v1.0.0` to
22
+
//! `v2.0.0`. The main changes in version `v2.0.0` were:
23
+
//!
24
+
//! - The database schema was changed.
25
+
//! - The torrents are now stored entirely in the database. The torrent files
26
+
//! are not stored in the filesystem anymore. This command reads the torrent
27
+
//! files from the filesystem and store them in the database.
28
+
//!
29
+
//! We recommend to download your production database and the torrent files dir.
30
+
//! And run the command in a local environment with the version `v2.0.0.`. Then,
31
+
//! you can run the app locally and make sure all the data was migrated
32
+
//! correctly.
33
+
//!
34
+
//! # Notes
2
35
//!
3
36
//! NOTES for `torrust_users` table transfer:
4
37
//!
5
-
//! - In v2, the table `torrust_user` contains a field `date_registered` non existing in v1.
6
-
//! We changed that columns to allow NULL. We also added the new column `date_imported` with
7
-
//! the datetime when the upgrader was executed.
38
+
//! - In v2, the table `torrust_user` contains a field `date_registered` non
39
+
//! existing in v1. We changed that column to allow `NULL`. We also added the
40
+
//! new column `date_imported` with the datetime when the upgrader was executed.
8
41
//!
9
42
//! NOTES for `torrust_user_profiles` table transfer:
10
43
//!
11
-
//! - In v2, the table `torrust_user_profiles` contains two new fields: `bio` and `avatar`.
12
-
//! Empty string is used as default value.
44
+
//! - In v2, the table `torrust_user_profiles` contains two new fields: `bio`
45
+
//! and `avatar`. Empty string is used as default value.
46
+
//!
47
+
//!
48
+
//! If you want more information about this command you can read the [issue 56](https://github.com/torrust/torrust-index-backend/issues/56).
0 commit comments