Skip to main content

Migration

Trait Migration 

Source
pub trait Migration<X>
where X: Executor,
{ // Required methods fn name(&self) -> &'static str; fn up<'a>( &'a self, db: &'a X, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + 'a>>; }
Expand description

One migration step. The unique name orders + dedupes it; up performs the change against an executor. Implement this on a struct for bespoke DDL, or use Migrator::create_table for the common “create this entity’s table”.

Required Methods§

Source

fn name(&self) -> &'static str

Source

fn up<'a>( &'a self, db: &'a X, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + 'a>>

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<E, X> Migration<X> for CreateTable<E>
where E: Entity, X: Executor,

Source§

impl<X> Migration<X> for Migration
where X: Executor,