I want to rename a table as part of a migration, but only if the table has not been renamed already. I'm currently running:
ALTER TABLE IF EXISTS old_name RENAME TO new_name
however, if new_name already exists it will still run. Is there a way to run this statement if and only if new_name does not exist?