fix(migrate): use Statement::from_string in down method for SeaORM 2.0
Some checks are pending
CI / Rust Tests (push) Waiting to run
CI / Frontend Lint & Type Check (push) Waiting to run
CI / Rust Lint & Check (push) Waiting to run
CI / Frontend Build (push) Blocked by required conditions

This commit is contained in:
ZhenYi 2026-04-20 16:02:18 +08:00
parent eba75ee359
commit 3c8e9e3674

View File

@ -20,10 +20,10 @@ impl MigrationTrait for Migration {
async fn down(&self, manager: &SchemaManager) -> Result<(), DbErr> { async fn down(&self, manager: &SchemaManager) -> Result<(), DbErr> {
manager manager
.get_connection() .get_connection()
.execute_raw( .execute_raw(sea_orm::Statement::from_string(
sea_orm::DbBackend::Postgres, sea_orm::DbBackend::Postgres,
"ALTER TABLE room_message DROP COLUMN IF EXISTS model_id;", "ALTER TABLE room_message DROP COLUMN IF EXISTS model_id;",
) ))
.await?; .await?;
Ok(()) Ok(())
} }