pub struct MigrationTracking {
pub table: Cow<'static, str>,
pub schema: Option<Cow<'static, str>>,
}Expand description
Where applied migrations are recorded: the tracking table and its schema.
Shared by the CLI and the runtime migrator. Each dialect has a default constant; adjust it with the builder methods.
§Examples
use drizzle_types::MigrationTracking;
let tracking = MigrationTracking::POSTGRES.table("schema_history");
assert_eq!(tracking.table, "schema_history");
assert_eq!(tracking.schema.as_deref(), Some("drizzle"));Fields§
§table: Cow<'static, str>Migrations tracking table name.
schema: Option<Cow<'static, str>>Schema of the tracking table (used by PostgreSQL; None elsewhere).
Implementations§
Source§impl MigrationTracking
impl MigrationTracking
Sourcepub fn new(
table: impl Into<Cow<'static, str>>,
schema: Option<impl Into<Cow<'static, str>>>,
) -> Self
pub fn new( table: impl Into<Cow<'static, str>>, schema: Option<impl Into<Cow<'static, str>>>, ) -> Self
Creates tracking metadata from a table name and an optional schema.
Sourcepub fn table(self, table: impl Into<Cow<'static, str>>) -> Self
pub fn table(self, table: impl Into<Cow<'static, str>>) -> Self
Replaces the table name, keeping the schema.
Sourcepub fn schema(self, schema: impl Into<Cow<'static, str>>) -> Self
pub fn schema(self, schema: impl Into<Cow<'static, str>>) -> Self
Sets the schema, keeping the table name.
Sourcepub fn without_schema(self) -> Self
pub fn without_schema(self) -> Self
Removes the schema, keeping the table name.
Trait Implementations§
Source§impl Clone for MigrationTracking
impl Clone for MigrationTracking
Source§impl Debug for MigrationTracking
impl Debug for MigrationTracking
Source§impl Default for MigrationTracking
impl Default for MigrationTracking
impl Eq for MigrationTracking
Source§impl Hash for MigrationTracking
impl Hash for MigrationTracking
Source§impl PartialEq for MigrationTracking
impl PartialEq for MigrationTracking
impl StructuralPartialEq for MigrationTracking
Auto Trait Implementations§
impl Freeze for MigrationTracking
impl RefUnwindSafe for MigrationTracking
impl Send for MigrationTracking
impl Sync for MigrationTracking
impl Unpin for MigrationTracking
impl UnsafeUnpin for MigrationTracking
impl UnwindSafe for MigrationTracking
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