From 1a53665321965bf5c2532e48e0312ea130df6b7b Mon Sep 17 00:00:00 2001 From: gabatxo1312 Date: Fri, 14 Nov 2025 13:43:24 +0100 Subject: [PATCH] Update seaorm to 2.0.0-rc.18 --- Cargo.lock | 103 +++++++++++++++++++++++-------------------- Cargo.toml | 2 +- migration/Cargo.toml | 2 +- src/state/error.rs | 2 + src/state/mod.rs | 5 ++- 5 files changed, 63 insertions(+), 51 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6d95c34..261f3e8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1158,20 +1158,6 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" -[[package]] -name = "futures" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876" -dependencies = [ - "futures-channel", - "futures-core", - "futures-io", - "futures-sink", - "futures-task", - "futures-util", -] - [[package]] name = "futures-channel" version = "0.3.31" @@ -1686,6 +1672,15 @@ dependencies = [ "serde", ] +[[package]] +name = "indoc" +version = "2.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79cf5c93f93228cf8efb3ba362535fb11199ac548a09ce117c9b1adc3030d706" +dependencies = [ + "rustversion", +] + [[package]] name = "inherent" version = "1.0.13" @@ -1749,6 +1744,15 @@ version = "1.70.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" +[[package]] +name = "itertools" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b192c782037fadd9cfa75548310488aabdbf3d2da73885b31bd0abd03351285" +dependencies = [ + "either", +] + [[package]] name = "itoa" version = "1.0.15" @@ -2738,9 +2742,9 @@ dependencies = [ [[package]] name = "sea-orm" -version = "1.1.17" +version = "2.0.0-rc.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "699b1ec145a6530c8f862eed7529d8a6068392e628d81cc70182934001e9c2a3" +checksum = "fd92b1f5f1a6bee6f51523dbd030c5f617e65da6caf312f166dabb404806db86" dependencies = [ "async-stream", "async-trait", @@ -2748,13 +2752,15 @@ dependencies = [ "chrono", "derive_more", "futures-util", + "itertools", "log", "ouroboros", "pgvector", "rust_decimal", "sea-orm-macros", "sea-query", - "sea-query-binder", + "sea-query-sqlx", + "sea-schema", "serde", "serde_json", "sqlx", @@ -2768,14 +2774,15 @@ dependencies = [ [[package]] name = "sea-orm-cli" -version = "1.1.17" +version = "2.0.0-rc.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "500cd31ebb07814d4c7b73796708bfab6c13d22f8db072cdb5115f967f4d5d2c" +checksum = "669479531f1422edde78327b24b32f652a9417f5942935737a7d7c7d31e5a1a9" dependencies = [ "chrono", "clap", "dotenvy", "glob", + "indoc", "regex", "sea-schema", "sqlx", @@ -2787,9 +2794,9 @@ dependencies = [ [[package]] name = "sea-orm-macros" -version = "1.1.17" +version = "2.0.0-rc.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0c964f4b7f34f53decf381bc88f03187b9355e07f356ce65544626e781a9585" +checksum = "07e65b4d10f02744f19c203f2e02fac65bc718efdd98636ea445f0a8f1ee0c1d" dependencies = [ "heck 0.5.0", "proc-macro2", @@ -2801,9 +2808,9 @@ dependencies = [ [[package]] name = "sea-orm-migration" -version = "1.1.17" +version = "2.0.0-rc.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "977e3f71486b04371026d1ecd899f49cf437f832cd11d463f8948ee02e47ed9e" +checksum = "4c70fc91069ee40ebecc35bb671adedbd5fd9352d9b09eeed228490df7934e78" dependencies = [ "async-trait", "clap", @@ -2817,9 +2824,9 @@ dependencies = [ [[package]] name = "sea-query" -version = "0.32.7" +version = "1.0.0-rc.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a5d1c518eaf5eda38e5773f902b26ab6d5e9e9e2bb2349ca6c64cf96f80448c" +checksum = "30d190945ff6b2914ef0631c1933ef67ee142b15f00b72d40bf241147d24b522" dependencies = [ "bigdecimal", "chrono", @@ -2833,10 +2840,24 @@ dependencies = [ ] [[package]] -name = "sea-query-binder" -version = "0.7.0" +name = "sea-query-derive" +version = "1.0.0-rc.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0019f47430f7995af63deda77e238c17323359af241233ec768aba1faea7608" +checksum = "365d236217f5daa4f40d3c9998ff3921351b53472da50308e384388162353b3a" +dependencies = [ + "darling", + "heck 0.4.1", + "proc-macro2", + "quote", + "syn 2.0.106", + "thiserror", +] + +[[package]] +name = "sea-query-sqlx" +version = "0.8.0-rc.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68873fa1776b4c25a26e7679f8ee22332978c721168ec1b0b32b6583d5a9381d" dependencies = [ "bigdecimal", "chrono", @@ -2848,29 +2869,15 @@ dependencies = [ "uuid", ] -[[package]] -name = "sea-query-derive" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bae0cbad6ab996955664982739354128c58d16e126114fe88c2a493642502aab" -dependencies = [ - "darling", - "heck 0.4.1", - "proc-macro2", - "quote", - "syn 2.0.106", - "thiserror", -] - [[package]] name = "sea-schema" -version = "0.16.2" +version = "0.17.0-rc.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2239ff574c04858ca77485f112afea1a15e53135d3097d0c86509cef1def1338" +checksum = "da2e92a98855cfdc2e32daac3f48517a3d9911209db012e5c74af1ff13a24946" dependencies = [ - "futures", + "async-trait", "sea-query", - "sea-query-binder", + "sea-query-sqlx", "sea-schema-derive", "sqlx", ] @@ -3402,9 +3409,9 @@ checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "strum" -version = "0.26.3" +version = "0.27.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fec0f0aef304996cf250b31b5a10dee7980c85da9d759361292b8bca5a18f06" +checksum = "af23d6f6c1a224baef9d3f61e287d2761385a5b88fdab4eb4c6f11aeb54c4bcf" [[package]] name = "subtle" diff --git a/Cargo.toml b/Cargo.toml index 4aed25f..aef12c0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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 diff --git a/migration/Cargo.toml b/migration/Cargo.toml index 9d7b7a0..9319d17 100644 --- a/migration/Cargo.toml +++ b/migration/Cargo.toml @@ -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. diff --git a/src/state/error.rs b/src/state/error.rs index f2efa0f..f265de5 100644 --- a/src/state/error.rs +++ b/src/state/error.rs @@ -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 { diff --git a/src/state/mod.rs b/src/state/mod.rs index 44cfde2..8181641 100644 --- a/src/state/mod.rs +++ b/src/state/mod.rs @@ -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