SeaQL / SeaQL/sea-orm

issue with Migrator::up, the trait bound `&sea_orm::DatabaseConnection: IntoSchemaManagerConnection<'_>` is not satisfied

Open
#2,341 4 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

needs-repro
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.