Jump to:
| Project: | Menu per Role |
| Version: | 6.x-1.2 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
Issue Summary
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!
| Attachment | Size |
|---|---|
| menu_per_role.install.patch | 909 bytes |
Comments
#1
jshuster,
I applied your fix in the CVS.
PostgreSQL is fine with deleting all the columns... 8-)
Thank you.
Alexis
#2
Alexis,
My pleasure! Thanks for a most handy module!
- JShuster
#3
Automatically closed -- issue fixed for 2 weeks with no activity.