yii\db\QueryBuilder::renameColumn PHP Méthode

renameColumn() public méthode

Builds a SQL statement for renaming a column.
public renameColumn ( string $table, string $oldName, string $newName ) : string
$table string the table whose column is to be renamed. The name will be properly quoted by the method.
$oldName string the old name of the column. The name will be properly quoted by the method.
$newName string the new name of the column. The name will be properly quoted by the method.
Résultat string the SQL statement for renaming a DB column.
    public function renameColumn($table, $oldName, $newName)
    {
        return 'ALTER TABLE ' . $this->db->quoteTableName($table) . ' RENAME COLUMN ' . $this->db->quoteColumnName($oldName) . ' TO ' . $this->db->quoteColumnName($newName);
    }