Support naming migrations sequentially (#2602)

* Support naming migrations sequentially and inferring naming scheme

* Document new options and how naming is inferred

* Only account for up migrations when inferring ordering
This commit is contained in:
Max Vorobev
2023-07-25 02:00:26 +03:00
committed by GitHub
parent c70cfaf035
commit f2bb464bcd
4 changed files with 104 additions and 6 deletions

View File

@@ -32,6 +32,14 @@ impl MigrationType {
}
}
pub fn is_up_migration(&self) -> bool {
match self {
MigrationType::Simple => true,
MigrationType::ReversibleUp => true,
MigrationType::ReversibleDown => false,
}
}
pub fn is_down_migration(&self) -> bool {
match self {
MigrationType::Simple => false,