upgrade from 5.x to 6.x missing indexes update
alexkb - August 6, 2009 - 05:49
| Project: | E-Publish |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | alexkb |
| Status: | active |
Description
We recently did an upgrade from 5 to 6, and ran into some issues with creating new editions, due to the various epublish database tables not being setup for auto increment. We made the changes direct to the database, but I've included some code below (for epublsh/epublish.install) that has been tested to work on our testing enviornment too:
<?php
function epublish_update_6001() {
$ret = array();
db_drop_primary_key($ret, 'epublish_edition');
db_drop_index($ret, 'epublish_edition', 'pid');
db_change_field($ret, 'epublish_edition', 'eid', 'eid', array('type' => 'serial', 'not null' => TRUE), array('primary key' => array('eid')));
// perhaps add 'indexes' => array('pid' => 'pid') to the end there, not sure on exact syntax.
db_drop_primary_key($ret, 'epublish_publication');
db_change_field($ret, 'epublish_publication', 'pid', 'pid', array('type' => 'serial', 'not null' => TRUE), array('primary key' => array('pid')));
db_drop_primary_key($ret, 'epublish_section');
db_change_field($ret, 'epublish_section', 'sid', 'sid', array('type' => 'serial', 'not null' => TRUE), array('primary key' => array('sid')));
return $ret;
}
?>Could someone else please test and have the maintainers commit to help others, thanks.

#1
Submitting patch for testing...
#2
I just took over this module... After doing a CVS checkout, I got version 5.x as the current HEAD version. Is this how it has been? If so, does the code you supplied need to be committed to version 5.x? I tried adding the code to 6.x and applying the updates but I got nothing but "red" on the screen (errors/failures).
Also, (FYI) I'm going to release a 6.x-2.0 version very soon -- if you use this module frequently I'd appreciate the feedback when I do release it.
-jer
#3
Hey Jer, thanks for creating the patch and testing the mods out.
Did you want to paste the error's here, so they can be troubleshot, or have you already worked it out. The patch is only for the drupal 6 version of the epublish module. I'd be happy to test this out more for you if you like and commit things back - could I perhaps become a co-maintainer ?
Yes, we'll give the 2.0 version a try when its released, thanks!
#4
Hey I appreciate the offer... Actually, I think that would be great (especially because it sounds like you've been using the module for a while so you're probably more familiar with it than me). I looked at your other commits and they appear to all follow the Drupal coding standards (always a "plus") :) so as long as you keep that up I'd be glad to have you as a co-maintainer.
#5
#6
+1 to new maintainer! big welcome to Jeremy. this project seemed semi-neglected for some time.
#7
Hey guys, thanks for letting the co-maintainer privileges. I've done some testing and made some tweaks to ensure it works properly now. The changes have been committed to cvs. I've also included a Patch of the particular changes if people want to apply it separately. I'll let Jeremy roll the commit's into a release when he's ready. Cheers!