rename this table
@param string $new_name
@param bool $exec
@return $this|bool
760698
public function rename($new_name, $exec = true) {
        $query = $this->schema->renameTable($this->name, $new_name, $exec);
        $this->name = $new_name;
        return ($exec) ? $this : $query;
    }
771960
public boolean renameColumn (Connection conn, String table, String from, String to,
                                 ColumnDefinition newColumnDef) throws SQLException
    {
        executeQuery(conn, "ALTER TABLE " + tableSQL(table) + " RENAME COLUMN " +
                     columnSQL(from) + " TO " + columnSQL(to));
        log("Renamed column '" + from + "' on table '" + table + "' to '" + to + "'");
        return true;
    }
804822
public function renameTable(string $from, string $to): bool
    {
        $from = $this->quoter->quoteName($from);
        $to = $this->quoter->quoteName($to);
        $this->db->exec(sprintf('RENAME TABLE %s TO %s;', $from, $to));

        return true;
    }
1240339
public function renameName($nameIndex, $newName)
    {
        foreach ($this->lines as $line) {
            $line->renameName($nameIndex, $newName);
        }
    }
1287456
public function renameColumn($oldName, $newName)
    {
        $action = RenameColumn::build($this->table, $oldName, $newName);
        $this->actions->addAction($action);

        return $this;
    }
180168
public function rename($newName, $returnNew = true)
    {
        if ($this->db->getDatabase()->getName() == $this->getName()) {
            $this->db->disconnect();
            $this->db->setDatabaseName(null);
        }

        $pid = version_compare($this->db->getVersion(), '9.2', '>=') ? 'pid' : 'procpid';

        $query = $this->db->getQuery(true);

        $query->select('pg_terminate_backend(' . $pid . ')')
            ->from('pg_stat_activity')
            ->where('datname = ' . $query->quote($this->getName()));

        $this->db->setQuery($query)->execute();

        $query = sprintf(
            'ALTER DATABASE %s RENAME TO %s',
            $this->db->quoteName($this->getName()),
            $this->db->quoteName($newName)
        );

        $this->db->setQuery($query)->execute();

        if ($returnNew) {
            return $this->db->getDatabase($newName)->select();
        }

        return $this;
    }
677071
public function renameFile(FileInfo $fileInfo, $new_file_name)
    {
        try {
            $this->validateFile($fileInfo, $new_file_name);
            $fm = new Filesystem();
            $old_file = $fileInfo->getFilepath(true);
            $new_file = $new_file_name;
            $fm->rename($old_file, $new_file);
        } catch (\Exception $e) {
            $this->getFileManager()->throwError("Cannot rename file or directory", 500, $e);
        }
    }
1248278
public function renameColumn(string $column, string $name): AbstractTable
    {
        if (!$this->hasColumn($column)) {
            throw new SchemaException("Undefined column '{$column}' in '{$this->getName()}'");
        }

        //Rename operation is simple about declaring new name
        $this->column($column)->setName($name);

        return $this;
    }
821631
public function renameField($tableName, $oldName, $newName)
    {
        $fieldList = $this->fieldList($tableName);
        if (array_key_exists($oldName, $fieldList)) {
            $this->query("ALTER TABLE \"$tableName\" CHANGE \"$oldName\" \"$newName\" " . $fieldList[$oldName]);
        }
    }
692454
public function rename($newName, $returnNew = true)
    {
        // Mysql 5.1.7 do not have RENAME DATABASE syntax anymore, so we use rename tables to do that.
        // @see: http://stackoverflow.com/questions/67093/how-do-i-quickly-rename-a-mysql-database-change-schema-name?page=1&tab=votes#tab-top
        $newDatabase = $this->db->getDatabase($newName)->create();

        $tables = $this->db->getReader(MysqlGrammar::showDbTables($this->name))->loadObjectList();

        foreach ($tables as $table) {
            $name = $table->Name;

            $this->db->setQuery(
                sprintf(
                    'RENAME TABLE %s.%s TO %s.%s',
                    $this->db->quoteName($this->name),
                    $this->db->quoteName($name),
                    $this->db->quoteName($newName),
                    $this->db->quoteName($name)
                )
            )->execute();
        }

        $this->drop(true);

        if ($returnNew) {
            return $newDatabase;
        }

        return $this;
    }
1222591
public function rename($newpath)
    {
        if ($this->filesystem->rename($this->path, $newpath)) {
            $this->path = $newpath;

            return true;
        }

        return false;
    }
1145082
public static function rename($table, $new_name)
	{
		$table = new Table($table);

		// To indicate that the table needs to be renamed, we will run the
		// "rename" command on the table instance and pass the instance to
		// the execute method as calling a Closure isn't needed.
		$table->rename($new_name);

		return static::execute($table);
	}
385312
public function truncateTable($name, $exec = true) {
        if (is_object($name) && $name instanceof TableBuilder)
            $name = $name->name;
        $cmd = array(
            'mysql|ibm|pgsql|sybase|dblib|mssql|sqlsrv|odbc' =>
                'TRUNCATE TABLE '.$this->db->quotekey($name).';',
            'sqlite2?' => array(
                'DELETE FROM '.$this->db->quotekey($name).';',
//                'UPDATE SQLITE_SEQUENCE SET seq = 0 WHERE name = '.$this->db->quotekey($name).';',
            ),
        );
        $query = $this->findQuery($cmd);
        return ($exec) ? $this->db->exec($query) : $query;
    }
339733
public function renameColumn($oldName, $newName)
    {
        foreach ($this->rows as $row) {
            $row->renameColumn($oldName, $newName);

            $subTable = $row->getSubtable();
            if ($subTable) {
                $subTable->renameColumn($oldName, $newName);
            }
        }
        if (!is_null($this->summaryRow)) {
            $this->summaryRow->renameColumn($oldName, $newName);
        }
        if (!is_null($this->totalsRow)) {
            $this->totalsRow->renameColumn($oldName, $newName);
        }
    }
88886
public function renameColumn($oldName, $newName)
    {
        foreach ($this->getDataTables() as $table) {
            $table->renameColumn($oldName, $newName);
        }
    }
804131
function _rename(){
    self._visitingAlter = true;
    var table = self._queryNode.table;
    var result = ['EXEC sp_rename '+self.visit(table.toNode())+', '+self.visit(alter.nodes[0].nodes[0])];
    self._visitingAlter = false;
    return result;
  }
251469
public function update($new_instance, $old_instance)
    {
        $instance = [];
        $instance['title'] = ( ! empty($new_instance['title']) ) ? \strip_tags($new_instance['title']) : '';
        $instance['show_parent'] = ( ! empty($new_instance['show_parent']) ) ? true : false;
        return $instance;
    }