issue with Migrator::up, the trait bound `&sea_orm::DatabaseConnection: IntoSchemaManagerConnection<'_>` is not satisfied
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 9.9k
- Forks
- 734
- Avg merge
- 6h 36m
- Merged PRs (30d)
- 8
Description
Hello guys, just updated to sea_orm version 1 I get the following error while I'm trying to apply migrations at startup
the code is:
I'm using the code inside the doc
let connect_options = sea_orm::ConnectOptions::new("postgres://root:root@localhost/database")
.set_schema_search_path("my_schema") // Override the default schema
.to_owned();
let db = sea_orm::Database::connect(connect_options).await.unwrap();
migration::Migrator::up(&db, None).await.unwrap();
the error is:
the trait bound `&sea_orm::DatabaseConnection: IntoSchemaManagerConnection<'_>` is not satisfied
the following other types implement trait `IntoSchemaManagerConnection<'c>`:
&'c migration::sea_orm::DatabaseConnection
&'c migration::sea_orm::DatabaseTransaction
SchemaManagerConnection<'c>
required by a bound introduced by this call
migrator.rs(230, 12): required by a bound in `migration::MigratorTrait::up`
I've also tried to pass the db to up method with no pointer but still get the same error
I would appreciate a lot if you could help me to fix this.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the startup migration example using ConnectOptions and migration::Migrator::up with PostgreSQL. Inspect the Migrator::up trait signature and the sea-orm and migration crate versions involved, then verify that the documented call compiles and applies migrations without the IntoSchemaManagerConnection error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- postgres, rust
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100