When updating from Drupal 5.16 to 6.10, and using MySQL, the database update fails with this error:
# user warning: You can't delete all columns with ALTER TABLE; use DROP TABLE instead query: ALTER TABLE menu_per_role DROP rid in /home/userid/htdocs/dp6devel/includes/database.mysql-common.inc on line 322.
... followed by a sequence of these errors as it tries to write to the modified table:
# user warning: Duplicate entry '0' for key 1 query: INSERT INTO menu_per_role (mlid, rids) VALUES (9, '2') in /home/userid/htdocs/dp6devel/sites/all/modules/menu_per_role/menu_per_role.install on line 85.
In menu_per_role_update_6000(), it looks like you'd want to either delete the two deprecated fields *after* creating the new fields, or simply drop and recreate the table.
Here's a patch that handles the D5->D6 migration -- at least, it yields a table that matches the schema definition. I don't know if this affects anything else, though -- but I hope this helps.
Thanks!
Comment | File | Size | Author |
---|---|---|---|
menu_per_role.install.patch | 909 bytes | jshuster@drupal.org |
Comments
Comment #1
AlexisWilke CreditAttribution: AlexisWilke commentedjshuster,
I applied your fix in the CVS.
PostgreSQL is fine with deleting all the columns... 8-)
Thank you.
Alexis
Comment #2
jshuster@drupal.org CreditAttribution: jshuster@drupal.org commentedAlexis,
My pleasure! Thanks for a most handy module!
- JShuster