$database->renameColumns() method

Rename table columns without changing type

Available since version 3.0.185.

Usage

$int = $database->renameColumns(string $table, array $columns);

Arguments

NameType(s)Description
tablestring
columnsarray

Associative array with one or more of [ 'old_name' => 'new_name' ]

Return value

int

Number of columns renamed

Exceptions

Method can throw exceptions on error:

  • \PDOException


$database methods and properties

API reference based on ProcessWire core version 3.0.244

“The end client and designer love the ease at which they can update the website. Training beyond how to log in wasn’t even necessary since ProcessWire’s default interface is straightforward.” —Jonathan Lahijani