function panels_update_5216 in Panels 5.2
Same name and namespace in other branches
- 6.3 panels.install \panels_update_5216()
Adds the 'shown' field to the panels_pane table in order to accomodate the new show/hide panes feature.
File
- ./
panels.install, line 531
Code
function panels_update_5216() {
$ret = array();
switch ($GLOBALS['db_type']) {
case 'mysql':
case 'mysqli':
$ret[] = update_sql("ALTER TABLE {panels_pane} ADD COLUMN shown int(1) DEFAULT 1 AFTER subtype");
$ret[] = update_sql("ALTER TABLE {panels_display} ADD COLUMN title varchar(128) AFTER cache");
$ret[] = update_sql("ALTER TABLE {panels_display} ADD COLUMN hide_title int(1) AFTER title");
$ret[] = update_sql("ALTER TABLE {panels_display} DROP COLUMN name");
$ret[] = update_sql("ALTER TABLE {panels_pane} ADD COLUMN visibility text AFTER access");
break;
case 'pgsql':
db_add_column($ret, 'panels_pane', 'shown', 'tinyint', array(
'default' => 1,
));
db_add_column($ret, 'panels_display', 'title', 'varchar(128)');
db_add_column($ret, 'panels_display', 'hide_title', 'tinyint', array(
'default' => 0,
));
$ret = update_sql("ALTER TABLE {panels_display} DROP name");
db_add_column($ret, 'panels_pane', 'visibility', 'text');
}
return $ret;
}