Skip to content

Commit

Permalink
Fix bad upgrade from 1.x versions.
Browse files Browse the repository at this point in the history
  • Loading branch information
zerocrates committed Feb 19, 2014
1 parent 215eb45 commit a47ddc4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions ItemRelationsPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,15 @@ public function hookUpgrade($args)
(1, 'type', 'Type', 'The nature or genre of the resource.')";
$db->query($sql);
}

if ($oldVersion <= '2.0') {
// Fix un-upgraded old table name if present.
$correctTableName = (bool) $db->fetchOne("SHOW TABLES LIKE '{$db->ItemRelationsRelation}'");
if (!$correctTableName) {
$sql = "RENAME TABLE `{$db->prefix}item_relations_item_relations` TO `{$db->ItemRelationsRelation}`";
$db->query($sql);
}
}
}

/**
Expand Down
2 changes: 1 addition & 1 deletion plugin.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ support_link="http://omeka.org/forums/forum/plugins"
license="GPLv3"
omeka_minimum_version="2.0"
omeka_target_version="2.0"
version="2.0"
version="2.0.1"
tags="item,relation,rdf"

0 comments on commit a47ddc4

Please sign in to comment.