function alinks_update_3 in Alinks 7
Same name and namespace in other branches
- 6 alinks.install \alinks_update_3()
File
- ./
alinks.install, line 119 - Install, update and uninstall functions for the Alinks module.
Code
function alinks_update_3() {
$ret = array();
switch ($GLOBALS['db_type']) {
case 'pgsql':
db_add_column($ret, 'alinks', 'alink_external', 'TINYINT(1)', array(
'DEFAULT' => 0,
));
db_add_column($ret, 'alinks', 'alink_class', 'VARCHAR(255)', array(
'DEFAULT' => 'alinks-link',
));
db_add_column($ret, 'alinks', 'alink_weight', 'INT(3)', array(
'DEFAULT' => 0,
));
break;
case 'mysql':
case 'mysqli':
$ret[] = update_sql("ALTER TABLE {alinks} ADD COLUMN alink_external TINYINT(1) NOT NULL DEFAULT 0 AFTER alink_end_boundary");
$ret[] = update_sql("ALTER TABLE {alinks} ADD COLUMN alink_class VARCHAR(255) NOT NULL DEFAULT 'alinks-link' AFTER alink_external");
$ret[] = update_sql("ALTER TABLE {alinks} ADD COLUMN alink_weight INT(3) NOT NULL DEFAULT 0 AFTER alink_class");
break;
}
return $ret;
}