Struct butane_core::migrations::FsMigration
source · pub struct FsMigration { /* private fields */ }
Expand description
A migration stored in the filesystem
Implementations§
Trait Implementations§
source§impl Debug for FsMigration
impl Debug for FsMigration
source§impl Migration for FsMigration
impl Migration for FsMigration
source§fn migration_from(&self) -> Result<Option<Cow<'_, str>>>
fn migration_from(&self) -> Result<Option<Cow<'_, str>>>
Get the name of the migration before this one (if any).
source§fn up_sql(&self, backend_name: &str) -> Result<Option<String>>
fn up_sql(&self, backend_name: &str) -> Result<Option<String>>
The backend-specific commands to apply this migration.
source§fn down_sql(&self, backend_name: &str) -> Result<Option<String>>
fn down_sql(&self, backend_name: &str) -> Result<Option<String>>
The backend-specific commands to undo this migration.
source§fn sql_backends(&self) -> Result<Vec<String>>
fn sql_backends(&self) -> Result<Vec<String>>
The names of the backends this migration has sql for.
source§fn apply(&self, conn: &mut impl BackendConnection) -> Result<()>
fn apply(&self, conn: &mut impl BackendConnection) -> Result<()>
Apply the migration to a database connection. The connection
must be for the same type of database as this and the database
must be in the state of the migration prior to this one
source§fn mark_applied(&self, conn: &impl ConnectionMethods) -> Result<()>
fn mark_applied(&self, conn: &impl ConnectionMethods) -> Result<()>
Mark the migration as being applied without doing any
work. Use carefully – the caller must ensure that the
database schema already matches that expected by this
migration.
source§impl MigrationMut for FsMigration
impl MigrationMut for FsMigration
source§fn set_migration_from(&mut self, prev: Option<String>) -> Result<()>
fn set_migration_from(&mut self, prev: Option<String>) -> Result<()>
Set the migration before this one.
source§fn write_table(&mut self, table: &ATable) -> Result<()>
fn write_table(&mut self, table: &ATable) -> Result<()>
Adds an abstract table to the migration. The table state should
represent the expected state after the migration has been
applied. It is expected that all tables will be added to the
migration in this fashion.
source§fn delete_table(&mut self, table: &str) -> Result<()>
fn delete_table(&mut self, table: &str) -> Result<()>
Delete the table with the given name. Note that simply
deleting a table in code does not work – it will remain with
its last known schema unless explicitly deleted. See also the
butane cli command
butane delete table <TABLE>
.source§impl PartialEq<FsMigration> for FsMigration
impl PartialEq<FsMigration> for FsMigration
impl Eq for FsMigration
Auto Trait Implementations§
impl !RefUnwindSafe for FsMigration
impl !Send for FsMigration
impl !Sync for FsMigration
impl Unpin for FsMigration
impl !UnwindSafe for FsMigration
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