Is it possible to apply migrations written in pure SQL? #437
-
I'm coming from Go. I was using Is it possible with Sea orm? I'm using I have a lot of .sql files to apply (in order) after database creation. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
I'm trying to use use sea_orm::{Database};
let db_pool = Database::connect("...").await;
sqlx::migrate!("sql").run(db_pool).await.unwrap(); with Cargo.toml: ...
sqlx = { version = "0.6.1", features = ["runtime-tokio-native-tls", "migrate"] } but the error is:
Can you help me? |
Beta Was this translation helpful? Give feedback.
-
Hey @frederikhors, you'll need to create a You could also define the SeaORM migration in pure SQL like this: https://www.sea-ql.org/SeaORM/docs/migration/writing-migration/#raw-sql |
Beta Was this translation helpful? Give feedback.
Hey @frederikhors, you'll need to create a
sqlx::Connection
for that to work.You could also define the SeaORM migration in pure SQL like this: https://www.sea-ql.org/SeaORM/docs/migration/writing-migration/#raw-sql