Struct migrant_lib::migration::EmbeddedMigration [] [src]

pub struct EmbeddedMigration {
    pub tag: String,
    pub up: Option<&'static str>,
    pub down: Option<&'static str>,
}

Define an embedded migration

SQL statements provided to EmbeddedMigration will be embedded in the executable so no files are required at run-time. The standard include_str! macro can be used to embed contents of files. Database specific features (d-postgres/d-sqlite/d-mysql) are required to use this functionality.

Example

EmbeddedMigration::with_tag("initial")?
    .up(include_str!("../migrations/embedded/initial/up.sql"))
    .down(include_str!("../migrations/embedded/initial/down.sql"));

Fields

Methods

impl EmbeddedMigration
[src]

[src]

Create a new EmbeddedMigration with the given tag

Tags may contain [a-z0-9-]

[src]

Statement to use for up migrations

[src]

Statement to use for down migrations

[src]

Box this migration up so it can be stored with other migrations

Trait Implementations

impl Clone for EmbeddedMigration
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl Debug for EmbeddedMigration
[src]

[src]

Formats the value using the given formatter.

impl Migratable for EmbeddedMigration
[src]

[src]

Define functionality that runs for up migrations

[src]

Define functionality that runs for down migrations

[src]

A unique identifying tag

[src]

Option migration description. Defaults to Migratable::tag