Schema constructor

Schema(
  1. List<Table> tables, {
  2. bool foreignkeys = false,
  3. List<Migration> migrations = const [],
})

Implementation

Schema(
  List<Table> tables, {
  this.foreignkeys = false,
  this.migrations = const [],
}) : tables = Map.fromEntries(tables.map((e) => MapEntry(e.name, e))) {
  final versions = migrations.map((e) => e.version).toSet();
  assert(versions.length == migrations.length, 'There are duplicate versions in the migrations. This is not allowed. Please remove the duplicates.');
}