Hello!
I need some clarification on D6 behavior with hook_install(), hook_update() and hook_schema().
This is my question within a simple use case:
When I write a module, I implement hook_schema(). I then do a hook_install() which call drupal_install_schema() function.
Then ok, it works.
BUT, then I have to add a single field to my database. So, I write a hook_update_N() and use drupal_add_field().
Ok, this works.
The question is: do I have to modify my hook_schema so it carries the new field or not ? When a new user will install the module, does drupal just assume that the schema is up to date then it does not need to do the updates ?
Simple question. It was this behavior with D5, but I'm not sure with D6.
Thanks.
Quoting Pierre Rineau pierre.rineau@makina-corpus.com:
The question is: do I have to modify my hook_schema so it carries the new field or not ?
Yes, hook_schema needs updated.
When a new user will install the module, does drupal just assume that the schema is up to date then it does not need to do the updates ?
Yes, no updates are run on new install.
Simple question. It was this behavior with D5, but I'm not sure with D6.
AFAIK, there is no change to this in D7 as well.
Earnie -- http://for-my-kids.com/ -- http://give-me-an-offer.com/
On Monday 13 October 2008 6:16:22 am Earnie Boyd wrote:
Quoting Pierre Rineau pierre.rineau@makina-corpus.com:
The question is: do I have to modify my hook_schema so it carries the new field or not ?
Yes, hook_schema needs updated.
When a new user will install the module, does drupal just assume that the schema is up to date then it does not need to do the updates ?
Yes, no updates are run on new install.
Simple question. It was this behavior with D5, but I'm not sure with D6.
AFAIK, there is no change to this in D7 as well.
Yet. :-)