I have found these related issues/pull requests
I was unable to find any related issues
Description
If a migration file has a non-numeric prefix (e.g., a_schema.sql), SQLx produces an error. However, if there is no prefix at all (e.g., schema.sql), no error is produced, and migrate! silently ignores the file. I believe this should either: produce an error (or warning) message like above, for any *.sql file that doesn't follow the required format; or, begin supporting no-prefix migrations.
Reproduction steps
- Write a function to create the SQLite database and run migrations, e.g.
let connect_options = SqliteConnectOptions::new()
.filename("foo.db")
.create_if_missing(true);
let pool = SqlitePoolOptions::new()
.connect_with(connect_options)
.await?;
dbg!(sqlx::migrate!("./migrations/")).run(&pool).await?;
- Create a no-prefix sql file, e.g.
./migrations/schema.sql. Make it create any sort of table or whatever
- Run
- The database file,
foo.db, will be created and initialized, but it will not contain the new table defined in schema.sql. The evaluation of migrate! as shown by dbg! will have an empty migrations field. Additionally, running something like .tables in sqlite3 will only show the _sqlx_migrations table. In other words, the schema.sql file was ignored, silently.
SQLx version
0.9.0
Enabled SQLx features
runtime-tokio, sqlite
Database server and version
SQLite
Operating system
Linux mint 6.8.0-136-generic
Rust version
rustc 1.97.1(8bab26f4f 2026-07-14)
I have found these related issues/pull requests
I was unable to find any related issues
Description
If a migration file has a non-numeric prefix (e.g.,
a_schema.sql), SQLx produces an error. However, if there is no prefix at all (e.g.,schema.sql), no error is produced, andmigrate!silently ignores the file. I believe this should either: produce an error (or warning) message like above, for any*.sqlfile that doesn't follow the required format; or, begin supporting no-prefix migrations.Reproduction steps
./migrations/schema.sql. Make it create any sort of table or whateverfoo.db, will be created and initialized, but it will not contain the new table defined inschema.sql. The evaluation ofmigrate!as shown bydbg!will have an emptymigrationsfield. Additionally, running something like.tablesinsqlite3will only show the_sqlx_migrationstable. In other words, theschema.sqlfile was ignored, silently.SQLx version
0.9.0
Enabled SQLx features
runtime-tokio, sqlite
Database server and version
SQLite
Operating system
Linux mint 6.8.0-136-generic
Rust version
rustc 1.97.1(8bab26f4f 2026-07-14)