code: public function renameTable($table, $newName)
      {
          $time = $this->beginCommand("rename table $table to $newName");
          $this->db->createCommand()->renameTable($table, $newName)->execute();
          $this->endCommand($time);
      }
docs: Builds and executes a SQL statement for renaming a DB table.
  @param string $table the table to be renamed. The name will be properly quoted by the method.
  @param string $newName the new table name. The name will be properly quoted by the method.