pub struct MigrationRecord {
pub version: String,
pub name: String,
pub state: MigrationState,
pub applied_at: Option<String>,
pub checksum: Option<String>,
pub duration_ms: Option<u64>,
pub error_message: Option<String>,
pub up_sql: Option<String>,
pub down_sql: Option<String>,
}Expand description
A single migration record with metadata.
Fields§
§version: StringVersion identifier (e.g., “001”, “20240115_1030”).
name: StringHuman-readable migration name.
state: MigrationStateCurrent state of this migration.
applied_at: Option<String>ISO-8601 timestamp when migration was applied.
checksum: Option<String>Checksum for migration file verification.
duration_ms: Option<u64>Execution duration in milliseconds.
error_message: Option<String>Error message if migration failed.
up_sql: Option<String>Up SQL preview (for pending migrations).
down_sql: Option<String>Down SQL preview (for applied migrations).
Implementations§
Source§impl MigrationRecord
impl MigrationRecord
Sourcepub fn new(version: impl Into<String>, name: impl Into<String>) -> Self
pub fn new(version: impl Into<String>, name: impl Into<String>) -> Self
Create a new migration record with version and name.
§Example
use sqlmodel_console::renderables::MigrationRecord;
let record = MigrationRecord::new("001", "create_users_table");Sourcepub fn state(self, state: MigrationState) -> Self
pub fn state(self, state: MigrationState) -> Self
Set the migration state.
Sourcepub fn applied_at(self, timestamp: Option<String>) -> Self
pub fn applied_at(self, timestamp: Option<String>) -> Self
Set the applied timestamp.
Sourcepub fn duration_ms(self, duration: Option<u64>) -> Self
pub fn duration_ms(self, duration: Option<u64>) -> Self
Set the execution duration in milliseconds.
Sourcepub fn error_message(self, message: Option<String>) -> Self
pub fn error_message(self, message: Option<String>) -> Self
Set an error message (for failed migrations).
Trait Implementations§
Source§impl Clone for MigrationRecord
impl Clone for MigrationRecord
Source§fn clone(&self) -> MigrationRecord
fn clone(&self) -> MigrationRecord
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 MigrationRecord
impl Debug for MigrationRecord
Source§impl Default for MigrationRecord
impl Default for MigrationRecord
Source§fn default() -> MigrationRecord
fn default() -> MigrationRecord
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for MigrationRecord
impl RefUnwindSafe for MigrationRecord
impl Send for MigrationRecord
impl Sync for MigrationRecord
impl Unpin for MigrationRecord
impl UnwindSafe for MigrationRecord
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