#4299·sqlx

Using `--source` with `sqlx migrate add -r` does not create up and down SQL files

Author: bearbeareanCreated Jun 4, 2026Updated Sep 11, 2026
Labelsbug

I have found these related issues/pull requests

#1565

Description

When using sqlx migrate add and the -r option to create .up.sql and .down.sql files, also adding --source will cause it to only create a single SQL file without .up or .down.

Reproduction steps

Without --source specified:

$ sqlx migrate add -r test                        
Creating migrations/20260604143750_test.up.sql
Creating migrations/20260604143750_test.down.sql

With --source specified:

$ sqlx migrate add --source db/migrations -r test
Creating db/migrations/20260604143914_test.sql

SQLx version

SQLx 0.9.0 and sqlx-cli 0.8.6

Enabled SQLx features

["derive", "macros", "migrate", "runtime-tokio", "sqlite"]

Database server and version

Sqlite

Operating system

NixOS 26.05

Rust version

rustc 1.96.0 (ac68faa20 2026-05-25)