Struct butane_core::migrations::MemMigration
source · pub struct MemMigration { /* private fields */ }
Expand description
A migration stored in memory.
Trait Implementations§
source§impl Clone for MemMigration
impl Clone for MemMigration
source§fn clone(&self) -> MemMigration
fn clone(&self) -> MemMigration
Returns a copy 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 MemMigration
impl Debug for MemMigration
source§impl<'de> Deserialize<'de> for MemMigration
impl<'de> Deserialize<'de> for MemMigration
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Migration for MemMigration
impl Migration for MemMigration
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 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 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 MemMigration
impl MigrationMut for MemMigration
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§fn add_sql(
&mut self,
backend_name: &str,
up_sql: &str,
down_sql: &str
) -> Result<()>
fn add_sql( &mut self, backend_name: &str, up_sql: &str, down_sql: &str ) -> Result<()>
Set the backend-specific commands to apply/undo this migration.
source§impl PartialEq<MemMigration> for MemMigration
impl PartialEq<MemMigration> for MemMigration
source§impl Serialize for MemMigration
impl Serialize for MemMigration
impl Eq for MemMigration
Auto Trait Implementations§
impl RefUnwindSafe for MemMigration
impl Send for MemMigration
impl Sync for MemMigration
impl Unpin for MemMigration
impl UnwindSafe for MemMigration
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