Skip to main content

migrate

Function migrate 

Source
pub async fn migrate<D, Q, I, F>(
    db: &D,
    migrations: I,
    migration_table: Option<&str>,
    logger: Option<F>,
) -> Result<(), Error>
where D: DatabaseExecutor, Q: Query + MigrationMeta + Clone, I: IntoIterator<Item = Migration<Q>>, F: Fn(&str),
Expand description

Executes database migrations.

ยงArguments

  • db - The database executor.
  • migrations - A list of migrations to apply.
  • migration_table - Optional custom name for the migration tracking table. Defaults to _d1_migrations.
  • logger - Optional callback for logging migration progress.