Skip to content

Database: Alter Column

Matthew McNaney edited this page Mar 17, 2017 · 2 revisions
$db = \phpws2\Database::getDB();
$tbl = $db->addTable('foo');
$newdt = new \phpws2\Database\Datatype\Varchar($tbl, 'no_matter', 5);
$tbl->alter($tbl->getDataType('bar'), $newdt);

Changes foo.bar column into a varchar. Although Datatypes are constructed with titles, it isn't used for alter functions. Use the rename method instead.

Clone this wiki locally