mirror of
https://github.com/launchbadge/sqlx.git
synced 2025-12-29 21:00:54 +00:00
parent
0aae849657
commit
45b5b61d7b
@ -6,6 +6,9 @@ pub enum MigrateError {
|
||||
#[error("while executing migrations: {0}")]
|
||||
Execute(#[from] Error),
|
||||
|
||||
#[error("while executing migration {1}: {0}")]
|
||||
ExecuteMigration(#[source] Error, i64),
|
||||
|
||||
#[error("while resolving migrations: {0}")]
|
||||
Source(#[source] BoxDynError),
|
||||
|
||||
|
||||
@ -199,7 +199,10 @@ CREATE TABLE IF NOT EXISTS _sqlx_migrations (
|
||||
.execute(&mut *tx)
|
||||
.await?;
|
||||
|
||||
let _ = tx.execute(&*migration.sql).await?;
|
||||
let _ = tx
|
||||
.execute(&*migration.sql)
|
||||
.await
|
||||
.map_err(|e| MigrateError::ExecuteMigration(e, migration.version))?;
|
||||
|
||||
// language=MySQL
|
||||
let _ = query(
|
||||
|
||||
@ -216,7 +216,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(
|
||||
|
||||
@ -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(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user