pub struct MigrationPlan {
pub id: String,
pub comment: Option<String>,
pub created_at: Option<String>,
pub version: u32,
pub actions: Vec<MigrationAction>,
}Expand description
A single versioned migration, grouping a set of MigrationActions under a version number.
Migration plans are auto-generated by vespertide revision and stored as JSON or YAML files
in the migrations/ directory. Never create or edit these files manually.
The version field is a monotonically increasing integer. The id is a UUID that guards
against accidental plan substitution when the same version number appears in two different
migration histories.
Fields§
§id: StringUnique identifier for this migration (UUID format). Defaults to empty string for backward compatibility with old migration files.
comment: Option<String>Human-readable description of what this migration does (from -m "message").
created_at: Option<String>ISO 8601 timestamp of when the migration file was generated.
version: u32Monotonically increasing version number, starting at 1.
actions: Vec<MigrationAction>Ordered list of schema changes to apply in this migration.
Implementations§
Source§impl MigrationPlan
impl MigrationPlan
Sourcepub fn with_prefix(self, prefix: &str) -> Self
pub fn with_prefix(self, prefix: &str) -> Self
Apply a prefix to all table names in the migration plan. This modifies all table references in all actions.
Trait Implementations§
Source§impl Clone for MigrationPlan
impl Clone for MigrationPlan
Source§fn clone(&self) -> MigrationPlan
fn clone(&self) -> MigrationPlan
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for MigrationPlan
impl Debug for MigrationPlan
Source§impl<'de> Deserialize<'de> for MigrationPlan
impl<'de> Deserialize<'de> for MigrationPlan
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>,
impl Eq for MigrationPlan
Source§impl JsonSchema for MigrationPlan
impl JsonSchema for MigrationPlan
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl PartialEq for MigrationPlan
impl PartialEq for MigrationPlan
Source§fn eq(&self, other: &MigrationPlan) -> bool
fn eq(&self, other: &MigrationPlan) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for MigrationPlan
impl Serialize for MigrationPlan
impl StructuralPartialEq for MigrationPlan
Auto Trait Implementations§
impl Freeze for MigrationPlan
impl RefUnwindSafe for MigrationPlan
impl Send for MigrationPlan
impl Sync for MigrationPlan
impl Unpin for MigrationPlan
impl UnsafeUnpin for MigrationPlan
impl UnwindSafe for MigrationPlan
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more