Skip to content

Commit

Permalink
[jan] Fix down migration of database schema.
Browse files Browse the repository at this point in the history
  • Loading branch information
yunosh committed Mar 11, 2016
1 parent 72ce9aa commit 3044491
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
Expand Up @@ -36,8 +36,19 @@ public function up()
*/
public function down()
{
$this->removeIndex('horde_dav_objects', array('id_external', 'id_collection'));
$this->removeIndex('horde_dav_objects', 'id_external');
$indexes = $this->indexes('horde_dav_objects');
$idx_names = array(
$this->indexName(
'horde_dav_objects',
array('column' => array('id_external', 'id_collection'))
),
$this->indexName('horde_dav_objects', 'id_external')
);
foreach ($indexes as $idx) {
if (in_array($idx->name, $idx_names)) {
$this->removeIndex('horde_dav_objects', array('name' => $idx->name));
}
}
$this->addIndex('horde_dav_objects', 'id_external', array('unique' => true));
}
}
4 changes: 2 additions & 2 deletions framework/Dav/package.xml
Expand Up @@ -21,7 +21,7 @@
</stability>
<license uri="http://www.horde.org/licenses/bsd">BSD-2-Clause</license>
<notes>
*
* [jan] Fix down migration of database schema.
</notes>
<contents>
<dir baseinstalldir="/" name="/">
Expand Down Expand Up @@ -856,7 +856,7 @@
<date>2014-12-03</date>
<license uri="http://www.horde.org/licenses/bsd">BSD-2-Clause</license>
<notes>
*
* [jan] Fix down migration of database schema.
</notes>
</release>
</changelog>
Expand Down

0 comments on commit 3044491

Please sign in to comment.