Skip to content

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

@bearbearean

Description

@bearbearean

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions