Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
This function added to abuse.install works for me:
function abuse_update_6100() {
$schema = abuse_schema();
db_add_field($ret, 'abuse_status', 'assigned_to_uid', $schema['abuse_status']['fields']['assigned_to_uid']);
db_add_field($ret, 'abuse_warnings', 'sent_by_uid', $schema['abuse_warnings']['fields']['sent_by_uid']);
db_create_table($ret, 'abuse_status_log', $schema['abuse_status_log']);
return $ret;
}
Comment | File | Size | Author |
---|---|---|---|
#3 | abuse-update_6000-308836-3.patch | 4.83 KB | Agileware |
Comments
Comment #1
BTMash CreditAttribution: BTMash commentedThanks for planning out this update.
There were some other changes I had also made - one specifically being that the object ids (oid) being autoincrementing IDs...I need to figure out the full list of changes in the schema so I can get it.
Thanks for taking this initiative.
Comment #2
jonskulski CreditAttribution: jonskulski commentedJust dropping by to say that after a 5.x->6.x upgrade, the abuse module was throwing SQL errors (because of no table upgrade path).
Applied this patch and reran upgrade and fixed all the SQL errors that I saw (basic functionality).
If I run into any more errors, I'll post back with a patch, but including this as a start seems like a good idea: it will take care of the base 5.x -> 6.x upgrade. As far as I can tell.
Comment #3
Agileware CreditAttribution: Agileware commentedHere is a more thorough attempt.
It addresses the new table, new columns, new indexes, column changes where the column length has changed and column changes where int was changed to serial.
- I know it is not exactly related to this issue but it also removes the unsigned attribute for serial column definitions as it is not used for those. Feel free to pull that out if you want it in a separate issue.
I rolled the patch against 6.x-1.1-alpha1 but I think it probably should be ok for dev too.
- Also, I notice that updates that were in the drupal 5 version are no longer in the drupal 6 version.
So maybe an implementation of hook_update_last_removed() should also be added too. - http://api.drupal.org/api/function/hook_update_last_removed/6
Comment #4
Agileware CreditAttribution: Agileware commentedAlso, the adding of the index on uid of the abuse table seemed necessary from looking at the 5.x .install file but my D5 install already had this index somehow.
So that line might need to be removed from this patch.
Comment #5
jcisio CreditAttribution: jcisio commentedThanks, Agileware.
- The patch looks good to me
- Yes, I'd like we leave the 'unsigned' parts intact in this issue.
- About indexes of uid etc., it's correct to add them. They are not in D5. Maybe some db tuner has added them.
- And yes, should add a hook_update_last_removed to return '2'.
They are just minor changes. Anyone can test this patch? I think I need at least one confirm to commit.
Comment #6
ebeyrent CreditAttribution: ebeyrent commentedThis worked perfectly for me. I applied the patch and ran the update with no errors. This solved some errors I was previously getting in watchdog. Nice work!
Comment #7
jcisio CreditAttribution: jcisio commentedMarking as RTBC per #6.