foreignRelationToSql method

String foreignRelationToSql()

Implementation

String foreignRelationToSql() {
  var out = '';

  var noForeignKeys = (createTable?.foreignKeys.isEmpty ?? true) &&
      (alterTable?.addForeignKeys.isEmpty ?? true);

  if (noForeignKeys) return out;

  out += '--\n';
  out += '-- ACTION CREATE FOREIGN KEY\n';
  out += '--\n';

  out += createTable?.foreignRelationToPgsql() ?? '';
  out += alterTable?.foreignRelationToSql() ?? '';

  return out;
}