function page_title_update_2 in Page Title 5.2
Changes the page_title column type from TEXT to VARCHAR for PostgreSQL and adds a PRIMARY KEY on (nid).
Implementation of hook_update_N().
File
- ./
page_title.install, line 107 - The Page Title install file, which controls the installation and uninstallation (and updates) of the Page Title module.
Code
function page_title_update_2() {
$ret = array();
switch ($GLOBALS['db_type']) {
case 'pgsql':
db_change_column($ret, 'page_title', 'nid', 'nid', 'int', array(
'not null' => TRUE,
));
db_change_column($ret, 'page_title', 'page_title', 'page_title', 'varchar(255)', array(
'not null' => TRUE,
));
$ret[] = update_sql('ALTER TABLE {page_title} ADD PRIMARY KEY (nid)');
break;
}
return $ret;
}