protected function isRelationTable($table)
{
$pk = $table->primaryKey;
return count($pk) === 2 && isset($table->foreignKeys[$pk[0]]) && isset($table->foreignKeys[$pk[1]]) && $table->foreignKeys[$pk[0]][0] !== $table->foreignKeys[$pk[1]][0];
// and the foreign keys point different tables
}