getDefinition method

String getDefinition()

Implementation

String getDefinition() {
  final escapedChildColumns =
      childColumns.map((column) => '`$column`').join(', ');
  final escapedParentColumns =
      parentColumns.map((column) => '`$column`').join(', ');

  return 'FOREIGN KEY ($escapedChildColumns)'
      ' REFERENCES `$parentName` ($escapedParentColumns)'
      ' ON UPDATE ${onUpdate.toSql()}'
      ' ON DELETE ${onDelete.toSql()}';
}