[−][src]Function dbq::run_migrations
pub fn run_migrations<C: GenericConnection>(
config: &SchemaConfig,
conn: &C,
advisory_lock_key: Option<i64>
) -> Result<()>
Create the database objects used by dbq. This function is idempotent and should be run on every startup to ensure that the database objects are up to date.
Pass an advisory lock key to wrap migrations in an advisory
lock to prevent errors from multiple migrations being run at once (for
instance, when multiple programs start and run migrations simultaneously).
The advisory lock key must be the same for every call to run_migrations
to prevent conflicts.