getAction static method

String getAction(
  1. ForeignKeyAction action,
  2. String type
)

Implementation

static String getAction(
  ForeignKeyAction action,

  /// `Update` , `Delete`
  String type,
) {
  String query = '';
  if (action == ForeignKeyAction.setnull) {
    query += ' ON ${type.toUpperCase()} SET NULL ';
  } else if (action == ForeignKeyAction.restrict) {
    query += ' ON ${type.toUpperCase()} RESTRICT ';
  } else if (action == ForeignKeyAction.setCascade) {
    query += ' ON ${type.toUpperCase()} CASCADE ';
  } else if (action == ForeignKeyAction.setDefault) {
    query += ' ON ${type.toUpperCase()} SET DEFAULT ';
  } else if (action == ForeignKeyAction.setnoAction) {
    query += ' ON ${type.toUpperCase()} NO ACTION ';
  }
  return query;
}