Function diesel::migrations::run_pending_migrations [] [src]

pub fn run_pending_migrations<Conn>(conn: &Conn)
                                    -> Result<(), RunMigrationsError> where Conn: MigrationConnection

Runs all migrations that have not yet been run. This function will print all progress to stdout. This function will return an Err if some error occurs reading the migrations, or if any migration fails to run. Each migration is run in its own transaction, so some migrations may be committed, even if a later migration fails to run.

It should be noted that this runs all migrations that have not already been run, regardless of whether or not their version is later than the latest run migration. This is generally not a problem, and eases the more common case of two developers generating independent migrations on a branch. Whoever created the second one will eventually need to run the first when both branches are merged.

See the module level documentation for information on how migrations should be structured, and where Diesel will look for them by default.