File tree Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ impl Migrator {
27
27
/// # })
28
28
/// # }
29
29
/// ```
30
+ /// See [MigrationSource] for details on structure of the `./migrations` directory.
30
31
pub async fn new < ' s , S > ( source : S ) -> Result < Self , MigrateError >
31
32
where
32
33
S : MigrationSource < ' s > ,
Original file line number Diff line number Diff line change @@ -11,6 +11,12 @@ pub trait MigrationSource<'s>: Debug {
11
11
fn resolve ( self ) -> BoxFuture < ' s , Result < Vec < Migration > , BoxDynError > > ;
12
12
}
13
13
14
+ /// Implementation of the `MigrationSource` for [std::path::Path].
15
+ ///
16
+ /// The path has to point to a directory, which contains the migration SQL scripts. All these
17
+ /// scripts must be stored in files with names using the format `<VERSION>_<DESCRIPTION>.sql`,
18
+ /// where `<VERSION>` is a string that can be parsed into `i64` and its value is greater than zero,
19
+ /// and `<DESCRIPTION>` is a string.
14
20
impl < ' s > MigrationSource < ' s > for & ' s Path {
15
21
fn resolve ( self ) -> BoxFuture < ' s , Result < Vec < Migration > , BoxDynError > > {
16
22
Box :: pin ( async move {
You can’t perform that action at this time.
0 commit comments