mirror of
https://github.com/launchbadge/sqlx.git
synced 2025-11-16 21:37:45 +00:00
* fix(macros): tell the compiler about external files/env vars to watch closes #663 closes #681 * feat(cli): add `migrate` subcommand for generating a build script suggest embedding migrations on `sqlx migrate add` in a new project
21 lines
588 B
Rust
21 lines
588 B
Rust
use sqlx::migrate::Migrator;
|
|
use std::path::Path;
|
|
|
|
static EMBEDDED: Migrator = sqlx::migrate!("tests/migrate/migrations");
|
|
|
|
#[sqlx_macros::test]
|
|
async fn same_output() -> anyhow::Result<()> {
|
|
let runtime = Migrator::new(Path::new("tests/migrate/migrations")).await?;
|
|
|
|
assert_eq!(runtime.migrations.len(), EMBEDDED.migrations.len());
|
|
|
|
for (e, r) in EMBEDDED.iter().zip(runtime.iter()) {
|
|
assert_eq!(e.version, r.version);
|
|
assert_eq!(e.description, r.description);
|
|
assert_eq!(e.sql, r.sql);
|
|
assert_eq!(e.checksum, r.checksum);
|
|
}
|
|
|
|
Ok(())
|
|
}
|