Run totallyGuarded() once outside of loop.

The boolean returned by totallyGuarded() will never change during the loop. Running the method outside of the foreach avoids one unnecessary count() and two checks for each iteration.
Add database prefix to renameColumn

Fixes an issue where renameColumn throws an exception if a database prefix is set.

Signed-off-by: Suhayb El Wardany <me@suw.me>
Fix spacing.
Adding integer serial types.
Merge pull request #3100 from Youpie/patch-1

Run totallyGuarded() once outside of loop.