How can i make my cube not be a 3D parallelogram when i rotate it under its parent?

I have a 2 cube game objects. one game object is 3 times longer than the 1st one. The longer one is the parent of the sorter one. I added a script to rotate the smaller one, but the shorter object turns into a parallelogram when i run the game.

the code:

function Update () {

transform.Rotate(Vector3.right,-90*Time.deltaTime);

}

use child.transform.localRotation

you can alternatively use transform.RotateAround()