Skip to content

Commit

Permalink
tweak(TB Setup) fix upgrade path re numberables
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmhh committed Dec 10, 2024
1 parent 2857667 commit 41203d1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tine20/Sales/Setup/Update/17.php
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,8 @@ public function update009()

$numConf = Tinebase_Controller_NumberableConfig::getInstance()->search(
Tinebase_Model_Filter_FilterGroup::getFilterForModel(Tinebase_Model_NumberableConfig::class, [
[TMFA::FIELD => Tinebase_Model_NumberableConfig::FLD_BUCKET_KEY, TMFA::OPERATOR => TMFA::OP_EQUALS, TMFA::VALUE => Sales_Model_Customer::class . '#number']
[TMFA::FIELD => Tinebase_Model_NumberableConfig::FLD_MODEL, TMFA::OPERATOR => TMFA::OP_EQUALS, TMFA::VALUE => Sales_Model_Customer::class],
[TMFA::FIELD => Tinebase_Model_NumberableConfig::FLD_PROPERTY, TMFA::OPERATOR => TMFA::OP_EQUALS, TMFA::VALUE => 'number']
]))->getFirstRecord();

$numConf->{Tinebase_Model_NumberableConfig::FLD_ZEROFILL} = 0;
Expand Down
6 changes: 6 additions & 0 deletions tine20/Tinebase/Setup/Update/17.php
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,12 @@ public function update015(): void
Tinebase_TransactionManager::getInstance()->rollBack();

$backend = Tinebase_Controller_NumberableConfig::getInstance()->getBackend();
if (!$this->_backend->tableExists($backend->getTableName())) {
$this->updateSchema(Tinebase_Config::APP_NAME, [
Tinebase_Model_NumberableConfig::class,
]);
}

$this->_db->query('UPDATE ' . $backend->getTablePrefix() . $backend->getTableName() . ' SET deleted_time = "1970-01-01 00:00:00" WHERE deleted_time IS NULL');
$this->_db->query('DELETE FROM ' . $backend->getTablePrefix() . $backend->getTableName() . ' WHERE model = "MeetingManager_Model_Top" AND property = "decision_number"');

Expand Down

0 comments on commit 41203d1

Please sign in to comment.