Provide schema update for changed primary key
Junyor - April 12, 2008 - 21:23
| Project: | Path Redirect |
| Version: | 5.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Description
The Drupal 5.x version of Path Redirect uses path as the primary key and rid as a unique key. Drupal 6.x, however does the opposite and there doesn't seem to be any update that makes this change.

#1
Good catch. Here are patches for 5.x and 6.x. I tested in both MySQL and Postgres the upgrades from 5.x-1.1 to 5.x-1.x-dev and from 5.x-1.1 to 6.x-1.x-dev, so I'm fairly confident that they're working well.
#2
Committed. Titled changed because this actually applies to 5.x independent of 6.x. Patch for 5.x above didn't include an updated
hook_install, but I fixed that and committed it. Thanks again for spotting the problem!#3
I'm not sure the committed fix will work for existing users. For instance, what if a user upgrades to 6.x without first upgrading to the latest 5.x? And what if the user has already run update #4?
#4
If a user upgrades from any 5.x release (i.e. non-dev-version) to 6.x, the 6.x installer has the same update functions that the 5.x branch has, only rewritten for the 6.x API. If a user has already run update 4 because they were running a dev version, they presumably know how to deal with that:
UPDATE {system} SET schema_version = 3 WHERE name = 'path_redirect'Then run update.php, and you'll get the necessary updates. As far as I understand, upgrading from dev versions is not something that needs to be explicitly supported. That said, since we've had this dev version sitting around for quite some time, it might make sense to add another update function; I'm just not (yet) convinced it's necessary.
I have some more patches to port to 6.x before releasing it, anyway, and I'll make sure to test the upgrade paths before I do.
#5
Got it. I'll run the update manually.
#6
Automatically closed -- issue fixed for two weeks with no activity.