18 require_once SQ_INCLUDE_PATH.
'/asset_management.inc';
65 'default' =>
'postgres',
74 'type' =>
'serialise',
79 'type' =>
'serialise',
84 'type' =>
'serialise',
89 'type' =>
'serialise',
102 'custom_fields' => Array(
104 'type' =>
'serialise',
105 'default' => Array(),
107 'aggregates' => Array(
109 'type' =>
'serialise',
110 'default' => Array(),
114 'type' =>
'serialise',
115 'default' => Array(),
119 'type' =>
'selection',
120 'parameters' => Array (
122 'builder' =>
'Query Builder',
123 'edit' =>
'Edit Manually',
124 'execute' =>
'Execute',
127 'allow_other' => FALSE,
128 'allow_empty' => FALSE,
130 'default' =>
'builder',
137 'reset_edit' => Array(
146 'parameters' => Array(
147 'allow_empty' => TRUE,
148 'allow_negative' => FALSE,
166 $db =& $GLOBALS[
'SQ_SYSTEM']->db;
169 if (version_compare($current_version,
'0.3',
'<')) {
171 $children = $GLOBALS[
'SQ_SYSTEM']->am->getTypeAssetids(
'data_source_db', FALSE);
173 pre_echo(
'UPGRADING DATA SOURCE DB - FROM VERSION '.$current_version);
176 foreach ($children as $assetid) {
177 $asset =& $GLOBALS[
'SQ_SYSTEM']->am->getAsset($assetid);
178 $sql = $asset->attr(
'sql');
179 if (!$asset->setAttrValue(
'sql', str_replace(
'<br />',
' ', $sql))) {
180 trigger_localised_error(
'CMS0039', E_USER_WARNING,
'0.3');
182 if (!$asset->saveAttributes()) {
183 trigger_localised_error(
'CMS0039', E_USER_WARNING,
'0.3');
186 $GLOBALS[
'SQ_SYSTEM']->am->forgetAsset($asset);
189 pre_echo(
'Upgraded '.$upgraded_count.
' DATA SOURCE DB assets to version 0.3');
193 return parent::_upgrade($current_version);