resetDriverTestSchema function

Future<void> resetDriverTestSchema(
  1. SchemaDriver driver, {
  2. String? schema,
})

Reset the driver test schema by tearing down and setting up again

This is equivalent to dropping all migrations and re-applying them. Uses TestSchemaManager internally.

Example:

await resetDriverTestSchema(driver);

Implementation

Future<void> resetDriverTestSchema(
  SchemaDriver driver, {
  String? schema,
}) async {
  final manager = createDriverTestSchemaManager(driver, schema: schema);
  await manager.teardown();
  await manager.setup();
}