Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
103 changes: 55 additions & 48 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ hightorrent_api = { git = "https://github.com/angrynode/hightorrent_api" }
log = "0.4.27"
# SQLITE MIGRATIONS (WIP)
migration = { path = "migration" }
sea-orm = { version = "1.1", features = [ "runtime-tokio", "debug-print", "sqlx-sqlite"] }
sea-orm = { version = "2.0.0-rc.18", features = [ "runtime-tokio", "debug-print", "sqlx-sqlite"] }
# Serialization/deserialization, for example in path extractors
serde = { version = "1.0.219", features = ["derive", "rc"] }
# (De)serialization for operations log
Expand Down
2 changes: 1 addition & 1 deletion migration/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ path = "src/lib.rs"
async-std = { version = "1", features = ["attributes", "tokio1"] }

[dependencies.sea-orm-migration]
version = "1.1.0"
version = "2.0.0-rc.18"
features = [
# Enable at least one `ASYNC_RUNTIME` and `DATABASE_DRIVER` feature if you want to run migration via CLI.
# View the list of supported features at https://www.sea-ql.org/SeaORM/docs/install-and-config/database-and-async-runtime.
Expand Down
2 changes: 2 additions & 0 deletions src/state/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ pub enum AppStateError {
},
#[snafu(display("Category error"))]
Category { source: CategoryError },
#[snafu(display("Error during migration"))]
Migration { source: migration::DbErr },
}

impl AppStateError {
Expand Down
5 changes: 4 additions & 1 deletion src/state/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,10 @@ impl AppState {
let database = Database::connect(format!("sqlite://{}?mode=rwc", &sqlite_path))
.await
.context(SqliteSnafu)?;
Migrator::up(&database, None).await.unwrap();

Migrator::up(&database, None)
.await
.context(MigrationSnafu)?;

let logger = Logger::new(config.log_path.clone())
.await
Expand Down
Loading