pub struct Migration {
pub id: String,
pub name: String,
pub sql: String,
pub created_at: DateTime<Utc>,
pub executed_at: Option<DateTime<Utc>>,
}
Expand description
Represents a database migration
A migration contains the SQL statements needed to evolve the database schema along with metadata for tracking execution history.
§Examples
use libsql_orm::{Migration, MigrationBuilder};
let migration = MigrationBuilder::new("create_users_table")
.up("CREATE TABLE users (id INTEGER PRIMARY KEY, name TEXT NOT NULL)")
.down("DROP TABLE users")
.build();
Fields§
§id: String
§name: String
§sql: String
§created_at: DateTime<Utc>
§executed_at: Option<DateTime<Utc>>
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Migration
impl<'de> Deserialize<'de> for Migration
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
Auto Trait Implementations§
impl Freeze for Migration
impl RefUnwindSafe for Migration
impl Send for Migration
impl Sync for Migration
impl Unpin for Migration
impl UnwindSafe for Migration
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