Source
List<String> errorMessages(SchemaTableDifference tableDiff) {
if (expectedColumn == null && actualColumn != null) {
return [
"Column '${actualColumn.name}' in table '${tableDiff.actualTable.name}' should NOT exist, but is created by migration files"
];
} else if (expectedColumn != null && actualColumn == null) {
return [
"Column '${expectedColumn.name}' in table '${tableDiff.actualTable.name}' should exist, but is NOT created by migration files"
];
}
return differingProperties.map((propertyName) {
var expectedValue =
reflect(expectedColumn).getField(new Symbol(propertyName)).reflectee;
var actualValue =
reflect(actualColumn).getField(new Symbol(propertyName)).reflectee;
return "Column '${expectedColumn.name}' in table '${tableDiff.actualTable.name}' expected "
"'$expectedValue' for '$propertyName', but migration files yield '$actualValue'";
}).toList();
}