toJson method

Map<String, Object?> toJson()

Implementation

Map<String, Object?> toJson() => {
  'table': table,
  'operation': operation.name,
  if (temporary) 'temporary': true,
  if (engine != null) 'engine': engine,
  if (tableCharset != null) 'charset': tableCharset,
  if (tableCollation != null) 'collation': tableCollation,
  if (_tableComment != null) 'comment': _tableComment,
  'columns': columns.map((c) => c.toJson()).toList(),
  if (_renamedColumns.isNotEmpty)
    'renamedColumns': _renamedColumns.map((r) => r.toJson()).toList(),
  if (_indexes.isNotEmpty || _droppedIndexes.isNotEmpty)
    'indexes': indexes.map((i) => i.toJson()).toList(),
  if (_foreignKeys.isNotEmpty || _droppedForeignKeys.isNotEmpty)
    'foreignKeys': foreignKeys.map((f) => f.toJson()).toList(),
};