Add version information for failed cli migration (#3129) (#3130)

This commit is contained in:
Maciej Flak
2024-04-05 06:45:21 +02:00
committed by GitHub
parent 0aae849657
commit 45b5b61d7b
4 changed files with 15 additions and 3 deletions

View File

@@ -142,7 +142,10 @@ CREATE TABLE IF NOT EXISTS _sqlx_migrations (
// The `execution_time` however can only be measured for the whole transaction. This value _only_ exists for
// data lineage and debugging reasons, so it is not super important if it is lost. So we initialize it to -1
// and update it once the actual transaction completed.
let _ = tx.execute(&*migration.sql).await?;
let _ = tx
.execute(&*migration.sql)
.await
.map_err(|e| MigrateError::ExecuteMigration(e, migration.version))?;
// language=SQL
let _ = query(