1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
//! # soma-schema
//!
//! A standalone Postgres migration tool — plain SQL files with `UP`/`DOWN` sections,
//! manifest-driven ordering, SHA-256 checksum drift detection, and advisory-lock safety
//! to prevent concurrent `up`/`down` runs.
//!
//! **Differentiators:** (1) manifest-first ordering (not filename-lexical) for FK-safe
//! rollback; (2) checksum on the full raw file (UP + DOWN) so even editing the DOWN
//! section of an applied migration is caught; (3) apply + track in a single transaction
//! (no split state on crash); (4) advisory lock scoped to the whole `up`/`down` call
//! (not per-migration).
//!
//! ## Quick start
//!
//! ```no_run
//! # use soma_schema::{Migrator, PostgresConfig, PostgresDriver};
//! # async fn run() -> soma_schema::Result<()> {
//! let pool = sqlx::PgPool::connect("postgres://localhost/mydb").await?;
//! let config = PostgresConfig {
//! schema: Some("app".into()),
//! ..Default::default()
//! };
//! let driver = PostgresDriver::new(pool, config)?;
//! let migrator = Migrator::from_root("migrations");
//! migrator.up(&driver).await?;
//! # Ok(())
//! # }
//! ```
pub use discover;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;