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;
}
CommentFileSizeAuthor
#3 abuse-update_6000-308836-3.patch4.83 KBAgileware
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

BTMash’s picture

Status: Needs review » Needs work

Thanks 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.

jonskulski’s picture

Just 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.

Agileware’s picture

Status: Needs work » Needs review
FileSize
4.83 KB

Here 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

Agileware’s picture

Also, 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.

jcisio’s picture

Thanks, 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.

ebeyrent’s picture

This 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!

jcisio’s picture

Status: Needs review » Reviewed & tested by the community

Marking as RTBC per #6.