addSchema method

Future addSchema({
  1. Logger? logger,
})

Adds the database tables in context to the database for the application under test.

This method executes database commands to create temporary tables in the test database. It is invoked by resetData.

Implementation

Future addSchema({Logger? logger}) async {
  final builder = SchemaBuilder.toSchema(
      context!.persistentStore, Schema.fromDataModel(context!.dataModel!),
      isTemporary: true);

  for (var cmd in builder.commands) {
    logger?.info("$cmd");
    await context!.persistentStore?.execute(cmd);
  }
}