Skip to content
This repository has been archived by the owner on Dec 27, 2023. It is now read-only.

Commit

Permalink
fix(Calendar): url field to short
Browse files Browse the repository at this point in the history
* also cleanup branch updatescript mess
  • Loading branch information
corneliusweiss committed Aug 17, 2021
1 parent c91c154 commit 1a7fabc
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 21 deletions.
64 changes: 46 additions & 18 deletions tine20/Calendar/Setup/Update/13.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,44 +12,72 @@
class Calendar_Setup_Update_13 extends Setup_Update_Abstract
{
const RELEASE013_UPDATE001 = __CLASS__ . '::update001';
const RELEASE013_UPDATE002 = __CLASS__ . '::update002';
const RELEASE013_UPDATE002 = __CLASS__ . '::update002'; // burned number @see 14.1
const RELEASE013_UPDATE003 = __CLASS__ . '::update003';
const RELEASE013_UPDATE004 = __CLASS__ . '::update004';


static protected $_allUpdates = [
self::PRIO_NORMAL_APP_STRUCTURE => [
self::RELEASE013_UPDATE002 => [
self::CLASS_CONST => self::class,
self::FUNCTION_CONST => 'update002',
],
],
self::PRIO_NORMAL_APP_UPDATE => [
self::RELEASE013_UPDATE001 => [
self::CLASS_CONST => self::class,
self::FUNCTION_CONST => 'update001',
],
],
self::PRIO_NORMAL_APP_STRUCTURE => [
self::RELEASE013_UPDATE003 => [
self::CLASS_CONST => self::class,
self::FUNCTION_CONST => 'update003',
],
self::RELEASE013_UPDATE004 => [
self::CLASS_CONST => self::class,
self::FUNCTION_CONST => 'update004',
],
],
];

public function update001()
{
$this->addApplicationUpdate('Calendar', '13.0', self::RELEASE013_UPDATE001);
}

public function update002()
public function update003()
{
if (! $this->_backend->columnExists('mute', 'cal_events')) {
$declaration = new Setup_Backend_Schema_Field_Xml('
<field>
<name>mute</name>
<type>boolean</type>
</field>');
$this->_backend->addCol('cal_events', $declaration);
}
if ($this->getTableVersion('cal_events') < 17) {
if (! $this->_backend->columnExists('mute', 'cal_events')) {
$declaration = new Setup_Backend_Schema_Field_Xml('
<field>
<name>mute</name>
<type>boolean</type>
</field>');
$this->_backend->addCol('cal_events', $declaration);
}
$this->setTableVersion('cal_events', 17);
}

$this->setTableVersion('cal_events', 13.1);
$this->addApplicationUpdate('Calendar', '13.1', self::RELEASE013_UPDATE002);
$this->setTableVersion('cal_events', 13.2);
$this->addApplicationUpdate('Calendar', '13.2', self::RELEASE013_UPDATE003);
}

/**
* url field to short
* @throws Setup_Exception_NotFound
*/
public function update004()
{
$this->_backend->alterCol('cal_events', new Setup_Backend_Schema_Field_Xml(
'<field>
<name>url</name>
<type>text</type>
<length>65535</length>
<notnull>false</notnull>
</field>'));

if ($this->getTableVersion('cal_events') < 18) {
$this->setTableVersion('cal_events', 18);
}

$this->addApplicationUpdate('Calendar', '13.3', self::RELEASE013_UPDATE004);
}

}
6 changes: 3 additions & 3 deletions tine20/Calendar/Setup/setup.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
<application>
<name>Calendar</name>
<!-- gettext('Calendar') -->
<version>13.1</version>
<version>13.3</version>
<order>15</order>
<status>enabled</status>
<tables>
<!-- events -->
<table>
<name>cal_events</name>
<version>17</version>
<version>18</version>
<declaration>
<field>
<name>id</name>
Expand Down Expand Up @@ -122,7 +122,7 @@
<field>
<name>url</name>
<type>text</type>
<length>255</length>
<length>65535</length>
<notnull>false</notnull>
</field>
<field>
Expand Down

0 comments on commit 1a7fabc

Please sign in to comment.