google_appliance_update_1 should be renamed to google_appliance_update_6201

larskleiner - July 23, 2009 - 08:57
Project:Google Search Appliance
Version:6.x-2.x-dev
Component:Code
Category:task
Priority:normal
Assigned:larskleiner
Status:closed
Description

google_appliance_update_1 should be renamed to google_appliance_update_6201, see http://api.drupal.org/api/function/hook_update_N/6.

#1

larskleiner - July 23, 2009 - 09:17

Patch rolled against 6.x-2.x-dev.

AttachmentSize
528428-google-appliance-drupal-6.patch 605 bytes

#2

larskleiner - July 23, 2009 - 09:18
Status:active» needs review

#3

jweowu - July 26, 2009 - 22:32
Status:needs review» reviewed & tested by the community

Tested Drupal 5 with google_appliance upgraded to Drupal 6.

update.php picked out the 6201 update:

The following queries were executed
google_appliance module
Update #6201

* variable_set(google_appliance_debug)
* variable_del(google_debug)
* variable_set(google_appliance_default_client)
* variable_del(google_appliance_client)
* variable_set(google_appliance_default_collection)
* variable_del(google_appliance_collection)
* ALTER TABLE {cache_google} ADD INDEX cid (cid)
* ALTER TABLE {cache_google} RENAME TO {cache_google_appliance}

#4

jweowu - July 27, 2009 - 00:44

We should incorporate coltrane's patch from http://drupal.org/node/385162

Otherwise the Drupal 5 update is broken.

That patch no longer applies, so I've rolled it into a new version of this one.

I've tested it on a Drupal 5 upgrade:

The following queries were executed
google_appliance module
Update #6000

* ALTER TABLE {cache_google} ADD `serialized` SMALLINT NOT NULL DEFAULT 0

Update #6201

* variable_set(google_appliance_debug)
* variable_del(google_debug)
* variable_set(google_appliance_default_client)
* variable_del(google_appliance_client)
* variable_set(google_appliance_default_collection)
* variable_del(google_appliance_collection)
* ALTER TABLE {cache_google} ADD INDEX cid (cid)
* ALTER TABLE {cache_google} RENAME TO {cache_google_appliance}

AttachmentSize
google-appliance-install-drupal-6.patch 620 bytes

#5

larskleiner - July 27, 2009 - 09:52

Thanks for testing, I commited my patch from above.

I'm not sure why you want to add the serialized column in an update, it's already part of the new cache_google_appliance schema. Wouldn't this be good enough to not break the D5 upgrade?

#6

jweowu - July 28, 2009 - 01:45

No, the schema function is only ever used when installing the module for the very first time. When upgrading the module (whether between 6.x releases, or upgrading from 5.x) that schema function isn't touched, because the module already exists in the system table.

The update hooks therefore need to make the necessary changes to make the existing tables match the latest schema, in any update situation.

People who started with 6.x-2.x will have this column, but users upgrading from Drupal 5 will not. The 60xx updates are explicitly for upgrading from a previous major version of Drupal, so update 6000 is ignored for users who started out with the original 6.x-2.x-dev (only update 6201 will be executed in their case).

edit: d'oh. I originally said the 6x00 updates were for updating from an earlier drupal, when I meant to say the 60xx updates.

#7

larskleiner - July 28, 2009 - 08:50
Status:reviewed & tested by the community» closed

I see your point, thanks. I committed a revised patch so that it doesn't conflict with my patch from above.

 
 

Drupal is a registered trademark of Dries Buytaert.