foreign method
void
foreign(})
Implementation
@override
void foreign(
String columnName,
String referencesTable,
String referencesColumn, {
bool constrained = true,
String onUpdate = 'CASCADE',
String onDelete = 'CASCADE',
}) {
String constraint = '';
if (constrained) {
constraint = 'CONSTRAINT FK_${_tableName}_$referencesTable ';
}
final fk =
'${constraint}FOREIGN KEY (`$columnName`) REFERENCES `$referencesTable` (`$referencesColumn`) ON UPDATE $onUpdate ON DELETE $onDelete';
_foreignKeys.add(fk);
}