ForeignKeyDefinition.fromJson constructor

ForeignKeyDefinition.fromJson(
  1. Map<String, dynamic> jsonSerialization
)

Implementation

factory ForeignKeyDefinition.fromJson(
    Map<String, dynamic> jsonSerialization) {
  return ForeignKeyDefinition(
    constraintName: jsonSerialization['constraintName'] as String,
    columns: (jsonSerialization['columns'] as List)
        .map((e) => e as String)
        .toList(),
    referenceTable: jsonSerialization['referenceTable'] as String,
    referenceTableSchema: jsonSerialization['referenceTableSchema'] as String,
    referenceColumns: (jsonSerialization['referenceColumns'] as List)
        .map((e) => e as String)
        .toList(),
    onUpdate: jsonSerialization['onUpdate'] == null
        ? null
        : _i2.ForeignKeyAction.fromJson(
            (jsonSerialization['onUpdate'] as int)),
    onDelete: jsonSerialization['onDelete'] == null
        ? null
        : _i2.ForeignKeyAction.fromJson(
            (jsonSerialization['onDelete'] as int)),
    matchType: jsonSerialization['matchType'] == null
        ? null
        : _i2.ForeignKeyMatchType.fromJson(
            (jsonSerialization['matchType'] as int)),
  );
}