renderTableOptions method

  1. @override
List<String> renderTableOptions(
  1. String tableName, {
  2. String? engine,
  3. String? charset,
  4. String? collation,
  5. String? comment,
  6. int? autoIncrement,
})
override

Renders table-level options set through TableDefinition (engine, charset, collation, comment, auto-increment seed). Most of these are MySQL-only; adapters return an empty list for options their engine has no equivalent for, so a migration stays portable across drivers.

Implementation

@override
List<String> renderTableOptions(
  String tableName, {
  String? engine,
  String? charset,
  String? collation,
  String? comment,
  int? autoIncrement,
}) {
  // ENGINE / CHARSET / COLLATE / AUTO_INCREMENT have no PostgreSQL
  // equivalent; only the comment survives.
  if (comment == null) return const [];
  return [
    'COMMENT ON TABLE ${escapeIdentifier(tableName)} IS '
        '${formatValue(comment)}',
  ];
}