From f5c74fa1270ece903f6885d07ec18bc41985104f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Han?= Date: Wed, 23 Sep 2026 15:22:16 +0200 Subject: [PATCH] fix(features): make migration support fully opt-in MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove unconditional migration features from the facade and macro support dependencies. Instead, forward migration support to sqlx-core and enabled database drivers only when the public migrate feature is selected. This preserves existing migrate and CLI behavior while allowing no-default-features consumers to omit migration checksum dependencies. Closes: https://github.com/transact-rs/sqlx/issues/4418 Signed-off-by: Sébastien Han --- Cargo.toml | 2 +- sqlx-macros-core/Cargo.toml | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 3ad344c3f9..d98dd2addf 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -225,7 +225,7 @@ features = ["time", "net", "sync", "fs", "io-util", "rt"] default-features = false [dependencies] -sqlx-core = { workspace = true, features = ["migrate"] } +sqlx-core = { workspace = true } sqlx-macros = { workspace = true, optional = true } sqlx-mysql = { workspace = true, optional = true, default-features = false } diff --git a/sqlx-macros-core/Cargo.toml b/sqlx-macros-core/Cargo.toml index 42bf0f5e8c..0de959f2a1 100644 --- a/sqlx-macros-core/Cargo.toml +++ b/sqlx-macros-core/Cargo.toml @@ -27,7 +27,7 @@ _sqlite = [] # SQLx features derive = [] macros = ["thiserror"] -migrate = ["sqlx-core/migrate"] +migrate = ["sqlx-core/migrate", "sqlx-mysql?/migrate", "sqlx-postgres?/migrate", "sqlx-sqlite?/migrate"] sqlx-toml = ["sqlx-core/sqlx-toml", "sqlx-sqlite?/sqlx-toml"] @@ -56,9 +56,9 @@ uuid = ["sqlx-core/uuid", "sqlx-mysql?/uuid", "sqlx-postgres?/uuid", "sqlx-sqlit [dependencies] sqlx-core = { workspace = true, features = ["offline"] } -sqlx-mysql = { workspace = true, features = ["offline", "migrate"], optional = true, default-features = false } -sqlx-postgres = { workspace = true, features = ["offline", "migrate"], optional = true } -sqlx-sqlite = { workspace = true, features = ["offline", "migrate"], optional = true } +sqlx-mysql = { workspace = true, features = ["offline"], optional = true, default-features = false } +sqlx-postgres = { workspace = true, features = ["offline"], optional = true } +sqlx-sqlite = { workspace = true, features = ["offline"], optional = true } async-global-executor = { workspace = true, optional = true } async-std = { workspace = true, optional = true }