toJsonForProtocol method
Returns a JSON structure of the model, optimized for Protocol communication.
Implementation
@override
Map<String, dynamic> toJsonForProtocol() {
return {
'name': name,
if (dartName != null) 'dartName': dartName,
if (module != null) 'module': module,
'schema': schema,
'addColumns':
addColumns.toJson(valueToJson: (v) => v.toJsonForProtocol()),
'deleteColumns': deleteColumns.toJson(),
'modifyColumns':
modifyColumns.toJson(valueToJson: (v) => v.toJsonForProtocol()),
'addIndexes':
addIndexes.toJson(valueToJson: (v) => v.toJsonForProtocol()),
'deleteIndexes': deleteIndexes.toJson(),
'addForeignKeys':
addForeignKeys.toJson(valueToJson: (v) => v.toJsonForProtocol()),
'deleteForeignKeys': deleteForeignKeys.toJson(),
'warnings': warnings.toJson(valueToJson: (v) => v.toJsonForProtocol()),
};
}