Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wildonion opened this issue Aug 29, 2024 · 2 comments

Comments

@wildonion
Copy link

wildonion commented Aug 29, 2024

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.

@sontixyou
Copy link

I got the same error.
#2311

@wildonion
Copy link
Author

it seems that we should downgrade version below than 1 until they implement IntoSchemaManagerConnection trait for the for the database connection pointer.
thanks.

I got the same error. #2311

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants