/** * update to 7.1 * - add seq * * @see 0000554: modlog: records can't be updated in less than 1 second intervals */ public function update_0() { $declaration = Tinebase_Setup_Update_Release7::getRecordSeqDeclaration(); try { $this->_backend->addCol('inventory_item', $declaration); } catch (Zend_Db_Statement_Exception $zdse) { // ignore } $this->setTableVersion('inventory_item', 3); Tinebase_Setup_Update_Release7::updateModlogSeq('Inventory_Model_InventoryItem', 'inventory_item'); $this->setApplicationVersion('Inventory', '7.1'); }
/** * update to 7.2 * - add seq * * @see 0000554: modlog: records can't be updated in less than 1 second intervals */ public function update_1() { $declaration = Tinebase_Setup_Update_Release7::getRecordSeqDeclaration(); try { $this->_backend->addCol('felamimail_account', $declaration); } catch (Zend_Db_Statement_Exception $zdse) { // ignore } $this->setTableVersion('felamimail_account', 19); Tinebase_Setup_Update_Release7::updateModlogSeq('Felamimail_Model_Account', 'felamimail_account'); $this->setApplicationVersion('Felamimail', '7.2'); }
/** * update to 7.1 * - add seq * * @see 0000554: modlog: records can't be updated in less than 1 second intervals */ public function update_0() { $declaration = Tinebase_Setup_Update_Release7::getRecordSeqDeclaration(); try { $this->_backend->addCol('metacrm_lead', $declaration); } catch (Zend_Db_Statement_Exception $zdse) { // ignore } $this->setTableVersion('metacrm_lead', 7); Tinebase_Setup_Update_Release7::updateModlogSeq('Crm_Model_Lead', 'metacrm_lead'); $this->setApplicationVersion('Crm', '7.1'); }
/** * update to 7.1 * - add seq * * @see 0000554: modlog: records can't be updated in less than 1 second intervals */ public function update_0() { $declaration = Tinebase_Setup_Update_Release7::getRecordSeqDeclaration(); try { $this->_backend->addCol('projects_project', $declaration); } catch (Zend_Db_Statement_Exception $zdse) { // ignore } $this->setTableVersion('projects_project', 2); Tinebase_Setup_Update_Release7::updateModlogSeq('Projects_Model_Project', 'projects_project'); $this->setApplicationVersion('Projects', '7.1'); }
/** * update to 7.1 * - add seq * * @see 0000554: modlog: records can't be updated in less than 1 second intervals */ public function update_0() { $declaration = Tinebase_Setup_Update_Release7::getRecordSeqDeclaration(); try { $this->_backend->addCol('addressbook', $declaration); } catch (Zend_Db_Statement_Exception $zdse) { // ignore } $this->setTableVersion('addressbook', 17); // update contacts: set max seq from modlog + update modlog Tinebase_Setup_Update_Release7::updateModlogSeq('Addressbook_Model_Contact', 'addressbook'); $this->setApplicationVersion('Addressbook', '7.1'); }
/** * update to 7.1 * - add seq * * @see 0000554: modlog: records can't be updated in less than 1 second intervals */ public function update_0() { $seqModels = array('Timetracker_Model_Timeaccount' => array('name' => 'timetracker_timeaccount', 'version' => 8), 'Timetracker_Model_Timesheet' => array('name' => 'timetracker_timesheet', 'version' => 3)); $declaration = Tinebase_Setup_Update_Release7::getRecordSeqDeclaration(); foreach ($seqModels as $model => $tableInfo) { try { $this->_backend->addCol($tableInfo['name'], $declaration); } catch (Zend_Db_Statement_Exception $zdse) { // ignore } $this->setTableVersion($tableInfo['name'], $tableInfo['version']); Tinebase_Setup_Update_Release7::updateModlogSeq($model, $tableInfo['name']); } $this->setApplicationVersion('Timetracker', '7.1'); }
/** * update to 7.1 * - add seq * * @see 0000554: modlog: records can't be updated in less than 1 second intervals */ public function update_0() { $seqModels = array('HumanResources_Model_Contract' => array('name' => 'humanresources_contract', 'version' => 3), 'HumanResources_Model_Employee' => array('name' => 'humanresources_employee', 'version' => 6), 'HumanResources_Model_FreeTime' => array('name' => 'humanresources_freetime', 'version' => 3), 'HumanResources_Model_WorkingTime' => array('name' => 'humanresources_workingtime', 'version' => 2)); $declaration = Tinebase_Setup_Update_Release7::getRecordSeqDeclaration(); foreach ($seqModels as $model => $tableInfo) { try { $this->_backend->addCol($tableInfo['name'], $declaration); } catch (Zend_Db_Statement_Exception $zdse) { // ignore } $this->setTableVersion($tableInfo['name'], $tableInfo['version']); Tinebase_Setup_Update_Release7::updateModlogSeq($model, $tableInfo['name']); } $this->setApplicationVersion('HumanResources', '7.1'); }
/** * update to 7.1 * - add seq * * @see 0000554: modlog: records can't be updated in less than 1 second intervals */ public function update_0() { $seqModels = array('Sales_Model_Contract' => array('name' => 'sales_contracts', 'version' => 5), 'Sales_Model_Product' => array('name' => 'sales_products', 'version' => 3)); $declaration = Tinebase_Setup_Update_Release7::getRecordSeqDeclaration(); foreach ($seqModels as $model => $tableInfo) { try { $this->_backend->addCol($tableInfo['name'], $declaration); } catch (Zend_Db_Statement_Exception $zdse) { // ignore } $this->setTableVersion($tableInfo['name'], $tableInfo['version']); Tinebase_Setup_Update_Release7::updateModlogSeq($model, $tableInfo['name']); } $this->setApplicationVersion('Sales', '7.1'); }
/** * update to 7.1 * - added seq to modlog * * @see 0000554: modlog: records can't be updated in less than 1 second intervals */ public function update_0() { $declaration = new Setup_Backend_Schema_Field_Xml(' <field> <name>seq</name> <type>integer</type> <length>64</length> <default>0</default> </field> '); try { $this->_backend->addCol('timemachine_modlog', $declaration); } catch (Zend_Db_Statement_Exception $zdse) { // already added $this->_backend->alterCol('timemachine_modlog', $declaration); } // try to drop "timemachine_modlog::application_id--applications::id" if it still exists try { $this->_backend->dropForeignKey('timemachine_modlog', 'timemachine_modlog::application_id--applications::id'); } catch (Zend_Db_Statement_Exception $zdse) { // already dropped } $declaration = new Setup_Backend_Schema_Index_Xml(' <index> <name>unique-fields</name> <unique>true</unique> <field> <name>application_id</name> </field> <field> <name>record_id</name> </field> <field> <name>record_type</name> </field> <field> <name>modification_account</name> </field> <field> <name>modified_attribute</name> </field> <field> <name>modification_time</name> </field> <field> <name>seq</name> </field> </index> '); try { $this->_backend->dropIndex('timemachine_modlog', 'unique-fields'); } catch (Zend_Db_Statement_Exception $zdse) { if (Tinebase_Core::isLogLevel(Zend_Log::NOTICE)) { Tinebase_Core::getLogger()->notice(__METHOD__ . '::' . __LINE__ . ' ' . $zdse->getMessage()); } } $this->_backend->addIndex('timemachine_modlog', $declaration); // add index to seq column $declaration = new Setup_Backend_Schema_Index_Xml(' <index> <name>seq</name> <field> <name>seq</name> </field> </index> '); try { $this->_backend->addIndex('timemachine_modlog', $declaration); } catch (Zend_Db_Statement_Exception $zdse) { // already added } $seqModels = array('Tinebase_Model_Tree_FileObject' => array('name' => 'tree_fileobjects', 'version' => 2), 'Tinebase_Model_Container' => array('name' => 'container', 'version' => 7), 'Tinebase_Model_Department' => array('name' => 'departments', 'version' => 2), 'Tinebase_Model_ImportExportDefinition' => array('name' => 'importexport_definition', 'version' => 6), 'Tinebase_Model_Note' => array('name' => 'notes', 'version' => 2), 'Tinebase_Model_PersistentFilter' => array('name' => 'filter', 'version' => 4), 'Tinebase_Model_PersistentObserver' => array('name' => 'record_observer', 'version' => 3), 'Tinebase_Model_Relation' => array('name' => 'relations', 'version' => 7), 'Tinebase_Model_Tag' => array('name' => 'tags', 'version' => 6)); $declaration = Tinebase_Setup_Update_Release7::getRecordSeqDeclaration(); foreach ($seqModels as $model => $tableInfo) { try { $this->_backend->addCol($tableInfo['name'], $declaration); } catch (Zend_Db_Statement_Exception $zdse) { // ignore } $this->setTableVersion($tableInfo['name'], $tableInfo['version']); Tinebase_Setup_Update_Release7::updateModlogSeq($model, $tableInfo['name']); } $this->setTableVersion('timemachine_modlog', 3); $this->setApplicationVersion('Tinebase', '7.1'); }