pub struct MigrationManager { /* private fields */ }Expand description
Migration manager coordinates file operations and tracking.
Implementations§
Source§impl MigrationManager
impl MigrationManager
Sourcepub fn new(config: MigrationConfig) -> Result<Self>
pub fn new(config: MigrationConfig) -> Result<Self>
Creates a new migration manager.
Sourcepub fn list_files(&self) -> Result<Vec<MigrationFile>>
pub fn list_files(&self) -> Result<Vec<MigrationFile>>
Lists all migration files in directory.
Sourcepub fn list_pending(&self) -> Result<Vec<MigrationFile>>
pub fn list_pending(&self) -> Result<Vec<MigrationFile>>
Lists pending migrations (not yet applied).
Sourcepub fn create(&self, name: &str) -> Result<MigrationFile>
pub fn create(&self, name: &str) -> Result<MigrationFile>
Creates a new migration file.
Sourcepub fn record_applied(&self, file: &MigrationFile) -> Result<AppliedMigration>
pub fn record_applied(&self, file: &MigrationFile) -> Result<AppliedMigration>
Records a migration as applied.
Sourcepub fn remove_applied(&self, id: u32) -> Result<()>
pub fn remove_applied(&self, id: u32) -> Result<()>
Removes a migration record (for rollback).
Sourcepub fn up_sql(file: &MigrationFile) -> &str
pub fn up_sql(file: &MigrationFile) -> &str
Returns the SQL content for the up migration (before “– Down Migration” marker).
Sourcepub fn down_sql(file: &MigrationFile) -> Option<&str>
pub fn down_sql(file: &MigrationFile) -> Option<&str>
Returns the SQL content for the down migration (after “– Down Migration” marker).
Auto Trait Implementations§
impl Freeze for MigrationManager
impl RefUnwindSafe for MigrationManager
impl Send for MigrationManager
impl Sync for MigrationManager
impl Unpin for MigrationManager
impl UnsafeUnpin for MigrationManager
impl UnwindSafe for MigrationManager
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more