pub struct FsMigration { /* private fields */ }Expand description
A migration stored in the filesystem.
Implementations§
Trait Implementations§
Source§impl Clone for FsMigration
impl Clone for FsMigration
Source§fn clone(&self) -> FsMigration
fn clone(&self) -> FsMigration
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FsMigration
impl Debug for FsMigration
Source§impl Migration for FsMigration
impl Migration for FsMigration
Source§fn db(&self) -> Result<ADB, Error>
fn db(&self) -> Result<ADB, Error>
Retrieves the full abstract database state describing all tables
Source§fn migration_from(&self) -> Result<Option<Cow<'_, str>>, Error>
fn migration_from(&self) -> Result<Option<Cow<'_, str>>, Error>
Get the name of the migration before this one (if any).
Source§fn up_sql(&self, backend_name: &str) -> Result<Option<String>, Error>
fn up_sql(&self, backend_name: &str) -> Result<Option<String>, Error>
The backend-specific commands to apply this migration.
Source§fn down_sql(&self, backend_name: &str) -> Result<Option<String>, Error>
fn down_sql(&self, backend_name: &str) -> Result<Option<String>, Error>
The backend-specific commands to undo this migration.
Source§fn sql_backends(&self) -> Result<Vec<String>, Error>
fn sql_backends(&self) -> Result<Vec<String>, Error>
The names of the backends this migration has sql for.
Source§fn apply(&self, conn: &mut impl BackendConnection) -> Result<(), Error>
fn apply(&self, conn: &mut impl BackendConnection) -> Result<(), Error>
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<(), Error>
fn mark_applied(&self, conn: &impl ConnectionMethods) -> Result<(), Error>
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<(), Error>
fn set_migration_from(&mut self, prev: Option<String>) -> Result<(), Error>
Set the migration before this one.
Source§fn add_modified_table(&mut self, table: &ATable) -> Result<(), Error>
fn add_modified_table(&mut self, table: &ATable) -> Result<(), Error>
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, if they were modified in this migration.
Source§fn add_unmodified_table(
&mut self,
table: &ATable,
from_migration_name: &str,
) -> Result<(), Error>
fn add_unmodified_table( &mut self, table: &ATable, from_migration_name: &str, ) -> Result<(), Error>
Marks a table as not modified in this migration.
Use instead of
add_modified_table.Source§fn delete_table(&mut self, table: &str) -> Result<(), Error>
fn delete_table(&mut self, table: &str) -> Result<(), Error>
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§fn add_sql(
&mut self,
backend_name: &str,
up_sql: &str,
down_sql: &str,
) -> Result<(), Error>
fn add_sql( &mut self, backend_name: &str, up_sql: &str, down_sql: &str, ) -> Result<(), Error>
Set the backend-specific commands to apply/undo this migration.
Source§impl PartialEq for FsMigration
impl PartialEq for FsMigration
impl Eq for FsMigration
Auto Trait Implementations§
impl Freeze for FsMigration
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