Struct schemamama_postgres::PostgresAdapter [] [src]

pub struct PostgresAdapter<'a> {
    // some fields omitted
}

An adapter that allows its migrations to act upon PostgreSQL connection transactions.

Methods

impl<'a> PostgresAdapter<'a>
[src]

fn new(connection: &'a GenericConnection) -> PostgresAdapter<'a>

Create a new migrator tied to a PostgreSQL connection.

fn setup_schema(&self) -> Result<()PostgresError>

Create the tables Schemamama requires to keep track of schema state. If the tables already exist, this function has no operation.

Trait Implementations

impl<'a> Adapter for PostgresAdapter<'a>
[src]

type MigrationType = PostgresMigration

An alias to a specific trait that extends Migration. Typically, the aforementioned trait will declare functions that the adapter will use to migrate upwards and downwards. Read more

type Error = PostgresError

An adapter-specific error type that can be returned from any of this trait's methods.

fn current_version(&self) -> Result<Option<Version>, PostgresError>

Returns the latest migration version, or None if no migrations have been recorded.

fn migrated_versions(&self) -> Result<BTreeSet<Version>, PostgresError>

Returns a set of the versions of all of the currently applied migrations.

fn apply_migration(&self, migration: &PostgresMigration) -> Result<()PostgresError>

Applies the specified migration.

fn revert_migration(&self, migration: &PostgresMigration) -> Result<()PostgresError>

Reverts the specified migration.