Replies: 2 comments 3 replies
-
I ran into the same problem while trying to run an Actix-Web application after integrating Sea-ORM, error[E0277]: the trait bound `&sea_orm::DatabaseConnection: IntoSchemaManagerConnection<'_>` is not satisfied
--> src/main.rs:21:18
|
21 | Migrator::up(&db, None).await.unwrap();
| ------------ ^^^ the trait `IntoSchemaManagerConnection<'_>` is not implemented for `&sea_orm::DatabaseConnection`
| |
| required by a bound introduced by this call
|
= help: the following other types implement trait `IntoSchemaManagerConnection<'c>`:
&'c migration::sea_orm::DatabaseConnection
&'c migration::sea_orm::DatabaseTransaction
SchemaManagerConnection<'c>
note: required by a bound in `migration::MigratorTrait::up`
--> C:\Users\Shaphil\.cargo\registry\src\index.crates.io-6f17d22bba15001f\sea-orm-migration-0.12.15\src\migrator.rs:230:12
|
228 | async fn up<'c, C>(db: C, steps: Option<u32>) -> Result<(), DbErr>
| -- required by a bound in this associated function
229 | where
230 | C: IntoSchemaManagerConnection<'c>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `MigratorTrait::up`
For more information about this error, try `rustc --explain E0277`.
error: could not compile `rust-actix` (bin "rust-actix") due to 1 previous error This is the line that produces the error, Migrator::up(&db, None).await.unwrap(); The application runs fine if I comment out that line. I am also using sea-orm = { version = "1.0.0", features = ["sqlx-postgres", "runtime-tokio-rustls", "macros"] } Here is the I was following along a tutorial on Youtube, https://www.youtube.com/watch?v=ENgFBKTBqDU&list=PLGOIZXklfFkRh8jHNY8070KUl86Tj3Ztf and, this guide for integration, https://www.sea-ql.org/SeaORM/docs/migration/setting-up-migration/#app-crate What am I doing wrong, and how can I fix this? |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Question
I try to run migration at application startup when I reading this document.
sea-orm: ver1.0.0
I am having trouble performing the migration because of this error.
Can I just implement it myself to avoid the error?
Beta Was this translation helpful? Give feedback.
All reactions